diff --git a/src/Gui/Application.cpp b/src/Gui/Application.cpp index abb43d48a3..5757a328f7 100644 --- a/src/Gui/Application.cpp +++ b/src/Gui/Application.cpp @@ -1562,13 +1562,21 @@ QStringList Application::workbenches(void) const QStringList hidden, extra; if (ht != config.end()) { QString items = QString::fromLatin1(ht->second.c_str()); +#if QT_VERSION >= QT_VERSION_CHECK(5,15,0) + hidden = items.split(QLatin1Char(';'), Qt::SkipEmptyParts); +#else hidden = items.split(QLatin1Char(';'), QString::SkipEmptyParts); +#endif if (hidden.isEmpty()) hidden.push_back(QLatin1String("")); } if (et != config.end()) { QString items = QString::fromLatin1(et->second.c_str()); +#if QT_VERSION >= QT_VERSION_CHECK(5,15,0) + extra = items.split(QLatin1Char(';'), Qt::SkipEmptyParts); +#else extra = items.split(QLatin1Char(';'), QString::SkipEmptyParts); +#endif if (extra.isEmpty()) extra.push_back(QLatin1String("")); } diff --git a/src/Gui/CommandView.cpp b/src/Gui/CommandView.cpp index 831ff1e3ca..cf7b024761 100644 --- a/src/Gui/CommandView.cpp +++ b/src/Gui/CommandView.cpp @@ -1863,8 +1863,12 @@ void StdViewScreenShot::activated(int iMsg) // Replace newline escape sequence through '\\n' string to build one big string, // otherwise Python would interpret it as an invalid command. // Python does the decoding for us. +#if QT_VERSION >= QT_VERSION_CHECK(5,15,0) + QStringList lines = comment.split(QLatin1String("\n"), Qt::KeepEmptyParts ); +#else QStringList lines = comment.split(QLatin1String("\n"), QString::KeepEmptyParts ); - comment = lines.join(QLatin1String("\\n")); +#endif + comment = lines.join(QLatin1String("\\n")); doCommand(Gui,"Gui.activeDocument().activeView().saveImage('%s',%d,%d,'%s','%s')", fn.toUtf8().constData(),w,h,background,comment.toUtf8().constData()); } diff --git a/src/Gui/DlgActionsImp.cpp b/src/Gui/DlgActionsImp.cpp index 40a733c462..6e3479d76a 100644 --- a/src/Gui/DlgActionsImp.cpp +++ b/src/Gui/DlgActionsImp.cpp @@ -252,8 +252,12 @@ void DlgCustomActionsImp::on_buttonAddAction_clicked() item->setData(1, Qt::UserRole, actionName); item->setText(1, ui->actionMenu->text()); item->setSizeHint(0, QSize(32, 32)); +#if QT_VERSION >= QT_VERSION_CHECK(5,15,0) + item->setIcon(0, ui->pixmapLabel->pixmap(Qt::ReturnByValue)); +#else if (ui->pixmapLabel->pixmap()) item->setIcon(0, *ui->pixmapLabel->pixmap()); +#endif // Convert input text into utf8 if (!ui->actionWhatsThis->text().isEmpty()) diff --git a/src/Gui/DlgCheckableMessageBox.cpp b/src/Gui/DlgCheckableMessageBox.cpp index 2396f43afc..6920619569 100644 --- a/src/Gui/DlgCheckableMessageBox.cpp +++ b/src/Gui/DlgCheckableMessageBox.cpp @@ -133,9 +133,13 @@ void DlgCheckableMessageBox::setText(const QString &t) QPixmap DlgCheckableMessageBox::iconPixmap() const { +#if QT_VERSION >= QT_VERSION_CHECK(5,15,0) + return m_d->ui.pixmapLabel->pixmap(Qt::ReturnByValue); +#else if (const QPixmap *p = m_d->ui.pixmapLabel->pixmap()) return QPixmap(*p); return QPixmap(); +#endif } void DlgCheckableMessageBox::setIconPixmap(const QPixmap &p) diff --git a/src/Gui/DlgParameterImp.cpp b/src/Gui/DlgParameterImp.cpp index 4fdbf8dcd3..0e49aa38dd 100644 --- a/src/Gui/DlgParameterImp.cpp +++ b/src/Gui/DlgParameterImp.cpp @@ -396,7 +396,11 @@ void DlgParameterImp::onChangeParameterSet(int itemPos) ParameterGrp::handle hGrp = App::GetApplication().GetUserParameter().GetGroup("BaseApp")->GetGroup("Preferences"); hGrp = hGrp->GetGroup("ParameterEditor"); QString path = QString::fromUtf8(hGrp->GetASCII("LastParameterGroup").c_str()); +#if QT_VERSION >= QT_VERSION_CHECK(5,15,0) + QStringList paths = path.split(QLatin1String("."), Qt::SkipEmptyParts); +#else QStringList paths = path.split(QLatin1String("."), QString::SkipEmptyParts); +#endif QTreeWidgetItem* parent = 0; for (int index=0; index < paramGroup->topLevelItemCount() && !paths.empty(); index++) { diff --git a/src/Gui/DlgProjectInformationImp.cpp b/src/Gui/DlgProjectInformationImp.cpp index 844fdfeea0..523560f02b 100644 --- a/src/Gui/DlgProjectInformationImp.cpp +++ b/src/Gui/DlgProjectInformationImp.cpp @@ -92,7 +92,11 @@ DlgProjectInformationImp::DlgProjectInformationImp(App::Document* doc, QWidget* // When saving the text to XML the newlines get lost. So we store also the newlines as '\n'. // See also accept(). QString comment = QString::fromUtf8(doc->Comment.getValue()); +#if QT_VERSION >= QT_VERSION_CHECK(5,15,0) + QStringList lines = comment.split(QLatin1String("\\n"), Qt::KeepEmptyParts); +#else QStringList lines = comment.split(QLatin1String("\\n"), QString::KeepEmptyParts); +#endif QString text = lines.join(QLatin1String("\n")); ui->textEditComment->setPlainText( text ); connect(ui->pushButtonOpenURL, SIGNAL(clicked()),this, SLOT(open_url())); @@ -124,7 +128,11 @@ void DlgProjectInformationImp::accept() // Replace newline escape sequence through '\\n' string QStringList lines = ui->textEditComment->toPlainText().split +#if QT_VERSION >= QT_VERSION_CHECK(5,15,0) + (QLatin1String("\n"), Qt::KeepEmptyParts); +#else (QLatin1String("\n"), QString::KeepEmptyParts); +#endif QString text = lines.join(QLatin1String("\\n")); _doc->Comment.setValue(text.isEmpty() ? "" : text.toUtf8()); diff --git a/src/Gui/DlgWorkbenchesImp.cpp b/src/Gui/DlgWorkbenchesImp.cpp index 7f48436353..850de62cf3 100644 --- a/src/Gui/DlgWorkbenchesImp.cpp +++ b/src/Gui/DlgWorkbenchesImp.cpp @@ -211,7 +211,11 @@ QStringList DlgWorkbenchesImp::load_enabled_workbenches() hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Workbenches"); enabled_wbs = QString::fromStdString(hGrp->GetASCII("Enabled", all_workbenches.toStdString().c_str()).c_str()); +#if QT_VERSION >= QT_VERSION_CHECK(5,15,0) + enabled_wbs_list = enabled_wbs.split(QLatin1String(","), Qt::SkipEmptyParts); +#else enabled_wbs_list = enabled_wbs.split(QLatin1String(","), QString::SkipEmptyParts); +#endif if (enabled_wbs_list.at(0) == all_workbenches) { enabled_wbs_list.removeFirst(); @@ -232,7 +236,11 @@ QStringList DlgWorkbenchesImp::load_disabled_workbenches() hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Workbenches"); disabled_wbs = QString::fromStdString(hGrp->GetASCII("Disabled", "")); +#if QT_VERSION >= QT_VERSION_CHECK(5,15,0) + disabled_wbs_list = disabled_wbs.split(QLatin1String(","), Qt::SkipEmptyParts); +#else disabled_wbs_list = disabled_wbs.split(QLatin1String(","), QString::SkipEmptyParts); +#endif return disabled_wbs_list; } diff --git a/src/Gui/Splashscreen.cpp b/src/Gui/Splashscreen.cpp index 7d8addcb38..c9cb160005 100644 --- a/src/Gui/Splashscreen.cpp +++ b/src/Gui/Splashscreen.cpp @@ -294,7 +294,8 @@ static QString getOperatingSystem() { #if QT_VERSION >= 0x050400 return QSysInfo::prettyProductName(); -#endif + +#else // < 0x050400 #if defined (Q_OS_WIN32) switch(QSysInfo::windowsVersion()) @@ -379,6 +380,8 @@ static QString getOperatingSystem() #else return QString(); #endif + +#endif // >= 0x050400 } static int getWordSizeOfOS() diff --git a/src/Mod/TechDraw/Gui/QGIFace.cpp b/src/Mod/TechDraw/Gui/QGIFace.cpp index e1c1cb9764..74d38fda0c 100644 --- a/src/Mod/TechDraw/Gui/QGIFace.cpp +++ b/src/Mod/TechDraw/Gui/QGIFace.cpp @@ -543,8 +543,8 @@ void QGIFace::buildSvgHatch() m_rect->centerAt(fCenter); r = m_rect->rect(); QByteArray before,after; - before.append(QString::fromStdString(SVGCOLPREFIX + SVGCOLDEFAULT)); - after.append(QString::fromStdString(SVGCOLPREFIX + m_svgCol)); + before = QString::fromStdString(SVGCOLPREFIX + SVGCOLDEFAULT).toUtf8(); + after = QString::fromStdString(SVGCOLPREFIX + m_svgCol).toUtf8(); QByteArray colorXML = m_svgXML.replace(before,after); long int tileCount = 0; for (int iw = 0; iw < int(nw); iw++) { @@ -590,8 +590,8 @@ void QGIFace::buildPixHatch() r = m_rect->rect(); QByteArray before,after; - before.append(QString::fromStdString(SVGCOLPREFIX + SVGCOLDEFAULT)); - after.append(QString::fromStdString(SVGCOLPREFIX + m_svgCol)); + before = QString::fromStdString(SVGCOLPREFIX + SVGCOLDEFAULT).toUtf8(); + after = QString::fromStdString(SVGCOLPREFIX + m_svgCol).toUtf8(); QByteArray colorXML = m_svgXML.replace(before,after); QSvgRenderer renderer; bool success = renderer.load(colorXML);