Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QMainWindow::resizeEvent() is called multiple times
Qt 6.11 is out! See what's new in the release blog

QMainWindow::resizeEvent() is called multiple times

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 2.0k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    Boris L
    wrote on last edited by
    #1

    I have found similar discussion here:
    "http://www.qtcentre.org/threads/44594-Stop-resizeEvent()-from-being-called-multiple-times-on-application-startup"
    but is ended up with nothing.

    I subclassed QMainWindow to catch resizeEvent() because I need to know actual window size after calling showMaximized().

    To my surprise resizeEvent() was fired 4 times during my application startup:
    2 times inside showMaximized(), providing size of 100x200 (?????) and 640x480
    and 2 times form the main event loop, providing 100x200 and then 1280x971 (actual size).

    So my question is: what was this and how to distinguish "right" event from the "wrong" one?

    My windows does nor have any child widgets. When I resize the window myself, everything is OK - only 1 event is fired.

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved