Salome HOME
For qt 5.15 & python 3.8.
authorOvidiu Mircescu <ovidiu.mircescu@edf.fr>
Fri, 7 Aug 2020 14:18:12 +0000 (16:18 +0200)
committerOvidiu Mircescu <ovidiu.mircescu@edf.fr>
Fri, 7 Aug 2020 14:18:12 +0000 (16:18 +0200)
tools/PyConsole/src/PyConsole_Editor.cxx
tools/PyInterp/src/PyInterp_Interp.cxx

index 438bdc3dd750e2ab15c4a49165dfa78af82aed8c..82d2f7b9f5e8ef81ad208736f5c40fa12b0b698e 100644 (file)
 #include <QChar>
 #include <QFileDialog>
 #include <QMessageBox>
+#include <QtGlobal>
 
 //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
index b4bcd5e625a1556259b3f334820a45b6c548dd46..38369cc3840227d44a665e41f93e9054b10a9ac9 100644 (file)
@@ -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)