DiagramDesigner/diagramCavas/include/util/selectorManager.h

43 lines
1.0 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/**
*\file selectorManager.h
*
*\brief 所有的selector管理类,采用单例模式
* 每个cavas实例一个selector根据具体要实现的内容进行创建和选择
*\author by 20241113
*/
#ifndef SELECTORMANAGER_H
#define SELECTORMANAGER_H
#include <QObject>
#include "baseSelector.h"
#include "global.h"
#include "graphicsDataModel/fixedPortsModel.h"
class SelectorManager : public QObject
{
Q_OBJECT
public:
SelectorManager(FixedPortsModel*,QObject *parent = 0);
SelectorManager() = delete;
~SelectorManager();
public:
void setWorkingSelector(SelectorType s) { m_curSelector=s; }
BaseSelector* getWorkingSelector(); //根据操作方式获取selector
void setDrawGraphicsItem(modelStateInfo&);
void setName(const QString&);
public slots:
void onSignal_setWorkingSelector(SelectorType);
private:
SelectorType m_curSelector;
QVector<BaseSelector*> m_vecSelectors;
FixedPortsModel *_graphModel;
};
#endif