VirtualBox

Changeset 84283 in vbox


Ignore:
Timestamp:
May 13, 2020 11:38:51 AM (5 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
137920
Message:

FE/Qt: bugref:9653: New Cloud VM wizard: Layout fixes for first basic and expert pages.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newcloudvm
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newcloudvm/UIWizardNewCloudVMPageBasic1.cpp

    r84277 r84283  
    4545UIWizardNewCloudVMPage1::UIWizardNewCloudVMPage1()
    4646    : m_fPolished(false)
    47     , m_pLocationLayout(0)
    4847    , m_pLocationLabel(0)
    4948    , m_pLocationComboBox(0)
    50     , m_pCloudContainerLayout(0)
    5149    , m_pAccountLabel(0)
    5250    , m_pAccountComboBox(0)
     
    516514UIWizardNewCloudVMPageBasic1::UIWizardNewCloudVMPageBasic1()
    517515    : m_pLabelMain(0)
     516    , m_pLocationLayout(0)
    518517    , m_pLabelDescription(0)
     518    , m_pOptionsLayout(0)
    519519{
    520520    /* Create main layout: */
     
    534534        if (m_pLocationLayout)
    535535        {
     536            m_pLocationLayout->setContentsMargins(0, 0, 0, 0);
    536537            m_pLocationLayout->setColumnStretch(0, 0);
    537538            m_pLocationLayout->setColumnStretch(1, 1);
     
    544545                m_pLocationLayout->addWidget(m_pLocationLabel, 0, 0, Qt::AlignRight);
    545546            }
    546             /* Create location selector: */
     547            /* Create location combo-box: */
    547548            m_pLocationComboBox = new QIComboBox(this);
    548549            if (m_pLocationComboBox)
     
    554555            }
    555556
    556             /* Create description label: */
    557             m_pLabelDescription = new QIRichTextLabel(this);
    558             if (m_pLabelDescription)
    559             {
    560                 /* Add into layout: */
    561                 m_pLocationLayout->addWidget(m_pLabelDescription, 1, 0, 1, 2);
    562             }
    563 
    564557            /* Add into layout: */
    565558            pMainLayout->addLayout(m_pLocationLayout);
    566559        }
    567560
    568         /* Create cloud container layout: */
    569         m_pCloudContainerLayout = new QGridLayout;
    570         if (m_pCloudContainerLayout)
    571         {
    572             m_pCloudContainerLayout->setContentsMargins(0, 0, 0, 0);
    573             m_pCloudContainerLayout->setColumnStretch(0, 0);
    574             m_pCloudContainerLayout->setColumnStretch(1, 1);
    575             m_pCloudContainerLayout->setRowStretch(2, 0);
    576             m_pCloudContainerLayout->setRowStretch(3, 1);
     561        /* Create description label: */
     562        m_pLabelDescription = new QIRichTextLabel(this);
     563        if (m_pLabelDescription)
     564        {
     565            /* Add into layout: */
     566            pMainLayout->addWidget(m_pLabelDescription);
     567        }
     568
     569        /* Create options layout: */
     570        m_pOptionsLayout = new QGridLayout;
     571        if (m_pOptionsLayout)
     572        {
     573            m_pOptionsLayout->setContentsMargins(0, 0, 0, 0);
     574            m_pOptionsLayout->setColumnStretch(0, 0);
     575            m_pOptionsLayout->setColumnStretch(1, 1);
     576            m_pOptionsLayout->setRowStretch(2, 0);
     577            m_pOptionsLayout->setRowStretch(3, 1);
    577578
    578579            /* Create account label: */
     
    581582            {
    582583                /* Add into layout: */
    583                 m_pCloudContainerLayout->addWidget(m_pAccountLabel, 0, 0, Qt::AlignRight);
    584             }
    585             /* Create sub-layout: */
     584                m_pOptionsLayout->addWidget(m_pAccountLabel, 0, 0, Qt::AlignRight);
     585            }
     586            /* Create account layout: */
    586587            QHBoxLayout *pAccountLayout = new QHBoxLayout;
    587588            if (pAccountLayout)
     
    611612
    612613                /* Add into layout: */
    613                 m_pCloudContainerLayout->addLayout(pAccountLayout, 0, 1);
    614             }
    615 
    616             /* Create profile property table: */
     614                m_pOptionsLayout->addLayout(pAccountLayout, 0, 1);
     615            }
     616
     617            /* Create account property table: */
    617618            m_pAccountPropertyTable = new QTableWidget(this);
    618619            if (m_pAccountPropertyTable)
     
    631632
    632633                /* Add into layout: */
    633                 m_pCloudContainerLayout->addWidget(m_pAccountPropertyTable, 1, 1);
     634                m_pOptionsLayout->addWidget(m_pAccountPropertyTable, 1, 1);
    634635            }
    635636
     
    639640            {
    640641                /* Add into layout: */
    641                 m_pCloudContainerLayout->addWidget(m_pSourceImageLabel, 2, 0, Qt::AlignRight);
     642                m_pOptionsLayout->addWidget(m_pSourceImageLabel, 2, 0, Qt::AlignRight);
    642643            }
    643644            /* Create source image list: */
     
    656657
    657658                /* Add into layout: */
    658                 m_pCloudContainerLayout->addWidget(m_pSourceImageList, 2, 1, 2, 1);
     659                m_pOptionsLayout->addWidget(m_pSourceImageList, 2, 1, 2, 1);
    659660            }
    660661
    661662            /* Add into layout: */
    662             pMainLayout->addLayout(m_pCloudContainerLayout);
     663            pMainLayout->addLayout(m_pOptionsLayout);
    663664        }
    664665    }
     
    740741        iMaxWidth = qMax(iMaxWidth, pLabel->minimumSizeHint().width());
    741742    m_pLocationLayout->setColumnMinimumWidth(0, iMaxWidth);
    742     m_pCloudContainerLayout->setColumnMinimumWidth(0, iMaxWidth);
     743    m_pOptionsLayout->setColumnMinimumWidth(0, iMaxWidth);
    743744
    744745    /* Update tool-tips: */
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newcloudvm/UIWizardNewCloudVMPageBasic1.h

    r84277 r84283  
    120120    CCloudProfile          m_comCloudProfile;
    121121
    122     /** Holds the location layout instance. */
    123     QGridLayout *m_pLocationLayout;
    124122    /** Holds the location type label instance. */
    125123    QLabel      *m_pLocationLabel;
     
    127125    QIComboBox  *m_pLocationComboBox;
    128126
    129     /** Holds the cloud container layout instance. */
    130     QGridLayout  *m_pCloudContainerLayout;
    131127    /** Holds the account label instance. */
    132128    QLabel       *m_pAccountLabel;
     
    190186    /** Holds the main label instance. */
    191187    QIRichTextLabel *m_pLabelMain;
     188    /** Holds the location layout instance. */
     189    QGridLayout     *m_pLocationLayout;
    192190    /** Holds the description label instance. */
    193191    QIRichTextLabel *m_pLabelDescription;
     192    /** Holds the options layout instance. */
     193    QGridLayout     *m_pOptionsLayout;
    194194};
    195195
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newcloudvm/UIWizardNewCloudVMPageExpert.cpp

    r84277 r84283  
    4646        if (m_pCntLocation)
    4747        {
    48             /* There is no location table in short wizard form: */
     48            /* There is no location container in short wizard form: */
    4949            if (!m_fFullWizard)
    5050                m_pCntLocation->setVisible(false);
    5151
    5252            /* Create location layout: */
    53             m_pLocationLayout = new QGridLayout(m_pCntLocation);
    54             if (m_pLocationLayout)
     53            QVBoxLayout *pLocationLayout = new QVBoxLayout(m_pCntLocation);
     54            if (pLocationLayout)
    5555            {
    56                 /* Create location selector: */
     56                /* Create location combo-box: */
    5757                m_pLocationComboBox = new QIComboBox(m_pCntLocation);
    5858                if (m_pLocationComboBox)
    5959                {
    6060                    /* Add into layout: */
    61                     m_pLocationLayout->addWidget(m_pLocationComboBox, 0, 0);
    62                 }
    63 
    64                 /* Create cloud container layout: */
    65                 m_pCloudContainerLayout = new QGridLayout;
    66                 if (m_pCloudContainerLayout)
    67                 {
    68                     m_pCloudContainerLayout->setContentsMargins(0, 0, 0, 0);
    69                     m_pCloudContainerLayout->setRowStretch(3, 1);
    70 
    71                     /* Create sub-layout: */
    72                     QHBoxLayout *pSubLayout = new QHBoxLayout;
    73                     if (pSubLayout)
     61                    pLocationLayout->addWidget(m_pLocationComboBox);
     62                }
     63
     64                /* Create account layout: */
     65                QHBoxLayout *pAccountLayout = new QHBoxLayout;
     66                if (pAccountLayout)
     67                {
     68                    pAccountLayout->setContentsMargins(0, 0, 0, 0);
     69                    pAccountLayout->setSpacing(1);
     70
     71                    /* Create account combo-box: */
     72                    m_pAccountComboBox = new QIComboBox(m_pCntLocation);
     73                    if (m_pAccountComboBox)
    7474                    {
    75                         pSubLayout->setContentsMargins(0, 0, 0, 0);
    76                         pSubLayout->setSpacing(1);
    77 
    78                         /* Create account combo-box: */
    79                         m_pAccountComboBox = new QIComboBox(m_pCntLocation);
    80                         if (m_pAccountComboBox)
    81                         {
    82                             /* Add into layout: */
    83                             pSubLayout->addWidget(m_pAccountComboBox);
    84                         }
    85                         /* Create account tool-button: */
    86                         m_pAccountToolButton = new QIToolButton(m_pCntLocation);
    87                         if (m_pAccountToolButton)
    88                         {
    89                             m_pAccountToolButton->setIcon(UIIconPool::iconSet(":/cloud_profile_manager_16px.png",
    90                                                                               ":/cloud_profile_manager_disabled_16px.png"));
    91 
    92                             /* Add into layout: */
    93                             pSubLayout->addWidget(m_pAccountToolButton);
    94                         }
    95 
    9675                        /* Add into layout: */
    97                         m_pCloudContainerLayout->addLayout(pSubLayout, 0, 0);
     76                        pAccountLayout->addWidget(m_pAccountComboBox);
    9877                    }
    99 
    100                     /* Create profile property table: */
    101                     m_pAccountPropertyTable = new QTableWidget(m_pCntLocation);
    102                     if (m_pAccountPropertyTable)
     78                    /* Create account tool-button: */
     79                    m_pAccountToolButton = new QIToolButton(m_pCntLocation);
     80                    if (m_pAccountToolButton)
    10381                    {
    104                         const QFontMetrics fm(m_pAccountPropertyTable->font());
    105                         const int iFontWidth = fm.width('x');
    106                         const int iTotalWidth = 50 * iFontWidth;
    107                         const int iFontHeight = fm.height();
    108                         const int iTotalHeight = 4 * iFontHeight;
    109                         m_pAccountPropertyTable->setMinimumSize(QSize(iTotalWidth, iTotalHeight));
    110                         //m_pAccountPropertyTable->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored);
    111                         m_pAccountPropertyTable->setAlternatingRowColors(true);
    112                         m_pAccountPropertyTable->horizontalHeader()->setVisible(false);
    113                         m_pAccountPropertyTable->verticalHeader()->setVisible(false);
    114                         m_pAccountPropertyTable->verticalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);
     82                        m_pAccountToolButton->setIcon(UIIconPool::iconSet(":/cloud_profile_manager_16px.png",
     83                                                                          ":/cloud_profile_manager_disabled_16px.png"));
    11584
    11685                        /* Add into layout: */
    117                         m_pCloudContainerLayout->addWidget(m_pAccountPropertyTable, 1, 0);
     86                        pAccountLayout->addWidget(m_pAccountToolButton);
    11887                    }
    11988
    120                     /* Create source image list: */
    121                     m_pSourceImageList = new QListWidget(m_pCntLocation);
    122                     if (m_pSourceImageList)
    123                     {
    124                         const QFontMetrics fm(m_pSourceImageList->font());
    125                         const int iFontWidth = fm.width('x');
    126                         const int iTotalWidth = 50 * iFontWidth;
    127                         const int iFontHeight = fm.height();
    128                         const int iTotalHeight = 4 * iFontHeight;
    129                         m_pSourceImageList->setMinimumSize(QSize(iTotalWidth, iTotalHeight));
    130                         //m_pSourceImageList->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored);
    131                         m_pSourceImageList->setAlternatingRowColors(true);
    132 
    133                         /* Add into layout: */
    134                         m_pCloudContainerLayout->addWidget(m_pSourceImageList, 2, 0);
    135                     }
    136 
    137                     /* Add into layout: */
    138                     m_pLocationLayout->addLayout(m_pCloudContainerLayout, 1, 0);
     89                    /* Add into layout: */
     90                    pLocationLayout->addLayout(pAccountLayout);
     91                }
     92
     93                /* Create account property table: */
     94                m_pAccountPropertyTable = new QTableWidget(m_pCntLocation);
     95                if (m_pAccountPropertyTable)
     96                {
     97                    const QFontMetrics fm(m_pAccountPropertyTable->font());
     98                    const int iFontWidth = fm.width('x');
     99                    const int iTotalWidth = 50 * iFontWidth;
     100                    const int iFontHeight = fm.height();
     101                    const int iTotalHeight = 4 * iFontHeight;
     102                    m_pAccountPropertyTable->setMinimumSize(QSize(iTotalWidth, iTotalHeight));
     103                    //m_pAccountPropertyTable->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored);
     104                    m_pAccountPropertyTable->setAlternatingRowColors(true);
     105                    m_pAccountPropertyTable->horizontalHeader()->setVisible(false);
     106                    m_pAccountPropertyTable->verticalHeader()->setVisible(false);
     107                    m_pAccountPropertyTable->verticalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);
     108
     109                    /* Add into layout: */
     110                    pLocationLayout->addWidget(m_pAccountPropertyTable);
     111                }
     112
     113                /* Create source image list: */
     114                m_pSourceImageList = new QListWidget(m_pCntLocation);
     115                if (m_pSourceImageList)
     116                {
     117                    const QFontMetrics fm(m_pSourceImageList->font());
     118                    const int iFontWidth = fm.width('x');
     119                    const int iTotalWidth = 50 * iFontWidth;
     120                    const int iFontHeight = fm.height();
     121                    const int iTotalHeight = 4 * iFontHeight;
     122                    m_pSourceImageList->setMinimumSize(QSize(iTotalWidth, iTotalHeight));
     123                    //m_pSourceImageList->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored);
     124                    m_pSourceImageList->setAlternatingRowColors(true);
     125
     126                    /* Add into layout: */
     127                    pLocationLayout->addWidget(m_pSourceImageList);
    139128                }
    140129            }
     
    148137        if (m_pSettingsCnt)
    149138        {
    150             /* Create form editor layout: */
    151             QVBoxLayout *pFormEditorLayout = new QVBoxLayout(m_pSettingsCnt);
    152             if (pFormEditorLayout)
     139            /* Create settings layout: */
     140            QVBoxLayout *pSettingsLayout = new QVBoxLayout(m_pSettingsCnt);
     141            if (pSettingsLayout)
    153142            {
    154143                /* Create form editor widget: */
     
    164153
    165154                    /* Add into layout: */
    166                     pFormEditorLayout->addWidget(m_pFormEditor);
     155                    pSettingsLayout->addWidget(m_pFormEditor);
    167156                }
    168157            }
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