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. Splashscreen not comming up with transparant background
Qt 6.11 is out! See what's new in the release blog

Splashscreen not comming up with transparant background

Scheduled Pinned Locked Moved General and Desktop
4 Posts 3 Posters 2.7k 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.
  • G Offline
    G Offline
    GroundZero
    wrote on last edited by
    #1

    Dear readers,

    No matter what I tried, I cannot get my Splashscreen to show up with transparent parts.
    I am using a PNG file with transparant parts, only thing is that it wont show the transparant
    parts, instead it shows a white background.

    My code is:

    @QSplashScreen *sscreen = new QSplashScreen;
    sscreen->setPixmap(QPixmap("c:/splash.png"));
    sscreen->setWindowFlags(Qt::WindowStaysOnTopHint | Qt::SplashScreen);@

    I hope someone can help me out.

    I am new to Qt programming so please go easy on me and try not to give me a
    100 line big class ;) :P

    EDIT:
    Found this solution on the internet, but what I want is to show the splashscreen for 5
    seconds, then remove it and show my app, now I cannot remove this splashscreen anymore.

    @ QPixmap aPixmap("c:/splash.png");
    QLabel* aWidget = new QLabel(0, Qt::FramelessWindowHint|Qt::WindowStaysOnTopHint);
    aWidget->setAttribute(Qt::WA_TranslucentBackground);
    aWidget->setPixmap(aPixmap);
    aWidget->show();@

    1 Reply Last reply
    0
    • A Offline
      A Offline
      Asperamanca
      wrote on last edited by
      #2

      Have you tried to set Qt::WA_TranslucentBackground in your original sample?

      As for the second sample: How do you try to "remove the splash screen"?

      1 Reply Last reply
      0
      • K Offline
        K Offline
        KA51O
        wrote on last edited by
        #3

        You can have a look at the "code":http://developer.qt.nokia.com/forums/viewthread/10075/ I posted a while ago. I'm using QTimer::singleShot(..) to close the splashscreen after a specified time (in this case 3 seconds).

        @
        QTimer::singleShot(3000, &splashScrWindow ,SLOT(close()));
        @

        1 Reply Last reply
        0
        • G Offline
          G Offline
          GroundZero
          wrote on last edited by
          #4

          oh thats awesome!!! thanks a lot KA510 awesome!

          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