aroberge / easygui_qt

Inspired by easygui, designed for PyQt
BSD 3-Clause "New" or "Revised" License
61 stars 18 forks source link

updated to work with PyQt5 #26

Closed schellenberg closed 6 years ago

schellenberg commented 6 years ago

PyQt5 changes the location of some GUI elements, by splitting up QtGui into QtGui and QtWidgets. Many previous calls to QtGui needed to be changed to QtWidgets instead. A call to .getInteger also needed to be changed to .getInt. Finally, in order for this to work, attempts to import the older PyQt4 were removed, since these changes are not backwards compatible.

Tested on Python 3.6 on Windows 10. Minimal testing (really, really basic) done on Python 3.6 and Mac OS X (Sierra)

aroberge commented 6 years ago

Thanks for this contribution. I am busy with another project at the moment and will try to get back to this as soon as possible.

I might not do a straight pull as I might want to retain compatibility with PyQt4. This would require some import written as

from PyQtx import Y as Z

where I can use a common name for both.

schellenberg commented 6 years ago

It would be nice to be able to keep compatibility with PyQt4, but I admit it looks tricky. There are still a few calls that look like QtGui.Whatever, as well as a lot that have been transformed into QtWidget.Whatever.

My motivation for updating to PyQt5, incidentally, is that I'm considering using this as students are learning Python with the Thonny IDE. Thonny makes it trivial to install any Python package you want, so long as you can pip install it. PyQt4 can't be installed that way, but PyQt5 works great...

aroberge commented 6 years ago

I really want to maintain backward compatibility with PyQt4. I am pretty confident that I can do so. I will try to make the required changes within a few days, and certainly before January 1.

aroberge commented 6 years ago

I have created an updated version which should work with both PyQt4 and PyQt5. I noticed that some tests automated tests are not working properly. However, it should be ready for testing.