Forbid user actions

Forbid user actions

t_tkacp
Alumni Alumni
457 Views
2 Replies
Message 1 of 3

Forbid user actions

t_tkacp
Alumni
Alumni

Hello to everyone!


I created new window with various controls (using Qt) for my Addin, because `CommandInputs` just not enough 😞
When user clicks on button from toolbar - window is appear. It runs in different thread, so user can keep working with Fusion while that window is open. But Fusion crashes when user tries to interact with Fusion controls while my Addin creates geometry.


So my question: Is it possible to forbid user to click any buttons in Fusion? (freeze UI somehow?)


Regards,
Pavel

0 Likes
Accepted solutions (1)
458 Views
2 Replies
Replies (2)
Message 2 of 3

KrisKaplan
Autodesk
Autodesk
Accepted solution

There is currently no API to disable to UI.  If you are dropping down to a lower level UI framework like Qt, then there could be several things to try, but my first thought would be to just create the dialog on the main thread and have it be modeless so the user can only interact with your widget.

 

A couple words of caution:  Fusion is a Qt based UI application.  And if you use Qt in your app (perhaps through PyQt or PySide in Python, or your own Qt library in C++) you are mixing two different versions of Qt in the same process, and that does not appear to be officially supported.  So while some simple modal dialogs appear to work, I would expect that the event loops from the different libraries are likely to interfere with each other (for example, your event loop could eat events intended for Fusion objects) causing unexpected/unsupported behavior.  So at this point, it is not recomended or supported to mix in another Qt (basically it's 'use at your own risk').  The other issue would be around calling into the Fusion API from a side thread.  Several APIs (particularly around UI types) are limited to the main thread, and support for thread safety in general in the API is somewhat untested.

 

Kris



Kris Kaplan
0 Likes
Message 3 of 3

t_tkacp
Alumni
Alumni

Hi Kris,

 

Thank you alot for your reply.

 

Regards,

Pavel.

0 Likes