00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef KPTWBSDEFINITIONPANEL_H
00021 #define KPTWBSDEFINITIONPANEL_H
00022
00023 #include "ui_kptwbsdefinitionpanelbase.h"
00024
00025 #include <QItemDelegate>
00026 #include <QWidget>
00027
00028 class KMacroCommand;
00029
00030 namespace KPlato
00031 {
00032
00033 class Part;
00034 class WBSDefinition;
00035
00036 class ComboBoxDelegate : public QItemDelegate
00037 {
00038 Q_OBJECT
00039 public:
00040 ComboBoxDelegate(QStringList &list, QObject *parent = 0);
00041
00042 QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option,
00043 const QModelIndex &index) const;
00044
00045 void setEditorData(QWidget *editor, const QModelIndex &index) const;
00046 void setModelData(QWidget *editor, QAbstractItemModel *model,
00047 const QModelIndex &index) const;
00048
00049 void updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &index) const;
00050 private:
00051 QStringList m_list;
00052 };
00053
00054
00055 class WBSDefinitionPanel : public QWidget, public Ui_WBSDefinitionPanelBase {
00056 Q_OBJECT
00057 public:
00058 WBSDefinitionPanel(WBSDefinition &def, QWidget *parent=0, const char *name=0);
00059
00060 KMacroCommand *buildCommand(Part *part);
00061
00062 bool ok();
00063
00064 void setStartValues(Part *part);
00065
00066 signals:
00067 void changed(bool enable);
00068
00069 protected slots:
00070 void slotChanged();
00071 void slotSelectionChanged();
00072 void slotRemoveBtnClicked();
00073 void slotAddBtnClicked();
00074 void slotLevelChanged(int);
00075 void slotLevelsGroupToggled(bool on);
00076 private:
00077 int selectedRow;
00078 WBSDefinition &m_def;
00079 };
00080
00081 }
00082
00083 #endif // WBSDEFINITIONPANEL_H