Thank you very much!, The solution is easier than I thought :-)
2011/7/25 Baz Walter <baz...@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: s...@iaa.es
_______________________________________________ PyQt mailing list PyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt