VirtualBox

Ignore:
Timestamp:
Apr 17, 2018 11:25:31 AM (7 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9049: Full and heavy cleanup for QIMainDialog and move it to VBoxGlobal library.

File:
1 edited

Legend:

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

    r71027 r71870  
    11/* $Id$ */
    22/** @file
    3  * VBox Qt GUI - Qt extensions: QIMainDialog class implementation.
     3 * VBox Qt GUI - Qt extensions: QIMainDialog class declaration.
    44 */
    55
    66/*
    7  * Copyright (C) 2008-2017 Oracle Corporation
     7 * Copyright (C) 2008-2018 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    2020
    2121/* Qt includes: */
     22#include <QDialog>
    2223#include <QMainWindow>
    2324#include <QPointer>
    24 #include <QDialog>
     25
     26/* GUI includes: */
     27#include "UILibraryDefs.h"
    2528
    2629/* Forward declarations: */
     
    3033
    3134/** QDialog analog based on QMainWindow. */
    32 class QIMainDialog: public QMainWindow
     35class SHARED_LIBRARY_STUFF QIMainDialog : public QMainWindow
    3336{
    3437    Q_OBJECT;
     
    3639public:
    3740
    38     /** Constructor.
    39       * @param pParent           holds the parent widget passed to the base-class,
    40       * @param enmFlags          holds the cumulative window flags passed to the base-class,
    41       * @param fIsAutoCentering  defines whether this dialog should be centered according it's parent. */
     41    /** Constructs main-dialog passing @a pParent and @a fFlags to the base-class.
     42      * @param  fIsAutoCentering  Brigs whether this dialog should be centered according it's parent. */
    4243    QIMainDialog(QWidget *pParent = 0,
    43                  Qt::WindowFlags enmFlags = Qt::Dialog,
     44                 Qt::WindowFlags fFlags = Qt::Dialog,
    4445                 bool fIsAutoCentering = true);
    4546
     
    5152    QDialog::DialogCode exec(bool fApplicationModal = true);
    5253
    53     /** Returns dialog's default-button. */
    54     QPushButton* defaultButton() const;
    55     /** Defines dialog's default-button. */
     54    /** Returns dialog's default button. */
     55    QPushButton *defaultButton() const;
     56    /** Defines dialog's default @a pButton. */
    5657    void setDefaultButton(QPushButton *pButton);
    5758
     
    6869protected:
    6970
    70     /** General event handler. */
    71     virtual bool event(QEvent *pEvent);
    72     /** Show event handler. */
    73     virtual void showEvent(QShowEvent *pEvent);
    74     /** Our own polish event handler. */
     71    /** Preprocesses any Qt @a pEvent for passed @a pObject. */
     72    virtual bool eventFilter(QObject *pObject, QEvent *pEvent) /* override */;
     73    /** Handles any Qt @a pEvent. */
     74    virtual bool event(QEvent *pEvent) /* override */;
     75
     76    /** Handles show @a pEvent. */
     77    virtual void showEvent(QShowEvent *pEvent) /* override */;
     78    /** Handles first show @a pEvent. */
    7579    virtual void polishEvent(QShowEvent *pEvent);
    76     /** Resize event handler. */
    77     virtual void resizeEvent(QResizeEvent *pEvent);
    78     /** Key-press event handler. */
    79     virtual void keyPressEvent(QKeyEvent *pEvent);
    80     /** General event filter. */
    81     virtual bool eventFilter(QObject *aObject, QEvent *pEvent);
    8280
    83     /** Function to search for dialog's default-button. */
    84     QPushButton* searchDefaultButton() const;
     81    /** Handles resize @a pEvent. */
     82    virtual void resizeEvent(QResizeEvent *pEvent) /* override */;
     83
     84    /** Handles key-press @a pEvent. */
     85    virtual void keyPressEvent(QKeyEvent *pEvent) /* override */;
     86
     87    /** Searches for dialog's default button. */
     88    QPushButton *searchDefaultButton() const;
    8589
    8690protected slots:
     
    101105
    102106    /** Holds whether this dialog should be centered according it's parent. */
    103     const bool m_fIsAutoCentering;
     107    const bool  m_fIsAutoCentering;
    104108    /** Holds whether this dialog is polished. */
    105     bool m_fPolished;
     109    bool        m_fPolished;
    106110
    107111    /** Holds modal dialog's result code. */
    108     QDialog::DialogCode m_enmResult;
     112    QDialog::DialogCode   m_enmResult;
    109113    /** Holds modal dialog's event-loop. */
    110     QPointer<QEventLoop> m_pEventLoop;
     114    QPointer<QEventLoop>  m_pEventLoop;
    111115
    112     /** Holds dialog's default-button. */
    113     QPointer<QPushButton> m_pDefaultButton;
     116    /** Holds dialog's default button. */
     117    QPointer<QPushButton>  m_pDefaultButton;
    114118    /** Holds dialog's size-grip. */
    115     QPointer<QSizeGrip> m_pSizeGrip;
     119    QPointer<QSizeGrip>    m_pSizeGrip;
    116120};
    117121
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