Changeset View
Changeset View
Standalone View
Standalone View
src/editors/KPropertyStringEditor.h
Show All 16 Lines | 1 | /* This file is part of the KDE project | |||
---|---|---|---|---|---|
17 | along with this library; see the file COPYING.LIB. If not, write to | 17 | along with this library; see the file COPYING.LIB. If not, write to | ||
18 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 18 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||
19 | * Boston, MA 02110-1301, USA. | 19 | * Boston, MA 02110-1301, USA. | ||
20 | */ | 20 | */ | ||
21 | 21 | | |||
22 | #ifndef KPROPERTY_STRINGEDIT_H | 22 | #ifndef KPROPERTY_STRINGEDIT_H | ||
23 | #define KPROPERTY_STRINGEDIT_H | 23 | #define KPROPERTY_STRINGEDIT_H | ||
24 | 24 | | |||
25 | #include "KPropertyFactory.h" | 25 | #include "KPropertyWidgetsFactory.h" | ||
26 | 26 | | |||
27 | #include <QLineEdit> | 27 | #include <QLineEdit> | ||
28 | 28 | | |||
29 | class KPROPERTY_EXPORT KPropertyStringEditor : public QLineEdit | 29 | class KPROPERTYWIDGETS_EXPORT KPropertyStringEditor : public QLineEdit | ||
30 | { | 30 | { | ||
31 | Q_OBJECT | 31 | Q_OBJECT | ||
32 | Q_PROPERTY(QString value READ value WRITE setValue USER true) | 32 | Q_PROPERTY(QString value READ value WRITE setValue USER true) | ||
33 | public: | 33 | public: | ||
34 | explicit KPropertyStringEditor(QWidget *parent = 0); | 34 | explicit KPropertyStringEditor(QWidget *parent = 0); | ||
35 | 35 | | |||
36 | ~KPropertyStringEditor(); | 36 | ~KPropertyStringEditor(); | ||
37 | 37 | | |||
38 | QString value() const; | 38 | QString value() const; | ||
39 | 39 | | |||
40 | Q_SIGNALS: | 40 | Q_SIGNALS: | ||
41 | void commitData( QWidget * editor ); | 41 | void commitData( QWidget * editor ); | ||
42 | 42 | | |||
43 | public Q_SLOTS: | 43 | public Q_SLOTS: | ||
44 | void setValue(const QString& value); | 44 | void setValue(const QString& value); | ||
45 | 45 | | |||
46 | private Q_SLOTS: | 46 | private Q_SLOTS: | ||
47 | void slotTextChanged( const QString & text ); | 47 | void slotTextChanged( const QString & text ); | ||
48 | 48 | | |||
49 | private: | 49 | private: | ||
50 | bool m_slotTextChangedEnabled; | 50 | bool m_slotTextChangedEnabled; | ||
51 | }; | 51 | }; | ||
52 | 52 | | |||
53 | class KPROPERTY_EXPORT KPropertyStringDelegate : public KPropertyEditorCreatorInterface | 53 | class KPROPERTYWIDGETS_EXPORT KPropertyStringDelegate : public KPropertyEditorCreatorInterface | ||
54 | { | 54 | { | ||
55 | public: | 55 | public: | ||
56 | KPropertyStringDelegate() {} | 56 | KPropertyStringDelegate() {} | ||
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 | 61 | | |||
62 | #endif | 62 | #endif |