File indexing completed on 2024-05-12 04:52:51
0001 /* 0002 SPDX-FileCopyrightText: 2019 Jean-Baptiste Mardelle 0003 SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL 0004 */ 0005 0006 #pragma once 0007 0008 #include "abstractparamwidget.hpp" 0009 #include <QWidget> 0010 0011 class QPushButton; 0012 class QToolButton; 0013 class QLabel; 0014 0015 /** @brief This class represents a parameter that requires 0016 the user to choose tick a checkbox 0017 */ 0018 class ClickableLabelParamWidget : public AbstractParamWidget 0019 { 0020 Q_OBJECT 0021 public: 0022 /** @brief Constructor for the widgetComment 0023 @param name String containing the name of the parameter 0024 @param comment Optional string containing the comment associated to the parameter 0025 @param checked Boolean indicating whether the checkbox should initially be checked 0026 @param parent Parent widget 0027 */ 0028 ClickableLabelParamWidget(std::shared_ptr<AssetParameterModel> model, QModelIndex index, QWidget *parent); 0029 0030 /** @brief Returns the current value of the parameter 0031 */ 0032 bool getValue(); 0033 0034 public Q_SLOTS: 0035 /** @brief Toggle the comments on or off 0036 */ 0037 void slotShowComment(bool show) override; 0038 0039 /** @brief refresh the properties to reflect changes in the model 0040 */ 0041 void slotRefresh() override; 0042 0043 private: 0044 QLabel *m_label; 0045 QToolButton *m_tb; 0046 QString m_displayName; 0047 };