File indexing completed on 2024-04-28 07:39:20
0001 /* 0002 SPDX-FileCopyrightText: 2007 Frederik Gladhorn <frederik.gladhorn@kdemail.net> 0003 SPDX-License-Identifier: GPL-2.0-or-later 0004 */ 0005 0006 #ifndef CONTAINERVIEW_H 0007 #define CONTAINERVIEW_H 0008 0009 #include <QTreeView> 0010 0011 class KEduVocContainer; 0012 0013 class ContainerModel; 0014 0015 /** 0016 * View for containers (KEduVocContainer). 0017 * @author Frederik Gladhorn <frederik.gladhorn@kdemail.net> 0018 */ 0019 class ContainerView : public QTreeView 0020 { 0021 Q_OBJECT 0022 public: 0023 /** Set up the lesson list widget. 0024 * Also creates the menu to manipulate the lessons. 0025 * @param parent parent widget */ 0026 explicit ContainerView(QWidget *parent = nullptr); 0027 /** Set the model for the view. 0028 * @param model the model */ 0029 virtual void setModel(ContainerModel *model); 0030 0031 public Q_SLOTS: 0032 /** let the user type a new name for the container */ 0033 void slotRename(); 0034 0035 protected: 0036 /** ContainerModel for this view. */ 0037 ContainerModel *m_model; 0038 0039 private: 0040 // intentionally hide this to make sure a proper model is passed 0041 void setModel(QAbstractItemModel *model) override 0042 { 0043 Q_UNUSED(model) 0044 } 0045 }; 0046 0047 #endif