[Qt-interest] Multi-head API?

Robin Helgelin lobbin at gmail.com
Mon Nov 16 13:27:48 CET 2009


On Tue, Oct 20, 2009 at 11:15, Paul Colby <qt at colby.id.au> wrote:
> I think you'll find (I haven't tried it, but seems to be so on Windows
> at least) that each screen has a distinct geometry ie
> QDesktopWidget::screenGeometry would return a different, and
> non-overlapping QRect for each screen.
>
> Assuming that's the case, you should be able to set your main window's
> geometry to lie within a different screen's QRect (or even across more
> than one).
>
> eg:
>
> this->setGeometry(QApplication::desktop()->screenGeometry(2)); // Take
> this as pseudo-code, but it's probably right.
>
> should put "this" on to screen "2", and make it the full size of that
> screen (just an example).
>
> I haven't tried that exactly, but I've done something very similar in
> the past to make an application startup on a different screen to the
> one it was launched from... worked on Windows XP at least.

I've just run into the same problem. I guess it would have been a lot
easier if one could specify screen when creating a top-level QWidget.

-- 
        regards,
        Robin



More information about the Qt-interest-old mailing list