mirror of
https://github.com/zhuzichu520/FluentUI.git
synced 2024-11-26 13:27:05 +08:00
update
This commit is contained in:
parent
c048336de1
commit
cbe26ce4cd
@ -25,8 +25,8 @@ DisableProgramGroupPage=yes
|
||||
;PrivilegesRequired=lowest
|
||||
OutputDir=.\
|
||||
OutputBaseFilename=installer
|
||||
Compression=lzma
|
||||
SolidCompression=yes
|
||||
Compression=zip
|
||||
SolidCompression=no
|
||||
WizardStyle=modern
|
||||
|
||||
[Languages]
|
||||
|
@ -10,7 +10,7 @@ import "qrc:///example/qml/component"
|
||||
FluContentPage{
|
||||
|
||||
title:"Http"
|
||||
property string cacheDirPath: FluTools.getApplicationDirPath() + "/cache/http"
|
||||
property string cacheDirPath: StandardPaths.writableLocation(StandardPaths.AppLocalDataLocation) + "/cache/http"
|
||||
property bool isDownCompleted: false
|
||||
|
||||
FluHttp{
|
||||
|
@ -3,6 +3,7 @@ import QtQuick.Layouts
|
||||
import QtQuick.Window
|
||||
import QtQuick.Controls
|
||||
import FluentUI
|
||||
import Qt.labs.platform
|
||||
import "qrc:///example/qml/component"
|
||||
|
||||
FluScrollablePage{
|
||||
@ -47,7 +48,7 @@ FluScrollablePage{
|
||||
FluScreenshot{
|
||||
id:screenshot
|
||||
captrueMode: FluScreenshotType.File
|
||||
saveFolder: FluTools.getApplicationDirPath()+"/screenshot"
|
||||
saveFolder: StandardPaths.writableLocation(StandardPaths.AppLocalDataLocation)+"/screenshot"
|
||||
onCaptrueCompleted:
|
||||
(captrue)=>{
|
||||
image.source = captrue
|
||||
|
@ -11,7 +11,7 @@ import "../component"
|
||||
FluContentPage{
|
||||
|
||||
title:"Http"
|
||||
property string cacheDirPath: FluTools.getApplicationDirPath() + "/cache/http"
|
||||
property string cacheDirPath: StandardPaths.writableLocation(StandardPaths.AppLocalDataLocation) + "/cache/http"
|
||||
property bool isDownCompleted: false
|
||||
|
||||
FluHttp{
|
||||
|
@ -3,6 +3,7 @@ import QtQuick.Layouts 1.15
|
||||
import QtQuick.Window 2.15
|
||||
import QtQuick.Controls 2.15
|
||||
import FluentUI 1.0
|
||||
import Qt.labs.platform 1.0
|
||||
import "qrc:///example/qml/component"
|
||||
import "../component"
|
||||
|
||||
@ -48,7 +49,7 @@ FluScrollablePage{
|
||||
FluScreenshot{
|
||||
id:screenshot
|
||||
captrueMode: FluScreenshotType.File
|
||||
saveFolder: FluTools.getApplicationDirPath()+"/screenshot"
|
||||
saveFolder: StandardPaths.writableLocation(StandardPaths.AppLocalDataLocation)+"/screenshot"
|
||||
onCaptrueCompleted:
|
||||
(captrue)=>{
|
||||
image.source = captrue
|
||||
|
@ -1,6 +1,7 @@
|
||||
#include "SettingsHelper.h"
|
||||
|
||||
#include <QDataStream>
|
||||
#include <QStandardPaths>
|
||||
|
||||
SettingsHelper::SettingsHelper(QObject *parent) : QObject(parent)
|
||||
{
|
||||
@ -34,7 +35,7 @@ void SettingsHelper::init(char *argv[]){
|
||||
auto applicationPath = QString::fromStdString(argv[0]);
|
||||
const QFileInfo fileInfo(applicationPath);
|
||||
const QString iniFileName = fileInfo.completeBaseName() + ".ini";
|
||||
const QString iniFilePath = fileInfo.dir().path() + "/" + iniFileName;
|
||||
const QString iniFilePath = QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation) + "/" + iniFileName;
|
||||
qDebug()<<"Application configuration file path->"<<iniFilePath;
|
||||
m_settings.reset(new QSettings(iniFilePath, QSettings::IniFormat));
|
||||
}
|
||||
|
@ -27,7 +27,6 @@ FRAMELESSHELPER_USE_NAMESPACE
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
SettingsHelper::getInstance()->init(argv);
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||
QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
|
||||
QGuiApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
|
||||
@ -40,6 +39,7 @@ int main(int argc, char *argv[])
|
||||
QGuiApplication::setOrganizationName("ZhuZiChu");
|
||||
QGuiApplication::setOrganizationDomain("https://zhuzichu520.github.io");
|
||||
QGuiApplication::setApplicationName("FluentUI");
|
||||
SettingsHelper::getInstance()->init(argv);
|
||||
if(SettingsHelper::getInstance()->getReander()=="software"){
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
|
||||
QQuickWindow::setGraphicsApi(QSGRendererInterface::Software);
|
||||
|
@ -527,11 +527,12 @@ bool FluHttp::cacheExists(const QString& httpId){
|
||||
}
|
||||
|
||||
QString FluHttp::getCacheFilePath(const QString& httpId){
|
||||
QDir dir = _cacheDir;
|
||||
if (!dir.exists(_cacheDir)){
|
||||
dir.mkpath(_cacheDir);
|
||||
QString path = FluTools::getInstance()->toLocalPath(QUrl(_cacheDir));
|
||||
QDir dir = path;
|
||||
if (!dir.exists(path)){
|
||||
dir.mkpath(path);
|
||||
}
|
||||
auto filePath = _cacheDir+"/"+httpId;
|
||||
auto filePath = path+"/"+httpId;
|
||||
return filePath;
|
||||
}
|
||||
|
||||
|
@ -48,7 +48,7 @@ Item{
|
||||
captureMode:control.captrueMode
|
||||
saveFolder: {
|
||||
if(typeof control.saveFolder === 'string'){
|
||||
return control.saveFolder
|
||||
return FluTools.toLocalPath(Qt.resolvedUrl(control.saveFolder))
|
||||
}else{
|
||||
return FluTools.toLocalPath(control.saveFolder)
|
||||
}
|
||||
|
@ -48,7 +48,7 @@ Item{
|
||||
captureMode:control.captrueMode
|
||||
saveFolder: {
|
||||
if(typeof control.saveFolder === 'string'){
|
||||
return control.saveFolder
|
||||
return FluTools.toLocalPath(Qt.resolvedUrl(control.saveFolder))
|
||||
}else{
|
||||
return FluTools.toLocalPath(control.saveFolder)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user