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

KDEUI

  • sources
  • kde-4.14
  • kdelibs
  • kdeui
  • widgets
ktoolbar.h
Go to the documentation of this file.
1 /* This file is part of the KDE libraries
2  Copyright (C) 2000 Reginald Stadlbauer (reggie@kde.org)
3  (C) 1997, 1998 Stephan Kulow (coolo@kde.org)
4  (C) 1997, 1998 Sven Radej (radej@kde.org)
5  (C) 1997, 1998 Mark Donohoe (donohoe@kde.org)
6  (C) 1997, 1998 Matthias Ettrich (ettrich@kde.org)
7  (C) 1999, 2000 Kurt Granroth (granroth@kde.org)
8  (C) 2005-2006 Hamish Rodda (rodda@kde.org)
9 
10  This library is free software; you can redistribute it and/or
11  modify it under the terms of the GNU Library General Public
12  License version 2 as published by the Free Software Foundation.
13 
14  This library is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  Library General Public License for more details.
18 
19  You should have received a copy of the GNU Library General Public License
20  along with this library; see the file COPYING.LIB. If not, write to
21  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
22  Boston, MA 02110-1301, USA.
23  */
24 
25 #ifndef KTOOLBAR_H
26 #define KTOOLBAR_H
27 
28 #include <kdeui_export.h>
29 
30 #include <QtGui/QToolBar>
31 
32 class QDomElement;
33 
34 class KConfigGroup;
35 class KConfig;
36 class KMainWindow;
37 class KXMLGUIClient;
38 
53 class KDEUI_EXPORT KToolBar : public QToolBar
54 {
55  Q_OBJECT
56 
57 public:
72  explicit KToolBar(QWidget *parent, bool isMainToolBar = false, bool readConfig = true);
73  // KDE5: remove. The one below is preferred so that all debug output from init() shows the right objectName already,
74  // and so that isMainToolBar() and iconSizeDefault() return correct values during loading too.
75 
91  explicit KToolBar(const QString& objectName, QWidget* parent, bool readConfig = true);
92 
105  KToolBar(const QString& objectName, QMainWindow* parentWindow, Qt::ToolBarArea area, bool newLine = false,
106  bool isMainToolBar = false, bool readConfig = true); // KDE5: remove, I don't think anyone is using this.
107 
111  virtual ~KToolBar();
112 
116  KMainWindow* mainWindow() const;
117 
121  void setIconDimensions( int size );
122 
128  int iconSizeDefault() const; // KDE5: hide from public API. Doesn't make sense to export this, and it isn't used.
129 
136 #ifndef KDE_NO_DEPRECATED
137  KDE_DEPRECATED void setContextMenuEnabled( bool enable = true );
138 #endif
139 
145 #ifndef KDE_NO_DEPRECATED
146  KDE_DEPRECATED bool contextMenuEnabled() const;
147 #endif
148 
152  void saveSettings( KConfigGroup &cg );
153 
162  void applySettings( const KConfigGroup &cg, bool forceGlobal = false );
163 
168 #ifndef KDE_NO_DEPRECATED
169  KDE_DEPRECATED void setXMLGUIClient( KXMLGUIClient *client );
170 #endif
171 
176  void addXMLGUIClient( KXMLGUIClient *client );
177 
182  void removeXMLGUIClient( KXMLGUIClient *client );
183 
187  void loadState( const QDomElement &element );
188 
192  void saveState( QDomElement &element ) const;
193 
197  bool eventFilter( QObject* watched, QEvent* event );
198 
203  static Qt::ToolButtonStyle toolButtonStyleSetting(); // KDE5: make private and file-static, nobody is calling this
204 
208  static bool toolBarsEditable();
209 
215  static void setToolBarsEditable( bool editable );
216 
220  static bool toolBarsLocked();
221 
225  static void setToolBarsLocked( bool locked );
226 
227  protected Q_SLOTS:
228  virtual void slotMovableChanged(bool movable);
229 
230  protected:
231  virtual void contextMenuEvent( QContextMenuEvent* );
232  virtual void actionEvent( QActionEvent* );
233 
234  // Draggable toolbar configuration
235  virtual void dragEnterEvent( QDragEnterEvent* );
236  virtual void dragMoveEvent( QDragMoveEvent* );
237  virtual void dragLeaveEvent( QDragLeaveEvent* );
238  virtual void dropEvent( QDropEvent* );
239  virtual void mousePressEvent( QMouseEvent* );
240  virtual void mouseMoveEvent( QMouseEvent* );
241  virtual void mouseReleaseEvent( QMouseEvent* );
242 
243  private:
244  class Private;
245  Private* const d;
246 
247  Q_PRIVATE_SLOT( d, void slotAppearanceChanged() )
248  Q_PRIVATE_SLOT( d, void slotContextAboutToShow() )
249  Q_PRIVATE_SLOT( d, void slotContextAboutToHide() )
250  Q_PRIVATE_SLOT( d, void slotContextLeft() )
251  Q_PRIVATE_SLOT( d, void slotContextRight() )
252  Q_PRIVATE_SLOT( d, void slotContextShowText() )
253  Q_PRIVATE_SLOT( d, void slotContextTop() )
254  Q_PRIVATE_SLOT( d, void slotContextBottom() )
255  Q_PRIVATE_SLOT( d, void slotContextIcons() )
256  Q_PRIVATE_SLOT( d, void slotContextText() )
257  Q_PRIVATE_SLOT( d, void slotContextTextRight() )
258  Q_PRIVATE_SLOT( d, void slotContextTextUnder() )
259  Q_PRIVATE_SLOT( d, void slotContextIconSize() )
260  Q_PRIVATE_SLOT( d, void slotLockToolBars( bool ) )
261 };
262 
263 #endif
QEvent
QWidget
QWidget::dropEvent
virtual void dropEvent(QDropEvent *event)
KXMLGUIClient
A KXMLGUIClient can be used with KXMLGUIFactory to create a GUI from actions and an XML document...
Definition: kxmlguiclient.h:46
QDragMoveEvent
QWidget::dragLeaveEvent
virtual void dragLeaveEvent(QDragLeaveEvent *event)
QWidget::dragEnterEvent
virtual void dragEnterEvent(QDragEnterEvent *event)
QMouseEvent
QWidget::dragMoveEvent
virtual void dragMoveEvent(QDragMoveEvent *event)
QWidget::mouseReleaseEvent
virtual void mouseReleaseEvent(QMouseEvent *event)
readConfig
TsConfig readConfig(const QString &fname)
QWidget::contextMenuEvent
virtual void contextMenuEvent(QContextMenuEvent *event)
QWidget::mousePressEvent
virtual void mousePressEvent(QMouseEvent *event)
KMainWindow
KDE top level main window
Definition: kmainwindow.h:106
QContextMenuEvent
QObject
QDropEvent
QWidget::mouseMoveEvent
virtual void mouseMoveEvent(QMouseEvent *event)
QObject::eventFilter
virtual bool eventFilter(QObject *watched, QEvent *event)
QString
QMainWindow
QActionEvent
QDragLeaveEvent
KConfigGroup
KConfig
QDragEnterEvent
KToolBar
Floatable toolbar with auto resize.
Definition: ktoolbar.h:53
QToolBar
kdeui_export.h
QDomElement
QToolBar::actionEvent
virtual void actionEvent(QActionEvent *event)
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:24:00 by doxygen 1.8.7 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 API Reference

Skip menu "kdelibs 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

Search



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