OSDN Git Service

f1acff9e66693cb61c8ef61238c89e3ee5281edd
[qt-creator-jp/qt-creator-jp.git] / src / plugins / qmldesigner / components / propertyeditor / resetwidget.h
1 /**************************************************************************
2 **
3 ** This file is part of Qt Creator
4 **
5 ** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
6 **
7 ** Contact: Nokia Corporation (qt-info@nokia.com)
8 **
9 ** No Commercial Usage
10 **
11 ** This file contains pre-release code and may not be distributed.
12 ** You may use this file in accordance with the terms and conditions
13 ** contained in the Technology Preview License Agreement accompanying
14 ** this package.
15 **
16 ** GNU Lesser General Public License Usage
17 **
18 ** Alternatively, this file may be used under the terms of the GNU Lesser
19 ** General Public License version 2.1 as published by the Free Software
20 ** Foundation and appearing in the file LICENSE.LGPL included in the
21 ** packaging of this file.  Please review the following information to
22 ** ensure the GNU Lesser General Public License version 2.1 requirements
23 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 **
25 ** In addition, as a special exception, Nokia gives you certain additional
26 ** rights.  These rights are described in the Nokia Qt LGPL Exception
27 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 **
29 ** If you have questions regarding the use of this file, please contact
30 ** Nokia at qt-info@nokia.com.
31 **
32 **************************************************************************/
33
34 #ifndef ResetWidget_h
35 #define ResetWidget_h
36
37 #include <QtGui/QGroupBox>
38 #include <QtGui/QPushButton>
39
40 QT_BEGIN_NAMESPACE
41 class QListWidget;
42 class QVBoxLayout;
43 class QTableWidget;
44 QT_END_NAMESPACE
45
46 namespace QmlDesigner {
47
48 class ResetWidget : public QGroupBox
49 {
50
51     Q_OBJECT
52
53     Q_PROPERTY(QObject *backendObject READ backendObject WRITE setBackendObject)
54
55 public slots:
56     void resetView();
57
58 public:
59     ResetWidget(QWidget *parent = 0);
60     QObject* backendObject()
61     {
62         return m_backendObject;
63     }
64
65     void setBackendObject(QObject* backendObject)
66     {
67         m_backendObject = backendObject;
68         setupView();
69     }
70
71     static void registerDeclarativeType();
72
73 public slots:
74     void buttonPressed(const QString &name);
75
76
77 private:
78     void setupView();
79
80     void addPropertyItem(const QString &name, int row);
81
82     QObject* m_backendObject;
83     QVBoxLayout *m_vlayout;
84     QTableWidget *m_tableWidget;
85
86 };
87
88 class ResetWidgetPushButton : public QPushButton
89 {
90     Q_OBJECT
91
92 public slots:
93     void myPressed();
94     void setName(const QString &name)
95     { m_name = name; }
96
97 signals:
98     void pressed(const QString &name);
99
100 public:
101     ResetWidgetPushButton(QWidget *parent = 0);
102 private:
103     QString m_name;
104
105 };
106
107 }
108
109 #endif //ResetWidget_h
110