VirtualBox

Ignore:
Timestamp:
Apr 18, 2016 1:23:14 PM (9 years ago)
Author:
vboxsync
Message:

FE/Qt: Qt5 migration (part 112): Selector UI: Details pane: Simplifying preview element layout due to Qt5 changes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGDetailsElements.cpp

    r60362 r60538  
    128128    setIcon(gpConverter->toIcon(elementType()));
    129129
    130     /* Create layout: */
    131     QGraphicsLinearLayout *pLayout = new QGraphicsLinearLayout;
    132     AssertPtr(pLayout);
    133     {
    134         /* Prepare layout: */
     130    /* Create preview: */
     131    m_pPreview = new UIGMachinePreview(this);
     132    AssertPtr(m_pPreview);
     133    {
     134        /* Configure preview: */
     135        connect(m_pPreview, SIGNAL(sigSizeHintChanged()),
     136                this, SLOT(sltPreviewSizeHintChanged()));
    135137        const int iMargin = data(ElementData_Margin).toInt();
    136         pLayout->setContentsMargins(iMargin, 2 * iMargin + minimumHeaderHeight(), iMargin, iMargin);
    137         /* Assign layout to widget: */
    138         setLayout(pLayout);
    139         /* Create preview: */
    140         m_pPreview = new UIGMachinePreview(this);
    141         AssertPtr(m_pPreview);
    142         {
    143             /* Prepare preview: */
    144             connect(m_pPreview, SIGNAL(sigSizeHintChanged()),
    145                     this, SLOT(sltPreviewSizeHintChanged()));
    146             /* Add preview into layout: */
    147             pLayout->addItem(m_pPreview);
    148         }
    149     }
    150 
    151     /* Set fixed size policy finally (after all content constructed): */
    152     setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
     138        m_pPreview->setPos(iMargin, 2 * iMargin + minimumHeaderHeight());
     139        m_pPreview->resize(m_pPreview->minimumSizeHint());
     140    }
    153141
    154142    /* Translate finally: */
     
    238226    /* Set new machine attribute directly: */
    239227    m_pPreview->setMachine(machine());
     228    m_pPreview->resize(m_pPreview->minimumSizeHint());
    240229    emit sigBuildDone();
    241230}
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