Isotropix Forums

PyQt needed even if I prefer PySide.

Clarisse Scripting related topics

PyQt needed even if I prefer PySide.

Unread postby timurhai » Sun Feb 12, 2017 4:14 pm

Hi.
To create a non-blocking Python Qt window, i need:
import pyqt_clarisse
and then:
pyqt_clarisse.exec_(App)

In a pyqt_clarisse.py we call see:
from PyQt4 import QtCore
from PyQt4 import QtGui
So i need to install PyQt4 even if i am going to use PySide only.
( In a studio we use PySide for in-house tools, we have a Python with PySide )
But for now i need to install PyQt just to make custom windows non-blocking.

Later i just replaced some lines in pyqt_clarisse.py to work PyQt or (and) PySide.
And now it works w/o PyQt4 in Python, but just with PySide:
Code: Select all
# from PyQt4 import QtCore
# from PyQt4 import QtGui
# Move import above modules in try block:
try:
    PythonQt = __import__('PySide', globals(), locals(), ['QtCore','QtGui'])
except ImportError:
    PythonQt = __import__('PyQt4', globals(), locals(), ['QtCore','QtGui'])
QtCore = PythonQt.QtCore
QtGui = PythonQt.QtGui


May be you can do something with this issue in feature releases, for example try to import PySide first.
Timur Hairulin
timurhai
 
Posts: 4
Joined: Mon Dec 19, 2016 11:05 am
Location: Korolev

Re: PyQt needed even if I prefer PySide.

Unread postby bvaldes » Mon Feb 13, 2017 3:34 pm

Hi,

Thank you for sharing this with the community !
We've added a feature request waiting for validation (#6471)

Cheers
Benoit VALDES
Isotropix
Clarisse QA
User avatar
bvaldes
 
Posts: 240
Joined: Mon Sep 26, 2016 11:44 am

Re: PyQt needed even if I prefer PySide.

Unread postby arnaud » Wed Oct 11, 2017 3:22 pm

Hello,

This feature has been approved and added on 3.5 roadmap.
Cheers
Arnaud

Isotropix
Chief Process & Innovation Officer
User avatar
arnaud
 
Posts: 188
Joined: Mon Dec 14, 2015 3:48 pm

Re: PyQt needed even if I prefer PySide.

Unread postby Braden99 » Mon Feb 19, 2018 2:00 am

Going forward with QT5, PyQt5 or PySide2 Python bindings might be in the environment instead.
So this should be taken into account in the future.

We use Qt.py shim layer around all Qt Python bindings, to make it easy to work with in multiple environments (PyQt4, PySide, PyQt5, PySide2)
https://github.com/mottosso/Qt.py
Braden99
 
Posts: 2
Joined: Mon Jan 08, 2018 4:05 am


Return to Scripting