1
0
mirror of https://gitee.com/drabel/LibQQt.git synced 2025-01-04 10:18:44 +08:00

update application workroot settings

This commit is contained in:
tianduanrui 2020-04-09 13:58:53 +08:00
parent 8bc3fd5811
commit d1f8b28c30
2 changed files with 9 additions and 9 deletions

View File

@ -171,17 +171,17 @@ void QQtApplication::setHighDpiScaling ( bool open )
#endif
}
void QQtApplication::setWorkRoot ( const QString workroot )
void QQtApplication::setWorkRoot ( const QString& workroot )
{
QDir::setCurrent ( workroot );
}
const QString QQtApplication::getWorkRoot()
QString QQtApplication::getWorkRoot()
{
return QDir::currentPath();
}
const QString QQtApplication::getStartingWorkRoot()
const QString& QQtApplication::getStartingWorkRoot() const
{
return startWorkRoot;
}

View File

@ -1,4 +1,4 @@
#ifndef QQTAPPLICATION_H
#ifndef QQTAPPLICATION_H
#define QQTAPPLICATION_H
#include <QApplication>
@ -39,15 +39,15 @@ public:
static void setHighDpiScaling ( bool open = true );
//设置工作目录
void setWorkRoot ( const QString workroot );
void setWorkRoot ( const QString& workroot );
//获取工作目录 总是跟随用户设置改变
const QString getWorkRoot();
//获取工作目录 总是跟随用户设置改变 $(pwd)或者%CD%
QString getWorkRoot();
//QQtApplication把启动目录强制切换到了应用程序所在目录如果用户需要更改回去那么自己切换到这个目录即可。
//获取启动时目录 $(pwd)或者%CD%
//获取启动时目录
//这个值是固定不变的。
const QString getStartingWorkRoot();
const QString& getStartingWorkRoot() const;
//这两个函数和MFC架构里的那两个函数一样的功能但是Qt提供了main函数里的更好的窗口启动方法所以这里不实现。
virtual int initInstance() { return 0; }