VirtualBox

Changeset 46831 in vbox for trunk


Ignore:
Timestamp:
Jun 27, 2013 12:03:39 PM (12 years ago)
Author:
vboxsync
Message:

FE/Qt: Overall GUI cleanup: Removing old layout hack for Qt 4.2.

Location:
trunk/src/VBox/Frontends/VirtualBox/src
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxLicenseViewer.cpp

    r45358 r46831  
    2323#include "VBoxLicenseViewer.h"
    2424#include "QIDialogButtonBox.h"
    25 #include "VBoxGlobal.h"
    2625#include "UIMessageCenter.h"
    2726
     
    5958    QVBoxLayout *mainLayout = new QVBoxLayout (this);
    6059    mainLayout->setSpacing (10);
    61     VBoxGlobal::setLayoutMargin (mainLayout, 10);
     60    mainLayout->setContentsMargins(10, 10, 10, 10);
    6261    mainLayout->addWidget (mLicenseText);
    6362    mainLayout->addWidget (dbb);
  • trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIAdvancedSlider.cpp

    r46496 r46831  
    1919
    2020#include "QIAdvancedSlider.h"
    21 #include "VBoxGlobal.h"
    2221
    2322/* Qt includes */
     
    263262
    264263    QVBoxLayout *pMainLayout = new QVBoxLayout(this);
    265     VBoxGlobal::setLayoutMargin(pMainLayout, 0);
     264    pMainLayout->setContentsMargins(0, 0, 0, 0);
    266265    m_pSlider = new CPrivateSlider(fOrientation, this);
    267266    pMainLayout->addWidget(m_pSlider);
  • trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIArrowSplitter.cpp

    r45307 r46831  
    1919
    2020/* VBox includes */
    21 #include "VBoxGlobal.h"
    2221#include "QIArrowSplitter.h"
    2322
    2423/* Qt includes */
     24#include <QApplication>
    2525#include <QHBoxLayout>
    2626#include <QKeyEvent>
     
    3535{
    3636    /* Setup main-layout */
    37     VBoxGlobal::setLayoutMargin (mMainLayout, 0);
     37    mMainLayout->setContentsMargins(0, 0, 0, 0);
    3838    mMainLayout->setSpacing(3);
    3939
     
    4949    /* Setup button layout */
    5050    QHBoxLayout *buttonLayout = new QHBoxLayout();
    51     VBoxGlobal::setLayoutMargin (buttonLayout, 0);
     51    buttonLayout->setContentsMargins(0, 0, 0, 0);
    5252    buttonLayout->setSpacing (0);
    5353    buttonLayout->addWidget (mSwitchButton);
  • trunk/src/VBox/Frontends/VirtualBox/src/extensions/QILabelSeparator.cpp

    r44528 r46831  
    2424/* Local includes */
    2525#include "QILabelSeparator.h"
    26 #include "VBoxGlobal.h"
    2726
    2827QILabelSeparator::QILabelSeparator (QWidget *aParent /* = NULL */, Qt::WindowFlags aFlags /* = 0 */)
     
    7372
    7473    QHBoxLayout *pLayout = new QHBoxLayout (this);
    75     VBoxGlobal::setLayoutMargin (pLayout, 0);
     74    pLayout->setContentsMargins(0, 0, 0, 0);
    7675    pLayout->addWidget (mLabel);
    7776    pLayout->addWidget (separator, Qt::AlignBottom);
  • trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIMessageBox.cpp

    r45362 r46831  
    3333#include "QIArrowSplitter.h"
    3434#include "QIDialogButtonBox.h"
    35 #include "VBoxGlobal.h"
     35
     36/* Other VBox includes: */
     37#include <VBox/sup.h>
    3638
    3739QIMessageBox::QIMessageBox(const QString &strCaption, const QString &strMessage, AlertIconType iconType,
     
    202204        pMainLayout->setSpacing(15);
    203205#else /* !Q_WS_MAC */
    204         VBoxGlobal::setLayoutMargin(pMainLayout, 11);
     206        pMainLayout->setContentsMargins(11, 11, 11, 11);
    205207        pMainLayout->setSpacing(10);
    206208#endif /* !Q_WS_MAC */
     
    211213            pMainLayout->addLayout(pTopLayout);
    212214            /* Configure layout: */
    213             VBoxGlobal::setLayoutMargin(pTopLayout, 0);
     215            pTopLayout->setContentsMargins(0, 0, 0, 0);
    214216            pTopLayout->setSpacing(10);
    215217            /* Create icon-label: */
  • trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIRichToolButton.cpp

    r44528 r46831  
    1919
    2020/* VBox includes */
    21 #include "VBoxGlobal.h"
    2221#include "QIRichToolButton.h"
    2322
    2423/* Qt includes */
     24#include <QApplication>
    2525#include <QLabel>
    2626#include <QHBoxLayout>
     
    6464    /* Setup main-layout */
    6565    QHBoxLayout *mainLayout = new QHBoxLayout (this);
    66     VBoxGlobal::setLayoutMargin (mainLayout, 0);
     66    mainLayout->setContentsMargins(0, 0, 0, 0);
    6767    mainLayout->setSpacing (0);
    6868    mainLayout->addWidget (mButton);
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.h

    r46797 r46831  
    343343    static QList <QPair <QString, QString> > DVDBackends();
    344344    static QList <QPair <QString, QString> > FloppyBackends();
    345 
    346     /* Qt 4.2.0 support function */
    347     static inline void setLayoutMargin (QLayout *aLayout, int aMargin)
    348     {
    349 #if QT_VERSION < 0x040300
    350         /* Deprecated since > 4.2 */
    351         aLayout->setMargin (aMargin);
    352 #else
    353         /* New since > 4.2 */
    354         aLayout->setContentsMargins (aMargin, aMargin, aMargin, aMargin);
    355 #endif
    356     }
    357345
    358346    static QString documentsPath();
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumManager.cpp

    r46756 r46831  
    190190
    191191        QHBoxLayout *layout = new QHBoxLayout (this);
    192         VBoxGlobal::setLayoutMargin (layout, 0);
     192        layout->setContentsMargins(0, 0, 0, 0);
    193193        layout->addWidget (mText);
    194194        layout->addWidget (mProgressBar);
     
    367367    mToolBar->setMacToolbar();
    368368    /* No spacing/margin on the mac */
    369     VBoxGlobal::setLayoutMargin (mainLayout, 0);
     369    mainLayout->setContentsMargins(0, 0, 0, 0);
    370370    mainLayout->insertSpacing (0, 10);
    371371#else /* MAC_LEOPARD_STYLE */
     
    374374    /* Set spacing/margin like in the selector window */
    375375    mainLayout->setSpacing (5);
    376     VBoxGlobal::setLayoutMargin (mainLayout, 5);
     376    mainLayout->setContentsMargins(5, 5, 5, 5);
    377377#endif /* MAC_LEOPARD_STYLE */
    378378
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineWindowNormal.cpp

    r46797 r46831  
    240240    QWidget *pIndicatorBox = new QWidget;
    241241    QHBoxLayout *pIndicatorBoxHLayout = new QHBoxLayout(pIndicatorBox);
    242     VBoxGlobal::setLayoutMargin(pIndicatorBoxHLayout, 0);
     242    pIndicatorBoxHLayout->setContentsMargins(0, 0, 0, 0);
    243243    pIndicatorBoxHLayout->setSpacing(5);
    244244    bool fAtLeastOneAddedToLeftSection = false;
     
    335335            if (QHBoxLayout *pContainerLayoutHostkey = new QHBoxLayout(pContainerWidgetHostkey))
    336336            {
    337                 VBoxGlobal::setLayoutMargin(pContainerLayoutHostkey, 0);
     337                pContainerLayoutHostkey->setContentsMargins(0, 0, 0, 0);
    338338                pContainerLayoutHostkey->setSpacing(3);
    339339                m_pNameHostkey = new QLabel(UIHostCombo::toReadableString(vboxGlobal().settings().hostCombo()));
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/VBoxSettingsSelector.cpp

    r42261 r46831  
    2121#include <QHeaderView>
    2222#include <QTabWidget>
     23#include <QLayout>
     24#include <QAction>
    2325
    2426/* Local includes */
    2527#include "VBoxSettingsSelector.h"
    2628#include "UISettingsPage.h"
    27 #include "VBoxGlobal.h"
    2829#include "UIToolBar.h"
    2930#include "QITreeWidget.h"
     
    231232        twitem->setIcon (treeWidget_Category, item->icon());
    232233        aPage->setContentsMargins (0, 0, 0, 0);
    233         VBoxGlobal::setLayoutMargin (aPage->layout(), 0);
     234        aPage->layout()->setContentsMargins(0, 0, 0, 0);
    234235        result = aPage;
    235236    }
     
    424425        mTbSelector->addAction (item->action());
    425426        aPage->setContentsMargins (0, 0, 0, 0);
    426         VBoxGlobal::setLayoutMargin (aPage->layout(), 0);
     427        aPage->layout()->setContentsMargins(0, 0, 0, 0);
    427428        result = aPage;
    428429    }
     
    446447            QTabWidget *tabWidget = parent->tabWidget();
    447448            aPage->setContentsMargins (9, 5, 9, 9);
    448             VBoxGlobal::setLayoutMargin (aPage->layout(), 0);
     449            aPage->layout()->setContentsMargins(0, 0, 0, 0);
    449450            QIcon icon1 (aSmallIcon);
    450451            if (!aSmallIconDisabled.isEmpty())
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/VBoxWarningPane.cpp

    r37106 r46831  
    2323/* Local includes */
    2424#include "VBoxWarningPane.h"
    25 #include "VBoxGlobal.h"
    2625
    2726VBoxWarningPane::VBoxWarningPane(QWidget *pParent)
     
    2928{
    3029    QHBoxLayout *pLayout = new QHBoxLayout(this);
    31     VBoxGlobal::setLayoutMargin(pLayout, 0);
     30    pLayout->setContentsMargins(0, 0, 0, 0);
    3231    pLayout->addWidget(&m_icon);
    3332    pLayout->addWidget(&m_label);
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