Results 1 to 6 of 6

Thread: QSplashScreen and QWebView

  1. #1
    Join Date
    Oct 2011
    Posts
    6
    Qt products
    Qt4
    Platforms
    Windows

    Default QSplashScreen and QWebView

    Dear All,

    I have an application where the main window consists of various QWebView widgets. When the application starts, a QSplashScreen object is displayed to the user. How can I tell the QSplashScreen object to stay visible until all the html pages are properly loaded in their respective QWebView widgets?

    Thanks in advance.

  2. #2
    Join Date
    Mar 2011
    Location
    Hyderabad, India
    Posts
    1,882
    Thanks
    3
    Thanked 452 Times in 435 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Wiki edits
    15

    Default Re: QSplashScreen and QWebView

    Does this not work void QSplashScreen::finish ( QWidget * mainWin )


  3. #3
    Join Date
    Oct 2011
    Posts
    6
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QSplashScreen and QWebView

    Hi Santosh,

    No, it does not work, since QSplashScreen::finish will make the splash screen disappear after the QWebView widgets have been created. This does not however guarantees that the html pages of the relative QWebView widgets have been loaded as well.

  4. #4
    Join Date
    Mar 2011
    Location
    Hyderabad, India
    Posts
    1,882
    Thanks
    3
    Thanked 452 Times in 435 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Wiki edits
    15

    Default Re: QSplashScreen and QWebView

    how are you using QSplashScreen?

  5. #5
    Join Date
    Oct 2011
    Posts
    6
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QSplashScreen and QWebView

    Hi Santosh.

    I am using QSplashScreen as follows:

    Qt Code:
    1. #include <QtGui/QApplication>
    2. #include "myapp.h"
    3. #include <QSplashScreen>
    4.  
    5. int main(int argc, char *argv[])
    6. {
    7. QApplication app(argc, argv);
    8. mainWindow w;
    9.  
    10. QSplashScreen *splash = new QSplashScreen(QPixmap(":/myapp/Resources/splash.png"));
    11.  
    12. splash->show();
    13. Qt::Alignment topRight = Qt::AlignRight | Qt::AlignTop;
    14. splash->showMessage(QObject::tr("Setting up the main window..."),topRight,Qt::white);
    15.  
    16.  
    17. w.setCentralWidget(w.splitter);
    18. w.show();
    19. app.processEvents();
    20.  
    21. splash->finish(&w);
    22. delete splash;
    23.  
    24. return app.exec();
    25. }
    To copy to clipboard, switch view to plain text mode 

  6. #6
    Join Date
    Mar 2011
    Location
    Hyderabad, India
    Posts
    1,882
    Thanks
    3
    Thanked 452 Times in 435 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Wiki edits
    15

    Default Re: QSplashScreen and QWebView

    you are deleting the "splash" ! delete it when you are done loading (somewhere in a slot), also either set a parent to "splash" or create it on stack.

    I assume QWebView loading is initiated in mainWindow, then have a finishedLoading() signal in mainWindow, and connect it to delteLater() or close() of "splash"

Similar Threads

  1. Animating QSplashScreen
    By pssss in forum Qt Programming
    Replies: 3
    Last Post: 3rd September 2011, 12:39
  2. QSplashScreen transparncy
    By vajindarladdad in forum Newbie
    Replies: 6
    Last Post: 12th October 2009, 14:12
  3. QSplashScreen 4.5.0 vs. 4.3.4
    By hosseinyounesi in forum Qt Programming
    Replies: 0
    Last Post: 23rd September 2009, 12:43
  4. QSplashScreen question
    By graciano in forum Qt Programming
    Replies: 7
    Last Post: 14th July 2009, 13:39
  5. Stylesheets on QSplashScreen
    By GuS in forum Qt Programming
    Replies: 0
    Last Post: 16th July 2008, 15:50

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.