VirtualBox

Changeset 45166 in vbox


Ignore:
Timestamp:
Mar 25, 2013 12:31:19 PM (12 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
84489
Message:

FE/Qt: QIDialog cleanup (part 4).

File:
1 edited

Legend:

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

    r45165 r45166  
    5252    setResult(QDialog::Rejected);
    5353
     54    /* Should we delete ourself on close in theory? */
    5455    bool fWasDeleteOnClose = testAttribute(Qt::WA_DeleteOnClose);
    5556    setAttribute(Qt::WA_DeleteOnClose, false);
     57
    5658#if defined(Q_WS_MAC) && QT_VERSION >= 0x040500
    5759    /* After 4.5 Qt changed the behavior of Sheets for the window/application
     
    7375    setAttribute(Qt::WA_ShowModal, true);
    7476
    75     /* Create a local event-loop: */
    76     QEventLoop eventLoop;
    77     m_pEventLoop = &eventLoop;
    78 
    7977    /* Show ourself if requested: */
    8078    if (fShow)
    8179        show();
    8280
    83     /* Guard ourself for the case
    84      * we destroyed ourself in our event-loop: */
    85     QPointer<QIDialog> guard = this;
     81    /* Create a local event-loop: */
     82    {
     83        QEventLoop eventLoop;
     84        m_pEventLoop = &eventLoop;
    8685
    87     /* Start the blocking event-loop: */
    88     eventLoop.exec();
     86        /* Guard ourself for the case
     87         * we destroyed ourself in our event-loop: */
     88        QPointer<QIDialog> guard = this;
    8989
    90     /* Are we still valid? */
    91     if (guard.isNull())
    92         return QDialog::Rejected;
     90        /* Start the blocking event-loop: */
     91        eventLoop.exec();
    9392
    94     m_pEventLoop = 0;
     93        /* Are we still valid? */
     94        if (guard.isNull())
     95            return QDialog::Rejected;
     96
     97        m_pEventLoop = 0;
     98    }
    9599
    96100    /* Save the result-code early (we can delete ourself on close): */
     
    105109    }
    106110#endif /* defined(Q_WS_MAC) && QT_VERSION >= 0x040500 */
     111    /* Set the old show modal attribute: */
     112    setAttribute (Qt::WA_ShowModal, wasShowModal);
    107113
    108     /* Set the old show modal attribute */
    109     setAttribute (Qt::WA_ShowModal, wasShowModal);
    110114    /* Delete ourself if we should do that on close: */
    111115    if (fWasDeleteOnClose)
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