LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-07-2011, 01:37 AM   #1
Gavin Harper
Member
 
Registered: Feb 2010
Location: Finland
Distribution: Slackware
Posts: 169

Rep: Reputation: 24
QSplashScreen - Extend loading time to display splash for longer?


Hello,

One requirement of a project I am currently working on (for Maemo) is that the Qt application displays a QSplashScreen when it loads.

My issue is that the application is fairly small and I have written it to load components etc as they are required rather than at start-up. This has lead to quick start up times (which, in a perfect world is what we all strive for!)

How would I intentionally delay the start-up time so that the splash shows for longer?

I have investigated
Quote:
QTimer:: oneShot() (Space added to prevent smiley)
however, its prototype dictates that it be connected to a slot. I am running this QSplashScreen from inside main so this is neither needed nor feasible.

What is the best way to essentially do this:

Code:
Display Splash
Timer for 3 seconds
Close Splash
Display mainWindow
I do not want to use native system calls such as sleep() and would instead rather a Qt based solution.

Thank you for your advice

Last edited by Gavin Harper; 04-07-2011 at 01:39 AM.
 
Old 04-08-2011, 10:58 AM   #2
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,882
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
The QSplashScreen is not going to go away until you start you main event loop. In fact, I have the opposite gripe which is that instead of using showMessage() to put up progress text, I'd rather use a timer to swap between 3 or 4 splash screens that have a rotating widget so that the user sees that the application is working while loading. A form of animation. However since the main event loop has not yet been run, I also cannot use any timers, they will never time out.

So my first recommendation here is that you do use sleep or nanosleep inline to get that delay. Or you can try sending a signal to your Qt application from another process that you are waiting for to be completed before you show your main screen. I'm not sure if that will work, "within the Qt library" because of that main event loop issue; however if you use straight C and wait on a Linux signal, then it may work.

My assumption was that you wanted to delay the Qt main window to wait for other processes; however in re-reading you're saying that it's super fast and you do not wish the splash screen to be so rapid that no one notices it.

A.) What's the big deal? Everyone I know wants the main window up ASAP.
B.) If this is a requirement or a sincere want on the part of the project where the splash screen shows branded information and/or copyrights, then just use sleep and stop trying to be Qt. (Hey, I can actually use a pun correctly there. I still pronounce it que-tee, but Nokia/Digia wants to pronounce it as "Cute")
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How do extend a Monitor/display virtually? samsung_sisc Linux - Desktop 2 12-12-2010 11:38 PM
Extend Desktop to another X Windows Display rseward Linux - Desktop 3 11-24-2009 12:43 PM
show a splash screen while gnome is loading theacerguy Linux - General 3 08-27-2009 07:52 AM
GRUB: splash image with loading bar Michele Spinolo Linux - Software 1 11-26-2004 03:51 AM
Extend Display to second monitor(ati 9600) Bujitsu Fedora 0 02-14-2004 06:51 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:31 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration