• 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
Classes | Macros | Functions
kmainwindow.h File Reference
#include <kdeui_export.h>
#include <QtGui/QMainWindow>
#include <QtCore/QMetaClassInfo>
Include dependency graph for kmainwindow.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  KMainWindow
 

Macros

#define KDE_DEFAULT_WINDOWFLAGS   0
 
#define KDE_RESTORE_MAIN_WINDOWS_NUM_TEMPLATE_ARGS   3
 
#define KDEUI_DECLARE_PRIVATE(classname)
 
#define RESTORE(type)
 

Functions

template<typename T >
void kRestoreMainWindows ()
 
template<typename T0 , typename T1 >
void kRestoreMainWindows ()
 
template<typename T0 , typename T1 , typename T2 >
void kRestoreMainWindows ()
 

Macro Definition Documentation

#define KDE_DEFAULT_WINDOWFLAGS   0

Definition at line 54 of file kmainwindow.h.

#define KDEUI_DECLARE_PRIVATE (   classname)
Value:
inline classname ## Private *k_func() { return reinterpret_cast<classname ## Private *>(k_ptr); } \
inline const classname ## Private *k_func() const { return reinterpret_cast<classname ## Private *>(k_ptr); } \
friend class classname ## Private;

Definition at line 48 of file kmainwindow.h.

Function Documentation

template<typename T >
void kRestoreMainWindows ( )
inline

Restores the last session.

(To be used in your main function).

These functions work also if you have more than one kind of toplevel widget (each derived from KMainWindow, of course).

Imagine you have three kinds of toplevel widgets: the classes childMW1, childMW2 and childMW3. Than you can just do:

if (qApp->isSessionRestored())
kRestoreMainWindows< childMW1, childMW2, childMW3 >();
else {
// create default application as usual
}

kRestoreMainWindows<>() will create (on the heap) as many instances of your main windows as have existed in the last session and call KMainWindow::restore() with the correct arguments. Note that also QWidget::show() is called implicitly.

Currently, these functions are provided for up to three template arguments. If you need more, tell us. To help you in deciding whether or not you can use kRestoreMainWindows, a define KDE_RESTORE_MAIN_WINDOWS_NUM_TEMPLATE_ARGS is provided.

These global convenience functions (that come with a varying number of template arguments) are a replacement for the RESTORE macro provided in earlier versions of KDE. The old RESTORE macro is still provided for backwards compatibility.

See also
KMainWindow::restore()
RESTORE
KMainWindow::classNameOfToplevel()

Definition at line 775 of file kmainwindow.h.

template<typename T0 , typename T1 >
void kRestoreMainWindows ( )
inline

Definition at line 784 of file kmainwindow.h.

template<typename T0 , typename T1 , typename T2 >
void kRestoreMainWindows ( )
inline

Definition at line 798 of file kmainwindow.h.

This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:24:01 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