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

KDE3Support

Signals | Public Member Functions | Protected Slots | Protected Member Functions | Protected Attributes | List of all members
K3DockMainWindow Class Reference

#include <k3dockwidget.h>

Inheritance diagram for K3DockMainWindow:
Inheritance graph
[legend]

Signals

void dockWidgetHasUndocked (K3DockWidget *)
 

Public Member Functions

 K3DockMainWindow (QWidget *parent=0L, const char *name=0L, Qt::WindowFlags f=Qt::Window)
 
virtual ~K3DockMainWindow ()
 
void activateDock ()
 
K3DockWidget * createDockWidget (const QString &name, const QPixmap &pixmap, QWidget *parent=0L, const QString &strCaption=QString(), const QString &strTabPageLabel=QLatin1String(" "))
 
Q3PopupMenu * dockHideShowMenu () const
 
K3DockWidget * getMainDockWidget () const
 
void makeDockInvisible (K3DockWidget *dock)
 
void makeDockVisible (K3DockWidget *dock)
 
void makeWidgetDockVisible (QWidget *widget)
 
K3DockManager * manager () const
 
void readDockConfig (QDomElement &base)
 
void readDockConfig (KConfig *c=0L, const QString &group=QString())
 
void setMainDockWidget (K3DockWidget *dockwidget)
 
void setView (QWidget *widget)
 
void writeDockConfig (QDomElement &base)
 
void writeDockConfig (KConfig *c=0L, const QString &group=QString())
 
- Public Member Functions inherited from KXmlGuiWindow
 KXmlGuiWindow (QWidget *parent=0, Qt::WindowFlags f=KDE_DEFAULT_WINDOWFLAGS)
 
virtual ~KXmlGuiWindow ()
 
virtual void applyMainWindowSettings (const KConfigGroup &config, bool force=false)
 
void createGUI (const QString &xmlfile=QString())
 
void createStandardStatusBarAction ()
 
virtual void finalizeGUI (KXMLGUIClient *client)
 
void finalizeGUI (bool force)
 
virtual KXMLGUIFactory * guiFactory ()
 
bool isHelpMenuEnabled () const
 
bool isStandardToolBarMenuEnabled () const
 
void setHelpMenuEnabled (bool showHelpMenu=true)
 
void setStandardToolBarMenuEnabled (bool enable)
 
void setupGUI (StandardWindowOptions options=Default, const QString &xmlfile=QString())
 
void setupGUI (const QSize &defaultSize, StandardWindowOptions options=Default, const QString &xmlfile=QString())
 
void setupToolbarMenuActions ()
 
QAction * toolBarMenuAction ()
 
- Public Member Functions inherited from KMainWindow
 KMainWindow (QWidget *parent=0, Qt::WindowFlags f=KDE_DEFAULT_WINDOWFLAGS)
 
virtual ~KMainWindow ()
 
KConfigGroup autoSaveConfigGroup () const
 
QString autoSaveGroup () const
 
bool autoSaveSettings () const
 
KMenu * customHelpMenu (bool showWhatsThis=true)
 
QString dbusName () const
 
bool hasMenuBar ()
 
KMenu * helpMenu (const QString &aboutAppText=QString(), bool showWhatsThis=true)
 
void ignoreInitialGeometry ()
 
bool initialGeometrySet () const
 
KMenuBar * menuBar ()
 
void resetAutoSaveSettings ()
 
bool restore (int number, bool show=true)
 
void saveMainWindowSettings (const KConfigGroup &config)
 
void setAutoSaveSettings (const QString &groupName=QLatin1String("MainWindow"), bool saveWindowSize=true)
 
void setAutoSaveSettings (const KConfigGroup &group, bool saveWindowSize=true)
 
KStatusBar * statusBar ()
 
KToolBar * toolBar (const QString &name=QString())
 
QList< KToolBar * > toolBars () const
 
- Public Member Functions inherited from KXMLGUIBuilder
 KXMLGUIBuilder (QWidget *widget)
 
virtual ~KXMLGUIBuilder ()
 
KXMLGUIClient * builderClient () const
 
KComponentData builderComponentData () const
 
virtual QStringList containerTags () const
 
virtual QWidget * createContainer (QWidget *parent, int index, const QDomElement &element, QAction *&containerAction)
 
virtual QAction * createCustomElement (QWidget *parent, int index, const QDomElement &element)
 
virtual QStringList customTags () const
 
virtual void removeContainer (QWidget *container, QWidget *parent, QDomElement &element, QAction *containerAction)
 
virtual void removeCustomElement (QWidget *parent, QAction *action)
 
void setBuilderClient (KXMLGUIClient *client)
 
void setBuilderComponentData (const KComponentData &componentData)
 
QWidget * widget ()
 
- Public Member Functions inherited from KXMLGUIClient
 KXMLGUIClient ()
 
 KXMLGUIClient (KXMLGUIClient *parent)
 
virtual ~KXMLGUIClient ()
 
QAction * action (const char *name) const
 
virtual QAction * action (const QDomElement &element) const
 
virtual KActionCollection * actionCollection () const
 
void addStateActionDisabled (const QString &state, const QString &action)
 
void addStateActionEnabled (const QString &state, const QString &action)
 
void beginXMLPlug (QWidget *)
 
QList< KXMLGUIClient * > childClients ()
 
KXMLGUIBuilder * clientBuilder () const
 
virtual KComponentData componentData () const
 
virtual QDomDocument domDocument () const
 
void endXMLPlug ()
 
KXMLGUIFactory * factory () const
 
StateChange getActionsToChangeForState (const QString &state)
 
void insertChildClient (KXMLGUIClient *child)
 
virtual QString localXMLFile () const
 
KXMLGUIClient * parentClient () const
 
void plugActionList (const QString &name, const QList< QAction * > &actionList)
 
void prepareXMLUnplug (QWidget *)
 
void reloadXML ()
 
void removeChildClient (KXMLGUIClient *child)
 
void replaceXMLFile (const QString &xmlfile, const QString &localxmlfile, bool merge=false)
 
void setClientBuilder (KXMLGUIBuilder *builder)
 
void setFactory (KXMLGUIFactory *factory)
 
void setXMLGUIBuildDocument (const QDomDocument &doc)
 
void unplugActionList (const QString &name)
 
virtual QString xmlFile () const
 
QDomDocument xmlguiBuildDocument () const
 

Protected Slots

void slotDockWidgetUndocked ()
 
- Protected Slots inherited from KXmlGuiWindow
virtual void saveNewToolbarConfig ()
 
- Protected Slots inherited from KMainWindow
void saveAutoSaveSettings ()
 
virtual void showAboutApplication ()
 

Protected Member Functions

virtual void virtual_hook (int id, void *data)
 
- Protected Member Functions inherited from KXmlGuiWindow
virtual bool event (QEvent *event)
 
- Protected Member Functions inherited from KMainWindow
 KMainWindow (KMainWindowPrivate &dd, QWidget *parent, Qt::WindowFlags f)
 
virtual void closeEvent (QCloseEvent *)
 
void parseGeometry (bool parsewidth)
 
virtual bool queryClose ()
 
virtual bool queryExit ()
 
virtual void readGlobalProperties (KConfig *sessionConfig)
 
virtual void readProperties (const KConfigGroup &)
 
bool readPropertiesInternal (KConfig *, int)
 
void restoreWindowSize (const KConfigGroup &config)
 
virtual void saveGlobalProperties (KConfig *sessionConfig)
 
virtual void saveProperties (KConfigGroup &)
 
void savePropertiesInternal (KConfig *, int)
 
void saveWindowSize (const KConfigGroup &config) const
 
bool settingsDirty () const
 
- Protected Member Functions inherited from KXMLGUIClient
void loadStandardsXmlFile ()
 
virtual void setComponentData (const KComponentData &componentData)
 
virtual void setDOMDocument (const QDomDocument &document, bool merge=false)
 
virtual void setLocalXMLFile (const QString &file)
 
virtual void setXML (const QString &document, bool merge=false)
 
virtual void setXMLFile (const QString &file, bool merge=false, bool setXMLDoc=true)
 
virtual void stateChanged (const QString &newstate, ReverseStateChange reverse=StateNoReverse)
 

Protected Attributes

K3DockManager * dockManager
 
K3DockWidget * mainDockWidget
 
- Protected Attributes inherited from KMainWindow
KMainWindowPrivate *const k_ptr
 

Additional Inherited Members

- Public Types inherited from KXmlGuiWindow
enum  StandardWindowOption
 
- Public Types inherited from KXMLGUIClient
enum  ReverseStateChange
 
- Public Slots inherited from KXmlGuiWindow
virtual void configureToolbars ()
 
void slotStateChanged (const QString &newstate, bool reverse)
 
virtual void slotStateChanged (const QString &newstate)
 
- Public Slots inherited from KMainWindow
void appHelpActivated (void)
 
virtual void setCaption (const QString &caption)
 
virtual void setCaption (const QString &caption, bool modified)
 
virtual void setPlainCaption (const QString &caption)
 
void setSettingsDirty ()
 
- Static Public Member Functions inherited from KMainWindow
static bool canBeRestored (int number)
 
static const QString classNameOfToplevel (int number)
 
static QList< KMainWindow * > memberList ()
 
- Static Public Member Functions inherited from KXMLGUIClient
static QString findMostRecentXMLFile (const QStringList &files, QString &doc)
 
- Properties inherited from KXmlGuiWindow
QString autoSaveGroup
 
bool autoSaveSettings
 
bool hasMenuBar
 
bool initialGeometrySet
 
bool standardToolBarMenuEnabled
 
- Properties inherited from KMainWindow
QString autoSaveGroup
 
bool autoSaveSettings
 
bool hasMenuBar
 
bool initialGeometrySet
 

Detailed Description

A special kind of KMainWindow that is able to have dockwidget child widgets (and member of the dockwidget class set).

The main widget should be a K3DockWidget where other K3DockWidget can be docked to the left, right, top, bottom or to the middle. Note: dock to the middle means to drop on a dockwidget and to unite them to a new widget, a tab control.

Furthermore, the K3DockMainWindow has got the K3DockManager and some data about the dock states.

If you've got some dockwidgets, you can dock them to the dockmainwindow to initialize a start scene: Here an example:

DockApplication::DockApplication( const char* name) : K3DockMainWindow( name)
{
...
K3DockWidget* mainDock;
mainDock = createDockWidget( "Falk's MainDockWidget", mainPixmap, 0L, "main_dock_widget");
AnyContentsWidget* cw = new AnyContentsWidget( mainDock);
mainDock->setWidget( cw);
// allow others to dock to the 4 sides
mainDock->setDockSite(K3DockWidget::DockCorner);
// forbit docking abilities of mainDock itself
mainDock->setEnableDocking(K3DockWidget::DockNone);
setView( mainDock); // central widget in a KDE mainwindow
setMainDockWidget( mainDock); // master dockwidget
...
K3DockWidget* dockLeft;
dockLeft = createDockWidget( "Intially left one", anyOtherPixmap, 0L, i18n("The left dockwidget"));
AnotherWidget* aw = new AnotherWidget( dockLeft);
dockLeft->setWidget( aw);
dockLeft->manualDock( mainDock, // dock target
K3DockWidget::DockLeft, // dock site
20 ); // relation target/this (in percent)
...

Docking is fully dynamic at runtime. That means you can always move dockwidgets via drag and drop.

And last but not least you can use the popupmenu for showing or hiding any controlled dockwidget of this class and insert it to your main menu bar or anywhere else.

Author
Max Judin (documentation: Falk Brettschneider).

Definition at line 1278 of file k3dockwidget.h.

Constructor & Destructor Documentation

K3DockMainWindow::K3DockMainWindow ( QWidget *  parent = 0L,
const char *  name = 0L,
Qt::WindowFlags  f = Qt::Window 
)

Constructs a dockmainwindow.

A special kind of KMainWindow that is able to have dockwidget child widgets.

It calls its base class constructor and does additional things concerning to the dock stuff:

  • information about the dock state of this' children gets initialized
  • a dockmanager is created...
  • ...and gets initialized
  • the main dockwidget is set to 0
Parameters
parentParent widget for the dock main widget
nameinternal object name
fQt::WidgetFlags widget flags

The main widget should be a dockwidget where other dockwidgets can be docked to the left, right, top, bottom or to the middle. Furthermore, the K3DockMainWindow has got the KDocManager and some data about the dock states.

Author
Max Judin.

Definition at line 105 of file k3dockwidget.cpp.

K3DockMainWindow::~K3DockMainWindow ( )
virtual

Destructs a dockmainwindow.

Definition at line 115 of file k3dockwidget.cpp.

Member Function Documentation

void K3DockMainWindow::activateDock ( )

It runs through all dockwidgets which are under control of the dockmanager and calls show() for every encapsulated widget and show() for the dockwidget itself if it is not in tab mode.

Additionally, if the main dockwidget is not a QDialog, it will be shown.

Definition at line 155 of file k3dockwidget.cpp.

K3DockWidget * K3DockMainWindow::createDockWidget ( const QString &  name,
const QPixmap &  pixmap,
QWidget *  parent = 0L,
const QString &  strCaption = QString(),
const QString &  strTabPageLabel = QLatin1String( " " ) 
)

This is one of the most important methods! The K3DockMainWindow creates a new dockwidget object here that usually should encapsulate the user's widget.

The new dockwidget is automatically taken under control by the dockmanager of the dockmainwindow.

Parameters
nameQObject name (default dockwidget caption)
pixmapwindow icon (for instance shown when docked as tabwidget entry)
parentparent widget for the new dockwidget
strCaptionwindow title (shown when toplevel)
strTabPageLabeltitle of the tab page (visible when in tab page mode), if it is "", only the icon will be shown; if it is 0L, the label is set to strCaption
Returns
a pointer to the new created dockwidget

Definition at line 150 of file k3dockwidget.cpp.

Q3PopupMenu * K3DockMainWindow::dockHideShowMenu ( ) const

Returns a popup menu that contains entries for all controlled dockwidgets making hiding and showing them possible.

Returns
the wanted popup menu

Definition at line 160 of file k3dockwidget.cpp.

void K3DockMainWindow::dockWidgetHasUndocked ( K3DockWidget *  )
signal

Signals a certain dockwidget is undocked now.

K3DockWidget * K3DockMainWindow::getMainDockWidget ( ) const

Returns the main dockwidget.

Returns
pointer to the main dockwidget

Definition at line 132 of file k3dockwidget.cpp.

void K3DockMainWindow::makeDockInvisible ( K3DockWidget *  dock)

This method hides the given dockwidget.

Parameters
dockthe dockwidget that is to be shown

Definition at line 171 of file k3dockwidget.cpp.

void K3DockMainWindow::makeDockVisible ( K3DockWidget *  dock)

This method shows the given dockwidget.

The clue is that it also considers the dockwidget could be a tab page and must set to be the activate one.

Parameters
dockthe dockwidget that is to be shown

Definition at line 165 of file k3dockwidget.cpp.

void K3DockMainWindow::makeWidgetDockVisible ( QWidget *  widget)

This is an overloaded member function, provided for convenience.

It differs from the above function only in what argument(s) it accepts.

Definition at line 177 of file k3dockwidget.cpp.

K3DockManager * K3DockMainWindow::manager ( ) const

Returns the dockmanager of this.

(see K3DockManager)

Returns
pointer to the wanted dockmanager

Definition at line 120 of file k3dockwidget.cpp.

void K3DockMainWindow::readDockConfig ( QDomElement &  base)

Reads the current dock window layout from a DOM tree below the given element.

Definition at line 187 of file k3dockwidget.cpp.

void K3DockMainWindow::readDockConfig ( KConfig *  c = 0L,
const QString &  group = QString() 
)

It reads the current dock state from the given section of KConfig.

Parameters
cKDE class for saving configurations
groupname of section to read from

Definition at line 198 of file k3dockwidget.cpp.

void K3DockMainWindow::setMainDockWidget ( K3DockWidget *  dockwidget)

Sets a new main dockwidget.

Additionally, the toolbar is re-initialized.

Parameters
dockwidgetdockwidget that become the new main dockwidget

Definition at line 125 of file k3dockwidget.cpp.

void K3DockMainWindow::setView ( QWidget *  widget)

This method calls the base class method.

If the given widget inherits K3DockWidget, applyToWidget(this) is called.

Parameters
widgetany widget that should become the main view

Definition at line 137 of file k3dockwidget.cpp.

void K3DockMainWindow::slotDockWidgetUndocked ( )
protectedslot

Called whenever one of the dockwidgets of this has been undocked.

Definition at line 204 of file k3dockwidget.cpp.

void K3DockMainWindow::virtual_hook ( int  id,
void *  data 
)
protectedvirtual

Reimplemented from KXMLGUIBuilder.

Definition at line 3463 of file k3dockwidget.cpp.

void K3DockMainWindow::writeDockConfig ( QDomElement &  base)

Saves the current dock window layout into a DOM tree below the given element.

Definition at line 182 of file k3dockwidget.cpp.

void K3DockMainWindow::writeDockConfig ( KConfig *  c = 0L,
const QString &  group = QString() 
)

It writes the current dock state in the given section of KConfig.

Parameters
cKDE class for saving configurations
groupname of section to write to

Definition at line 193 of file k3dockwidget.cpp.

Member Data Documentation

K3DockManager* K3DockMainWindow::dockManager
protected

A pointer to the manager for the dock process.

Definition at line 1429 of file k3dockwidget.h.

K3DockWidget* K3DockMainWindow::mainDockWidget
protected

A pointer to the main dockwidget (where one can manualDock() to.

Definition at line 1424 of file k3dockwidget.h.


The documentation for this class was generated from the following files:
  • k3dockwidget.h
  • k3dockwidget.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:51:59 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDE3Support

Skip menu "KDE3Support"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • 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