File indexing completed on 2024-04-28 04:42:55

0001 /*
0002     SPDX-FileCopyrightText: 2012 Frederik Gladhorn <gladhorn@kde.org>
0003 
0004     SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0005 */
0006 
0007 #include <QApplication>
0008 #include <QPushButton>
0009 #include <QBoxLayout>
0010 #include <QTimer>
0011 
0012 class SimpleWidgetApp : public QWidget
0013 {
0014     Q_OBJECT
0015 public:
0016     SimpleWidgetApp()
0017     {
0018         QPushButton *button = new QPushButton(this);
0019         button->setText(QStringLiteral("Button 1"));
0020         QPushButton *button2 = new QPushButton(this);
0021         button2->setText(QStringLiteral("Button 2"));
0022 
0023         this->setGeometry(0,0,200,100);
0024 
0025         button->setText(QLatin1String("Button 1"));
0026         button->setGeometry(10,10,100,20);
0027         button2->setText(QLatin1String("Button 2"));
0028         button2->setGeometry(10,40,100,20);
0029 
0030         button->setFocus();
0031         QTimer timer;
0032         timer.singleShot(100, button2, SLOT(setFocus()));
0033     }
0034 };
0035 
0036 int main(int argc, char *argv[])
0037 {
0038     QApplication app(argc, argv);
0039     app.setApplicationName(QStringLiteral("LibKdeAccessibilityClient Simple Widget App"));
0040 
0041     SimpleWidgetApp simple;
0042     simple.show();
0043     return app.exec();
0044 }
0045 
0046 #include "simplewidgetapp.moc"