VirtualBox

Changeset 45337 in vbox for trunk/src


Ignore:
Timestamp:
Apr 4, 2013 11:32:41 AM (12 years ago)
Author:
vboxsync
Message:

FE/Qt: Message-box: Reordering initialization to fix focusing issues and determine 'default' button.

File:
1 edited

Legend:

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

    r45308 r45337  
    4949    /* Set caption: */
    5050    setWindowTitle(strCaption);
    51 
    52     /* Set focus to dialog initially: */
    53     setFocus();
    5451
    5552    /* Prepare content: */
     
    200197    QVBoxLayout *pMainLayout = new QVBoxLayout(this);
    201198    {
     199        /* Configure layout: */
     200#ifdef Q_WS_MAC
     201        pMainLayout->setContentsMargins(40, 11, 40, 11);
     202        pMainLayout->setSpacing(15);
     203#else /* !Q_WS_MAC */
     204        VBoxGlobal::setLayoutMargin(pMainLayout, 11);
     205        pMainLayout->setSpacing(10);
     206#endif /* !Q_WS_MAC */
    202207        /* Create top-layout: */
    203208        QHBoxLayout *pTopLayout = new QHBoxLayout;
    204209        {
     210            /* Insert into parent layout: */
     211            pMainLayout->addLayout(pTopLayout);
     212            /* Configure layout: */
     213            VBoxGlobal::setLayoutMargin(pTopLayout, 0);
     214            pTopLayout->setSpacing(10);
    205215            /* Create icon-label: */
    206216            m_pIconLabel = new QLabel;
    207217            {
     218                /* Insert into parent layout: */
     219                pTopLayout->addWidget(m_pIconLabel);
    208220                /* Configure label: */
    209221                m_pIconLabel->setPixmap(standardPixmap(m_iconType, this));
     
    214226            m_pTextLabel = new QILabel(m_strMessage);
    215227            {
     228                /* Insert into parent layout: */
     229                pTopLayout->addWidget(m_pTextLabel);
    216230                /* Configure label: */
    217231                m_pTextLabel->setWordWrap(true);
     
    221235                m_pTextLabel->setSizePolicy(sizePolicy);
    222236            }
    223             /* Configure layout: */
    224             VBoxGlobal::setLayoutMargin(pTopLayout, 0);
    225             pTopLayout->setSpacing(10);
    226             pTopLayout->addWidget(m_pIconLabel);
    227             pTopLayout->addWidget(m_pTextLabel);
    228237        }
    229238        /* Create details text-view: */
     
    240249        m_pDetailsContainer = new QIArrowSplitter(m_pDetailsTextView);
    241250        {
     251            /* Insert into parent layout: */
     252            pMainLayout->addWidget(m_pDetailsContainer);
    242253            /* Configure container: */
    243254            connect(m_pDetailsContainer, SIGNAL(showBackDetails()), this, SLOT(detailsBack()));
     
    250261        m_pFlagCheckBox = new QCheckBox;
    251262        {
     263            /* Insert into parent layout: */
     264            pMainLayout->addWidget(m_pFlagCheckBox, 0, Qt::AlignHCenter | Qt::AlignVCenter);
    252265            /* Configure check-box: */
    253266            m_pFlagCheckBox->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);
     
    258271        m_pButtonBox = new QIDialogButtonBox;
    259272        {
     273            /* Insert into parent layout: */
     274            pMainLayout->addWidget(m_pButtonBox);
    260275            /* Configure button-box: */
    261276            m_pButtonBox->setCenterButtons(true);
     
    277292            }
    278293        }
    279         /* Configure layout: */
    280 #ifdef Q_WS_MAC
    281         pMainLayout->setContentsMargins(40, 11, 40, 11);
    282         pMainLayout->setSpacing(15);
    283 #else /* !Q_WS_MAC */
    284         VBoxGlobal::setLayoutMargin(pMainLayout, 11);
    285         pMainLayout->setSpacing(10);
    286 #endif /* !Q_WS_MAC */
    287         pMainLayout->addLayout(pTopLayout);
    288         pMainLayout->addWidget(m_pDetailsContainer);
    289         pMainLayout->addWidget(m_pFlagCheckBox, 0, Qt::AlignHCenter | Qt::AlignVCenter);
    290         pMainLayout->addWidget(m_pButtonBox);
    291294    }
    292295}
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