[Qt-interest] Window list in z-order?

John Weeks john at wavemetrics.com
Tue Feb 8 21:46:44 CET 2011


Hi, all- I posted this a while back (Oct. 6, 2010, to be exact) so I think there's been time for everyone to have seen it :) I've hit a need for a solution to this, and still haven't found the answer. I'm hoping someone might have some insight. Thanks!



Our application has document windows of many kinds (think along the lines of a scientific IDE). A common action is to find the top document of a given kind. Presently, in Macintosh and Windows code, we get the top (in z-order) window of any kind, then walk down the window list looking for the first one of the given kind.

Can anyone suggest a way to implement this in Qt? These document "windows" might be actual windows (QMainWindow or just QWidget with custom code to make it functioning window), or they might be QMdiSubWindow (which isn't an actual window).

I see QApplication::topLevelWidgets() and QApplication::allWidgets(). The documentation doesn't tell me about the ordering of the list. It also seems like allWidgets would probably include too many widgets, and topLevelWidgets would include only widgets that are also windows. Am I right about that?

I also see QApplication::focusWidget(). That seems like it might give me something like the top window in z-order, but it might also give me a sub-widget of a compound widget.

Will I have to roll my own document-in-Z-order list and maintain it myself?

Regards,
John Weeks

WaveMetrics, Inc.
Phone (503) 620-3001
Fax   (503) 620-6754
email   support at WaveMetrics.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20110208/17b69983/attachment.html 


More information about the Qt-interest-old mailing list