1 | /* $Id: QIDialogContainer.h 79957 2019-07-24 13:42:49Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VBox Qt GUI - Qt extensions: QIDialogContainer class declaration.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 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_QIDialogContainer_h
|
---|
19 | #define FEQT_INCLUDED_SRC_extensions_QIDialogContainer_h
|
---|
20 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
21 | # pragma once
|
---|
22 | #endif
|
---|
23 |
|
---|
24 | /* Qt includes: */
|
---|
25 | #include <QDialog>
|
---|
26 |
|
---|
27 | /* GUI includes: */
|
---|
28 | #include "UILibraryDefs.h"
|
---|
29 |
|
---|
30 | /* Forward declarations: */
|
---|
31 | class QGridLayout;
|
---|
32 | class QWidget;
|
---|
33 | class QIDialogButtonBox;
|
---|
34 |
|
---|
35 | /** QDialog sub-class used as executable input container for passed widget.
|
---|
36 | * Should be used as popup or modal dialog wrapping functionality of the passed widget. */
|
---|
37 | class SHARED_LIBRARY_STUFF QIDialogContainer : public QDialog
|
---|
38 | {
|
---|
39 | Q_OBJECT;
|
---|
40 |
|
---|
41 | public:
|
---|
42 |
|
---|
43 | /** Constructs QIDialogContainer passing @a pParent & @a enmFlags to the base-class. */
|
---|
44 | QIDialogContainer(QWidget *pParent = 0, Qt::WindowFlags enmFlags = Qt::WindowFlags());
|
---|
45 |
|
---|
46 | /** Defines containing @a pWidget. */
|
---|
47 | void setWidget(QWidget *pWidget);
|
---|
48 |
|
---|
49 | public slots:
|
---|
50 |
|
---|
51 | /** Activates window. */
|
---|
52 | void sltActivateWindow() { activateWindow(); }
|
---|
53 |
|
---|
54 | /** Sets Ok button to be @a fEnabled. */
|
---|
55 | void setOkButtonEnabled(bool fEnabled);
|
---|
56 |
|
---|
57 | private:
|
---|
58 |
|
---|
59 | /** Prepares all. */
|
---|
60 | void prepare();
|
---|
61 |
|
---|
62 | /** Holds the layout instance. */
|
---|
63 | QGridLayout *m_pLayout;
|
---|
64 | /** Holds the widget reference. */
|
---|
65 | QWidget *m_pWidget;
|
---|
66 | /** Holds the button-box instance. */
|
---|
67 | QIDialogButtonBox *m_pButtonBox;
|
---|
68 | };
|
---|
69 |
|
---|
70 | #endif /* !FEQT_INCLUDED_SRC_extensions_QIDialogContainer_h */
|
---|