[prev in list] [next in list] [prev in thread] [next in thread]
List: pykde
Subject: Re: [PyQt] Run code after the QtDialog shows
From: "starglider.dev" <starglider.dev () gmail ! com>
Date: 2012-05-24 20:25:12
Message-ID: CAJdNm3_jpwCFu10BJHcMKnd_J5iMhui1x39J65BUYAzvE3TFwg () mail ! gmail ! com
[Download RAW message or body]
[Attachment #2 (multipart/alternative)]
Sorry gmail send it automatic.
Hi,
I need to "emulate" a terminal and need to automaticly run the code after
the QDialog shows and close the QDialog after it ends the task.
The best I find was this:
class ConsoleClass(QDialog): ...
def main():
app = QApplication(sys.argv)
main.form = ConsoleClass()
main.form.show()
app.processEvents()
run_my_code()
main()
It works fine, but if I call it from a another form it closes all the
application.
How can I prevent the main application to be closed?
Thank you in advance for your help.
zorze
[Attachment #5 (text/html)]
Sorry gmail send it automatic.<br><br>Hi,<br>I need to "emulate" a terminal \
and need to automaticly run the code after<br>the QDialog shows and close the QDialog \
after it ends the task.<br>The best I find was this:<br> <br \
style="font-family:courier new,monospace"> <font size="1"><span \
style="font-family:courier new,monospace">class ConsoleClass(QDialog): ...</span><br \
style="font-family:courier new,monospace"><br style="font-family:courier \
new,monospace"><span style="font-family:courier new,monospace">def main():</span><br \
style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> app = \
QApplication(sys.argv)</span><br style="font-family:courier new,monospace"><span \
style="font-family:courier new,monospace"> main.form = ConsoleClass()</span><br \
style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> </span><br \
style="font-family:courier new,monospace"><span style="font-family:courier \
new,monospace"> main.form.show()</span><br style="font-family:courier \
new,monospace">
<span style="font-family:courier new,monospace"> app.processEvents()<br> \
run_my_code()<br style="font-family:courier new,monospace"></span><br \
style="font-family:courier new,monospace"><span style="font-family:courier \
new,monospace">main()</span></font><br>
<br>It works fine, but if I call it from a another form it closes all the \
application.<br><br>How can I prevent the main application to be closed?<br><br>Thank \
you in advance for your help.<br><br>zorze <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