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 3: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 10:05 am
Location: Korolev

Re: PyQt needed even if I prefer PySide.

Unread postby bvaldes » Mon Feb 13, 2017 2: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: 275
Joined: Mon Sep 26, 2016 10:44 am

Re: PyQt needed even if I prefer PySide.

Unread postby arnaud » Wed Oct 11, 2017 2: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 2:48 pm

Re: PyQt needed even if I prefer PySide.

Unread postby Braden99 » Mon Feb 19, 2018 1: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: 6
Joined: Mon Jan 08, 2018 3:05 am

Re: PyQt needed even if I prefer PySide.

Unread postby ruchit » Sat Aug 11, 2018 9:19 am

Hi,
In Clarisse 3.5, PySide2.QtWidgets.QWidget() crashes main QApplication.
So tell me how to use PySide2 in 3.5 and make parent under QMainWindow ??

Thank you
ruchit
 
Posts: 4
Joined: Sat Aug 11, 2018 9:13 am

Re: PyQt needed even if I prefer PySide.

Unread postby bvaldes » Mon Aug 20, 2018 9:55 am

Hi,

This is a normal behavior. In the SDK doc in Clarisse, there is a special section about QT with Clarisse: `file:///YOUR/CLARISSE/iNSTALL/FOLDER/Clarisse/docs/sdk/using_pyqt.html`

Unfortunately, this is only working for PyQt before before 3.6 and for PySide and PyQt since the release of 3.6.
If you want to use PySide2, you have to edit the python file located here: `D:\YOUR/CLARISSE/iNSTALL/FOLDER\Clarisse\python\pyqt_clarisse.py`

You will have to replace the lines that import PyQt4 by PySide2 and maybe some other things (for example, QApplication is not located in QtGui in PySide2 but in QWidgets).

Because it's a feature request, could you please add a new entry in the feature request tracker? https://www.isotropix.com/user/feature

The tricks should allow you to use PySide2 while we discuss about the feature.

Best regards,
Benoit VALDES
Isotropix
Clarisse QA
User avatar
bvaldes
 
Posts: 275
Joined: Mon Sep 26, 2016 10:44 am

Re: PyQt needed even if I prefer PySide.

Unread postby Braden99 » Thu Sep 27, 2018 12:11 pm

I wonder if it's possible in a future Clarisse version that the app itself is running in a Qt event loop directly?
Then parenting custom Qt windows into Clarisse app would be trivial.

I understand porting the Clarisse UI to Qt might be a big undertaking, but very beneficial to provide a full development environment appropriate for vfx industry.
Braden99
 
Posts: 6
Joined: Mon Jan 08, 2018 3:05 am

Re: PyQt needed even if I prefer PySide.

Unread postby bvaldes » Mon Oct 01, 2018 10:40 am

Hello,

This is a good idea but as you know, it will be a long term developing.

You should add a feature request to port the Clarisse UI to QT: https://www.isotropix.com/user/feature

Regards
Benoit VALDES
Isotropix
Clarisse QA
User avatar
bvaldes
 
Posts: 275
Joined: Mon Sep 26, 2016 10:44 am

Re: PyQt needed even if I prefer PySide.

Unread postby Braden99 » Tue Oct 02, 2018 11:59 pm

Hey Benoit

Thanks, yeah I logged that as
#8807 - Port the Clarisse UI to QT

Cheers
Braden
Braden99
 
Posts: 6
Joined: Mon Jan 08, 2018 3:05 am


Return to Scripting