00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef QPROPERTYEDITOR_H
00025 #define QPROPERTYEDITOR_H
00026
00027 #include "propertyeditor_global.h"
00028 #include "qpropertyeditor_items_p.h"
00029
00030 #include <QtGui/QTreeView>
00031
00032 namespace qdesigner_internal {
00033
00034 class QPropertyEditorModel;
00035 class QPropertyEditorDelegate;
00036
00037 class QT_PROPERTYEDITOR_EXPORT QPropertyEditor: public QTreeView
00038 {
00039 Q_OBJECT
00040 public:
00041 QPropertyEditor(QWidget *parent = 0);
00042 ~QPropertyEditor();
00043
00044 IProperty *initialInput() const;
00045 bool isReadOnly() const;
00046
00047 inline QPropertyEditorModel *editorModel() const
00048 { return m_model; }
00049
00050 signals:
00051 void propertyChanged(IProperty *property);
00052
00053 public slots:
00054 void setInitialInput(IProperty *initialInput);
00055 void setReadOnly(bool readOnly);
00056
00057 protected:
00058 virtual void drawBranches(QPainter *painter, const QRect &rect, const QModelIndex &index) const;
00059 virtual void keyPressEvent(QKeyEvent *ev);
00060 virtual QStyleOptionViewItem viewOptions() const;
00061 virtual void focusInEvent(QFocusEvent *event);
00062
00063 private:
00064 QPropertyEditorModel *m_model;
00065 QPropertyEditorDelegate *m_itemDelegate;
00066 bool contentsResized;
00067 };
00068
00069 }
00070
00071 #endif // QPROPERTYEDITOR_H