6#include <QtTest/qsignalspy.h>
7#include <QtQml/qqmlcomponent.h>
8#include <QtQuickControls2/qquickstyle.h>
9#include <QtQuickTemplates2/private/qquickabstractbutton_p.h>
10#include <QtQuickTemplates2/private/qquickapplicationwindow_p.h>
14 : QQuickApplicationHelper(testCase, testFilePath, initialProperties, qmlImportPaths)
31 if (!currentStyle.isEmpty() && style == currentStyle)
66 if (!skipList.contains(
name)) {
67 const auto importPathList =
engine->importPathList();
68 for (
const QString &importPath : importPathList) {
100 qWarning() <<
"button" <<
button <<
"doesn't have an associated window";
115 qWarning() <<
"button" <<
button <<
"must have a width greater than 0";
120 qWarning() <<
"button" <<
button <<
"must have a height greater than 0";
134 qWarning() <<
"button" <<
button <<
"must have a valid clicked signal";
141 qWarning() <<
"clicked signal of button" <<
button <<
"was not emitted after clicking";
155 qWarning() <<
"button" <<
button <<
"must have a valid doubleClicked signal";
162 qWarning() <<
"doubleClicked signal of button" <<
button <<
"was not emitted after double-clicking";
178 qmlWarning(
this) <<
"Failed to create component from the following data:\n" <<
data;
QFileInfoList entryInfoList(Filters filters=NoFilter, SortFlags sort=NoSort) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
\inmodule QtCore \reentrant
bool exists() const
This is an overloaded member function, provided for convenience. It differs from the above function o...
qsizetype size() const noexcept
\inmodule QtCore\reentrant
\inmodule QtCore\reentrant
The QQmlComponent class encapsulates a QML component definition.
The QQmlEngine class provides an environment for instantiating QML components.
static QString urlToLocalFileOrQrc(const QString &)
If url is a local file returns a path suitable for passing to QFile.
Q_INVOKABLE QQmlComponent * createComponent(const QByteArray &data)
Allows creating QQmlComponents in C++, which is useful for tests that need to check if items created ...
QQuickControlsApplicationHelper(QQmlDataTest *testCase, const QString &testFilePath, const QVariantMap &initialProperties={}, const QStringList &qmlImportPaths={})
QQuickApplicationWindow * appWindow
static void setStyle(const QString &style)
Sets the application style to style.
static QString name()
Returns the name of the application style.
QScopedPointer< QObject > cleanup
T * data() const noexcept
Returns the value of the pointer referenced by this object.
\macro QT_RESTRICTED_CAST_FROM_ASCII
bool startsWith(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the string starts with s; otherwise returns false.
static QString fromUtf8(QByteArrayView utf8)
This is an overloaded member function, provided for convenience. It differs from the above function o...
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
QString & prepend(QChar c)
static QUrl fromLocalFile(const QString &localfile)
Returns a QUrl representation of localFile, interpreted as a local file.
QSignalSpy spy(myCustomObject, SIGNAL(mySignal(int, QString, double)))
[0]
bool verifyButtonClickable(QQuickAbstractButton *button)
void addTestRowForEachControl(QQmlEngine *engine, const QString &qqc2ImportPath, const QString &sourcePath, const QString &targetPath, const QStringList &skipList=QStringList())
void forEachControl(QQmlEngine *engine, const QString &qqc2ImportPath, const QString &sourcePath, const QString &targetPath, const QStringList &skipList, ForEachCallback callback)
bool doubleClickButton(QQuickAbstractButton *button)
bool clickButton(QQuickAbstractButton *button)
std::function< void(const QString &, const QUrl &)> ForEachCallback
Q_TESTLIB_EXPORT QTestData & newRow(const char *dataTag)
Appends a new row to the current test data.
void mouseDClick(QWindow *window, Qt::MouseButton button, Qt::KeyboardModifiers stateKey=Qt::KeyboardModifiers(), QPoint pos=QPoint(), int delay=-1)
void mouseClick(QWindow *window, Qt::MouseButton button, Qt::KeyboardModifiers stateKey=Qt::KeyboardModifiers(), QPoint pos=QPoint(), int delay=-1)
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
static qreal component(const QPointF &point, unsigned int i)
QQmlEngine * qmlEngine(const QObject *obj)
void qmlClearTypeRegistrations()
Q_QML_EXPORT QQmlInfo qmlWarning(const QObject *me)
#define qPrintable(string)
#define QStringLiteral(str)
QUrl url("example.com")
[constructor-url-reference]
\inmodule QtCore \reentrant
bool updateStyle(const QString &style)