[Qt-interest] Multiple X servers
Bradley T. Hughes
bradley.hughes at nokia.com
Fri Jan 23 12:31:03 CET 2009
andrew.m.goth at l-3com.com wrote:
> How can I configure different Qt windows within a single application to
> be displayed on separate X servers?
FYI, Qt only supports connecting to a single X server display.
> I'm looking for functionality similar to the "-screen" option to
> [toplevel] on Tk:
>
> http://www.tcl.tk/man/tcl8.6/TkCmd/toplevel.htm#M12
>
> "Specifies the screen on which to place the new window. Any valid screen
> name may be used, even one associated with a different display. Defaults
> to the same screen as its parent."
This can be done by passing the return value of QDesktopWidget::screen() as
the parent to QWidget. For example, to place a QMainWindow on screen 1
(instead of the default which is usually screen 0), do this:
QMainWindow *mainWindow = new QMainWindow(QDesktopWidget::screen(1));
--
Bradley T. Hughes (Nokia-D-Qt/Oslo), bradley.hughes at nokia.com
Sandakervn. 116, P.O. Box 4332 Nydalen, 0402 Oslo, Norway
More information about the Qt-interest-old
mailing list