VirtualBox

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

Last change on this file since 82781 was 76581, checked in by vboxsync, 5 years ago

Fe/QT: scm header guard alignment.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.5 KB
Line 
1/* $Id: QIDialog.h 76581 2019-01-01 06:24:57Z vboxsync $ */
2/** @file
3 * VBox Qt GUI - Qt extensions: QIDialog class declaration.
4 */
5
6/*
7 * Copyright (C) 2008-2019 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 FEQT_INCLUDED_SRC_extensions_QIDialog_h
19#define FEQT_INCLUDED_SRC_extensions_QIDialog_h
20#ifndef RT_WITHOUT_PRAGMA_ONCE
21# pragma once
22#endif
23
24/* Qt includes: */
25#include <QDialog>
26#include <QPointer>
27
28/* GUI includes: */
29#include "UILibraryDefs.h"
30
31/* Forward declarations: */
32class QEventLoop;
33
34/** QDialog extension providing the GUI with
35 * the advanced capabilities like delayed show. */
36class SHARED_LIBRARY_STUFF QIDialog : public QDialog
37{
38 Q_OBJECT;
39
40public:
41
42 /** Constructs the dialog passing @a pParent and @a enmFlags to the base-class. */
43 QIDialog(QWidget *pParent = 0, Qt::WindowFlags enmFlags = 0);
44
45 /** Defines whether the dialog is @a fVisible. */
46 void setVisible(bool fVisible);
47
48public slots:
49
50 /** Shows the dialog as a modal one, blocking until the user closes it.
51 * @param fShow Brings whether the dialog should be shown instantly.
52 * @param fApplicationModal Brings whether the dialog should be application-modal. */
53 virtual int execute(bool fShow = true, bool fApplicationModal = false);
54
55 /** Shows the dialog as a modal one, blocking until the user closes it. */
56 virtual int exec() /* override */ { return execute(); }
57
58protected:
59
60 /** Handles show @a pEvent. */
61 virtual void showEvent(QShowEvent *pEvent) /* override */;
62 /** Handles show @a pEvent sent for the first time. */
63 virtual void polishEvent(QShowEvent *pEvent);
64
65private:
66
67 /** Holds whether the dialog is polished. */
68 bool m_fPolished;
69
70 /** Holds the separate event-loop instance.
71 * @note This event-loop is only used when the dialog being executed via the execute()
72 * functionality, allowing for the delayed show and advanced modality flag. */
73 QPointer<QEventLoop> m_pEventLoop;
74};
75
76/** Safe pointer to the QIDialog class. */
77typedef QPointer<QIDialog> UISafePointerDialog;
78
79#endif /* !FEQT_INCLUDED_SRC_extensions_QIDialog_h */
Note: See TracBrowser for help on using the repository browser.

© 2023 Oracle
ContactPrivacy policyTerms of Use