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

KDEUI

KPushButton Class Reference

A QPushButton with drag-support and KGuiItem support. More...

#include <kpushbutton.h>

Inheritance diagram for KPushButton:

Inheritance graph
[legend]

List of all members.


Public Member Functions

QMenu * delayedMenu ()
KStandardGuiItem::StandardItem guiItem () const
bool isDragEnabled () const
 KPushButton (const KGuiItem &item, QWidget *parent=0)
 KPushButton (const KIcon &icon, const QString &text, QWidget *parent=0)
 KPushButton (const QString &text, QWidget *parent=0)
 KPushButton (QWidget *parent=0)
void setDelayedMenu (QMenu *delayed_menu)
void setDragEnabled (bool enable)
void setGuiItem (KStandardGuiItem::StandardItem item)
void setGuiItem (const KGuiItem &item)
KDE_DEPRECATED void setIcon (const QIcon &pix)
void setIcon (const KIcon &icon)
void setText (const QString &text)
 ~KPushButton ()

Protected Member Functions

virtual QDrag * dragObject ()
virtual void mouseMoveEvent (QMouseEvent *)
virtual void mousePressEvent (QMouseEvent *)
virtual void startDrag ()

Properties

bool isDragEnabled

Detailed Description

A QPushButton with drag-support and KGuiItem support.

This is nothing but a QPushButton with drag-support and KGuiItem support. You must call setDragEnabled (true) and override the virtual method dragObject() to specify the QDragObject to be used.

Author:
Carsten Pfeiffer <pfeiffer@kde.org>

Definition at line 40 of file kpushbutton.h.


Constructor & Destructor Documentation

KPushButton::KPushButton ( QWidget *  parent = 0  )  [explicit]

Default constructor.

Definition at line 103 of file kpushbutton.cpp.

KPushButton::KPushButton ( const QString &  text,
QWidget *  parent = 0 
) [explicit]

Constructor, that sets the button-text to text.

Definition at line 109 of file kpushbutton.cpp.

KPushButton::KPushButton ( const KIcon &  icon,
const QString &  text,
QWidget *  parent = 0 
)

Constructor, that sets an icon and the button-text to text.

Definition at line 115 of file kpushbutton.cpp.

KPushButton::KPushButton ( const KGuiItem &  item,
QWidget *  parent = 0 
) [explicit]

Constructor that takes a KGuiItem for the text, the icon, the tooltip and the what's this help.

Definition at line 122 of file kpushbutton.cpp.

KPushButton::~KPushButton (  ) 

Destructs the button.

Definition at line 128 of file kpushbutton.cpp.


Member Function Documentation

QMenu * KPushButton::delayedMenu (  ) 

returns a delayed popup menu since menu() isn't virtual

Definition at line 262 of file kpushbutton.cpp.

QDrag * KPushButton::dragObject (  )  [protected, virtual]

Reimplement this and return the QDrag object that should be used for the drag.

Remember to give it "this" as parent.

Default implementation returns 0, so that no drag is initiated.

Definition at line 245 of file kpushbutton.cpp.

KStandardGuiItem::StandardItem KPushButton::guiItem (  )  const

Reads the standard KGuiItem for this button.

Definition at line 184 of file kpushbutton.cpp.

bool KPushButton::isDragEnabled (  )  const

Returns:
if drag support is enabled or not.

void KPushButton::mouseMoveEvent ( QMouseEvent *  e  )  [protected, virtual]

Reimplemented to add drag-support.

Definition at line 228 of file kpushbutton.cpp.

void KPushButton::mousePressEvent ( QMouseEvent *  e  )  [protected, virtual]

Reimplemented to add drag-support.

Definition at line 221 of file kpushbutton.cpp.

void KPushButton::setDelayedMenu ( QMenu *  delayed_menu  ) 

Sets a delayed popup menu for consistency, since menu() isn't virtual.

Definition at line 257 of file kpushbutton.cpp.

void KPushButton::setDragEnabled ( bool  enable  ) 

Enables/disables drag-support.

Default is disabled.

Definition at line 216 of file kpushbutton.cpp.

void KPushButton::setGuiItem ( KStandardGuiItem::StandardItem  item  ) 

Sets the standard KGuiItem for this button.

Definition at line 178 of file kpushbutton.cpp.

void KPushButton::setGuiItem ( const KGuiItem &  item  ) 

Sets the KGuiItem for this button.

Definition at line 166 of file kpushbutton.cpp.

void KPushButton::setIcon ( const QIcon &  pix  ) 

Sets the pixmap for this button.

Rarely used. This one exists mostly for usage in Qt designer, with icons embedded into the ui file. But you should rather save them separately, and load them with KIcon("name") so that the icons are themeable.

Definition at line 211 of file kpushbutton.cpp.

void KPushButton::setIcon ( const KIcon &  icon  ) 

Sets the Icon Set for this button.

It also takes into account hte KGlobalSettings::showIconsOnPushButtons() setting.

Definition at line 201 of file kpushbutton.cpp.

void KPushButton::setText ( const QString &  text  ) 

Sets the text of the button.

Definition at line 189 of file kpushbutton.cpp.

void KPushButton::startDrag (  )  [protected, virtual]

Starts a drag (dragCopy() by default) using dragObject().

Definition at line 250 of file kpushbutton.cpp.


Property Documentation

bool KPushButton::isDragEnabled [read, write]

Definition at line 43 of file kpushbutton.h.


The documentation for this class was generated from the following files:
  • kpushbutton.h
  • kpushbutton.cpp

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
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.7
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