Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
We have tried the suggested method and looked over all windows in the Illustrator process, but still can't create a dialog, that would block all Illustrator UI.
At best (when we are parenting from a window with the class name 'illustrator') we can create a dialog, that blocks the main window (all menus and tools), but panels are still not blocked i.e. we can move them and select tools from them (see video
http://screencast.com/t/3e82I118
).
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
/t5/illustrator-discussions/modal-dialogs-in-plug-in-with-qt/m-p/5640705#M225486
Dec 09, 2013
Dec 09, 2013
Hmm. The funny thing is, that sounds familliar. I feel I've seent that behaviour, but looking at our code, nothing jumps out at me that looks like it would address that problem.
We have a small library we've built that has a generic base modal dialog class off of which all our modal dialogs derive -- it handles things like making sure its parented off the current Qt dialog (by determining if one exists, and finding it) or failing that, main Illustrator window if nothing else is open. We also have a class for the 'main application window' but looking at its code, ti seems to largely be a container for the found window handle (and some helpful methods for finding the main window handle). So nothing there.
I'm honestly not sure. Maybe the flags you send to the dialog? I know we had to tinker with them to get them just so. It looks like we use:
// for resizable
const Qt::WindowFlags kDefaultWindowFlags = Qt::CustomizeWindowHint | Qt::Window | Qt::WindowTitleHint;
// for fixed
const Qt::WindowFlags kDefaultWindowFlagsFixed = kDefaultWindowFlags | Qt::MSWindowsFixedSizeDialogHint;
It also looks like we manually set 'setModal(true)' as the first line of our constructor. I don't know why that would matter, but perhaps it does?
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
/t5/illustrator-discussions/modal-dialogs-in-plug-in-with-qt/m-p/5640706#M225488
Dec 10, 2013
Dec 10, 2013
Yes, we set 'setModal(true)' manually too, and we tried this combinations of flags, nothing helps.
There is a function in Acrobat API called AVAppBeginModal, that "
Prepares the Acrobat viewer to display a modal window.
For example, it disables floating windows in Windows, where they are not automatically disabled."
May be there is some analog in Illustrator and your base class calles it?
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
/t5/illustrator-discussions/modal-dialogs-in-plug-in-with-qt/m-p/5640707#M225489
Dec 10, 2013
Dec 10, 2013
On Mac, we have to call something that turns off the menus, but not in Windows.
I've just re-checked all our code and I can't find anything. We have a base class for modal dialogs, but there's nothing in there that does anything Illustrator-specific. It just sets the modality and handles a bunch of things like restoring & saving dialog geometry (to remember positioning) and other little hacks/tweaks for things I'm 100% sure aren't related to modality.
We have a singleton class derived from CWinWidget that represents the main application window. It doesn't have much at all frankly, it mostly looks like it exists to figure out which window to use as its base handle when creating itself and then is a singleton so it doesn't have to keep doing that.
I looked at our QApplication-derived class, and again, lots of Mac code but not a lot of Windows stuff. It doesn't have anything either. It looks like so long as we have picked up the right Illustrator window handle for our QWinWidget, it just works on Windows.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
/t5/illustrator-discussions/modal-dialogs-in-plug-in-with-qt/m-p/5640708#M225491
Dec 15, 2013
Dec 15, 2013
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more