Qt5: fix deprecation warnings for Qt 5.15

+ QByteArray::append is deprecated
+ QPixmap* QLabel::pixmap() is deprecated
+ overloaded version of QString::split is deprecated
+ QSysInfo::windowsVersion()/QSysInfo::MacVersion() is deprecated
This commit is contained in:
wmayer
2020-10-18 13:57:39 +02:00
parent 34f4b712d8
commit 2057e151d8
9 changed files with 49 additions and 6 deletions

View File

@@ -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());
}