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

KDEUI

Signals | Public Member Functions | Protected Member Functions | List of all members
KToolBarLabelAction Class Reference

#include <ktoolbarlabelaction.h>

Inheritance diagram for KToolBarLabelAction:
KAction QAction QWidgetAction

Signals

void textChanged (const QString &newText)
 
- Signals inherited from KAction
void authorized (KAuth::Action *action)
 
void globalShortcutChanged (const QKeySequence &)
 
void triggered (Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers)
 

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)
 
- Public Member Functions inherited from KAction
 KAction (const KIcon &icon, const QString &text, QObject *parent)
 
 KAction (const QString &text, QObject *parent)
 
 KAction (QObject *parent)
 
virtual ~KAction ()
 
KAuth::Action * authAction () const
 
bool event (QEvent *)
 
void forgetGlobalShortcut ()
 
const KShortcut & globalShortcut (ShortcutTypes type=ActiveShortcut) const
 
bool globalShortcutAllowed () const
 
bool isGlobalShortcutEnabled () const
 
bool isShortcutConfigurable () const
 
KRockerGesture rockerGesture (ShortcutTypes type=ActiveShortcut) const
 
void setAuthAction (const QString &actionName)
 
void setAuthAction (KAuth::Action *action)
 
void setGlobalShortcut (const KShortcut &shortcut, ShortcutTypes type=ShortcutTypes(ActiveShortcut|DefaultShortcut), GlobalShortcutLoading loading=Autoloading)
 
void setGlobalShortcutAllowed (bool allowed, GlobalShortcutLoading loading=Autoloading)
 
void setHelpText (const QString &text)
 
void setRockerGesture (const KRockerGesture &gest, ShortcutTypes type=ShortcutTypes(ActiveShortcut|DefaultShortcut))
 
void setShapeGesture (const KShapeGesture &gest, ShortcutTypes type=ShortcutTypes(ActiveShortcut|DefaultShortcut))
 
void setShortcut (const KShortcut &shortcut, ShortcutTypes type=ShortcutTypes(ActiveShortcut|DefaultShortcut))
 
void setShortcut (const QKeySequence &shortcut, ShortcutTypes type=ShortcutTypes(ActiveShortcut|DefaultShortcut))
 
void setShortcutConfigurable (bool configurable)
 
void setShortcuts (const QList< QKeySequence > &shortcuts, ShortcutTypes type=ShortcutTypes(ActiveShortcut|DefaultShortcut))
 
KShapeGesture shapeGesture (ShortcutTypes type=ActiveShortcut) const
 
KShortcut shortcut (ShortcutTypes types=ActiveShortcut) const
 

Protected Member Functions

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

Additional Inherited Members

- Public Types inherited from KAction
enum  GlobalShortcutLoading { Autoloading = 0x0 , NoAutoloading = 0x4 }
 
enum  ShortcutType { ActiveShortcut = 0x1 , DefaultShortcut = 0x2 }
 
- Properties inherited from KAction
KShortcut globalShortcut
 
bool globalShortcutAllowed
 
bool globalShortcutEnabled
 
KShortcut shortcut
 
bool shortcutConfigurable
 

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() ) );
KAction
Class to encapsulate user-driven action or event.
Definition: kaction.h:217
KAction::triggered
void triggered(Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers)
Emitted when the action is triggered.
KAction::setShortcut
void setShortcut(const KShortcut &shortcut, ShortcutTypes type=ShortcutTypes(ActiveShortcut|DefaultShortcut))
Set the shortcut for this action.
Definition: kaction.cpp:198
KToolBarLabelAction
Class to display a label in a toolbar.
Definition: ktoolbarlabelaction.h:50
i18n
QString i18n(const char *text)
Author
Felix Berger felix.nosp@m.berg.nosp@m.er@be.nosp@m.ldes.nosp@m.ign.d.nosp@m.e

Definition at line 49 of file ktoolbarlabelaction.h.

Constructor & Destructor Documentation

◆ KToolBarLabelAction() [1/2]

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() [2/2]

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::~KToolBarLabelAction ( )
virtual

Destroys the toolbar label.

Definition at line 49 of file ktoolbarlabelaction.cpp.

Member Function Documentation

◆ buddy()

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.

◆ createWidget()

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.

◆ event()

bool KToolBarLabelAction::event ( QEvent *  event)
protectedvirtual

Definition at line 78 of file ktoolbarlabelaction.cpp.

◆ eventFilter()

bool KToolBarLabelAction::eventFilter ( QObject *  watched,
QEvent *  event 
)
protectedvirtual

Definition at line 90 of file ktoolbarlabelaction.cpp.

◆ setBuddy()

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.

◆ textChanged

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
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDEUI

Skip menu "KDEUI"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules
  • Related Pages

kdelibs-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • 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
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal