VirtualBox

Changeset 68441 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Aug 17, 2017 11:58:10 AM (7 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:6669: macOS: Avoid modal lock for VBox About dialog.

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

Legend:

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

    r63307 r68441  
    4242
    4343VBoxAboutDlg::VBoxAboutDlg(QWidget *pParent, const QString &strVersion)
    44     : QIWithRetranslateUI2<QIDialog>(pParent)
     44#ifdef VBOX_WS_MAC
     45    // No need for About dialog parent on macOS.
     46    // First of all, non of other native apps (Safari, App Store, iTunes) centers About dialog according the app itself, they do
     47    // it according to screen instead, we should do it as well.  Besides that since About dialog is not modal, it will be in
     48    // conflict with modal dialogs if there will be a parent passed, because the dialog will not have own event-loop in that case.
     49    : QIWithRetranslateUI2<QIDialog>(0)
     50    , m_pPseudoParent(pParent)
     51#else
     52    // On other hosts we will keep the current behavior for now.
     53    // First of all it's quite difficult to find native (Metro UI) Windows app which have About dialog at all.  But non-native
     54    // cross-platform apps (Qt Creator, VLC) centers About dialog according the app exactly.
     55    : QIWithRetranslateUI2<QDialog>(pParent)
     56    , m_pPseudoParent(0)
     57#endif
    4558    , m_strVersion(strVersion)
    4659    , m_pLabel(0)
     
    92105    /* Delete dialog on close: */
    93106    setAttribute(Qt::WA_DeleteOnClose);
     107
     108    /* Make sure the dialog is deleted on pseudo-parent destruction: */
     109    connect(m_pPseudoParent, &QObject::destroyed, this, &VBoxAboutDlg::close);
    94110
    95111    /* Choose default image: */
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxAboutDlg.h

    r62493 r68441  
    6868    void prepareCloseButton();
    6969
     70    /** Holds the pseudo parent reference. */
     71    QObject *m_pPseudoParent;
     72
    7073    /** Holds the About-VirtualBox text. */
    7174    QString m_strAboutText;
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