DAWorkbench 0.0.1
DAWorkbench API
载入中...
搜索中...
未找到
DAChartPlotItemFactory.h
1#ifndef DACHARTPLOTITEMFACTORY_H
2#define DACHARTPLOTITEMFACTORY_H
3#include <functional>
4#include <unordered_map>
5#include "qwt_plot_item.h"
6namespace DA
7{
8
13{
14public:
15 using FpItemCreate = std::function< QwtPlotItem*() >;
16public:
18
24 static QwtPlotItem* createItem(int rtti);
25
31 static void registCreateItemFucntion(int rtti, FpItemCreate fp);
32
38 static bool isHaveCreateItemFucntion(int rtti);
39
40private:
41 static QHash< int, DAChartPlotItemFactory::FpItemCreate >& factoryFunctionMap();
42};
43}
44
45#endif // DACHARTPLOTITEMFACTORY_H
针对QwtPlotItem的工厂类
Definition DAChartPlotItemFactory.h:13
static void registCreateItemFucntion(int rtti, FpItemCreate fp)
注册工厂函数
Definition DAChartPlotItemFactory.cpp:63
static bool isHaveCreateItemFucntion(int rtti)
判断是否存在此工厂函数
Definition DAChartPlotItemFactory.cpp:68
static QwtPlotItem * createItem(int rtti)
创建item
Definition DAChartPlotItemFactory.cpp:54
std::function< QwtPlotItem *() > FpItemCreate
函数指针:QwtPlotItem* itemCreate(int rtti);
Definition DAChartPlotItemFactory.h:15
序列化类都是带异常的,使用中需要处理异常
Definition AppMainWindow.cpp:44