Giter VIP home page Giter VIP logo

Comments (13)

aroberge avatar aroberge commented on August 25, 2024

I just added the following to all relevant files in the repository:

try:
    from PyQt4 import QtGui, QtCore
except ImportError:
    from PyQt5 import QtGui, QtCore  # untested

However, I have no idea if this will be sufficient or if the syntax has changed between PyQt5 and PyQt4 - and can not test it myself. If you could try it and report the result, it would be appreciated.

from easygui_qt.

thorstenkampe avatar thorstenkampe commented on August 25, 2024

I get this on Windows:

Traceback (most recent call last):
  File "F:\PortableApps\Python3x\lib\site-packages\easygui_qt-0.9.1-py3.4.egg\easygui_qt\easygui_qt.py", line 24, in <module>
    from . import utils
  File "F:\PortableApps\Python3x\lib\site-packages\easygui_qt-0.9.1-py3.4.egg\easygui_qt\utils.py", line 125, in <module>
    class MyPageDialog(QtGui.QDialog):
AttributeError: 'module' object has no attribute 'QDialog'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "F:\Documents\dev\python\thorsten\cyrillic.py", line 11, in <module>
    import easygui_qt
  File "F:\PortableApps\Python3x\lib\site-packages\easygui_qt-0.9.1-py3.4.egg\easygui_qt\__init__.py", line 6, in <module>
    from .easygui_qt import *
  File "F:\PortableApps\Python3x\lib\site-packages\easygui_qt-0.9.1-py3.4.egg\easygui_qt\easygui_qt.py", line 31, in <module>
    import utils
ImportError: No module named 'utils'

from easygui_qt.

aroberge avatar aroberge commented on August 25, 2024

The second error puzzles me... that being said: did you import it from PyPi? I have not created a new version. I was just suggesting to try from the current repository - by cloning it.

That being said: it looks like PyQt5 has changed the modules structure (no attribute 'QDialog') which I can not test from here.

I'll keep this issue open, in case I find a way (and the time) to support both PyQt4 and PyQt5.

Sorry that I can not be more helpful at this time.

from easygui_qt.

stonebig avatar stonebig commented on August 25, 2024

You may look at what spider-ide folks are doing

from easygui_qt.

wannaphong avatar wannaphong commented on August 25, 2024

QtPy ? https://github.com/goanpeca/QtPy

from easygui_qt.

stonebig avatar stonebig commented on August 25, 2024

(today) yes.

from easygui_qt.

aroberge avatar aroberge commented on August 25, 2024

I don't have any time to spend on this project at the moment; I'm open to pull requests (or feel free to fork it, of course).

from easygui_qt.

uvchik avatar uvchik commented on August 25, 2024

I cannot test qt4 but I forked this repository in order to adapt it to qt5 without backward compatibility with qt4.

https://github.com/uvchik/easygui_qt5

from easygui_qt.

aroberge avatar aroberge commented on August 25, 2024

I probably should have closed this issue : the latest version should now be compatible with qt5. (One problem: the automated tests no longer work.)

from easygui_qt.

uvchik avatar uvchik commented on August 25, 2024

What do mean with the latest version?

For me get_file_names() dids not work with pyqt5. I had to change it according to the following page:

http://pyqt.sourceforge.net/Docs/PyQt5/pyqt4_differences.html#qfiledialog

-        files = qt_widgets.QFileDialog.getOpenFileNames(None, title, os.getcwd(),
-                                               "All Files (*.*)", options)
+        files = qt_widgets.QFileDialog.getOpenFileNames(None, title, os.getcwd(),
+                                               , "", "All Files (*.*)", options)

from easygui_qt.

aroberge avatar aroberge commented on August 25, 2024

By latest version, I refer to the last commit made on December 25, 2017, based on some input by a user who contacted me.

Based on what you found, obviously there is at least one bug in existing version. It is obvious that I did not test it as fully as I should have.

from easygui_qt.

uvchik avatar uvchik commented on August 25, 2024

I could make a PR but I am not sure if my changes work on pyqt4.

from easygui_qt.

aroberge avatar aroberge commented on August 25, 2024

I understand ... it would likely need and if/else statement to work reliably with both versions.

I think you are better off continuing with your fork - and I will leave this issue open as a warning for anyone interested in a qt5 compatible version. This project is at the bottom of my priority list (I started it for fun, as a means to learn qt) and I cannot give it the prompt attention it deserves.

from easygui_qt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.