summaryrefslogtreecommitdiffstats
path: root/tests/auto/other
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/other')
-rw-r--r--tests/auto/other/compiler/tst_compiler.cpp4
-rw-r--r--tests/auto/other/lancelot/paintcommands.cpp49
-rw-r--r--tests/auto/other/lancelot/paintcommands.h4
-rw-r--r--tests/auto/other/lancelot/scripts/fillrect.qps121
-rw-r--r--tests/auto/other/lancelot/scripts/fillrect_aa.qps121
-rw-r--r--tests/auto/other/other.pro5
-rw-r--r--tests/auto/other/qaccessibility/tst_qaccessibility.cpp18
-rw-r--r--tests/auto/other/qfocusevent/tst_qfocusevent.cpp6
8 files changed, 322 insertions, 6 deletions
diff --git a/tests/auto/other/compiler/tst_compiler.cpp b/tests/auto/other/compiler/tst_compiler.cpp
index de15f4c62d..78026665be 100644
--- a/tests/auto/other/compiler/tst_compiler.cpp
+++ b/tests/auto/other/compiler/tst_compiler.cpp
@@ -634,7 +634,7 @@ void tst_Compiler::cxx11_alignas()
struct S {
alignas(double) char c;
};
- QCOMPARE(Q_ALIGNOF(S), Q_ALIGNOF(double));
+ QCOMPARE(alignof(S), alignof(double));
#endif
}
@@ -1396,7 +1396,7 @@ void tst_Compiler::cxx11_unrestricted_unions()
~U() {}
};
U u;
- std::aligned_storage<sizeof(QString), Q_ALIGNOF(QString)> as;
+ std::aligned_storage<sizeof(QString), alignof(QString)> as;
Q_UNUSED(u);
Q_UNUSED(as);
diff --git a/tests/auto/other/lancelot/paintcommands.cpp b/tests/auto/other/lancelot/paintcommands.cpp
index fbf906b55d..215a4c2a29 100644
--- a/tests/auto/other/lancelot/paintcommands.cpp
+++ b/tests/auto/other/lancelot/paintcommands.cpp
@@ -365,6 +365,7 @@ void PaintCommands::staticInit()
"^gradient_setCoordinateMode\\s+(\\w*)$",
"gradient_setCoordinateMode <coordinate method enum>",
"gradient_setCoordinateMode ObjectBoundingMode");
+
DECL_PAINTCOMMANDSECTION("drawing ops");
DECL_PAINTCOMMAND("drawPoint", command_drawPoint,
"^drawPoint\\s+(-?[\\w.]*)\\s+(-?[\\w.]*)$",
@@ -454,6 +455,14 @@ void PaintCommands::staticInit()
"\n - where t means tile"
"\n - and s is an offset in the tile",
"drawTiledPixmap :/images/alpha.png ");
+ DECL_PAINTCOMMAND("fillRect", command_fillRect,
+ "^fillRect\\s+(-?\\w*)\\s+(-?\\w*)\\s+(-?\\w*)\\s+(-?\\w*)\\s*(\\w*)?$",
+ "fillRect <x> <y> <w> <h> [color]\n - Uses current brush if no color given",
+ "fillRect 10 10 20 20 blue");
+ DECL_PAINTCOMMAND("fillRectF", command_fillRectF,
+ "^fillRectF\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)\\s*(\\w*)?$",
+ "fillRectF <x> <y> <w> <h> [color]\n - Uses current brush if no color given",
+ "fillRectF 10.5 10.5 20.2 20.2 blue");
DECL_PAINTCOMMANDSECTION("painterPaths");
DECL_PAINTCOMMAND("path_moveTo", command_path_moveTo,
@@ -1331,6 +1340,46 @@ void PaintCommands::command_drawTextDocument(QRegularExpressionMatch re)
m_painter->restore();
}
+/***************************************************************************************************/
+void PaintCommands::command_fillRect(QRegularExpressionMatch re)
+{
+ QStringList caps = re.capturedTexts();
+ int x = convertToInt(caps.at(1));
+ int y = convertToInt(caps.at(2));
+ int w = convertToInt(caps.at(3));
+ int h = convertToInt(caps.at(4));
+
+ if (!caps.at(5).isEmpty()) {
+ QColor color = convertToColor(caps.at(5));
+ if (m_verboseMode)
+ printf(" -(lance) fillRect(%d, %d, %d, %d, %s)\n", x, y, w, h, qPrintable(color.name()));
+ m_painter->fillRect(x, y, w, h, color);
+ } else {
+ if (m_verboseMode)
+ printf(" -(lance) fillRect(%d, %d, %d, %d)\n", x, y, w, h);
+ m_painter->fillRect(x, y, w, h, m_painter->brush());
+ }
+}
+
+void PaintCommands::command_fillRectF(QRegularExpressionMatch re)
+{
+ QStringList caps = re.capturedTexts();
+ double x = convertToDouble(caps.at(1));
+ double y = convertToDouble(caps.at(2));
+ double w = convertToDouble(caps.at(3));
+ double h = convertToDouble(caps.at(4));
+
+ if (!caps.at(5).isEmpty()) {
+ QColor color = convertToColor(caps.at(5));
+ if (m_verboseMode)
+ printf(" -(lance) fillRectF(%.2f, %.2f, %.2f, %.2f, %s)\n", x, y, w, h, qPrintable(color.name()));
+ m_painter->fillRect(QRectF(x, y, w, h), color);
+ } else {
+ if (m_verboseMode)
+ printf(" -(lance) fillRectF(%.2f, %.2f, %.2f, %.2f)\n", x, y, w, h);
+ m_painter->fillRect(QRectF(x, y, w, h), m_painter->brush());
+ }
+}
/***************************************************************************************************/
void PaintCommands::command_noop(QRegularExpressionMatch)
diff --git a/tests/auto/other/lancelot/paintcommands.h b/tests/auto/other/lancelot/paintcommands.h
index 79bdab634a..816ecd6fa2 100644
--- a/tests/auto/other/lancelot/paintcommands.h
+++ b/tests/auto/other/lancelot/paintcommands.h
@@ -200,6 +200,10 @@ private:
void command_drawStaticText(QRegularExpressionMatch re);
void command_drawTextDocument(QRegularExpressionMatch re);
void command_drawTiledPixmap(QRegularExpressionMatch re);
+ void command_fillRect(QRegularExpressionMatch re);
+ void command_fillRectF(QRegularExpressionMatch re);
+
+ // paths
void command_path_addEllipse(QRegularExpressionMatch re);
void command_path_addPolygon(QRegularExpressionMatch re);
void command_path_addRect(QRegularExpressionMatch re);
diff --git a/tests/auto/other/lancelot/scripts/fillrect.qps b/tests/auto/other/lancelot/scripts/fillrect.qps
new file mode 100644
index 0000000000..103ef2646a
--- /dev/null
+++ b/tests/auto/other/lancelot/scripts/fillrect.qps
@@ -0,0 +1,121 @@
+setRenderHint Antialiasing false
+
+# offscreen
+translate 0 -200
+
+begin_block rects
+# int API
+fillRect 10 10 20 20 green
+fillRect 40 10 20 20
+drawRect 70 10 20 20
+
+# float API, int values
+fillRectF 10.0 40.0 20.0 20.0 green
+fillRectF 40.0 40.0 20.0 20.0
+drawRect 70.0 40.0 20.0 20.0
+
+# float API, float values
+fillRectF 10.0 70.0 20.5 20.5 green
+fillRectF 40.0 70.0 20.5 20.5
+drawRect 70.0 70.0 20.5 20.5
+
+# alignment, int api, color
+fillRect 10 100 10 10 green
+fillRect 20 100 10 10 green
+fillRect 10 110 10 10 green
+fillRect 20 110 10 10 green
+
+# alignment, int api, brush
+fillRect 40 100 10 10
+fillRect 50 100 10 10
+fillRect 40 110 10 10
+fillRect 50 110 10 10
+
+# alignment comparison
+drawRect 70 100 10 10
+drawRect 80 100 10 10
+drawRect 70 110 10 10
+drawRect 80 110 10 10
+
+# alignment, float api, color
+fillRectF 10.0 130.0 10.0 10.0 green
+fillRectF 20.0 130.0 10.0 10.0 green
+fillRectF 10.0 140.0 10.0 10.0 green
+fillRectF 20.0 140.0 10.0 10.0 green
+
+# alignment, float api, brush
+fillRectF 40.0 130.0 10.0 10.0
+fillRectF 50.0 130.0 10.0 10.0
+fillRectF 40.0 140.0 10.0 10.0
+fillRectF 50.0 140.0 10.0 10.0
+
+# alignment comparison
+drawRect 70.0 130.0 10.0 10.0
+drawRect 80.0 130.0 10.0 10.0
+drawRect 70.0 140.0 10.0 10.0
+drawRect 80.0 140.0 10.0 10.0
+
+end_block
+
+begin_block row
+
+repeat_block rects
+
+save
+translate 100.2 0.2
+repeat_block rects
+restore
+
+save
+translate 200.5 0.5
+repeat_block rects
+restore
+
+save
+translate 300.7 0.7
+repeat_block rects
+restore
+
+end_block
+
+# end of block defs
+
+resetMatrix
+
+setPen NoPen
+setBrush green
+repeat_block row
+
+save
+translate 500 50
+scale 0.42 0.42
+repeat_block row
+restore
+
+save
+translate 0 160
+scale 1.8 0.8
+repeat_block row
+restore
+
+save
+translate 650 320
+rotate 80
+repeat_block row
+restore
+
+save
+setBrush green Dense2Pattern
+translate 0 400
+repeat_block row
+restore
+
+save
+gradient_clearStops
+gradient_appendStop 0 green
+gradient_appendStop 1 blue
+gradient_setCoordinateMode ObjectBoundingMode
+gradient_setLinear 0.0 0.0 1.0 1.0
+translate 0 600
+repeat_block row
+restore
diff --git a/tests/auto/other/lancelot/scripts/fillrect_aa.qps b/tests/auto/other/lancelot/scripts/fillrect_aa.qps
new file mode 100644
index 0000000000..3232899661
--- /dev/null
+++ b/tests/auto/other/lancelot/scripts/fillrect_aa.qps
@@ -0,0 +1,121 @@
+setRenderHint Antialiasing true
+
+# offscreen
+translate 0 -200
+
+begin_block rects
+# int API
+fillRect 10 10 20 20 green
+fillRect 40 10 20 20
+drawRect 70 10 20 20
+
+# float API, int values
+fillRectF 10.0 40.0 20.0 20.0 green
+fillRectF 40.0 40.0 20.0 20.0
+drawRect 70.0 40.0 20.0 20.0
+
+# float API, float values
+fillRectF 10.0 70.0 20.5 20.5 green
+fillRectF 40.0 70.0 20.5 20.5
+drawRect 70.0 70.0 20.5 20.5
+
+# alignment, int api, color
+fillRect 10 100 10 10 green
+fillRect 20 100 10 10 green
+fillRect 10 110 10 10 green
+fillRect 20 110 10 10 green
+
+# alignment, int api, brush
+fillRect 40 100 10 10
+fillRect 50 100 10 10
+fillRect 40 110 10 10
+fillRect 50 110 10 10
+
+# alignment comparison
+drawRect 70 100 10 10
+drawRect 80 100 10 10
+drawRect 70 110 10 10
+drawRect 80 110 10 10
+
+# alignment, float api, color
+fillRectF 10.0 130.0 10.0 10.0 green
+fillRectF 20.0 130.0 10.0 10.0 green
+fillRectF 10.0 140.0 10.0 10.0 green
+fillRectF 20.0 140.0 10.0 10.0 green
+
+# alignment, float api, brush
+fillRectF 40.0 130.0 10.0 10.0
+fillRectF 50.0 130.0 10.0 10.0
+fillRectF 40.0 140.0 10.0 10.0
+fillRectF 50.0 140.0 10.0 10.0
+
+# alignment comparison
+drawRect 70.0 130.0 10.0 10.0
+drawRect 80.0 130.0 10.0 10.0
+drawRect 70.0 140.0 10.0 10.0
+drawRect 80.0 140.0 10.0 10.0
+
+end_block
+
+begin_block row
+
+repeat_block rects
+
+save
+translate 100.2 0.2
+repeat_block rects
+restore
+
+save
+translate 200.5 0.5
+repeat_block rects
+restore
+
+save
+translate 300.7 0.7
+repeat_block rects
+restore
+
+end_block
+
+# end of block defs
+
+resetMatrix
+
+setPen NoPen
+setBrush green
+repeat_block row
+
+save
+translate 500 50
+scale 0.42 0.42
+repeat_block row
+restore
+
+save
+translate 0 160
+scale 1.8 0.8
+repeat_block row
+restore
+
+save
+translate 650 320
+rotate 80
+repeat_block row
+restore
+
+save
+setBrush green Dense2Pattern
+translate 0 400
+repeat_block row
+restore
+
+save
+gradient_clearStops
+gradient_appendStop 0 green
+gradient_appendStop 1 blue
+gradient_setCoordinateMode ObjectBoundingMode
+gradient_setLinear 0.0 0.0 1.0 1.0
+translate 0 600
+repeat_block row
+restore
diff --git a/tests/auto/other/other.pro b/tests/auto/other/other.pro
index 4206852e4c..743de1e188 100644
--- a/tests/auto/other/other.pro
+++ b/tests/auto/other/other.pro
@@ -68,7 +68,4 @@ winrt|!qtHaveModule(gui)|!qtConfig(accessibility): SUBDIRS -= qaccessibility
android: SUBDIRS += \
android
-qtConfig(xkbcommon): {
- SUBDIRS += \
- xkbkeyboard
-}
+qtHaveModule(gui):qtConfig(xkbcommon): SUBDIRS += xkbkeyboard
diff --git a/tests/auto/other/qaccessibility/tst_qaccessibility.cpp b/tests/auto/other/qaccessibility/tst_qaccessibility.cpp
index 7d7fa6403b..82dc826db2 100644
--- a/tests/auto/other/qaccessibility/tst_qaccessibility.cpp
+++ b/tests/auto/other/qaccessibility/tst_qaccessibility.cpp
@@ -203,11 +203,15 @@ private slots:
void applicationTest();
void mainWindowTest();
void subWindowTest();
+#if QT_CONFIG(shortcut)
void buttonTest();
+#endif
void scrollBarTest();
void tabTest();
void tabWidgetTest();
+#if QT_CONFIG(shortcut)
void menuTest();
+#endif
void spinBoxTest();
void doubleSpinBoxTest();
void textEditTest();
@@ -234,8 +238,10 @@ private slots:
void dockWidgetTest();
void comboBoxTest();
void accessibleName();
+#if QT_CONFIG(shortcut)
void labelTest();
void accelerators();
+#endif
void bridgeTest();
protected slots:
@@ -1026,6 +1032,8 @@ public Q_SLOTS:
}
};
+#if QT_CONFIG(shortcut)
+
void tst_QAccessibility::buttonTest()
{
QWidget window;
@@ -1198,6 +1206,8 @@ void tst_QAccessibility::buttonTest()
// test->release();
}
+#endif // QT_CONFIG(shortcut)
+
void tst_QAccessibility::scrollBarTest()
{
QScrollBar *scrollBar = new QScrollBar(Qt::Horizontal);
@@ -1407,6 +1417,8 @@ void tst_QAccessibility::tabWidgetTest()
QTestAccessibility::clearEvents();
}
+#if QT_CONFIG(shortcut)
+
void tst_QAccessibility::menuTest()
{
{
@@ -1617,6 +1629,8 @@ void tst_QAccessibility::menuTest()
QTestAccessibility::clearEvents();
}
+#endif // QT_CONFIG(shortcut)
+
void tst_QAccessibility::spinBoxTest()
{
QSpinBox * const spinBox = new QSpinBox();
@@ -3629,6 +3643,8 @@ void tst_QAccessibility::comboBoxTest()
QTestAccessibility::clearEvents();
}
+#if QT_CONFIG(shortcut)
+
void tst_QAccessibility::labelTest()
{
QWidget *window = new QWidget;
@@ -3729,6 +3745,8 @@ void tst_QAccessibility::accelerators()
QTestAccessibility::clearEvents();
}
+#endif // QT_CONFIG(shortcut)
+
#ifdef QT_SUPPORTS_IACCESSIBLE2
static IUnknown *queryIA2(IAccessible *acc, const IID &iid)
{
diff --git a/tests/auto/other/qfocusevent/tst_qfocusevent.cpp b/tests/auto/other/qfocusevent/tst_qfocusevent.cpp
index 260ba12a97..9285d5b5da 100644
--- a/tests/auto/other/qfocusevent/tst_qfocusevent.cpp
+++ b/tests/auto/other/qfocusevent/tst_qfocusevent.cpp
@@ -91,7 +91,9 @@ private slots:
void checkReason_BackTab();
void checkReason_Popup();
void checkReason_focusWidget();
+#if QT_CONFIG(shortcut)
void checkReason_Shortcut();
+#endif
void checkReason_ActiveWindow();
private:
@@ -250,6 +252,8 @@ QT_BEGIN_NAMESPACE
QT_END_NAMESPACE
#endif
+#if QT_CONFIG(shortcut)
+
void tst_QFocusEvent::checkReason_Shortcut()
{
initWidget();
@@ -288,6 +292,8 @@ void tst_QFocusEvent::checkReason_Shortcut()
#endif
}
+#endif // QT_CONFIG(shortcut)
+
void tst_QFocusEvent::checkReason_focusWidget()
{
// This test checks that a widget doesn't loose