VirtualBox

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

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

FE/Qt: bugref:7720: QIDialogContainer: Extending with possibility to enable/disable Ok button according to connected validity change signals.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.0 KB
Line 
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: */
31class QGridLayout;
32class QWidget;
33class 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. */
37class SHARED_LIBRARY_STUFF QIDialogContainer : public QDialog
38{
39 Q_OBJECT;
40
41public:
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
49public slots:
50
51 /** Activates window. */
52 void sltActivateWindow() { activateWindow(); }
53
54 /** Sets Ok button to be @a fEnabled. */
55 void setOkButtonEnabled(bool fEnabled);
56
57private:
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 */
Note: See TracBrowser for help on using the repository browser.

© 2023 Oracle
ContactPrivacy policyTerms of Use