summaryrefslogtreecommitdiffstats
path: root/tests/manual/touchmocking/touchmockingapplication.h
blob: 4f6e744fc653b3143c3adaa903de80a1a1964215 (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
26
27
28
29
30
31
32
33
34
35
// Copyright (C) 2022 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only

#ifndef TOUCHMOCKINGAPPLICATION_H
#define TOUCHMOCKINGAPPLICATION_H

#if defined(QUICK_TOUCHBROWSER)
#    include <QGuiApplication>
using Application = QGuiApplication;
#elif defined(WIDGET_TOUCHBROWSER)
#    include <QApplication>
using Application = QApplication;
#endif

QT_BEGIN_NAMESPACE
class QCursor;
QT_END_NAMESPACE

class TouchMockingApplication : public Application
{
    Q_OBJECT

public:
    TouchMockingApplication(int &argc, char **argv);
    ~TouchMockingApplication();

    virtual bool notify(QObject *, QEvent *) override;

private:
    void restoreCursor();

    QCursor *m_touchPoint;
};

#endif // TOUCHMOCKINGAPPLICATION_H