File indexing completed on 2024-04-21 03:59:42

0001 /*
0002     SPDX-FileCopyrightText: 2002 Simon Hausmann <hausmann@kde.org>
0003     SPDX-FileCopyrightText: 2005-2006 David Faure <faure@kde.org>
0004 
0005     SPDX-License-Identifier: LGPL-2.0-or-later
0006 */
0007 
0008 #include "kmainwindowtest.h"
0009 
0010 #include <QApplication>
0011 #include <QLabel>
0012 #include <QMenuBar>
0013 #include <QStatusBar>
0014 #include <QTimer>
0015 
0016 MainWindow::MainWindow()
0017 {
0018     QTimer::singleShot(2 * 1000, this, &MainWindow::showMessage);
0019 
0020     setCentralWidget(new QLabel(QStringLiteral("foo"), this));
0021 
0022     menuBar()->addAction(QStringLiteral("hi"));
0023 }
0024 
0025 void MainWindow::showMessage()
0026 {
0027     statusBar()->show();
0028     statusBar()->showMessage(QStringLiteral("test"));
0029 }
0030 
0031 int main(int argc, char **argv)
0032 {
0033     QApplication::setApplicationName(QStringLiteral("kmainwindowtest"));
0034     QApplication app(argc, argv);
0035 
0036     MainWindow *mw = new MainWindow; // deletes itself when closed
0037     mw->show();
0038 
0039     return app.exec();
0040 }
0041 
0042 #include "moc_kmainwindowtest.cpp"