kdeui Library API Documentation

KKeyButton Class Reference

A push button that looks like a keyboard key. More...

#include <kkeybutton.h>

Inheritance diagram for KKeyButton:

QPushButton List of all members.

Public Slots

void captureShortcut ()

Signals

void capturedShortcut (const KShortcut &)

Public Member Functions

 KKeyButton (QWidget *parent=0, const char *name=0)
virtual ~KKeyButton ()
void setShortcut (const KShortcut &cut) KDE_DEPRECATED
void setShortcut (const KShortcut &cut, bool bQtShortcut)
const KShortcutshortcut () const
void setText (const QString &text)

Protected Member Functions

void drawButton (QPainter *_painter)
virtual void virtual_hook (int id, void *data)

Protected Attributes

KShortcut m_cut
bool m_bEditing

Detailed Description

A push button that looks like a keyboard key.

You must call setShortcut() to set the widget's currently displayed key. You can call captureShortcut() to get a new shortcut from the user. If captureShortcut() suceeds, then the capturedShortcut signal will be emitted with the value of the new shortcut. The widget containing a KKeyButton widget must connect to this signal and check if the shortcut is valid. If it is, you will need to call setShortcut() with the new value in order make it the key currently displayed.

Author:
Mark Donohoe <donohoe@kde.org>

Definition at line 40 of file kkeybutton.h.


Constructor & Destructor Documentation

KKeyButton::KKeyButton QWidget parent = 0,
const char *  name = 0
 

Constructs key button widget.

Definition at line 68 of file kkeybutton.cpp.

References captureShortcut(), QPushButton::clicked(), m_bEditing, and setShortcut().

KKeyButton::~KKeyButton  )  [virtual]
 

Destructs the key button widget.

Definition at line 78 of file kkeybutton.cpp.


Member Function Documentation

void KKeyButton::setShortcut const KShortcut cut  ) 
 

Deprecated:
Use setShortcut( cut, false ) instead

Definition at line 93 of file kkeybutton.cpp.

Referenced by KKeyButton().

void KKeyButton::setShortcut const KShortcut cut,
bool  bQtShortcut
 

Since:
3.1

Definition at line 83 of file kkeybutton.cpp.

References QString::fromLatin1(), QString::isEmpty(), m_cut, QString::replace(), setText(), and KShortcut::toString().

void KKeyButton::setText const QString text  ) 
 

Reimplemented for internal purposes.

Reimplemented from QPushButton.

Definition at line 98 of file kkeybutton.cpp.

References QPushButton::setText().

Referenced by setShortcut().

void KKeyButton::captureShortcut  )  [slot]
 

Call this method to capture a shortcut from the keyboard.

If it succeeds, the capturedShortcut() will be emitted.

Definition at line 104 of file kkeybutton.cpp.

References QDialog::exec(), KShortcut::isNull(), m_bEditing, m_cut, and KShortcutDialog::shortcut().

Referenced by KKeyButton().

void KKeyButton::drawButton QPainter _painter  )  [protected]
 

Reimplemented for internal reasons.

Definition at line 123 of file kkeybutton.cpp.

References QPainter::drawRect(), QPainter::drawRoundRect(), m_bEditing, QPainter::setBrush(), QPainter::setClipping(), QPainter::setClipRegion(), QPainter::setPen(), QPointArray::setPoint(), and QPushButton::text().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for kdeui Library Version 3.4.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Feb 8 06:22:49 2006 by doxygen 1.4.4 written by Dimitri van Heesch, © 1997-2003