VirtualBox

Changeset 77179 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Feb 6, 2019 3:35:57 PM (6 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9340: Rework QIMainDialog to use int instead of QDialog::DialogCode because of lack of enum values, we need more (that's native Qt approach).

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

Legend:

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

    r76606 r77179  
    4242    , m_fIsAutoCentering(fIsAutoCentering)
    4343    , m_fPolished(false)
    44     , m_enmResult(QDialog::Rejected)
     44    , m_iResult(QDialog::Rejected)
    4545{
    4646    /* Install event-filter: */
     
    4848}
    4949
    50 QDialog::DialogCode QIMainDialog::exec(bool fApplicationModal /* = true */)
     50int QIMainDialog::exec(bool fApplicationModal /* = true */)
    5151{
    5252    /* Check for the recursive run: */
     
    8989
    9090    /* Save the result code early (we can delete ourself on close): */
    91     const QDialog::DialogCode enmResultCode = result();
     91    const int iResultCode = result();
    9292
    9393    /* Return old modality: */
     
    101101
    102102    /* Return the result code: */
    103     return enmResultCode;
     103    return iResultCode;
    104104}
    105105
     
    325325}
    326326
    327 void QIMainDialog::done(QDialog::DialogCode enmResult)
     327void QIMainDialog::done(int iResult)
    328328{
    329329    /* Set the final result: */
    330     setResult(enmResult);
     330    setResult(iResult);
    331331    /* Hide: */
    332332    hide();
  • trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIMainDialog.h

    r76581 r77179  
    4949
    5050    /** Returns the dialog's result code. */
    51     QDialog::DialogCode result() const { return m_enmResult; }
     51    int result() const { return m_iResult; }
    5252
    5353    /** Executes the dialog, launching local event-loop.
    5454      * @param fApplicationModal defines whether this dialog should be modal to application or window. */
    55     QDialog::DialogCode exec(bool fApplicationModal = true);
     55    int exec(bool fApplicationModal = true);
    5656
    5757    /** Returns dialog's default button. */
     
    9393protected slots:
    9494
    95     /** Sets the modal dialog's result code to @a enmResult. */
    96     void setResult(QDialog::DialogCode enmResult) { m_enmResult = enmResult; }
     95    /** Sets the modal dialog's result code to @a iResult. */
     96    void setResult(int iResult) { m_iResult = iResult; }
    9797
    98     /** Closes the modal dialog and sets its result code to @a enmResult.
     98    /** Closes the modal dialog and sets its result code to @a iResult.
    9999      * If this dialog is shown with exec(), done() causes the local
    100       * event-loop to finish, and exec() to return @a enmResult. */
    101     virtual void done(QDialog::DialogCode enmResult);
     100      * event-loop to finish, and exec() to return @a iResult. */
     101    virtual void done(int iResult);
    102102    /** Hides the modal dialog and sets the result code to Accepted. */
    103103    virtual void accept() { done(QDialog::Accepted); }
     
    113113
    114114    /** Holds modal dialog's result code. */
    115     QDialog::DialogCode   m_enmResult;
     115    int                   m_iResult;
    116116    /** Holds modal dialog's event-loop. */
    117117    QPointer<QEventLoop>  m_pEventLoop;
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