// other test failed which this one depends on).
property bool optional: false
- // Property that is set to true when the main window is shown.
- // We need to set the property value in an odd way to handle
- // both qmlviewer and the QtQuickTest module test wrapper.
- property bool windowShown: util.wrapper ? qtest.windowShown : false
+ property bool windowShown: qtest.windowShown
// Internal private state. Identifiers prefixed with qtest are reserved.
property bool qtest_prevWhen: true
}
}
- // The test framework will set util.windowShown when the
- // window is actually shown. If we are running with qmlviewer,
- // then this won't happen. So we use a timer instead.
- Timer {
- id: qtest_windowShowTimer
- interval: 100
- repeat: false
- onTriggered: { windowShown = true }
- }
Component.onCompleted: {
qtest.hasTestCase = true;
if (optional)
TestLogger.log_optional_test(qtest_testId)
qtest_prevWhen = when
- var isQmlViewer = util.wrapper ? false : true
- if (isQmlViewer)
- qtest_windowShowTimer.running = true
if (when && !completed && !running)
qtest_run()
}
{
Q_OBJECT
Q_PROPERTY(bool printAvailableFunctions READ printAvailableFunctions NOTIFY printAvailableFunctionsChanged)
- Q_PROPERTY(bool wrapper READ wrapper NOTIFY wrapperChanged)
Q_PROPERTY(int dragThreshold READ dragThreshold NOTIFY dragThresholdChanged)
public:
QuickTestUtil(QObject *parent = 0)
{
return QTest::printAvailableFunctions;
}
- bool wrapper() const
- {
- return true;
- }
int dragThreshold() const { return qApp->styleHints()->startDragDistance(); }
Q_SIGNALS:
void printAvailableFunctionsChanged();
- void wrapperChanged();
void dragThresholdChanged();
public Q_SLOTS:
QQmlV8Handle typeName(const QVariant& v) const
{
QString name(v.typeName());
- //qDebug() << "type:" << name << " string value:" << v.toString() << " value:" << v;
if (v.canConvert<QObject*>()) {
QQmlType *type = 0;
const QMetaObject *mo = v.value<QObject*>()->metaObject();