VirtualBox

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

Last change on this file was 104358, checked in by vboxsync, 5 weeks ago

FE/Qt. bugref:10622. More refactoring around the retranslation functionality.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.6 KB
Line 
1/* $Id: QIDialogContainer.h 104358 2024-04-18 05:33:40Z vboxsync $ */
2/** @file
3 * VBox Qt GUI - Qt extensions: QIDialogContainer class declaration.
4 */
5
6/*
7 * Copyright (C) 2019-2023 Oracle and/or its affiliates.
8 *
9 * This file is part of VirtualBox base platform packages, as
10 * available from https://www.virtualbox.org.
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation, in version 3 of the
15 * License.
16 *
17 * This program is distributed in the hope that it will be useful, but
18 * WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 * General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, see <https://www.gnu.org/licenses>.
24 *
25 * SPDX-License-Identifier: GPL-3.0-only
26 */
27
28#ifndef FEQT_INCLUDED_SRC_extensions_QIDialogContainer_h
29#define FEQT_INCLUDED_SRC_extensions_QIDialogContainer_h
30#ifndef RT_WITHOUT_PRAGMA_ONCE
31# pragma once
32#endif
33
34/* Qt includes: */
35#include <QDialog>
36
37/* GUI includes: */
38#include "UILibraryDefs.h"
39
40/* Forward declarations: */
41class QGridLayout;
42class QLabel;
43class QProgressBar;
44class QWidget;
45class QIDialogButtonBox;
46
47/** QDialog sub-class used as executable input container for passed widget.
48 * Should be used as popup or modal dialog wrapping functionality of the passed widget. */
49class SHARED_LIBRARY_STUFF QIDialogContainer : public QDialog
50{
51 Q_OBJECT;
52
53public:
54
55 /** Constructs QIDialogContainer passing @a pParent & @a enmFlags to the base-class. */
56 QIDialogContainer(QWidget *pParent = 0, Qt::WindowFlags enmFlags = Qt::WindowFlags());
57
58 /** Defines containing @a pWidget. */
59 void setWidget(QWidget *pWidget);
60
61public slots:
62
63 /** Activates window. */
64 void sltActivateWindow() { activateWindow(); }
65
66 /** Sets progress-bar to be @a fHidden. */
67 void setProgressBarHidden(bool fHidden);
68
69 /** Sets Ok button to be @a fEnabled. */
70 void setOkButtonEnabled(bool fEnabled);
71
72private slots:
73
74 /** Handles translation event. */
75 void sltRetranslateUI();
76
77private:
78
79 /** Prepares all. */
80 void prepare();
81
82 /** Holds the layout instance. */
83 QGridLayout *m_pLayout;
84 /** Holds the widget reference. */
85 QWidget *m_pWidget;
86 /** Holds the progress-bar instance. */
87 QLabel *m_pProgressLabel;
88 /** Holds the progress-bar instance. */
89 QProgressBar *m_pProgressBar;
90 /** Holds the button-box instance. */
91 QIDialogButtonBox *m_pButtonBox;
92};
93
94#endif /* !FEQT_INCLUDED_SRC_extensions_QIDialogContainer_h */
Note: See TracBrowser for help on using the repository browser.

© 2023 Oracle
ContactPrivacy policyTerms of Use