Page 1 of 1

PyQt and Clarisse

Unread postPosted: Tue Sep 13, 2022 4:25 am
by christianl013
Hi, first time post here but I had a question in regards to qt and clarisse.

I read this doc on qt integration: https://clarissewiki.com/5.0/sdk/using_pyqt.html

I applied this to my qt gui and it launches in clarisse just fine but one thing about is that I can not interact with clarisse when the dialog is open. Is this the expected behavior? I thought that by using the helper wrapper this would not be the case.

Has anyone else had any experience with this? I am using pyside2 and python 3.7.

Thanks.

Best, Christian

Re: PyQt and Clarisse

Unread postPosted: Wed Sep 14, 2022 2:34 pm
by anemoff
Hi,

This is not normal. Maybe you created a modal widget?
What OS are you using?
Can you share a minimal script that shows this?

Here is a very simple script with an always-on-top widget, but you can still interact with the rest of Clarisse GUI.

py code

import sys
import PySide2
from PySide2 import QtCore
from PySide2 import QtWidgets
import pyqt_clarisse

app = None
if not QtWidgets.QApplication.instance():
app = QtWidgets.QApplication(sys.argv)
else:
app = QtWidgets.QApplication.instance()

label = QtWidgets.QLabel("Hello World")
label.setWindowFlags(QtCore.Qt.WindowStaysOnTopHint)
label.resize(200, 50)
label.show()

pyqt_clarisse.exec_(app)

Cheers,

Re: PyQt and Clarisse

Unread postPosted: Wed Sep 14, 2022 6:59 pm
by christianl013
Thanks for the reply. I am currently on windows 10.

I have attached here a basic script of how I am doing this. I am trying to class the ui so I can have things a bit more organized. All of the examples I have seen go right into the heart of the matter in the script but I have alot of other functions I need to bring into the script.

I could not seem to get this working with right click context either or multithreading, the app would just freeze, so yeah, it seems I got something wrong here. I appreciate you taking a look at it.

Thanks again.

Re: PyQt and Clarisse

Unread postPosted: Mon Sep 19, 2022 4:29 pm
by anemoff
I've installed the packages qtpy and PySide2, and set the environment variable "QT_API=pyside2" but I can't run your script. I'm on Windows 10 too.
I also changed the imports to "from qtpy import ...". But I don't have QtCompat.loadUI and UI file is missing, so it can't run as is.

I'm not familiar with qtpy but I modified my previous example using qtpy and it runs:

py code

import sys

from qtpy import QtCore
from qtpy import QtWidgets
import pyqt_clarisse

app = None
if not QtWidgets.QApplication.instance():
app = QtWidgets.QApplication(sys.argv)
else:
app = QtWidgets.QApplication.instance()

label = QtWidgets.QLabel("Hello World")
label.setWindowFlags(QtCore.Qt.WindowStaysOnTopHint)
label.resize(200, 50)
label.show()

pyqt_clarisse.exec_(app)


Can you show a simpler example that shows your problems?
What kind of functions do you need to bring into the script?