[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: Bug? kwm, Qt or mine?
From:       Sven Radej <sven () lisa ! exp ! univie ! ac ! at>
Date:       1998-05-03 8:09:46
[Download RAW message or body]

On Sun, 03 May 1998, Burkhard Lehner wrote:
(...)
>AFAIK QWidget::x() and QWidget::y() don't ask the window manager for any
>position, but use the internal members. These, on the other hand, should
>always represent the position of the the widget RELETIVE TO IT'S PARENT
>WIDGET. Maybe that's the reason why it returns so unexpected results?
I know that. I was talking about top level widgets (which have root
window for parent)

>
>> >Please try using 
>> >     QRect r = KWM::geometry(winId());
>> >     
>> >and then use r.x() and r.y() instead of the QWidget methods.
>> >
>> >Does this improve anything?
>> Yes, works perfect when window is toplevel. But when window is child
>> widget, position is wrong, size is ok (Maybe I should have it mapped to
>> parent or from global or so.). But it should work.
>
>Yes, that would be a good idea, I think.
>QWidget::mapToGlobal (QPoint (0, 0)); should return the absolute
>coordinate of the upper left corner of the widget (the widget, not the
>decoration frame). Maybe that is what you were looking for?
Yes that was the problem. It's working now, thanks.

What I want to know is why x() and y() do not always return correct
results.
 --
Sven Radej

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic