results.stopLogging();
}
-int quick_test_main(int argc, char **argv, const char *name, quick_test_viewport_create createViewport, const char *sourceDir)
+int quick_test_main(int argc, char **argv, const char *name, const char *sourceDir)
{
- Q_UNUSED(createViewport);
QGuiApplication* app = 0;
if (!QCoreApplication::instance()) {
app = new QGuiApplication(argc, argv);
#define QUICKTEST_H
#include <QtQuickTest/quicktestglobal.h>
-#include <QtWidgets/qwidget.h>
-#ifdef QT_OPENGL_LIB
-#include <QtGui/qopengl.h>
-#endif
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-typedef QWidget *(*quick_test_viewport_create)();
-
-Q_QUICK_TEST_EXPORT int quick_test_main(int argc, char **argv, const char *name, quick_test_viewport_create createViewport, const char *sourceDir);
+Q_QUICK_TEST_EXPORT int quick_test_main(int argc, char **argv, const char *name, const char *sourceDir);
#ifdef QUICK_TEST_SOURCE_DIR
#define QUICK_TEST_MAIN(name) \
int main(int argc, char **argv) \
{ \
- return quick_test_main(argc, argv, #name, 0, QUICK_TEST_SOURCE_DIR); \
+ return quick_test_main(argc, argv, #name, QUICK_TEST_SOURCE_DIR); \
}
#define QUICK_TEST_OPENGL_MAIN(name) \
- static QWidget *name##_create_viewport() \
- { \
- return new QOpenGLWidget(); \
- } \
int main(int argc, char **argv) \
{ \
- return quick_test_main(argc, argv, #name, name##_create_viewport, QUICK_TEST_SOURCE_DIR); \
+ return quick_test_main(argc, argv, #name, QUICK_TEST_SOURCE_DIR); \
}
#else
#define QUICK_TEST_MAIN(name) \
int main(int argc, char **argv) \
{ \
- return quick_test_main(argc, argv, #name, 0, 0); \
+ return quick_test_main(argc, argv, #name, 0); \
}
#define QUICK_TEST_OPENGL_MAIN(name) \
- static QWidget *name##_create_viewport() \
- { \
- return new QOpenGLWidget(); \
- } \
int main(int argc, char **argv) \
{ \
- return quick_test_main(argc, argv, #name, name##_create_viewport, 0); \
+ return quick_test_main(argc, argv, #name, 0); \
}
#endif
#include <QPainter>
#include <QtQuick/QQuickView>
-#include <QApplication>
+#include <QGuiApplication>
#include <QEasingCurve>
#include <QtQuick/QQuickPaintedItem>
int main(int argc, char ** argv)
{
- QApplication app(argc, argv);
+ QGuiApplication app(argc, argv);
qmlRegisterType<EasingPlot>("EasingPlot", 1, 0, "EasingPlot");
#include <QtOpenGL/qgl.h>
#endif
-#ifdef QT_OPENGL_LIB
-
-static QWidget *qmltestrunner_create_gl_viewport()
-{
- return new QGLWidget();
-}
-
-#endif
-
int main(int argc, char **argv)
{
-#ifdef QT_OPENGL_LIB
- bool isOpenGL = false;
- for (int index = 1; index < argc; ++index) {
- if (strcmp(argv[index], "-opengl") == 0) {
- isOpenGL = true;
- break;
- }
- }
- if (isOpenGL) {
- return quick_test_main(argc, argv, "qmltestrunner",
- qmltestrunner_create_gl_viewport, ".");
- } else
-#endif
- {
- return quick_test_main(argc, argv, "qmltestrunner", 0, ".");
- }
+ return quick_test_main(argc, argv, "qmltestrunner", ".");
}