VirtualBox

Changeset 100871 in vbox


Ignore:
Timestamp:
Aug 14, 2023 1:21:44 PM (16 months ago)
Author:
vboxsync
Message:

FE/Qt: bugref:10502: QIDialog: Make sure event-loop exited on done() call even if dialog isn't shown yet/already.

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

Legend:

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

    r100073 r100871  
    112112}
    113113
     114void QIDialog::done(int iResult)
     115{
     116    /* Call to base-class: */
     117    QDialog::done(iResult);
     118
     119    /* Make sure event-loop exited even if no dialog visibility changed, s.a. QIDialog::setVisible above.
     120     * That is necessary to exit event-loop if dialog was executed with fShow == false. */
     121    if (m_pEventLoop && m_pEventLoop->isRunning() && !QDialog::isVisible())
     122        m_pEventLoop->exit();
     123}
     124
    114125void QIDialog::showEvent(QShowEvent *pEvent)
    115126{
  • trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIDialog.h

    r98103 r100871  
    6666    virtual int exec() RT_OVERRIDE { return execute(); }
    6767
     68    /** Closes the dialog and sets its result code to iResult. */
     69    virtual void done(int iResult) RT_OVERRIDE;
     70
    6871protected:
    6972
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