2017-07-19 23:20:32 +02:00
|
|
|
#pragma once
|
2013-08-09 06:57:18 +02:00
|
|
|
|
|
|
|
#include <QDialog>
|
|
|
|
|
|
|
|
namespace Ui {
|
|
|
|
class lcQEditGroupsDialog;
|
|
|
|
}
|
|
|
|
|
|
|
|
class lcQEditGroupsDialog : public QDialog
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2018-04-17 03:29:42 +02:00
|
|
|
lcQEditGroupsDialog(QWidget* Parent, const QMap<lcPiece*, lcGroup*>& PieceParents, const QMap<lcGroup*, lcGroup*>& GroupParents, lcModel* Model);
|
2013-08-09 06:57:18 +02:00
|
|
|
~lcQEditGroupsDialog();
|
|
|
|
|
2016-08-01 05:44:15 +02:00
|
|
|
QMap<lcPiece*, lcGroup*> mPieceParents;
|
|
|
|
QMap<lcGroup*, lcGroup*> mGroupParents;
|
|
|
|
QList<lcGroup*> mNewGroups;
|
|
|
|
//QList<lcGroup*> mDeletedGroups; // todo: support deleting groups in the edit groups dialog
|
2013-08-09 06:57:18 +02:00
|
|
|
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
PieceRole = Qt::UserRole,
|
2013-12-13 23:27:57 +01:00
|
|
|
GroupRole
|
2013-08-09 06:57:18 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
public slots:
|
2020-03-22 23:44:41 +01:00
|
|
|
void accept() override;
|
|
|
|
void reject() override;
|
2013-08-09 06:57:18 +02:00
|
|
|
void on_newGroup_clicked();
|
2014-11-10 01:06:11 +01:00
|
|
|
void onItemClicked(QTreeWidgetItem* Item, int Column);
|
|
|
|
void onItemDoubleClicked(QTreeWidgetItem* Item, int Column);
|
2013-08-09 06:57:18 +02:00
|
|
|
|
|
|
|
private:
|
|
|
|
Ui::lcQEditGroupsDialog *ui;
|
|
|
|
|
2014-11-10 01:06:11 +01:00
|
|
|
void UpdateParents(QTreeWidgetItem* ParentItem, lcGroup* ParentGroup);
|
|
|
|
void AddChildren(QTreeWidgetItem* ParentItem, lcGroup* ParentGroup);
|
2013-12-13 23:27:57 +01:00
|
|
|
|
2020-03-22 23:44:41 +01:00
|
|
|
void timerEvent(QTimerEvent* Event) override;
|
2013-12-13 23:27:57 +01:00
|
|
|
|
2018-04-17 03:29:42 +02:00
|
|
|
lcModel* mModel;
|
2014-11-10 01:06:11 +01:00
|
|
|
QTreeWidgetItem* mLastItemClicked;
|
|
|
|
bool mEditableDoubleClicked;
|
|
|
|
QBasicTimer mClickTimer;
|
2013-08-09 06:57:18 +02:00
|
|
|
};
|