[SDL] Help with SDL inside QT

Julien Pauty jpauty at irisa.fr
Tue Jan 21 00:44:03 PST 2003


Many thanks,

I have also tried to do such a thing, but never managed to do it. It will
be really useful (at least for me !).

Julien
----- Original Message -----
From: "Sam Lantinga" <slouken at devolution.com>
To: <sdl at libsdl.org>
Sent: Tuesday, January 21, 2003 8:01 AM
Subject: Re: [SDL] Help with SDL inside QT


> > I'm trying to use SDL to update a Qt widget. So i tried the window id
> > hack, but I wasn't successfull and I can't find help anywhere. What I
did:
> > 1. made the qwidget
> > 2. got its window id (with the winId() method)
> > 3. used the id to set SDL_WINDOWID env variable
> > 4 tried to use SDL on that window.
>
> Since this is asked so often it qualifies as a FAQ, but nobody has ever
> answered it, I took a crack at it myself with your steps as a starting
> point (thanks!) :)
>
> And... I got it!
> The attached archive builds a simple Qt application qtSDL, which creates
an
> SDL "screen" widget, and if sample.bmp resides in the current directory,
> blits that to the center of the widget.  This screen widget correctly
handles
> resizing, paint events, and drawing interactions with Qt.  Note that SDL
no
> longer handles events for the screen at this point, so you'll have to do
all
> your actions based on Qt signals.
>
> I've only tested this with Qt 3.0 on X11.
>
> If the attachment gets munged, you can find this at:
> http://www.libsdl.org/cvs/qtSDL.tar.gz
>
> See ya!
> -Sam Lantinga, Software Engineer, Blizzard Entertainment





More information about the SDL mailing list