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

List:       kde-devel
Subject:    Re: Qtoolbox and style
From:       Remi Villatel <maxilys () tele2 ! fr>
Date:       2006-02-28 0:03:18
Message-ID: 44039346.7010806 () tele2 ! fr
[Download RAW message or body]

Michael Pyne wrote:

>> const QToolBox* tb = (const QToolBox*) widget;
>> int index = tb->indexOf( tb->childAt( QPoint(left, top) ) );
	[---CUT---]

>> The problem is that it works only once --when the toolbox tab is
>> selected-- then never again. When a pseudo-tab is selected for the
>> second time, index == -1 as if it was out of its parent.
	[---CUT---]

> Is the QRect being passed to your style function in global coordinates or 
> widget coordinates?
	[---CUT---]

I guess it's in widget coordinates since (top left) is always (0,0).

> Some functions that use QRect expect global coordinates, so if the QRect 
> passed to you is in widget coordinates that could explain things.
	[---CUT---]
> To switch between the different kinds, QWidget has a mapToGlobal() and a 
> mapFromGlobal() call.

I think I tried all available mappings... but that shouldn't be 
necessary since it works better without them and I already get valid 
indexes --with the stupid limitations I mentioned hereabove. I say 
"stupid" because there's something really strange in the fact that it 
won't work twice for the same (selected) tab.

Besides, there's something wrong with the mappings. All the tabs have 
the same widget coordinates... and also the same mapped coordinates. I 
tried to work with the coordinates, thinking it should be easy to find 
this way if a tab is at the top of its toolbox parent, at the bottom or 
none of the two. It didn't lead me much further than indexOf().

I'm kinda running out of imagination.

-- 
==================
Remi Villatel
maxilys_@_tele2.fr
==================
 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread] 

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