-
Notifications
You must be signed in to change notification settings - Fork 153
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
Make sure PyQt5 is supported #663
Conversation
Notes here: https://wiki.qt.io/Transition_from_Qt_4.x_to_Qt5 |
Note that to get PyQt5 to work at all, I needed to do https://github.com/conda/conda-recipes/issues/385 |
d1fb68a
to
c96b5fa
Compare
Stuck on this very frustrating error: glue/qt/widgets/mpl_widget.py:38: in wrapper
result = func(*args, **kwargs)
glue/core/application_base.py:72: in new_data_viewer
c = viewer_class(self._session)
glue/qt/widgets/histogram_widget.py:46: in __init__
super(HistogramWidget, self).__init__(session, parent)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <glue.qt.widgets.histogram_widget.HistogramWidget object at 0x12f035180>
session = <glue.core.session.Session object at 0x12e99a4d0>, parent = None
def __init__(self, session, parent=None):
"""
:type session: :class:`~glue.core.Session`
"""
> QMainWindow.__init__(self, parent)
E TypeError: __init__() takes exactly 2 arguments (1 given) Even though I am passing two arguments. However it's possible parent no longer takes |
So inverting the order of inheritance for class DataViewer(ViewerBase, QMainWindow): fixed that issue, somehow. Not 100% I understand at this point. |
Only two failing tests... |
Need to set the following to get HiDPI icons: app.setAttribute(QtCore.Qt.AA_UseHighDpiPixmaps); |
Main to-dos:
|
The following will be required for Matplotlib icons to look good in PyQt5: matplotlib/matplotlib#5057 |
@@ -243,7 +244,11 @@ def __init__(self, data_collection, parent=None): | |||
# without this reference, PySide clobbers instance | |||
# data of model items | |||
self.register_to_hub(self.data_collection.hub) | |||
self.setSupportedDragActions(Qt.CopyAction) | |||
if not is_pyqt5(): | |||
self.setSupportedDragActions(Qt.CopyAction) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does Qt5 not support this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does but I had to add a method now, see a few lines down.
f370ecf
to
f1fb976
Compare
There were issues with the existing PyQt5 packages for conda, so I made a Docker image in which to build my own: https://hub.docker.com/r/astrofrog/ubuntu-12.04-conda-pyqt5-builder/ - the conda package can be installed with |
…e when initializing DataViewer, because of multiple inheritance.
ab1e039
to
8e12d83
Compare
… client _relim method
Well, this took a while :-/ 🎉 |
Make sure PyQt5 is supported
To install in conda: http://stackoverflow.com/questions/25468397/using-anaconda-python-with-pyqt5