Changeset 9784 in vbox
- Timestamp:
- Jun 18, 2008 8:28:03 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxVMSettingsDlg.cpp
r9782 r9784 130 130 mTwSelector->hideColumn (listView_Id); 131 131 mTwSelector->hideColumn (listView_Link); 132 133 /* Adjust selector list */134 int minWid = 0;135 for (int i = 0; i < mTwSelector->topLevelItemCount(); ++ i)136 {137 QTreeWidgetItem *item = mTwSelector->topLevelItem (i);138 QFontMetrics fm (item->font (0));139 int wid = fm.width (item->text (0)) +140 16 /* icon */ + 2 * 8 /* 2 margins */;141 minWid = wid > minWid ? wid : minWid;142 int hei = fm.height() > 16 ?143 fm.height() /* text height */ :144 16 /* icon */ + 2 * 2 /* 2 margins */;145 item->setSizeHint (0, QSize (wid, hei));146 }147 mTwSelector->setFixedWidth (minWid);148 149 /* Sort selector by the id column (to have pages in the desired order) */150 mTwSelector->sortItems (listView_Id, Qt::AscendingOrder);151 132 152 133 /* Initially select the first settings page */ … … 308 289 mTwSelector->setCurrentItem (mTwSelector->topLevelItem (ci)); 309 290 291 /* Adjust selector list */ 292 mTwSelector->setFixedWidth (static_cast<QAbstractItemView*> (mTwSelector)->sizeHintForColumn (0) + 2 * mTwSelector->frameWidth()); 293 294 /* Sort selector by the id column (to have pages in the desired order) */ 295 mTwSelector->sortItems (listView_Id, Qt::AscendingOrder); 296 mTwSelector->resizeColumnToContents (0); 297 310 298 mWarnIconLabel->setWarningText (tr ("Invalid settings detected")); 311 299 mButtonBox->button (QDialogButtonBox::Ok)->setWhatsThis (tr ("Accepts (saves) changes and closes the dialog."));
Note:
See TracChangeset
for help on using the changeset viewer.