KDEUI
#include <ktoolbar.h>
Public Member Functions | |
KToolBar (QWidget *parent, bool isMainToolBar=false, bool readConfig=true) | |
KToolBar (const QString &objectName, QWidget *parent, bool readConfig=true) | |
KToolBar (const QString &objectName, QMainWindow *parentWindow, Qt::ToolBarArea area, bool newLine=false, bool isMainToolBar=false, bool readConfig=true) | |
virtual | ~KToolBar () |
void | addXMLGUIClient (KXMLGUIClient *client) |
void | applySettings (const KConfigGroup &cg, bool forceGlobal=false) |
bool | contextMenuEnabled () const |
bool | eventFilter (QObject *watched, QEvent *event) |
int | iconSizeDefault () const |
void | loadState (const QDomElement &element) |
KMainWindow * | mainWindow () const |
void | removeXMLGUIClient (KXMLGUIClient *client) |
void | saveSettings (KConfigGroup &cg) |
void | saveState (QDomElement &element) const |
void | setContextMenuEnabled (bool enable=true) |
void | setIconDimensions (int size) |
void | setXMLGUIClient (KXMLGUIClient *client) |
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
|
explicit |
Constructor.
This constructor takes care of adding the toolbar to the mainwindow, if parent
is a QMainWindow.
Normally KDE applications do not call this directly, they either call KMainWindow::toolBar(name), or they use XML-GUI and specify toolbars using XML.
- Parameters
-
parent The standard toolbar parent (usually a KMainWindow) isMainToolBar True for the "main toolbar", false for other toolbars. Different settings apply. readConfig whether to apply the configuration (global and application-specific)
Definition at line 766 of file ktoolbar.cpp.
|
explicit |
Constructor.
This constructor takes care of adding the toolbar to the mainwindow, if parent
is a QMainWindow.
Normally KDE applications do not call this directly, they either call KMainWindow::toolBar(name), or they use XML-GUI and specify toolbars using XML.
- Parameters
-
objectName The QObject name of this toolbar, required so that QMainWindow can save and load the toolbar position, and so that KToolBar can find out if it's the main toolbar. parent The standard toolbar parent (usually a KMainWindow) readConfig whether to apply the configuration (global and application-specific)
Definition at line 777 of file ktoolbar.cpp.
KToolBar::KToolBar | ( | const QString & | objectName, |
QMainWindow * | parentWindow, | ||
Qt::ToolBarArea | area, | ||
bool | newLine = false , |
||
bool | isMainToolBar = false , |
||
bool | readConfig = true |
||
) |
Alternate constructor with additional arguments, e.g.
to choose in which area the toolbar should be auto-added. This is rarely used in KDE. When using XMLGUI you can specify this as an xml attribute instead.
- 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. isMainToolBar True for the "main toolbar", false for other toolbars. Different settings apply. readConfig whether to apply the configuration (global and application-specific)
Definition at line 791 of file ktoolbar.cpp.
|
virtual |
Destroys the toolbar.
Definition at line 808 of file ktoolbar.cpp.
Member Function Documentation
|
protectedvirtual |
Definition at line 1367 of file ktoolbar.cpp.
void KToolBar::addXMLGUIClient | ( | KXMLGUIClient * | client | ) |
Adds an XML gui client that uses this toolbar.
- Since
- 4.8.1
Definition at line 862 of file ktoolbar.cpp.
void KToolBar::applySettings | ( | const KConfigGroup & | cg, |
bool | forceGlobal = false |
||
) |
Read the toolbar settings from group configGroup
in config
and apply them.
- Parameters
-
forceGlobal is deprecated. In kde3 it used to mean "force global settings, i.e. ignore @p cg", but only for visibility/position/index, not for icon size etc. Only visibility is still controlled by this.
Definition at line 1039 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 822 of file ktoolbar.cpp.
|
protectedvirtual |
Definition at line 872 of file ktoolbar.cpp.
|
protectedvirtual |
Definition at line 1088 of file ktoolbar.cpp.
|
protectedvirtual |
Definition at line 1167 of file ktoolbar.cpp.
|
protectedvirtual |
Definition at line 1130 of file ktoolbar.cpp.
|
protectedvirtual |
Definition at line 1182 of file ktoolbar.cpp.
Reimplemented to support context menu activation on disabled tool buttons.
Definition at line 1270 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 1077 of file ktoolbar.cpp.
void KToolBar::loadState | ( | const QDomElement & | element | ) |
Load state from an XML.
- Parameters
-
element,called by KXMLGUIBuilder.
Definition at line 898 of file ktoolbar.cpp.
KMainWindow * KToolBar::mainWindow | ( | ) | const |
Returns the main window that this toolbar is docked with.
Definition at line 1066 of file ktoolbar.cpp.
|
protectedvirtual |
Definition at line 1219 of file ktoolbar.cpp.
|
protectedvirtual |
Definition at line 1205 of file ktoolbar.cpp.
|
protectedvirtual |
Definition at line 1258 of file ktoolbar.cpp.
void KToolBar::removeXMLGUIClient | ( | KXMLGUIClient * | client | ) |
Removes an XML gui client that uses this toolbar.
- Since
- 4.8.5
Definition at line 867 of file ktoolbar.cpp.
void KToolBar::saveSettings | ( | KConfigGroup & | cg | ) |
Save the toolbar settings to group configGroup
in config
.
Definition at line 828 of file ktoolbar.cpp.
void KToolBar::saveState | ( | QDomElement & | element | ) | const |
Save state into an XML.
- Parameters
-
element,called by KXMLGUIBuilder.
Definition at line 1006 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 815 of file ktoolbar.cpp.
void KToolBar::setIconDimensions | ( | int | size | ) |
Convenience function to set icon size.
Definition at line 1071 of file ktoolbar.cpp.
|
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 1408 of file ktoolbar.cpp.
|
static |
Allows you to lock and unlock all toolbars (i.e., disallow/allow moving of the toobars).
Definition at line 1415 of file ktoolbar.cpp.
void KToolBar::setXMLGUIClient | ( | KXMLGUIClient * | client | ) |
Sets the XML gui client.
- Deprecated:
- use addXMLGUIClient.
Definition at line 855 of file ktoolbar.cpp.
|
protectedvirtualslot |
Definition at line 1082 of file ktoolbar.cpp.
|
static |
Returns whether the toolbars are currently editable (drag & drop of actions).
Definition at line 1403 of file ktoolbar.cpp.
|
static |
Returns whether the toolbars are locked (i.e., moving of the toobars disallowed).
Definition at line 1428 of file ktoolbar.cpp.
|
static |
Returns the global setting for "Icon Text" for the main toolbar.
- Returns
- global setting for "Icon Text" for the main toolbar
Definition at line 891 of file ktoolbar.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:49:18 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.