enthought / qt_binder

Thinly wrap Qt widgets with Traits
Other
19 stars 5 forks source link

PySide2 support #60

Closed rkern closed 4 years ago

rkern commented 4 years ago

PySide2 is essentially supported now, at least for running tests, and with some care.

There is an upstream bug in 5.13.1 (the latest release as of now) that prevents our introspection techniques from working unless if the QApplication is initialized in a particular way. I have a workaround that is sufficient for the test suite, but not the examples. This bug has been fixed upstream, but it has not appeared in a release, yet. When a new release comes down, we'll remove the workaround.

There is a difference in behavior of overloaded signal objects (e.g. destroyed() vs destroyed(QObject*) with PyQt5. In PyQt5 the signal that we listen to via the plain destroyed name will give us the full destroyed(QObject*) overload, giving us the QObject as the argument. In PySide2, we get the argumentless destroyed() variant. Because we can no longer specify exactly what signal we want to listen to using the C++-style strings and have to go through the Python .destroyed[QObject] style of overloading, it's hard to rationalize the two. I'm not entirely sure what to do about this. It's possible that this current implementation will suffice. Maybe we should document it as a location of undefined behavior for now.

codecov-io commented 4 years ago

Codecov Report

Merging #60 into master will increase coverage by 0.37%. The diff coverage is 79.77%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #60      +/-   ##
==========================================
+ Coverage   75.94%   76.32%   +0.37%     
==========================================
  Files          20       20              
  Lines        1501     1508       +7     
  Branches      236      241       +5     
==========================================
+ Hits         1140     1151      +11     
+ Misses        313      308       -5     
- Partials       48       49       +1
Impacted Files Coverage Δ
qt_binder/qt/ui_loader.py 27.45% <0%> (-1.72%) :arrow_down:
qt_binder/binder.py 93.93% <83.52%> (+2.01%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update f92f9df...aa2815b. Read the comment docs.

rkern commented 4 years ago

@jvkersch @rahulporuri CI should be green now, and the examples should work. Rebuild your envs if you used etstool.py before. PySide2 5.13.2 was released today with the required fix, so the examples now work, too.