[PyQt] Splash screen with progress bar (was Re: Any Large PyQt
Projects?)
Gustavo A. Díaz
gustavo.diaz at gmail.com
Sat Feb 21 22:23:00 GMT 2009
Here another example of splash with progress bar of how i did for my
application:
http://opencoffee.lnxteam.org/trac/opencoffee/browser/trunk/opencoffee-server/core/splashScreen/splash.py
2009/2/20 David Boddie <david at boddie.org.uk>
> On Fri Feb 20 16:39:11 GMT 2009, Chris Withers wrote:
> > Toby Dickenson wrote:
>
> > > * Startup time while your modules are imported. Plan to have a splash
> > > screen with a progress bar :-(
> >
> > How do you do this with PyQt?
>
> One way is to take advantage of the fact that the splash screen is just
> a widget. You can just create a progress bar as a child widget and update
> that.
>
> For example:
>
> app = QApplication(sys.argv)
>
> # Create a pixmap - not needed if you have your own.
> pixmap = create_pixmap(480, 320)
>
> splash = QSplashScreen(pixmap)
> progressBar = QProgressBar(splash)
> progressBar.setGeometry(splash.width()/10, 8*splash.height()/10,
> 8*splash.width()/10, splash.height()/10)
> splash.show()
>
> for i in range(0, 100):
> progressBar.setValue(i)
>
> # Do something which takes some time.
> t = time.time()
> while time.time() < t + 0.1:
> app.processEvents()
>
>
> I hope this is enough to help you get started.
>
> David
> _______________________________________________
> PyQt mailing list PyQt at riverbankcomputing.com
> http://www.riverbankcomputing.com/mailman/listinfo/pyqt
>
--
Gustavo A. Díaz
GDNet Projects
www.gdnet.com.ar
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20090221/749697af/attachment.html
More information about the PyQt
mailing list