Results 1 to 20 of 27

Thread: SplashScreen isn't displayed

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    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: SplashScreen isn't displayed

    Did you try to compile it? Variable pixmap is not a pointer so it would be pixmap.isNull(). Check the return value with a debugger or print it to debug output.
    J-P Nurmi

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

    Default Re: SplashScreen isn't displayed

    I placed this in main.cpp, and reached in console window:
    QObject::connect: No such signal QTimer::timeout()
    But even if there's no timeout() signal, it should show splash

  3. #3
    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: SplashScreen isn't displayed

    Sure it's something wrong with pixmap.
    Make sure you added the qrc to the project file and that you rebuild the project.

    Regards

  4. #4
    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: SplashScreen isn't displayed

    You have in your code timeOut not timeout.
    I'm sure console said the same.

    Regards

  5. #5
    Join Date
    Jan 2006
    Location
    travelling
    Posts
    1,116
    Thanks
    8
    Thanked 127 Times in 121 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: SplashScreen isn't displayed

    Call QApplication::processEvents() after the splash.show()... and read the docs next time ... a QWidget can't appear before the application event loop starts running unless :
    • It has an event loop of its own, just like QMessageBox
    • You manually force events processing


    If you want to display messages (or change the content of the splash in any way...) you'll have to call the same function after each change to allow propagation of show/hide/reisze/paint events...
    Current Qt projects : QCodeEdit, RotiDeCode

  6. #6
    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: SplashScreen isn't displayed

    Quote Originally Posted by fullmetalcoder View Post
    Call QApplication::processEvents() after the splash.show()... and read the docs next time ...
    Actually, processing pending events does not solve the problem. QCoreApplication::exec() is already called and the splash screen is shown by then, same time with the main window. It's just that the pixmap is not loaded correctly so no splash screen is shown either.
    J-P Nurmi

  7. #7
    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: SplashScreen isn't displayed

    This seems to be a double thread. Please don't start new threads on exactly the same subject.
    J-P Nurmi

  8. #8
    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: SplashScreen isn't displayed

    Quote Originally Posted by jpn View Post
    This seems to be a double thread. Please don't start new threads on exactly the same subject.
    Yes, it seemed kind of familiar... The suggestions just came out, no thinking at all.

    Anyway, Sal, loose the resource file and put the png somewhere accessible, like "c:\\image.png" ( this is to make sure you don't mess up the path ), and load the pixmap like this:
    Qt Code:
    1. QPixmap pix = QPixmap( "c:\\image.png");
    To copy to clipboard, switch view to plain text mode 

    There is no room for mistakes here. If it still doesn't show, then try changing the window flags for the splash. But only if that doesn't work.

    Regards

  9. #9
    Join Date
    Jan 2006
    Location
    travelling
    Posts
    1,116
    Thanks
    8
    Thanked 127 Times in 121 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: SplashScreen isn't displayed

    Quote Originally Posted by jpn View Post
    t's just that the pixmap is not loaded correctly so no splash screen is shown either.
    Good point! It might not be the problem here but AFAIK, by default, resources use UNIX-like path, i.e. there is a '/' at the begining...
    Current Qt projects : QCodeEdit, RotiDeCode

  10. #10
    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: SplashScreen isn't displayed

    Quote Originally Posted by fullmetalcoder View Post
    Good point! It might not be the problem here but AFAIK, by default, resources use UNIX-like path, i.e. there is a '/' at the begining...
    Yes, I guess this is it .
    Well, this and actually compiling the qrc.

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

    Default Re: SplashScreen isn't displayed

    This is it. Now splash is displayed. So I have a wrong adress of image in resource file. Of course I have resource file included in my .pro file. But what's the correct adress of this image...hmm...

  12. #12
    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: SplashScreen isn't displayed

    Quote Originally Posted by Salazaar View Post
    This is it. Now splash is displayed. So I have a wrong adress of image in resource file. Of course I have resource file included in my .pro file. But what's the correct adress of this image...hmm...
    This is what I was trying to help you to realize yourself. It would be great help for you to learn, if not how to use debugger for now, but at least how to print informative messages to debug output.
    J-P Nurmi

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

    Default Re: SplashScreen isn't displayed

    D' you mean to use qDebug to see if pixmap.isNull() ?

  14. #14
    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: SplashScreen isn't displayed

    Quote Originally Posted by Salazaar View Post
    D' you mean to use qDebug to see if pixmap.isNull() ?
    In this case, yes. The list of possible use cases is endless, though.
    J-P Nurmi

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

    Default Re: SplashScreen isn't displayed

    I added line
    Qt Code:
    1. qDebug() << "Is pixmap null:" << pixmap.isNull();
    To copy to clipboard, switch view to plain text mode 
    and reached in console:
    QObject::connect: No such signal QTimer::timeout()
    Is pixmap null: true
    So there's a problem with loading image.

  16. #16
    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: SplashScreen isn't displayed

    Could you paste the contents of .qrc file and the output of "tree -f" executed in the project directory from command line? About the signal, you have already been advised more than once how to fix that.
    J-P Nurmi

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

    Default Re: SplashScreen isn't displayed

    Sure. Images.qrc:
    <RCC>
    <qresource prefix="/new/prefix1" >
    <file>File.jpg</file>
    <file>Poker.JPG</file>
    <file>Poker.PNG</file>
    <file>Tools.jpg</file>
    <file>about.jpg</file>
    <file>copy.jpg</file>
    <file>cut.jpg</file>
    <file>delete.jpg</file>
    <file>delfile.jpg</file>
    <file>exit.jpg</file>
    <file>favicon.ico</file>
    <file>find.jpg</file>
    <file>font.jpg</file>
    <file>help.jpg</file>
    <file>mainlogo.jpg</file>
    <file>new.jpg</file>
    <file>paste.jpg</file>
    <file>print.jpg</file>
    <file>save.jpg</file>
    <file>settings.jpg</file>
    <file>sort.jpg</file>
    </qresource>
    </RCC>
    And If I try tree -f I reach that there's no such command

Similar Threads

  1. Replies: 20
    Last Post: 15th August 2008, 23:19
  2. Images/icons. It's not displayed
    By LMZ in forum Qt Tools
    Replies: 37
    Last Post: 18th May 2007, 14:55
  3. JPEG Image isn't displayed!?
    By GodOfWar in forum Qt Programming
    Replies: 9
    Last Post: 16th April 2007, 15:01
  4. QLineEdit - Float number not displayed correct
    By morty in forum Qt Programming
    Replies: 3
    Last Post: 9th November 2006, 00:47

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
  •  
Qt is a trademark of The Qt Company.