AutoTest: Use setupFunction for TestSettingsPage

Change-Id: Ib592b3fd92480a5e712cf7cd69d4b5c899a1f216
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
This commit is contained in:
hjk
2024-01-29 09:02:52 +01:00
parent 8b8e360ba8
commit 45a62e785a
3 changed files with 21 additions and 16 deletions

View File

@@ -94,8 +94,6 @@ public:
void onRunUnderCursorTriggered(TestRunMode mode);
void onDisableTemporarily(bool disable);
TestSettingsPage m_testSettingPage;
TestCodeParser m_testCodeParser;
TestTreeModel m_testTreeModel{&m_testCodeParser};
TestRunner m_testRunner;
@@ -506,6 +504,8 @@ public:
void initialize() final
{
setupTestSettingsPage();
dd = new AutotestPluginPrivate;
#ifdef WITH_TESTS
ExtensionSystem::PluginManager::registerScenario("TestModelManagerInterface",

View File

@@ -10,6 +10,8 @@
#include "testsettings.h"
#include "testtreemodel.h"
#include <coreplugin/dialogs/ioptionspage.h>
#include <utils/algorithm.h>
#include <utils/id.h>
#include <utils/infolabel.h>
@@ -253,7 +255,10 @@ void TestSettingsWidget::onFrameworkItemChanged()
// TestSettingsPage
TestSettingsPage::TestSettingsPage()
class TestSettingsPage final : public Core::IOptionsPage
{
public:
TestSettingsPage()
{
setId(Constants::AUTOTEST_SETTINGS_ID);
setDisplayName(Tr::tr("General"));
@@ -262,5 +267,11 @@ TestSettingsPage::TestSettingsPage()
setCategoryIconPath(":/autotest/images/settingscategory_autotest.png");
setWidgetCreator([] { return new TestSettingsWidget; });
}
};
void setupTestSettingsPage()
{
static TestSettingsPage theTestSettingsPage;
}
} // Autotest::Internal

View File

@@ -3,14 +3,8 @@
#pragma once
#include <coreplugin/dialogs/ioptionspage.h>
namespace Autotest::Internal {
class TestSettingsPage : public Core::IOptionsPage
{
public:
TestSettingsPage();
};
void setupTestSettingsPage();
} // Autotest::Internal