FactDev  0.1
projectcombodelegate.h
1 #ifndef PROJECTCOMBODELEGATE_H
2 #define PROJECTCOMBODELEGATE_H
3 
4 #include "models/project.h"
5 #include "gui/widgets/delegates/comboboxdelegate.h"
6 namespace Gui {
7 namespace Widgets {
8 namespace Delegates {
9 
14 {
15 Q_OBJECT
16 public:
22  ProjectComboDelegate(QSharedPointer<Models::Customer> c, QObject* parent=0);
23 
33  QWidget *createEditor(QWidget *parent,
34  const QStyleOptionViewItem &option,
35  const QModelIndex &index) const;
36 
45  void paint(QPainter *painter,
46  const QStyleOptionViewItem &option,
47  const QModelIndex &index) const;
48 
53  void removeInCombo(QList<int>&l);
54 
60  QMap<int, Models::Project> getProjects() const;
61 
67  bool isLocked() const;
68 
74  void setLocked(bool locked);
75 
76 private:
77  QMap<int, Models::Project> _projects;
79  QList<int> _removeInCombo;
80  bool _locked;
81 };
82 }
83 }
84 }
85 #endif // PROJECTCOMBODELEGATE_H
ProjectComboDelegate(QSharedPointer< Models::Customer > c, QObject *parent=0)
ProjectComboDelegate::ProjectComboDelegate.
Definition: projectcombodelegate.cpp:7
void setLocked(bool locked)
ProjectComboDelegate::setLocked Change the state of the lock by a new value locked ...
Definition: projectcombodelegate.cpp:63
bool isLocked() const
ProjectComboDelegate::isLocked Return TRUE if is locked else FALSE.
Definition: projectcombodelegate.cpp:68
void removeInCombo(QList< int > &l)
ProjectComboDelegate::removeInCombo Remove the items contained in the list l into the current ComboBo...
Definition: projectcombodelegate.cpp:54
The ProjectComboDelegate class.
Definition: projectcombodelegate.h:13
QWidget * createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const
ProjectComboDelegate:createEditor Return a ComboBox specified by index item defined by the parent wid...
Definition: projectcombodelegate.cpp:16
QMap< int, Models::Project > getProjects() const
ProjectComboDelegate::getProjects Return a list of projects linked to a Customer ID.
Definition: projectcombodelegate.cpp:58
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
ProjectComboDelegate::paint Renders the delegate using the given painter and style option for the ite...
Definition: projectcombodelegate.cpp:39
The ComboBoxDelegate class.
Definition: comboboxdelegate.h:15