[Development] Wrong resize event for QAbstractScrollArea derives

raven-worx Software info at raven-worx.net
Wed Oct 16 16:23:48 CEST 2013


> On Friday 11 October 2013 13:31:31 raven-worx Software wrote:
>> Hi,
>>
>> a question out of curiosity:
>> In QAbstractScrollArea::viewportEvent() a resize event is passed to
>> the base class implementation of the event handler. Whats the reason
>> for doing this for a non input event?
>>
>> I'm asking because, this actually causes that you receive a wrong
>> resize event for your scroll area widget, which actually didn't resize
>> at all.
>>
>> I hope i haven't overseen something?
>>
>> You can find this code in Qt4 and still in Qt5.
>
> Because QAbstractScrollArea::resizeEvent, as documented, is supposed to be
> called when the viewport is called.
> This is the behaviour of QAbstractScrollArea with most event.  you can
> intercept viewport event form the widget itself.
> One can argue if it is a good idea, but it has been like that since  
> Qt 4.0 and
> is not going to change now.
>
> --
> Olivier
>
> Woboq - Qt services and support - http://woboq.com - http://code.woboq.org
>

i know that is like this - as i already stated ;)
I was asking if there is a special reason for doing this for a event  
which is not an input event, because you just receive the wrong size  
in the event...
Which of course makes sense for input event derivations but not for  
the resize event.





More information about the Development mailing list