VirtualBox

Ignore:
Timestamp:
Jul 3, 2020 11:18:35 AM (5 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9515: UINameAndSystemEditor: A possibility to define layout indent for labels of the left column; This is necessary to properly embed this composite widget into more complex grid layouts.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/widgets
Files:
2 edited

Legend:

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

    r85051 r85052  
    4949    , m_fSupportsHWVirtEx(false)
    5050    , m_fSupportsLongMode(false)
     51    , m_pMainLayout(0)
    5152    , m_pNameLabel(0)
    5253    , m_pPathLabel(0)
     
    6061{
    6162    prepare();
     63}
     64
     65void UINameAndSystemEditor::setMinimumLayoutIndent(int iIndent)
     66{
     67    if (m_pMainLayout)
     68        m_pMainLayout->setColumnMinimumWidth(0, iIndent);
    6269}
    6370
     
    367374{
    368375    /* Create main-layout: */
    369     QGridLayout *pMainLayout = new QGridLayout(this);
    370     if (pMainLayout)
    371     {
    372         pMainLayout->setContentsMargins(0, 0, 0, 0);
    373         pMainLayout->setColumnStretch(0, 0);
    374         pMainLayout->setColumnStretch(1, 1);
     376    m_pMainLayout = new QGridLayout(this);
     377    if (m_pMainLayout)
     378    {
     379        m_pMainLayout->setContentsMargins(0, 0, 0, 0);
     380        m_pMainLayout->setColumnStretch(0, 0);
     381        m_pMainLayout->setColumnStretch(1, 1);
    375382
    376383        int iRow = 0;
     
    386393
    387394                /* Add into layout: */
    388                 pMainLayout->addWidget(m_pNameLabel, iRow, 0, 1, 1);
     395                m_pMainLayout->addWidget(m_pNameLabel, iRow, 0, 1, 1);
    389396            }
    390397            /* Create name editor: */
     
    393400            {
    394401                /* Add into layout: */
    395                 pMainLayout->addWidget(m_pNameLineEdit, iRow, 1, 1, 2);
     402                m_pMainLayout->addWidget(m_pNameLineEdit, iRow, 1, 1, 2);
    396403            }
    397404
     
    409416
    410417                /* Add into layout: */
    411                 pMainLayout->addWidget(m_pPathLabel, iRow, 0, 1, 1);
     418                m_pMainLayout->addWidget(m_pPathLabel, iRow, 0, 1, 1);
    412419            }
    413420            /* Create path selector: */
     
    420427
    421428                /* Add into layout: */
    422                 pMainLayout->addWidget(m_pPathSelector, iRow, 1, 1, 2);
     429                m_pMainLayout->addWidget(m_pPathSelector, iRow, 1, 1, 2);
    423430            }
    424431
     
    436443
    437444                /* Add into layout: */
    438                 pMainLayout->addWidget(m_pLabelFamily, iRow, 0);
     445                m_pMainLayout->addWidget(m_pLabelFamily, iRow, 0);
    439446            }
    440447
     
    449456
    450457                /* Add into layout: */
    451                 pMainLayout->addWidget(m_pComboFamily, iRow, 1);
     458                m_pMainLayout->addWidget(m_pComboFamily, iRow, 1);
    452459            }
    453460
     
    462469
    463470                /* Add into layout: */
    464                 pMainLayout->addWidget(m_pLabelType, iRow, 0);
     471                m_pMainLayout->addWidget(m_pLabelType, iRow, 0);
    465472            }
    466473            /* Create VM OS type combo: */
     
    472479
    473480                /* Add into layout: */
    474                 pMainLayout->addWidget(m_pComboType, iRow, 1);
     481                m_pMainLayout->addWidget(m_pComboType, iRow, 1);
    475482            }
    476483
     
    495502
    496503                /* Add into layout: */
    497                 pMainLayout->addLayout(pLayoutIcon, iIconRow, 2, 2, 1);
     504                m_pMainLayout->addLayout(pLayoutIcon, iIconRow, 2, 2, 1);
    498505            }
    499506
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UINameAndSystemEditor.h

    r83902 r85052  
    3535/* Forward declarations: */
    3636class QComboBox;
     37class QGridLayout;
    3738class QLabel;
    3839class QILineEdit;
     
    7475                          bool fChoosePath = false,
    7576                          bool fChooseType = true);
     77
     78    /** Defines minimum layout @a iIndent. */
     79    void setMinimumLayoutIndent(int iIndent);
    7680
    7781    /** Defines whether VM name stuff is @a fEnabled. */
     
    160164    bool  m_fSupportsLongMode;
    161165
     166    /** Holds the main layout instance. */
     167    QGridLayout *m_pMainLayout;
     168
    162169    /** Holds the VM name label instance. */
    163170    QLabel *m_pNameLabel;
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