~ubuntu-branches/ubuntu/precise/virtualbox/precise-updates

« back to all changes in this revision

Viewing changes to src/VBox/Frontends/VirtualBox/src/settings/VBoxSettingsSelector.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Felix Geyer
  • Date: 2011-07-04 13:02:31 UTC
  • mfrom: (3.1.1 sid)
  • Revision ID: james.westby@ubuntu.com-20110704130231-l843es6wqhx614n7
Tags: 4.0.10-dfsg-1ubuntu1
* Merge from Debian unstable, remaining changes:
  - Add Apport hook.
    - debian/virtualbox-ose.files/source_virtualbox-ose.py
    - debian/virtualbox-ose.install
  - Drop *-source packages.
* Add the Modaliases control field manually for maximum backportability.

Show diffs side-by-side

added added

removed removed

Lines of Context:
284
284
 
285
285
void VBoxSettingsTreeViewSelector::polish()
286
286
{
287
 
    mTwSelector->setFixedWidth (static_cast<QAbstractItemView*> (mTwSelector)
288
 
        ->sizeHintForColumn (treeWidget_Category) + 2 * mTwSelector->frameWidth());
289
 
 
290
 
    /* Sort selector by the id column */
291
 
    mTwSelector->sortItems (treeWidget_Id, Qt::AscendingOrder);
292
 
    mTwSelector->resizeColumnToContents (treeWidget_Category);
293
 
 
294
 
    /* Add some margin to every item in the tree */
295
 
    mTwSelector->addTopBottomMarginToItems (12);
 
287
    /* Get recommended size hint: */
 
288
    int iItemWidth = static_cast<QAbstractItemView*>(mTwSelector)->sizeHintForColumn(treeWidget_Category);
 
289
    int iItemHeight = qMax(16 /* icon height */, mTwSelector->fontMetrics().height() /* text height */);
 
290
    /* Add some margin to every item in the tree: */
 
291
    iItemHeight += 4 /* margin itself */ * 2 /* margin count */;
 
292
    /* Set final size hint for items: */
 
293
    mTwSelector->setSizeHintForItems(QSize(iItemWidth , iItemHeight));
 
294
 
 
295
    /* Fix selector width to minimum possible: */
 
296
    mTwSelector->setFixedWidth(iItemWidth + 2 * mTwSelector->frameWidth());
 
297
 
 
298
    /* Sort selector by the id column: */
 
299
    mTwSelector->sortItems(treeWidget_Id, Qt::AscendingOrder);
 
300
 
 
301
    /* Resize column(s) to content: */
 
302
    mTwSelector->resizeColumnToContents(treeWidget_Category);
296
303
}
297
304
 
298
305
void VBoxSettingsTreeViewSelector::settingsGroupChanged (QTreeWidgetItem *aItem,