VirtualBox

source: vbox/trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIDialog.h@ 74942

Last change on this file since 74942 was 71900, checked in by vboxsync, 6 years ago

FE/Qt: bugref:9049: A bit of coding-style fixes for all extensions.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.4 KB
Line 
1/* $Id: QIDialog.h 71900 2018-04-18 14:40:43Z vboxsync $ */
2/** @file
3 * VBox Qt GUI - Qt extensions: QIDialog class declaration.
4 */
5
6/*
7 * Copyright (C) 2008-2018 Oracle Corporation
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.virtualbox.org. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
12 * General Public License (GPL) as published by the Free Software
13 * Foundation, in version 2 as it comes in the "COPYING" file of the
14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16 */
17
18#ifndef ___QIDialog_h___
19#define ___QIDialog_h___
20
21/* Qt includes: */
22#include <QDialog>
23#include <QPointer>
24
25/* GUI includes: */
26#include "UILibraryDefs.h"
27
28/* Forward declarations: */
29class QEventLoop;
30
31/** QDialog extension providing the GUI with
32 * the advanced capabilities like delayed show. */
33class SHARED_LIBRARY_STUFF QIDialog : public QDialog
34{
35 Q_OBJECT;
36
37public:
38
39 /** Constructs the dialog passing @a pParent and @a enmFlags to the base-class. */
40 QIDialog(QWidget *pParent = 0, Qt::WindowFlags enmFlags = 0);
41
42 /** Defines whether the dialog is @a fVisible. */
43 void setVisible(bool fVisible);
44
45public slots:
46
47 /** Shows the dialog as a modal one, blocking until the user closes it.
48 * @param fShow Brings whether the dialog should be shown instantly.
49 * @param fApplicationModal Brings whether the dialog should be application-modal. */
50 virtual int execute(bool fShow = true, bool fApplicationModal = false);
51
52 /** Shows the dialog as a modal one, blocking until the user closes it. */
53 virtual int exec() /* override */ { return execute(); }
54
55protected:
56
57 /** Handles show @a pEvent. */
58 virtual void showEvent(QShowEvent *pEvent) /* override */;
59 /** Handles show @a pEvent sent for the first time. */
60 virtual void polishEvent(QShowEvent *pEvent);
61
62private:
63
64 /** Holds whether the dialog is polished. */
65 bool m_fPolished;
66
67 /** Holds the separate event-loop instance.
68 * @note This event-loop is only used when the dialog being executed via the execute()
69 * functionality, allowing for the delayed show and advanced modality flag. */
70 QPointer<QEventLoop> m_pEventLoop;
71};
72
73/** Safe pointer to the QIDialog class. */
74typedef QPointer<QIDialog> UISafePointerDialog;
75
76#endif /* !___QIDialog_h___ */
Note: See TracBrowser for help on using the repository browser.

© 2023 Oracle
ContactPrivacy policyTerms of Use