From 35bc1078b4c130cd24282ce6c770c195b1cfd76f Mon Sep 17 00:00:00 2001 From: Venugopal Shivashankar Date: Fri, 20 Sep 2019 10:15:03 +0200 Subject: Shiboken: Add check for 'external' link type MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Apparently, qdoc generates entries with 'external' type, which is ignored by Shiboken. This leads to treating such links as reference links, leading to broken links in the HTML output. Change-Id: I426f91661ba1cc0b0f17b2e30fbddcf9e1fee530 Reviewed-by: Topi Reiniƶ Reviewed-by: Friedemann Kleint --- sources/shiboken2/generator/qtdoc/qtdocgenerator.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/shiboken2/generator/qtdoc/qtdocgenerator.cpp b/sources/shiboken2/generator/qtdoc/qtdocgenerator.cpp index 9cad400f3..dd29c02f0 100644 --- a/sources/shiboken2/generator/qtdoc/qtdocgenerator.cpp +++ b/sources/shiboken2/generator/qtdoc/qtdocgenerator.cpp @@ -1023,6 +1023,8 @@ QtXmlToSphinx::LinkContext *QtXmlToSphinx::handleLinkStart(const QString &type, result->type = LinkContext::External; else result->type = LinkContext::Reference; + } else if (type == QLatin1String("external")) { + result->type = LinkContext::External; } else { result->type = LinkContext::Reference; } -- cgit v1.2.3 From 45fdb9c06d8934e5c8de208e584d4c35943cd3b8 Mon Sep 17 00:00:00 2001 From: Andreas Beckermann Date: Thu, 12 Sep 2019 14:56:35 +0200 Subject: Remove trailing whitespace from __repr__ QDebug normally prints a trailing ' ', however the repr implementation does not expect so. Remove the trailing space, if it is there. This makes sure that e.g. PySide2.QtCore.QRegularExpression() is printed as instead of (note the double space before 'at') Change-Id: I6c088069a6a8ca42933a442cce7b576327a9d151 Reviewed-by: Christian Tismer Reviewed-by: Friedemann Kleint --- sources/shiboken2/generator/shiboken2/cppgenerator.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/shiboken2/generator/shiboken2/cppgenerator.cpp b/sources/shiboken2/generator/shiboken2/cppgenerator.cpp index 68bcfe508..7de0cfc09 100644 --- a/sources/shiboken2/generator/shiboken2/cppgenerator.cpp +++ b/sources/shiboken2/generator/shiboken2/cppgenerator.cpp @@ -6030,6 +6030,7 @@ QString CppGenerator::writeReprFunction(QTextStream &s, GeneratorContext &contex Indentation indent(INDENT); s << INDENT << "str.replace(0, idx, Py_TYPE(self)->tp_name);" << endl; } + s << INDENT << "str = str.trimmed();" << endl; s << INDENT << "PyObject *mod = PyDict_GetItemString(Py_TYPE(self)->tp_dict, \"__module__\");" << endl; // PYSIDE-595: The introduction of heap types has the side effect that the module name // is always prepended to the type name. Therefore the strchr check: -- cgit v1.2.3 From 142d75c30ac18461b350c543d6eb43df1ae60aa4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cristi=C3=A1n=20Maureira-Fredes?= Date: Mon, 25 Mar 2019 17:49:38 +0100 Subject: Add .pyproject files for each example Change-Id: I4dec66067aa2b0cc50d1ac3226537e4f09006132 Reviewed-by: Venugopal Shivashankar --- examples/3d/3d.pyproject | 3 +++ examples/axcontainer/axcontainer.pyproject | 3 +++ examples/charts/charts.pyproject | 3 +++ examples/charts/chartthemes/chartthemes.pyproject | 3 +++ examples/corelib/threads/threads.pyproject | 3 +++ examples/corelib/tools/codecs/codecs.pyproject | 3 +++ examples/corelib/tools/settingseditor/settingseditor.pyproject | 3 +++ examples/corelib/tools/tools.pyproject | 3 +++ examples/datavisualization/datavisualization.pyproject | 3 +++ examples/declarative/declarative.pyproject | 3 +++ .../declarative/extending/chapter1-basics/chapter1-basics.pyproject | 3 +++ .../extending/chapter2-methods/chapter2-methods.pyproject | 3 +++ .../extending/chapter3-bindings/chapter3-bindings.pyproject | 3 +++ .../chapter4-customPropertyTypes.pyproject | 3 +++ .../chapter5-listproperties/chapter5-listproperties.pyproject | 3 +++ examples/declarative/signals/pytoqml1/pytoqml1.pyproject | 3 +++ examples/declarative/signals/qmltopy1/qmltopy1.pyproject | 3 +++ examples/declarative/signals/qmltopy2/qmltopy2.pyproject | 3 +++ examples/declarative/signals/qmltopy3/qmltopy3.pyproject | 3 +++ examples/declarative/signals/qmltopy4/qmltopy4.pyproject | 3 +++ examples/declarative/textproperties/textproperties.pyproject | 3 +++ examples/macextras/macextras.pyproject | 3 +++ examples/multimedia/multimedia.pyproject | 3 +++ examples/network/network.pyproject | 4 ++++ examples/opengl/opengl.pyproject | 5 +++++ examples/opengl/textures/textures.pyproject | 3 +++ examples/remoteobjects/modelview/modelview.pyproject | 3 +++ examples/script/script.pyproject | 3 +++ examples/texttospeech/texttospeech.pyproject | 3 +++ examples/tutorial/tutorial.pyproject | 5 +++++ examples/webenginequick/webenginequick.pyproject | 3 +++ examples/webenginewidgets/webenginewidgets.pyproject | 3 +++ examples/widgets/animation/animatedtiles/animatedtiles.pyproject | 4 ++++ examples/widgets/animation/appchooser/appchooser.pyproject | 3 +++ examples/widgets/animation/easing/easing.pyproject | 4 ++++ examples/widgets/animation/states/states.pyproject | 3 +++ examples/widgets/dialogs/classwizard/classwizard.pyproject | 4 ++++ examples/widgets/dialogs/dialogs.pyproject | 4 ++++ examples/widgets/draganddrop/draggabletext/draggabletext.pyproject | 4 ++++ examples/widgets/effects/effects.pyproject | 3 +++ examples/widgets/graphicsview/collidingmice/collidingmice.pyproject | 3 +++ examples/widgets/graphicsview/diagramscene/diagramscene.pyproject | 3 +++ examples/widgets/graphicsview/dragdroprobot/dragdroprobot.pyproject | 3 +++ examples/widgets/graphicsview/graphicsview.pyproject | 3 +++ examples/widgets/itemviews/addressbook/addressbook.pyproject | 4 ++++ examples/widgets/itemviews/itemviews.pyproject | 3 +++ examples/widgets/itemviews/stardelegate/stardelegate.pyproject | 3 +++ examples/widgets/layouts/layouts.pyproject | 3 +++ examples/widgets/mainwindows/application/application.pyproject | 3 +++ examples/widgets/mainwindows/dockwidgets/dockwidgets.pyproject | 3 +++ examples/widgets/mainwindows/mdi/mdi.pyproject | 3 +++ examples/widgets/painting/basicdrawing/basicdrawing.pyproject | 3 +++ examples/widgets/painting/painting.pyproject | 3 +++ examples/widgets/richtext/richtext.pyproject | 3 +++ .../widgets/richtext/syntaxhighlighter/syntaxhighlighter.pyproject | 4 ++++ examples/widgets/richtext/textobject/textobject.pyproject | 3 +++ examples/widgets/state-machine/state-machine.pyproject | 4 ++++ examples/widgets/tutorials/addressbook/addressbook.pyproject | 4 ++++ examples/widgets/widgets/widgets.pyproject | 3 +++ examples/xml/dombookmarks/dombookmarks.pyproject | 3 +++ examples/xmlpatterns/schema/schema.pyproject | 4 ++++ 61 files changed, 198 insertions(+) create mode 100644 examples/3d/3d.pyproject create mode 100644 examples/axcontainer/axcontainer.pyproject create mode 100644 examples/charts/charts.pyproject create mode 100644 examples/charts/chartthemes/chartthemes.pyproject create mode 100644 examples/corelib/threads/threads.pyproject create mode 100644 examples/corelib/tools/codecs/codecs.pyproject create mode 100644 examples/corelib/tools/settingseditor/settingseditor.pyproject create mode 100644 examples/corelib/tools/tools.pyproject create mode 100644 examples/datavisualization/datavisualization.pyproject create mode 100644 examples/declarative/declarative.pyproject create mode 100644 examples/declarative/extending/chapter1-basics/chapter1-basics.pyproject create mode 100644 examples/declarative/extending/chapter2-methods/chapter2-methods.pyproject create mode 100644 examples/declarative/extending/chapter3-bindings/chapter3-bindings.pyproject create mode 100644 examples/declarative/extending/chapter4-customPropertyTypes/chapter4-customPropertyTypes.pyproject create mode 100644 examples/declarative/extending/chapter5-listproperties/chapter5-listproperties.pyproject create mode 100644 examples/declarative/signals/pytoqml1/pytoqml1.pyproject create mode 100644 examples/declarative/signals/qmltopy1/qmltopy1.pyproject create mode 100644 examples/declarative/signals/qmltopy2/qmltopy2.pyproject create mode 100644 examples/declarative/signals/qmltopy3/qmltopy3.pyproject create mode 100644 examples/declarative/signals/qmltopy4/qmltopy4.pyproject create mode 100644 examples/declarative/textproperties/textproperties.pyproject create mode 100644 examples/macextras/macextras.pyproject create mode 100644 examples/multimedia/multimedia.pyproject create mode 100644 examples/network/network.pyproject create mode 100644 examples/opengl/opengl.pyproject create mode 100644 examples/opengl/textures/textures.pyproject create mode 100644 examples/remoteobjects/modelview/modelview.pyproject create mode 100644 examples/script/script.pyproject create mode 100644 examples/texttospeech/texttospeech.pyproject create mode 100644 examples/tutorial/tutorial.pyproject create mode 100644 examples/webenginequick/webenginequick.pyproject create mode 100644 examples/webenginewidgets/webenginewidgets.pyproject create mode 100644 examples/widgets/animation/animatedtiles/animatedtiles.pyproject create mode 100644 examples/widgets/animation/appchooser/appchooser.pyproject create mode 100644 examples/widgets/animation/easing/easing.pyproject create mode 100644 examples/widgets/animation/states/states.pyproject create mode 100644 examples/widgets/dialogs/classwizard/classwizard.pyproject create mode 100644 examples/widgets/dialogs/dialogs.pyproject create mode 100644 examples/widgets/draganddrop/draggabletext/draggabletext.pyproject create mode 100644 examples/widgets/effects/effects.pyproject create mode 100644 examples/widgets/graphicsview/collidingmice/collidingmice.pyproject create mode 100644 examples/widgets/graphicsview/diagramscene/diagramscene.pyproject create mode 100644 examples/widgets/graphicsview/dragdroprobot/dragdroprobot.pyproject create mode 100644 examples/widgets/graphicsview/graphicsview.pyproject create mode 100644 examples/widgets/itemviews/addressbook/addressbook.pyproject create mode 100644 examples/widgets/itemviews/itemviews.pyproject create mode 100644 examples/widgets/itemviews/stardelegate/stardelegate.pyproject create mode 100644 examples/widgets/layouts/layouts.pyproject create mode 100644 examples/widgets/mainwindows/application/application.pyproject create mode 100644 examples/widgets/mainwindows/dockwidgets/dockwidgets.pyproject create mode 100644 examples/widgets/mainwindows/mdi/mdi.pyproject create mode 100644 examples/widgets/painting/basicdrawing/basicdrawing.pyproject create mode 100644 examples/widgets/painting/painting.pyproject create mode 100644 examples/widgets/richtext/richtext.pyproject create mode 100644 examples/widgets/richtext/syntaxhighlighter/syntaxhighlighter.pyproject create mode 100644 examples/widgets/richtext/textobject/textobject.pyproject create mode 100644 examples/widgets/state-machine/state-machine.pyproject create mode 100644 examples/widgets/tutorials/addressbook/addressbook.pyproject create mode 100644 examples/widgets/widgets/widgets.pyproject create mode 100644 examples/xml/dombookmarks/dombookmarks.pyproject create mode 100644 examples/xmlpatterns/schema/schema.pyproject diff --git a/examples/3d/3d.pyproject b/examples/3d/3d.pyproject new file mode 100644 index 000000000..4c85ba5a4 --- /dev/null +++ b/examples/3d/3d.pyproject @@ -0,0 +1,3 @@ +{ + "files": ["simple3d.py"] +} diff --git a/examples/axcontainer/axcontainer.pyproject b/examples/axcontainer/axcontainer.pyproject new file mode 100644 index 000000000..b054d6f18 --- /dev/null +++ b/examples/axcontainer/axcontainer.pyproject @@ -0,0 +1,3 @@ +{ + "files": ["axviewer.py"] +} diff --git a/examples/charts/charts.pyproject b/examples/charts/charts.pyproject new file mode 100644 index 000000000..a4e6c01c1 --- /dev/null +++ b/examples/charts/charts.pyproject @@ -0,0 +1,3 @@ +{ + "files": ["percentbarchart.py", "donutbreakdown.py", "legend.py", "nesteddonuts.py", "modeldata.py", "lineandbar.py", "memoryusage.py", "callout.py", "audio.py"] +} diff --git a/examples/charts/chartthemes/chartthemes.pyproject b/examples/charts/chartthemes/chartthemes.pyproject new file mode 100644 index 000000000..4a0b38795 --- /dev/null +++ b/examples/charts/chartthemes/chartthemes.pyproject @@ -0,0 +1,3 @@ +{ + "files": ["main.py", "README.md", "themewidget.ui"] +} diff --git a/examples/corelib/threads/threads.pyproject b/examples/corelib/threads/threads.pyproject new file mode 100644 index 000000000..254aabec0 --- /dev/null +++ b/examples/corelib/threads/threads.pyproject @@ -0,0 +1,3 @@ +{ + "files": ["mandelbrot.py"] +} diff --git a/examples/corelib/tools/codecs/codecs.pyproject b/examples/corelib/tools/codecs/codecs.pyproject new file mode 100644 index 000000000..72237d60b --- /dev/null +++ b/examples/corelib/tools/codecs/codecs.pyproject @@ -0,0 +1,3 @@ +{ + "files": ["codecs.py"] +} diff --git a/examples/corelib/tools/settingseditor/settingseditor.pyproject b/examples/corelib/tools/settingseditor/settingseditor.pyproject new file mode 100644 index 000000000..9eb637af2 --- /dev/null +++ b/examples/corelib/tools/settingseditor/settingseditor.pyproject @@ -0,0 +1,3 @@ +{ + "files": ["settingseditor.py"] +} diff --git a/examples/corelib/tools/tools.pyproject b/examples/corelib/tools/tools.pyproject new file mode 100644 index 000000000..63f9c6198 --- /dev/null +++ b/examples/corelib/tools/tools.pyproject @@ -0,0 +1,3 @@ +{ + "files": ["regexp.py"] +} diff --git a/examples/datavisualization/datavisualization.pyproject b/examples/datavisualization/datavisualization.pyproject new file mode 100644 index 000000000..415133f09 --- /dev/null +++ b/examples/datavisualization/datavisualization.pyproject @@ -0,0 +1,3 @@ +{ + "files": ["bars3d.py"] +} diff --git a/examples/declarative/declarative.pyproject b/examples/declarative/declarative.pyproject new file mode 100644 index 000000000..e64c1d934 --- /dev/null +++ b/examples/declarative/declarative.pyproject @@ -0,0 +1,3 @@ +{ + "files": ["view.qml", "scrolling.py", "usingmodel.py"] +} diff --git a/examples/declarative/extending/chapter1-basics/chapter1-basics.pyproject b/examples/declarative/extending/chapter1-basics/chapter1-basics.pyproject new file mode 100644 index 000000000..869556bb8 --- /dev/null +++ b/examples/declarative/extending/chapter1-basics/chapter1-basics.pyproject @@ -0,0 +1,3 @@ +{ + "files": ["basics.py", "app.qml"] +} diff --git a/examples/declarative/extending/chapter2-methods/chapter2-methods.pyproject b/examples/declarative/extending/chapter2-methods/chapter2-methods.pyproject new file mode 100644 index 000000000..cdf33be7f --- /dev/null +++ b/examples/declarative/extending/chapter2-methods/chapter2-methods.pyproject @@ -0,0 +1,3 @@ +{ + "files": ["methods.py", "app.qml"] +} diff --git a/examples/declarative/extending/chapter3-bindings/chapter3-bindings.pyproject b/examples/declarative/extending/chapter3-bindings/chapter3-bindings.pyproject new file mode 100644 index 000000000..6e21f86f9 --- /dev/null +++ b/examples/declarative/extending/chapter3-bindings/chapter3-bindings.pyproject @@ -0,0 +1,3 @@ +{ + "files": ["app.qml", "bindings.py"] +} diff --git a/examples/declarative/extending/chapter4-customPropertyTypes/chapter4-customPropertyTypes.pyproject b/examples/declarative/extending/chapter4-customPropertyTypes/chapter4-customPropertyTypes.pyproject new file mode 100644 index 000000000..af1cfefb7 --- /dev/null +++ b/examples/declarative/extending/chapter4-customPropertyTypes/chapter4-customPropertyTypes.pyproject @@ -0,0 +1,3 @@ +{ + "files": ["app.qml", "customPropertyTypes.py"] +} diff --git a/examples/declarative/extending/chapter5-listproperties/chapter5-listproperties.pyproject b/examples/declarative/extending/chapter5-listproperties/chapter5-listproperties.pyproject new file mode 100644 index 000000000..a3f89d575 --- /dev/null +++ b/examples/declarative/extending/chapter5-listproperties/chapter5-listproperties.pyproject @@ -0,0 +1,3 @@ +{ + "files": ["app.qml", "listproperties.py"] +} diff --git a/examples/declarative/signals/pytoqml1/pytoqml1.pyproject b/examples/declarative/signals/pytoqml1/pytoqml1.pyproject new file mode 100644 index 000000000..e6f087cce --- /dev/null +++ b/examples/declarative/signals/pytoqml1/pytoqml1.pyproject @@ -0,0 +1,3 @@ +{ + "files": ["main.py", "view.qml"] +} diff --git a/examples/declarative/signals/qmltopy1/qmltopy1.pyproject b/examples/declarative/signals/qmltopy1/qmltopy1.pyproject new file mode 100644 index 000000000..e6f087cce --- /dev/null +++ b/examples/declarative/signals/qmltopy1/qmltopy1.pyproject @@ -0,0 +1,3 @@ +{ + "files": ["main.py", "view.qml"] +} diff --git a/examples/declarative/signals/qmltopy2/qmltopy2.pyproject b/examples/declarative/signals/qmltopy2/qmltopy2.pyproject new file mode 100644 index 000000000..e6f087cce --- /dev/null +++ b/examples/declarative/signals/qmltopy2/qmltopy2.pyproject @@ -0,0 +1,3 @@ +{ + "files": ["main.py", "view.qml"] +} diff --git a/examples/declarative/signals/qmltopy3/qmltopy3.pyproject b/examples/declarative/signals/qmltopy3/qmltopy3.pyproject new file mode 100644 index 000000000..e6f087cce --- /dev/null +++ b/examples/declarative/signals/qmltopy3/qmltopy3.pyproject @@ -0,0 +1,3 @@ +{ + "files": ["main.py", "view.qml"] +} diff --git a/examples/declarative/signals/qmltopy4/qmltopy4.pyproject b/examples/declarative/signals/qmltopy4/qmltopy4.pyproject new file mode 100644 index 000000000..e6f087cce --- /dev/null +++ b/examples/declarative/signals/qmltopy4/qmltopy4.pyproject @@ -0,0 +1,3 @@ +{ + "files": ["main.py", "view.qml"] +} diff --git a/examples/declarative/textproperties/textproperties.pyproject b/examples/declarative/textproperties/textproperties.pyproject new file mode 100644 index 000000000..e6f087cce --- /dev/null +++ b/examples/declarative/textproperties/textproperties.pyproject @@ -0,0 +1,3 @@ +{ + "files": ["main.py", "view.qml"] +} diff --git a/examples/macextras/macextras.pyproject b/examples/macextras/macextras.pyproject new file mode 100644 index 000000000..d559b7ca4 --- /dev/null +++ b/examples/macextras/macextras.pyproject @@ -0,0 +1,3 @@ +{ + "files": ["macpasteboardmime.py"] +} diff --git a/examples/multimedia/multimedia.pyproject b/examples/multimedia/multimedia.pyproject new file mode 100644 index 000000000..a0b8b441c --- /dev/null +++ b/examples/multimedia/multimedia.pyproject @@ -0,0 +1,3 @@ +{ + "files": ["player.py", "audiooutput.py", "camera.py"] +} diff --git a/examples/network/network.pyproject b/examples/network/network.pyproject new file mode 100644 index 000000000..44b9ec433 --- /dev/null +++ b/examples/network/network.pyproject @@ -0,0 +1,4 @@ +{ + "files": ["blockingfortuneclient.py", "fortuneserver.py", + "threadedfortuneserver.py", "fortuneclient.py"] +} diff --git a/examples/opengl/opengl.pyproject b/examples/opengl/opengl.pyproject new file mode 100644 index 000000000..12f435daf --- /dev/null +++ b/examples/opengl/opengl.pyproject @@ -0,0 +1,5 @@ +{ + "files": ["grabber.py", "samplebuffers.py", "hellogl.py", + "hellogl2.py", "contextinfo.py", "2dpainting.py", + "overpainting.py"] +} diff --git a/examples/opengl/textures/textures.pyproject b/examples/opengl/textures/textures.pyproject new file mode 100644 index 000000000..05416190a --- /dev/null +++ b/examples/opengl/textures/textures.pyproject @@ -0,0 +1,3 @@ +{ + "files": ["textures.qrc", "textures_rc.py", "textures.py"] +} diff --git a/examples/remoteobjects/modelview/modelview.pyproject b/examples/remoteobjects/modelview/modelview.pyproject new file mode 100644 index 000000000..0b3a1b5e3 --- /dev/null +++ b/examples/remoteobjects/modelview/modelview.pyproject @@ -0,0 +1,3 @@ +{ + "files": ["modelviewserver.py", "modelviewclient.py"] +} diff --git a/examples/script/script.pyproject b/examples/script/script.pyproject new file mode 100644 index 000000000..5beba8c3a --- /dev/null +++ b/examples/script/script.pyproject @@ -0,0 +1,3 @@ +{ + "files": ["README.md", "helloscript.py"] +} diff --git a/examples/texttospeech/texttospeech.pyproject b/examples/texttospeech/texttospeech.pyproject new file mode 100644 index 000000000..69fc13f90 --- /dev/null +++ b/examples/texttospeech/texttospeech.pyproject @@ -0,0 +1,3 @@ +{ + "files": ["texttospeech.py"] +} diff --git a/examples/tutorial/tutorial.pyproject b/examples/tutorial/tutorial.pyproject new file mode 100644 index 000000000..09478e108 --- /dev/null +++ b/examples/tutorial/tutorial.pyproject @@ -0,0 +1,5 @@ +{ + "files": ["t6.py", "t9.py", "t8.py", "t13.py", "t10.py", "t7.py", + "t3.py", "t4.py", "t1.py", "t12.py", "t2.py", "t5.py", + "t11.py", "t14.py"] +} diff --git a/examples/webenginequick/webenginequick.pyproject b/examples/webenginequick/webenginequick.pyproject new file mode 100644 index 000000000..dd9039229 --- /dev/null +++ b/examples/webenginequick/webenginequick.pyproject @@ -0,0 +1,3 @@ +{ + "files": ["quicknanobrowser.py", "browser.qml"] +} diff --git a/examples/webenginewidgets/webenginewidgets.pyproject b/examples/webenginewidgets/webenginewidgets.pyproject new file mode 100644 index 000000000..6bc12af6b --- /dev/null +++ b/examples/webenginewidgets/webenginewidgets.pyproject @@ -0,0 +1,3 @@ +{ + "files": ["simplebrowser.py"] +} diff --git a/examples/widgets/animation/animatedtiles/animatedtiles.pyproject b/examples/widgets/animation/animatedtiles/animatedtiles.pyproject new file mode 100644 index 000000000..08ee55685 --- /dev/null +++ b/examples/widgets/animation/animatedtiles/animatedtiles.pyproject @@ -0,0 +1,4 @@ +{ + "files": ["animatedtiles.qrc", "animatedtiles.py", + "animatedtiles_rc.py"] +} diff --git a/examples/widgets/animation/appchooser/appchooser.pyproject b/examples/widgets/animation/appchooser/appchooser.pyproject new file mode 100644 index 000000000..14bc351a1 --- /dev/null +++ b/examples/widgets/animation/appchooser/appchooser.pyproject @@ -0,0 +1,3 @@ +{ + "files": ["appchooser_rc.py", "appchooser.py", "appchooser.qrc"] +} diff --git a/examples/widgets/animation/easing/easing.pyproject b/examples/widgets/animation/easing/easing.pyproject new file mode 100644 index 000000000..2677e28ea --- /dev/null +++ b/examples/widgets/animation/easing/easing.pyproject @@ -0,0 +1,4 @@ +{ + "files": ["easing.qrc", "ui_form.py", "easing.py", "easing_rc.py", + "form.ui"] +} diff --git a/examples/widgets/animation/states/states.pyproject b/examples/widgets/animation/states/states.pyproject new file mode 100644 index 000000000..d94cf2e65 --- /dev/null +++ b/examples/widgets/animation/states/states.pyproject @@ -0,0 +1,3 @@ +{ + "files": ["states.py", "states_rc.py"] +} diff --git a/examples/widgets/dialogs/classwizard/classwizard.pyproject b/examples/widgets/dialogs/classwizard/classwizard.pyproject new file mode 100644 index 000000000..1c1fe9998 --- /dev/null +++ b/examples/widgets/dialogs/classwizard/classwizard.pyproject @@ -0,0 +1,4 @@ +{ + "files": ["classwizard.qrc", "classwizard.py", "classwizard_rc.py", + "classwizard_rc.pyc"] +} diff --git a/examples/widgets/dialogs/dialogs.pyproject b/examples/widgets/dialogs/dialogs.pyproject new file mode 100644 index 000000000..001fd141b --- /dev/null +++ b/examples/widgets/dialogs/dialogs.pyproject @@ -0,0 +1,4 @@ +{ + "files": ["findfiles.py", "standarddialogs.py", "extension.py", + "trivialwizard.py"] +} diff --git a/examples/widgets/draganddrop/draggabletext/draggabletext.pyproject b/examples/widgets/draganddrop/draggabletext/draggabletext.pyproject new file mode 100644 index 000000000..0d422076e --- /dev/null +++ b/examples/widgets/draganddrop/draggabletext/draggabletext.pyproject @@ -0,0 +1,4 @@ +{ + "files": ["draggabletext_rc.py", "words.txt", "draggabletext.qrc", + "draggabletext.py"] +} diff --git a/examples/widgets/effects/effects.pyproject b/examples/widgets/effects/effects.pyproject new file mode 100644 index 000000000..c64fe46d4 --- /dev/null +++ b/examples/widgets/effects/effects.pyproject @@ -0,0 +1,3 @@ +{ + "files": ["lighting.py"] +} diff --git a/examples/widgets/graphicsview/collidingmice/collidingmice.pyproject b/examples/widgets/graphicsview/collidingmice/collidingmice.pyproject new file mode 100644 index 000000000..ea5821866 --- /dev/null +++ b/examples/widgets/graphicsview/collidingmice/collidingmice.pyproject @@ -0,0 +1,3 @@ +{ + "files": ["collidingmice.py", "mice_rc.py"] +} diff --git a/examples/widgets/graphicsview/diagramscene/diagramscene.pyproject b/examples/widgets/graphicsview/diagramscene/diagramscene.pyproject new file mode 100644 index 000000000..0acabdd78 --- /dev/null +++ b/examples/widgets/graphicsview/diagramscene/diagramscene.pyproject @@ -0,0 +1,3 @@ +{ + "files": ["diagramscene.qrc", "diagramscene.py", "diagramscene_rc.py"] +} diff --git a/examples/widgets/graphicsview/dragdroprobot/dragdroprobot.pyproject b/examples/widgets/graphicsview/dragdroprobot/dragdroprobot.pyproject new file mode 100644 index 000000000..587484a97 --- /dev/null +++ b/examples/widgets/graphicsview/dragdroprobot/dragdroprobot.pyproject @@ -0,0 +1,3 @@ +{ + "files": ["dragdroprobot.qrc", "dragdroprobot_rc.py", "dragdroprobot.py"] +} diff --git a/examples/widgets/graphicsview/graphicsview.pyproject b/examples/widgets/graphicsview/graphicsview.pyproject new file mode 100644 index 000000000..007d36bd2 --- /dev/null +++ b/examples/widgets/graphicsview/graphicsview.pyproject @@ -0,0 +1,3 @@ +{ + "files": ["elasticnodes.py", "anchorlayout.py"] +} diff --git a/examples/widgets/itemviews/addressbook/addressbook.pyproject b/examples/widgets/itemviews/addressbook/addressbook.pyproject new file mode 100644 index 000000000..2aa763753 --- /dev/null +++ b/examples/widgets/itemviews/addressbook/addressbook.pyproject @@ -0,0 +1,4 @@ +{ + "files": ["tablemodel.py", "addressbook.py", "adddialogwidget.py", + "addresswidget.py", "newaddresstab.py"] +} diff --git a/examples/widgets/itemviews/itemviews.pyproject b/examples/widgets/itemviews/itemviews.pyproject new file mode 100644 index 000000000..a582259cc --- /dev/null +++ b/examples/widgets/itemviews/itemviews.pyproject @@ -0,0 +1,3 @@ +{ + "files": ["basicsortfiltermodel.py", "fetchmore.py"] +} diff --git a/examples/widgets/itemviews/stardelegate/stardelegate.pyproject b/examples/widgets/itemviews/stardelegate/stardelegate.pyproject new file mode 100644 index 000000000..13fdf9dde --- /dev/null +++ b/examples/widgets/itemviews/stardelegate/stardelegate.pyproject @@ -0,0 +1,3 @@ +{ + "files": ["stardelegate.py", "stareditor.py", "starrating.py"] +} diff --git a/examples/widgets/layouts/layouts.pyproject b/examples/widgets/layouts/layouts.pyproject new file mode 100644 index 000000000..85eb22785 --- /dev/null +++ b/examples/widgets/layouts/layouts.pyproject @@ -0,0 +1,3 @@ +{ + "files": ["basiclayouts.py", "dynamiclayouts.py", "flowlayout.py"] +} diff --git a/examples/widgets/mainwindows/application/application.pyproject b/examples/widgets/mainwindows/application/application.pyproject new file mode 100644 index 000000000..0e0413982 --- /dev/null +++ b/examples/widgets/mainwindows/application/application.pyproject @@ -0,0 +1,3 @@ +{ + "files": ["application.qrc", "application.py", "application_rc.py"] +} diff --git a/examples/widgets/mainwindows/dockwidgets/dockwidgets.pyproject b/examples/widgets/mainwindows/dockwidgets/dockwidgets.pyproject new file mode 100644 index 000000000..2df11468e --- /dev/null +++ b/examples/widgets/mainwindows/dockwidgets/dockwidgets.pyproject @@ -0,0 +1,3 @@ +{ + "files": ["dockwidgets.qrc", "dockwidgets.py", "dockwidgets_rc.py"] +} diff --git a/examples/widgets/mainwindows/mdi/mdi.pyproject b/examples/widgets/mainwindows/mdi/mdi.pyproject new file mode 100644 index 000000000..7df26fd77 --- /dev/null +++ b/examples/widgets/mainwindows/mdi/mdi.pyproject @@ -0,0 +1,3 @@ +{ + "files": ["mdi_rc.py", "mdi.py", "mdi.qrc"] +} diff --git a/examples/widgets/painting/basicdrawing/basicdrawing.pyproject b/examples/widgets/painting/basicdrawing/basicdrawing.pyproject new file mode 100644 index 000000000..9ecbfadcf --- /dev/null +++ b/examples/widgets/painting/basicdrawing/basicdrawing.pyproject @@ -0,0 +1,3 @@ +{ + "files": ["basicdrawing_rc.py", "basicdrawing.qrc", "basicdrawing.py"] +} diff --git a/examples/widgets/painting/painting.pyproject b/examples/widgets/painting/painting.pyproject new file mode 100644 index 000000000..ed24e12b0 --- /dev/null +++ b/examples/widgets/painting/painting.pyproject @@ -0,0 +1,3 @@ +{ + "files": ["concentriccircles.py"] +} diff --git a/examples/widgets/richtext/richtext.pyproject b/examples/widgets/richtext/richtext.pyproject new file mode 100644 index 000000000..e91a98961 --- /dev/null +++ b/examples/widgets/richtext/richtext.pyproject @@ -0,0 +1,3 @@ +{ + "files": ["syntaxhighlighter.py", "orderform.py"] +} diff --git a/examples/widgets/richtext/syntaxhighlighter/syntaxhighlighter.pyproject b/examples/widgets/richtext/syntaxhighlighter/syntaxhighlighter.pyproject new file mode 100644 index 000000000..e42b221a8 --- /dev/null +++ b/examples/widgets/richtext/syntaxhighlighter/syntaxhighlighter.pyproject @@ -0,0 +1,4 @@ +{ + "files": ["syntaxhighlighter_rc.py", "syntaxhighlighter.py", + "syntaxhighlighter.qrc"] +} diff --git a/examples/widgets/richtext/textobject/textobject.pyproject b/examples/widgets/richtext/textobject/textobject.pyproject new file mode 100644 index 000000000..ed4135844 --- /dev/null +++ b/examples/widgets/richtext/textobject/textobject.pyproject @@ -0,0 +1,3 @@ +{ + "files": ["textobject.py"] +} diff --git a/examples/widgets/state-machine/state-machine.pyproject b/examples/widgets/state-machine/state-machine.pyproject new file mode 100644 index 000000000..dafb204c8 --- /dev/null +++ b/examples/widgets/state-machine/state-machine.pyproject @@ -0,0 +1,4 @@ +{ + "files": ["pingpong.py", "trafficlight.py", "twowaybutton.py", + "eventtrans.py", "rogue.py", "factstates.py"] +} diff --git a/examples/widgets/tutorials/addressbook/addressbook.pyproject b/examples/widgets/tutorials/addressbook/addressbook.pyproject new file mode 100644 index 000000000..13d739e1b --- /dev/null +++ b/examples/widgets/tutorials/addressbook/addressbook.pyproject @@ -0,0 +1,4 @@ +{ + "files": ["part3.py", "part1.py", "part5.py", "part2.py", + "part7.py", "part6.py", "part4.py"] +} diff --git a/examples/widgets/widgets/widgets.pyproject b/examples/widgets/widgets/widgets.pyproject new file mode 100644 index 000000000..b4e3ef67e --- /dev/null +++ b/examples/widgets/widgets/widgets.pyproject @@ -0,0 +1,3 @@ +{ + "files": ["tetrix.py", "hellogl_openglwidget_legacy.py"] +} diff --git a/examples/xml/dombookmarks/dombookmarks.pyproject b/examples/xml/dombookmarks/dombookmarks.pyproject new file mode 100644 index 000000000..9a688558d --- /dev/null +++ b/examples/xml/dombookmarks/dombookmarks.pyproject @@ -0,0 +1,3 @@ +{ + "files": ["jennifer.xbel", "frank.xbel", "dombookmarks.py"] +} diff --git a/examples/xmlpatterns/schema/schema.pyproject b/examples/xmlpatterns/schema/schema.pyproject new file mode 100644 index 000000000..697e58d70 --- /dev/null +++ b/examples/xmlpatterns/schema/schema.pyproject @@ -0,0 +1,4 @@ +{ + "files": ["schema.qrc", "schema.py", "schema.ui", "ui_schema.py", + "schema_rc.py"] +} -- cgit v1.2.3 From 63e46f6a0a80cda662be9350923a9e080fac7b6f Mon Sep 17 00:00:00 2001 From: Christian Tismer Date: Mon, 30 Sep 2019 13:14:20 +0200 Subject: Fix bad shutdown effect on QApplication.instance() When app = QtWidgets.QApplication.instance() is used before a QApplication has been created, the qApp code sees no qApp instance in C++ and assumes a shutdown. This patch keeps track of QApplication being created and behaves correctly on that aspect. It is still unsolved that QtCore.QObject.staticMetaObject gets deleted on a qApp shutdown, which is too much. I think this can be handled in another patch if at all, since the shutdown / recreate feature is undocumented and of little use. Change-Id: I140b6dba45f7cd337580373dbf72bc6d0a625fea Fixes: PYSIDE-1093 Reviewed-by: Friedemann Kleint Reviewed-by: Cristian Maureira-Fredes --- .../pyside2/tests/pysidetest/qapp_like_a_macro_test.py | 18 ++++++++++++++++++ sources/shiboken2/libshiboken/qapp_macro.cpp | 9 +++++++-- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/sources/pyside2/tests/pysidetest/qapp_like_a_macro_test.py b/sources/pyside2/tests/pysidetest/qapp_like_a_macro_test.py index c58aba82e..1c0d5d55d 100644 --- a/sources/pyside2/tests/pysidetest/qapp_like_a_macro_test.py +++ b/sources/pyside2/tests/pysidetest/qapp_like_a_macro_test.py @@ -33,7 +33,10 @@ import PySide2 # It also uses the qApp variable to finish the instance and start over. class qAppMacroTest(unittest.TestCase): + _test_1093_is_first = True + def test_qApp_is_like_a_macro_and_can_restart(self): + self._test_1093_is_first = False from PySide2 import QtCore try: from PySide2 import QtGui, QtWidgets @@ -72,5 +75,20 @@ class qAppMacroTest(unittest.TestCase): # and they are again all the same self.assertTrue(qApp is QtCore.qApp is QtGui.qApp is QtWidgets.qApp) + def test_1093(self): + # Test that without creating a QApplication staticMetaObject still exists. + # Please see https://bugreports.qt.io/browse/PYSIDE-1093 for explanation. + # Note: This test must run first, otherwise we would be mislead! + assert self._test_1093_is_first + from PySide2 import QtCore + self.assertTrue(QtCore.QObject.staticMetaObject is not None) + app = QtCore.QCoreApplication.instance() + self.assertTrue(QtCore.QObject.staticMetaObject is not None) + if app is None: + app = QtCore.QCoreApplication([]) + self.assertTrue(QtCore.QObject.staticMetaObject is not None) + del __builtins__.qApp + + if __name__ == '__main__': unittest.main() diff --git a/sources/shiboken2/libshiboken/qapp_macro.cpp b/sources/shiboken2/libshiboken/qapp_macro.cpp index 12af9613c..306f53b74 100644 --- a/sources/shiboken2/libshiboken/qapp_macro.cpp +++ b/sources/shiboken2/libshiboken/qapp_macro.cpp @@ -120,6 +120,7 @@ reset_qApp_var(void) PyObject * MakeSingletonQAppWrapper(PyTypeObject *type) { + static bool app_created = false; if (type == nullptr) type = Py_NONE_TYPE; if (!(type == Py_NONE_TYPE || Py_TYPE(qApp_content) == Py_NONE_TYPE)) { @@ -145,6 +146,9 @@ MakeSingletonQAppWrapper(PyTypeObject *type) Py_REFCNT(qApp_var) = 1; // fuse is armed... } if (type == Py_NONE_TYPE) { + // PYSIDE-1093: Ignore None when no instance has ever been created. + if (!app_created) + Py_RETURN_NONE; // Debug mode showed that we need to do more than just remove the // reference. To keep everything in the right order, it is easiest // to do a full shutdown, using QtCore.__moduleShutdown(). @@ -158,9 +162,10 @@ MakeSingletonQAppWrapper(PyTypeObject *type) Py_REFCNT(qApp_content) = Py_REFCNT(Py_None); if (__moduleShutdown != nullptr) Py_XDECREF(PyObject_CallFunction(__moduleShutdown, const_cast("()"))); + } else { + PyObject_INIT(qApp_content, type); + app_created = true; } - else - (void)PyObject_INIT(qApp_content, type); Py_INCREF(qApp_content); return qApp_content; } -- cgit v1.2.3 From e2774ff5350fa94352858672aa165a8ff22aa3b1 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 2 Oct 2019 14:05:57 +0200 Subject: shiboken: Fix handling of modified default expressions - Do not try to resolve modified default expressions (add enumeration scopes or similar) - Fix the signature parser to handle arbitrary expressions Fixes: PYSIDE-1095 Change-Id: I059c3a1f066687d7c2f0dad9ea7f0d93e292b1b5 Reviewed-by: Christian Tismer --- .../shiboken2/generator/shiboken2/shibokengenerator.cpp | 8 ++++---- .../files.dir/shibokensupport/signature/parser.py | 3 ++- sources/shiboken2/tests/libsample/modifications.cpp | 16 ++++++++++++++++ sources/shiboken2/tests/libsample/modifications.h | 10 ++++++++++ .../shiboken2/tests/samplebinding/modifications_test.py | 10 ++++++++++ .../shiboken2/tests/samplebinding/typesystem_sample.xml | 6 ++++++ 6 files changed, 48 insertions(+), 5 deletions(-) diff --git a/sources/shiboken2/generator/shiboken2/shibokengenerator.cpp b/sources/shiboken2/generator/shiboken2/shibokengenerator.cpp index 34e43a4c7..2a8eefba6 100644 --- a/sources/shiboken2/generator/shiboken2/shibokengenerator.cpp +++ b/sources/shiboken2/generator/shiboken2/shibokengenerator.cpp @@ -573,11 +573,11 @@ QString ShibokenGenerator::guessScopeForDefaultValue(const AbstractMetaFunction { QString value = getDefaultValue(func, arg); - if (value.isEmpty()) - return QString(); - - if (isPointer(arg->type())) + if (value.isEmpty() + || arg->hasModifiedDefaultValueExpression() + || isPointer(arg->type())) { return value; + } static const QRegularExpression enumValueRegEx(QStringLiteral("^([A-Za-z_]\\w*)?$")); Q_ASSERT(enumValueRegEx.isValid()); diff --git a/sources/shiboken2/shibokenmodule/files.dir/shibokensupport/signature/parser.py b/sources/shiboken2/shibokenmodule/files.dir/shibokensupport/signature/parser.py index 3d14ec7b3..0081a07ba 100644 --- a/sources/shiboken2/shibokenmodule/files.dir/shibokensupport/signature/parser.py +++ b/sources/shiboken2/shibokenmodule/files.dir/shibokensupport/signature/parser.py @@ -106,7 +106,8 @@ def _parse_line(line): $ """ ret = SimpleNamespace(**re.match(line_re, line, re.VERBOSE).groupdict()) - argstr = ret.arglist + # PYSIDE-1095: Handle arbitrary default expressions + argstr = ret.arglist.replace("->", ".deref.") arglist = _parse_arglist(argstr) args = [] for arg in arglist: diff --git a/sources/shiboken2/tests/libsample/modifications.cpp b/sources/shiboken2/tests/libsample/modifications.cpp index 98b22f09b..56ba81875 100644 --- a/sources/shiboken2/tests/libsample/modifications.cpp +++ b/sources/shiboken2/tests/libsample/modifications.cpp @@ -149,3 +149,19 @@ Modifications::nonConversionRuleForArgumentWithDefaultValue(ObjectType** object) *object = m_object; return true; } + +void Modifications::setEnumValue(TestEnum e) +{ + m_enumValue = e; +} + +Modifications::TestEnum Modifications::enumValue() const +{ + return m_enumValue; +} + +Modifications::TestEnum Modifications::defaultEnumValue() const +{ + return TestEnumValue2; +} + diff --git a/sources/shiboken2/tests/libsample/modifications.h b/sources/shiboken2/tests/libsample/modifications.h index fa32bdec3..674a05f27 100644 --- a/sources/shiboken2/tests/libsample/modifications.h +++ b/sources/shiboken2/tests/libsample/modifications.h @@ -51,6 +51,11 @@ public: Overloaded_ibPP }; + enum TestEnum { + TestEnumValue1, + TestEnumValue2 + }; + // those overloaded methods should be heavily modified // to push the overload decisor to its limits inline OverloadedModFunc overloaded(int a0, bool b0, int c0, double d0) { return Overloaded_ibid; } @@ -123,8 +128,13 @@ public: // Inject code with a %CONVERTTOPYTHON that receives an user's primitive type. static inline OddBool passOddBool(OddBool ob) { return ob; } + void setEnumValue(TestEnum e = TestEnumValue1); + TestEnum enumValue() const; + TestEnum defaultEnumValue() const; + private: ObjectType* m_object; + TestEnum m_enumValue = TestEnumValue1; }; class LIBSAMPLE_API AbstractModifications : public Modifications diff --git a/sources/shiboken2/tests/samplebinding/modifications_test.py b/sources/shiboken2/tests/samplebinding/modifications_test.py index 1dcd50359..e9a1eaf7f 100644 --- a/sources/shiboken2/tests/samplebinding/modifications_test.py +++ b/sources/shiboken2/tests/samplebinding/modifications_test.py @@ -220,5 +220,15 @@ class ModificationsTest(unittest.TestCase): self.assertTrue(isinstance(res, float)) self.assertEqual(res, em.increment) + def testDefaultValueModifications(self): + # PSYIDE-1095: setEnumValue() has the default value modified to + # calling defaultEnumValue() which returns Modifications.TestEnumValue2. + # This used to generated broken code since defaultEnumValue() was + # qualified by the enum scope. + modifications = Modifications() + modifications.setEnumValue() + self.assertEqual(modifications.enumValue(), Modifications.TestEnumValue2) + + if __name__ == '__main__': unittest.main() diff --git a/sources/shiboken2/tests/samplebinding/typesystem_sample.xml b/sources/shiboken2/tests/samplebinding/typesystem_sample.xml index 19b4948a1..4d624f952 100644 --- a/sources/shiboken2/tests/samplebinding/typesystem_sample.xml +++ b/sources/shiboken2/tests/samplebinding/typesystem_sample.xml @@ -956,6 +956,7 @@ + @@ -1287,6 +1288,11 @@ %PYARG_0 = %CONVERTTOPYTHON[OddBool](%0); + + + + + -- cgit v1.2.3