Mercurial > projects > qtd
comparison examples/layouts/basiclayouts/dialog.d @ 213:26036621830e
more D2 examples fixes
author | SokoL_SD |
---|---|
date | Tue, 14 Jul 2009 13:22:48 +0000 |
parents | 6aeaf24018d7 |
children | 256ab6cb8e85 |
comparison
equal
deleted
inserted
replaced
212:bc1525b955d8 | 213:26036621830e |
---|---|
108 { | 108 { |
109 horizontalGroupBox = new QGroupBox(tr("Horizontal layout")); | 109 horizontalGroupBox = new QGroupBox(tr("Horizontal layout")); |
110 QHBoxLayout layout = new QHBoxLayout; | 110 QHBoxLayout layout = new QHBoxLayout; |
111 | 111 |
112 for (int i = 0; i < NumButtons; ++i) { | 112 for (int i = 0; i < NumButtons; ++i) { |
113 buttons[i] = new QPushButton(format(tr("Button {}"), i + 1)); | 113 version(Tango) |
114 const string str = tr("Button {}:"); | |
115 else | |
116 const string str = tr("Button %s:"); | |
117 buttons[i] = new QPushButton(format(str, i + 1)); | |
114 layout.addWidget(buttons[i]); | 118 layout.addWidget(buttons[i]); |
115 } | 119 } |
116 horizontalGroupBox.setLayout(layout); | 120 horizontalGroupBox.setLayout(layout); |
117 } | 121 } |
118 | 122 |
120 { | 124 { |
121 gridGroupBox = new QGroupBox(tr("Grid layout")); | 125 gridGroupBox = new QGroupBox(tr("Grid layout")); |
122 QGridLayout layout = new QGridLayout; | 126 QGridLayout layout = new QGridLayout; |
123 | 127 |
124 for (int i = 0; i < NumGridRows; ++i) { | 128 for (int i = 0; i < NumGridRows; ++i) { |
125 labels[i] = new QLabel(format(tr("Line {}:"), i + 1)); | 129 version(Tango) |
130 const string str = tr("Line {}:"); | |
131 else | |
132 const string str = tr("Line %s:"); | |
133 labels[i] = new QLabel(format(str, i + 1)); | |
126 lineEdits[i] = new QLineEdit; | 134 lineEdits[i] = new QLineEdit; |
127 layout.addWidget(labels[i], i + 1, 0); | 135 layout.addWidget(labels[i], i + 1, 0); |
128 layout.addWidget(lineEdits[i], i + 1, 1); | 136 layout.addWidget(lineEdits[i], i + 1, 1); |
129 } | 137 } |
130 | 138 |