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. QFrame: Why do i need paint twice to be able to see it?
Forum Updated to NodeBB v4.3 + New Features

QFrame: Why do i need paint twice to be able to see it?

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 1.9k 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.
  • O Offline
    O Offline
    olibali
    wrote on last edited by
    #1

    Hello. I've attached a project. It can be useful:
    "file:":http://www.olibali.info/pages/starter.tar.gz
    It creates a spash screen ( with transparent PNG ) and starts loading things.
    ( reading settings, allocating memory, setting up dialogs, windows...... these are not included but easily can be done )

    During loading through a text buffer it tells the user what's going on. When finished opens up the mainwindow.

    My problem is that i have to paint twice and only after then emit the showed() function, which will start the initialization. Why is that? If in first paintEvent() i call emit showed() I can't see the painted QFrame. But one paint is done, isn't it?

    A few pics:
    !http://img46.imageshack.us/img46/8453/screenshotat20111218232.png(first)!
    !http://img440.imageshack.us/img440/8453/screenshotat20111218232.png(second)!

    This is how I solved it, but I don't understand the why... it should work first time...:
    in paintEvent() function:
    @
    itsShowed = 0;
    .
    .
    .
    if( itsShowed < 2 ){
    itsShowed++;
    if( itsShowed == 2 ) emit showed();
    }@

    If i only put
    @emit showed();@
    in the paintEvent() function, i could only see the window appear after the initialization, but then it's closed right away. So no SplashScreen at all. Why?

    Houston, we have a problem.

    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