多个文件使用全局变量
作者:互联网
目录
1 声明
//A.h
extern QMap<ToolTask, QString> KToolTaskTxt;
2 初始化
全局区域初始化
//A.cpp
QMap<ToolTask, QString> KToolTaskTxt={
{I_ADD_SCREW,"add screw"},
{I_ADD_ARROW,"add arrow"},
{I_ADD_LABEL,"add label"},
{I_MEASURE_LINE,"measure line"},
{I_MEASURE_MULTILINE,"measure multiline"},
{I_MEASURE_ANGLE,"measure angle"},
{I_MEASURE_SQUARE,"measure square"}
};
3 使用
#include "A.h"
标签:文件,KToolTaskTxt,多个,初始化,measure,ADD,add,MEASURE,全局变量 来源: https://blog.csdn.net/a1356467/article/details/115376327