在工作中遇到多个屏幕显示运行系统时,将当前应用程序通过配置文件指定到某一个屏幕中显示。
配置文件放置到bin/config下,实现代码如下:
//获取当前软件所在屏幕的序号
int currentScreenIndex = 0;
QJsonObject json;
QString strPath = QCoreApplication::applicationDirPath();
QDir dir(strPath);
dir.cd("config/");
QString _strPath = dir.absolutePath() + "/screen.json";
QFile _file(_strPath