annotate examples/layouts/dynamiclayouts/dialog.d @ 282:256ab6cb8e85

Signals look-up andNew syntax for connect. The old one will not work from now on. This will allow for the signals overload. Although changes are done for both D1 and D2 versions, D1 won't work because of compiler bugs. I am tired of waiting for fixes.
author eldar
date Fri, 16 Oct 2009 02:43:59 +0000
parents 9fa74f0e3fb6
children 7a3c43424dca
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
101
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
1 /****************************************************************************
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
2 **
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
4 ** Contact: Qt Software Information (qt-info@nokia.com)
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
5 **
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
6 ** This file is part of the examples of the Qt Toolkit.
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
7 **
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
8 ** $QT_BEGIN_LICENSE:LGPL$
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
9 ** Commercial Usage
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
10 ** Licensees holding valid Qt Commercial licenses may use this file in
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
11 ** accordance with the Qt Commercial License Agreement provided with the
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
12 ** Software or, alternatively, in accordance with the terms contained in
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
13 ** a written agreement between you and Nokia.
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
14 **
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
15 ** GNU Lesser General Public License Usage
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
16 ** Alternatively, this file may be used under the terms of the GNU Lesser
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
17 ** General Public License version 2.1 as published by the Free Software
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
18 ** Foundation and appearing in the file LICENSE.LGPL included in the
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
19 ** packaging of this file. Please review the following information to
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
20 ** ensure the GNU Lesser General Public License version 2.1 requirements
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
21 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
22 **
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
23 ** In addition, as a special exception, Nokia gives you certain
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
24 ** additional rights. These rights are described in the Nokia Qt LGPL
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
26 ** package.
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
27 **
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
28 ** GNU General Public License Usage
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
29 ** Alternatively, this file may be used under the terms of the GNU
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
30 ** General Public License version 3.0 as published by the Free Software
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
31 ** Foundation and appearing in the file LICENSE.GPL included in the
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
32 ** packaging of this file. Please review the following information to
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
33 ** ensure the GNU General Public License version 3.0 requirements will be
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
34 ** met: http://www.gnu.org/copyleft/gpl.html.
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
35 **
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
36 ** If you are unsure which license is appropriate for your use, please
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
37 ** contact the sales department at qt-sales@nokia.com.
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
38 ** $QT_END_LICENSE$
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
39 **
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
40 ****************************************************************************/
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
41 module dialog;
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
42
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
43
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
44 import qt.gui.QDialog;
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
45 import qt.gui.QGroupBox;
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
46 import qt.gui.QGridLayout;
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
47 import qt.gui.QLabel;
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
48 import qt.gui.QComboBox;
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
49 import qt.gui.QDialogButtonBox;
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
50 import qt.gui.QPushButton;
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
51 import qt.gui.QMessageBox;
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
52 import qt.gui.QSpinBox;
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
53 import qt.gui.QDial;
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
54 import qt.gui.QProgressBar;
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
55
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
56
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
57 class Dialog : public QDialog
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
58 {
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
59 public:
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
60
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
61 this(QWidget parent = null)
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
62 {
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
63 super(parent);
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
64 createRotableGroupBox();
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
65 createOptionsGroupBox();
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
66 createButtonBox();
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
67
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
68 mainLayout = new QGridLayout;
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
69 mainLayout.addWidget(rotableGroupBox, 0, 0);
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
70 mainLayout.addWidget(optionsGroupBox, 1, 0);
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
71 mainLayout.addWidget(buttonBox, 2, 0);
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
72 setLayout(mainLayout);
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
73
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
74 mainLayout.setSizeConstraint(QLayout.SetMinimumSize);
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
75
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
76 setWindowTitle(tr("Dynamic Layouts"));
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
77 }
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
78
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
79 private:
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
80
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
81 void buttonsOrientationChanged(int index)
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
82 {
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
83 mainLayout.setSizeConstraint(QLayout.SetNoConstraint);
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
84 setMinimumSize(0, 0);
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
85
103
236401001115 fix for current qtd signals system
eldar
parents: 101
diff changeset
86 Qt.Orientation orientation = cast(Qt.Orientation) buttonsOrientationComboBox.itemData(index).toInt();
101
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
87
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
88 if (orientation == buttonBox.orientation())
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
89 return;
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
90
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
91 mainLayout.removeWidget(buttonBox);
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
92
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
93 int spacing = mainLayout.spacing();
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
94
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
95 QSize oldSizeHint = buttonBox.sizeHint() + QSize(spacing, spacing);
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
96 buttonBox.setOrientation(orientation);
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
97 QSize newSizeHint = buttonBox.sizeHint() + QSize(spacing, spacing);
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
98
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
99 if (orientation == Qt_Orientation.Horizontal) {
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
100 mainLayout.addWidget(buttonBox, 2, 0);
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
101 resize(size() + QSize(-1 * oldSizeHint.width(), newSizeHint.height()));
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
102 } else {
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
103 mainLayout.addWidget(buttonBox, 0, 3, 2, 1);
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
104 resize(size() + QSize(newSizeHint.width(), -1 * oldSizeHint.height()));
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
105 }
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
106
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
107 mainLayout.setSizeConstraint(QLayout.SetDefaultConstraint);
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
108 }
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
109
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
110 void rotateWidgets()
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
111 {
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
112 assert(rotableWidgets.length % 2 == 0);
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
113
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
114 foreach (QWidget widget; rotableWidgets)
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
115 rotableLayout.removeWidget(widget);
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
116
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
117 rotableWidgets = rotableWidgets[1..$] ~ rotableWidgets[0];
108
9fa74f0e3fb6 uniform indention
mandel
parents: 103
diff changeset
118
101
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
119 int n = rotableWidgets.length;
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
120 for (int i = 0; i < n / 2; ++i) {
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
121 rotableLayout.addWidget(rotableWidgets[n - i - 1], 0, i);
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
122 rotableLayout.addWidget(rotableWidgets[i], 1, i);
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
123 }
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
124 }
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
125
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
126 void help()
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
127 {
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
128 QMessageBox.information(this, tr("Dynamic Layouts Help"),
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
129 tr("This example shows how to change layouts dynamically."));
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
130 }
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
131
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
132 private:
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
133
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
134 void createRotableGroupBox()
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
135 {
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
136 rotableGroupBox = new QGroupBox(tr("Rotable Widgets"));
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
137
108
9fa74f0e3fb6 uniform indention
mandel
parents: 103
diff changeset
138 auto a0 = new QSpinBox;
9fa74f0e3fb6 uniform indention
mandel
parents: 103
diff changeset
139 auto a1 = new QSlider;
9fa74f0e3fb6 uniform indention
mandel
parents: 103
diff changeset
140 auto a2 = new QDial;
9fa74f0e3fb6 uniform indention
mandel
parents: 103
diff changeset
141 auto a3 = new QProgressBar;
9fa74f0e3fb6 uniform indention
mandel
parents: 103
diff changeset
142
9fa74f0e3fb6 uniform indention
mandel
parents: 103
diff changeset
143 rotableWidgets ~= a0;
9fa74f0e3fb6 uniform indention
mandel
parents: 103
diff changeset
144 rotableWidgets ~= a1;
9fa74f0e3fb6 uniform indention
mandel
parents: 103
diff changeset
145 rotableWidgets ~= a2;
9fa74f0e3fb6 uniform indention
mandel
parents: 103
diff changeset
146 rotableWidgets ~= a3;
9fa74f0e3fb6 uniform indention
mandel
parents: 103
diff changeset
147
282
256ab6cb8e85 Signals look-up andNew syntax for connect. The old one will not work from now on. This will allow for the signals overload. Although changes are done for both D1 and D2 versions, D1 won't work because of compiler bugs. I am tired of waiting for fixes.
eldar
parents: 108
diff changeset
148 connect!("valueChanged")(a0, &a1.setValue);
256ab6cb8e85 Signals look-up andNew syntax for connect. The old one will not work from now on. This will allow for the signals overload. Although changes are done for both D1 and D2 versions, D1 won't work because of compiler bugs. I am tired of waiting for fixes.
eldar
parents: 108
diff changeset
149 connect!("valueChanged")(a1, &a2.setValue);
256ab6cb8e85 Signals look-up andNew syntax for connect. The old one will not work from now on. This will allow for the signals overload. Although changes are done for both D1 and D2 versions, D1 won't work because of compiler bugs. I am tired of waiting for fixes.
eldar
parents: 108
diff changeset
150 connect!("valueChanged")(a2, &a3.setValue);
256ab6cb8e85 Signals look-up andNew syntax for connect. The old one will not work from now on. This will allow for the signals overload. Although changes are done for both D1 and D2 versions, D1 won't work because of compiler bugs. I am tired of waiting for fixes.
eldar
parents: 108
diff changeset
151 connect!("valueChanged")(a3, &a0.setValue);
108
9fa74f0e3fb6 uniform indention
mandel
parents: 103
diff changeset
152
9fa74f0e3fb6 uniform indention
mandel
parents: 103
diff changeset
153 /*
101
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
154 int n = rotableWidgets.length;
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
155 for (int i = 0; i < n; ++i) {
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
156 rotableWidgets[i].valueChanged.connect(&rotableWidgets[(i + 1) % n].setValue);
103
236401001115 fix for current qtd signals system
eldar
parents: 101
diff changeset
157 }*/
101
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
158
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
159 rotableLayout = new QGridLayout;
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
160 rotableGroupBox.setLayout(rotableLayout);
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
161
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
162 rotateWidgets();
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
163 }
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
164
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
165 void createOptionsGroupBox()
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
166 {
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
167 optionsGroupBox = new QGroupBox(tr("Options"));
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
168
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
169 buttonsOrientationLabel = new QLabel(tr("Orientation of buttons:"));
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
170
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
171 buttonsOrientationComboBox = new QComboBox;
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
172 buttonsOrientationComboBox.addItem(tr("Horizontal"), new QVariant(cast(ulong) Qt.Horizontal));
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
173 buttonsOrientationComboBox.addItem(tr("Vertical"), new QVariant(cast(ulong) Qt.Vertical));
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
174
282
256ab6cb8e85 Signals look-up andNew syntax for connect. The old one will not work from now on. This will allow for the signals overload. Although changes are done for both D1 and D2 versions, D1 won't work because of compiler bugs. I am tired of waiting for fixes.
eldar
parents: 108
diff changeset
175 connect!("currentIndexChanged")(buttonsOrientationComboBox, &this.buttonsOrientationChanged);
101
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
176
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
177 optionsLayout = new QGridLayout;
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
178 optionsLayout.addWidget(buttonsOrientationLabel, 0, 0);
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
179 optionsLayout.addWidget(buttonsOrientationComboBox, 0, 1);
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
180 optionsLayout.setColumnStretch(2, 1);
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
181 optionsGroupBox.setLayout(optionsLayout);
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
182 }
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
183
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
184 void createButtonBox()
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
185 {
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
186 buttonBox = new QDialogButtonBox;
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
187
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
188 closeButton = buttonBox.addButton(QDialogButtonBox.Close);
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
189 helpButton = buttonBox.addButton(QDialogButtonBox.Help);
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
190 rotateWidgetsButton = buttonBox.addButton(tr("Rotate &Widgets"), QDialogButtonBox.ActionRole);
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
191
282
256ab6cb8e85 Signals look-up andNew syntax for connect. The old one will not work from now on. This will allow for the signals overload. Although changes are done for both D1 and D2 versions, D1 won't work because of compiler bugs. I am tired of waiting for fixes.
eldar
parents: 108
diff changeset
192 connect!("clicked")(rotateWidgetsButton, &this.rotateWidgets);
256ab6cb8e85 Signals look-up andNew syntax for connect. The old one will not work from now on. This will allow for the signals overload. Although changes are done for both D1 and D2 versions, D1 won't work because of compiler bugs. I am tired of waiting for fixes.
eldar
parents: 108
diff changeset
193 connect!("clicked")(closeButton, &this.close);
256ab6cb8e85 Signals look-up andNew syntax for connect. The old one will not work from now on. This will allow for the signals overload. Although changes are done for both D1 and D2 versions, D1 won't work because of compiler bugs. I am tired of waiting for fixes.
eldar
parents: 108
diff changeset
194 connect!("clicked")(helpButton, &this.help);
101
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
195 }
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
196
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
197 QGroupBox rotableGroupBox;
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
198 QWidget[] rotableWidgets;
103
236401001115 fix for current qtd signals system
eldar
parents: 101
diff changeset
199
101
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
200 QGroupBox optionsGroupBox;
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
201 QLabel buttonsOrientationLabel;
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
202 QComboBox buttonsOrientationComboBox;
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
203
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
204 QDialogButtonBox buttonBox;
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
205 QPushButton closeButton;
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
206 QPushButton helpButton;
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
207 QPushButton rotateWidgetsButton;
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
208
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
209 QGridLayout mainLayout;
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
210 QGridLayout rotableLayout;
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
211 QGridLayout optionsLayout;
4f909ae70e76 add dynamiclayouts example
mandel
parents:
diff changeset
212 }