[Qt-interest] Multi-head API?

Murray Cumming murrayc at murrayc.com
Tue Oct 20 09:51:52 CEST 2009


On Mon, 2009-10-19 at 09:00 -0400, Josiah Bryan wrote:
> http://doc.trolltech.com/4.5/qdesktopwidget.html
> 
> 	QDesktopWidget *d = QApplication::desktop();
> 	int ns = d->numScreens();
> 
> 	for(int screenNum = 0; screenNum < ns; screenNum ++)
> 	{
> 		QRect geom = d->screenGeometry(screenNum);
> 
> 		// do whatever with geom
> 	}

Thanks. I see that I can discover what screen a widget is mostly on with
int QDesktopWidget::screenNumber ( const QWidget * widget = 0 ) const
http://doc.trolltech.com/4.5/qdesktopwidget.html#screenNumber

But how can I move a window to a screen, or say that it should appear
there when it is shown? The class documentation says "Applications can
use this classs ... to place child widgets on one screen."

I don't see anything suitable in QMainWindow, QWidget, or QApplication
either.

> Murray Cumming wrote:
> > Is there any API in Qt to discover the available physical screens and
> > the available configured displays? Likewise, is there any API I can use
> > to discover what display a window is on and to say that a particular
> > window should be on a particular screen?
> > 
> > I'm hoping for equivalents to GTK+'s GdkScreen and GdkDisplay objects,
> > http://library.gnome.org/devel/gdk/stable/GdkScreen.html
> > http://library.gnome.org/devel/gdk/stable/GdkDisplay.html
> > and to functions such as gtk_window_set_screen():
> > http://library.gnome.org/devel/gtk/unstable/GtkWindow.html#gtk-window-set-screen
> > 
> 


-- 
murrayc at murrayc.com
www.murrayc.com
www.openismus.com




More information about the Qt-interest-old mailing list