How to code a loading'.' '..' '...' page that redirects to another ui after 2 seconds?
-
I am extremely new to qt designer and python.
I have made a UI page that will appear when you open the application. I want the UI page to have an animated "loading..." where the dots change every 0.5 seconds. I want this page to automatically change to my other UI page after 2 seconds of waiting.How would I code that? And where would I put that code?
Thanks so much,
Aaron
-
I am extremely new to qt designer and python.
I have made a UI page that will appear when you open the application. I want the UI page to have an animated "loading..." where the dots change every 0.5 seconds. I want this page to automatically change to my other UI page after 2 seconds of waiting.How would I code that? And where would I put that code?
Thanks so much,
Aaron
@itsnotaron Sounds like you need https://doc.qt.io/qt-5/qprogressdialog.html
Or https://doc.qt.io/qt-5/qprogressbar.html depending on how you want to do this. -
Hi and welcome to devnet,
Out of curiosity, why impose that 2 seconds delay to your user ?
Based on your description it's not really justified.
-
I am extremely new to qt designer and python.
I have made a UI page that will appear when you open the application. I want the UI page to have an animated "loading..." where the dots change every 0.5 seconds. I want this page to automatically change to my other UI page after 2 seconds of waiting.How would I code that? And where would I put that code?
Thanks so much,
Aaron
@itsnotaron
Apart from what @SGaist says (always heed his advice!).In addition to @jsulm , there is also
QSplashScreen
, https://doc.qt.io/qt-5/qsplashscreen.html if you specifically intend during application startup. You can change message on it dynamically. I'm sure it's the same principle asQProgresss...
. -
Hi and welcome to devnet,
Out of curiosity, why impose that 2 seconds delay to your user ?
Based on your description it's not really justified.
@SGaist For an assignment I have, I need to make a (fake, but) realistic looking application. I proposed a loading page, so I want to follow through with that.
I don't need a loading page, but to make it more realistic/to get more marks, I want to add a 2 second loading page. -
@SGaist For an assignment I have, I need to make a (fake, but) realistic looking application. I proposed a loading page, so I want to follow through with that.
I don't need a loading page, but to make it more realistic/to get more marks, I want to add a 2 second loading page.@itsnotaron said in How to code a loading'.' '..' '...' page that redirects to another ui after 2 seconds?:
I don't need a loading page, but to make it more realistic/to get more marks, I want to add a 2 second loading page.
You can make a fake loading screen, which simulates loading some stuff by using a
QTimer
which will increase theQProgressBar
by some value.Skip the "task" - part. Just make the timer consecutively increase your progress by some amount of steps or some value or percentage
https://doc.qt.io/qt-5/qprogressdialog.html#details