00001 /**************************************************************************** 00002 ** 00003 ** This file is part of a Qt Solutions component. 00004 ** 00005 ** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 00006 ** 00007 ** Contact: Qt Software Information (qt-info@nokia.com) 00008 ** 00009 ** Commercial Usage 00010 ** Licensees holding valid Qt Commercial licenses may use this file in 00011 ** accordance with the Qt Solutions Commercial License Agreement provided 00012 ** with the Software or, alternatively, in accordance with the terms 00013 ** contained in a written agreement between you and Nokia. 00014 ** 00015 ** GNU Lesser General Public License Usage 00016 ** Alternatively, this file may be used under the terms of the GNU Lesser 00017 ** General Public License version 2.1 as published by the Free Software 00018 ** Foundation and appearing in the file LICENSE.LGPL included in the 00019 ** packaging of this file. Please review the following information to 00020 ** ensure the GNU Lesser General Public License version 2.1 requirements 00021 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 00022 ** 00023 ** In addition, as a special exception, Nokia gives you certain 00024 ** additional rights. These rights are described in the Nokia Qt LGPL 00025 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 00026 ** package. 00027 ** 00028 ** GNU General Public License Usage 00029 ** Alternatively, this file may be used under the terms of the GNU 00030 ** General Public License version 3.0 as published by the Free Software 00031 ** Foundation and appearing in the file LICENSE.GPL included in the 00032 ** packaging of this file. Please review the following information to 00033 ** ensure the GNU General Public License version 3.0 requirements will be 00034 ** met: http://www.gnu.org/copyleft/gpl.html. 00035 ** 00036 ** Please note Third Party Software included with Qt Solutions may impose 00037 ** additional restrictions and it is the user's responsibility to ensure 00038 ** that they have met the licensing requirements of the GPL, LGPL, or Qt 00039 ** Solutions Commercial license and the relevant license of the Third 00040 ** Party Software they are using. 00041 ** 00042 ** If you are unsure which license is appropriate for your use, please 00043 ** contact the sales department at qt-sales@nokia.com. 00044 ** 00045 ****************************************************************************/ 00046 00047 /**************************************************************************** 00048 ** 00049 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 00050 ** Contact: Qt Software Information (qt-info@nokia.com) 00051 ** 00052 ** This file is part of the tools applications of the Qt Toolkit. 00053 ** 00054 ** $QT_BEGIN_LICENSE:LGPL$ 00055 ** No Commercial Usage 00056 ** This file contains pre-release code and may not be distributed. 00057 ** You may use this file in accordance with the terms and conditions 00058 ** contained in the either Technology Preview License Agreement or the 00059 ** Beta Release License Agreement. 00060 ** 00061 ** GNU Lesser General Public License Usage 00062 ** Alternatively, this file may be used under the terms of the GNU Lesser 00063 ** General Public License version 2.1 as published by the Free Software 00064 ** Foundation and appearing in the file LICENSE.LGPL included in the 00065 ** packaging of this file. Please review the following information to 00066 ** ensure the GNU Lesser General Public License version 2.1 requirements 00067 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 00068 ** 00069 ** In addition, as a special exception, Nokia gives you certain 00070 ** additional rights. These rights are described in the Nokia Qt LGPL 00071 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 00072 ** package. 00073 ** 00074 ** GNU General Public License Usage 00075 ** Alternatively, this file may be used under the terms of the GNU 00076 ** General Public License version 3.0 as published by the Free Software 00077 ** Foundation and appearing in the file LICENSE.GPL included in the 00078 ** packaging of this file. Please review the following information to 00079 ** ensure the GNU General Public License version 3.0 requirements will be 00080 ** met: http://www.gnu.org/copyleft/gpl.html. 00081 ** 00082 ** If you are unsure which license is appropriate for your use, please 00083 ** contact the sales department at qt-sales@nokia.com. 00084 ** $QT_END_LICENSE$ 00085 ** 00086 ****************************************************************************/ 00087 00088 #ifndef QTTREEPROPERTYBROWSER_H 00089 #define QTTREEPROPERTYBROWSER_H 00090 00091 #include "qtpropertybrowser.h" 00092 00093 #if QT_VERSION >= 0x040400 00094 QT_BEGIN_NAMESPACE 00095 #endif 00096 00097 class QTreeWidgetItem; 00098 class QtTreePropertyBrowserPrivate; 00099 00100 class QT_QTPROPERTYBROWSER_EXPORT QtTreePropertyBrowser : public QtAbstractPropertyBrowser 00101 { 00102 Q_OBJECT 00103 Q_ENUMS(ResizeMode) 00104 Q_PROPERTY(int indentation READ indentation WRITE setIndentation) 00105 Q_PROPERTY(bool rootIsDecorated READ rootIsDecorated WRITE setRootIsDecorated) 00106 Q_PROPERTY(bool alternatingRowColors READ alternatingRowColors WRITE setAlternatingRowColors) 00107 Q_PROPERTY(bool headerVisible READ isHeaderVisible WRITE setHeaderVisible) 00108 Q_PROPERTY(ResizeMode resizeMode READ resizeMode WRITE setResizeMode) 00109 Q_PROPERTY(int splitterPosition READ splitterPosition WRITE setSplitterPosition) 00110 Q_PROPERTY(bool propertiesWithoutValueMarked READ propertiesWithoutValueMarked WRITE setPropertiesWithoutValueMarked) 00111 public: 00112 00113 enum ResizeMode 00114 { 00115 Interactive, 00116 Stretch, 00117 Fixed, 00118 ResizeToContents 00119 }; 00120 00121 QtTreePropertyBrowser(QWidget *parent = 0); 00122 ~QtTreePropertyBrowser(); 00123 00124 int indentation() const; 00125 void setIndentation(int i); 00126 00127 bool rootIsDecorated() const; 00128 void setRootIsDecorated(bool show); 00129 00130 bool alternatingRowColors() const; 00131 void setAlternatingRowColors(bool enable); 00132 00133 bool isHeaderVisible() const; 00134 void setHeaderVisible(bool visible); 00135 00136 ResizeMode resizeMode() const; 00137 void setResizeMode(ResizeMode mode); 00138 00139 int splitterPosition() const; 00140 void setSplitterPosition(int position); 00141 00142 void setExpanded(QtBrowserItem *item, bool expanded); 00143 bool isExpanded(QtBrowserItem *item) const; 00144 00145 bool isItemVisible(QtBrowserItem *item) const; 00146 void setItemVisible(QtBrowserItem *item, bool visible); 00147 00148 void setBackgroundColor(QtBrowserItem *item, const QColor &color); 00149 QColor backgroundColor(QtBrowserItem *item) const; 00150 QColor calculatedBackgroundColor(QtBrowserItem *item) const; 00151 00152 void setPropertiesWithoutValueMarked(bool mark); 00153 bool propertiesWithoutValueMarked() const; 00154 00155 void editItem(QtBrowserItem *item); 00156 00157 Q_SIGNALS: 00158 00159 void collapsed(QtBrowserItem *item); 00160 void expanded(QtBrowserItem *item); 00161 00162 protected: 00163 virtual void itemInserted(QtBrowserItem *item, QtBrowserItem *afterItem); 00164 virtual void itemRemoved(QtBrowserItem *item); 00165 virtual void itemChanged(QtBrowserItem *item); 00166 00167 private: 00168 00169 QtTreePropertyBrowserPrivate *d_ptr; 00170 Q_DECLARE_PRIVATE(QtTreePropertyBrowser) 00171 Q_DISABLE_COPY(QtTreePropertyBrowser) 00172 00173 Q_PRIVATE_SLOT(d_func(), void slotCollapsed(const QModelIndex &)) 00174 Q_PRIVATE_SLOT(d_func(), void slotExpanded(const QModelIndex &)) 00175 Q_PRIVATE_SLOT(d_func(), void slotCurrentBrowserItemChanged(QtBrowserItem *)) 00176 Q_PRIVATE_SLOT(d_func(), void slotCurrentTreeItemChanged(QTreeWidgetItem *, QTreeWidgetItem *)) 00177 00178 }; 00179 00180 #if QT_VERSION >= 0x040400 00181 QT_END_NAMESPACE 00182 #endif 00183 00184 #endif