You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123 lines
3.5 KiB
C

/**********************************************************************
* @file TreeWidget.h
* @brief
* @author BaGuijun (baguijun@163.com)
* @date 2024-09-04
*********************************************************************/
#ifndef _TreeWidget_H
#define _TreeWidget_H
#include "GUIWidgetAPI.h"
#include <QTreeWidget>
namespace Interface {
class FITKCFDPost3DManager;
class PostGraphObjectManager;
}
namespace GUI
{
/**
* @brief
* @author BaGuijun (baguijun@163.com)
* @date 2024-09-04
*/
class GUIWidgetAPI TreeWidget : public QTreeWidget
{
Q_OBJECT;
public:
/**
* @brief
* @param[i] parent
* @author BaGuijun (baguijun@163.com)
* @date 2024-09-04
*/
TreeWidget(QWidget* parent = nullptr);
/**
* @brief
* @author BaGuijun (baguijun@163.com)
* @date 2024-09-04
*/
~TreeWidget();
/**
* @brief
* @author BaGuijun (baguijun@163.com)
* @date 2024-09-06
*/
void updateTree();
/**
* @brief id
* @return int id
* @author BaGuijun (baguijun@163.com)
* @date 2024-09-14
*/
int getCurrentDataID();
private slots:
;
/**
* @brief
* @param[i] item
* @param[i] row
* @author BaGuijun (baguijun@163.com)
* @date 2024-09-04
*/
void slotItemClecked(QTreeWidgetItem* item, int index);
/**
* @brief
* @param[i] point
* @author BaGuijun (baguijun@163.com)
* @date 2024-09-07
*/
void onModelCustomContextMenu(QPoint point);
/**
* @brief
* @author BaGuijun (baguijun@163.com)
* @date 2024-09-07
*/
void slotAcitonClicked();
private:
/**
* @brief action
* @param[i] menu Qmenu
* @param[i] actions action
* @param[i] objectName action
* @param[i] isEnable action
* @author BaGuijun (baguijun@163.com)
* @date 2024-09-07
*/
void addMenuActions(QMenu& menu, QString actions, QString objectName, bool isEnable = true);
private:
/**
* @brief
* @author BaGuijun (baguijun@163.com)
* @date 2024-09-04
*/
QTreeWidgetItem* _rootItem = nullptr;
/**
* @brief id
* @author BaGuijun (baguijun@163.com)
* @date 2024-09-09
*/
int _currentObjID = -1;
/**
* @brief
* @author BaGuijun (baguijun@163.com)
* @date 2024-09-06
*/
Interface::FITKCFDPost3DManager* _postDataManager = nullptr;
/**
* @brief
* @author BaGuijun (baguijun@163.com)
* @date 2024-10-08
*/
Interface::PostGraphObjectManager* _postGraphManager = nullptr;
/**
* @brief
* @author BaGuijun (baguijun@163.com)
* @date 2024-10-08
*/
QHash<int, QTreeWidgetItem*> _itemHash = {};
};
}
#endif