KDEUI
KToolBar Class Reference
Floatable toolbar with auto resize. More...
#include <ktoolbar.h>

Public Member Functions | |
void | applySettings (const KConfigGroup &cg, bool force=false) |
KDE_DEPRECATED bool | contextMenuEnabled () const |
bool | eventFilter (QObject *watched, QEvent *event) |
int | iconSizeDefault () const |
KToolBar (const QString &objectName, QMainWindow *parentWindow, Qt::ToolBarArea area, bool newLine=false, bool honorStyle=false, bool readConfig=true) | |
KToolBar (QWidget *parent, bool honorStyle=false, bool readConfig=true) | |
void | loadState (const QDomElement &element) |
KMainWindow * | mainWindow () const |
void | saveSettings (KConfigGroup &cg) |
void | saveState (QDomElement &element) const |
KDE_DEPRECATED void | setContextMenuEnabled (bool enable=true) |
void | setIconDimensions (int size) |
void | setXMLGUIClient (KXMLGUIClient *client) |
virtual | ~KToolBar () |
Static Public Member Functions | |
static void | setToolBarsEditable (bool editable) |
static void | setToolBarsLocked (bool locked) |
static bool | toolBarsEditable () |
static bool | toolBarsLocked () |
static Qt::ToolButtonStyle | toolButtonStyleSetting () |
Protected Slots | |
virtual void | slotMovableChanged (bool movable) |
Protected Member Functions | |
virtual void | actionEvent (QActionEvent *) |
virtual void | contextMenuEvent (QContextMenuEvent *) |
virtual void | dragEnterEvent (QDragEnterEvent *) |
virtual void | dragLeaveEvent (QDragLeaveEvent *) |
virtual void | dragMoveEvent (QDragMoveEvent *) |
virtual void | dropEvent (QDropEvent *) |
virtual void | mouseMoveEvent (QMouseEvent *) |
virtual void | mousePressEvent (QMouseEvent *) |
virtual void | mouseReleaseEvent (QMouseEvent *) |
Detailed Description
Floatable toolbar with auto resize.A KDE-style toolbar.
KToolBar can be used as a standalone widget, but KMainWindow provides easy factories and management of one or more toolbars.
KToolBar uses a global config group to load toolbar settings on construction. It will reread this config group on a KApplication::appearanceChanged() signal.
Definition at line 53 of file ktoolbar.h.
Constructor & Destructor Documentation
KToolBar::KToolBar | ( | QWidget * | parent, | |
bool | honorStyle = false , |
|||
bool | readConfig = true | |||
) | [explicit] |
Normal constructor.
This constructor is used by the XML-GUI. If you use it, you need to call QMainWindow::addToolBar to specify the position of the toolbar. So it's simpler to use the other constructor.
The toolbar will read in various global config settings for things like icon size and text position, etc. However, some of the settings will be honored only if honorStyle
is set to true. All other toolbars will be IconOnly and use Medium icons.
- Parameters:
-
parent The standard toolbar parent (usually a KMainWindow) honorStyle If true, then global settings for IconSize and IconText will be honored readConfig whether to apply the configuration (global and application-specific)
Definition at line 613 of file ktoolbar.cpp.
KToolBar::KToolBar | ( | const QString & | objectName, | |
QMainWindow * | parentWindow, | |||
Qt::ToolBarArea | area, | |||
bool | newLine = false , |
|||
bool | honorStyle = false , |
|||
bool | readConfig = true | |||
) |
Constructor for non-XML-GUI applications.
The toolbar will read in various global config settings for things like icon size and text position, etc. However, some of the settings will be honored only if honorStyle
is set to true. All other toolbars will be IconOnly and use Medium icons.
- Parameters:
-
objectName The QObject name of this toolbar, required so that QMainWindow can save and load the toolbar position parentWindow The window that should be the parent of this toolbar area The position of the toolbar. Usually Qt::TopToolBarArea. newLine If true, start a new line in the dock for this toolbar. honorStyle If true, then global settings for IconSize and IconText will be honored readConfig whether to apply the configuration (global and application-specific)
Definition at line 624 of file ktoolbar.cpp.
KToolBar::~KToolBar | ( | ) | [virtual] |
Member Function Documentation
void KToolBar::actionEvent | ( | QActionEvent * | event | ) | [protected, virtual] |
Definition at line 1321 of file ktoolbar.cpp.
void KToolBar::applySettings | ( | const KConfigGroup & | cg, | |
bool | force = false | |||
) |
Read the toolbar settings from group configGroup
in config
and apply them.
Even default settings are re-applied if force
is set.
Definition at line 907 of file ktoolbar.cpp.
bool KToolBar::contextMenuEnabled | ( | ) | const |
Returns the context menu enabled flag.
- Returns:
- true if the context menu is disabled
- Deprecated:
- use contextMenuPolicy
Definition at line 652 of file ktoolbar.cpp.
void KToolBar::contextMenuEvent | ( | QContextMenuEvent * | event | ) | [protected, virtual] |
Definition at line 718 of file ktoolbar.cpp.
void KToolBar::dragEnterEvent | ( | QDragEnterEvent * | event | ) | [protected, virtual] |
Definition at line 1047 of file ktoolbar.cpp.
void KToolBar::dragLeaveEvent | ( | QDragLeaveEvent * | event | ) | [protected, virtual] |
Definition at line 1126 of file ktoolbar.cpp.
void KToolBar::dragMoveEvent | ( | QDragMoveEvent * | event | ) | [protected, virtual] |
Definition at line 1089 of file ktoolbar.cpp.
void KToolBar::dropEvent | ( | QDropEvent * | event | ) | [protected, virtual] |
Definition at line 1141 of file ktoolbar.cpp.
Reimplemented to support context menu activation on disabled tool buttons.
Definition at line 1229 of file ktoolbar.cpp.
int KToolBar::iconSizeDefault | ( | ) | const |
Returns the default size for this type of toolbar.
- Returns:
- the default size for this type of toolbar.
Definition at line 1033 of file ktoolbar.cpp.
void KToolBar::loadState | ( | const QDomElement & | element | ) |
Load state from an XML.
- Parameters:
-
element,called by KXMLGUIBuilder.
Definition at line 740 of file ktoolbar.cpp.
KMainWindow * KToolBar::mainWindow | ( | ) | const |
Returns the main window that this toolbar is docked with.
Definition at line 1023 of file ktoolbar.cpp.
void KToolBar::mouseMoveEvent | ( | QMouseEvent * | event | ) | [protected, virtual] |
Definition at line 1178 of file ktoolbar.cpp.
void KToolBar::mousePressEvent | ( | QMouseEvent * | event | ) | [protected, virtual] |
Definition at line 1164 of file ktoolbar.cpp.
void KToolBar::mouseReleaseEvent | ( | QMouseEvent * | event | ) | [protected, virtual] |
Definition at line 1217 of file ktoolbar.cpp.
void KToolBar::saveSettings | ( | KConfigGroup & | cg | ) |
Save the toolbar settings to group configGroup
in config
.
Definition at line 657 of file ktoolbar.cpp.
void KToolBar::saveState | ( | QDomElement & | element | ) | const |
Save state into an XML.
- Parameters:
-
element,called by KXMLGUIBuilder.
Definition at line 878 of file ktoolbar.cpp.
void KToolBar::setContextMenuEnabled | ( | bool | enable = true |
) |
This allows you to enable or disable the context menu.
- Parameters:
-
enable If false, then the context menu will be disabled
- Deprecated:
- use setContextMenuPolicy
Definition at line 647 of file ktoolbar.cpp.
void KToolBar::setIconDimensions | ( | int | size | ) |
void KToolBar::setToolBarsEditable | ( | bool | editable | ) | [static] |
Enable or disable toolbar editing via drag & drop of actions.
This is called by KEditToolbar and should generally be set to disabled whenever KEditToolbar is not active.
Definition at line 1353 of file ktoolbar.cpp.
void KToolBar::setToolBarsLocked | ( | bool | locked | ) | [static] |
Allows you to lock and unlock all toolbars (i.e., disallow/allow moving of the toobars).
Definition at line 1359 of file ktoolbar.cpp.
void KToolBar::setXMLGUIClient | ( | KXMLGUIClient * | client | ) |
void KToolBar::slotMovableChanged | ( | bool | movable | ) | [protected, virtual, slot] |
Definition at line 1041 of file ktoolbar.cpp.
bool KToolBar::toolBarsEditable | ( | ) | [static] |
Returns whether the toolbars are currently editable (drag & drop of actions).
Definition at line 1348 of file ktoolbar.cpp.
bool KToolBar::toolBarsLocked | ( | ) | [static] |
Returns whether the toolbars are locked (i.e., moving of the toobars disallowed).
Definition at line 1374 of file ktoolbar.cpp.
Qt::ToolButtonStyle KToolBar::toolButtonStyleSetting | ( | ) | [static] |
Returns the global setting for "Icon Text".
- Returns:
- global setting for "Icon Text"
Definition at line 733 of file ktoolbar.cpp.
The documentation for this class was generated from the following files: