QT6: No Qt::AA_EnableHighDpiScaling in QT6

This commit is contained in:
Simon De Backer
2020-10-03 16:08:55 +02:00
parent 9a915c2ad0
commit 9f3c173b9f

View File

@@ -1,17 +1,17 @@
/* /*
Copyright 2006-2020 The QElectroTech Team Copyright 2006-2020 The QElectroTech Team
This file is part of QElectroTech. This file is part of QElectroTech.
QElectroTech is free software: you can redistribute it and/or modify QElectroTech is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or the Free Software Foundation, either version 2 of the License, or
(at your option) any later version. (at your option) any later version.
QElectroTech is distributed in the hope that it will be useful, QElectroTech is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>. along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
*/ */
@@ -30,8 +30,8 @@
@param msg : Message @param msg : Message
*/ */
void myMessageOutput(QtMsgType type, void myMessageOutput(QtMsgType type,
const QMessageLogContext &context, const QMessageLogContext &context,
const QString &msg) const QString &msg)
{ {
QString txt=QTime::currentTime().toString("hh:mm:ss.zzz"); QString txt=QTime::currentTime().toString("hh:mm:ss.zzz");
@@ -110,8 +110,8 @@ void myMessageOutput(QtMsgType type,
txt+=")\n"; txt+=")\n";
} }
QFile outFile(QETApp::configDir() QFile outFile(QETApp::configDir()
+QDate::currentDate().toString("yyyyMMdd") +QDate::currentDate().toString("yyyyMMdd")
+".log"); +".log");
if(outFile.open(QIODevice::WriteOnly | QIODevice::Append)) if(outFile.open(QIODevice::WriteOnly | QIODevice::Append))
{ {
QTextStream ts(&outFile); QTextStream ts(&outFile);
@@ -166,7 +166,13 @@ int main(int argc, char **argv)
QCoreApplication::setApplicationName("QElectroTech"); QCoreApplication::setApplicationName("QElectroTech");
//Creation and execution of the application //Creation and execution of the application
//HighDPI //HighDPI
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) // ### Qt 6: remove
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
#else
#if TODO_LIST
#pragma message("@TODO remove code for QT 6 or later")
#endif
#endif
SingleApplication app(argc, argv, true); SingleApplication app(argc, argv, true);
#ifdef Q_OS_MACOS #ifdef Q_OS_MACOS
//Handle the opening of QET when user double click on a .qet .elmt .tbt file //Handle the opening of QET when user double click on a .qet .elmt .tbt file