• Skip to content
  • Skip to link menu
KDE 4.6 API Reference
  • KDE API Reference
  • kdelibs
  • KDE Home
  • Contact Us
 

KDEUI

Signals | Public Member Functions | Protected Member Functions

KToolBarLabelAction Class Reference

Class to display a label in a toolbar. More...

#include <ktoolbarlabelaction.h>

Inheritance diagram for KToolBarLabelAction:
Inheritance graph
[legend]

List of all members.

Signals

void textChanged (const QString &newText)

Public Member Functions

 KToolBarLabelAction (const QString &text, QObject *parent)
 KToolBarLabelAction (QAction *buddy, const QString &text, QObject *parent)
virtual ~KToolBarLabelAction ()
QAction * buddy () const
virtual QWidget * createWidget (QWidget *parent)
void setBuddy (QAction *buddy)

Protected Member Functions

virtual bool event (QEvent *)
virtual bool eventFilter (QObject *watched, QEvent *event)

Detailed Description

Class to display a label in a toolbar.

KToolBarLabelAction is a convenience class for displaying a label in a toolbar.

It provides easy access to the label's setBuddy(QAction*) and buddy() methods and can be used as follows:

 KHistoryCombo* findCombo = new KHistoryCombo( true, this );

 KWidgetAction* action = new KWidgetAction( findCombo, i18n("Find Combo"),
                                            Qt::Key_F6, this, SLOT( slotFocus() ),
                                            actionCollection(), "find_combo");

 KAction *action = new KToolBarLabelAction( action, i18n( "Find "), "find_label" );
 action->setShortcut( Qt::Key_F6 );
 connect( action, SIGNAL( triggered() ), this, SLOT( slotFocus() ) );
Author:
Felix Berger <felixberger@beldesign.de>

Definition at line 49 of file ktoolbarlabelaction.h.


Constructor & Destructor Documentation

KToolBarLabelAction::KToolBarLabelAction ( const QString &  text,
QObject *  parent 
)

Creates a toolbar label.

Parameters:
textThe label's and the action's text.
parentThis action's parent.

Definition at line 33 of file ktoolbarlabelaction.cpp.

KToolBarLabelAction::KToolBarLabelAction ( QAction *  buddy,
const QString &  text,
QObject *  parent 
)

Creates a toolbar label setting a buddy for the label.

Parameters:
buddyThe action whose widget which is focused when the label's accelerator is typed.
textThe label's and the action's text.
parentThis action's parent.

Definition at line 40 of file ktoolbarlabelaction.cpp.

KToolBarLabelAction::~KToolBarLabelAction ( ) [virtual]

Destroys the toolbar label.

Definition at line 49 of file ktoolbarlabelaction.cpp.


Member Function Documentation

QAction * KToolBarLabelAction::buddy ( ) const

Returns the label's buddy or 0 if no buddy is currently set.

See QLabel::buddy() and QLabel::setBuddy() for more information.

Definition at line 73 of file ktoolbarlabelaction.cpp.

QWidget * KToolBarLabelAction::createWidget ( QWidget *  parent) [virtual]

Reimplemented from.

See also:
QActionWidgetFactory.

These lines were copied from Konqueror's KonqDraggableLabel class in konq_misc.cc

Definition at line 104 of file ktoolbarlabelaction.cpp.

bool KToolBarLabelAction::event ( QEvent *  event) [protected, virtual]
Reimplemented from superclass.

Reimplemented from KAction.

Definition at line 78 of file ktoolbarlabelaction.cpp.

bool KToolBarLabelAction::eventFilter ( QObject *  watched,
QEvent *  event 
) [protected, virtual]

Definition at line 90 of file ktoolbarlabelaction.cpp.

void KToolBarLabelAction::setBuddy ( QAction *  buddy)

Sets the label's buddy to buddy.

See QLabel::setBuddy() for details.

Definition at line 54 of file ktoolbarlabelaction.cpp.

void KToolBarLabelAction::textChanged ( const QString &  newText) [signal]

This signal is emmitted whenever the text of this action is changed.


The documentation for this class was generated from the following files:
  • ktoolbarlabelaction.h
  • ktoolbarlabelaction.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
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.7.3
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