VirtualBox

Changeset 104985 in vbox


Ignore:
Timestamp:
Jun 20, 2024 2:26:50 PM (9 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
163595
Message:

FE/Qt: bugref:10666, bugref:10669: Reworking layout for hard disk Format and Variant editors; Got rid of unwanted contents margins; Using grid layout; Replace QIComboBox to QComboBox.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/wizards
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/clonevd/UIWizardCloneVDExpertPage.cpp

    r103957 r104985  
    2727
    2828/* Qt includes: */
     29#include <QApplication>
    2930#include <QDir>
    3031#include <QGridLayout>
     32#include <QStyle>
    3133
    3234/* GUI includes: */
     
    7981    if (m_pFormatVariantGroupBox)
    8082    {
    81         QHBoxLayout *pFormatVariantLayout = new QHBoxLayout(m_pFormatVariantGroupBox);
    82         pFormatVariantLayout->addWidget(m_pFormatComboBox, 0, Qt::AlignTop);
    83         pFormatVariantLayout->addWidget(m_pVariantWidget);
     83        QGridLayout *pFormatVariantLayout = new QGridLayout(m_pFormatVariantGroupBox);
     84#ifdef VBOX_WS_MAC
     85        pFormatVariantLayout->setSpacing(2 * 5);
     86#else
     87        pFormatVariantLayout->setSpacing(2 * qApp->style()->pixelMetric(QStyle::PM_LayoutHorizontalSpacing));
     88#endif
     89        pFormatVariantLayout->setRowStretch(2, 1);
     90        pFormatVariantLayout->setColumnStretch(0, 1);
     91        pFormatVariantLayout->addWidget(m_pFormatComboBox, 0, 0);
     92        pFormatVariantLayout->addWidget(m_pVariantWidget, 0, 1, 2, 1);
    8493        pMainLayout->addWidget(m_pFormatVariantGroupBox);
    8594    }
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/editors/UIWizardDiskEditors.cpp

    r104639 r104985  
    3232#include <QDir>
    3333#include <QFileInfo>
     34#include <QGridLayout>
    3435#include <QLabel>
    3536#include <QRadioButton>
     
    197198void UIDiskVariantWidget::prepare()
    198199{
    199     QVBoxLayout *pVariantLayout = new QVBoxLayout(this);
     200    QGridLayout *pVariantLayout = new QGridLayout(this);
    200201    AssertReturnVoid(pVariantLayout);
     202    pVariantLayout->setContentsMargins(0, 0, 0, 0);
     203    pVariantLayout->setRowStretch(2, 1);
    201204    m_pFixedCheckBox = new QCheckBox;
    202205    m_pSplitBox = new QCheckBox;
    203206    connect(m_pFixedCheckBox, &QCheckBox::toggled, this, &UIDiskVariantWidget::sltVariantChanged);
    204207    connect(m_pSplitBox, &QCheckBox::toggled, this, &UIDiskVariantWidget::sltVariantChanged);
    205     pVariantLayout->addWidget(m_pFixedCheckBox);
    206     pVariantLayout->addWidget(m_pSplitBox);
    207     pVariantLayout->addStretch();
     208    pVariantLayout->addWidget(m_pFixedCheckBox, 0, 0);
     209    pVariantLayout->addWidget(m_pSplitBox, 1, 0);
    208210    sltRetranslateUI();
    209211    connect(&translationEventListener(), &UITranslationEventListener::sigRetranslateUI,
     
    605607{
    606608    m_pMainLayout = new QVBoxLayout(this);
     609    m_pMainLayout->setContentsMargins(0, 0, 0, 0);
    607610    populateFormats();
    608611    createFormatWidgets();
     
    661664
    662665UIDiskFormatsComboBox::UIDiskFormatsComboBox(bool fExpertMode, KDeviceType enmDeviceType, QWidget *pParent /* = 0 */)
    663     : QIComboBox(pParent)
     666    : QComboBox(pParent)
    664667    , UIDiskFormatBase(enmDeviceType, fExpertMode)
    665668{
     
    675678    }
    676679
    677     connect(this, &QIComboBox::currentIndexChanged,
     680    connect(this, &QComboBox::currentIndexChanged,
    678681            this, &UIDiskFormatsComboBox::sigMediumFormatChanged);
    679682
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/editors/UIWizardDiskEditors.h

    r103982 r104985  
    3333
    3434/* Qt includes: */
     35#include <QComboBox>
    3536#include <QIcon>
    3637#include <QGroupBox>
    3738#include <QVector>
    38 
    39 /* Local includes: */
    40 #include "QIComboBox.h"
    4139
    4240/* Forward declarations: */
     
    225223};
    226224
    227 class SHARED_LIBRARY_STUFF UIDiskFormatsComboBox : public QIComboBox, public UIDiskFormatBase
     225class SHARED_LIBRARY_STUFF UIDiskFormatsComboBox : public QComboBox, public UIDiskFormatBase
    228226{
    229227    Q_OBJECT;
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvd/UIWizardNewVDExpertPage.cpp

    r103957 r104985  
    2727
    2828/* Qt includes: */
     29#include <QApplication>
    2930#include <QDir>
    3031#include <QGridLayout>
     32#include <QStyle>
    3133
    3234/* GUI includes: */
     
    6365
    6466    m_pFormatVariantGroupBox = new QGroupBox;
    65     QHBoxLayout *pFormatVariantLayout = new QHBoxLayout(m_pFormatVariantGroupBox);
    66     pFormatVariantLayout->addWidget(m_pFormatComboBox, 0, Qt::AlignTop);
    67     pFormatVariantLayout->addWidget(m_pVariantWidget);
     67    QGridLayout *pFormatVariantLayout = new QGridLayout(m_pFormatVariantGroupBox);
     68#ifdef VBOX_WS_MAC
     69    pFormatVariantLayout->setSpacing(2 * 5);
     70#else
     71    pFormatVariantLayout->setSpacing(2 * qApp->style()->pixelMetric(QStyle::PM_LayoutHorizontalSpacing));
     72#endif
     73    pFormatVariantLayout->setRowStretch(2, 1);
     74    pFormatVariantLayout->setColumnStretch(0, 1);
     75    pFormatVariantLayout->addWidget(m_pFormatComboBox, 0, 0);
     76    pFormatVariantLayout->addWidget(m_pVariantWidget, 0, 1, 2, 1);
    6877
    6978    pMainLayout->addWidget(m_pSizeAndPathGroup);
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