[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    Re: [PyQt] Splash screen with progress bar (was Re: Any Large PyQt
From:       Gustavo_A._Díaz <gustavo.diaz () gmail ! com>
Date:       2009-02-21 22:23:00
Message-ID: 64c123920902211423o33507bf4x79544cc141804677 () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


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@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@riverbankcomputing.com
> http://www.riverbankcomputing.com/mailman/listinfo/pyqt
>



-- 
Gustavo A. Díaz
GDNet Projects
www.gdnet.com.ar

[Attachment #5 (text/html)]

Here another example of splash with progress bar of how i did for my \
application:<br><br><a \
href="http://opencoffee.lnxteam.org/trac/opencoffee/browser/trunk/opencoffee-server/co \
re/splashScreen/splash.py">http://opencoffee.lnxteam.org/trac/opencoffee/browser/trunk/opencoffee-server/core/splashScreen/splash.py</a><br>
 <br><div class="gmail_quote">2009/2/20 David Boddie <span dir="ltr">&lt;<a \
href="mailto:david@boddie.org.uk">david@boddie.org.uk</a>&gt;</span><br><blockquote \
class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt \
0pt 0.8ex; padding-left: 1ex;"> On Fri Feb 20 16:39:11 GMT 2009, Chris Withers \
wrote:<br> &gt; Toby Dickenson wrote:<br>
<br>
&gt; &gt; * Startup time while your modules are imported. Plan to have a splash<br>
&gt; &gt; screen with a progress bar :-(<br>
&gt;<br>
&gt; How do you do this with PyQt?<br>
<br>
One way is to take advantage of the fact that the splash screen is just<br>
a widget. You can just create a progress bar as a child widget and update<br>
that.<br>
<br>
For example:<br>
<br>
app = QApplication(sys.argv)<br>
<br>
# Create a pixmap - not needed if you have your own.<br>
pixmap = create_pixmap(480, 320)<br>
<br>
splash = QSplashScreen(pixmap)<br>
progressBar = QProgressBar(splash)<br>
progressBar.setGeometry(splash.width()/10, 8*splash.height()/10,<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp;8*splash.width()/10, splash.height()/10)<br> splash.show()<br>
<br>
for i in range(0, 100):<br>
 &nbsp; &nbsp;progressBar.setValue(i)<br>
<br>
 &nbsp; &nbsp;# Do something which takes some time.<br>
 &nbsp; &nbsp;t = time.time()<br>
 &nbsp; &nbsp;while time.time() &lt; t + 0.1:<br>
 &nbsp; &nbsp; &nbsp; &nbsp;app.processEvents()<br>
<br>
<br>
I hope this is enough to help you get started.<br>
<br>
David<br>
_______________________________________________<br>
PyQt mailing list &nbsp; &nbsp;<a \
href="mailto:PyQt@riverbankcomputing.com">PyQt@riverbankcomputing.com</a><br> <a \
href="http://www.riverbankcomputing.com/mailman/listinfo/pyqt" \
target="_blank">http://www.riverbankcomputing.com/mailman/listinfo/pyqt</a><br> \
</blockquote></div><br><br clear="all"><br>-- <br>Gustavo A. Díaz<br>GDNet \
Projects<br><a href="http://www.gdnet.com.ar">www.gdnet.com.ar</a><br>



_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic