Strictly speaking, I am not sure these are OSG questions as much as they
are Qt questions, but since I am a developer an OSG/Qt app myself, I
will share what little I know.

I know that reparenting under some windowing systems can invalidate
window IDs, so that might be related to your "BadWindow" errors.  You
would have to check with your Qt documentation and your windowing system
documentation to be sure (that is, if it is documented).  You might have
tried this already, but if not, then try setting the OSG adapter
widget's parent in the constructor, and reparenting the parent widget,
instead of the OSG adapter widget.  I cannot seem to find where I found
this problem documented; you might start your search with winId, and go
from there.

As to the "Exit" problem you describe, look into overriding the
protected virtual closeEvent function on your main window.  Decide
whether or not to accept the event; if you accept, have closeEvent
inform the app to closeAllWindows at an appropriate time.  You should
probably wait until the main window actually closes before calling
closeAllWindows on the app, since not waiting can cause problems
(I do not recall if it is a recursion problem, or a "you closed this
already" problem).

I hope this helps...

D.J.


On Mon, Jul 27, 2009 at 4:52 PM, Butler, Lee Mr CIV USA
USAMC<[email protected]> wrote:
> Classification: UNCLASSIFIED
> Caveats: NONE
>
> The example code has problems on my machine (RedHat 5, Qt 4.5.2, NVidia
> 185.18.14, KDE).  I've got svn revision 10512 from HEAD.
>
> The code compiles just fine (using qmake) but on startup I get:
>
> X Error: BadWindow (invalid Window parameter) 3
>  Major opcode: 3 (X_GetWindowAttributes)
>  Resource id:  0x2200017
> X Error: BadWindow (invalid Window parameter) 3
>  Major opcode: 18 (X_ChangeProperty)
>  Resource id:  0x2200017
> X Error: BadWindow (invalid Window parameter) 3
>  Major opcode: 18 (X_ChangeProperty)
>  Resource id:  0x2200017
> X Error: BadWindow (invalid Window parameter) 3
>  Major opcode: 3 (X_GetWindowAttributes)
>  Resource id:  0x2200043
> X Error: BadWindow (invalid Window parameter) 3
>  Major opcode: 18 (X_ChangeProperty)
>  Resource id:  0x2200043
> X Error: BadWindow (invalid Window parameter) 3
>  Major opcode: 18 (X_ChangeProperty)
>  Resource id:  0x2200043
> X Error: BadWindow (invalid Window parameter) 3
>  Major opcode: 3 (X_GetWindowAttributes)
>  Resource id:  0x2200045
> X Error: BadWindow (invalid Window parameter) 3
>  Major opcode: 18 (X_ChangeProperty)
>  Resource id:  0x2200045
> X Error: BadWindow (invalid Window parameter) 3
>  Major opcode: 18 (X_ChangeProperty)
>  Resource id:  0x2200045
> X Error: BadWindow (invalid Window parameter) 3
>  Major opcode: 3 (X_GetWindowAttributes)
>  Resource id:  0x220004f
> X Error: BadWindow (invalid Window parameter) 3
>  Major opcode: 18 (X_ChangeProperty)
>  Resource id:  0x220004f
> X Error: BadWindow (invalid Window parameter) 3
>  Major opcode: 18 (X_ChangeProperty)
>  Resource id:  0x220004f
> X Error: BadWindow (invalid Window parameter) 3
>  Major opcode: 3 (X_GetWindowAttributes)
>  Resource id:  0x2200051
> X Error: BadWindow (invalid Window parameter) 3
>  Major opcode: 18 (X_ChangeProperty)
>  Resource id:  0x2200051
> X Error: BadWindow (invalid Window parameter) 3
>  Major opcode: 18 (X_ChangeProperty)
>  Resource id:  0x2200051
>
> I can resize the "outboard" window without any problem, but attempting to
> resize the "main" window causes X11 to lock up.
>
> If I switch to gnome, it runs OK.
>
> Under either Gnome or KDE, selecting "Main->Exit" from the application
> causes the main window to close, but leaves a frozen "Outboard" window
> behind.  The application does not quit until the outboard window is closed.
>
> Lee
>
> Classification: UNCLASSIFIED
> Caveats: NONE
>
>
>
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to