Warning: That file was not part of the compilation database. It may have many parsing errors.
1 | /* This file is part of the KDE libraries |
---|---|
2 | Copyright (C) 1997 Mario Weilguni (mweilguni@sime.com) |
3 | Copyright (C) 2006 Olivier Goffart <ogoffart@kde.org> |
4 | |
5 | This library is free software; you can redistribute it and/or |
6 | modify it under the terms of the GNU Library General Public |
7 | License as published by the Free Software Foundation; either |
8 | version 2 of the License, or (at your option) any later version. |
9 | |
10 | This library is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Library General Public License for more details. |
14 | |
15 | You should have received a copy of the GNU Library General Public License |
16 | along with this library; see the file COPYING.LIB. If not, write to |
17 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
18 | Boston, MA 02110-1301, USA. |
19 | */ |
20 | |
21 | #ifndef KDIALOGBUTTONBOX_H |
22 | #define KDIALOGBUTTONBOX_H |
23 | |
24 | #include <kdeui_export.h> |
25 | |
26 | #include <QtGui/QDialogButtonBox> |
27 | |
28 | class QPushButton; |
29 | class KPushButton; |
30 | class KGuiItem; |
31 | |
32 | class KDialogButtonBoxPrivate; |
33 | /** |
34 | * Container widget for buttons. |
35 | * |
36 | * An extension of QDialogButtonBox which allow the use of KGuiItem and |
37 | * conveniance slot connection. |
38 | * |
39 | * \image html kdialogbuttonbox.png "Various KDE Dialog Button Boxes with different buttons" |
40 | * |
41 | * @author Mario Weilguni <mweilguni@sime.com> |
42 | * @author Olivier Goffart <ogoffart@kde.org> |
43 | **/ |
44 | |
45 | class KDEUI_EXPORT KDialogButtonBox : public QDialogButtonBox |
46 | { |
47 | Q_OBJECT |
48 | |
49 | public: |
50 | /** |
51 | * Create an empty container for buttons. |
52 | * |
53 | * If @p _orientation is @p Vertical, the buttons inserted with |
54 | * addButton() are laid out from top to bottom, otherwise they |
55 | * are laid out from left to right. |
56 | */ |
57 | explicit KDialogButtonBox(QWidget *parent, Qt::Orientation _orientation = Qt::Horizontal); |
58 | |
59 | /** |
60 | * Free private data field |
61 | */ |
62 | ~KDialogButtonBox(); |
63 | |
64 | /** |
65 | * Creates a push button with the given text, adds it to the button box for the specified role, and returns the corresponding push button. |
66 | * If role is invalid, no button is created, and zero is returned. |
67 | * |
68 | * The clicked signal of the button is automatically connected to the slot |
69 | * |
70 | * @param text the text of the button to add. |
71 | * @param role the button role |
72 | * @param receiver An object to connect to. |
73 | * @param slot A Qt slot to connect the 'clicked()' signal to. |
74 | * |
75 | * @return A pointer to the new button. |
76 | */ |
77 | QPushButton *addButton(const QString& text, ButtonRole role, QObject * receiver, const char * slot); |
78 | |
79 | /** |
80 | * Creates a push button with the given KUiItem, adds it to the button box for the specified role, and returns the corresponding push button. |
81 | * If role is invalid, the button is created, but not added. |
82 | * |
83 | * The clicked signal of the button is automatically connected to the slot |
84 | * |
85 | * @param guiitem text and icon on the button |
86 | * @param role the button role |
87 | * @param receiver An object to connect to. |
88 | * @param slot A Qt slot to connect the 'clicked()' signal to. |
89 | * |
90 | * @return A pointer to the new button. |
91 | */ |
92 | KPushButton *addButton(const KGuiItem& guiitem,ButtonRole role, QObject * receiver=0, const char * slot=0); |
93 | |
94 | using QDialogButtonBox::addButton; |
95 | |
96 | private: |
97 | KDialogButtonBoxPrivate* const d; |
98 | }; |
99 | |
100 | #endif |
101 | |
102 |
Warning: That file was not part of the compilation database. It may have many parsing errors.