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

KDEUI

kpushbutton.h
Go to the documentation of this file.
00001 /* This file is part of the KDE libraries
00002     Copyright (C) 2000 Carsten Pfeiffer <pfeiffer@kde.org>
00003 
00004     This library is free software; you can redistribute it and/or
00005     modify it under the terms of the GNU Library General Public
00006     License as published by the Free Software Foundation; either
00007     version 2 of the License, or (at your option) any later version.
00008 
00009     This library is distributed in the hope that it will be useful,
00010     but WITHOUT ANY WARRANTY; without even the implied warranty of
00011     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012     Library General Public License for more details.
00013 
00014     You should have received a copy of the GNU Library General Public License
00015     along with this library; see the file COPYING.LIB.  If not, write to
00016     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00017     Boston, MA 02110-1301, USA.
00018 */
00019 
00020 #ifndef KPUSHBUTTON_H
00021 #define KPUSHBUTTON_H
00022 
00023 #include <QtGui/QPushButton>
00024 
00025 #include <kstandardguiitem.h>
00026 
00027 class QDrag;
00028 class QMenu;
00029 class KIcon;
00030 
00031 namespace KAuth {
00032     class Action;
00033 }
00034 
00046 class KDEUI_EXPORT KPushButton : public QPushButton
00047 {
00048     Q_OBJECT
00049     Q_PROPERTY(bool isDragEnabled READ isDragEnabled WRITE setDragEnabled)
00050 
00051 public:
00052 
00056     explicit KPushButton( QWidget *parent = 0 );
00057 
00061     explicit KPushButton( const QString &text, QWidget *parent = 0 );
00062 
00066     KPushButton( const KIcon &icon, const QString &text, QWidget *parent = 0 );
00067 
00072     explicit KPushButton( const KGuiItem &item, QWidget *parent = 0 );
00073 
00077     ~KPushButton();
00078 
00082     void setDragEnabled( bool enable );
00083 
00087     bool isDragEnabled() const;
00088 
00092     void setGuiItem( const KGuiItem& item );
00093 
00097     void setGuiItem( KStandardGuiItem::StandardItem item );
00098 
00102     KStandardGuiItem::StandardItem guiItem() const;
00103 
00108     void setIcon( const KIcon &icon );
00109 
00113     void setIcon( const QIcon &pix );
00114 
00118     void setText( const QString &text );
00119 
00124      void setDelayedMenu(QMenu *delayed_menu);
00125 
00130      QMenu *delayedMenu();
00131 
00136     virtual QSize sizeHint() const;
00137 
00143      KAuth::Action *authAction() const;
00144 
00155      void setAuthAction(KAuth::Action *action);
00156 
00164      void setAuthAction(const QString &actionName);
00165 
00166 protected:
00173     virtual QDrag * dragObject();
00174 
00178     virtual void mousePressEvent( QMouseEvent * );
00182     virtual void mouseMoveEvent( QMouseEvent * );
00183 
00188     virtual void paintEvent( QPaintEvent * );
00189 
00193     virtual void startDrag();
00194 
00195 Q_SIGNALS:
00211     void authorized(KAuth::Action *action);
00212 
00213 private:
00218     void init( const KGuiItem &item );
00219 
00220 private:
00221     class KPushButtonPrivate;
00222     KPushButtonPrivate * const d;
00223 
00224     Q_PRIVATE_SLOT(d, void slotSettingsChanged( int ))
00225     Q_PRIVATE_SLOT(d, void slotPressedInternal())
00226     Q_PRIVATE_SLOT(d, void slotClickedInternal())
00227     Q_PRIVATE_SLOT(d, void slotDelayedMenuTimeout())
00228     Q_PRIVATE_SLOT(d, void authStatusChanged(int))
00229 };
00230 
00231 #endif // KPUSHBUTTON_H
This file is part of the KDE documentation.
Documentation copyright © 1996-2012 The KDE developers.
Generated on Thu May 10 2012 20:53:05 by doxygen 1.8.0 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.8.3 API Reference

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