diff --git a/apps/cmstapp/code/control_box/controlbox.cpp b/apps/cmstapp/code/control_box/controlbox.cpp index 16081a4b..4190bebb 100755 --- a/apps/cmstapp/code/control_box/controlbox.cpp +++ b/apps/cmstapp/code/control_box/controlbox.cpp @@ -57,7 +57,9 @@ DEALINGS IN THE SOFTWARE. # include # include # include -# include +# if QT_VERSION < 0x060000 + # include +# endif # include # include @@ -216,7 +218,11 @@ ControlBox::ControlBox(const QCommandLineParser& parser, QWidget *parent) } // Make sure the controlbox will fit onto small screens (& resize to sizeHint() for HiDPI screens) - QSize sz_target = (qApp->desktop()->availableGeometry(this)).size(); + # if QT_VERSION < 0x060000 + QSize sz_target = (qApp->desktop()->availableGeometry(this)).size(); + # else + QSize sz_target = qApp->primaryScreen()->availableGeometry().size(); + # endif QSize sz_source = this->sizeHint(); if (sz_source.width() > sz_target.width() || sz_source.height() > sz_target.height() ) { sz_source.scale(sz_target.width() - 100, sz_target.height() - 100, Qt::KeepAspectRatio); // keep min. 100 pixels around dialog @@ -1752,7 +1758,11 @@ void ControlBox::getServiceDetails(int index) QMap submap; // Get a QFileInfo associated with the index and display the connection - QFileInfo fi = services_list.at(index).objpath.path(); + # if QT_VERSION < 0x060000 + QFileInfo fi = services_list.at(index).objpath.path(); + # else + QFileInfo fi(services_list.at(index).objpath.path()); + # endif ui.label_details_connection->setText(tr("Connection: %1").arg(fi.baseName()) ); // Start building the string for the left label @@ -2094,7 +2104,11 @@ void ControlBox::assembleTabStatus() ui.tableWidget_services->setItem(row, 2, qtwi02); QTableWidgetItem* qtwi03 = new QTableWidgetItem(); - QFileInfo fi = services_list.at(row).objpath.path(); + # if QT_VERSION < 0x060000 + QFileInfo fi = services_list.at(row).objpath.path(); + # else + QFileInfo fi(services_list.at(row).objpath.path()); + # endif qtwi03->setText(fi.baseName() ); qtwi03->setTextAlignment(Qt::AlignVCenter|Qt::AlignLeft); ui.tableWidget_services->setItem(row, 3, qtwi03); @@ -2345,7 +2359,11 @@ void ControlBox::assembleTabVPN() ui.tableWidget_vpn->setCellWidget(rowcount, 3, ql03); QLabel* ql04 = new QLabel(ui.tableWidget_vpn); - QFileInfo fi = services_list.at(row).objpath.path(); + # if QT_VERSION < 0x060000 + QFileInfo fi = services_list.at(row).objpath.path(); + # else + QFileInfo fi(services_list.at(row).objpath.path()); + # endif ql04->setText(fi.baseName() ); ql04->setAlignment(Qt:: AlignCenter); ui.tableWidget_vpn->setCellWidget(rowcount, 4, ql04); diff --git a/apps/cmstapp/code/main.cpp b/apps/cmstapp/code/main.cpp index 381e0d4c..3123fbcd 100755 --- a/apps/cmstapp/code/main.cpp +++ b/apps/cmstapp/code/main.cpp @@ -54,11 +54,10 @@ void signalhandler(int sig) { int main(int argc, char *argv[]) { - // set core application attributes + +# if QT_VERSION < 0x060000 QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); -// #if QT_VERSION >= 0x050600 -// QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); -// #endif +# endif QApplication::setApplicationName(LONG_NAME); QApplication::setApplicationVersion(VERSION); @@ -169,8 +168,13 @@ int main(int argc, char *argv[]) // Setup translations QTranslator qtTranslator; - qtTranslator.load("qt_" + QLocale::system().name(), - QLibraryInfo::location(QLibraryInfo::TranslationsPath)); + # if QT_VERSION < 0x060000 + qtTranslator.load("qt_" + QLocale::system().name(), + QLibraryInfo::location(QLibraryInfo::TranslationsPath)); + # else + (void) qtTranslator.load("qt_" + QLocale::system().name(), + QLibraryInfo::path(QLibraryInfo::TranslationsPath)); + # endif app.installTranslator(&qtTranslator); QTranslator cmstTranslator; diff --git a/apps/cmstapp/code/vpn_agent/vpnagent_adaptor.h b/apps/cmstapp/code/vpn_agent/vpnagent_adaptor.h index 7255f978..e0e6b4a4 100644 --- a/apps/cmstapp/code/vpn_agent/vpnagent_adaptor.h +++ b/apps/cmstapp/code/vpn_agent/vpnagent_adaptor.h @@ -19,7 +19,9 @@ class QByteArray; template class QList; template class QMap; class QString; -class QStringList; +# if QT_VERSION < 0x060000 + class QStringList; +# endif class QVariant; QT_END_NAMESPACE diff --git a/apps/resource.h b/apps/resource.h index fbb87739..be5668e4 100755 --- a/apps/resource.h +++ b/apps/resource.h @@ -34,7 +34,7 @@ DEALINGS IN THE SOFTWARE. ///////////////////////////////// Program Values /////////////////////// // // Program Info (may be visible, but don't mark for tranalation) -#define VERSION "2022.11.20-1" +#define VERSION "2022.11.20-2" #define RELEASE_DATE "1 May 2022" #define COPYRIGHT_DATE "2013-2022" diff --git a/text/changelog.txt b/text/changelog.txt index 7c3d3a84..a61d8e55 100644 --- a/text/changelog.txt +++ b/text/changelog.txt @@ -2,6 +2,7 @@
Change Log
In Progress
    +
  • Changes to allow compile with QT6 (PR #278 from kitsnotes).
  • Numerous translation updates
  • All columns can be resized in the Technologies windows in the Status tab.