• Skip to content
  • Skip to link menu
KDE 4.1 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 
00040 class KDEUI_EXPORT KPushButton : public QPushButton
00041 {
00042     Q_OBJECT
00043     Q_PROPERTY(bool isDragEnabled READ isDragEnabled WRITE setDragEnabled)
00044 
00045 public:
00046 
00050     explicit KPushButton( QWidget *parent = 0 );
00051 
00055     explicit KPushButton( const QString &text, QWidget *parent = 0 );
00056 
00060     KPushButton( const KIcon &icon, const QString &text, QWidget *parent = 0 );
00061 
00066     explicit KPushButton( const KGuiItem &item, QWidget *parent = 0 );
00067 
00071     ~KPushButton();
00072 
00076     void setDragEnabled( bool enable );
00077 
00081     bool isDragEnabled() const;
00082 
00086     void setGuiItem( const KGuiItem& item );
00087 
00091     void setGuiItem( KStandardGuiItem::StandardItem item );
00092 
00096     KStandardGuiItem::StandardItem guiItem() const;
00097 
00102     void setIcon( const KIcon &icon );
00103 
00109     KDE_DEPRECATED void setIcon( const QIcon &pix );
00110 
00114     void setText( const QString &text );
00115 
00120      void setDelayedMenu(QMenu *delayed_menu);
00121 
00126      QMenu *delayedMenu();
00127 
00128 protected:
00135     virtual QDrag * dragObject();
00136 
00140     virtual void mousePressEvent( QMouseEvent * );
00144     virtual void mouseMoveEvent( QMouseEvent * );
00145 
00149     virtual void startDrag();
00150 
00151 private:
00156     void init( const KGuiItem &item );
00157 
00158 private:
00159     class KPushButtonPrivate;
00160     KPushButtonPrivate * const d;
00161 
00162     Q_PRIVATE_SLOT(d, void slotSettingsChanged( int ))
00163     Q_PRIVATE_SLOT(d, void slotPressedInternal())
00164     Q_PRIVATE_SLOT(d, void slotClickedInternal())
00165     Q_PRIVATE_SLOT(d, void slotDelayedMenuTimeout())
00166 };
00167 
00168 #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
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • KIO
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • Kross
  • KUtils
  • Nepomuk
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.4
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