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

KDEUI

  • sources
  • kde-4.14
  • kdelibs
  • 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 
27 class QDrag;
28 class QMenu;
29 class KIcon;
30 
31 namespace KAuth {
32  class Action;
33 }
34 
46 class KDEUI_EXPORT KPushButton : public QPushButton
47 {
48  Q_OBJECT
49  Q_PROPERTY(bool isDragEnabled READ isDragEnabled WRITE setDragEnabled)
50 
51 public:
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 
166 protected:
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 
195 Q_SIGNALS:
211  void authorized(KAuth::Action *action);
212 
213 private:
218  void init( const KGuiItem &item );
219 
220 private:
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
KStandardGuiItem::guiItem
KGuiItem guiItem(StandardItem ui_enum)
Returns the gui item for the given identifier.
Definition: kstandardguiitem.cpp:29
KPushButton
A QPushButton with drag-support and KGuiItem support.
Definition: kpushbutton.h:46
QWidget
QPushButton::sizeHint
virtual QSize sizeHint() const
QAbstractButton::mouseMoveEvent
virtual void mouseMoveEvent(QMouseEvent *e)
kstandardguiitem.h
QMouseEvent
KStandardGuiItem::StandardItem
StandardItem
Definition: kstandardguiitem.h:48
QAbstractButton::setIcon
void setIcon(const QIcon &icon)
KGuiItem
An abstract class for GUI data such as ToolTip and Icon.
Definition: kguiitem.h:36
QDrag
KIcon
A wrapper around QIcon that provides KDE icon features.
Definition: kicon.h:40
QString
QAbstractButton::mousePressEvent
virtual void mousePressEvent(QMouseEvent *e)
Action
QMenu
QSize
QPushButton::paintEvent
virtual void paintEvent(QPaintEvent *)
QAbstractButton::setText
void setText(const QString &text)
QPushButton
QPaintEvent
KAuth::Action
QIcon
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:24:00 by doxygen 1.8.7 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 API Reference

Skip menu "kdelibs 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

Search



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