Display webpage in Toolkit App

I’m trying to create a toolkit app that displays a html page from a file.
Normally in pyQT this is easy to do with the QtWebEngineWidgets module and QWebEngineView. However it seems that the QtWebEngineWidgets is removed from the QT library that ships with toolkit.
Is there any setting in the config that let’s me get the module?

3 Likes

Hi @jonlemur,

QtWebEngine is “new”.

Shotgun Desktop provides PySide, which is base on a Qt version that wasn’t using QtWebEngine but QtWebKit.

Shotgun Create provides PySide2, but a version that wasn’t exposing QtWebEngine through the python library.

One solution could be to install the library you need (pyQT) using “pip install pyQT --user” from the python interpreter you use to run your toolkit app. That way, pyQT would be available in your environment and his QtWebEngine too.

Thanks,
Kerby

5 Likes

If I want the toolkit app to be distributed to all users in the studio I think I need to have the python modules ‘ship’ with the shotgun desktop installation, right?

I think I might be able to put the module on a chared network path and load it from there though.

Thanks for your help!
/Jon

2 Likes

Hello @jonlemur

Python is pretty flexible. You need to find way to add your Qt module to your python environment before running the “import” command.

It can be done by playing around the PYTHON* environment variables or by playing with the “sys.path” list.

Unfortunately, finding a clean way to do this is out of my expertise. Maybe someone else in the forum have a solution!

1 Like

Hey everyone, just a heads up, I’m going to move this topic over to our Pipeline Integrations Category.
Phil

1 Like

Couldn’t you add the shared location to the PATH?

sys.path.insert(0, PATH_TO_SHARED_LIB)
3 Likes

@Ricardo_Musch, that is a great idea. Should work, thank you

3 Likes

@jonlemur
This should also make sure that your lib is found in that path first as it inserts the path before everything else.

2 Likes