Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Qt5 Support #302

Merged
merged 4 commits into from
Apr 30, 2018
Merged

Qt5 Support #302

merged 4 commits into from
Apr 30, 2018

Conversation

corranwebster
Copy link
Contributor

@corranwebster corranwebster commented Apr 13, 2018

Now we have a released Pyface with Qt5 support, it makes sense to see what is needed to support Qt5.

This PR:

  • Integrates PyQt5 into the CI testing system.
  • Fixes mouse wheel support.
  • Fixes dangling NativeScrollbar references on qt4.

- install SWIG from EDM
- add pyqt5 to edmtool
- mousewheel API
@codecov-io
Copy link

codecov-io commented Apr 14, 2018

Codecov Report

Merging #302 into master will increase coverage by 0.05%.
The diff coverage is 86.95%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #302      +/-   ##
==========================================
+ Coverage    33.6%   33.65%   +0.05%     
==========================================
  Files         206      206              
  Lines       18278    18298      +20     
  Branches     2407     2411       +4     
==========================================
+ Hits         6142     6159      +17     
- Misses      11744    11747       +3     
  Partials      392      392
Impacted Files Coverage Δ
enable/wx/base_window.py 0% <0%> (ø) ⬆️
enable/qt4/base_window.py 53.39% <100%> (+1.94%) ⬆️
enable/events.py 75.53% <100%> (+0.26%) ⬆️
enable/qt4/scrollbar.py 77.22% <100%> (+0.38%) ⬆️

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 8b6861d...65c8abd. Read the comment docs.

@corranwebster corranwebster changed the title [WIP] Qt5 Support Qt5 Support Apr 14, 2018
Copy link
Member

@jwiggins jwiggins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general LGTM

QtCore.QPoint(0, 200), QtCore.QPoint(0, 200.0/120), 200,
QtCore.Qt.Vertical, QtCore.Qt.NoButton, QtCore.Qt.NoModifier,
QtCore.Qt.ScrollUpdate
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like this code should be in a pyface testing support module... But I don't see any such module in pyface.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pyface doesn't really do any testing at the level of individual mouse events (things are usually driven at the level of signals and slots), so we haven't had a need to put anything like this into Pyface.

For now it's probably good enough to have it as part of enable.tests.qt4; if we find that we are repeating this a lot we might want to create a enable.qt4.testing.* utility method.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good to me

@corranwebster
Copy link
Contributor Author

I think this is good to merge.

@corranwebster corranwebster merged commit 3323236 into master Apr 30, 2018
@corranwebster corranwebster deleted the feature/qt5-support branch April 30, 2018 08:53
@corranwebster corranwebster mentioned this pull request Nov 26, 2019
3 tasks
@kitchoi
Copy link
Contributor

kitchoi commented Dec 2, 2020

Apparently the two tests on wx are failing (but the job has been allowed to fail on CI):

======================================================================
FAIL: test_horizontal_mouse_wheel (enable.tests.wx.mouse_wheel_test_case.MouseWheelTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/.edm/envs/enable-test-2.7-wx-pillow/lib/python2.7/site-packages/enable-4.7.1.dev15-py2.7-linux-x86_64.egg/enable/tests/wx/mouse_wheel_test_case.py", line 82, in test_horizontal_mouse_wheel
    self.assertEqual(self.tool.event.mouse_wheel_delta, (200, 0))
AssertionError: <undefined> != (200, 0)
======================================================================
FAIL: test_vertical_mouse_wheel (enable.tests.wx.mouse_wheel_test_case.MouseWheelTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/.edm/envs/enable-test-2.7-wx-pillow/lib/python2.7/site-packages/enable-4.7.1.dev15-py2.7-linux-x86_64.egg/enable/tests/wx/mouse_wheel_test_case.py", line 63, in test_vertical_mouse_wheel
    self.assertEqual(self.tool.event.mouse_wheel_delta, (0, 200))
AssertionError: <undefined> != (0, 200)

The CI job for wx is very close to passing. If we can require wx job to pass, we will be able to catch these more easily.

I tried to fix these by assigning the mouse_wheel_delta to the event object where they are defined. However the values are not the expected value. I get (1.0, 0) for horizontal case, and (0, 1.0) for vertical case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants