[Interest] Update widget geometry BEFORE window shown

Henry Skoglund henry at tungware.se
Sat May 25 09:11:31 CEST 2024


On 2024-05-24 21:14, David M. Cotter wrote:
> I’ve tried everything I can think of. The ONLY one that works the way 
> I NEED is the first one, but that one flashes the window on the screen
>
> #if 1
> qWidgetP->show();
> qWidgetP->hide();
> QtLetTimersFire(0);
> #endif
>
Hi, have you tried the old Windows trick of moving the widget to 
Cleveland, i.e. way off into negative territory like Minimize does? 
https://devblogs.microsoft.com/oldnewthing/20041028-00/?p=37453
Say you have this code:

    auto qWidgetP = new QWidget();
    qWidgetP->setGeometry({100,100,1000,1000});
    qWidgetP->show();
    QTimer::singleShot(1000,[qWidgetP]{ qWidgetP->hide(); });

FLashes for sure. But if you position it like this:
    qWidgetP->setGeometry({-32000,-32000,1000,1000});
do all the setup and then later move it back into the normal coords.
The flash will still occur but noone will here you scream/flash.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20240525/c46ce302/attachment.htm>


More information about the Interest mailing list