summaryrefslogtreecommitdiffstats
path: root/sources/pyside2
diff options
context:
space:
mode:
Diffstat (limited to 'sources/pyside2')
-rw-r--r--sources/pyside2/PySide2/QtPrintSupport/typesystem_printsupport.xml.in1
-rw-r--r--sources/pyside2/PySide2/QtPrintSupport/typesystem_printsupport_common.xml1
-rw-r--r--sources/pyside2/PySide2/glue/qtcore.cpp5
-rw-r--r--sources/pyside2/doc/codesnippets/examples/dialogs/standarddialogs/dialog.cpp24
-rw-r--r--sources/pyside2/tests/QtCore/qslot_object_test.py14
5 files changed, 20 insertions, 25 deletions
diff --git a/sources/pyside2/PySide2/QtPrintSupport/typesystem_printsupport.xml.in b/sources/pyside2/PySide2/QtPrintSupport/typesystem_printsupport.xml.in
index 7949b2da..ff078d19 100644
--- a/sources/pyside2/PySide2/QtPrintSupport/typesystem_printsupport.xml.in
+++ b/sources/pyside2/PySide2/QtPrintSupport/typesystem_printsupport.xml.in
@@ -40,7 +40,6 @@
****************************************************************************/
-->
<typesystem package="PySide2.QtPrintSupport">
- <load-typesystem name="QtGui/typesystem_gui.xml" generate="no"/>
<load-typesystem name="QtWidgets/typesystem_widgets.xml" generate="no"/>
<load-typesystem name="QtPrintSupport/typesystem_printsupport_common.xml" generate="yes"/>
</typesystem>
diff --git a/sources/pyside2/PySide2/QtPrintSupport/typesystem_printsupport_common.xml b/sources/pyside2/PySide2/QtPrintSupport/typesystem_printsupport_common.xml
index c11a6e04..48710387 100644
--- a/sources/pyside2/PySide2/QtPrintSupport/typesystem_printsupport_common.xml
+++ b/sources/pyside2/PySide2/QtPrintSupport/typesystem_printsupport_common.xml
@@ -40,6 +40,7 @@
****************************************************************************/
-->
<typesystem package="PySide2.QtPrintSupport">
+ <load-typesystem name="QtWidgets/typesystem_widgets.xml" generate="no"/>
<object-type name="QPageSetupDialog">
<modify-function signature="exec()" rename="exec_" allow-thread="yes"/>
diff --git a/sources/pyside2/PySide2/glue/qtcore.cpp b/sources/pyside2/PySide2/glue/qtcore.cpp
index 3e1bab97..93f7321a 100644
--- a/sources/pyside2/PySide2/glue/qtcore.cpp
+++ b/sources/pyside2/PySide2/glue/qtcore.cpp
@@ -1289,7 +1289,7 @@ Shiboken::AutoDecRef emptyTuple(PyTuple_New(0));
PyObject *pyTimer = reinterpret_cast<PyTypeObject *>(Shiboken::SbkType<QTimer>())->tp_new(Shiboken::SbkType<QTimer>(), emptyTuple, 0);
reinterpret_cast<PyTypeObject *>(Shiboken::SbkType<QTimer>())->tp_init(pyTimer, emptyTuple, 0);
-QTimer * timer = %CONVERTTOCPP[QTimer *](pyTimer);
+auto timer = %CONVERTTOCPP[QTimer *](pyTimer);
//XXX /|\ omitting this space crashes shiboken!
Shiboken::AutoDecRef result(
PyObject_CallMethod(pyTimer,
@@ -1484,8 +1484,7 @@ if (PySide::SignalManager::registerMetaMethod(%1, signalName.mid(1).toLatin1().d
if (!PyObject_TypeCheck(%1, PySideSignalInstanceTypeF()))
goto Sbk_%TYPEFunc_%FUNCTION_NAME_TypeError;
PySideSignalInstance *signalInstance = reinterpret_cast<PySideSignalInstance *>(%1);
-QObject * sender = %CONVERTTOCPP[QObject *](PySide::Signal::getObject(signalInstance));
-//XXX /|\ omitting this space crashes shiboken!
+auto sender = %CONVERTTOCPP[QObject *](PySide::Signal::getObject(signalInstance));
QSignalTransition *%0 = %CPPSELF->%FUNCTION_NAME(sender, PySide::Signal::getSignature(signalInstance),%2);
%PYARG_0 = %CONVERTTOPYTHON[QSignalTransition *](%0);
// @snippet qstate-addtransition-2
diff --git a/sources/pyside2/doc/codesnippets/examples/dialogs/standarddialogs/dialog.cpp b/sources/pyside2/doc/codesnippets/examples/dialogs/standarddialogs/dialog.cpp
index d4dde36b..db11e22f 100644
--- a/sources/pyside2/doc/codesnippets/examples/dialogs/standarddialogs/dialog.cpp
+++ b/sources/pyside2/doc/codesnippets/examples/dialogs/standarddialogs/dialog.cpp
@@ -49,32 +49,32 @@
****************************************************************************/
//! [0]
- i = QInputDialog().getInteger(self, self.tr("QInputDialog().getInteger()"),
- self.tr("Percentage:"), 25, 0, 100, 1, ok)
+ i, ok = QInputDialog().getInteger(self, "QInputDialog().getInteger()",
+ "Percentage:", 25, 0, 100, 1)
if ok:
- self.integerLabel.setText(self.tr("%1%").arg(i))
+ self.integerLabel.setText("{}%".format(i))
//! [0]
//! [1]
- d = QInputDialog().getDouble(self, self.tr("QInputDialog().getDouble()"),
- self.tr("Amount:"), 37.56, -10000, 10000, 2, ok)
+ d, ok = QInputDialog().getDouble(self, "QInputDialog().getDouble()",
+ "Amount:", 37.56, -10000, 10000, 2)
if ok:
- doubleLabel.setText(QString("$%1").arg(d))
+ doubleLabel.setText("${}".format())
//! [1]
//! [2]
- items = [self.tr("Spring"), self.tr("Summer"), self.tr("Fall"), self.tr("Winter")]
+ items = ["Spring", "Summer", "Fall", "Winter"]
- item = QInputDialog().getItem(self, self.tr("QInputDialog().getItem()"),
- selftr("Season:"), items, 0, False, ok)
+ item, ok = QInputDialog().getItem(self, "QInputDialog().getItem()",
+ "Season:", items, 0, False)
if ok and not item.isEmpty():
itemLabel.setText(item)
//! [2]
//! [3]
- text = QInputDialog::getText(self, self.tr("QInputDialog().getText()"),
- self.tr("User name:"), QLineEdit.Normal,
- QDir().home().dirName(), ok)
+ text, ok = QInputDialog().getText(self, "QInputDialog().getText()",
+ "User name:", QLineEdit.Normal,
+ QDir().home().dirName())
if ok and text:
textLabel.setText(text)
//! [3]
diff --git a/sources/pyside2/tests/QtCore/qslot_object_test.py b/sources/pyside2/tests/QtCore/qslot_object_test.py
index b8d5513f..7a2691a0 100644
--- a/sources/pyside2/tests/QtCore/qslot_object_test.py
+++ b/sources/pyside2/tests/QtCore/qslot_object_test.py
@@ -31,7 +31,10 @@
import unittest
from PySide2 import QtCore
-global qApp
+"""
+This is a simple slot test that was updated to use the qApp "macro".
+It is implicitly in builtins and does not need an import.
+"""
class objTest(QtCore.QObject):
@@ -41,21 +44,15 @@ class objTest(QtCore.QObject):
self.ok = False
def slot(self):
- global qApp
-
self.ok = True
qApp.quit()
-
class slotTest(unittest.TestCase):
def quit_app(self):
- global qApp
-
qApp.quit()
def testBasic(self):
- global qApp
timer = QtCore.QTimer()
timer.setInterval(100)
@@ -71,6 +68,5 @@ class slotTest(unittest.TestCase):
if __name__ == '__main__':
- global qApp
- qApp = QtCore.QCoreApplication([])
+ QtCore.QCoreApplication()
unittest.main()