[prev in list] [next in list] [prev in thread] [next in thread]
List: pykde
Subject: Re: [PyQt] modeless dialog - repeated windows
From: Susana Sanchez Exposito <sse () iaa ! es>
Date: 2011-07-26 7:23:45
Message-ID: CAK=du8LRT670B08ye7Y9VTmSnp9m5-WJYAoW5H-a0ug34RchSw () mail ! gmail ! com
[Download RAW message or body]
[Attachment #2 (multipart/alternative)]
Thank you very much!,
The solution is easier than I thought :-)
2011/7/25 Baz Walter <bazwal@ftml.net>
> On 25/07/11 12:20, Susana Sanchez Exposito wrote:
>
> > I would like if the user selects the option to open the modeless dialog
> > and
> > this dialog is opened yet, this dialog would be focused instead of opening
> > another window of the same modeless dialog.
> >
>
> import sys
> from PyQt4 import QtGui, QtCore
>
> class Window(QtGui.QPushButton):
> def __init__(self):
> QtGui.QPushButton.__init__(**self, 'Open')
> self.dialog = QtGui.QMessageBox(self)
> self.dialog.setWindowModality(**QtCore.Qt.NonModal)
> self.clicked.connect(self.**showDialog)
>
> def showDialog(self):
> self.dialog.show()
> self.dialog.activateWindow()
>
> if __name__ == '__main__':
>
> app = QtGui.QApplication(sys.argv)
> win = Window()
> win.move(600, 400)
> win.dialog.move(600, 500)
> win.show()
> sys.exit(app.exec_())
>
> ______________________________**_________________
> PyQt mailing list PyQt@riverbankcomputing.com
> http://www.riverbankcomputing.**com/mailman/listinfo/pyqt<http://www.riverbankcomputing.com/mailman/listinfo/pyqt>
>
--
Susana Sánchez Expósito
Instituto de Astrofísica de Andalucía IAA (CSIC)
Camino Bajo de Huétor, 50. Granada E-18008
Tel:(+34) 958 121 311 / (+34) 958 230 618
Fax:(+34) 958 814 530
e-mail: sse@iaa.es
[Attachment #5 (text/html)]
Thank you very much!,<div>The solution is easier than I thought \
:-)</div><div><br></div><div><br><br><div class="gmail_quote">2011/7/25 Baz Walter \
<span dir="ltr"><<a \
href="mailto:bazwal@ftml.net">bazwal@ftml.net</a>></span><br> <blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex;"><div class="im">On 25/07/11 12:20, Susana Sanchez Exposito \
wrote:<br> <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px \
#ccc solid;padding-left:1ex"> I would like if the user selects the option to open \
the modeless dialog and<br> this dialog is opened yet, this dialog would be focused \
instead of opening<br> another window of the same modeless dialog.<br>
</blockquote>
<br></div>
import sys<br>
from PyQt4 import QtGui, QtCore<br>
<br>
class Window(QtGui.QPushButton):<br>
def __init__(self):<br>
QtGui.QPushButton.__init__(<u></u>self, 'Open')<br>
self.dialog = QtGui.QMessageBox(self)<br>
self.dialog.setWindowModality(<u></u>QtCore.Qt.NonModal)<br>
self.clicked.connect(self.<u></u>showDialog)<br>
<br>
def showDialog(self):<br>
self.dialog.show()<br>
self.dialog.activateWindow()<br>
<br>
if __name__ == '__main__':<br>
<br>
app = QtGui.QApplication(sys.argv)<br>
win = Window()<br>
win.move(600, 400)<br>
win.dialog.move(600, 500)<br>
win.show()<br>
sys.exit(app.exec_())<br>
<br>
______________________________<u></u>_________________<br>
PyQt mailing list <a href="mailto:PyQt@riverbankcomputing.com" \
target="_blank">PyQt@riverbankcomputing.com</a><br> <a \
href="http://www.riverbankcomputing.com/mailman/listinfo/pyqt" \
target="_blank">http://www.riverbankcomputing.<u></u>com/mailman/listinfo/pyqt</a><br>
</blockquote></div><br><br clear="all"><br>-- <br>Susana Sánchez \
Expósito<br><br>Instituto de Astrofísica de Andalucía IAA (CSIC)<br>Camino Bajo de \
Huétor, 50. Granada E-18008<br>Tel:(+34) 958 121 311 / (+34) 958 230 618<br> \
Fax:(+34) 958 814 530<br>e-mail: <a href="mailto:sse@iaa.es" \
target="_blank">sse@iaa.es</a><br> </div>
_______________________________________________
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