These are chat archives for PySide/pyside2

27th
Apr 2017
From IRC (bridge bot)
@FromIRC
Apr 27 2017 07:53
<mementomori> hi
<mementomori> https://bugreports.qt.io/browse/PYSIDE-505 has been marked 'easy'. Does this mean that removing the offending include would resolve the issue?
<fkleint> @ctismer: ^^^^^^^^^^^? (you did that apparently ;⁠-)
<fkleint> mementomori: Running shiboken should leave the .hpp file behind on error , can you please attach it?
<mementomori> fkleint, the error is:
<mementomori> /home/filippo/Qt/5.8/gcc_64/include/QtMultimedia/qtmultimediadefs.h:1:10: fatal error: '../../src/multimedia/qtmultimediadefs.h' file not found
<mementomori> Errors in /tmp/pyside2_global_J19794.hpp:
From IRC (bridge bot)
@FromIRC
Apr 27 2017 07:58
<mementomori> do you want me to attach /tmp/pyside2_global_J19794.hpp to the report?
<fkleint> mementomori: yes, please
<fkleint> it is not quite plausible why it is included, we alway build from checkouts though
<fkleint> mementomori: have you tried 5.9, btw - first supported version will be 5.10, I guess
<mementomori> fkleint, file attached
<mementomori> fkleint, I've tried 5.6 (as found in the wiki docs but doesn't compile) and 5.8
<mementomori> 5.9 is still beta...
<fkleint> hm, it is just #include <QtMultimedia/QtMultimedia>
<fkleint> weird
<mementomori> fkleint, does CLANG_INSTALL_DIR matter=
<mementomori> ?
From IRC (bridge bot)
@FromIRC
Apr 27 2017 08:04
<fkleint> nope, not at all
<fkleint> hah ! there we go: https://bugreports.qt.io/browse/QTBUG-58432
<fkleint> (I faintly rembered, sth was broken in the 5.8 packages)
<fkleint> so, it is a duplicate (of sorts) of QTBUG-58432 ; it should then work with 5.9
From IRC (bridge bot)
@FromIRC
Apr 27 2017 08:10
<mementomori> fkleint, you set the report as duplicate/closed. Should I try 5.9 beta or do I have another option?
<fkleint> mementomori: It just means it is not a PySide 2 issue. You can either checkout 5.8 latest from git or use 5.9. Actually, 5.7 could also work (not sure when the bug was introduced)
<mementomori> 5.6 5.7 and 5.8 use the same CLANG_INSTALL_DIR or I need something else?
<fkleint> That is determined by the PySide branch . Anything > 5.6 reqiures clang
<fkleint> But one clang installation should suffice for all
<mementomori> fkleint, I'm downloading 5.7 from the maintenace tool. I'll report here the results
From IRC (bridge bot)
@FromIRC
Apr 27 2017 08:16
<mementomori> it's actually 5.7.1
From IRC (bridge bot)
@FromIRC
Apr 27 2017 08:35
<alcroito> fkleint: > This is currently old-school OpenGL, but let's one compare QGLWidget vs QOpenGLWidget.
<alcroito> what do you mean?
<fkleint> alcroito: compare hellogl.py to this
<fkleint> alcroito: it is not using fancy shaders, etxc
<alcroito> fkleint: compare how?
<fkleint> alcroito: We can ofc rewrite it
<fkleint> alcroito: hellogl.py uses QGLWidget
<fkleint> alcroito: it shows you what to do when porting QGLWidget -> QOPenGLWIdget
<alcroito> fkleint: i am confused. i see that hellogl.py uses legacy GL. I see that hellogl_openglwidget.py also uses legacy GL. Presumably you want to rewrite the QOpenGLWidget example to use core GL.
<fkleint> alcroito: Yes, if I have infinite time on my hands, i can re-port the C++ example
<fkleint> alcroito: We need to add support for shaders, etc
<alcroito> fkleint: ah, because that's not there yet
<fkleint> alcroito: will do that eventually
<fkleint> ofc
<alcroito> why did you need the introspection thing though?
<alcroito> i'm a bit lost on that discussion as well
From IRC (bridge bot)
@FromIRC
Apr 27 2017 08:41
<fkleint> alcroito: take a look at https://codereview.qt-project.org/#/c/192701/
<fkleint> alcroito: it will be next to impossible to write tests for all those
<fkleint> alcroito: would be much simpler to just write a map of functions expected to be present for each class
<fkleint> [it does not help that I don't have much clue about MM,]
<alcroito> fkleint: why do you need introspection, if i assume you want to write a map of functions to test manually?
<alcroito> ah, because you don't know the arguments
<alcroito> and you just want to test if it's there
<fkleint> alcroito: yes, bascially just dump out a map of functions from a PyObj
<fkleint> alcroito: and compare to expected
<fkleint> alcroito: but coming back to the example, do you think it makes sense. or should it be renamed to helloopengl_legacy sth to make it clear?
<alcroito> fkleint: i think it's fine to have all 3. legacy QGLwidget, legacy QOpenGLWidget, core QOpenGLWidget
<alcroito> and maybe rename the examples to reflect the approach
<fkleint> ok, any suggestions?
<fkleint> on how to name the new one?
From IRC (bridge bot)
@FromIRC
Apr 27 2017 08:46
<alcroito> hellogl_qopenglwidget_compatibility_gl? :⁠D
<fkleint> hm ;⁠-)
<alcroito> fkleint: regarding introspection, i don't see why we can't do that right now. I tried in in interpeter right now this:
<alcroito> > from PySide2 import QtCore
<alcroito> >>> hasattr(QtCore.QUrl, 'hasQuery')
<alcroito> True
<alcroito> >>> hasattr(QtCore.QUrl, 'hasQuerya')
<alcroito> False
<alcroito> we don't necesarrily need a dump of methods, we can just iterate the expected array, and check each one if it is present
<fkleint> thinks ctismer will come up with an impressive tesing framework.,.
From IRC (bridge bot)
@FromIRC
Apr 27 2017 08:53
<alcroito> fkleint: i mean i'm not against impressive testing frameworks, but we can do it with hasattr, and focus on getting the missing bindings :⁠P
<fkleint> hm ;⁠-)
Ethan Smith
@ethanhs
Apr 27 2017 09:39
Does your testing require runtime checking, or would static checking suffice?
From IRC (bridge bot)
@FromIRC
Apr 27 2017 09:41
<alcroito> @ethanhs: what would static checking imply in regards to python?
Ethan Smith
@ethanhs
Apr 27 2017 09:41
Eg reading the source and getting type and export info from that
From IRC (bridge bot)
@FromIRC
Apr 27 2017 09:41
<alcroito> i think runtime would be preferable
<alcroito> but that's my opinion
Ethan Smith
@ethanhs
Apr 27 2017 09:42
I certainly agree, but Python wasn't really meant to have runtime types
From IRC (bridge bot)
@FromIRC
Apr 27 2017 09:43
<alcroito> it's not about types in this case at least, but checking for the existance of methods
Ethan Smith
@ethanhs
Apr 27 2017 09:44
Oh well then you can just check dir() on a class and see if the item is callable
That seems the most straightforward way in my mind
From IRC (bridge bot)
@FromIRC
Apr 27 2017 09:45
<mementomori> grrrr... got errors compiling pyside2 against 5.7.
<mementomori> Scanning dependencies of target uiplugin
<mementomori> [ 2%] Building CXX object plugins/CMakeFiles/uiplugin.dir/customwidgets.cpp.o
<mementomori> In file included from /home/filippo/Qt/5.7/gcc_64/include/QtCore/qglobal.h:83:0,
<mementomori> from /home/filippo/Qt/5.7/gcc_64/include/QtCore/QtGlobal:1,
<mementomori> from /home/filippo/tmp/pyside2/src/pyside-setup/sources/pyside2/plugins/customwidget.h:45,
<mementomori> from /home/filippo/tmp/pyside2/src/pyside-setup/sources/pyside2/plugins/customwidgets.cpp:40:
<mementomori> /home/filippo/Qt/5.7/gcc_64/include/QtCore/qcompilerdetection.h:562:6: error: #error Qt requires a C++11 compiler and yours does not seem to be that.
<mementomori> # error Qt requires a C++11 compiler and yours does not seem to be that.
<mementomori> $ gcc --version
<mementomori> gcc (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609
<mementomori> maybe a flag missing in the makefile?
Ethan Smith
@ethanhs
Apr 27 2017 09:48
alcoito: this would comparing attributes in the typesystem files to the actually built modules? Or would you be targeting against Qt itself via clang or some such thing?
From IRC (bridge bot)
@FromIRC
Apr 27 2017 09:50
* mementomori is trying with export CXXFLAGS=-std=c++11
<lqi> > from PySide2 import QtCore
<lqi> >print(dir(QtCore))
From IRC (bridge bot)
@FromIRC
Apr 27 2017 09:57
* mementomori is crossing fingers. things seem building....
From IRC (bridge bot)
@FromIRC
Apr 27 2017 10:13
<mementomori> aha ;⁠) build completed!
From IRC (bridge bot)
@FromIRC
Apr 27 2017 10:36
<alcroito> @ethanhs: the typesystem files don't specify methods though. I think the idea was that because writing tests for every single newly added class is too much work atm, we would just write a manual list with method names, and check if those are present in the modules at runtime
<lqi> https://bugreports.qt.io/browse/PYSIDE-266 for those types in system, could we reuse ctypes? like ctypes.wintypes.HBITMAP for that purpose?
From IRC (bridge bot)
@FromIRC
Apr 27 2017 10:47
<alcroito> lqi: if wintypes provide them, i think so
Ethan Smith
@ethanhs
Apr 27 2017 10:50
alcroito: I see. well if you don't need to check types it is relatively straightforward to use inspect's getmemebers and isclass methods to get the classes then the memebers of the classes
From IRC (bridge bot)
@FromIRC
Apr 27 2017 10:52
<alcroito> @ethanhs: Does getmembers return the whole list of methods though, including the ones that were inherited from c-side?
Ethan Smith
@ethanhs
Apr 27 2017 10:56
alcroito: It should. I called it on QPoint for example, and you get output such as ('y', <method 'y' of 'PySide2.QtCore.QPoint' objects>) in a list
From IRC (bridge bot)
@FromIRC
Apr 27 2017 10:57
<alcroito> @ethanhs: yep, seems to work with inherited stuff like QObject from QWidget as well
<alcroito> I don't know why we had to wait for some new introspection thing. Maybe that was for getting types of arguments, dunno
<alcroito> yeah, i think it was about getting the whole signature
Ethan Smith
@ethanhs
Apr 27 2017 10:58
Christian seemed interested in getting the types
From IRC (bridge bot)
@FromIRC
Apr 27 2017 10:58
<alcroito> ok
Ethan Smith
@ethanhs
Apr 27 2017 10:59
He was afk before he could explain why
Ethan Smith
@ethanhs
Apr 27 2017 11:04
Sadly Python does not handle function signatures very well from C modules. The inspect functions don't agree with them well
Christian Tismer
@ctismer
Apr 27 2017 11:52
fkleint: yes I assumed it to be easy after resolving the include. Maybe I should better say “tedious” ? :-)
Ethan: yes, I would like to make good annotations.
ctismer @ctismer will dig into things, tomorrow. Traveling today...
From IRC (bridge bot)
@FromIRC
Apr 27 2017 14:31
<mementomori> I finally built PySide2 from source against qt5.7
<mementomori> I'm going to write a little doc about how I did
<Siecje> \o/ :⁠)
From IRC (bridge bot)
@FromIRC
Apr 27 2017 15:20
<mementomori> updated "PySide2 GettingStarted" on the wiki. waiting for the moderator