VirtualBox

Changeset 7623 in vbox


Ignore:
Timestamp:
Mar 28, 2008 10:41:47 AM (17 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
29124
Message:

FE/Qt4: Added Qt 4.2 support function for setContentsMargins.

Location:
trunk/src/VBox/Frontends/VirtualBox4
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox4/include/VBoxUtils.h

    r7560 r7623  
    219219#endif // __VBoxUtils_h__
    220220
     221/* Qt 4.2.0 support function */
     222inline void setLayoutMargin (QLayout *aLayout, int aMargin)
     223{
     224#if QT_VERSION < 0x040200
     225    /* Deprecated since > 4.2 */
     226    aLayout->setMargin (aMargin);
     227#else
     228    /* New since > 4.2 */
     229    aLayout->setContentsMargins (aMargin, aMargin, aMargin, aMargin);
     230#endif
     231}
     232
  • trunk/src/VBox/Frontends/VirtualBox4/src/QIMessageBox.cpp

    r7369 r7623  
    2020#include "VBoxDefs.h"
    2121#include "QIRichLabel.h"
     22#include "VBoxUtils.h"
    2223
    2324/* Qt includes */
     
    5455
    5556    QVBoxLayout *layout = new QVBoxLayout (this);
    56     layout->setMargin (11);
     57    setLayoutMargin (layout, 11);
    5758    layout->setSpacing (10);
    5859    layout->setSizeConstraint (QLayout::SetMinimumSize);
     
    6162
    6263    QHBoxLayout *hLayout = new QHBoxLayout (main);
    63     hLayout->setContentsMargins (0, 0, 0, 0);
     64    setLayoutMargin (hLayout, 0);
    6465    hLayout->setSpacing (10);
    6566    layout->addWidget (main);
     
    7576
    7677    QVBoxLayout* messageVBoxLayout = new QVBoxLayout();
    77     messageVBoxLayout->setContentsMargins (0, 0, 0, 0);
     78    setLayoutMargin (messageVBoxLayout, 0);
    7879    messageVBoxLayout->setSpacing (10);
    7980    hLayout->addLayout (messageVBoxLayout);
     
    9596
    9697    QVBoxLayout* detailsVBoxLayout = new QVBoxLayout(mDetailsVBox);
    97     detailsVBoxLayout->setContentsMargins (0, 0, 0, 0);
     98    setLayoutMargin (detailsVBoxLayout, 0);
    9899    detailsVBoxLayout->setSpacing (10);
    99100
  • trunk/src/VBox/Frontends/VirtualBox4/src/VBoxConsoleWnd.cpp

    r7599 r7623  
    2929#include "QIStatusBar.h"
    3030#include "QIHotKeyEdit.h"
     31#include "VBoxUtils.h"
    3132
    3233/* Qt includes */
     
    396397    QWidget *indicatorBox = new QWidget ();
    397398    QHBoxLayout *indicatorBoxHLayout = new QHBoxLayout (indicatorBox);
    398     indicatorBoxHLayout->setContentsMargins (0, 0, 0, 0);
     399    setLayoutMargin (indicatorBoxHLayout, 0);
    399400    indicatorBoxHLayout->setSpacing (5);
    400401    /* i/o devices */
     
    464465    hostkey_hbox = new QWidget();
    465466    QHBoxLayout *hostkeyHBoxLayout = new QHBoxLayout (hostkey_hbox);
    466     hostkeyHBoxLayout->setContentsMargins (0, 0, 0, 0);
     467    setLayoutMargin (hostkeyHBoxLayout, 0);
    467468    hostkeyHBoxLayout->setSpacing (3);
    468469    indicatorBoxHLayout->addWidget (hostkey_hbox);
     
    651652        setCentralWidget (new QWidget (this));
    652653        QGridLayout *pMainLayout = new QGridLayout(centralWidget());
    653         pMainLayout->setContentsMargins (0, 0, 0, 0);
     654        setLayoutMargin (pMainLayout, 0);
    654655        pMainLayout->setSpacing (0);
    655656
     
    34453446    /* Setup main dialog's layout */
    34463447    QVBoxLayout *mainLayout = new QVBoxLayout (this);
    3447     mainLayout->setContentsMargins (10, 10, 10, 10);
     3448    setLayoutMargin (mainLayout, 10);
    34483449    mainLayout->setSpacing (10);
    34493450
  • trunk/src/VBox/Frontends/VirtualBox4/src/VBoxSelectorWnd.cpp

    r7611 r7623  
    2929#include "VBoxGlobalSettingsDlg.h"
    3030#include "VBoxVMLogViewer.h"
     31#include "VBoxUtils.h"
    3132
    3233#ifdef Q_WS_X11
     
    245246    QVBoxLayout *vMainLayout = new QVBoxLayout (this);
    246247    vMainLayout->setSpacing (10);
    247     vMainLayout->setContentsMargins (0, 0, 0, 0);
     248    setLayoutMargin (vMainLayout, 0);
    248249
    249250    /* mBrowser */
     
    453454        new QHBoxLayout (centralWidget());
    454455    centralLayout->setSpacing (9);
    455     centralLayout->setContentsMargins (5, 5, 5, 5);
     456    setLayoutMargin (centralLayout, 5);
    456457
    457458    /* left vertical box */
Note: See TracChangeset for help on using the changeset viewer.

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