• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.14.38 API Reference
  • KDE Home
  • Contact Us
 

KDEUI

  • kdeui
  • widgets
kpushbutton.h
Go to the documentation of this file.
1/* This file is part of the KDE libraries
2 Copyright (C) 2000 Carsten Pfeiffer <pfeiffer@kde.org>
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
8
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 Boston, MA 02110-1301, USA.
18*/
19
20#ifndef KPUSHBUTTON_H
21#define KPUSHBUTTON_H
22
23#include <QtGui/QPushButton>
24
25#include <kstandardguiitem.h>
26
27class QDrag;
28class QMenu;
29class KIcon;
30
31namespace KAuth {
32 class Action;
33}
34
46class KDEUI_EXPORT KPushButton : public QPushButton
47{
48 Q_OBJECT
49 Q_PROPERTY(bool isDragEnabled READ isDragEnabled WRITE setDragEnabled)
50
51public:
52
56 explicit KPushButton( QWidget *parent = 0 );
57
61 explicit KPushButton( const QString &text, QWidget *parent = 0 );
62
66 KPushButton( const KIcon &icon, const QString &text, QWidget *parent = 0 );
67
72 explicit KPushButton( const KGuiItem &item, QWidget *parent = 0 );
73
77 ~KPushButton();
78
82 void setDragEnabled( bool enable );
83
87 bool isDragEnabled() const;
88
92 void setGuiItem( const KGuiItem& item );
93
97 void setGuiItem( KStandardGuiItem::StandardItem item );
98
102 KStandardGuiItem::StandardItem guiItem() const;
103
108 void setIcon( const KIcon &icon );
109
113 void setIcon( const QIcon &pix );
114
118 void setText( const QString &text );
119
124 void setDelayedMenu(QMenu *delayed_menu);
125
130 QMenu *delayedMenu();
131
136 virtual QSize sizeHint() const;
137
143 KAuth::Action *authAction() const;
144
155 void setAuthAction(KAuth::Action *action);
156
164 void setAuthAction(const QString &actionName);
165
166protected:
173 virtual QDrag * dragObject();
174
178 virtual void mousePressEvent( QMouseEvent * );
182 virtual void mouseMoveEvent( QMouseEvent * );
183
188 virtual void paintEvent( QPaintEvent * );
189
193 virtual void startDrag();
194
195Q_SIGNALS:
211 void authorized(KAuth::Action *action);
212
213private:
218 void init( const KGuiItem &item );
219
220private:
221 class KPushButtonPrivate;
222 KPushButtonPrivate * const d;
223
224 Q_PRIVATE_SLOT(d, void slotSettingsChanged( int ))
225 Q_PRIVATE_SLOT(d, void slotPressedInternal())
226 Q_PRIVATE_SLOT(d, void slotClickedInternal())
227 Q_PRIVATE_SLOT(d, void slotDelayedMenuTimeout())
228 Q_PRIVATE_SLOT(d, void authStatusChanged(int))
229};
230
231#endif // KPUSHBUTTON_H
KAuth::Action
KGuiItem
An abstract class for GUI data such as ToolTip and Icon.
Definition: kguiitem.h:37
KIcon
A wrapper around QIcon that provides KDE icon features.
Definition: kicon.h:41
KPushButton
A QPushButton with drag-support and KGuiItem support.
Definition: kpushbutton.h:47
KPushButton::authorized
void authorized(KAuth::Action *action)
Signal emitted when the button is triggered and authorized.
QMenu
QPushButton
QWidget
kstandardguiitem.h
KAuth
KStandardGuiItem::StandardItem
StandardItem
Definition: kstandardguiitem.h:49
Action
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDEUI

Skip menu "KDEUI"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules
  • Related Pages

kdelibs-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal