PDA

View Full Version : Move window in Clone Mode



ultrabrite
14th June 2006, 17:55
Hello

I've dual head setup in Linux running in Clone Mode. And I'm trying to move my QWidget window from display0 to display1. Below is what I'm doing

Window currently is on display 0


[...]
QDesktopWidget desktop;
QWidget* parent = desktop.screen(1);
setParent(parent);


According to documentation "destop.screen(1)" Returns a widget that represents the screen with index screen. And I assume if I make this returned widget parent for my QWidget window, it will move the window to parent's 0,0 location (moving to display 1). But during runtime i get


Fatal: ASSERT: "!d->isWidget" in file kernel/qobject.cpp, line 1665
Aborted

Does anybody know what i'm doing wrong ?

wysota
14th June 2006, 18:22
You can't use QDesktopWidget (and its screens) as regular widgets, so you can't set it as parent of some other widget. I'm not an expert at this, but I think you have to use some X calls -- Qt won't do the work for you here.