File: kdatepicktest.cpp

package info (click to toggle)
kwidgetsaddons 5.116.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 32,836 kB
  • sloc: cpp: 32,526; python: 677; sh: 14; makefile: 7
file content (47 lines) | stat: -rw-r--r-- 922 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/*
    SPDX-FileCopyrightText: 2014 Alex Merry <alex.merry@kde.org>

    SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
*/

#include "kdatepicker.h"
#include <QApplication>
#include <QTimer>

class Manager : public QObject
{
    Q_OBJECT
public:
    Manager()
    {
        picker.show();
        QTimer::singleShot(1000, this, &Manager::timeout1);
        QTimer::singleShot(5000, this, &Manager::timeout2);
    }

private Q_SLOTS:
    void timeout1()
    {
        picker.setEnabled(false);
    }
    void timeout2()
    {
        picker.setEnabled(true);
    }

private:
    KDatePicker picker;
};

int main(int argc, char **argv)
{
    QApplication::setApplicationName(QStringLiteral("KDatePickertest"));
    QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps, true);
    QApplication app(argc, argv);

    Manager mgr;

    return app.exec();
}

#include <kdatepicktest.moc>