[Qt-interest] Qt 5 and multiple screens

bd.anon at free.fr bd.anon at free.fr
Thu Jun 2 01:36:09 CEST 2011


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



More information about the Qt-interest-old mailing list