blob: 31a752091c31b2433e44dbc770553a3edf1bee45 (
plain)
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
|
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include "base.h"
#include "qapplication.h"
base::base(QWidget *parent) :
QWidget(parent)
{
m_timer = new QTimer(this);
m_timer->setSingleShot(false);
connect(m_timer, &QTimer::timeout, this, &base::periodicTimer);
m_timer->start(5000);
}
void base::periodicTimer()
{
if(m_modalStarted)
qApp->quit();
m_modalDialog = new QDialog(this);
m_modalDialog->setWindowTitle(QLatin1String("modal"));
m_modalDialog->setModal(true);
m_modalDialog->show();
m_modalStarted = true;
}
|