Results 1 to 5 of 5

Thread: image not showing in splash screen

  1. #1

    Default image not showing in splash screen

    Hi

    I am developing on a Mac. I added a QSplashScreen to my app and it worked nicely, displaying a transparent png. Since i added the following call (before i create my QApplication object as per the docs), all i get is a grey window, the same dimensions as my png:

    QApplication::setGraphicsSystem("raster");

    If i uncommented then the image comes back. It's vital to my app that it draws in raster mode.

    Any help would be great,

    thanks

    David

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: image not showing in splash screen

    Is the entire area grey, or just the transparent area?
    I have seen other mention of translucency on Mac under the raster renderer: here

    You might like to share a bit more code.

  3. #3

    Default Re: image not showing in splash screen

    Hi

    Its nothing to do with the image being transparent, since I tried with non-transparent image
    And the effect is the same,

    What other code do you need?

    The entire area is grey. It seems to be an issue with rendering images before the main application loop,
    When working in raster mode on a mac.

  4. #4
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: image not showing in splash screen

    The code that shows how you are creating the splash screen, showing it, and calling processEvents() etc...

  5. #5

    Default Re: image not showing in splash screen

    Hi

    I created a simple window application to reproduce the problem, which i believe must be a Qt bug. Here is the code for main.cpp:

    Qt Code:
    1. #ifdef Q_OS_WIN
    2. #include <windows.h> // for Sleep
    3. #else
    4. #include <time.h>
    5. #endif
    6.  
    7. static void Sleep(int ms)
    8. {
    9. //QTEST_ASSERT(ms > 0);
    10.  
    11. #ifdef Q_OS_WIN
    12. Sleep(uint(ms));
    13. #else
    14. struct timespec ts = { ms / 1000, (ms % 1000) * 1000 * 1000 };
    15. nanosleep(&ts, NULL);
    16. #endif
    17. }
    18.  
    19. int main(int argc, char *argv[])
    20. {
    21. // need this on mac to render web contents nice and smooth
    22. QApplication::setGraphicsSystem("raster");
    23.  
    24. QApplication a(argc, argv);
    25.  
    26. QSplashScreen splash(QPixmap(":/showme.jpg"));
    27. splash.show();
    28.  
    29. Sleep(2000);
    30.  
    31. splash.hide();
    32.  
    33. MainWindow w;
    34. w.show();
    35.  
    36. return a.exec();
    37. }
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. Problem with Splash Screen ?
    By vinod in forum Qt Programming
    Replies: 13
    Last Post: 11th April 2020, 17:15
  2. splash screen problem
    By wizarda in forum Qt Programming
    Replies: 9
    Last Post: 15th January 2011, 02:05
  3. Showing a splash screen with transparency.
    By kremuwa in forum Qt Programming
    Replies: 11
    Last Post: 12th September 2010, 22:46
  4. Splash screen showing for two seconds
    By Koas in forum Qt Programming
    Replies: 5
    Last Post: 17th October 2008, 19:40
  5. Splash Screen
    By Salazaar in forum Newbie
    Replies: 27
    Last Post: 4th June 2007, 17:31

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.