VirtualBox

Changeset 45165 in vbox


Ignore:
Timestamp:
Mar 25, 2013 12:26:16 PM (12 years ago)
Author:
vboxsync
Message:

FE/Qt: QIDialog cleanup (part 3), moving code into appropriate place.

File:
1 edited

Legend:

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

    r45163 r45165  
    3535}
    3636
    37 void QIDialog::showEvent(QShowEvent * /* pEvent */)
     37void QIDialog::setVisible(bool fVisible)
    3838{
    39     /* Polishing: */
    40     if (m_fPolished)
    41         return;
    42     m_fPolished = true;
     39    /* Call to base-class: */
     40    QDialog::setVisible(fVisible);
    4341
    44     /* Make sure layout is polished: */
    45     adjustSize();
    46 #ifdef Q_WS_MAC
    47     /* And dialog have fixed size: */
    48     setFixedSize(size());
    49 #endif /* Q_WS_MAC */
    50 
    51     /* Explicit centering according to our parent: */
    52     VBoxGlobal::centerWidget(this, parentWidget(), false);
     42    /* Exit from the event-loop if
     43     * 1. there is any and
     44     * 2. we are changing our state from visible to invisible: */
     45    if (m_pEventLoop && !fVisible)
     46        m_pEventLoop->exit();
    5347}
    5448
     
    122116}
    123117
    124 void QIDialog::setVisible(bool fVisible)
     118void QIDialog::showEvent(QShowEvent * /* pEvent */)
    125119{
    126     /* Call to base-class: */
    127     QDialog::setVisible(fVisible);
     120    /* Polishing: */
     121    if (m_fPolished)
     122        return;
     123    m_fPolished = true;
    128124
    129     /* Exit from the event-loop if
    130      * 1. there is any and
    131      * 2. we are changing our state from visible to invisible: */
    132     if (m_pEventLoop && !fVisible)
    133         m_pEventLoop->exit();
     125    /* Make sure layout is polished: */
     126    adjustSize();
     127#ifdef Q_WS_MAC
     128    /* And dialog have fixed size: */
     129    setFixedSize(size());
     130#endif /* Q_WS_MAC */
     131
     132    /* Explicit centering according to our parent: */
     133    VBoxGlobal::centerWidget(this, parentWidget(), false);
    134134}
    135135
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