2025-09-05 20:54:06 +00:00
|
|
|
#ifndef XTREEWIDGET_H
|
|
|
|
|
#define XTREEWIDGET_H
|
|
|
|
|
|
|
|
|
|
#include <QTreeWidget>
|
|
|
|
|
|
2026-01-12 20:55:41 -05:00
|
|
|
class QTreeWidgetItem;
|
|
|
|
|
|
2025-09-05 20:54:06 +00:00
|
|
|
class XTreeWidget : public QTreeWidget
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
2026-01-01 22:18:51 -05:00
|
|
|
|
2025-09-05 20:54:06 +00:00
|
|
|
public:
|
|
|
|
|
explicit XTreeWidget(QWidget *parent = nullptr);
|
|
|
|
|
|
2026-01-12 20:55:41 -05:00
|
|
|
// Helper methods for batch export
|
|
|
|
|
int countExportableChildren(QTreeWidgetItem* parent) const;
|
|
|
|
|
int countExportableChildrenByType(QTreeWidgetItem* parent, int contentType) const;
|
|
|
|
|
|
2025-09-05 20:54:06 +00:00
|
|
|
signals:
|
2026-01-12 20:55:41 -05:00
|
|
|
void ItemSelected(const QString itemText, QTreeWidgetItem* item);
|
2025-09-05 20:54:06 +00:00
|
|
|
void ItemClosed(const QString itemText);
|
|
|
|
|
void Cleared();
|
|
|
|
|
|
2026-01-12 20:55:41 -05:00
|
|
|
// Export signals
|
|
|
|
|
void exportRequested(const QString& format, QTreeWidgetItem* item);
|
|
|
|
|
void quickExportRequested(QTreeWidgetItem* item);
|
|
|
|
|
void exportDialogRequested(QTreeWidgetItem* item);
|
|
|
|
|
void batchExportRequested(QTreeWidgetItem* parentItem);
|
|
|
|
|
void batchExportByTypeRequested(QTreeWidgetItem* parentItem, int contentType);
|
|
|
|
|
|
2025-09-05 20:54:06 +00:00
|
|
|
protected:
|
|
|
|
|
void ItemSelectionChanged();
|
|
|
|
|
void PrepareContextMenu(const QPoint &pos);
|
|
|
|
|
|
|
|
|
|
private:
|
2026-01-12 20:55:41 -05:00
|
|
|
void prepareInstanceContextMenu(QMenu* menu, QTreeWidgetItem* item);
|
|
|
|
|
void prepareContainerContextMenu(QMenu* menu, QTreeWidgetItem* item);
|
2025-09-05 20:54:06 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif // XTREEWIDGET_H
|