1 | /* $Id: QIDialogButtonBox.h 76581 2019-01-01 06:24:57Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VBox Qt GUI - Qt extensions: QIDialogButtonBox 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_QIDialogButtonBox_h
|
---|
19 | #define FEQT_INCLUDED_SRC_extensions_QIDialogButtonBox_h
|
---|
20 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
21 | # pragma once
|
---|
22 | #endif
|
---|
23 |
|
---|
24 | /* Qt includes: */
|
---|
25 | #include <QDialogButtonBox>
|
---|
26 | #include <QPointer>
|
---|
27 |
|
---|
28 | /* GUI includes: */
|
---|
29 | #include "QIWithRetranslateUI.h"
|
---|
30 | #include "UILibraryDefs.h"
|
---|
31 |
|
---|
32 | /* Forward declarations: */
|
---|
33 | class QBoxLayout;
|
---|
34 | class QPushButton;
|
---|
35 | class UIHelpButton;
|
---|
36 |
|
---|
37 | /** QDialogButtonBox subclass extending standard functionality. */
|
---|
38 | class SHARED_LIBRARY_STUFF QIDialogButtonBox : public QIWithRetranslateUI<QDialogButtonBox>
|
---|
39 | {
|
---|
40 | Q_OBJECT;
|
---|
41 |
|
---|
42 | public:
|
---|
43 |
|
---|
44 | /** Constructs dialog-button-box passing @a pParent to the base-class. */
|
---|
45 | QIDialogButtonBox(QWidget *pParent = 0);
|
---|
46 | /** Constructs dialog-button-box passing @a pParent to the base-class.
|
---|
47 | * @param enmOrientation Brings the button-box orientation. */
|
---|
48 | QIDialogButtonBox(Qt::Orientation enmOrientation, QWidget *pParent = 0);
|
---|
49 | /** Constructs dialog-button-box passing @a pParent to the base-class.
|
---|
50 | * @param enmButtonTypes Brings the set of button types.
|
---|
51 | * @param enmOrientation Brings the button-box orientation. */
|
---|
52 | QIDialogButtonBox(StandardButtons enmButtonTypes, Qt::Orientation enmOrientation = Qt::Horizontal, QWidget *pParent = 0);
|
---|
53 |
|
---|
54 | /** Returns the button of requested @a enmButtonType. */
|
---|
55 | QPushButton *button(StandardButton enmButtonType) const;
|
---|
56 |
|
---|
57 | /** Adds button with passed @a strText for specified @a enmRole. */
|
---|
58 | QPushButton *addButton(const QString &strText, ButtonRole enmRole);
|
---|
59 | /** Adds standard button of passed @a enmButtonType. */
|
---|
60 | QPushButton *addButton(StandardButton enmButtonType);
|
---|
61 |
|
---|
62 | /** Defines a set of standard @a enmButtonTypes. */
|
---|
63 | void setStandardButtons(StandardButtons enmButtonTypes);
|
---|
64 |
|
---|
65 | /** Adds extra @a pWidget. */
|
---|
66 | void addExtraWidget(QWidget *pWidget);
|
---|
67 | /** Adds extra @a pLayout. */
|
---|
68 | void addExtraLayout(QLayout *pLayout);
|
---|
69 |
|
---|
70 | protected:
|
---|
71 |
|
---|
72 | /** Handles translation event. */
|
---|
73 | virtual void retranslateUi() /* override */;
|
---|
74 |
|
---|
75 | /** Returns button layout. */
|
---|
76 | QBoxLayout *boxLayout() const;
|
---|
77 |
|
---|
78 | /** Searchs for empty @a pLayout space. */
|
---|
79 | int findEmptySpace(QBoxLayout *pLayout) const;
|
---|
80 |
|
---|
81 | private:
|
---|
82 |
|
---|
83 | /** Holds the Help button reference. */
|
---|
84 | QPointer<UIHelpButton> m_pHelpButton;
|
---|
85 | };
|
---|
86 |
|
---|
87 | #endif /* !FEQT_INCLUDED_SRC_extensions_QIDialogButtonBox_h */
|
---|