Files
qt-creator/src/plugins/qtsupport/examplesparser.h
Eike Ziller c43a2ee1c4 Use categories for Tutorials page
Instead of adding the category into the title with "Help: ..." etc, use
the actual categorized view that we already use for examples and
marketplace. Set the corresponding meta data in the manifest file and
read it also for tutorials.

Change-Id: Id9081518c1c0afee8d080af3ca8a5dca5cdde775
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-07-14 09:33:03 +00:00

56 lines
1.7 KiB
C++

// Copyright (C) 2023 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#pragma once
#include "qtsupport_global.h"
#include <coreplugin/welcomepagehelper.h>
#include <utils/expected.h>
#include <utils/filepath.h>
namespace QtSupport::Internal {
enum InstructionalType { Example = 0, Demo, Tutorial };
class QTSUPPORT_TEST_EXPORT ExampleItem : public Core::ListItem
{
public:
Utils::FilePath projectPath;
QString docUrl;
Utils::FilePaths filesToOpen;
Utils::FilePath mainFile; /* file to be visible after opening filesToOpen */
Utils::FilePaths dependencies;
InstructionalType type;
bool hasSourceCode = false;
bool isVideo = false;
bool isHighlighted = false;
QString videoUrl;
QString videoLength;
QStringList platforms;
QHash<QString, QStringList> metaData;
};
QTSUPPORT_TEST_EXPORT Utils::expected_str<QList<ExampleItem *>> parseExamples(
const Utils::FilePath &manifest,
const Utils::FilePath &examplesInstallPath,
const Utils::FilePath &demosInstallPath,
bool examples);
QTSUPPORT_TEST_EXPORT Utils::expected_str<QList<ExampleItem *>> parseExamples(
const QByteArray &manifestData,
const Utils::FilePath &manifestPath,
const Utils::FilePath &examplesInstallPath,
const Utils::FilePath &demosInstallPath,
bool examples);
QTSUPPORT_TEST_EXPORT QList<std::pair<Core::Section, QList<ExampleItem *>>> getCategories(
const QList<ExampleItem *> &items,
bool sortIntoCategories,
const QStringList &defaultOrder,
bool restrictRows);
} // namespace QtSupport::Internal
Q_DECLARE_METATYPE(QtSupport::Internal::ExampleItem *)