┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/tests/testhelpers.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/tests/testhelpers.h')
-rw-r--r--src/tests/testhelpers.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/tests/testhelpers.h b/src/tests/testhelpers.h
new file mode 100644
index 000000000..e73f5449f
--- /dev/null
+++ b/src/tests/testhelpers.h
@@ -0,0 +1,26 @@
+/*
+ * SPDX-FileCopyrightText: 2026 Sebastian Englbrecht
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+#pragma once
+
+#include <QApplication>
+#include <QTest>
+
+namespace TestHelpers
+{
+
+/**
+ * Disables all Qt UI animations.
+ * Call once in initTestCase().
+ * Eliminates the need for qWait(N) hacks that wait for animations to finish.
+ */
+inline void disableAnimations()
+{
+ QApplication::setEffectEnabled(Qt::UI_AnimateMenu, false);
+ QApplication::setEffectEnabled(Qt::UI_AnimateCombo, false);
+ QApplication::setEffectEnabled(Qt::UI_AnimateTooltip, false);
+ QApplication::setEffectEnabled(Qt::UI_AnimateToolBox, false);
+}
+
+} // namespace TestHelpers