leocad/qt/lc_qeditgroupsdialog.h

48 lines
1.1 KiB
C
Raw Permalink Normal View History

#pragma once
2013-08-09 06:57:18 +02:00
#include <QDialog>
namespace Ui {
class lcQEditGroupsDialog;
}
class lcQEditGroupsDialog : public QDialog
{
Q_OBJECT
public:
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,
GroupRole
2013-08-09 06:57:18 +02:00
};
public slots:
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);
void timerEvent(QTimerEvent* Event) override;
lcModel* mModel;
2014-11-10 01:06:11 +01:00
QTreeWidgetItem* mLastItemClicked;
bool mEditableDoubleClicked;
QBasicTimer mClickTimer;
2013-08-09 06:57:18 +02:00
};