| 1 |
/* Copyright (c) 2020, Dyssol Development Team. |
| 2 |
* Copyright (c) 2024, DyssolTEC GmbH. |
| 3 |
* All rights reserved. This file is part of Dyssol. See LICENSE file for license information. */ |
| 4 |
|
| 5 |
#pragma once |
| 6 |
|
| 7 |
#include <QListWidget> |
| 8 |
|
| 9 |
class CQtList : public QListWidget |
| 10 |
{ |
| 11 |
Q_OBJECT |
| 12 |
|
| 13 |
public: |
| 14 |
CQtList(QWidget* _parent); |
| 15 |
|
| 16 |
void AddItemEditable(const std::string& _text, const QVariant& _userData = -1); |
| 17 |
|
| 18 |
void InsertItemCheckable(int _row, const QString& _text, bool _checked = false, const QVariant& _userData = -1); |
| 19 |
void InsertItemCheckable(int _row, const std::string& _text, bool _checked = false, const QVariant& _userData = -1); |
| 20 |
void AddItemCheckable(const QString& _text, bool _checked = false, const QVariant& _userData = -1); |
| 21 |
void SetItemChecked(int _row, bool _checked) const; |
| 22 |
bool GetItemChecked(int _row) const; |
| 23 |
|
| 24 |
std::string CurrentItemUserDataStr() const; |
| 25 |
size_t CurrentItemUserDataUInt() const; |
| 26 |
|
| 27 |
void RestoreCurrentRow(int _row); |
| 28 |
|
| 29 |
void focusInEvent(QFocusEvent* _e) override; |
| 30 |
void focusOutEvent(QFocusEvent* _e) override; |
| 31 |
|
| 32 |
signals: |
| 33 |
void GotFocus(); |
| 34 |
void LostFocus(); |
| 35 |
}; |