KDEUI
kmainwindow.h File Reference
#include <kdeui_export.h>
#include <QtGui/QMainWindow>
#include <QtCore/QMetaClassInfo>
Go to the source code of this file.
Classes | |
class | KMainWindow |
KDE top level main window More... | |
Functions | |
template<typename T0 , typename T1 , typename T2 > | |
void | kRestoreMainWindows () |
template<typename T0 , typename T1 > | |
void | kRestoreMainWindows () |
template<typename T > | |
void | kRestoreMainWindows () |
Function Documentation
void kRestoreMainWindows | ( | ) | [inline] |
Definition at line 794 of file kmainwindow.h.
void kRestoreMainWindows | ( | ) | [inline] |
Definition at line 780 of file kmainwindow.h.
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 771 of file kmainwindow.h.