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.
AppFlow/OperatorsModel/OperManagerBase.cpp

58 lines
1.8 KiB
C++

#include "OperManagerBase.h"
#include "GUIFrame/MainWindow.h"
#include "FITK_Kernel/FITKAppFramework/FITKAppFramework.h"
#include "FITK_Kernel/FITKAppFramework/FITKGlobalData.h"
#include "FITK_Kernel/FITKCore/FITKAbstractNDataObject.h"
namespace ModelOper
{
/**
* @brief OperManagerBase
*
* OperManagerBaseFITKAPPGUI::MainWindow_mainWindow
*
* @param args
*/
OperManagerBase::OperManagerBase(/* args */)
{
_mainWindow = dynamic_cast<GUI::MainWindow *>(FITKAPP->getGlobalData()->getMainWindow());
}
/**
* @brief OperManagerBase
*
* OperManagerBase
*/
OperManagerBase::~OperManagerBase()
{
}
void OperManagerBase::preArgs()
{
if (_emitter == nullptr)return;
auto current = _emitter;
_senderName = current->objectName();
QString name = _senderName.toLower();
// 根据对象名称后缀确定操作类型
if (name.contains("create")) {
_operType = Create;
}
else if (name.contains("edit")) {
_operType = Edit;
}
else if (name.contains("rename")){
_operType = Rename;
}
else if (name.contains("copy")){
_operType = Copy;
}
else if (name.contains("delete")){
_operType = Delete;
}
else if (name.contains("select")) {
_operType = Select;
}
}
} // namespace ModelOper