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. Custom Widget Paint Event Too Soon?
Forum Updated to NodeBB v4.3 + New Features

Custom Widget Paint Event Too Soon?

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 2.0k Views 1 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.
  • C Offline
    C Offline
    Chris H
    wrote on last edited by
    #1

    I'm writing a custom widget, and it appears to be getting a really early paintEvent() call before its proper size has been set by the layout it's in, causing it to flash up on the screen really large before being immediately resized to the correct dimensions. I'm clearly missing a standard widget procedural step during initialization, but what is it?

    1 Reply Last reply
    0
    • G Offline
      G Offline
      goetz
      wrote on last edited by
      #2

      Do you happen to call show() before you put it into the layout?

      http://www.catb.org/~esr/faqs/smart-questions.html

      1 Reply Last reply
      0
      • C Offline
        C Offline
        Chris H
        wrote on last edited by
        #3

        Ah. Yes indeed, through a long, convoluted series of function calls that certainly should not be calling show(). I wonder why I put that in there? Thanks for the kick.

        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