VirtualBox

Changeset 43782 in vbox


Ignore:
Timestamp:
Oct 31, 2012 11:12:47 AM (12 years ago)
Author:
vboxsync
Message:

FE/Qt: VM group UI: Some size-handling cleanup for group-item.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserItemGroup.cpp

    r43779 r43782  
    345345            int iHorizontalMargin = data(GroupItemData_HorizonalMargin).toInt();
    346346            int iMajorSpacing = data(GroupItemData_MajorSpacing).toInt();
    347             int iToggleButtonWidth = data(GroupItemData_ToggleButtonSize).toSizeF().width();
    348             int iEnterButtonWidth = data(GroupItemData_EnterButtonSize).toSizeF().width();
    349             int iExitButtonWidth = data(GroupItemData_ExitButtonSize).toSizeF().width();
     347            int iToggleButtonWidth = data(GroupItemData_ToggleButtonSize).toSize().width();
     348            int iEnterButtonWidth = data(GroupItemData_EnterButtonSize).toSize().width();
     349            int iExitButtonWidth = data(GroupItemData_ExitButtonSize).toSize().width();
    350350            int iGroupPixmapWidth = data(GroupItemData_GroupPixmapSize).toSize().width();
    351351            int iMachinePixmapWidth = data(GroupItemData_MachinePixmapSize).toSize().width();
     
    377377        case GroupItemData_MachineCountText: return m_machineItems.isEmpty() ? QString() : QString::number(m_machineItems.size());
    378378        /* Sizes: */
    379         case GroupItemData_ToggleButtonSize: return m_pToggleButton ? m_pToggleButton->minimumSizeHint() : QSizeF(0, 0);
    380         case GroupItemData_EnterButtonSize: return m_pEnterButton ? m_pEnterButton->minimumSizeHint() : QSizeF(0, 0);
    381         case GroupItemData_ExitButtonSize: return m_pExitButton ? m_pExitButton->minimumSizeHint() : QSizeF(0, 0);
     379        case GroupItemData_ToggleButtonSize: return m_pToggleButton ? m_pToggleButton->minimumSizeHint().toSize() : QSize(0, 0);
     380        case GroupItemData_EnterButtonSize: return m_pEnterButton ? m_pEnterButton->minimumSizeHint().toSize() : QSize(0, 0);
     381        case GroupItemData_ExitButtonSize: return m_pExitButton ? m_pExitButton->minimumSizeHint().toSize() : QSize(0, 0);
    382382        case GroupItemData_MinimumNameSize:
    383383        {
    384384            if (isMainRoot())
    385                 return QSizeF(0, 0);
     385                return QSize(0, 0);
    386386            QFont font = data(GroupItemData_NameFont).value<QFont>();
    387387            QPaintDevice *pPaintDevice = model()->paintDevice();
     
    395395        {
    396396            if (isMainRoot())
    397                 return QSizeF(0, 0);
     397                return QSize(0, 0);
    398398            QFontMetrics fm(data(GroupItemData_NameFont).value<QFont>(), model()->paintDevice());
    399399            return QSize(fm.width(data(GroupItemData_Name).toString()) + 2, fm.height());
    400         }
    401         case GroupItemData_NameEditorSize:
    402         {
    403             if (isRoot())
    404                 return QSizeF(0, 0);
    405             return m_pNameEditorWidget->minimumSizeHint();
    406400        }
    407401        case GroupItemData_GroupPixmapSize:
     
    412406        {
    413407            if (isMainRoot())
    414                 return QSizeF(0, 0);
     408                return QSize(0, 0);
    415409            QFontMetrics fm(data(GroupItemData_InfoFont).value<QFont>(), model()->paintDevice());
    416410            return QSize(fm.width(data(GroupItemData_GroupCountText).toString()), fm.height());
     
    419413        {
    420414            if (isMainRoot())
    421                 return QSizeF(0, 0);
     415                return QSize(0, 0);
    422416            QFontMetrics fm(data(GroupItemData_InfoFont).value<QFont>(), model()->paintDevice());
    423417            return QSize(fm.width(data(GroupItemData_MachineCountText).toString()), fm.height());
     
    885879
    886880                /* Prepare variables: */
    887                 int iExitButtonHeight = data(GroupItemData_ExitButtonSize).toSizeF().height();
     881                int iExitButtonHeight = data(GroupItemData_ExitButtonSize).toSize().height();
    888882
    889883                /* Layout exit-button: */
     
    915909        /* Prepare variables: */
    916910        int iFullWidth = geometry().width();
    917         QSizeF toggleButtonSize = data(GroupItemData_ToggleButtonSize).toSizeF().toSize();
     911        QSizeF toggleButtonSize = data(GroupItemData_ToggleButtonSize).toSize();
    918912        int iToggleButtonWidth = toggleButtonSize.width();
    919913        int iButtonHeight = toggleButtonSize.height();
    920         QSizeF enterButtonSize = data(GroupItemData_EnterButtonSize).toSizeF().toSize();
     914        QSizeF enterButtonSize = data(GroupItemData_EnterButtonSize).toSize();
    921915        int iEnterButtonWidth = enterButtonSize.width();
    922916        int iEnterButtonHeight = enterButtonSize.height();
     
    15091503        QRect fullRect = pOption->rect;
    15101504        int iMinorSpacing = data(GroupItemData_MinorSpacing).toInt();
    1511         int iEnterButtonWidth = data(GroupItemData_EnterButtonSize).toSizeF().width();
     1505        int iEnterButtonWidth = data(GroupItemData_EnterButtonSize).toSize().width();
    15121506        QSize groupPixmapSize = data(GroupItemData_GroupPixmapSize).toSize();
    15131507        QSize machinePixmapSize = data(GroupItemData_MachinePixmapSize).toSize();
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserItemGroup.h

    r43779 r43782  
    118118        GroupItemData_MinimumNameSize,
    119119        GroupItemData_NameSize,
    120         GroupItemData_NameEditorSize,
    121120        GroupItemData_GroupPixmapSize,
    122121        GroupItemData_MachinePixmapSize,
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette