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

KDEUI

Signals | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
KEditToolBar Class Reference

#include <kedittoolbar.h>

Inheritance diagram for KEditToolBar:
Inheritance graph
[legend]

Signals

void newToolBarConfig ()
 
QT_MOC_COMPAT void newToolbarConfig ()
 
- Signals inherited from KDialog
void aboutToShowDetails ()
 
void applyClicked ()
 
void buttonClicked (KDialog::ButtonCode button)
 
void cancelClicked ()
 
void closeClicked ()
 
void defaultClicked ()
 
void finished ()
 
void helpClicked ()
 
void hidden ()
 
void layoutHintChanged ()
 
void noClicked ()
 
void okClicked ()
 
void resetClicked ()
 
void tryClicked ()
 
void user1Clicked ()
 
void user2Clicked ()
 
void user3Clicked ()
 
void yesClicked ()
 

Public Member Functions

 KEditToolBar (KActionCollection *collection, QWidget *parent=0)
 
 KEditToolBar (KXMLGUIFactory *factory, QWidget *parent=0)
 
 ~KEditToolBar ()
 
void setDefaultToolBar (const QString &toolBarName)
 
void setResourceFile (const QString &file, bool global=true)
 
- Public Member Functions inherited from KDialog
 KDialog (QWidget *parent=0, Qt::WindowFlags flags=0)
 
 ~KDialog ()
 
KPushButton * button (ButtonCode id) const
 
KIcon buttonIcon (ButtonCode id) const
 
QString buttonText (ButtonCode id) const
 
QString buttonToolTip (ButtonCode id) const
 
QString buttonWhatsThis (ButtonCode id) const
 
ButtonCode defaultButton () const
 
QString helpLinkText () const
 
void incrementInitialSize (const QSize &size)
 
bool isButtonEnabled (ButtonCode id) const
 
QWidget * mainWidget ()
 
virtual QSize minimumSizeHint () const
 
void restoreDialogSize (const KConfigGroup &config)
 
void saveDialogSize (KConfigGroup &config, KConfigGroup::WriteConfigFlags options=KConfigGroup::Normal) const
 
void setButtonFocus (ButtonCode id)
 
void setButtonGuiItem (ButtonCode id, const KGuiItem &item)
 
void setButtonIcon (ButtonCode id, const KIcon &icon)
 
void setButtonMenu (ButtonCode id, QMenu *menu, ButtonPopupMode popupmode=InstantPopup)
 
void setButtons (ButtonCodes buttonMask)
 
void setButtonsOrientation (Qt::Orientation orientation)
 
void setButtonText (ButtonCode id, const QString &text)
 
void setButtonToolTip (ButtonCode id, const QString &text)
 
void setButtonWhatsThis (ButtonCode id, const QString &text)
 
void setDefaultButton (ButtonCode id)
 
void setEscapeButton (ButtonCode id)
 
void setInitialSize (const QSize &size)
 
void setMainWidget (QWidget *widget)
 
void showButton (ButtonCode id, bool state)
 
void showButtonSeparator (bool state)
 
virtual QSize sizeHint () const
 

Static Public Member Functions

static void setGlobalDefaultToolBar (const char *toolBarName)
 
- Static Public Member Functions inherited from KDialog
static bool avoidArea (QWidget *widget, const QRect &area, int screen=-1)
 
static void centerOnScreen (QWidget *widget, int screen=-1)
 
static int groupSpacingHint ()
 
static QString makeStandardCaption (const QString &userCaption, QWidget *window=0, CaptionFlags flags=HIGCompliantCaption)
 
static int marginHint ()
 
static void resizeLayout (QWidget *widget, int margin, int spacing)
 
static void resizeLayout (QLayout *lay, int margin, int spacing)
 
static void setAllowEmbeddingInGraphicsView (bool allowEmbedding)
 
static int spacingHint ()
 

Protected Member Functions

virtual void hideEvent (QHideEvent *event)
 
virtual void showEvent (QShowEvent *event)
 
- Protected Member Functions inherited from KDialog
 KDialog (KDialogPrivate &dd, QWidget *parent, Qt::WindowFlags flags=0)
 
virtual void closeEvent (QCloseEvent *e)
 
virtual void keyPressEvent (QKeyEvent *)
 

Additional Inherited Members

- Public Types inherited from KDialog
enum  ButtonCode {
  None = 0x00000000, Help = 0x00000001, Default = 0x00000002, Ok = 0x00000004,
  Apply = 0x00000008, Try = 0x00000010, Cancel = 0x00000020, Close = 0x00000040,
  No = 0x00000080, Yes = 0x00000100, Reset = 0x00000200, Details = 0x00000400,
  User1 = 0x00001000, User2 = 0x00002000, User3 = 0x00004000, NoDefault = 0x00008000
}
 
enum  ButtonPopupMode { InstantPopup = 0, DelayedPopup = 1 }
 
enum  CaptionFlag { NoCaptionFlags = 0, AppNameCaption = 1, ModifiedCaption = 2, HIGCompliantCaption = AppNameCaption }
 
- Public Slots inherited from KDialog
void delayedDestruct ()
 
void enableButton (ButtonCode id, bool state)
 
void enableButtonApply (bool state)
 
void enableButtonCancel (bool state)
 
void enableButtonOk (bool state)
 
void enableLinkedHelp (bool state)
 
bool isDetailsWidgetVisible () const
 
virtual void setCaption (const QString &caption)
 
virtual void setCaption (const QString &caption, bool modified)
 
void setDetailsWidget (QWidget *detailsWidget)
 
void setDetailsWidgetVisible (bool visible)
 
void setHelp (const QString &anchor, const QString &appname=QString())
 
void setHelpLinkText (const QString &text)
 
virtual void setPlainCaption (const QString &caption)
 
- Protected Slots inherited from KDialog
virtual void slotButtonClicked (int button)
 
void updateGeometry ()
 
- Protected Attributes inherited from KDialog
KDialogPrivate *const d_ptr
 

Detailed Description

A dialog used to customize or configure toolbars.

This dialog only works if your application uses the XML UI framework for creating menus and toolbars. It depends on the XML files to describe the toolbar layouts and it requires the actions to determine which buttons are active.

Typically you do not need to use it directly as KXmlGuiWindow::setupGUI takes care of it.

If you use plugListAction you need to overload saveNewToolbarConfig() to plug actions again:

void MyClass::saveNewToolbarConfig()
{
KXmlGuiWindow::saveNewToolbarConfig();
plugActionList( "list1", list1Actions );
plugActionList( "list2", list2Actions );
}

When created, KEditToolBar takes a KXMLGUIFactory object, and uses it to find all of the action collections and XML files (there is one of each for the mainwindow, but there could be more, when adding other XMLGUI clients like KParts or plugins). The editor aims to be semi-intelligent about where it assigns any modifications. In other words, it will not write out part specific changes to your application's main XML file.

KXmlGuiWindow and KParts::MainWindow take care of creating KEditToolBar correctly and connecting to its newToolBarConfig slot, but if you really really want to do it yourself, see the KXmlGuiWindow::configureToolbars() and KXmlGuiWindow::saveNewToolbarConfig() code.

kedittoolbar.png
KDE Toolbar Editor (KWrite)
Author
Kurt Granroth granr.nosp@m.oth@.nosp@m.kde.o.nosp@m.rg David Faure faure.nosp@m.@kde.nosp@m..org

Definition at line 68 of file kedittoolbar.h.

Constructor & Destructor Documentation

KEditToolBar::KEditToolBar ( KActionCollection *  collection,
QWidget *  parent = 0 
)
explicit

Old constructor for apps that do not use components.

This constructor is somewhat deprecated, since it doesn't work with any KXMLGuiClient being added to the mainwindow. You really want to use the other constructor.

You must pass along your collection of actions (some of which appear in your toolbars).

Parameters
collectionThe collection of actions to work on.
parentThe parent of the dialog.

Definition at line 526 of file kedittoolbar.cpp.

KEditToolBar::KEditToolBar ( KXMLGUIFactory *  factory,
QWidget *  parent = 0 
)
explicit

Main constructor.

The main parameter, factory, is a pointer to the XML GUI factory object for your application. It contains a list of all of the GUI clients (along with the action collections and xml files) and the toolbar editor uses that.

Use this like so:

KEditToolBar edit(factory());
if (edit.exec())
...
Parameters
factoryYour application's factory object
parentThe usual parent for the dialog.

Definition at line 536 of file kedittoolbar.cpp.

KEditToolBar::~KEditToolBar ( )

destructor

Definition at line 579 of file kedittoolbar.cpp.

Member Function Documentation

void KEditToolBar::hideEvent ( QHideEvent *  event)
protectedvirtual

Emits the hidden signal.

You can connect to that signal to detect when a dialog has been closed.

Reimplemented from KDialog.

Definition at line 1691 of file kedittoolbar.cpp.

void KEditToolBar::newToolBarConfig ( )
signal

Signal emitted when 'apply' or 'ok' is clicked or toolbars were reset.

Connect to it, to plug action lists and to call applyMainWindowSettings (see sample code in this class's documentation)

QT_MOC_COMPAT void KEditToolBar::newToolbarConfig ( )
signal
void KEditToolBar::setDefaultToolBar ( const QString &  toolBarName)

Sets the default toolbar that will be selected when the dialog is shown.

If not set, or QString() is passed in, the global default tool bar name will be used.

Parameters
toolBarNamethe name of the tool bar
See also
setGlobalDefaultToolBar

Definition at line 585 of file kedittoolbar.cpp.

void KEditToolBar::setGlobalDefaultToolBar ( const char *  toolBarName)
static

Sets the default toolbar which will be auto-selected for all KEditToolBar instances.

Can be overridden on a per-dialog basis by calling setDefaultToolBar( const QString& ) on the dialog.

Parameters
toolbarNamethe name of the tool bar

Definition at line 689 of file kedittoolbar.cpp.

void KEditToolBar::setResourceFile ( const QString &  file,
bool  global = true 
)

The name (absolute or relative) of your application's UI resource file is assumed to be share/apps/appname/appnameui.rc though this can be overridden by calling this method.

The global parameter controls whether or not the global resource file is used. If this is true, then you may edit all of the actions in your toolbars – global ones and local one. If it is false, then you may edit only your application's entries. The only time you should set this to false is if your application does not use the global resource file at all (very rare).

Parameters
xmlfileThe application's local resource file.
globalIf true, then the global resource file will also be parsed.

Definition at line 572 of file kedittoolbar.cpp.

void KEditToolBar::showEvent ( QShowEvent *  event)
protectedvirtual

Definition at line 1674 of file kedittoolbar.cpp.


The documentation for this class was generated from the following files:
  • kedittoolbar.h
  • kedittoolbar.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:49:17 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
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • 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