VirtualBox

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


Ignore:
Timestamp:
Aug 5, 2024 2:28:46 PM (6 months ago)
Author:
vboxsync
Message:

FE/Qt: bugref:10665, bugref:10744: UINativeWizard: Make sure wizard is cleanup up if aborted (by Escape key, Cancel button or by closing the window).

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

Legend:

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

    r105585 r105586  
    55
    66/*
    7  * Copyright (C) 2009-2023 Oracle and/or its affiliates.
     7 * Copyright (C) 2009-2024 Oracle and/or its affiliates.
    88 *
    99 * This file is part of VirtualBox base platform packages, as
     
    9999    , m_strHelpKeyword(strHelpKeyword)
    100100    , m_iLastIndex(-1)
     101    , m_fAborted(true)
    101102    , m_fClosed(false)
    102103    , m_pLabelPixmap(0)
     
    234235void UINativeWizard::keyPressEvent(QKeyEvent *pEvent)
    235236{
     237    // WORKAROUND:
     238    // In non-modal case we'll have to handle Escape button ourselves.
     239    // In modal case QDialog does this itself internally by unwinding the event-loop.
     240
    236241    /* Different handling depending on current modality: */
    237242    const Qt::WindowModality enmModality = windowHandle()->modality();
     
    276281        {
    277282            m_fClosed = true;
     283            if (m_fAborted)
     284                cleanWizard();
    278285            emit sigClose(m_enmType);
    279286        }
     
    374381        /* Different handling depending on current modality: */
    375382        if (windowHandle()->modality() == Qt::NonModal)
     383        {
     384            m_fAborted = false;
    376385            close();
     386        }
    377387        else
    378388            accept();
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/UINativeWizard.h

    r105585 r105586  
    55
    66/*
    7  * Copyright (C) 2009-2023 Oracle and/or its affiliates.
     7 * Copyright (C) 2009-2024 Oracle and/or its affiliates.
    88 *
    99 * This file is part of VirtualBox base platform packages, as
     
    155155
    156156protected slots:
     157
    157158    /** Handles translation event. */
    158159    virtual void sltRetranslateUI();
     
    210211    /** Holds the set of invisible pages. */
    211212    QSet<int>   m_invisiblePages;
     213    /** Holds whether user has requested to abort wizard. */
     214    bool        m_fAborted;
    212215    /** Holds whether the dialod had emitted signal to be closed. */
    213216    bool        m_fClosed;
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