You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
1.0 KiB
42 lines
1.0 KiB
15 years ago
|
|
||
|
#include "kmainwindowrestoretest.h"
|
||
|
|
||
|
#include <kapplication.h>
|
||
|
|
||
14 years ago
|
#include <tqlabel.h>
|
||
15 years ago
|
|
||
|
#define MAKE_WINDOW( kind, title ) do { \
|
||
|
MainWin##kind * m = new MainWin##kind; \
|
||
|
m->setCaption( title ); \
|
||
14 years ago
|
m->setCentralWidget( new TQLabel( title, m ) ); \
|
||
15 years ago
|
m->show(); \
|
||
|
} while ( false )
|
||
|
|
||
|
int main( int argc, char * argv[] ) {
|
||
|
|
||
12 years ago
|
TDEApplication app( argc, argv, "kmainwindowrestoretest" );
|
||
15 years ago
|
|
||
|
if ( kapp->isRestored() ) {
|
||
|
kRestoreMainWindows< MainWin1, MainWin2, MainWin3 >();
|
||
|
kRestoreMainWindows< MainWin4, MainWin5 >();
|
||
|
RESTORE(MainWin6);
|
||
|
//kRestoreMainWindows< MainWin6 >(); // should be equivalent to RESTORE()
|
||
|
} else {
|
||
|
MAKE_WINDOW( 1, "First 1" );
|
||
|
MAKE_WINDOW( 1, "Second 1" );
|
||
|
MAKE_WINDOW( 2, "Only 2" );
|
||
|
MAKE_WINDOW( 3, "First 3" );
|
||
|
MAKE_WINDOW( 4, "First 4" );
|
||
|
MAKE_WINDOW( 4, "Second 4" );
|
||
|
MAKE_WINDOW( 3, "Second 3" );
|
||
|
MAKE_WINDOW( 4, "Third 4" );
|
||
|
MAKE_WINDOW( 5, "First 5" );
|
||
|
MAKE_WINDOW( 5, "Second 5" );
|
||
|
MAKE_WINDOW( 1, "Only 6" );
|
||
|
}
|
||
|
|
||
|
return app.exec();
|
||
|
}
|
||
|
|
||
|
#include "kmainwindowrestoretest.moc"
|