4#ifndef CONTROLSTESTUTILS_P_H
5#define CONTROLSTESTUTILS_P_H
18#include <QtGui/qpa/qplatformtheme.h>
19#include <QtQuickTestUtils/private/visualtestutils_p.h>
25class QQuickApplicationWindow;
26class QQuickAbstractButton;
37 const QVariantMap &initialProperties = {},
38 const QStringList &qmlImportPaths = {});
45 [[nodiscard]]
bool updateStyle(
const QString &style);
53 void forEachControl(QQmlEngine *engine,
const QString &qqc2ImportPath,
const QString &sourcePath,
54 const QString &targetPath,
const QStringList &skipList,
ForEachCallback callback);
56 const QString &targetPath,
const QStringList &skipList = QStringList());
78 Q_PROPERTY(QString styleName READ styleName CONSTANT FINAL)
94 m_colorScheme = theme;
95 QWindowSystemInterface::handleThemeChange<QWindowSystemInterface::SynchronousDelivery>();
121 Q_INVOKABLE void set(Qt::ApplicationAttribute attribute,
bool on =
true);
148#define VERIFY_VISUAL_FOCUS(control) do
150 QVERIFY2(control->hasVisualFocus(), qUtf8Printable(visualFocusFailureMessage(control))); \
151}while (false)
153#define TRY_VERIFY_POPUP_OPENED(popup) do
155 QTRY_VERIFY(popup->isOpened());
156 if (auto *popupWindow = QQuickPopupPrivate::get(popup)->popupWindow) {
157 QVERIFY(QTest::qWaitForWindowExposed(popupWindow));
158 if (QQuickTest::qIsPolishScheduled(popupWindow))
159 QQuickTest::qWaitForPolish(popupWindow);
161}while (false)
The QQmlComponent class encapsulates a QML component definition.
Q_INVOKABLE void set(Qt::ApplicationAttribute attribute, bool on=true)
QQuickControlsApplicationHelper(QQmlDataTest *testCase, const QString &testFilePath, const QVariantMap &initialProperties={}, const QStringList &qmlImportPaths={})
QQuickApplicationWindow * appWindow
Q_INVOKABLE bool setValue(const QString &name, const QString &value)
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 clickMenuItem(QQuickMenuItem *menuItem)
bool doubleClickButton(QQuickAbstractButton *button)
QQuickPopup * popupParent(QQuickItem *item)
QString visualFocusFailureMessage(QQuickControl *control)
bool arePopupWindowsSupported()
bool clickButton(QQuickAbstractButton *button)
std::function< void(const QString &, const QUrl &)> ForEachCallback
QByteArray qActiveFocusFailureMessage(QQuickPopup *popup)
QScopedPointer< QQmlEngine > engine
bool updateStyle(const QString &style)