File indexing completed on 2024-05-05 04:53:51

0001 /*
0002     SPDX-FileCopyrightText: 2017 Nicolas Carion
0003     SPDX-FileCopyrightText: 2022 Julius Künzel <jk.kdedev@smartlab.uber.space>
0004     SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0005 */
0006 
0007 #pragma once
0008 
0009 #include "abstractmodel/abstracttreemodel.hpp"
0010 
0011 /** @brief This class represents a render preset hierarchy to be displayed as a tree
0012  */
0013 class TreeItem;
0014 class ProfileModel;
0015 class RenderPresetTreeModel : public AbstractTreeModel
0016 {
0017     Q_OBJECT
0018 
0019 protected:
0020     explicit RenderPresetTreeModel(QObject *parent = nullptr);
0021 
0022 public:
0023     static std::shared_ptr<RenderPresetTreeModel> construct(QObject *parent);
0024 
0025     void init();
0026 
0027     QVariant data(const QModelIndex &index, int role) const override;
0028 
0029     /** @brief Given a valid QModelIndex, this function retrieves the corresponding preset's name. Returns the empty string if something went wrong */
0030     QString getPreset(const QModelIndex &index) const;
0031 
0032     /** @brief This function returns the model index corresponding to a given @param presetName */
0033     QModelIndex findPreset(const QString &presetName);
0034 };