Page 2 of 2 FirstFirst 12
Results 21 to 28 of 28

Thread: Splash Screen

  1. #21
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Splash Screen

    ":new/prefix1/Poker.jpg"
    This is a path in the resource filesystem.
    To access the image that way you have to add it to a qrc file under that path, and compile the qrc.

    Anyway, make sure you're able to load jpeg files and this jpeg file does not have any weird compression that the Qt plugin is not able to interpret.

    Regards

  2. #22
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Splash Screen

    The splashscreen is displayed with Qt::WindowStaysOnTopHint so it's on top of other windows.

  3. #23
    Join Date
    May 2007
    Posts
    315
    Thanks
    1
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Splash Screen

    So I have to use ":". I will try to add it and use png image instead jpg to see if this was a problem.
    Last edited by Salazaar; 4th June 2007 at 09:40.

  4. #24
    Join Date
    May 2007
    Posts
    315
    Thanks
    1
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Splash Screen

    I added ":" prefix, and selected png image instead jpg, but it still doesn't work. Image's not displayed. Contents of my main.cpp file again
    Qt Code:
    1. #include <QApplication>
    2. #include <QPlastiqueStyle>
    3. #include <QSplashScreen>
    4. #include <QTimer>
    5. #include "maker.h"
    6. #include "about.h"
    7.  
    8. int main(int argc, char *argv[])
    9. {
    10. QApplication::setStyle ( new QPlastiqueStyle() );
    11. QApplication app(argc, argv);
    12. QPixmap pixmap(":new/prefix1/poker.png");
    13. QSplashScreen splash(pixmap);
    14.  
    15.  
    16. QTimer splashTimer;
    17.  
    18. splashTimer.setSingleShot( true );
    19.  
    20. splashTimer.setInterval( 4000 ); //4 seconds
    21.  
    22. QObject::connect( &splashTimer, SIGNAL( timeOut() ), &splash, SLOT( close()) );
    23. splashTimer.start();
    24. splash.show();
    25.  
    26. MainWindow MainWindow;
    27. MainWindow.show();
    28.  
    29. return app.exec();
    30. }
    To copy to clipboard, switch view to plain text mode 
    Do someone know, what's wrong?
    edit:
    all forms were created using designer

  5. #25
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Splash Screen

    Add "CONFIG+=debug console" to your project file, rebuild, run and see the message about a nonexistent signal "QTimer::timeOut()". It should be "timeout".

  6. #26
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Splash Screen

    Quote Originally Posted by wysota View Post
    Add "CONFIG+=debug console" to your project file, rebuild, run and see the message about a nonexistent signal "QTimer::timeOut()". It should be "timeout".
    Yes, but that does not explain the splash not showing up.

    Regards

  7. #27
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Splash Screen

    Salazaar, could you check what QPixmap::isNull() returns once you've enabled console like Wysota suggested:
    Qt Code:
    1. #include <QtDebug>
    2. ...
    3. qDebug() << pixmap.isNull();
    To copy to clipboard, switch view to plain text mode 
    J-P Nurmi

  8. #28
    Join Date
    May 2007
    Posts
    315
    Thanks
    1
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Splash Screen

    I don't know what do you mean, but I've done it, but there appear errors in compilation that
    C:\Dev-cpp\.... cannot find QtGuid4. And I don't know is it this what you were asking about, but:
    collect2: ld returned exit status

Similar Threads

  1. Problem with Splash Screen ?
    By vinod in forum Qt Programming
    Replies: 13
    Last Post: 11th April 2020, 18:15
  2. multi screen
    By Thomas Feldman in forum Qt Programming
    Replies: 5
    Last Post: 9th May 2007, 17:41
  3. QTimer based Splash Screen
    By bpetty in forum Newbie
    Replies: 6
    Last Post: 15th December 2006, 01:51
  4. Replies: 3
    Last Post: 8th December 2006, 19:51
  5. Problem with screen update...
    By mysearch05 in forum Qt Programming
    Replies: 2
    Last Post: 27th January 2006, 19:24

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.