tools/designer/src/components/propertyeditor/qpropertyeditor.h

Go to the documentation of this file.
00001 /****************************************************************************
00002 **
00003 ** Copyright (C) 1992-2006 Trolltech ASA. All rights reserved.
00004 **
00005 ** This file is part of the Qt Designer of the Qt Toolkit.
00006 **
00007 ** This file may be used under the terms of the GNU General Public
00008 ** License version 2.0 as published by the Free Software Foundation
00009 ** and appearing in the file LICENSE.GPL included in the packaging of
00010 ** this file.  Please review the following information to ensure GNU
00011 ** General Public Licensing requirements will be met:
00012 ** http://www.trolltech.com/products/qt/opensource.html
00013 **
00014 ** If you are unsure which license is appropriate for your use, please
00015 ** review the following information:
00016 ** http://www.trolltech.com/products/qt/licensing.html or contact the
00017 ** sales department at sales@trolltech.com.
00018 **
00019 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
00020 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
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 }  // namespace qdesigner_internal
00070 
00071 #endif // QPROPERTYEDITOR_H

Generated on Thu Mar 15 12:01:08 2007 for Qt 4.2 User's Guide by  doxygen 1.5.1