From e628ef9e94c3a1754d9ed2ec52b276d085c8ee4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lie=20Delhaie?= Date: Mon, 25 Oct 2021 22:59:03 +0200 Subject: [PATCH] Update Optimisation for Windows + Add Qt to AboutBox --- Chronos.pro | 14 ++- Chronos.pro.user | 208 ++++++++++++++++++++++++++---- Chronos.pro.user.f1407b1 | 266 +++++++++++++++++++++++++++++++++++++++ sources/mainwindow.cpp | 2 + ui/aboutbox.ui | 22 ++-- 5 files changed, 477 insertions(+), 35 deletions(-) create mode 100644 Chronos.pro.user.f1407b1 diff --git a/Chronos.pro b/Chronos.pro index 1632b66..637b784 100644 --- a/Chronos.pro +++ b/Chronos.pro @@ -9,8 +9,19 @@ win32 { QMAKE_CXXFLAGS_RELEASE -= -O QMAKE_CXXFLAGS_RELEASE -= -O1 QMAKE_CXXFLAGS_RELEASE *= -O2 - + equals(QMAKE_TARGET.arch, arm64) { + message("CPU Architecture : aarch64") + # Add specific arm stuff here + } + equals(QMAKE_TARGET.arch, x86_64) { + message("CPU Architecture : x64") + QMAKE_CXXFLAGS_RELEASE += -favor:INTEL64 + } RC_ICONS = icon.ico + VERSION = 2.0.0.0 + QMAKE_TARGET_COMPANY = "Aurélie Delhaie" + QMAKE_TARGET_PRODUCT = "Chronos" + QMAKE_TARGET_DESCRIPTION = "Chronos" } macx { @@ -25,6 +36,7 @@ macx { message("CPU Architecture : aarch64") QMAKE_CXXFLAGS_RELEASE += -mcpu=apple-a14 } + VERSION = 2.0.0 } # add the desired -O3 if not present, MinGW only diff --git a/Chronos.pro.user b/Chronos.pro.user index 2f32edf..7f2ec76 100644 --- a/Chronos.pro.user +++ b/Chronos.pro.user @@ -1,10 +1,10 @@ - + EnvironmentId - {f1407b1e-b4d5-4aac-ba0d-b38072a0dfb8} + {67c351c8-ac7f-4fbb-b594-e8b60a17310f} ProjectExplorer.Project.ActiveTarget @@ -70,14 +70,16 @@ 0 true - + + -fno-delayed-template-parsing + true Builtin.BuildSystem true true Builtin.DefaultTidyAndClazy - 4 + 8 @@ -89,24 +91,22 @@ ProjectExplorer.Project.Target.0 Desktop - Qt 6.2.0 for macOS - Qt 6.2.0 for macOS - qt.qt6.620.clang_64_kit - 0 + Desktop Qt 6.2.0 MSVC2019 64bit + Desktop Qt 6.2.0 MSVC2019 64bit + qt.qt6.620.win64_msvc2019_64_kit + 1 0 0 0 - /Volumes/Macintosh SSD/sources/Qt/build-Chronos-Qt_6_2_0_for_macOS-Debug - /Volumes/Macintosh SSD/sources/Qt/build-Chronos-Qt_6_2_0_for_macOS-Debug + E:\Qt Projects Sources\build-Chronos-Desktop_Qt_6_2_0_MSVC2019_64bit-Debug + E:/Qt Projects Sources/build-Chronos-Desktop_Qt_6_2_0_MSVC2019_64bit-Debug true QtProjectManager.QMakeBuildStep false - - arm-darwin-generic-mach_o-64bit - + true @@ -137,16 +137,14 @@ 2 - /Volumes/Macintosh SSD/sources/Qt/build-Chronos-Qt_6_2_0_for_macOS-Release - /Volumes/Macintosh SSD/sources/Qt/build-Chronos-Qt_6_2_0_for_macOS-Release + E:\Qt Projects Sources\build-Chronos-Desktop_Qt_6_2_0_MSVC2019_64bit-Release + E:/Qt Projects Sources/build-Chronos-Desktop_Qt_6_2_0_MSVC2019_64bit-Release true QtProjectManager.QMakeBuildStep false - - arm-darwin-generic-mach_o-64bit - + true @@ -179,8 +177,8 @@ 0 - /Volumes/Macintosh SSD/sources/Qt/build-Chronos-Qt_6_2_0_for_macOS-Profile - /Volumes/Macintosh SSD/sources/Qt/build-Chronos-Qt_6_2_0_for_macOS-Profile + E:\Qt Projects Sources\build-Chronos-Desktop_Qt_6_2_0_MSVC2019_64bit-Profile + E:/Qt Projects Sources/build-Chronos-Desktop_Qt_6_2_0_MSVC2019_64bit-Profile true @@ -239,21 +237,183 @@ 2 - Qt4ProjectManager.Qt4RunConfiguration:/Volumes/Macintosh SSD/sources/Qt/Chronos/Chronos.pro - /Volumes/Macintosh SSD/sources/Qt/Chronos/Chronos.pro + Qt4ProjectManager.Qt4RunConfiguration:E:/Qt Projects Sources/Chronos/Chronos.pro + E:/Qt Projects Sources/Chronos/Chronos.pro false true true false true - /Volumes/Macintosh SSD/sources/Qt/build-Chronos-Qt_6_2_0_for_macOS-Release/Chronos.app/Contents/MacOS + E:/Qt Projects Sources/build-Chronos-Desktop_Qt_6_2_0_MSVC2019_64bit-Release + + 1 + + + + ProjectExplorer.Project.Target.1 + + Desktop + Desktop Qt 6.2.0 MSVC2019 ARM64 + Desktop Qt 6.2.0 MSVC2019 ARM64 + qt.qt6.620.win64_msvc2019_arm64_kit + 0 + 0 + 0 + + 0 + E:\Qt Projects Sources\build-Chronos-Desktop_Qt_6_2_0_MSVC2019_ARM64-Debug + E:/Qt Projects Sources/build-Chronos-Desktop_Qt_6_2_0_MSVC2019_ARM64-Debug + + + true + QtProjectManager.QMakeBuildStep + false + + + + true + Qt4ProjectManager.MakeStep + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + clean + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + + Debug + Qt4ProjectManager.Qt4BuildConfiguration + 2 + + + E:\Qt Projects Sources\build-Chronos-Desktop_Qt_6_2_0_MSVC2019_ARM64-Release + E:/Qt Projects Sources/build-Chronos-Desktop_Qt_6_2_0_MSVC2019_ARM64-Release + + + true + QtProjectManager.QMakeBuildStep + false + + + + true + Qt4ProjectManager.MakeStep + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + clean + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + + Release + Qt4ProjectManager.Qt4BuildConfiguration + 0 + 0 + + + 0 + E:\Qt Projects Sources\build-Chronos-Desktop_Qt_6_2_0_MSVC2019_ARM64-Profile + E:/Qt Projects Sources/build-Chronos-Desktop_Qt_6_2_0_MSVC2019_ARM64-Profile + + + true + QtProjectManager.QMakeBuildStep + false + + + + true + Qt4ProjectManager.MakeStep + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + clean + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + + Profile + Qt4ProjectManager.Qt4BuildConfiguration + 0 + 0 + 0 + + 3 + + + 0 + Deploy + Deploy + ProjectExplorer.BuildSteps.Deploy + + 1 + + false + ProjectExplorer.DefaultDeployConfiguration + + 1 + + true + true + true + + 2 + + Qt4ProjectManager.Qt4RunConfiguration:E:/Qt Projects Sources/Chronos/Chronos.pro + E:/Qt Projects Sources/Chronos/Chronos.pro + false + true + true + false + true + E:/Qt Projects Sources/build-Chronos-Desktop_Qt_6_2_0_MSVC2019_ARM64-Debug 1 ProjectExplorer.Project.TargetCount - 1 + 2 ProjectExplorer.Project.Updater.FileVersion diff --git a/Chronos.pro.user.f1407b1 b/Chronos.pro.user.f1407b1 new file mode 100644 index 0000000..2f32edf --- /dev/null +++ b/Chronos.pro.user.f1407b1 @@ -0,0 +1,266 @@ + + + + + + EnvironmentId + {f1407b1e-b4d5-4aac-ba0d-b38072a0dfb8} + + + ProjectExplorer.Project.ActiveTarget + 0 + + + ProjectExplorer.Project.EditorSettings + + true + false + true + + Cpp + + CppGlobal + + + + QmlJS + + QmlJSGlobal + + + 2 + UTF-8 + false + 4 + false + 80 + true + true + 1 + false + true + false + 0 + true + true + 0 + 8 + true + false + 1 + true + true + true + *.md, *.MD, Makefile + false + true + + + + ProjectExplorer.Project.PluginSettings + + + true + false + true + true + true + true + + + 0 + true + + true + Builtin.BuildSystem + + true + true + Builtin.DefaultTidyAndClazy + 4 + + + + true + + + + + ProjectExplorer.Project.Target.0 + + Desktop + Qt 6.2.0 for macOS + Qt 6.2.0 for macOS + qt.qt6.620.clang_64_kit + 0 + 0 + 0 + + 0 + /Volumes/Macintosh SSD/sources/Qt/build-Chronos-Qt_6_2_0_for_macOS-Debug + /Volumes/Macintosh SSD/sources/Qt/build-Chronos-Qt_6_2_0_for_macOS-Debug + + + true + QtProjectManager.QMakeBuildStep + false + + arm-darwin-generic-mach_o-64bit + + + + true + Qt4ProjectManager.MakeStep + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + clean + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + + Debug + Qt4ProjectManager.Qt4BuildConfiguration + 2 + + + /Volumes/Macintosh SSD/sources/Qt/build-Chronos-Qt_6_2_0_for_macOS-Release + /Volumes/Macintosh SSD/sources/Qt/build-Chronos-Qt_6_2_0_for_macOS-Release + + + true + QtProjectManager.QMakeBuildStep + false + + arm-darwin-generic-mach_o-64bit + + + + true + Qt4ProjectManager.MakeStep + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + clean + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + + Release + Qt4ProjectManager.Qt4BuildConfiguration + 0 + 0 + + + 0 + /Volumes/Macintosh SSD/sources/Qt/build-Chronos-Qt_6_2_0_for_macOS-Profile + /Volumes/Macintosh SSD/sources/Qt/build-Chronos-Qt_6_2_0_for_macOS-Profile + + + true + QtProjectManager.QMakeBuildStep + false + + + + true + Qt4ProjectManager.MakeStep + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + clean + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + + Profile + Qt4ProjectManager.Qt4BuildConfiguration + 0 + 0 + 0 + + 3 + + + 0 + Deploy + Deploy + ProjectExplorer.BuildSteps.Deploy + + 1 + + false + ProjectExplorer.DefaultDeployConfiguration + + 1 + + true + true + true + + 2 + + Qt4ProjectManager.Qt4RunConfiguration:/Volumes/Macintosh SSD/sources/Qt/Chronos/Chronos.pro + /Volumes/Macintosh SSD/sources/Qt/Chronos/Chronos.pro + false + true + true + false + true + /Volumes/Macintosh SSD/sources/Qt/build-Chronos-Qt_6_2_0_for_macOS-Release/Chronos.app/Contents/MacOS + + 1 + + + + ProjectExplorer.Project.TargetCount + 1 + + + ProjectExplorer.Project.Updater.FileVersion + 22 + + + Version + 22 + + diff --git a/sources/mainwindow.cpp b/sources/mainwindow.cpp index 841ac01..f00634c 100644 --- a/sources/mainwindow.cpp +++ b/sources/mainwindow.cpp @@ -51,6 +51,7 @@ void MainWindow::init() { Welcome w(week_template); w.exec(); week_template = w.get_result(); + saveLoaded = true; } if (saveLoaded) { set_date_to_now(); @@ -139,6 +140,7 @@ void MainWindow::save_to_file() { f->write(doc.toJson()); f->close(); } + delete f; } void MainWindow::compute_week_number(const QDateTime &dt) { diff --git a/ui/aboutbox.ui b/ui/aboutbox.ui index 6ec0c11..69202c1 100644 --- a/ui/aboutbox.ui +++ b/ui/aboutbox.ui @@ -217,16 +217,18 @@ background-color: qlineargradient(spread:pad, x1:0, y1:1, x2:1, y2:1, stop:0 rgb <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'.AppleSystemUIFont'; font-size:12px; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:10pt;">Application icon: Alexis Delhaie (me)</span></p> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'MS Shell Dlg 2'; font-size:10pt;"><br /></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:10pt;">About box banner: Alexis Delhaie (me)</span></p> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'MS Shell Dlg 2'; font-size:10pt;"><br /></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:10pt;">Clock image: iconsdb, Iconic (MIT License)</span></p> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'MS Shell Dlg 2'; font-size:10pt;"><br /></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:10pt;">Running image: Icons made by </span><a href="https://www.flaticon.com/authors/freepik"><span style=" font-family:'MS Shell Dlg 2'; font-size:10pt; text-decoration: underline; color:#0000ff;">Freepik</span></a><span style=" font-family:'MS Shell Dlg 2'; font-size:10pt;"> from </span><a href="https://www.flaticon.com/"><span style=" font-family:'MS Shell Dlg 2'; font-size:10pt; text-decoration: underline; color:#0000ff;">www.flaticon.com</span></a></p> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'MS Shell Dlg 2'; font-size:10pt; text-decoration: underline; color:#0000ff;"><br /></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:10pt;">Calendar image: Icons made by </span><a href="https://www.flaticon.com/authors/freepik"><span style=" font-family:'MS Shell Dlg 2'; font-size:10pt; text-decoration: underline; color:#0000ff;">Freepik</span></a><span style=" font-family:'MS Shell Dlg 2'; font-size:10pt;"> from </span><a href="https://www.flaticon.com/"><span style=" font-family:'MS Shell Dlg 2'; font-size:10pt; text-decoration: underline; color:#0000ff;">www.flaticon.com</span></a></p></body></html> +</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:12px; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12px;">Qt 6.2.0 : https://www.qt.io/download-open-source</span></p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:10pt;"><br /></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">Application icon: Alexis Delhaie (me)</span></p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:10pt;"><br /></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">About box banner: Alexis Delhaie (me)</span></p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:10pt;"><br /></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">Clock image: iconsdb, Iconic (MIT License)</span></p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:10pt;"><br /></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">Running image: Icons made by </span><a href="https://www.flaticon.com/authors/freepik"><span style=" font-size:10pt; text-decoration: underline; color:#0000ff;">Freepik</span></a><span style=" font-size:10pt;"> from </span><a href="https://www.flaticon.com/"><span style=" font-size:10pt; text-decoration: underline; color:#0000ff;">www.flaticon.com</span></a></p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:10pt; text-decoration: underline; color:#0000ff;"><br /></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">Calendar image: Icons made by </span><a href="https://www.flaticon.com/authors/freepik"><span style=" font-size:10pt; text-decoration: underline; color:#0000ff;">Freepik</span></a><span style=" font-size:10pt;"> from </span><a href="https://www.flaticon.com/"><span style=" font-size:10pt; text-decoration: underline; color:#0000ff;">www.flaticon.com</span></a></p></body></html>