26 lines
568 B
C++
26 lines
568 B
C++
#pragma once
|
|
#include <QMap>
|
|
#include <QTreeWidget>
|
|
|
|
class SettingsTree : public QTreeWidget
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
explicit SettingsTree(QWidget *parent = nullptr);
|
|
|
|
void loadKeys(const QStringList &keys);
|
|
void setValue(const QString &key, const QString &value);
|
|
|
|
Q_SIGNALS:
|
|
void valueEdited(const QString &key, const QString &value);
|
|
|
|
private slots:
|
|
void onItemChanged(QTreeWidgetItem *item, int column);
|
|
|
|
private:
|
|
QString fullPath(QTreeWidgetItem *item) const;
|
|
|
|
QMap<QString, QTreeWidgetItem *> m_itemMap;
|
|
bool m_loading = false;
|
|
};
|