1 /* This file is part of the KDE project
2 Copyright (C) 2006 David Faure <faure@kde.org>
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program. If not, see <http://www.gnu.org/licenses/>.
18 #include "centralwidget.h"
20 #include <QtGui/QApplication>
21 #include <QtGui/QLabel>
22 #include <QtCore/QTimer>
23 #include <QtGui/QSplitter>
25 SCWMainWindow::SCWMainWindow( QWidget
* parent
)
26 : QMainWindow( parent
)
28 QLabel
* widget1
= new QLabel( "widget1" );
29 setCentralWidget( widget1
);
30 QTimer::singleShot( 10, this, SLOT( slotSwitchCentralWidget() ) );
33 void SCWMainWindow::slotSwitchCentralWidget()
35 QLabel
* widget2
= new QLabel( "widget2" );
36 delete centralWidget(); // ## workaround for the crash
37 setCentralWidget( widget2
);
40 int main( int argc
, char** argv
) {
41 QApplication
app( argc
, argv
);
43 SCWMainWindow
* mw
= new SCWMainWindow
;
49 #include "centralwidget.moc"