Merge pull request #1411 from bhangart/fix/settings-tests-windows

Give the toolbar and gesture settings tests their own settings scope
This commit is contained in:
ispyisail
2026-10-09 22:39:37 +13:00
committed by GitHub
3 changed files with 18 additions and 0 deletions
@@ -21,6 +21,7 @@
#include <QAction>
#include <QComboBox>
#include <QCoreApplication>
#include <QListWidget>
#include <QPushButton>
#include <QSettings>
@@ -86,6 +87,11 @@ private slots:
void initTestCase()
{
QStandardPaths::setTestModeEnabled(true);
//A scope of this test's own. Without an organization name,
//QSettings on Windows has no registry key: it drops every
//write and reads only defaults.
QCoreApplication::setOrganizationName(QStringLiteral("QElectroTech-tst_diagramtoolbarsettings"));
QCoreApplication::setApplicationName(QStringLiteral("tst_diagramtoolbarsettings"));
clearSettings();
//A few of the diagram editor's commands, as it registers them
for (const QString &id : {QStringLiteral("diagrameditor.copy"),
+6
View File
@@ -22,6 +22,7 @@
#include <QAction>
#include <QComboBox>
#include <QCoreApplication>
#include <QDropEvent>
#include <QListWidget>
#include <QMainWindow>
@@ -64,6 +65,11 @@ private slots:
void initTestCase()
{
QStandardPaths::setTestModeEnabled(true);
//A scope of this test's own. Without an organization name,
//QSettings on Windows has no registry key: it drops every
//write and reads only defaults.
QCoreApplication::setOrganizationName(QStringLiteral("QElectroTech-tst_gesturesettings"));
QCoreApplication::setApplicationName(QStringLiteral("tst_gesturesettings"));
QSettings().remove(QStringLiteral("diagrameditor"));
addCommand(QStringLiteral("diagrameditor.copy"), QStringLiteral("Copier"));
addCommand(QStringLiteral("diagrameditor.cut"), QStringLiteral("Couper"));
+6
View File
@@ -20,6 +20,7 @@
#include <QCheckBox>
#include <QComboBox>
#include <QCoreApplication>
#include <QDockWidget>
#include <QMainWindow>
#include <QSettings>
@@ -48,6 +49,11 @@ private slots:
void initTestCase()
{
QStandardPaths::setTestModeEnabled(true);
//A scope of this test's own. Without an organization name,
//QSettings on Windows has no registry key: it drops every
//write and reads only defaults.
QCoreApplication::setOrganizationName(QStringLiteral("QElectroTech-tst_toolbarsettings"));
QCoreApplication::setApplicationName(QStringLiteral("tst_toolbarsettings"));
QSettings().remove(QStringLiteral("toolbars"));
m_window = new QMainWindow();