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

kdeui

KPushButton Class Reference

This is nothing but 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

KStdGuiItem::StdItem guiItem () const
int guiItm () const
bool isDragEnabled () const
 KPushButton (const KGuiItem &item, QWidget *parent, const char *name=0)
 KPushButton (const QIconSet &icon, const QString &text, QWidget *parent, const char *name=0)
 KPushButton (const QString &text, QWidget *parent, const char *name=0)
 KPushButton (QWidget *parent, const char *name=0)
void setDragEnabled (bool enable)
void setGuiItem (KStdGuiItem::StdItem item)
void setGuiItem (const KGuiItem &item)
void setGuiItm (int itm)
void setIconSet (const QIconSet &iconSet)
void setText (const QString &text)
 ~KPushButton ()

Protected Member Functions

virtual QDragObject * dragObject ()
virtual void mouseMoveEvent (QMouseEvent *)
virtual void mousePressEvent (QMouseEvent *)
virtual void startDrag ()
virtual void virtual_hook (int id, void *data)

Properties

bool isDragEnabled
int stdItem

Detailed Description

This is nothing but a QPushButton with drag-support and KGuiItem support.

You have to call setDragEnabled( true ) and override the virtual method dragObject() to specify the QDragObject to be used.

A QPushButton with drag-support and KGuiItem support

Author:
Carsten Pfeiffer <pfeiffer@kde.org>

Definition at line 37 of file kpushbutton.h.


Constructor & Destructor Documentation

KPushButton::KPushButton ( QWidget *  parent,
const char *  name = 0 
)

Default constructor.

Definition at line 43 of file kpushbutton.cpp.

KPushButton::KPushButton ( const QString &  text,
QWidget *  parent,
const char *  name = 0 
)

Constructor, that sets the button-text to text.

Definition at line 50 of file kpushbutton.cpp.

KPushButton::KPushButton ( const QIconSet &  icon,
const QString &  text,
QWidget *  parent,
const char *  name = 0 
)

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

Definition at line 58 of file kpushbutton.cpp.

KPushButton::KPushButton ( const KGuiItem &  item,
QWidget *  parent,
const char *  name = 0 
)

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

Definition at line 66 of file kpushbutton.cpp.

KPushButton::~KPushButton (  ) 

Destructs the button.

Definition at line 74 of file kpushbutton.cpp.


Member Function Documentation

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

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

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

Definition at line 205 of file kpushbutton.cpp.

KStdGuiItem::StdItem KPushButton::guiItem (  )  const

Reads the standard KGuiItem for this button.

Since:
3.4

Definition at line 143 of file kpushbutton.cpp.

int KPushButton::guiItm (  )  const [inline]

Definition at line 101 of file kpushbutton.h.

bool KPushButton::isDragEnabled (  )  const [inline]

Returns:
if drag support is enabled or not.

Definition at line 80 of file kpushbutton.h.

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

Reimplemented to add drag-support.

Definition at line 188 of file kpushbutton.cpp.

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

Reimplemented to add drag-support.

Definition at line 181 of file kpushbutton.cpp.

void KPushButton::setDragEnabled ( bool  enable  ) 

Enables/disables drag-support.

Default is disabled.

Definition at line 176 of file kpushbutton.cpp.

void KPushButton::setGuiItem ( KStdGuiItem::StdItem  item  ) 

Sets the standard KGuiItem for this button.

Since:
3.4

Definition at line 137 of file kpushbutton.cpp.

void KPushButton::setGuiItem ( const KGuiItem &  item  ) 

Sets the KGuiItem for this button.

Definition at line 120 of file kpushbutton.cpp.

void KPushButton::setGuiItm ( int  itm  )  [inline]

Definition at line 100 of file kpushbutton.h.

void KPushButton::setIconSet ( const QIconSet &  iconSet  ) 

Sets the Icon Set for this button.

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

Reimplemented from QPushButton.

Definition at line 160 of file kpushbutton.cpp.

void KPushButton::setText ( const QString &  text  ) 

Sets the text of the button.

Reimplemented from QPushButton.

Definition at line 148 of file kpushbutton.cpp.

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

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

Definition at line 210 of file kpushbutton.cpp.

void KPushButton::virtual_hook ( int  id,
void *  data 
) [protected, virtual]

Definition at line 217 of file kpushbutton.cpp.


Property Documentation

bool KPushButton::isDragEnabled [read, write]

Definition at line 41 of file kpushbutton.h.

int KPushButton::stdItem [read, write]

Definition at line 40 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
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

API Reference

Skip menu "API Reference"
  • dcop
  • DNSSD
  • interfaces
  • Kate
  • kconf_update
  • KDECore
  • KDED
  • kdefx
  • KDEsu
  • kdeui
  • KDocTools
  • KHTML
  • KImgIO
  • KInit
  • kio
  • kioslave
  • KJS
  • KNewStuff
  • KParts
  • KUtils
Generated for API Reference by doxygen 1.5.9
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