]> git.lyx.org Git - features.git/blobdiff - src/frontends/qt/GuiPrefs.cpp
Allow compiling with Qt6
[features.git] / src / frontends / qt / GuiPrefs.cpp
index b4af5589d9909c8d95a1cf2ae29a75af805b147f..7537ead04820af5627a2931f0ab8eb1347082d05 100644 (file)
@@ -188,7 +188,11 @@ QString browseRelToSub(QString const & filename, QString const & relpath,
                toqstr(makeRelPath(qstring_to_ucs4(outname), qstring_to_ucs4(relpath)));
 
        QString testname = reloutname;
+#if QT_VERSION < 0x060000
        testname.remove(QRegExp("^(\\.\\./)+"));
+#else
+       testname.remove(QRegularExpression("^(\\.\\./)+"));
+#endif
 
        if (testname.contains("/"))
                return outname;
@@ -2424,7 +2428,11 @@ PrefLanguage::PrefLanguage(GuiPreferences * form)
        startCommandED->setValidator(new NoNewLineValidator(startCommandED));
        endCommandED->setValidator(new NoNewLineValidator(endCommandED));
 
+#if QT_VERSION < 0x060000
        defaultDecimalSepED->setValidator(new QRegExpValidator(QRegExp("\\S"), this));
+#else
+       defaultDecimalSepED->setValidator(new QRegularExpressionValidator(QRegularExpression("\\S"), this));
+#endif
        defaultDecimalSepED->setMaxLength(1);
 
        defaultLengthUnitCO->addItem(lyx::qt_(unit_name_gui[Length::CM]), Length::CM);
@@ -2453,6 +2461,9 @@ PrefLanguage::PrefLanguage(GuiPreferences * form)
                                      index.data(Qt::UserRole).toString());
        }
        uiLanguageCO->blockSignals(false);
+
+       // FIXME: restore this when it works (see discussion in #6450).
+       respectOSkbdCB->hide();
 }
 
 
@@ -2581,9 +2592,12 @@ PrefUserInterface::PrefUserInterface(GuiPreferences * form)
        iconSetCO->addItem(qt_("Classic"), "classic");
        iconSetCO->addItem(qt_("Oxygen"), "oxygen");
 
-#if (!(defined Q_WS_X11 || defined(QPA_XCB)) || QT_VERSION < 0x040600)
-       useSystemThemeIconsCB->hide();
+#if QT_VERSION >= 0x040600
+       if (guiApp->platformName() != "qt4x11"
+           && guiApp->platformName() != "xcb"
+           && !guiApp->platformName().contains("wayland"))
 #endif
+               useSystemThemeIconsCB->hide();
 }