class KToolBar

Floatable toolbar with auto resize. More...

Definition#include <ktoolbar.h>
InheritsQFrame
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Signals

Protected Methods

Protected Members


Detailed Description

A KDE-style toolbar.

KToolBar can be "floated", dragged and docked from its parent window.

A KToolBar can contain standard or toggle buttons, line edit widgets, combo boxes, frames or any developer-defined custom widget, with automatic full-width resize for each widget (except buttons). Buttons can also be connected to popup menus with a delay option.

KToolBar can be used as a standalone widget, but KTMainWindow provides easy factories and management of one or more toolbars. Once you have a KToolBar object, you can insert items into it with the insert... methods, or remove them with the removeItem() method. This can be done at any time; the toolbar will be automatically updated. There are also many methods to set per-child properties like alignment and toggle behaviour.

KToolBar uses a global config group to load toolbar settings on construction. It will reread this config group on a KApplication::appearanceChanged() signal.

BUGS: Sometimes flickers on auto resize, no workaround has yet been found for this.

void  clicked (int id)

[signal]

Emitted when button id is clicked.

void  doubleClicked (int id)

[signal]

Emitted when button id is double-clicked.

Note: you will always recive two clicked() , pressed() and released() signals. There is no way to avoid it - at least no easy way. If you need to resolve this all you can do is set up timers which wait for QApplication::doubleClickInterval() to expire. If in that time you don't get this signal, you may belive that button was only clicked and not double-clicked. And please note that butons with popup menus do not emit this signal, but those with delayed popup do.

void  pressed (int)

[signal]

Emitted when button id is pressed.

void  released (int)

[signal]

Emits when button id is released.

void  toggled (int)

[signal]

Emitted when a toggle button changes state.

Emitted also if you change state with setButton() or toggleButton() If you make a button normal again, with setToggle (false), this signal won't be emitted.

void  highlighted (int id, bool isHighlighted)

[signal]

This signal is emitted when item id gets highlighted/unhighlighted (i.e when mouse enters/exits).

Note that this signal is emitted from all buttons (normal, disabled and toggle) even when there is no visible change in buttons (i.e., buttons do not raise when mouse enters). The parameter isHighlighted is true when mouse enters and false when mouse exits.

void  highlighted (int id )

[signal]

This signal is emitted when item id gets highlighted/unhighlighted (i.e when mouse enters/exits).

Note that this signal is emitted from all buttons (normal, disabled and toggle) even when there is no visible change in buttons (i.e., buttons do not raise when mouse enters).

void  moved ( BarPosition )

[signal]

Emitted when toolbar changes position, or when an item is removed from toolbar.

This is normaly connected to KTMainWindow::updateRects(). If you subclass KTMainWindow and reimplement KTMainWindow::resizeEvent() or KTMainWindow::updateRects(), be sure to connect to this signal. Note: You can connect this signal to a slot that doesn't take parameter.

void  modechange ()

[signal]

This signal is emited when toolbar detects changing of following parameters: highlighting, button-size, button-mode. This signal is internal, aimed to buttons.

KToolBarItemListitems ()

[protected]

This will return a pointer to the list of toolbar items