1// Copyright (C) 2019 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QUICKTESTUTIL_P_H
5#define QUICKTESTUTIL_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtQuickTest/private/quicktestglobal_p.h>
19
20#include <QtCore/qobject.h>
21#include <QtQml/qqml.h>
22#include <QtQml/qjsvalue.h>
23
24QT_BEGIN_NAMESPACE
25
26class Q_QUICK_TEST_PRIVATE_EXPORT QuickTestUtil : public QObject
27{
28 Q_OBJECT
29 Q_PROPERTY(bool printAvailableFunctions READ printAvailableFunctions NOTIFY printAvailableFunctionsChanged)
30 Q_PROPERTY(int dragThreshold READ dragThreshold NOTIFY dragThresholdChanged)
31 QML_NAMED_ELEMENT(TestUtil)
32 QML_ADDED_IN_VERSION(1, 0)
33public:
34 QuickTestUtil(QObject *parent = nullptr) :QObject(parent) {}
35 ~QuickTestUtil() override {}
36
37 bool printAvailableFunctions() const;
38 int dragThreshold() const;
39
40 Q_INVOKABLE void populateClipboardText(int lineCount);
41
42Q_SIGNALS:
43 void printAvailableFunctionsChanged();
44 void dragThresholdChanged();
45
46public Q_SLOTS:
47
48 QJSValue typeName(const QVariant& v) const;
49 bool compare(const QVariant& act, const QVariant& exp) const;
50
51 QJSValue callerFile(int frameIndex = 0) const;
52 int callerLine(int frameIndex = 0) const;
53};
54
55QT_END_NAMESPACE
56
57#endif // QUICKTESTUTIL_P_H
58

source code of qtdeclarative/src/qmltest/quicktestutil_p.h