Changeset 78935 in vbox
- Timestamp:
- Jun 3, 2019 12:50:23 PM (6 years ago)
- svn:sync-xref-src-repo-rev:
- 131057
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/wizards/importappliance/UIFormEditorWidget.cpp
r78934 r78935 148 148 149 149 /** Constructs ChoiceData editor passing @a pParent to the base-class. */ 150 ChoiceEditor(QWidget *pParent = 0) 151 : QComboBox(pParent) {} 150 ChoiceEditor(QWidget *pParent = 0); 152 151 153 152 private: 154 153 155 154 /** Defines the @a choice. */ 156 void setChoice(const ChoiceData &choice) 157 { 158 addItems(choice.values().toList()); 159 setCurrentIndex(choice.selectedIndex()); 160 } 161 155 void setChoice(const ChoiceData &choice); 162 156 /** Returns the choice. */ 163 ChoiceData choice() const 164 { 165 QVector<QString> choices(count()); 166 for (int i = 0; i < count(); ++i) 167 choices[i] = itemText(i); 168 return ChoiceData(choices, currentIndex()); 169 } 157 ChoiceData choice() const; 170 158 }; 171 159 … … 180 168 181 169 /** Constructs RangedIntegerData editor passing @a pParent to the base-class. */ 182 RangedIntegerEditor(QWidget *pParent = 0) 183 : QSpinBox(pParent) {} 170 RangedIntegerEditor(QWidget *pParent = 0); 184 171 185 172 private: 186 173 187 174 /** Defines @a rangedInteger. */ 188 void setRangedInteger(const RangedIntegerData &rangedInteger) 189 { 190 setMinimum(rangedInteger.minimum()); 191 setMaximum(rangedInteger.maximum()); 192 setValue(rangedInteger.integer()); 193 } 194 175 void setRangedInteger(const RangedIntegerData &rangedInteger); 195 176 /** Returns ranged-integer. */ 196 RangedIntegerData rangedInteger() const 197 { 198 return RangedIntegerData(minimum(), maximum(), value()); 199 } 177 RangedIntegerData rangedInteger() const; 200 178 }; 201 179 … … 396 374 virtual QITableViewRow *childItem(int iIndex) const /* override */; 397 375 }; 376 377 378 /********************************************************************************************************************************* 379 * Class ChoiceEditor implementation. * 380 *********************************************************************************************************************************/ 381 382 ChoiceEditor::ChoiceEditor(QWidget *pParent /* = 0 */) 383 : QComboBox(pParent) 384 { 385 } 386 387 void ChoiceEditor::setChoice(const ChoiceData &choice) 388 { 389 addItems(choice.values().toList()); 390 setCurrentIndex(choice.selectedIndex()); 391 } 392 393 ChoiceData ChoiceEditor::choice() const 394 { 395 QVector<QString> choices(count()); 396 for (int i = 0; i < count(); ++i) 397 choices[i] = itemText(i); 398 return ChoiceData(choices, currentIndex()); 399 } 400 401 402 /********************************************************************************************************************************* 403 * Class RangedIntegerEditor implementation. * 404 *********************************************************************************************************************************/ 405 406 RangedIntegerEditor::RangedIntegerEditor(QWidget *pParent /* = 0 */) 407 : QSpinBox(pParent) 408 { 409 } 410 411 void RangedIntegerEditor::setRangedInteger(const RangedIntegerData &rangedInteger) 412 { 413 setMinimum(rangedInteger.minimum()); 414 setMaximum(rangedInteger.maximum()); 415 setValue(rangedInteger.integer()); 416 } 417 418 RangedIntegerData RangedIntegerEditor::rangedInteger() const 419 { 420 return RangedIntegerData(minimum(), maximum(), value()); 421 } 398 422 399 423
Note:
See TracChangeset
for help on using the changeset viewer.