[Qt-interest] Qt 5 and multiple screens
Jason H
scorp1us at yahoo.com
Thu Jun 2 02:17:08 CEST 2011
As someone who has developed multi-screen software, since Qt4 days, the guidelines make sense.
But there are a couple things you can do:
0. Always launch on the primary screen.
1. Always ensure your windows are within the bounds of the same screen that you launch
2. Save the location of the windows when they close.
3. Restore the positions the next time, pending:
The coordinates still exist! If the user reconfigures the screen layout, you could place it at a location that no longer exists! So be prepared to reset them to something within the screen of your main app.
It should also be observed, that "screens" only matter for "maximize" and "primary display" purposes. I run excel 1 window spanning both screens, and other instances maximized on just one.
________________________________
From: "bd.anon at free.fr" <bd.anon at free.fr>
To: Qt Interest <qt-interest at trolltech.com>
Sent: Wednesday, June 1, 2011 7:36 PM
Subject: [Qt-interest] Qt 5 and multiple screens
Documentation for QDesktopWidget says, talking about multiple screens
: "All windows opened in the context of the application should be
constrained to the boundaries of the primary screen; for example, it
would be inconvenient if a dialog box popped up on a different screen,
or split over two screens".
I strongly disagree.
Sure, nobody wants a dialog box to appear on a different screen.
But there is much more to consider, as multiple screens nowadays are
getting much more common that at the time of Qt 4 design.
As a consequence, customers more and more frequently request
applications designed to make use of several screens when these are
available : This is certainly the case for financial / monitoring
applications, or browsers, and many others.
As a rule, the user alone should decide which screen, primary or not,
he wants to use, or if he wants his app to be split between several
main windows and several screens ; certainly not the developer, even
less the framework.
It would be very unfortunate if Qt were unable to handle multiple
screens, other that :
- by forcing the customer to constrain it's application within one
screen, the primary one ;
- or by forcing the programmer to split the app into several apps, in
order to enforce the "only one screen per app" rule, with considerable
added complexity and synchronisation problems [actually, the primary
screen rule seems to forbid that option].
A potential fix for Qt 5 might be to consider a screen pos to no
longer be just a couple {x,y}, but to add a third component, the
screen number.
That way, applications with several main windows will not have to
prevent the user from restricting those main windows on the same
screen, and still will be able to accurately pinpoint a screen pos for
tooltips and dialog boxes to appear where they belong.
Source compatibility with Qt 4 could probably be achieved by ignoring
the screen number, with the consequence that the app's windows will
have to be constrained on the same screen.
Bertrand Anon
_______________________________________________
Qt-interest mailing list
Qt-interest at qt.nokia.com
http://lists.qt.nokia.com/mailman/listinfo/qt-interest
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20110601/b694e360/attachment.html
More information about the Qt-interest-old
mailing list