VirtualBox

source: vbox/trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIDialogButtonBox.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.9 KB
Line 
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: */
33class QBoxLayout;
34class QPushButton;
35class UIHelpButton;
36
37/** QDialogButtonBox subclass extending standard functionality. */
38class SHARED_LIBRARY_STUFF QIDialogButtonBox : public QIWithRetranslateUI<QDialogButtonBox>
39{
40 Q_OBJECT;
41
42public:
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
70protected:
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
81private:
82
83 /** Holds the Help button reference. */
84 QPointer<UIHelpButton> m_pHelpButton;
85};
86
87#endif /* !FEQT_INCLUDED_SRC_extensions_QIDialogButtonBox_h */
Note: See TracBrowser for help on using the repository browser.

© 2023 Oracle
ContactPrivacy policyTerms of Use