Changeset View
Changeset View
Standalone View
Standalone View
src/editors/linestyleedit.h
Show All 14 Lines | 1 | /* This file is part of the KDE project | |||
---|---|---|---|---|---|
15 | along with this library; see the file COPYING.LIB. If not, write to | 15 | along with this library; see the file COPYING.LIB. If not, write to | ||
16 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 16 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||
17 | * Boston, MA 02110-1301, USA. | 17 | * Boston, MA 02110-1301, USA. | ||
18 | */ | 18 | */ | ||
19 | 19 | | |||
20 | #ifndef KPROPERTY_LINESTYLEEDIT_H | 20 | #ifndef KPROPERTY_LINESTYLEEDIT_H | ||
21 | #define KPROPERTY_LINESTYLEEDIT_H | 21 | #define KPROPERTY_LINESTYLEEDIT_H | ||
22 | 22 | | |||
23 | #include "KPropertyFactory.h" | 23 | #include "KPropertyWidgetsFactory.h" | ||
24 | #include "KPropertyLineStyleSelector_p.h" | 24 | #include "KPropertyLineStyleSelector_p.h" | ||
25 | 25 | | |||
26 | //! Line style combo box (Property::LineStyle, equivalent of Qt::PenStyle) | 26 | //! Line style combo box (Property::LineStyle, equivalent of Qt::PenStyle) | ||
27 | //! @todo enable transparency selection | 27 | //! @todo enable transparency selection | ||
28 | //! @todo add transparency option | 28 | //! @todo add transparency option | ||
29 | //! @todo reimplement view using KColorCells | 29 | //! @todo reimplement view using KColorCells | ||
30 | class KPROPERTY_EXPORT KPropertyLineStyleComboEditor : public KPropertyLineStyleSelector | 30 | class KPROPERTYWIDGETS_EXPORT KPropertyLineStyleComboEditor : public KPropertyLineStyleSelector | ||
31 | { | 31 | { | ||
32 | Q_OBJECT | 32 | Q_OBJECT | ||
33 | Q_PROPERTY(QVariant value READ value WRITE setValue USER true) | 33 | Q_PROPERTY(QVariant value READ value WRITE setValue USER true) | ||
34 | 34 | | |||
35 | public: | 35 | public: | ||
36 | explicit KPropertyLineStyleComboEditor(QWidget *parent = 0); | 36 | explicit KPropertyLineStyleComboEditor(QWidget *parent = 0); | ||
37 | 37 | | |||
38 | ~KPropertyLineStyleComboEditor(); | 38 | ~KPropertyLineStyleComboEditor(); | ||
39 | 39 | | |||
40 | QVariant value() const; | 40 | QVariant value() const; | ||
41 | 41 | | |||
42 | Q_SIGNALS: | 42 | Q_SIGNALS: | ||
43 | void commitData(QWidget * editor); | 43 | void commitData(QWidget * editor); | ||
44 | 44 | | |||
45 | public Q_SLOTS: | 45 | public Q_SLOTS: | ||
46 | void setValue(const QVariant &value); | 46 | void setValue(const QVariant &value); | ||
47 | 47 | | |||
48 | protected Q_SLOTS: | 48 | protected Q_SLOTS: | ||
49 | void slotValueChanged(int index); | 49 | void slotValueChanged(int index); | ||
50 | }; | 50 | }; | ||
51 | 51 | | |||
52 | class KPROPERTY_EXPORT KPropertyLineStyleComboDelegate : public KPropertyEditorCreatorInterface, | 52 | class KPROPERTYWIDGETS_EXPORT KPropertyLineStyleComboDelegate : public KPropertyEditorCreatorInterface, | ||
53 | public KPropertyValuePainterInterface | 53 | public KPropertyValuePainterInterface | ||
54 | { | 54 | { | ||
55 | public: | 55 | public: | ||
56 | KPropertyLineStyleComboDelegate() {options.removeBorders = false;} | 56 | KPropertyLineStyleComboDelegate() {options.removeBorders = false;} | ||
57 | 57 | | |||
58 | virtual QWidget * createEditor( int type, QWidget *parent, | 58 | virtual QWidget * createEditor( int type, QWidget *parent, | ||
59 | const QStyleOptionViewItem & option, const QModelIndex & index ) const; | 59 | const QStyleOptionViewItem & option, const QModelIndex & index ) const; | ||
60 | 60 | | |||
61 | virtual void paint( QPainter * painter, | 61 | virtual void paint( QPainter * painter, | ||
62 | const QStyleOptionViewItem & option, const QModelIndex & index ) const; | 62 | const QStyleOptionViewItem & option, const QModelIndex & index ) const; | ||
63 | }; | 63 | }; | ||
64 | 64 | | |||
65 | #endif | 65 | #endif |