File indexing completed on 2024-04-14 05:38:52
0001 /* 0002 KT list view item task header. 0003 -------------------------------------------------------------------- 0004 SPDX-FileCopyrightText: 1999 Gary Meyer <gary@meyer.net> 0005 -------------------------------------------------------------------- 0006 SPDX-License-Identifier: GPL-2.0-or-later 0007 */ 0008 0009 #pragma once 0010 0011 #include "variablesWidget.h" 0012 0013 class CTVariable; 0014 0015 /** 0016 * QTreeWidgetItem with a CTTask. 0017 */ 0018 class VariableWidget : public QTreeWidgetItem 0019 { 0020 public: 0021 /** 0022 * Initialize the list view item and task. 0023 */ 0024 explicit VariableWidget(VariablesWidget *variablesWidget, CTVariable *_ctVariable); 0025 0026 /** 0027 * Refresh from underlying task. 0028 */ 0029 void refresh(); 0030 0031 /* 0032 * Change the status of this variable 0033 */ 0034 void toggleEnable(); 0035 0036 /** 0037 * Get the task. 0038 */ 0039 CTVariable *getCTVariable() const; 0040 0041 private: 0042 /** 0043 * Variable 0044 */ 0045 CTVariable *ctVariable = nullptr; 0046 0047 VariablesWidget *variablesWidget = nullptr; 0048 }; 0049