From 3ca7a77672c894e56e20c1e237c37cfa98f16961 Mon Sep 17 00:00:00 2001 From: Ovidiu Mircescu Date: Fri, 7 Aug 2020 16:18:12 +0200 Subject: [PATCH] For qt 5.15 & python 3.8. --- tools/PyConsole/src/PyConsole_Editor.cxx | 9 +++++++++ tools/PyInterp/src/PyInterp_Interp.cxx | 6 ++++++ 2 files changed, 15 insertions(+) diff --git a/tools/PyConsole/src/PyConsole_Editor.cxx b/tools/PyConsole/src/PyConsole_Editor.cxx index 438bdc3dd..82d2f7b9f 100644 --- a/tools/PyConsole/src/PyConsole_Editor.cxx +++ b/tools/PyConsole/src/PyConsole_Editor.cxx @@ -108,6 +108,7 @@ #include #include #include +#include //VSR: uncomment below macro to support unicode text properly in SALOME // current commented out due to regressions @@ -1392,7 +1393,11 @@ bool PyConsole_Editor::dump( const QString& fileName ) if ( file.open( QFile::WriteOnly ) ) { QTextStream out( &file ); for ( int i = 0; i < myHistory.count(); i++ ) { +#if QT_VERSION >= QT_VERSION_CHECK(5,15,0) + out << myHistory[i] << Qt::endl; +#else out << myHistory[i] << endl; +#endif } file.close(); ok = true; @@ -1561,7 +1566,11 @@ void PyConsole_Editor::multilinePaste( const QString& s ) // Split string data to lines QString s2 = s; s2.replace( "\r", "" ); // Windows string format converted to Unix style +#if QT_VERSION >= QT_VERSION_CHECK(5,15,0) + QStringList lst = s2.split( QChar('\n'), Qt::KeepEmptyParts ); +#else QStringList lst = s2.split( QChar('\n'), QString::KeepEmptyParts ); +#endif // Perform the proper paste operation for the first line to handle the case where // something was already there diff --git a/tools/PyInterp/src/PyInterp_Interp.cxx b/tools/PyInterp/src/PyInterp_Interp.cxx index b4bcd5e62..38369cc38 100644 --- a/tools/PyInterp/src/PyInterp_Interp.cxx +++ b/tools/PyInterp/src/PyInterp_Interp.cxx @@ -144,6 +144,12 @@ static PyTypeObject PyStdOut_Type = { 0, /*tp_del*/ 0, /*tp_version_tag*/ 0, /*tp_finalize*/ +#if PY_VERSION_HEX >= 0x03080000 + 0, /*tp_vectorcall*/ +#if PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ +#endif +#endif }; #define PyStdOut_Check(v) ((v)->ob_type == &PyStdOut_Type) -- 2.39.2