Thanks to visit codestin.com
Credit goes to github.com

Skip to content

guidata PySide2 compatibility #635

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

Closed
stonebig opened this issue May 9, 2018 · 7 comments
Closed

guidata PySide2 compatibility #635

stonebig opened this issue May 9, 2018 · 7 comments

Comments

@stonebig
Copy link
Contributor

stonebig commented May 9, 2018

procedure of test:

  • rename guidata sub-directory "qt" as "qt_old",
  • copy "qtpy" directory package as guidata package subdirectory "qt"
  • from guidata import tests; tests.run()
:\WinP\bd36\buPs2\winp64-3.6.x.1\python-3.6.5.amd64\lib\site-packages\guidata\configtools.py in <module>()
     20 import gettext
     21 
---> 22 from guidata.qt.QtGui import (QFont, QLabel, QPixmap, QIcon, QHBoxLayout,
     23                               QColor, QPen, QBrush, QFontDatabase)
     24 from guidata.qt.QtCore import Qt

ImportError: cannot import name 'QLabel'
@stonebig
Copy link
Contributor Author

stonebig commented May 9, 2018

a patch needed for QtAwesome : spyder-ide/qtawesome#84

@stonebig
Copy link
Contributor Author

stonebig commented May 9, 2018

lot of patching to move Guidata to QtPy. And also in testing part, so the external API part.... maybe it's more a new package.

Yet it roughly works, PySide2 bug aside.

@stonebig
Copy link
Contributor Author

stonebig commented May 10, 2018

replacing classic guidata/Qt per Qtpy is not good:

  • the API is changed,
  • guiqwt and user codes that depend on it are broken,
  • lot of time spent rewriting examples.

the good method would be to move 'vendored' QtPy aside, then redirect guidata/Qt load to guidata/Qtpy Loads.

Benefit = having guiqwt working for free, no more example rewrite

@stonebig
Copy link
Contributor Author

stonebig commented May 10, 2018

procedure of next test:

  • copy guidata sub-directory "qt" as "qt_old",
  • copy "qtpy" directory package as guidata package subdirectory "qtpy"
  • rewrite guidata/qt as redirection to guidata/qtpy ( from ..qtpy import blabla)
  • from guidata import tests; tests.run()

@stonebig
Copy link
Contributor Author

so in second example, we need to patch in the applicative part the ToPyDateTime() and ToPyDate(), that are both ToPython() in PySide2, in guidata/datasets/qtitemwidgets.py

       try:
            return self.dateedit.date().toPyDate()
        except:
            return self.dateedit.dateTime().toPython()
       try:
            return self.dateedit.date().toPyDateTime()
        except:
            return self.dateedit.dateTime().toPython()

@stonebig
Copy link
Contributor Author

I have a mysterious message "Qpicture: invalid format version 0""

@stonebig
Copy link
Contributor Author

but overal, it works without effort (probably not optimal in perf, but I don't care)

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

No branches or pull requests

1 participant