[Qt-interest] Problem: X Error: BadWindow (invalid Window parameter) 3 ...
Zeljko
zeljko at holobit.net
Wed Feb 4 15:55:31 CET 2009
Bjoern Erik Nilsen wrote:
> Just come to think of it, this approach won't work as expected when
> having mouse grabbers (grabMouse() or press-and-hold on a mouse button).
> In that case the Qt::WA_UnderMouse is updated slightly different. The
> attribute is basically updated whenever the widget gets enter/leave
> events.
That was first what comes to my mind when I saw your code (what about mouse
grabbers ? ) ;)
> If you are in doubt whether you can use it or not, I suggest you stick
> with widgetAt()/topLevelAt() to make sure your application continues to
> work as intended.
you mean my application continues to freeze ;)
>
> Anyways, I'm not able to trigger any X errors using
> widgetAt()/topLevelAt(), so your application is very much appreciated in
> my inbox :-)
ok, here is little bit more (my app is commercial and huge , so I cannot
send it to you - sorry), but I can explain concept why I'm calling
widgetAt().
1.I'm using my own tooltips system, since I have some controls which aren't
QObject(), but just QPainter's work (caching it's positions).So I need to
show hint over such controls -> In one sentence -> I don't use tooltip
events.
2.My hint system uses timer and it tracks mouse position on the screen.
3.When tooltip system triggers it calls widgetAt() (I've replaced with
topLevelAt() - but no change - it also freezes sometimes with BadWindow
errors) and if it find widget it shows MY TOOLTIP (created and painted by
me).
4.My tooltip window is QWidget created with Qt::Tooltip flag.After my latest
tests SEEM THAT HERE IS REAL PROBLEM - X ERRORS ARE CAUSED BY THIS WIDGET.
X is looking for specific resource eg. my tooltip and it cannot find it
somehow , so it produces BadWindow -> X_TranslateCoords problem.
Is it correct to use it in such way (I've read in documentation that
Qt::Tooltip is only internaly used ... is it true ? ) ?
Or I should add some special attribute to my tooltip ?
thanks,
zac
More information about the Qt-interest-old
mailing list