@@ -57,7 +57,9 @@ DEALINGS IN THE SOFTWARE.
5757# include < QColorDialog>
5858# include < QPainter>
5959# include < QImage>
60- # include < QDesktopWidget>
60+ # if QT_VERSION < 0x060000
61+ # include < QDesktopWidget>
62+ # endif
6163# include < QInputDialog>
6264# include < QDateTime>
6365
@@ -216,7 +218,11 @@ ControlBox::ControlBox(const QCommandLineParser& parser, QWidget *parent)
216218 }
217219
218220 // Make sure the controlbox will fit onto small screens (& resize to sizeHint() for HiDPI screens)
219- QSize sz_target = (qApp->desktop ()->availableGeometry (this )).size ();
221+ # if QT_VERSION < 0x060000
222+ QSize sz_target = (qApp->desktop ()->availableGeometry (this )).size ();
223+ # else
224+ QSize sz_target = qApp->primaryScreen ()->availableGeometry ().size ();
225+ # endif
220226 QSize sz_source = this ->sizeHint ();
221227 if (sz_source.width () > sz_target.width () || sz_source.height () > sz_target.height () ) {
222228 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)
17521758 QMap<QString,QVariant> submap;
17531759
17541760 // Get a QFileInfo associated with the index and display the connection
1755- QFileInfo fi = services_list.at (index).objpath .path ();
1761+ # if QT_VERSION < 0x060000
1762+ QFileInfo fi = services_list.at (index).objpath .path ();
1763+ # else
1764+ QFileInfo fi (services_list.at (index).objpath .path ());
1765+ # endif
17561766 ui.label_details_connection ->setText (tr (" <b>Connection:</b> %1" ).arg (fi.baseName ()) );
17571767
17581768 // Start building the string for the left label
@@ -2094,7 +2104,11 @@ void ControlBox::assembleTabStatus()
20942104 ui.tableWidget_services ->setItem (row, 2 , qtwi02);
20952105
20962106 QTableWidgetItem* qtwi03 = new QTableWidgetItem ();
2097- QFileInfo fi = services_list.at (row).objpath .path ();
2107+ # if QT_VERSION < 0x060000
2108+ QFileInfo fi = services_list.at (row).objpath .path ();
2109+ # else
2110+ QFileInfo fi (services_list.at (row).objpath .path ());
2111+ # endif
20982112 qtwi03->setText (fi.baseName () );
20992113 qtwi03->setTextAlignment (Qt::AlignVCenter|Qt::AlignLeft);
21002114 ui.tableWidget_services ->setItem (row, 3 , qtwi03);
@@ -2345,7 +2359,11 @@ void ControlBox::assembleTabVPN()
23452359 ui.tableWidget_vpn ->setCellWidget (rowcount, 3 , ql03);
23462360
23472361 QLabel* ql04 = new QLabel (ui.tableWidget_vpn );
2348- QFileInfo fi = services_list.at (row).objpath .path ();
2362+ # if QT_VERSION < 0x060000
2363+ QFileInfo fi = services_list.at (row).objpath .path ();
2364+ # else
2365+ QFileInfo fi (services_list.at (row).objpath .path ());
2366+ # endif
23492367 ql04->setText (fi.baseName () );
23502368 ql04->setAlignment (Qt:: AlignCenter);
23512369 ui.tableWidget_vpn ->setCellWidget (rowcount, 4 , ql04);
0 commit comments