let QWidget send simultaneous resizeevent when resize happens
Hello all,
in my project im using another layout system other than QLayout.
there is a layout algorithm which triggers a size calculation when QWidget::resize() happens.
i read the doc of QWidget::resize() only when the widget is visible he sends a resizeevent immediately.
is there any way to let a widget always send a resizeevent when resize happens?
ps: currently im using the trick with flag WA_WState_Visible, since this flag is even not documented i assume it is not supposed to use.
Thank you.
Re: let QWidget send simultaneous resizeevent when resize happens
Why do you want to calculate the layout when the widget is hidden? Maybe you could recalculate the layout when showEvent() happens to avoid the problem. Better yet implement your own layout as a proper QLayout subclass.
Re: let QWidget send simultaneous resizeevent when resize happens
Quote:
Originally Posted by
wysota
Why do you want to calculate the layout when the widget is hidden? Maybe you could recalculate the layout when showEvent() happens to avoid the problem. Better yet implement your own layout as a proper
QLayout subclass.
Hello. We are not creating a new project while porting it to Qt.
because of historical reason the old layout we cannot remove in the near future.
may i know whether it is not recommanded to trigger a resizeevent before the widget visible?
Re: let QWidget send simultaneous resizeevent when resize happens
Quote:
Originally Posted by
cic1988
Hello. We are not creating a new project while porting it to Qt.
because of historical reason the old layout we cannot remove in the near future.
I have no idea what you mean by that.
Quote:
may i know whether it is not recommanded to trigger a resizeevent before the widget visible?
All widgets gain their physical attributes (like font size, size, etc.) when they are shown for the first time.
Re: let QWidget send simultaneous resizeevent when resize happens
Quote:
Originally Posted by
wysota
I have no idea what you mean by that.
you suggest me to use QLayout. I wrote why i didnt use it.
Quote:
Originally Posted by
wysota
All widgets gain their physical attributes (like font size, size, etc.) when they are shown for the first time.
then it's clear. Thanks.
Re: let QWidget send simultaneous resizeevent when resize happens
Quote:
Originally Posted by
cic1988
you suggest me to use QLayout. I wrote why i didnt use it.
Almost all you need to do to make your layout QLayout compatible is to reimplement QLayout::setGeometry() and position all widgets from within that method.