Mercurial > projects > qtd
comparison 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 |
comparison
equal
deleted
inserted
replaced
281:7f2e3ffa1c33 | 282:256ab6cb8e85 |
---|---|
143 rotableWidgets ~= a0; | 143 rotableWidgets ~= a0; |
144 rotableWidgets ~= a1; | 144 rotableWidgets ~= a1; |
145 rotableWidgets ~= a2; | 145 rotableWidgets ~= a2; |
146 rotableWidgets ~= a3; | 146 rotableWidgets ~= a3; |
147 | 147 |
148 a0.valueChanged.connect(&a1.setValue); | 148 connect!("valueChanged")(a0, &a1.setValue); |
149 a1.valueChanged.connect(&a2.setValue); | 149 connect!("valueChanged")(a1, &a2.setValue); |
150 a2.valueChanged.connect(&a3.setValue); | 150 connect!("valueChanged")(a2, &a3.setValue); |
151 a3.valueChanged.connect(&a0.setValue); | 151 connect!("valueChanged")(a3, &a0.setValue); |
152 | 152 |
153 /* | 153 /* |
154 int n = rotableWidgets.length; | 154 int n = rotableWidgets.length; |
155 for (int i = 0; i < n; ++i) { | 155 for (int i = 0; i < n; ++i) { |
156 rotableWidgets[i].valueChanged.connect(&rotableWidgets[(i + 1) % n].setValue); | 156 rotableWidgets[i].valueChanged.connect(&rotableWidgets[(i + 1) % n].setValue); |
170 | 170 |
171 buttonsOrientationComboBox = new QComboBox; | 171 buttonsOrientationComboBox = new QComboBox; |
172 buttonsOrientationComboBox.addItem(tr("Horizontal"), new QVariant(cast(ulong) Qt.Horizontal)); | 172 buttonsOrientationComboBox.addItem(tr("Horizontal"), new QVariant(cast(ulong) Qt.Horizontal)); |
173 buttonsOrientationComboBox.addItem(tr("Vertical"), new QVariant(cast(ulong) Qt.Vertical)); | 173 buttonsOrientationComboBox.addItem(tr("Vertical"), new QVariant(cast(ulong) Qt.Vertical)); |
174 | 174 |
175 buttonsOrientationComboBox.currentIndexChanged.connect(&this.buttonsOrientationChanged); | 175 connect!("currentIndexChanged")(buttonsOrientationComboBox, &this.buttonsOrientationChanged); |
176 | 176 |
177 optionsLayout = new QGridLayout; | 177 optionsLayout = new QGridLayout; |
178 optionsLayout.addWidget(buttonsOrientationLabel, 0, 0); | 178 optionsLayout.addWidget(buttonsOrientationLabel, 0, 0); |
179 optionsLayout.addWidget(buttonsOrientationComboBox, 0, 1); | 179 optionsLayout.addWidget(buttonsOrientationComboBox, 0, 1); |
180 optionsLayout.setColumnStretch(2, 1); | 180 optionsLayout.setColumnStretch(2, 1); |
187 | 187 |
188 closeButton = buttonBox.addButton(QDialogButtonBox.Close); | 188 closeButton = buttonBox.addButton(QDialogButtonBox.Close); |
189 helpButton = buttonBox.addButton(QDialogButtonBox.Help); | 189 helpButton = buttonBox.addButton(QDialogButtonBox.Help); |
190 rotateWidgetsButton = buttonBox.addButton(tr("Rotate &Widgets"), QDialogButtonBox.ActionRole); | 190 rotateWidgetsButton = buttonBox.addButton(tr("Rotate &Widgets"), QDialogButtonBox.ActionRole); |
191 | 191 |
192 rotateWidgetsButton.clicked.connect(&this.rotateWidgets); | 192 connect!("clicked")(rotateWidgetsButton, &this.rotateWidgets); |
193 closeButton.clicked.connect(&this.close); | 193 connect!("clicked")(closeButton, &this.close); |
194 helpButton.clicked.connect(&this.help); | 194 connect!("clicked")(helpButton, &this.help); |
195 } | 195 } |
196 | 196 |
197 QGroupBox rotableGroupBox; | 197 QGroupBox rotableGroupBox; |
198 QWidget[] rotableWidgets; | 198 QWidget[] rotableWidgets; |
199 | 199 |