File indexing completed on 2024-04-28 03:59:18

0001 /*
0002     SPDX-FileCopyrightText: 2014 Alex Merry <alex.merry@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 "kdatepicker.h"
0008 #include <QApplication>
0009 #include <QTimer>
0010 
0011 class Manager : public QObject
0012 {
0013     Q_OBJECT
0014 public:
0015     Manager()
0016     {
0017         picker.show();
0018         QTimer::singleShot(1000, this, &Manager::timeout1);
0019         QTimer::singleShot(5000, this, &Manager::timeout2);
0020     }
0021 
0022 private Q_SLOTS:
0023     void timeout1()
0024     {
0025         picker.setEnabled(false);
0026     }
0027     void timeout2()
0028     {
0029         picker.setEnabled(true);
0030     }
0031 
0032 private:
0033     KDatePicker picker;
0034 };
0035 
0036 int main(int argc, char **argv)
0037 {
0038     QApplication::setApplicationName(QStringLiteral("KDatePickertest"));
0039     QApplication app(argc, argv);
0040 
0041     Manager mgr;
0042 
0043     return app.exec();
0044 }
0045 
0046 #include <kdatepicktest.moc>