2022-08-19 15:59:36 +02:00
|
|
|
// Copyright (C) 2021 The Qt Company Ltd.
|
2022-12-21 10:12:09 +01:00
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
2021-12-14 19:36:48 +02:00
|
|
|
|
|
|
|
|
#include "test-utilities.h"
|
|
|
|
|
|
|
|
|
|
#include <coreplugin/iwizardfactory.h>
|
QDS-5691 Create a tab for Recent choices
The Recents should store presets, rather than normal project items,
while the rest of tabs are to store normal project (i.e. wizard) items
but with the default screen size written under the wizard name.
In this patch I also did a few renames: e.g. the Presets view now uses a
PresetModel rather than ProjectModel, because we now store presets. A
Preset is a higher level concept than Project / Wizard item: it can be a
project/wizard item with pre-defined configurations; and now we can have
multiple presets using the same Wizard factory. Renamed struct
ProjectCategory to WizardCategory, because the items are grouped by the
category of the wizard (i.e. the "category" property of IWizardFactory)
I extracted a class, PresetData, to hold the data that is being shared
by the PresetModel (items in the view) and the PresetCategoryModel
(header/tab items). It stored both information on normal presets and on
recent presets.
Made changes to JsonWizardFactory so that I could extract the list of
screen sizes without requiring to build a wizard object first. This is
important, because multiple JsonWizard objects cannot be created at the
same time and I need to show the screen sizes of multiple presets /
wizards as the Presets view is opened. This also required class
WizardFactories to use JsonWizardFactory instead of Core::IWizardFactory
-- since "screen sizes" are a particularity of the json wizards, not of
all kinds of wizards.
Also, fixed a TODO in WizardHandler::reset() method.
Also, added a few utilities I had need of, in algorithm.h.
Change-Id: Ifd986e2def19b2e112f0aa1ab3db63d522736321
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2022-01-10 15:48:29 +02:00
|
|
|
#include <projectexplorer/jsonwizard/jsonwizardfactory.h>
|
2021-12-14 19:36:48 +02:00
|
|
|
|
|
|
|
|
#include "wizardfactories.h"
|
|
|
|
|
|
|
|
|
|
using namespace StudioWelcome;
|
|
|
|
|
using Core::IWizardFactory;
|
QDS-5691 Create a tab for Recent choices
The Recents should store presets, rather than normal project items,
while the rest of tabs are to store normal project (i.e. wizard) items
but with the default screen size written under the wizard name.
In this patch I also did a few renames: e.g. the Presets view now uses a
PresetModel rather than ProjectModel, because we now store presets. A
Preset is a higher level concept than Project / Wizard item: it can be a
project/wizard item with pre-defined configurations; and now we can have
multiple presets using the same Wizard factory. Renamed struct
ProjectCategory to WizardCategory, because the items are grouped by the
category of the wizard (i.e. the "category" property of IWizardFactory)
I extracted a class, PresetData, to hold the data that is being shared
by the PresetModel (items in the view) and the PresetCategoryModel
(header/tab items). It stored both information on normal presets and on
recent presets.
Made changes to JsonWizardFactory so that I could extract the list of
screen sizes without requiring to build a wizard object first. This is
important, because multiple JsonWizard objects cannot be created at the
same time and I need to show the screen sizes of multiple presets /
wizards as the Presets view is opened. This also required class
WizardFactories to use JsonWizardFactory instead of Core::IWizardFactory
-- since "screen sizes" are a particularity of the json wizards, not of
all kinds of wizards.
Also, fixed a TODO in WizardHandler::reset() method.
Also, added a few utilities I had need of, in algorithm.h.
Change-Id: Ifd986e2def19b2e112f0aa1ab3db63d522736321
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2022-01-10 15:48:29 +02:00
|
|
|
using ProjectExplorer::JsonWizardFactory;
|
2021-12-14 19:36:48 +02:00
|
|
|
|
|
|
|
|
namespace {
|
|
|
|
|
|
QDS-5691 Create a tab for Recent choices
The Recents should store presets, rather than normal project items,
while the rest of tabs are to store normal project (i.e. wizard) items
but with the default screen size written under the wizard name.
In this patch I also did a few renames: e.g. the Presets view now uses a
PresetModel rather than ProjectModel, because we now store presets. A
Preset is a higher level concept than Project / Wizard item: it can be a
project/wizard item with pre-defined configurations; and now we can have
multiple presets using the same Wizard factory. Renamed struct
ProjectCategory to WizardCategory, because the items are grouped by the
category of the wizard (i.e. the "category" property of IWizardFactory)
I extracted a class, PresetData, to hold the data that is being shared
by the PresetModel (items in the view) and the PresetCategoryModel
(header/tab items). It stored both information on normal presets and on
recent presets.
Made changes to JsonWizardFactory so that I could extract the list of
screen sizes without requiring to build a wizard object first. This is
important, because multiple JsonWizard objects cannot be created at the
same time and I need to show the screen sizes of multiple presets /
wizards as the Presets view is opened. This also required class
WizardFactories to use JsonWizardFactory instead of Core::IWizardFactory
-- since "screen sizes" are a particularity of the json wizards, not of
all kinds of wizards.
Also, fixed a TODO in WizardHandler::reset() method.
Also, added a few utilities I had need of, in algorithm.h.
Change-Id: Ifd986e2def19b2e112f0aa1ab3db63d522736321
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2022-01-10 15:48:29 +02:00
|
|
|
class MockWizardFactory : public JsonWizardFactory
|
2021-12-14 19:36:48 +02:00
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
MOCK_METHOD(Utils::Wizard *, runWizardImpl,
|
|
|
|
|
(
|
|
|
|
|
const Utils::FilePath &,
|
|
|
|
|
QWidget *,
|
|
|
|
|
Utils::Id,
|
|
|
|
|
const QVariantMap &,
|
|
|
|
|
bool
|
|
|
|
|
),
|
|
|
|
|
(override));
|
|
|
|
|
|
2022-02-08 11:10:52 +01:00
|
|
|
MOCK_METHOD((std::pair<int, QStringList>), screenSizeInfoFromPage, (const QString &), (const, override));
|
QDS-5691 Create a tab for Recent choices
The Recents should store presets, rather than normal project items,
while the rest of tabs are to store normal project (i.e. wizard) items
but with the default screen size written under the wizard name.
In this patch I also did a few renames: e.g. the Presets view now uses a
PresetModel rather than ProjectModel, because we now store presets. A
Preset is a higher level concept than Project / Wizard item: it can be a
project/wizard item with pre-defined configurations; and now we can have
multiple presets using the same Wizard factory. Renamed struct
ProjectCategory to WizardCategory, because the items are grouped by the
category of the wizard (i.e. the "category" property of IWizardFactory)
I extracted a class, PresetData, to hold the data that is being shared
by the PresetModel (items in the view) and the PresetCategoryModel
(header/tab items). It stored both information on normal presets and on
recent presets.
Made changes to JsonWizardFactory so that I could extract the list of
screen sizes without requiring to build a wizard object first. This is
important, because multiple JsonWizard objects cannot be created at the
same time and I need to show the screen sizes of multiple presets /
wizards as the Presets view is opened. This also required class
WizardFactories to use JsonWizardFactory instead of Core::IWizardFactory
-- since "screen sizes" are a particularity of the json wizards, not of
all kinds of wizards.
Also, fixed a TODO in WizardHandler::reset() method.
Also, added a few utilities I had need of, in algorithm.h.
Change-Id: Ifd986e2def19b2e112f0aa1ab3db63d522736321
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2022-01-10 15:48:29 +02:00
|
|
|
|
2021-12-14 19:36:48 +02:00
|
|
|
MOCK_METHOD(bool, isAvailable, (Utils::Id), (const, override));
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class QdsWizardFactories: public ::testing::Test
|
|
|
|
|
{
|
|
|
|
|
protected:
|
|
|
|
|
void SetUp() override
|
|
|
|
|
{
|
|
|
|
|
oldIconUnicodeFunc = WizardFactories::setIconUnicodeCallback(+[](const QString &) -> QString {
|
|
|
|
|
return "whatever-icon unicode";
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void TearDown() override
|
|
|
|
|
{
|
|
|
|
|
WizardFactories::setIconUnicodeCallback(oldIconUnicodeFunc);
|
|
|
|
|
}
|
|
|
|
|
|
2022-02-08 11:10:52 +01:00
|
|
|
IWizardFactory *aWizardFactory(IWizardFactory::WizardKind kind,
|
2021-12-14 19:36:48 +02:00
|
|
|
const QPair<QString, bool> &availableOnPlatform = {})
|
|
|
|
|
{
|
|
|
|
|
MockWizardFactory *factory = new MockWizardFactory;
|
|
|
|
|
m_factories.push_back(std::unique_ptr<IWizardFactory>(factory));
|
|
|
|
|
|
2022-02-08 11:10:52 +01:00
|
|
|
configureFactory(*factory, kind, availableOnPlatform);
|
2021-12-14 19:36:48 +02:00
|
|
|
|
|
|
|
|
return factory;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// a good wizard factory is a wizard factory that is not filtered out, and which is available on
|
|
|
|
|
// platform `this->platform`
|
QDS-5691 Create a tab for Recent choices
The Recents should store presets, rather than normal project items,
while the rest of tabs are to store normal project (i.e. wizard) items
but with the default screen size written under the wizard name.
In this patch I also did a few renames: e.g. the Presets view now uses a
PresetModel rather than ProjectModel, because we now store presets. A
Preset is a higher level concept than Project / Wizard item: it can be a
project/wizard item with pre-defined configurations; and now we can have
multiple presets using the same Wizard factory. Renamed struct
ProjectCategory to WizardCategory, because the items are grouped by the
category of the wizard (i.e. the "category" property of IWizardFactory)
I extracted a class, PresetData, to hold the data that is being shared
by the PresetModel (items in the view) and the PresetCategoryModel
(header/tab items). It stored both information on normal presets and on
recent presets.
Made changes to JsonWizardFactory so that I could extract the list of
screen sizes without requiring to build a wizard object first. This is
important, because multiple JsonWizard objects cannot be created at the
same time and I need to show the screen sizes of multiple presets /
wizards as the Presets view is opened. This also required class
WizardFactories to use JsonWizardFactory instead of Core::IWizardFactory
-- since "screen sizes" are a particularity of the json wizards, not of
all kinds of wizards.
Also, fixed a TODO in WizardHandler::reset() method.
Also, added a few utilities I had need of, in algorithm.h.
Change-Id: Ifd986e2def19b2e112f0aa1ab3db63d522736321
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2022-01-10 15:48:29 +02:00
|
|
|
IWizardFactory *aGoodWizardFactory(const QString &name = "", const QString &id = "",
|
|
|
|
|
const QString &categoryId = "", const std::pair<int, QStringList> &sizes = {})
|
2021-12-14 19:36:48 +02:00
|
|
|
{
|
|
|
|
|
MockWizardFactory *factory = new MockWizardFactory;
|
|
|
|
|
m_factories.push_back(std::unique_ptr<IWizardFactory>(factory));
|
|
|
|
|
|
2022-02-08 11:10:52 +01:00
|
|
|
configureFactory(*factory, IWizardFactory::ProjectWizard,
|
QDS-5691 Create a tab for Recent choices
The Recents should store presets, rather than normal project items,
while the rest of tabs are to store normal project (i.e. wizard) items
but with the default screen size written under the wizard name.
In this patch I also did a few renames: e.g. the Presets view now uses a
PresetModel rather than ProjectModel, because we now store presets. A
Preset is a higher level concept than Project / Wizard item: it can be a
project/wizard item with pre-defined configurations; and now we can have
multiple presets using the same Wizard factory. Renamed struct
ProjectCategory to WizardCategory, because the items are grouped by the
category of the wizard (i.e. the "category" property of IWizardFactory)
I extracted a class, PresetData, to hold the data that is being shared
by the PresetModel (items in the view) and the PresetCategoryModel
(header/tab items). It stored both information on normal presets and on
recent presets.
Made changes to JsonWizardFactory so that I could extract the list of
screen sizes without requiring to build a wizard object first. This is
important, because multiple JsonWizard objects cannot be created at the
same time and I need to show the screen sizes of multiple presets /
wizards as the Presets view is opened. This also required class
WizardFactories to use JsonWizardFactory instead of Core::IWizardFactory
-- since "screen sizes" are a particularity of the json wizards, not of
all kinds of wizards.
Also, fixed a TODO in WizardHandler::reset() method.
Also, added a few utilities I had need of, in algorithm.h.
Change-Id: Ifd986e2def19b2e112f0aa1ab3db63d522736321
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2022-01-10 15:48:29 +02:00
|
|
|
{platform, true}, sizes);
|
2021-12-14 19:36:48 +02:00
|
|
|
|
|
|
|
|
if (!name.isEmpty())
|
|
|
|
|
factory->setDisplayName(name);
|
|
|
|
|
if (!id.isEmpty())
|
|
|
|
|
factory->setId(Utils::Id::fromString(id));
|
|
|
|
|
if (!categoryId.isEmpty())
|
|
|
|
|
factory->setCategory(categoryId);
|
|
|
|
|
|
|
|
|
|
return factory;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void configureFactory(MockWizardFactory &factory, IWizardFactory::WizardKind kind,
|
QDS-5691 Create a tab for Recent choices
The Recents should store presets, rather than normal project items,
while the rest of tabs are to store normal project (i.e. wizard) items
but with the default screen size written under the wizard name.
In this patch I also did a few renames: e.g. the Presets view now uses a
PresetModel rather than ProjectModel, because we now store presets. A
Preset is a higher level concept than Project / Wizard item: it can be a
project/wizard item with pre-defined configurations; and now we can have
multiple presets using the same Wizard factory. Renamed struct
ProjectCategory to WizardCategory, because the items are grouped by the
category of the wizard (i.e. the "category" property of IWizardFactory)
I extracted a class, PresetData, to hold the data that is being shared
by the PresetModel (items in the view) and the PresetCategoryModel
(header/tab items). It stored both information on normal presets and on
recent presets.
Made changes to JsonWizardFactory so that I could extract the list of
screen sizes without requiring to build a wizard object first. This is
important, because multiple JsonWizard objects cannot be created at the
same time and I need to show the screen sizes of multiple presets /
wizards as the Presets view is opened. This also required class
WizardFactories to use JsonWizardFactory instead of Core::IWizardFactory
-- since "screen sizes" are a particularity of the json wizards, not of
all kinds of wizards.
Also, fixed a TODO in WizardHandler::reset() method.
Also, added a few utilities I had need of, in algorithm.h.
Change-Id: Ifd986e2def19b2e112f0aa1ab3db63d522736321
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2022-01-10 15:48:29 +02:00
|
|
|
const QPair<QString, bool> &availableOnPlatform = {},
|
2022-01-17 15:22:20 +01:00
|
|
|
const std::pair<int, QStringList> &sizes = {})
|
2021-12-14 19:36:48 +02:00
|
|
|
{
|
|
|
|
|
if (kind == IWizardFactory::ProjectWizard) {
|
|
|
|
|
QSet<Utils::Id> supported{Utils::Id{"QmlProjectManager.QmlProject"}};
|
|
|
|
|
factory.setSupportedProjectTypes(supported);
|
|
|
|
|
EXPECT_EQ(IWizardFactory::ProjectWizard, factory.kind())
|
|
|
|
|
<< "Expected to create a Project Wizard factory";
|
|
|
|
|
} else {
|
|
|
|
|
factory.setSupportedProjectTypes({});
|
|
|
|
|
EXPECT_EQ(IWizardFactory::FileWizard, factory.kind())
|
|
|
|
|
<< "Expected to create a File Wizard factory";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!availableOnPlatform.first.isEmpty()) {
|
|
|
|
|
const QString platform = availableOnPlatform.first;
|
|
|
|
|
bool value = availableOnPlatform.second;
|
|
|
|
|
Utils::Id platformId = Utils::Id::fromString(platform);
|
|
|
|
|
|
|
|
|
|
EXPECT_CALL(factory, isAvailable(platformId))
|
|
|
|
|
.Times(AtLeast(1))
|
|
|
|
|
.WillRepeatedly(Return(value));
|
|
|
|
|
}
|
QDS-5691 Create a tab for Recent choices
The Recents should store presets, rather than normal project items,
while the rest of tabs are to store normal project (i.e. wizard) items
but with the default screen size written under the wizard name.
In this patch I also did a few renames: e.g. the Presets view now uses a
PresetModel rather than ProjectModel, because we now store presets. A
Preset is a higher level concept than Project / Wizard item: it can be a
project/wizard item with pre-defined configurations; and now we can have
multiple presets using the same Wizard factory. Renamed struct
ProjectCategory to WizardCategory, because the items are grouped by the
category of the wizard (i.e. the "category" property of IWizardFactory)
I extracted a class, PresetData, to hold the data that is being shared
by the PresetModel (items in the view) and the PresetCategoryModel
(header/tab items). It stored both information on normal presets and on
recent presets.
Made changes to JsonWizardFactory so that I could extract the list of
screen sizes without requiring to build a wizard object first. This is
important, because multiple JsonWizard objects cannot be created at the
same time and I need to show the screen sizes of multiple presets /
wizards as the Presets view is opened. This also required class
WizardFactories to use JsonWizardFactory instead of Core::IWizardFactory
-- since "screen sizes" are a particularity of the json wizards, not of
all kinds of wizards.
Also, fixed a TODO in WizardHandler::reset() method.
Also, added a few utilities I had need of, in algorithm.h.
Change-Id: Ifd986e2def19b2e112f0aa1ab3db63d522736321
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2022-01-10 15:48:29 +02:00
|
|
|
|
|
|
|
|
auto screenSizes = (sizes == std::pair<int, QStringList>{}
|
|
|
|
|
? std::make_pair(0, QStringList({"640 x 480"}))
|
|
|
|
|
: sizes);
|
|
|
|
|
|
|
|
|
|
EXPECT_CALL(factory, screenSizeInfoFromPage(QString("Fields")))
|
|
|
|
|
.Times(AtLeast(0))
|
|
|
|
|
.WillRepeatedly(Return(screenSizes));
|
2021-12-14 19:36:48 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
WizardFactories makeWizardFactoriesHandler(QList<IWizardFactory *> source,
|
|
|
|
|
const QString &platform = "")
|
|
|
|
|
{
|
|
|
|
|
return WizardFactories{source, nullptr, Utils::Id::fromString(platform)};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
QString platform = "Desktop";
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
std::vector<std::unique_ptr<IWizardFactory>> m_factories;
|
|
|
|
|
WizardFactories::GetIconUnicodeFunc oldIconUnicodeFunc;
|
|
|
|
|
};
|
|
|
|
|
|
QDS-5691 Create a tab for Recent choices
The Recents should store presets, rather than normal project items,
while the rest of tabs are to store normal project (i.e. wizard) items
but with the default screen size written under the wizard name.
In this patch I also did a few renames: e.g. the Presets view now uses a
PresetModel rather than ProjectModel, because we now store presets. A
Preset is a higher level concept than Project / Wizard item: it can be a
project/wizard item with pre-defined configurations; and now we can have
multiple presets using the same Wizard factory. Renamed struct
ProjectCategory to WizardCategory, because the items are grouped by the
category of the wizard (i.e. the "category" property of IWizardFactory)
I extracted a class, PresetData, to hold the data that is being shared
by the PresetModel (items in the view) and the PresetCategoryModel
(header/tab items). It stored both information on normal presets and on
recent presets.
Made changes to JsonWizardFactory so that I could extract the list of
screen sizes without requiring to build a wizard object first. This is
important, because multiple JsonWizard objects cannot be created at the
same time and I need to show the screen sizes of multiple presets /
wizards as the Presets view is opened. This also required class
WizardFactories to use JsonWizardFactory instead of Core::IWizardFactory
-- since "screen sizes" are a particularity of the json wizards, not of
all kinds of wizards.
Also, fixed a TODO in WizardHandler::reset() method.
Also, added a few utilities I had need of, in algorithm.h.
Change-Id: Ifd986e2def19b2e112f0aa1ab3db63d522736321
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2022-01-10 15:48:29 +02:00
|
|
|
QStringList presetNames(const WizardCategory &cat)
|
|
|
|
|
{
|
2022-02-23 15:32:34 +02:00
|
|
|
QStringList result = Utils::transform<QStringList>(cat.items, &PresetItem::wizardName);
|
QDS-5691 Create a tab for Recent choices
The Recents should store presets, rather than normal project items,
while the rest of tabs are to store normal project (i.e. wizard) items
but with the default screen size written under the wizard name.
In this patch I also did a few renames: e.g. the Presets view now uses a
PresetModel rather than ProjectModel, because we now store presets. A
Preset is a higher level concept than Project / Wizard item: it can be a
project/wizard item with pre-defined configurations; and now we can have
multiple presets using the same Wizard factory. Renamed struct
ProjectCategory to WizardCategory, because the items are grouped by the
category of the wizard (i.e. the "category" property of IWizardFactory)
I extracted a class, PresetData, to hold the data that is being shared
by the PresetModel (items in the view) and the PresetCategoryModel
(header/tab items). It stored both information on normal presets and on
recent presets.
Made changes to JsonWizardFactory so that I could extract the list of
screen sizes without requiring to build a wizard object first. This is
important, because multiple JsonWizard objects cannot be created at the
same time and I need to show the screen sizes of multiple presets /
wizards as the Presets view is opened. This also required class
WizardFactories to use JsonWizardFactory instead of Core::IWizardFactory
-- since "screen sizes" are a particularity of the json wizards, not of
all kinds of wizards.
Also, fixed a TODO in WizardHandler::reset() method.
Also, added a few utilities I had need of, in algorithm.h.
Change-Id: Ifd986e2def19b2e112f0aa1ab3db63d522736321
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2022-01-10 15:48:29 +02:00
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QStringList screenSizes(const WizardCategory &cat)
|
2021-12-14 19:36:48 +02:00
|
|
|
{
|
QDS-5691 Create a tab for Recent choices
The Recents should store presets, rather than normal project items,
while the rest of tabs are to store normal project (i.e. wizard) items
but with the default screen size written under the wizard name.
In this patch I also did a few renames: e.g. the Presets view now uses a
PresetModel rather than ProjectModel, because we now store presets. A
Preset is a higher level concept than Project / Wizard item: it can be a
project/wizard item with pre-defined configurations; and now we can have
multiple presets using the same Wizard factory. Renamed struct
ProjectCategory to WizardCategory, because the items are grouped by the
category of the wizard (i.e. the "category" property of IWizardFactory)
I extracted a class, PresetData, to hold the data that is being shared
by the PresetModel (items in the view) and the PresetCategoryModel
(header/tab items). It stored both information on normal presets and on
recent presets.
Made changes to JsonWizardFactory so that I could extract the list of
screen sizes without requiring to build a wizard object first. This is
important, because multiple JsonWizard objects cannot be created at the
same time and I need to show the screen sizes of multiple presets /
wizards as the Presets view is opened. This also required class
WizardFactories to use JsonWizardFactory instead of Core::IWizardFactory
-- since "screen sizes" are a particularity of the json wizards, not of
all kinds of wizards.
Also, fixed a TODO in WizardHandler::reset() method.
Also, added a few utilities I had need of, in algorithm.h.
Change-Id: Ifd986e2def19b2e112f0aa1ab3db63d522736321
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2022-01-10 15:48:29 +02:00
|
|
|
QStringList result = Utils::transform<QStringList>(cat.items, &PresetItem::screenSizeName);
|
2021-12-14 19:36:48 +02:00
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
QDS-5691 Create a tab for Recent choices
The Recents should store presets, rather than normal project items,
while the rest of tabs are to store normal project (i.e. wizard) items
but with the default screen size written under the wizard name.
In this patch I also did a few renames: e.g. the Presets view now uses a
PresetModel rather than ProjectModel, because we now store presets. A
Preset is a higher level concept than Project / Wizard item: it can be a
project/wizard item with pre-defined configurations; and now we can have
multiple presets using the same Wizard factory. Renamed struct
ProjectCategory to WizardCategory, because the items are grouped by the
category of the wizard (i.e. the "category" property of IWizardFactory)
I extracted a class, PresetData, to hold the data that is being shared
by the PresetModel (items in the view) and the PresetCategoryModel
(header/tab items). It stored both information on normal presets and on
recent presets.
Made changes to JsonWizardFactory so that I could extract the list of
screen sizes without requiring to build a wizard object first. This is
important, because multiple JsonWizard objects cannot be created at the
same time and I need to show the screen sizes of multiple presets /
wizards as the Presets view is opened. This also required class
WizardFactories to use JsonWizardFactory instead of Core::IWizardFactory
-- since "screen sizes" are a particularity of the json wizards, not of
all kinds of wizards.
Also, fixed a TODO in WizardHandler::reset() method.
Also, added a few utilities I had need of, in algorithm.h.
Change-Id: Ifd986e2def19b2e112f0aa1ab3db63d522736321
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2022-01-10 15:48:29 +02:00
|
|
|
QStringList categoryNames(const std::map<QString, WizardCategory> &presets)
|
2021-12-14 19:36:48 +02:00
|
|
|
{
|
QDS-5691 Create a tab for Recent choices
The Recents should store presets, rather than normal project items,
while the rest of tabs are to store normal project (i.e. wizard) items
but with the default screen size written under the wizard name.
In this patch I also did a few renames: e.g. the Presets view now uses a
PresetModel rather than ProjectModel, because we now store presets. A
Preset is a higher level concept than Project / Wizard item: it can be a
project/wizard item with pre-defined configurations; and now we can have
multiple presets using the same Wizard factory. Renamed struct
ProjectCategory to WizardCategory, because the items are grouped by the
category of the wizard (i.e. the "category" property of IWizardFactory)
I extracted a class, PresetData, to hold the data that is being shared
by the PresetModel (items in the view) and the PresetCategoryModel
(header/tab items). It stored both information on normal presets and on
recent presets.
Made changes to JsonWizardFactory so that I could extract the list of
screen sizes without requiring to build a wizard object first. This is
important, because multiple JsonWizard objects cannot be created at the
same time and I need to show the screen sizes of multiple presets /
wizards as the Presets view is opened. This also required class
WizardFactories to use JsonWizardFactory instead of Core::IWizardFactory
-- since "screen sizes" are a particularity of the json wizards, not of
all kinds of wizards.
Also, fixed a TODO in WizardHandler::reset() method.
Also, added a few utilities I had need of, in algorithm.h.
Change-Id: Ifd986e2def19b2e112f0aa1ab3db63d522736321
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2022-01-10 15:48:29 +02:00
|
|
|
const QMap<QString, WizardCategory> qmap{presets};
|
2021-12-14 19:36:48 +02:00
|
|
|
return qmap.keys();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} // namespace
|
|
|
|
|
|
|
|
|
|
/******************* TESTS *******************/
|
|
|
|
|
|
|
|
|
|
TEST_F(QdsWizardFactories, haveEmptyListOfWizardFactories)
|
|
|
|
|
{
|
|
|
|
|
WizardFactories wf = makeWizardFactoriesHandler(
|
|
|
|
|
{/*wizard factories*/},
|
|
|
|
|
/*get wizards supporting platform*/ "platform"
|
|
|
|
|
);
|
|
|
|
|
|
QDS-5691 Create a tab for Recent choices
The Recents should store presets, rather than normal project items,
while the rest of tabs are to store normal project (i.e. wizard) items
but with the default screen size written under the wizard name.
In this patch I also did a few renames: e.g. the Presets view now uses a
PresetModel rather than ProjectModel, because we now store presets. A
Preset is a higher level concept than Project / Wizard item: it can be a
project/wizard item with pre-defined configurations; and now we can have
multiple presets using the same Wizard factory. Renamed struct
ProjectCategory to WizardCategory, because the items are grouped by the
category of the wizard (i.e. the "category" property of IWizardFactory)
I extracted a class, PresetData, to hold the data that is being shared
by the PresetModel (items in the view) and the PresetCategoryModel
(header/tab items). It stored both information on normal presets and on
recent presets.
Made changes to JsonWizardFactory so that I could extract the list of
screen sizes without requiring to build a wizard object first. This is
important, because multiple JsonWizard objects cannot be created at the
same time and I need to show the screen sizes of multiple presets /
wizards as the Presets view is opened. This also required class
WizardFactories to use JsonWizardFactory instead of Core::IWizardFactory
-- since "screen sizes" are a particularity of the json wizards, not of
all kinds of wizards.
Also, fixed a TODO in WizardHandler::reset() method.
Also, added a few utilities I had need of, in algorithm.h.
Change-Id: Ifd986e2def19b2e112f0aa1ab3db63d522736321
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2022-01-10 15:48:29 +02:00
|
|
|
std::map<QString, WizardCategory> presets = wf.presetsGroupedByCategory();
|
2021-12-14 19:36:48 +02:00
|
|
|
|
QDS-5691 Create a tab for Recent choices
The Recents should store presets, rather than normal project items,
while the rest of tabs are to store normal project (i.e. wizard) items
but with the default screen size written under the wizard name.
In this patch I also did a few renames: e.g. the Presets view now uses a
PresetModel rather than ProjectModel, because we now store presets. A
Preset is a higher level concept than Project / Wizard item: it can be a
project/wizard item with pre-defined configurations; and now we can have
multiple presets using the same Wizard factory. Renamed struct
ProjectCategory to WizardCategory, because the items are grouped by the
category of the wizard (i.e. the "category" property of IWizardFactory)
I extracted a class, PresetData, to hold the data that is being shared
by the PresetModel (items in the view) and the PresetCategoryModel
(header/tab items). It stored both information on normal presets and on
recent presets.
Made changes to JsonWizardFactory so that I could extract the list of
screen sizes without requiring to build a wizard object first. This is
important, because multiple JsonWizard objects cannot be created at the
same time and I need to show the screen sizes of multiple presets /
wizards as the Presets view is opened. This also required class
WizardFactories to use JsonWizardFactory instead of Core::IWizardFactory
-- since "screen sizes" are a particularity of the json wizards, not of
all kinds of wizards.
Also, fixed a TODO in WizardHandler::reset() method.
Also, added a few utilities I had need of, in algorithm.h.
Change-Id: Ifd986e2def19b2e112f0aa1ab3db63d522736321
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2022-01-10 15:48:29 +02:00
|
|
|
ASSERT_THAT(presets, IsEmpty());
|
2021-12-14 19:36:48 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TEST_F(QdsWizardFactories, filtersOutNonProjectWizardFactories)
|
|
|
|
|
{
|
|
|
|
|
WizardFactories wf = makeWizardFactoriesHandler(
|
2022-02-08 11:10:52 +01:00
|
|
|
{aWizardFactory(IWizardFactory::FileWizard, {platform, true})},
|
2021-12-14 19:36:48 +02:00
|
|
|
/*get wizards supporting platform*/ platform
|
|
|
|
|
);
|
|
|
|
|
|
QDS-5691 Create a tab for Recent choices
The Recents should store presets, rather than normal project items,
while the rest of tabs are to store normal project (i.e. wizard) items
but with the default screen size written under the wizard name.
In this patch I also did a few renames: e.g. the Presets view now uses a
PresetModel rather than ProjectModel, because we now store presets. A
Preset is a higher level concept than Project / Wizard item: it can be a
project/wizard item with pre-defined configurations; and now we can have
multiple presets using the same Wizard factory. Renamed struct
ProjectCategory to WizardCategory, because the items are grouped by the
category of the wizard (i.e. the "category" property of IWizardFactory)
I extracted a class, PresetData, to hold the data that is being shared
by the PresetModel (items in the view) and the PresetCategoryModel
(header/tab items). It stored both information on normal presets and on
recent presets.
Made changes to JsonWizardFactory so that I could extract the list of
screen sizes without requiring to build a wizard object first. This is
important, because multiple JsonWizard objects cannot be created at the
same time and I need to show the screen sizes of multiple presets /
wizards as the Presets view is opened. This also required class
WizardFactories to use JsonWizardFactory instead of Core::IWizardFactory
-- since "screen sizes" are a particularity of the json wizards, not of
all kinds of wizards.
Also, fixed a TODO in WizardHandler::reset() method.
Also, added a few utilities I had need of, in algorithm.h.
Change-Id: Ifd986e2def19b2e112f0aa1ab3db63d522736321
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2022-01-10 15:48:29 +02:00
|
|
|
std::map<QString, WizardCategory> presets = wf.presetsGroupedByCategory();
|
2021-12-14 19:36:48 +02:00
|
|
|
|
QDS-5691 Create a tab for Recent choices
The Recents should store presets, rather than normal project items,
while the rest of tabs are to store normal project (i.e. wizard) items
but with the default screen size written under the wizard name.
In this patch I also did a few renames: e.g. the Presets view now uses a
PresetModel rather than ProjectModel, because we now store presets. A
Preset is a higher level concept than Project / Wizard item: it can be a
project/wizard item with pre-defined configurations; and now we can have
multiple presets using the same Wizard factory. Renamed struct
ProjectCategory to WizardCategory, because the items are grouped by the
category of the wizard (i.e. the "category" property of IWizardFactory)
I extracted a class, PresetData, to hold the data that is being shared
by the PresetModel (items in the view) and the PresetCategoryModel
(header/tab items). It stored both information on normal presets and on
recent presets.
Made changes to JsonWizardFactory so that I could extract the list of
screen sizes without requiring to build a wizard object first. This is
important, because multiple JsonWizard objects cannot be created at the
same time and I need to show the screen sizes of multiple presets /
wizards as the Presets view is opened. This also required class
WizardFactories to use JsonWizardFactory instead of Core::IWizardFactory
-- since "screen sizes" are a particularity of the json wizards, not of
all kinds of wizards.
Also, fixed a TODO in WizardHandler::reset() method.
Also, added a few utilities I had need of, in algorithm.h.
Change-Id: Ifd986e2def19b2e112f0aa1ab3db63d522736321
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2022-01-10 15:48:29 +02:00
|
|
|
ASSERT_THAT(presets, IsEmpty());
|
2021-12-14 19:36:48 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TEST_F(QdsWizardFactories, filtersOutWizardFactoriesUnavailableForPlatform)
|
|
|
|
|
{
|
|
|
|
|
WizardFactories wf = makeWizardFactoriesHandler(
|
2022-02-08 11:10:52 +01:00
|
|
|
{aWizardFactory(IWizardFactory::ProjectWizard, {"Non-Desktop", false})},
|
2021-12-14 19:36:48 +02:00
|
|
|
/*get wizards supporting platform*/ "Non-Desktop"
|
|
|
|
|
);
|
|
|
|
|
|
QDS-5691 Create a tab for Recent choices
The Recents should store presets, rather than normal project items,
while the rest of tabs are to store normal project (i.e. wizard) items
but with the default screen size written under the wizard name.
In this patch I also did a few renames: e.g. the Presets view now uses a
PresetModel rather than ProjectModel, because we now store presets. A
Preset is a higher level concept than Project / Wizard item: it can be a
project/wizard item with pre-defined configurations; and now we can have
multiple presets using the same Wizard factory. Renamed struct
ProjectCategory to WizardCategory, because the items are grouped by the
category of the wizard (i.e. the "category" property of IWizardFactory)
I extracted a class, PresetData, to hold the data that is being shared
by the PresetModel (items in the view) and the PresetCategoryModel
(header/tab items). It stored both information on normal presets and on
recent presets.
Made changes to JsonWizardFactory so that I could extract the list of
screen sizes without requiring to build a wizard object first. This is
important, because multiple JsonWizard objects cannot be created at the
same time and I need to show the screen sizes of multiple presets /
wizards as the Presets view is opened. This also required class
WizardFactories to use JsonWizardFactory instead of Core::IWizardFactory
-- since "screen sizes" are a particularity of the json wizards, not of
all kinds of wizards.
Also, fixed a TODO in WizardHandler::reset() method.
Also, added a few utilities I had need of, in algorithm.h.
Change-Id: Ifd986e2def19b2e112f0aa1ab3db63d522736321
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2022-01-10 15:48:29 +02:00
|
|
|
std::map<QString, WizardCategory> presets = wf.presetsGroupedByCategory();
|
2021-12-14 19:36:48 +02:00
|
|
|
|
QDS-5691 Create a tab for Recent choices
The Recents should store presets, rather than normal project items,
while the rest of tabs are to store normal project (i.e. wizard) items
but with the default screen size written under the wizard name.
In this patch I also did a few renames: e.g. the Presets view now uses a
PresetModel rather than ProjectModel, because we now store presets. A
Preset is a higher level concept than Project / Wizard item: it can be a
project/wizard item with pre-defined configurations; and now we can have
multiple presets using the same Wizard factory. Renamed struct
ProjectCategory to WizardCategory, because the items are grouped by the
category of the wizard (i.e. the "category" property of IWizardFactory)
I extracted a class, PresetData, to hold the data that is being shared
by the PresetModel (items in the view) and the PresetCategoryModel
(header/tab items). It stored both information on normal presets and on
recent presets.
Made changes to JsonWizardFactory so that I could extract the list of
screen sizes without requiring to build a wizard object first. This is
important, because multiple JsonWizard objects cannot be created at the
same time and I need to show the screen sizes of multiple presets /
wizards as the Presets view is opened. This also required class
WizardFactories to use JsonWizardFactory instead of Core::IWizardFactory
-- since "screen sizes" are a particularity of the json wizards, not of
all kinds of wizards.
Also, fixed a TODO in WizardHandler::reset() method.
Also, added a few utilities I had need of, in algorithm.h.
Change-Id: Ifd986e2def19b2e112f0aa1ab3db63d522736321
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2022-01-10 15:48:29 +02:00
|
|
|
ASSERT_THAT(presets, IsEmpty());
|
2021-12-14 19:36:48 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TEST_F(QdsWizardFactories, doesNotFilterOutAGoodWizardFactory)
|
|
|
|
|
{
|
|
|
|
|
WizardFactories wf = makeWizardFactoriesHandler({aGoodWizardFactory()}, platform);
|
|
|
|
|
|
QDS-5691 Create a tab for Recent choices
The Recents should store presets, rather than normal project items,
while the rest of tabs are to store normal project (i.e. wizard) items
but with the default screen size written under the wizard name.
In this patch I also did a few renames: e.g. the Presets view now uses a
PresetModel rather than ProjectModel, because we now store presets. A
Preset is a higher level concept than Project / Wizard item: it can be a
project/wizard item with pre-defined configurations; and now we can have
multiple presets using the same Wizard factory. Renamed struct
ProjectCategory to WizardCategory, because the items are grouped by the
category of the wizard (i.e. the "category" property of IWizardFactory)
I extracted a class, PresetData, to hold the data that is being shared
by the PresetModel (items in the view) and the PresetCategoryModel
(header/tab items). It stored both information on normal presets and on
recent presets.
Made changes to JsonWizardFactory so that I could extract the list of
screen sizes without requiring to build a wizard object first. This is
important, because multiple JsonWizard objects cannot be created at the
same time and I need to show the screen sizes of multiple presets /
wizards as the Presets view is opened. This also required class
WizardFactories to use JsonWizardFactory instead of Core::IWizardFactory
-- since "screen sizes" are a particularity of the json wizards, not of
all kinds of wizards.
Also, fixed a TODO in WizardHandler::reset() method.
Also, added a few utilities I had need of, in algorithm.h.
Change-Id: Ifd986e2def19b2e112f0aa1ab3db63d522736321
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2022-01-10 15:48:29 +02:00
|
|
|
std::map<QString, WizardCategory> presets = wf.presetsGroupedByCategory();
|
|
|
|
|
|
|
|
|
|
ASSERT_THAT(presets, Not(IsEmpty()));
|
|
|
|
|
}
|
|
|
|
|
|
2022-01-17 18:34:48 +02:00
|
|
|
TEST_F(QdsWizardFactories, buildsPresetItemWithCorrectSizeName)
|
QDS-5691 Create a tab for Recent choices
The Recents should store presets, rather than normal project items,
while the rest of tabs are to store normal project (i.e. wizard) items
but with the default screen size written under the wizard name.
In this patch I also did a few renames: e.g. the Presets view now uses a
PresetModel rather than ProjectModel, because we now store presets. A
Preset is a higher level concept than Project / Wizard item: it can be a
project/wizard item with pre-defined configurations; and now we can have
multiple presets using the same Wizard factory. Renamed struct
ProjectCategory to WizardCategory, because the items are grouped by the
category of the wizard (i.e. the "category" property of IWizardFactory)
I extracted a class, PresetData, to hold the data that is being shared
by the PresetModel (items in the view) and the PresetCategoryModel
(header/tab items). It stored both information on normal presets and on
recent presets.
Made changes to JsonWizardFactory so that I could extract the list of
screen sizes without requiring to build a wizard object first. This is
important, because multiple JsonWizard objects cannot be created at the
same time and I need to show the screen sizes of multiple presets /
wizards as the Presets view is opened. This also required class
WizardFactories to use JsonWizardFactory instead of Core::IWizardFactory
-- since "screen sizes" are a particularity of the json wizards, not of
all kinds of wizards.
Also, fixed a TODO in WizardHandler::reset() method.
Also, added a few utilities I had need of, in algorithm.h.
Change-Id: Ifd986e2def19b2e112f0aa1ab3db63d522736321
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2022-01-10 15:48:29 +02:00
|
|
|
{
|
|
|
|
|
WizardFactories wf = makeWizardFactoriesHandler(
|
|
|
|
|
{
|
|
|
|
|
aGoodWizardFactory("A", "A_id", "A.category", {1, {"size 0", "size 1"}}),
|
|
|
|
|
},
|
|
|
|
|
platform);
|
|
|
|
|
|
|
|
|
|
std::map<QString, WizardCategory> presets = wf.presetsGroupedByCategory();
|
2021-12-14 19:36:48 +02:00
|
|
|
|
QDS-5691 Create a tab for Recent choices
The Recents should store presets, rather than normal project items,
while the rest of tabs are to store normal project (i.e. wizard) items
but with the default screen size written under the wizard name.
In this patch I also did a few renames: e.g. the Presets view now uses a
PresetModel rather than ProjectModel, because we now store presets. A
Preset is a higher level concept than Project / Wizard item: it can be a
project/wizard item with pre-defined configurations; and now we can have
multiple presets using the same Wizard factory. Renamed struct
ProjectCategory to WizardCategory, because the items are grouped by the
category of the wizard (i.e. the "category" property of IWizardFactory)
I extracted a class, PresetData, to hold the data that is being shared
by the PresetModel (items in the view) and the PresetCategoryModel
(header/tab items). It stored both information on normal presets and on
recent presets.
Made changes to JsonWizardFactory so that I could extract the list of
screen sizes without requiring to build a wizard object first. This is
important, because multiple JsonWizard objects cannot be created at the
same time and I need to show the screen sizes of multiple presets /
wizards as the Presets view is opened. This also required class
WizardFactories to use JsonWizardFactory instead of Core::IWizardFactory
-- since "screen sizes" are a particularity of the json wizards, not of
all kinds of wizards.
Also, fixed a TODO in WizardHandler::reset() method.
Also, added a few utilities I had need of, in algorithm.h.
Change-Id: Ifd986e2def19b2e112f0aa1ab3db63d522736321
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2022-01-10 15:48:29 +02:00
|
|
|
ASSERT_THAT(categoryNames(presets), ElementsAreArray({"A.category"}));
|
|
|
|
|
ASSERT_THAT(presetNames(presets["A.category"]), ElementsAreArray({"A"}));
|
|
|
|
|
ASSERT_THAT(screenSizes(presets["A.category"]), ElementsAreArray({"size 1"}));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TEST_F(QdsWizardFactories, whenSizeInfoIsBadBuildsPresetItemWithEmptySizeName)
|
|
|
|
|
{
|
|
|
|
|
WizardFactories wf = makeWizardFactoriesHandler(
|
|
|
|
|
{
|
|
|
|
|
aGoodWizardFactory("A", "A_id", "A.category", {1, {/*empty*/}}),
|
|
|
|
|
},
|
|
|
|
|
platform);
|
|
|
|
|
|
|
|
|
|
std::map<QString, WizardCategory> presets = wf.presetsGroupedByCategory();
|
|
|
|
|
|
|
|
|
|
ASSERT_THAT(categoryNames(presets), ElementsAreArray({"A.category"}));
|
|
|
|
|
ASSERT_THAT(presetNames(presets["A.category"]), ElementsAreArray({"A"}));
|
|
|
|
|
ASSERT_THAT(screenSizes(presets["A.category"]), ElementsAreArray({""}));
|
2021-12-14 19:36:48 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TEST_F(QdsWizardFactories, sortsWizardFactoriesByCategory)
|
|
|
|
|
{
|
|
|
|
|
WizardFactories wf = makeWizardFactoriesHandler(
|
|
|
|
|
{
|
|
|
|
|
aGoodWizardFactory("B", "B_id", "Z.category"),
|
|
|
|
|
aGoodWizardFactory("X", "X_id", "A.category"),
|
|
|
|
|
},
|
|
|
|
|
platform);
|
|
|
|
|
|
QDS-5691 Create a tab for Recent choices
The Recents should store presets, rather than normal project items,
while the rest of tabs are to store normal project (i.e. wizard) items
but with the default screen size written under the wizard name.
In this patch I also did a few renames: e.g. the Presets view now uses a
PresetModel rather than ProjectModel, because we now store presets. A
Preset is a higher level concept than Project / Wizard item: it can be a
project/wizard item with pre-defined configurations; and now we can have
multiple presets using the same Wizard factory. Renamed struct
ProjectCategory to WizardCategory, because the items are grouped by the
category of the wizard (i.e. the "category" property of IWizardFactory)
I extracted a class, PresetData, to hold the data that is being shared
by the PresetModel (items in the view) and the PresetCategoryModel
(header/tab items). It stored both information on normal presets and on
recent presets.
Made changes to JsonWizardFactory so that I could extract the list of
screen sizes without requiring to build a wizard object first. This is
important, because multiple JsonWizard objects cannot be created at the
same time and I need to show the screen sizes of multiple presets /
wizards as the Presets view is opened. This also required class
WizardFactories to use JsonWizardFactory instead of Core::IWizardFactory
-- since "screen sizes" are a particularity of the json wizards, not of
all kinds of wizards.
Also, fixed a TODO in WizardHandler::reset() method.
Also, added a few utilities I had need of, in algorithm.h.
Change-Id: Ifd986e2def19b2e112f0aa1ab3db63d522736321
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2022-01-10 15:48:29 +02:00
|
|
|
std::map<QString, WizardCategory> presets = wf.presetsGroupedByCategory();
|
2021-12-14 19:36:48 +02:00
|
|
|
|
QDS-5691 Create a tab for Recent choices
The Recents should store presets, rather than normal project items,
while the rest of tabs are to store normal project (i.e. wizard) items
but with the default screen size written under the wizard name.
In this patch I also did a few renames: e.g. the Presets view now uses a
PresetModel rather than ProjectModel, because we now store presets. A
Preset is a higher level concept than Project / Wizard item: it can be a
project/wizard item with pre-defined configurations; and now we can have
multiple presets using the same Wizard factory. Renamed struct
ProjectCategory to WizardCategory, because the items are grouped by the
category of the wizard (i.e. the "category" property of IWizardFactory)
I extracted a class, PresetData, to hold the data that is being shared
by the PresetModel (items in the view) and the PresetCategoryModel
(header/tab items). It stored both information on normal presets and on
recent presets.
Made changes to JsonWizardFactory so that I could extract the list of
screen sizes without requiring to build a wizard object first. This is
important, because multiple JsonWizard objects cannot be created at the
same time and I need to show the screen sizes of multiple presets /
wizards as the Presets view is opened. This also required class
WizardFactories to use JsonWizardFactory instead of Core::IWizardFactory
-- since "screen sizes" are a particularity of the json wizards, not of
all kinds of wizards.
Also, fixed a TODO in WizardHandler::reset() method.
Also, added a few utilities I had need of, in algorithm.h.
Change-Id: Ifd986e2def19b2e112f0aa1ab3db63d522736321
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2022-01-10 15:48:29 +02:00
|
|
|
ASSERT_THAT(categoryNames(presets), ElementsAreArray({"A.category", "Z.category"}));
|
|
|
|
|
ASSERT_THAT(presetNames(presets["A.category"]), ElementsAreArray({"X"}));
|
|
|
|
|
ASSERT_THAT(presetNames(presets["Z.category"]), ElementsAreArray({"B"}));
|
2021-12-14 19:36:48 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TEST_F(QdsWizardFactories, sortsWizardFactoriesById)
|
|
|
|
|
{
|
|
|
|
|
WizardFactories wf = makeWizardFactoriesHandler(
|
|
|
|
|
{
|
|
|
|
|
aGoodWizardFactory("B", "Z_id", "category"),
|
|
|
|
|
aGoodWizardFactory("X", "A_id", "category"),
|
|
|
|
|
},
|
|
|
|
|
platform);
|
|
|
|
|
|
QDS-5691 Create a tab for Recent choices
The Recents should store presets, rather than normal project items,
while the rest of tabs are to store normal project (i.e. wizard) items
but with the default screen size written under the wizard name.
In this patch I also did a few renames: e.g. the Presets view now uses a
PresetModel rather than ProjectModel, because we now store presets. A
Preset is a higher level concept than Project / Wizard item: it can be a
project/wizard item with pre-defined configurations; and now we can have
multiple presets using the same Wizard factory. Renamed struct
ProjectCategory to WizardCategory, because the items are grouped by the
category of the wizard (i.e. the "category" property of IWizardFactory)
I extracted a class, PresetData, to hold the data that is being shared
by the PresetModel (items in the view) and the PresetCategoryModel
(header/tab items). It stored both information on normal presets and on
recent presets.
Made changes to JsonWizardFactory so that I could extract the list of
screen sizes without requiring to build a wizard object first. This is
important, because multiple JsonWizard objects cannot be created at the
same time and I need to show the screen sizes of multiple presets /
wizards as the Presets view is opened. This also required class
WizardFactories to use JsonWizardFactory instead of Core::IWizardFactory
-- since "screen sizes" are a particularity of the json wizards, not of
all kinds of wizards.
Also, fixed a TODO in WizardHandler::reset() method.
Also, added a few utilities I had need of, in algorithm.h.
Change-Id: Ifd986e2def19b2e112f0aa1ab3db63d522736321
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2022-01-10 15:48:29 +02:00
|
|
|
std::map<QString, WizardCategory> presets = wf.presetsGroupedByCategory();
|
2021-12-14 19:36:48 +02:00
|
|
|
|
QDS-5691 Create a tab for Recent choices
The Recents should store presets, rather than normal project items,
while the rest of tabs are to store normal project (i.e. wizard) items
but with the default screen size written under the wizard name.
In this patch I also did a few renames: e.g. the Presets view now uses a
PresetModel rather than ProjectModel, because we now store presets. A
Preset is a higher level concept than Project / Wizard item: it can be a
project/wizard item with pre-defined configurations; and now we can have
multiple presets using the same Wizard factory. Renamed struct
ProjectCategory to WizardCategory, because the items are grouped by the
category of the wizard (i.e. the "category" property of IWizardFactory)
I extracted a class, PresetData, to hold the data that is being shared
by the PresetModel (items in the view) and the PresetCategoryModel
(header/tab items). It stored both information on normal presets and on
recent presets.
Made changes to JsonWizardFactory so that I could extract the list of
screen sizes without requiring to build a wizard object first. This is
important, because multiple JsonWizard objects cannot be created at the
same time and I need to show the screen sizes of multiple presets /
wizards as the Presets view is opened. This also required class
WizardFactories to use JsonWizardFactory instead of Core::IWizardFactory
-- since "screen sizes" are a particularity of the json wizards, not of
all kinds of wizards.
Also, fixed a TODO in WizardHandler::reset() method.
Also, added a few utilities I had need of, in algorithm.h.
Change-Id: Ifd986e2def19b2e112f0aa1ab3db63d522736321
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2022-01-10 15:48:29 +02:00
|
|
|
ASSERT_THAT(categoryNames(presets), ElementsAreArray({"category"}));
|
|
|
|
|
ASSERT_THAT(presetNames(presets["category"]), ElementsAreArray({"X", "B"}));
|
2021-12-14 19:36:48 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TEST_F(QdsWizardFactories, groupsWizardFactoriesByCategory)
|
|
|
|
|
{
|
|
|
|
|
WizardFactories wf = makeWizardFactoriesHandler(
|
|
|
|
|
{
|
|
|
|
|
aGoodWizardFactory("C", "C_id", "Z.category"),
|
|
|
|
|
aGoodWizardFactory("B", "B_id", "A.category"),
|
|
|
|
|
aGoodWizardFactory("A", "A_id", "A.category"),
|
|
|
|
|
},
|
|
|
|
|
platform);
|
|
|
|
|
|
QDS-5691 Create a tab for Recent choices
The Recents should store presets, rather than normal project items,
while the rest of tabs are to store normal project (i.e. wizard) items
but with the default screen size written under the wizard name.
In this patch I also did a few renames: e.g. the Presets view now uses a
PresetModel rather than ProjectModel, because we now store presets. A
Preset is a higher level concept than Project / Wizard item: it can be a
project/wizard item with pre-defined configurations; and now we can have
multiple presets using the same Wizard factory. Renamed struct
ProjectCategory to WizardCategory, because the items are grouped by the
category of the wizard (i.e. the "category" property of IWizardFactory)
I extracted a class, PresetData, to hold the data that is being shared
by the PresetModel (items in the view) and the PresetCategoryModel
(header/tab items). It stored both information on normal presets and on
recent presets.
Made changes to JsonWizardFactory so that I could extract the list of
screen sizes without requiring to build a wizard object first. This is
important, because multiple JsonWizard objects cannot be created at the
same time and I need to show the screen sizes of multiple presets /
wizards as the Presets view is opened. This also required class
WizardFactories to use JsonWizardFactory instead of Core::IWizardFactory
-- since "screen sizes" are a particularity of the json wizards, not of
all kinds of wizards.
Also, fixed a TODO in WizardHandler::reset() method.
Also, added a few utilities I had need of, in algorithm.h.
Change-Id: Ifd986e2def19b2e112f0aa1ab3db63d522736321
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2022-01-10 15:48:29 +02:00
|
|
|
std::map<QString, WizardCategory> presets = wf.presetsGroupedByCategory();
|
2021-12-14 19:36:48 +02:00
|
|
|
|
QDS-5691 Create a tab for Recent choices
The Recents should store presets, rather than normal project items,
while the rest of tabs are to store normal project (i.e. wizard) items
but with the default screen size written under the wizard name.
In this patch I also did a few renames: e.g. the Presets view now uses a
PresetModel rather than ProjectModel, because we now store presets. A
Preset is a higher level concept than Project / Wizard item: it can be a
project/wizard item with pre-defined configurations; and now we can have
multiple presets using the same Wizard factory. Renamed struct
ProjectCategory to WizardCategory, because the items are grouped by the
category of the wizard (i.e. the "category" property of IWizardFactory)
I extracted a class, PresetData, to hold the data that is being shared
by the PresetModel (items in the view) and the PresetCategoryModel
(header/tab items). It stored both information on normal presets and on
recent presets.
Made changes to JsonWizardFactory so that I could extract the list of
screen sizes without requiring to build a wizard object first. This is
important, because multiple JsonWizard objects cannot be created at the
same time and I need to show the screen sizes of multiple presets /
wizards as the Presets view is opened. This also required class
WizardFactories to use JsonWizardFactory instead of Core::IWizardFactory
-- since "screen sizes" are a particularity of the json wizards, not of
all kinds of wizards.
Also, fixed a TODO in WizardHandler::reset() method.
Also, added a few utilities I had need of, in algorithm.h.
Change-Id: Ifd986e2def19b2e112f0aa1ab3db63d522736321
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2022-01-10 15:48:29 +02:00
|
|
|
ASSERT_THAT(categoryNames(presets), ElementsAreArray({"A.category", "Z.category"}));
|
|
|
|
|
ASSERT_THAT(presetNames(presets["A.category"]), ElementsAreArray({"A", "B"}));
|
|
|
|
|
ASSERT_THAT(presetNames(presets["Z.category"]), ElementsAreArray({"C"}));
|
2021-12-14 19:36:48 +02:00
|
|
|
}
|
|
|
|
|
|
QDS-5691 Create a tab for Recent choices
The Recents should store presets, rather than normal project items,
while the rest of tabs are to store normal project (i.e. wizard) items
but with the default screen size written under the wizard name.
In this patch I also did a few renames: e.g. the Presets view now uses a
PresetModel rather than ProjectModel, because we now store presets. A
Preset is a higher level concept than Project / Wizard item: it can be a
project/wizard item with pre-defined configurations; and now we can have
multiple presets using the same Wizard factory. Renamed struct
ProjectCategory to WizardCategory, because the items are grouped by the
category of the wizard (i.e. the "category" property of IWizardFactory)
I extracted a class, PresetData, to hold the data that is being shared
by the PresetModel (items in the view) and the PresetCategoryModel
(header/tab items). It stored both information on normal presets and on
recent presets.
Made changes to JsonWizardFactory so that I could extract the list of
screen sizes without requiring to build a wizard object first. This is
important, because multiple JsonWizard objects cannot be created at the
same time and I need to show the screen sizes of multiple presets /
wizards as the Presets view is opened. This also required class
WizardFactories to use JsonWizardFactory instead of Core::IWizardFactory
-- since "screen sizes" are a particularity of the json wizards, not of
all kinds of wizards.
Also, fixed a TODO in WizardHandler::reset() method.
Also, added a few utilities I had need of, in algorithm.h.
Change-Id: Ifd986e2def19b2e112f0aa1ab3db63d522736321
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2022-01-10 15:48:29 +02:00
|
|
|
TEST_F(QdsWizardFactories, createsPresetItemAndCategoryCorrectlyFromWizardFactory)
|
2021-12-14 19:36:48 +02:00
|
|
|
{
|
|
|
|
|
IWizardFactory *source = aGoodWizardFactory("myName", "myId", "myCategoryId");
|
|
|
|
|
|
|
|
|
|
source->setDescription("myDescription");
|
|
|
|
|
source->setDetailsPageQmlPath(":/my/qml/path");
|
|
|
|
|
source->setFontIconName("myFontIconConstantName");
|
|
|
|
|
source->setDisplayCategory("myDisplayCategory");
|
|
|
|
|
|
|
|
|
|
WizardFactories::setIconUnicodeCallback(+[](const QString &name) -> QString {
|
|
|
|
|
return (name == "myFontIconConstantName" ? "\uABCD" : "\0");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
WizardFactories wf = makeWizardFactoriesHandler({source}, platform);
|
|
|
|
|
|
QDS-5691 Create a tab for Recent choices
The Recents should store presets, rather than normal project items,
while the rest of tabs are to store normal project (i.e. wizard) items
but with the default screen size written under the wizard name.
In this patch I also did a few renames: e.g. the Presets view now uses a
PresetModel rather than ProjectModel, because we now store presets. A
Preset is a higher level concept than Project / Wizard item: it can be a
project/wizard item with pre-defined configurations; and now we can have
multiple presets using the same Wizard factory. Renamed struct
ProjectCategory to WizardCategory, because the items are grouped by the
category of the wizard (i.e. the "category" property of IWizardFactory)
I extracted a class, PresetData, to hold the data that is being shared
by the PresetModel (items in the view) and the PresetCategoryModel
(header/tab items). It stored both information on normal presets and on
recent presets.
Made changes to JsonWizardFactory so that I could extract the list of
screen sizes without requiring to build a wizard object first. This is
important, because multiple JsonWizard objects cannot be created at the
same time and I need to show the screen sizes of multiple presets /
wizards as the Presets view is opened. This also required class
WizardFactories to use JsonWizardFactory instead of Core::IWizardFactory
-- since "screen sizes" are a particularity of the json wizards, not of
all kinds of wizards.
Also, fixed a TODO in WizardHandler::reset() method.
Also, added a few utilities I had need of, in algorithm.h.
Change-Id: Ifd986e2def19b2e112f0aa1ab3db63d522736321
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2022-01-10 15:48:29 +02:00
|
|
|
std::map<QString, WizardCategory> presets = wf.presetsGroupedByCategory();
|
2021-12-14 19:36:48 +02:00
|
|
|
|
QDS-5691 Create a tab for Recent choices
The Recents should store presets, rather than normal project items,
while the rest of tabs are to store normal project (i.e. wizard) items
but with the default screen size written under the wizard name.
In this patch I also did a few renames: e.g. the Presets view now uses a
PresetModel rather than ProjectModel, because we now store presets. A
Preset is a higher level concept than Project / Wizard item: it can be a
project/wizard item with pre-defined configurations; and now we can have
multiple presets using the same Wizard factory. Renamed struct
ProjectCategory to WizardCategory, because the items are grouped by the
category of the wizard (i.e. the "category" property of IWizardFactory)
I extracted a class, PresetData, to hold the data that is being shared
by the PresetModel (items in the view) and the PresetCategoryModel
(header/tab items). It stored both information on normal presets and on
recent presets.
Made changes to JsonWizardFactory so that I could extract the list of
screen sizes without requiring to build a wizard object first. This is
important, because multiple JsonWizard objects cannot be created at the
same time and I need to show the screen sizes of multiple presets /
wizards as the Presets view is opened. This also required class
WizardFactories to use JsonWizardFactory instead of Core::IWizardFactory
-- since "screen sizes" are a particularity of the json wizards, not of
all kinds of wizards.
Also, fixed a TODO in WizardHandler::reset() method.
Also, added a few utilities I had need of, in algorithm.h.
Change-Id: Ifd986e2def19b2e112f0aa1ab3db63d522736321
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2022-01-10 15:48:29 +02:00
|
|
|
ASSERT_THAT(categoryNames(presets), ElementsAreArray({"myCategoryId"}));
|
|
|
|
|
ASSERT_THAT(presetNames(presets["myCategoryId"]), ElementsAreArray({"myName"}));
|
2021-12-14 19:36:48 +02:00
|
|
|
|
QDS-5691 Create a tab for Recent choices
The Recents should store presets, rather than normal project items,
while the rest of tabs are to store normal project (i.e. wizard) items
but with the default screen size written under the wizard name.
In this patch I also did a few renames: e.g. the Presets view now uses a
PresetModel rather than ProjectModel, because we now store presets. A
Preset is a higher level concept than Project / Wizard item: it can be a
project/wizard item with pre-defined configurations; and now we can have
multiple presets using the same Wizard factory. Renamed struct
ProjectCategory to WizardCategory, because the items are grouped by the
category of the wizard (i.e. the "category" property of IWizardFactory)
I extracted a class, PresetData, to hold the data that is being shared
by the PresetModel (items in the view) and the PresetCategoryModel
(header/tab items). It stored both information on normal presets and on
recent presets.
Made changes to JsonWizardFactory so that I could extract the list of
screen sizes without requiring to build a wizard object first. This is
important, because multiple JsonWizard objects cannot be created at the
same time and I need to show the screen sizes of multiple presets /
wizards as the Presets view is opened. This also required class
WizardFactories to use JsonWizardFactory instead of Core::IWizardFactory
-- since "screen sizes" are a particularity of the json wizards, not of
all kinds of wizards.
Also, fixed a TODO in WizardHandler::reset() method.
Also, added a few utilities I had need of, in algorithm.h.
Change-Id: Ifd986e2def19b2e112f0aa1ab3db63d522736321
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2022-01-10 15:48:29 +02:00
|
|
|
auto category = presets["myCategoryId"];
|
2021-12-14 19:36:48 +02:00
|
|
|
ASSERT_EQ("myCategoryId", category.id);
|
|
|
|
|
ASSERT_EQ("myDisplayCategory", category.name);
|
|
|
|
|
|
QDS-5691 Create a tab for Recent choices
The Recents should store presets, rather than normal project items,
while the rest of tabs are to store normal project (i.e. wizard) items
but with the default screen size written under the wizard name.
In this patch I also did a few renames: e.g. the Presets view now uses a
PresetModel rather than ProjectModel, because we now store presets. A
Preset is a higher level concept than Project / Wizard item: it can be a
project/wizard item with pre-defined configurations; and now we can have
multiple presets using the same Wizard factory. Renamed struct
ProjectCategory to WizardCategory, because the items are grouped by the
category of the wizard (i.e. the "category" property of IWizardFactory)
I extracted a class, PresetData, to hold the data that is being shared
by the PresetModel (items in the view) and the PresetCategoryModel
(header/tab items). It stored both information on normal presets and on
recent presets.
Made changes to JsonWizardFactory so that I could extract the list of
screen sizes without requiring to build a wizard object first. This is
important, because multiple JsonWizard objects cannot be created at the
same time and I need to show the screen sizes of multiple presets /
wizards as the Presets view is opened. This also required class
WizardFactories to use JsonWizardFactory instead of Core::IWizardFactory
-- since "screen sizes" are a particularity of the json wizards, not of
all kinds of wizards.
Also, fixed a TODO in WizardHandler::reset() method.
Also, added a few utilities I had need of, in algorithm.h.
Change-Id: Ifd986e2def19b2e112f0aa1ab3db63d522736321
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2022-01-10 15:48:29 +02:00
|
|
|
auto presetItem = presets["myCategoryId"].items[0];
|
2022-02-23 15:32:34 +02:00
|
|
|
ASSERT_EQ("myName", presetItem->wizardName);
|
|
|
|
|
ASSERT_EQ("myDescription", presetItem->description);
|
|
|
|
|
ASSERT_EQ("qrc:/my/qml/path", presetItem->qmlPath.toString());
|
|
|
|
|
ASSERT_EQ("\uABCD", presetItem->fontIconCode);
|
2021-12-14 19:36:48 +02:00
|
|
|
}
|
|
|
|
|
|