AWS Thinkbox Discussion Forums

Deadline Monitor Script - dynamically add controls at runtime

I’m trying to work out how to dynamically modify the DeadlineScriptDialog object. I have a few dropdowns that are supposed to generate different options depending on their value.
The idea is to have one Grid in the Dialog that is empty to begin with, but can be filled with various Controls at runtime and can also be cleared. Unfortunately the Controls do not seem to behave the same way as one may expect from Qt widgets, so I’m at a loss as to how to delete and add them at runtime. Any ideas?
Cheers
Michael

These should actually still be relevant, with the first one being especially so. Just do a forum search for “QDialog” and you’ll find all kinds of examples of intermixing Qt controls with Deadline.

Thanks, those links look useful. However, there’s no way to extend the existing dialog? I don’t really want to re-invent the wheel by writing my own complete dialog. Guess there’s no way around it :frowning:

Any chance you could log an enhancement request for some sort of “Clear()” function that’ll clear out an e.g. Grid and lets you add fresh controls at runtime?

Here’s some C++ examples of how to do it:

The PyQt way is going to be similar: Walk over the children of a certain parent (in your case the QDialog) and remove everything you find. It may take some head scratching, but do some research and report back! I’ll try and loop back around on Monday.

Privacy | Site terms | Cookie preferences