• Skip to content
  • Skip to link menu
KDE 4.5 API Reference
  • KDE API Reference
  • kdelibs
  • Sitemap
  • 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 
00115     KDE_DEPRECATED void setIcon( const QIcon &pix );
00116 
00120     void setText( const QString &text );
00121 
00126      void setDelayedMenu(QMenu *delayed_menu);
00127 
00132      QMenu *delayedMenu();
00133 
00138     virtual QSize sizeHint() const;
00139 
00145      KAuth::Action *authAction() const;
00146 
00157      void setAuthAction(KAuth::Action *action);
00158 
00166      void setAuthAction(const QString &actionName);
00167 
00168 protected:
00175     virtual QDrag * dragObject();
00176 
00180     virtual void mousePressEvent( QMouseEvent * );
00184     virtual void mouseMoveEvent( QMouseEvent * );
00185 
00190     virtual void paintEvent( QPaintEvent * );
00191 
00195     virtual void startDrag();
00196 
00197 Q_SIGNALS:
00213     void authorized(KAuth::Action *action);
00214 
00215 private:
00220     void init( const KGuiItem &item );
00221 
00222 private:
00223     class KPushButtonPrivate;
00224     KPushButtonPrivate * const d;
00225 
00226     Q_PRIVATE_SLOT(d, void slotSettingsChanged( int ))
00227     Q_PRIVATE_SLOT(d, void slotPressedInternal())
00228     Q_PRIVATE_SLOT(d, void slotClickedInternal())
00229     Q_PRIVATE_SLOT(d, void slotDelayedMenuTimeout())
00230     Q_PRIVATE_SLOT(d, void authStatusChanged(int))
00231 };
00232 
00233 #endif // KPUSHBUTTON_H

KDEUI

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

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • 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
  • KUtils
  • Nepomuk
  • Plasma
  •     Sodep
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.9-20090814
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal