Scribus
Open source desktop publishing at your fingertips
guidesdelegate.h
1 /*
2 For general Scribus (>=1.3.2) copyright and licensing information please refer
3 to the COPYING file provided with the program. Following this notice may exist
4 a copyright and/or license notice that predates the release of Scribus 1.3.2
5 for which a new license (GPL+exception) is in place.
6 */
7 #ifndef GUIDESDELEGATE_H
8 #define GUIDESDELEGATE_H
9 
10 #include <QItemDelegate>
11 
12 class ScribusDoc;
13 
14 
20 class GuidesDelegate : public QItemDelegate
21 {
22  Q_OBJECT
23 
24  public:
25  GuidesDelegate(QObject *parent = 0);
26 
27 // implemented in inheritance
28 // QWidget *createEditor(QWidget *parent,
29 // const QStyleOptionViewItem &option,
30 // const QModelIndex &index) const;
31 
32  void setEditorData(QWidget *editor, const QModelIndex &index) const;
33 
34  void setModelData(QWidget *editor,
35  QAbstractItemModel *model,
36  const QModelIndex &index) const;
37 
38  void updateEditorGeometry(QWidget *editor,
39  const QStyleOptionViewItem &option,
40  const QModelIndex &index) const;
41 
42  void unitChange(int docUnitDecimals);
43  void setDoc(ScribusDoc * doc);
44 
45  // protected due const in createEditor
46  protected:
47  ScribusDoc *m_doc;
48 };
49 
50 
55 {
56  Q_OBJECT
57 
58  public:
59  GuidesHDelegate(QObject *parent = 0);
60 
61  QWidget *createEditor(QWidget *parent,
62  const QStyleOptionViewItem &option,
63  const QModelIndex &index) const;
64 };
65 
66 
71 {
72  Q_OBJECT
73 
74  public:
75  GuidesVDelegate(QObject *parent = 0);
76 
77  QWidget *createEditor(QWidget *parent,
78  const QStyleOptionViewItem &option,
79  const QModelIndex &index) const;
80 };
81 
82 #endif
A delegate for vertical guides model/view. Limit guides for page width.
Definition: guidesdelegate.h:70
the Document Class
Definition: scribusdoc.h:90
A delegate/editor for guides model. It's based on the ScrSpinBox widget. User cannot enter any others...
Definition: guidesdelegate.h:20
A delegate for horizontal guides model/view. Limit guides for page height.
Definition: guidesdelegate.h:54