Changeset View
Changeset View
Standalone View
Standalone View
src/editors/coloredit.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_COLOREDIT_H | 20 | #ifndef KPROPERTY_COLOREDIT_H | ||
21 | #define KPROPERTY_COLOREDIT_H | 21 | #define KPROPERTY_COLOREDIT_H | ||
22 | 22 | | |||
23 | #include "KPropertyFactory.h" | 23 | #include "kpropertywidgets_export.h" | ||
24 | #include "KPropertyWidgetsFactory.h" | ||||
24 | #include <KColorCombo> | 25 | #include <KColorCombo> | ||
25 | 26 | | |||
26 | //! Color combo box | 27 | //! Color combo box | ||
27 | //! @todo enable transparency selection | 28 | //! @todo enable transparency selection | ||
28 | //! @todo add transparency option | 29 | //! @todo add transparency option | ||
29 | //! @todo reimplement view using KColorCells | 30 | //! @todo reimplement view using KColorCells | ||
30 | class KPROPERTY_EXPORT KPropertyColorComboEditor : public KColorCombo | 31 | class KPROPERTYWIDGETS_EXPORT KPropertyColorComboEditor : public KColorCombo | ||
31 | { | 32 | { | ||
32 | Q_OBJECT | 33 | Q_OBJECT | ||
33 | Q_PROPERTY(QVariant value READ value WRITE setValue USER true) | 34 | Q_PROPERTY(QVariant value READ value WRITE setValue USER true) | ||
34 | 35 | | |||
35 | public: | 36 | public: | ||
36 | explicit KPropertyColorComboEditor(QWidget *parent = 0); | 37 | explicit KPropertyColorComboEditor(QWidget *parent = 0); | ||
37 | 38 | | |||
38 | ~KPropertyColorComboEditor(); | 39 | ~KPropertyColorComboEditor(); | ||
39 | 40 | | |||
40 | QVariant value() const; | 41 | QVariant value() const; | ||
41 | 42 | | |||
42 | Q_SIGNALS: | 43 | Q_SIGNALS: | ||
43 | void commitData( QWidget * editor ); | 44 | void commitData( QWidget * editor ); | ||
44 | 45 | | |||
45 | public Q_SLOTS: | 46 | public Q_SLOTS: | ||
46 | void setValue(const QVariant &value); | 47 | void setValue(const QVariant &value); | ||
47 | 48 | | |||
48 | protected Q_SLOTS: | 49 | protected Q_SLOTS: | ||
49 | void slotValueChanged(const QColor&); | 50 | void slotValueChanged(const QColor&); | ||
50 | }; | 51 | }; | ||
51 | 52 | | |||
52 | class KPROPERTY_EXPORT KPropertyColorComboDelegate : public KPropertyEditorCreatorInterface, | 53 | class KPROPERTYWIDGETS_EXPORT KPropertyColorComboDelegate : public KPropertyEditorCreatorInterface, | ||
53 | public KPropertyValuePainterInterface | 54 | public KPropertyValuePainterInterface | ||
54 | { | 55 | { | ||
55 | public: | 56 | public: | ||
56 | KPropertyColorComboDelegate() {} | 57 | KPropertyColorComboDelegate() {} | ||
57 | 58 | | |||
58 | virtual QWidget * createEditor( int type, QWidget *parent, | 59 | virtual QWidget * createEditor( int type, QWidget *parent, | ||
59 | const QStyleOptionViewItem & option, const QModelIndex & index ) const; | 60 | const QStyleOptionViewItem & option, const QModelIndex & index ) const; | ||
60 | 61 | | |||
61 | virtual void paint( QPainter * painter, | 62 | virtual void paint( QPainter * painter, | ||
62 | const QStyleOptionViewItem & option, const QModelIndex & index ) const; | 63 | const QStyleOptionViewItem & option, const QModelIndex & index ) const; | ||
63 | }; | 64 | }; | ||
64 | 65 | | |||
65 | #endif | 66 | #endif |