update qmake file

This commit is contained in:
Aurélie Delhaie
2021-10-19 22:45:05 +02:00
parent b07b7b69eb
commit 2b95b41257
9 changed files with 66 additions and 22 deletions

BIN
.DS_Store vendored

Binary file not shown.

View File

@@ -1,17 +1,36 @@
QT += core gui QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets greaterThan(QT_MAJOR_VERSION, 5): QT += widgets
CONFIG += c++17 CONFIG += c++17
# remove possible other optimization flags # remove possible other optimization flags
QMAKE_CXXFLAGS_RELEASE -= -O win32 {
QMAKE_CXXFLAGS_RELEASE -= -O1 message("Build for Windows")
QMAKE_CXXFLAGS_RELEASE *= -O2 QMAKE_CXXFLAGS_RELEASE -= -O
QMAKE_CXXFLAGS_RELEASE -= -O1
QMAKE_CXXFLAGS_RELEASE *= -O2
RC_ICONS = icon.ico
}
macx {
message("Build for macOS")
ICON = icon.icns
QMAKE_INFO_PLIST = Info.plist
QMAKE_CXXFLAGS_RELEASE -= -O
QMAKE_CXXFLAGS_RELEASE -= -O1
QMAKE_CXXFLAGS_RELEASE -= -O2
QMAKE_CXXFLAGS_RELEASE *= -O3
equals(QMAKE_APPLE_DEVICE_ARCHS, arm64) {
message("CPU Architecture : aarch64")
QMAKE_CXXFLAGS_RELEASE += -mcpu=apple-a14
}
}
# add the desired -O3 if not present, MinGW only # add the desired -O3 if not present, MinGW only
# QMAKE_CXXFLAGS_RELEASE *= -O3 # QMAKE_CXXFLAGS_RELEASE *= -O3
RC_ICONS = icon.ico
# The following define makes your compiler emit warnings if you use # The following define makes your compiler emit warnings if you use
# any Qt feature that has been marked deprecated (the exact warnings # any Qt feature that has been marked deprecated (the exact warnings

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject> <!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 5.0.2, 2021-10-18T18:56:11. --> <!-- Written by QtCreator 5.0.2, 2021-10-19T22:43:22. -->
<qtcreator> <qtcreator>
<data> <data>
<variable>EnvironmentId</variable> <variable>EnvironmentId</variable>
@@ -144,7 +144,9 @@
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value> <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value> <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
<valuelist type="QVariantList" key="QtProjectManager.QMakeBuildStep.SelectedAbis"/> <valuelist type="QVariantList" key="QtProjectManager.QMakeBuildStep.SelectedAbis">
<value type="QString">arm-darwin-generic-mach_o-64bit</value>
</valuelist>
</valuemap> </valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1"> <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
@@ -244,7 +246,7 @@
<value type="bool" key="RunConfiguration.UseLibrarySearchPath">true</value> <value type="bool" key="RunConfiguration.UseLibrarySearchPath">true</value>
<value type="bool" key="RunConfiguration.UseQmlDebugger">false</value> <value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
<value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value> <value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
<value type="QString" key="RunConfiguration.WorkingDirectory.default">/Volumes/Macintosh SSD/sources/Qt/build-Chronos-Qt_6_2_0_for_macOS-Debug/Chronos.app/Contents/MacOS</value> <value type="QString" key="RunConfiguration.WorkingDirectory.default">/Volumes/Macintosh SSD/sources/Qt/build-Chronos-Qt_6_2_0_for_macOS-Release/Chronos.app/Contents/MacOS</value>
</valuemap> </valuemap>
<value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value> <value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
</valuemap> </valuemap>

24
Info.plist Normal file
View File

@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleExecutable</key>
<string>Chronos</string>
<key>CFBundleIconFile</key>
<string></string>
<key>CFBundleIdentifier</key>
<string>com.aureliedelhaie.Chronos</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>LSMinimumSystemVersion</key>
<string>10.14</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>NSSupportsAutomaticGraphicsSwitching</key>
<true/>
<key>CFBundleIconFile</key>
<string>icon.icns</string>
</dict>
</plist>

BIN
icon.icns Normal file

Binary file not shown.

View File

@@ -11,6 +11,8 @@ AboutBox::AboutBox(QWidget *parent) :
xmin = ui->frame->x(); xmin = ui->frame->x();
ymax = ui->frame->x() + ui->frame->height(); ymax = ui->frame->x() + ui->frame->height();
ymin = ui->frame->y(); ymin = ui->frame->y();
ui->systemLabel->setText(QString("Built on %1 (%2-%3)").arg(QSysInfo::prettyProductName(), QSysInfo::kernelVersion(), QSysInfo::buildCpuArchitecture()));
ui->versionLabel->setText(QString("Version: %1").arg(VERSION));
} }
AboutBox::~AboutBox() AboutBox::~AboutBox()

View File

@@ -1,9 +1,12 @@
#ifndef ABOUTBOX_H #ifndef ABOUTBOX_H
#define ABOUTBOX_H #define ABOUTBOX_H
#define VERSION "2.0.0"
#include <QDialog> #include <QDialog>
#include <QMouseEvent> #include <QMouseEvent>
#include <iostream> #include <iostream>
#include <QSysInfo>
namespace Ui { namespace Ui {
class AboutBox; class AboutBox;

View File

@@ -104,6 +104,10 @@ void MainWindow::open_save() {
delete file; delete file;
QJsonObject obj = QJsonDocument::fromJson(json.toUtf8()).object(); QJsonObject obj = QJsonDocument::fromJson(json.toUtf8()).object();
if (obj[KEY_SAVE_FILE_VERSION] != SAVE_FILE_VERSION) {
panic_dialog("Your save file version does not match the supported version."
" Please update this file and restart the application");
}
week_template = Week::from_json(obj[KEY_TEMPLATE].toObject()); week_template = Week::from_json(obj[KEY_TEMPLATE].toObject());
QJsonArray arr = obj[KEY_YEARS].toArray(); QJsonArray arr = obj[KEY_YEARS].toArray();
foreach (QJsonValue val, arr) { foreach (QJsonValue val, arr) {

View File

@@ -166,32 +166,22 @@ background-color: qlineargradient(spread:pad, x1:0, y1:1, x2:1, y2:1, stop:0 rgb
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QLabel" name="label_2"> <widget class="QLabel" name="versionLabel">
<property name="styleSheet"> <property name="styleSheet">
<string notr="true">font-size: 12px;</string> <string notr="true">font-size: 12px;</string>
</property> </property>
<property name="text"> <property name="text">
<string>Version: 2.0.0</string> <string>Version: ...</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QLabel" name="label_3"> <widget class="QLabel" name="systemLabel">
<property name="styleSheet"> <property name="styleSheet">
<string notr="true">font-size: 12px;</string> <string notr="true">font-size: 12px;</string>
</property> </property>
<property name="text"> <property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Made with Qt&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string> <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;...&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_7">
<property name="styleSheet">
<string notr="true">font-size: 12px;</string>
</property>
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Save Updater: Rust (&lt;a href=&quot;https://github.com/mojitaurelie/chronos-save-updater&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0068da;&quot;&gt;https://github.com/mojitaurelie/chronos-save-updater&lt;/span&gt;&lt;/a&gt;)&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property> </property>
</widget> </widget>
</item> </item>