KToggleToolBarAction Class

Header: #include <KToggleToolBarAction>
CMake: find_package(KF6 REQUIRED COMPONENTS XmlGui)
target_link_libraries(mytarget PRIVATE KF6::XmlGui)

Public Functions

KToggleToolBarAction(KToolBar *toolBar, const QString &text, QObject *parent)
virtual ~KToggleToolBarAction() override
KToolBar *toolBar()

Reimplemented Public Functions

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

Detailed Description

An action that takes care of everything associated with showing or hiding a toolbar by a menu action. It will show or hide the toolbar with the given name when activated, and check or uncheck itself if the toolbar is manually shown or hidden.

If you need to perform some additional action when the toolbar is shown or hidden, connect to the toggled(bool) signal. It will be emitted after the toolbar's visibility has changed, whenever it changes.

Member Function Documentation

KToggleToolBarAction::KToggleToolBarAction(KToolBar *toolBar, const QString &text, QObject *parent)

Creates a KToggleToolBarAction that manages the toolBar with text in its label, as a child of parent.

[override virtual noexcept] KToggleToolBarAction::~KToggleToolBarAction()

Destroys the toggle toolbar action.

[override virtual] bool KToggleToolBarAction::eventFilter(QObject *watched, QEvent *event)

Filters then returns the specified event for a given watched object.

Reimplemented from QObject.

KToolBar *KToggleToolBarAction::toolBar()

Returns a pointer to the tool bar it manages.