[Qt-jambi-interest] Widget Size 0?

Dawid Sip vad at poczta.onet.pl
Tue Apr 15 15:47:30 CEST 2008


>> Hi, Dawid.
>>
>> Dawid Sip wrote:
>>     
>>> I dondt know why after putting first dockWidget into a Splitter and
>>> getting size of that dockWidget i get 0 for width and for height, but
>>> after putting a second dockWid into the Splitter and again getting the
>>> size immediately after the addition i get the right height and the
>>> right width. Does anyone know how to get the right size after adding
>>> the first dockWidget?
>>>       
>> You can't depend on the initial size of the widget prior to any event
>> handling.
>>     
> [...]
>
> I'm not an expert, but I think the following bunch of code inserted after
> the first addition and before requesting size of the (first) added widget
> could help.
>
> Code:
>
> QEventLoop.ProcessEventsFlags pef = new
>  	QEventLoop.ProcessEventsFlags(QEventLoop.ProcessEventsFlag.ExcludeUserInputEvents);
> pef.set(QEventLoop.ProcessEventsFlag.ExcludeSocketNotifiers);
> QAbstractEventDispatcher.instance().processEvents(pef);
>
>
> --
> Tomasz 'Trog' Welman
>   
Hi Tomasz,

I was thinking the same way, to somehow get a gripp of the event loop. 
Fortunately enough this wasn't necessary. Thanks anyway, it might come 
in handy later ;)

cheers,
Dawid


More information about the Qt-jambi-interest mailing list