VirtualBox

Ignore:
Timestamp:
Feb 26, 2015 7:11:24 PM (10 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
98656
Message:

FE/Qt: 6669: Few small fixes and rework/cleanup for QIMainDialog.

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

Legend:

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

    r52730 r54538  
    4545    QDialog::setVisible(fVisible);
    4646
    47     /* Exit from the event-loop if
    48      * 1. there is any and
    49      * 2. we are changing our state from visible to invisible: */
     47    /* Exit from the event-loop if there is any and
     48     * we are changing our state from visible to hidden. */
    5049    if (m_pEventLoop && !fVisible)
    5150        m_pEventLoop->exit();
    5251}
    5352
    54 int QIDialog::exec(bool fShow /* = true */, bool fApplicationModal /* = false*/)
     53int QIDialog::exec(bool fShow /* = true */, bool fApplicationModal /* = false */)
    5554{
     55    /* Check for the recursive run: */
     56    AssertMsgReturn(!m_pEventLoop, ("QIDialog::exec() is called recursively!\n"), QDialog::Rejected);
     57
    5658    /* Reset the result-code: */
    5759    setResult(QDialog::Rejected);
    5860
    5961    /* Should we delete ourself on close in theory? */
    60     bool fOldDeleteOnClose = testAttribute(Qt::WA_DeleteOnClose);
     62    const bool fOldDeleteOnClose = testAttribute(Qt::WA_DeleteOnClose);
    6163    /* For the exec() time, set this attribute to 'false': */
    6264    setAttribute(Qt::WA_DeleteOnClose, false);
    6365
    6466    /* Which is the current window-modality? */
    65     Qt::WindowModality oldModality = windowModality();
     67    const Qt::WindowModality oldModality = windowModality();
    6668    /* For the exec() time, set this attribute to 'window-modal' or 'application-modal': */
    6769    setWindowModality(!fApplicationModal ? Qt::WindowModal : Qt::ApplicationModal);
     
    9193
    9294    /* Save the result-code early (we can delete ourself on close): */
    93     int iResultCode = result();
     95    const int iResultCode = result();
    9496
    9597    /* Return old modality: */
  • trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIMainDialog.cpp

    r52733 r54538  
    11/* $Id$ */
    22/** @file
    3  * VBox Qt GUI - VirtualBox Qt extensions: QIMainDialog class implementation.
     3 * VBox Qt GUI - Qt extensions: QIMainDialog class implementation.
    44 */
    55
    66/*
    7  * Copyright (C) 2008-2012 Oracle Corporation
     7 * Copyright (C) 2008-2015 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    2020#else  /* !VBOX_WITH_PRECOMPILED_HEADERS */
    2121
    22 # include "QIMainDialog.h"
    23 # include "VBoxUtils.h"
    24 # include "VBoxGlobal.h"
    25 
    26 # include <iprt/assert.h>
    27 
    28 /* Qt includes */
    29 # include <QProcess>
    30 # include <QEventLoop>
    31 # include <QApplication>
     22/* Qt includes: */
    3223# include <QDir>
    3324# include <QUrl>
    3425# include <QMenu>
     26# include <QProcess>
     27# include <QSizeGrip>
     28# include <QEventLoop>
    3529# include <QPushButton>
     30# include <QApplication>
    3631# include <QDialogButtonBox>
    3732
     33/* GUI includes: */
     34# include "QIMainDialog.h"
     35# include "VBoxGlobal.h"
     36# include "VBoxUtils.h"
     37
     38/* Other VBox includes: */
     39# include <iprt/assert.h>
     40
    3841#endif /* !VBOX_WITH_PRECOMPILED_HEADERS */
    3942
    40 #include <QSizeGrip>
    41 
    42 
    43 QIMainDialog::QIMainDialog (QWidget *aParent /* = 0 */,
    44                             Qt::WindowFlags aFlags /* = Qt::Dialog */)
    45     : QMainWindow (aParent, aFlags)
    46     , mRescode (QDialog::Rejected)
    47     , mPolished (false)
    48     , mIsAutoCentering (true)
    49     , mCenterWidget (aParent)
    50 {
    51     qApp->installEventFilter (this);
    52 }
    53 
    54 QDialog::DialogCode QIMainDialog::exec()
     43QIMainDialog::QIMainDialog(QWidget *pParent /* = 0 */,
     44                           Qt::WindowFlags enmFlags /* = Qt::Dialog */,
     45                           bool fIsAutoCentering /* = true */)
     46    : QMainWindow(pParent, enmFlags)
     47    , m_fIsAutoCentering(fIsAutoCentering)
     48    , m_fPolished(false)
     49    , m_enmResult(QDialog::Rejected)
     50{
     51    /* Install event-filter: */
     52    qApp->installEventFilter(this);
     53}
     54
     55QDialog::DialogCode QIMainDialog::exec(bool fApplicationModal /* = true */)
    5556{
    5657    /* Check for the recursive run: */
    57     AssertMsg(!mEventLoop, ("QIMainDialog::exec() is called recursively!\n"));
     58    AssertMsgReturn(!m_pEventLoop, ("QIMainDialog::exec() is called recursively!\n"), QDialog::Rejected);
    5859
    5960    /* Reset the result code: */
    6061    setResult(QDialog::Rejected);
    6162
    62     /* Tune some attributes: */
    63     bool fDeleteOnClose = testAttribute(Qt::WA_DeleteOnClose); NOREF(fDeleteOnClose);
    64     AssertMsg(!fDeleteOnClose, ("QIMainDialog is NOT supposed to be run in 'delete-on-close' mode!"));
     63    /* Should we delete ourself on close in theory? */
     64    const bool fOldDeleteOnClose = testAttribute(Qt::WA_DeleteOnClose);
     65    /* For the exec() time, set this attribute to 'false': */
    6566    setAttribute(Qt::WA_DeleteOnClose, false);
    66     bool fWasShowModal = testAttribute(Qt::WA_ShowModal);
    67     setAttribute(Qt::WA_ShowModal, true);
     67
     68    /* Which is the current window-modality? */
     69    const Qt::WindowModality oldModality = windowModality();
     70    /* For the exec() time, set this attribute to 'window-modal' or 'application-modal': */
     71    setWindowModality(!fApplicationModal ? Qt::WindowModal : Qt::ApplicationModal);
     72
     73    /* Show ourself: */
     74    show();
    6875
    6976    /* Create a local event-loop: */
    70     QEventLoop eventLoop;
    71     mEventLoop = &eventLoop;
    72     /* Show the window: */
    73     show();
    74     /* A guard to ourself for the case we destroy ourself: */
    75     QPointer<QIMainDialog> guard = this;
    76     /* Start the event-loop: */
    77     eventLoop.exec();
    78     /* Check if dialog is still valid: */
    79     if (guard.isNull())
    80         return QDialog::Rejected;
    81     mEventLoop = 0;
    82     /* Prepare result: */
    83     QDialog::DialogCode res = result();
    84     /* Restore old show-modal attribute: */
    85     setAttribute(Qt::WA_ShowModal, fWasShowModal);
    86     /* Return the final result: */
    87     return res;
    88 }
    89 
    90 QDialog::DialogCode QIMainDialog::result() const
    91 {
    92     return mRescode;
    93 }
    94 
    95 void QIMainDialog::setSizeGripEnabled (bool aEnabled)
    96 {
    97     if (!mSizeGrip && aEnabled)
    98     {
    99         mSizeGrip = new QSizeGrip (this);
    100         mSizeGrip->resize (mSizeGrip->sizeHint());
    101         mSizeGrip->show();
    102     }
    103     else if (mSizeGrip && !aEnabled)
    104         delete mSizeGrip;
     77    {
     78        QEventLoop eventLoop;
     79        m_pEventLoop = &eventLoop;
     80
     81        /* Guard ourself for the case
     82         * we destroyed ourself in our event-loop: */
     83        QPointer<QIMainDialog> guard = this;
     84
     85        /* Start the blocking event-loop: */
     86        eventLoop.exec();
     87
     88        /* Are we still valid? */
     89        if (guard.isNull())
     90            return QDialog::Rejected;
     91
     92        m_pEventLoop = 0;
     93    }
     94
     95    /* Save the result code early (we can delete ourself on close): */
     96    const QDialog::DialogCode enmResultCode = result();
     97
     98    /* Return old modality: */
     99    setWindowModality(oldModality);
     100
     101    /* Reset attribute to previous value: */
     102    setAttribute(Qt::WA_DeleteOnClose, fOldDeleteOnClose);
     103    /* Delete ourself if we should do that on close: */
     104    if (fOldDeleteOnClose)
     105        delete this;
     106
     107    /* Return the result code: */
     108    return enmResultCode;
     109}
     110
     111QPushButton* QIMainDialog::defaultButton() const
     112{
     113    return m_pDefaultButton;
     114}
     115
     116void QIMainDialog::setDefaultButton(QPushButton *pButton)
     117{
     118    m_pDefaultButton = pButton;
    105119}
    106120
    107121bool QIMainDialog::isSizeGripEnabled() const
    108122{
    109     return mSizeGrip;
    110 }
    111 
    112 void QIMainDialog::setDefaultButton (QPushButton* aButton)
    113 {
    114     mDefaultButton = aButton;
    115 }
    116 
    117 QPushButton* QIMainDialog::defaultButton() const
    118 {
    119     return mDefaultButton;
    120 }
    121 
    122 void QIMainDialog::setAutoCenteringEnabled(bool fIsAutoCentering)
    123 {
    124     mIsAutoCentering = fIsAutoCentering;
    125 }
    126 
    127 void QIMainDialog::setVisible (bool aVisible)
    128 {
    129     QMainWindow::setVisible (aVisible);
    130     /* Exit from the event loop if there is any and we are changing our state
    131      * from visible to invisible. */
    132     if (mEventLoop && !aVisible)
    133         mEventLoop->exit();
    134 }
    135 
    136 bool QIMainDialog::event (QEvent *aEvent)
    137 {
    138      switch (aEvent->type())
    139      {
    140           case QEvent::Polish:
    141           {
    142               /* Initially search for the default button. */
    143               mDefaultButton = searchDefaultButton();
    144               break;
    145           }
    146           default:
    147               break;
    148      }
    149      return QMainWindow::event (aEvent);
    150 }
    151 
    152 void QIMainDialog::showEvent (QShowEvent *aEvent)
    153 {
    154     QMainWindow::showEvent (aEvent);
    155 
    156     /* Polishing border */
    157     if (mPolished)
     123    return m_pSizeGrip;
     124}
     125
     126void QIMainDialog::setSizeGripEnabled(bool fEnabled)
     127{
     128    /* Create if missed: */
     129    if (!m_pSizeGrip && fEnabled)
     130    {
     131        m_pSizeGrip = new QSizeGrip(this);
     132        m_pSizeGrip->resize(m_pSizeGrip->sizeHint());
     133        m_pSizeGrip->show();
     134    }
     135    /* Destroy if present: */
     136    else if (m_pSizeGrip && !fEnabled)
     137    {
     138        delete m_pSizeGrip;
     139        m_pSizeGrip = 0;
     140    }
     141}
     142
     143void QIMainDialog::setVisible(bool fVisible)
     144{
     145    /* Call to base-class: */
     146    QMainWindow::setVisible(fVisible);
     147
     148    /* Exit from the event-loop if there is any and
     149     * we are changing our state from visible to hidden. */
     150    if (m_pEventLoop && !fVisible)
     151        m_pEventLoop->exit();
     152}
     153
     154bool QIMainDialog::event(QEvent *pEvent)
     155{
     156    /* Depending on event-type: */
     157    switch (pEvent->type())
     158    {
     159        case QEvent::Polish:
     160        {
     161            /* Initially search for the default-button: */
     162            m_pDefaultButton = searchDefaultButton();
     163            break;
     164        }
     165        default:
     166            break;
     167    }
     168
     169    /* Call to base-class: */
     170    return QMainWindow::event(pEvent);
     171}
     172
     173void QIMainDialog::showEvent(QShowEvent *pEvent)
     174{
     175    /* Make sure we should polish dialog: */
     176    if (m_fPolished)
    158177        return;
    159     mPolished = true;
    160 
    161     /* Explicit widget centering relatively to it's centering
    162      * widget if any or desktop if centering widget is missed. */
    163     if (mIsAutoCentering)
    164         VBoxGlobal::centerWidget (this, mCenterWidget, false);
    165 }
    166 
    167 void QIMainDialog::resizeEvent (QResizeEvent *aEvent)
    168 {
    169     QMainWindow::resizeEvent (aEvent);
    170 
    171     /* Adjust the size-grip location for the current resize event */
    172     if (mSizeGrip)
     178
     179    /* Call to polish-event: */
     180    polishEvent(pEvent);
     181
     182    /* Mark dialog as polished: */
     183    m_fPolished = true;
     184}
     185
     186void QIMainDialog::polishEvent(QShowEvent*)
     187{
     188    /* Explicit centering according to our parent: */
     189    if (m_fIsAutoCentering)
     190        VBoxGlobal::centerWidget(this, parentWidget(), false);
     191}
     192
     193void QIMainDialog::resizeEvent(QResizeEvent *pEvent)
     194{
     195    /* Call to base-class: */
     196    QMainWindow::resizeEvent(pEvent);
     197
     198    /* Adjust the size-grip location for the current resize event: */
     199    if (m_pSizeGrip)
    173200    {
    174201        if (isRightToLeft())
    175             mSizeGrip->move (rect().bottomLeft() - mSizeGrip->rect().bottomLeft());
     202            m_pSizeGrip->move(rect().bottomLeft() - m_pSizeGrip->rect().bottomLeft());
    176203        else
    177             mSizeGrip->move (rect().bottomRight() - mSizeGrip->rect().bottomRight());
    178         aEvent->accept();
     204            m_pSizeGrip->move(rect().bottomRight() - m_pSizeGrip->rect().bottomRight());
    179205    }
    180206}
     
    234260        default: break;
    235261    }
     262
    236263    /* Call to base-class: */
    237264    return QMainWindow::keyPressEvent(pEvent);
    238265}
    239266
    240 bool QIMainDialog::eventFilter (QObject *aObject, QEvent *aEvent)
    241 {
     267bool QIMainDialog::eventFilter(QObject *pObject, QEvent *pEvent)
     268{
     269    /* Skip for inactive window: */
    242270    if (!isActiveWindow())
    243         return QMainWindow::eventFilter (aObject, aEvent);
    244 
    245     if (qobject_cast<QWidget*> (aObject) &&
    246         qobject_cast<QWidget*> (aObject)->window() != this)
    247         return QMainWindow::eventFilter (aObject, aEvent);
    248 
    249     switch (aEvent->type())
    250     {
    251         /* Auto-default button focus-in processor used to move the "default"
     271        return QMainWindow::eventFilter(pObject, pEvent);
     272
     273    /* Skip for children of other than this one window: */
     274    if (qobject_cast<QWidget*>(pObject) &&
     275        qobject_cast<QWidget*>(pObject)->window() != this)
     276        return QMainWindow::eventFilter(pObject, pEvent);
     277
     278    /* Depending on event-type: */
     279    switch (pEvent->type())
     280    {
     281        /* Auto-default-button focus-in processor used to move the "default"
    252282         * button property into the currently focused button. */
    253283        case QEvent::FocusIn:
    254284        {
    255             if (qobject_cast<QPushButton*> (aObject) &&
    256                 (aObject->parent() == centralWidget() ||
    257                  qobject_cast<QDialogButtonBox*> (aObject->parent())))
    258             {
    259                 qobject_cast<QPushButton*> (aObject)->setDefault (aObject != mDefaultButton);
    260                 if (mDefaultButton)
    261                     mDefaultButton->setDefault (aObject == mDefaultButton);
    262             }
    263             break;
    264         }
    265         /* Auto-default button focus-out processor used to remove the "default"
     285            if (qobject_cast<QPushButton*>(pObject) &&
     286                (pObject->parent() == centralWidget() ||
     287                 qobject_cast<QDialogButtonBox*>(pObject->parent())))
     288            {
     289                qobject_cast<QPushButton*>(pObject)->setDefault(pObject != m_pDefaultButton);
     290                if (m_pDefaultButton)
     291                    m_pDefaultButton->setDefault(pObject == m_pDefaultButton);
     292            }
     293            break;
     294        }
     295        /* Auto-default-button focus-out processor used to remove the "default"
    266296         * button property from the previously focused button. */
    267297        case QEvent::FocusOut:
    268298        {
    269             if (qobject_cast<QPushButton*> (aObject) &&
    270                 (aObject->parent() == centralWidget() ||
    271                  qobject_cast<QDialogButtonBox*> (aObject->parent())))
    272             {
    273                 if (mDefaultButton)
    274                     mDefaultButton->setDefault (aObject != mDefaultButton);
    275                 qobject_cast<QPushButton*> (aObject)->setDefault (aObject == mDefaultButton);
     299            if (qobject_cast<QPushButton*>(pObject) &&
     300                (pObject->parent() == centralWidget() ||
     301                 qobject_cast<QDialogButtonBox*>(pObject->parent())))
     302            {
     303                if (m_pDefaultButton)
     304                    m_pDefaultButton->setDefault(pObject != m_pDefaultButton);
     305                qobject_cast<QPushButton*>(pObject)->setDefault(pObject == m_pDefaultButton);
    276306            }
    277307            break;
     
    280310            break;
    281311    }
    282     return QMainWindow::eventFilter (aObject, aEvent);
     312
     313    /* Call to base-class: */
     314    return QMainWindow::eventFilter(pObject, pEvent);
    283315}
    284316
    285317QPushButton* QIMainDialog::searchDefaultButton() const
    286318{
    287     /* Search for the first default button in the dialog. */
    288     QList<QPushButton*> list = qFindChildren<QPushButton*> (this);
    289     foreach (QPushButton *button, list)
    290         if (button->isDefault() &&
    291             (button->parent() == centralWidget() ||
    292              qobject_cast<QDialogButtonBox*> (button->parent())))
    293             return button;
    294     return NULL;
    295 }
    296 
    297 
    298 void QIMainDialog::accept()
    299 {
    300     done (QDialog::Accepted);
    301 }
    302 
    303 void QIMainDialog::reject()
    304 {
    305     done (QDialog::Rejected);
    306 }
    307 
    308 void QIMainDialog::done (QDialog::DialogCode aResult)
    309 {
    310     /* Set the final result */
    311     setResult (aResult);
    312     /* Hide this window */
     319    /* Search for the first default-button in the dialog: */
     320    QList<QPushButton*> list = qFindChildren<QPushButton*>(this);
     321    foreach (QPushButton *pButton, list)
     322        if (pButton->isDefault() &&
     323            (pButton->parent() == centralWidget() ||
     324             qobject_cast<QDialogButtonBox*>(pButton->parent())))
     325            return pButton;
     326    return 0;
     327}
     328
     329void QIMainDialog::done(QDialog::DialogCode enmResult)
     330{
     331    /* Set the final result: */
     332    setResult(enmResult);
     333    /* Hide: */
    313334    hide();
    314     /* And close the window */
    315     close();
    316 }
    317 
    318 void QIMainDialog::setResult (QDialog::DialogCode aRescode)
    319 {
    320     mRescode = aRescode;
    321 }
    322 
     335}
     336
  • trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIMainDialog.h

    r52727 r54538  
    44
    55/*
    6  * Copyright (C) 2008-2010 Oracle Corporation
     6 * Copyright (C) 2008-2015 Oracle Corporation
    77 *
    88 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    1515 */
    1616
    17 #ifndef __QIMainDialog_h__
    18 #define __QIMainDialog_h__
     17#ifndef ___QIMainDialog_h___
     18#define ___QIMainDialog_h___
    1919
    20 /* Qt includes */
     20/* Qt includes: */
    2121#include <QMainWindow>
     22#include <QPointer>
    2223#include <QDialog>
    23 #include <QPointer>
    2424
     25/* Forward declarations: */
     26class QPushButton;
    2527class QEventLoop;
    2628class QSizeGrip;
    2729
     30/** QDialog analog based on QMainWindow. */
    2831class QIMainDialog: public QMainWindow
    2932{
     
    3235public:
    3336
    34     QIMainDialog (QWidget *aParent = 0, Qt::WindowFlags aFlags = Qt::Dialog);
     37    /** Constructor.
     38      * @param pParent           holds the parent widget passed to the base-class,
     39      * @param enmFlags          holds the cumulative window flags passed to the base-class,
     40      * @param fIsAutoCentering  defines whether this dialog should be centered according it's parent. */
     41    QIMainDialog(QWidget *pParent = 0,
     42                 Qt::WindowFlags enmFlags = Qt::Dialog,
     43                 bool fIsAutoCentering = true);
    3544
    36     QDialog::DialogCode exec();
    37     QDialog::DialogCode result() const;
     45    /** Returns the dialog's result code. */
     46    QDialog::DialogCode result() const { return m_enmResult; }
    3847
    39     void setSizeGripEnabled (bool aEnabled);
    40     bool isSizeGripEnabled () const;
     48    /** Executes the dialog, launching local event-loop.
     49      * @param fApplicationModal defines whether this dialog should be modal to application or window. */
     50    QDialog::DialogCode exec(bool fApplicationModal = true);
    4151
    42     void setDefaultButton (QPushButton *aButton);
    43     QPushButton* defaultButton () const;
     52    /** Returns dialog's default-button. */
     53    QPushButton* defaultButton() const;
     54    /** Defines dialog's default-button. */
     55    void setDefaultButton(QPushButton *pButton);
    4456
    45     void setAutoCenteringEnabled(bool fIsAutoCentering);
     57    /** Returns whether size-grip was enabled for that dialog. */
     58    bool isSizeGripEnabled() const;
     59    /** Defines whether size-grip should be @a fEnabled for that dialog. */
     60    void setSizeGripEnabled(bool fEnabled);
    4661
    4762public slots:
    4863
    49     virtual void setVisible (bool aVisible);
     64    /** Defines whether the dialog is @a fVisible. */
     65    virtual void setVisible(bool fVisible);
    5066
    5167protected:
    5268
    53     virtual bool event (QEvent *aEvent);
    54     virtual void showEvent (QShowEvent *aEvent);
    55     virtual void resizeEvent (QResizeEvent *aEvent);
     69    /** General event handler. */
     70    virtual bool event(QEvent *pEvent);
     71    /** Show event handler. */
     72    virtual void showEvent(QShowEvent *pEvent);
     73    /** Our own polish event handler. */
     74    virtual void polishEvent(QShowEvent *pEvent);
     75    /** Resize event handler. */
     76    virtual void resizeEvent(QResizeEvent *pEvent);
     77    /** Key-press event handler. */
    5678    virtual void keyPressEvent(QKeyEvent *pEvent);
    57     virtual bool eventFilter (QObject *aObject, QEvent *aEvent);
     79    /** General event filter. */
     80    virtual bool eventFilter(QObject *aObject, QEvent *pEvent);
    5881
     82    /** Function to search for dialog's default-button. */
    5983    QPushButton* searchDefaultButton() const;
    60 
    61     void centerAccording (QWidget *aWidget) { mCenterWidget = aWidget; }
    6284
    6385protected slots:
    6486
    65     virtual void accept();
    66     virtual void reject();
     87    /** Sets the modal dialog's result code to @a enmResult. */
     88    void setResult(QDialog::DialogCode enmResult) { m_enmResult = enmResult; }
    6789
    68     void done (QDialog::DialogCode aRescode);
    69     void setResult (QDialog::DialogCode aRescode);
     90    /** Closes the modal dialog and sets its result code to @a enmResult.
     91      * If this dialog is shown with exec(), done() causes the local
     92      * event-loop to finish, and exec() to return @a enmResult. */
     93    virtual void done(QDialog::DialogCode enmResult);
     94    /** Hides the modal dialog and sets the result code to Accepted. */
     95    virtual void accept() { done(QDialog::Accepted); }
     96    /** Hides the modal dialog and sets the result code to Rejected. */
     97    virtual void reject() { done(QDialog::Rejected); }
    7098
    7199private:
    72100
    73     /* Private member vars */
    74     QDialog::DialogCode mRescode;
    75     QPointer<QEventLoop> mEventLoop;
     101    /** Holds whether this dialog should be centered according it's parent. */
     102    const bool m_fIsAutoCentering;
     103    /** Holds whether this dialog is polished. */
     104    bool m_fPolished;
    76105
    77     QPointer<QSizeGrip> mSizeGrip;
    78     QPointer<QPushButton> mDefaultButton;
     106    /** Holds modal dialog's result code. */
     107    QDialog::DialogCode m_enmResult;
     108    /** Holds modal dialog's event-loop. */
     109    QPointer<QEventLoop> m_pEventLoop;
    79110
    80     bool mPolished;
    81     bool mIsAutoCentering;
    82     QWidget *mCenterWidget;
     111    /** Holds dialog's default-button. */
     112    QPointer<QPushButton> m_pDefaultButton;
     113    /** Holds dialog's size-grip. */
     114    QPointer<QSizeGrip> m_pSizeGrip;
    83115};
    84116
    85 #endif /* __QIMainDialog_h__ */
    86 
     117#endif /* !___QIMainDialog_h___ */
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