I made the simple code below as example. It justs open a new window clicking on a button. I don't find a way to prevent this widget to be re-opened if it is already on the screen. I would like to open a QDialog warning if the window already exists and mainly to have the closeEvent method sending a signal to Mainwidget saying that the new window has been closed. This would allow to open the newWidget again.

```
import sys
from PyQt4 import QtCore, QtGui

class NewWidget(QtGui.QWidget): 
    def __init__(self, parent=None):
        super(NewWidget,self).__init__(parent)

        self.lineEdit = QtGui.QLineEdit('new window',self)
        self.resize(200,50)
        self.show()

    def closeEvent(self,ev):

        self.Exit = QtGui.QMessageBox.question(self,
                  "Confirm Exit...",
                  "Are you sure you want to exit ?",
                  QtGui.QMessageBox.Yes| QtGui.QMessageBox.No)
        ev.ignore()

        if self.Exit  == QtGui.QMessageBox.Yes:            
            ev.accept()     

class MainWidget(QtGui.QWidget):
    def __init__(self, parent=None):
        super(MainWidget,self).__init__(parent)

        self.button = QtGui.QPushButton("button", self)
        self.button.clicked.connect(self.open_new)

    def open_new(self):

        self.new = NewWidget()

if __name__ == "__main__":

    app = QtGui.QApplication(sys.argv)
    main = MainWidget()
    main.resize(200,50)
    main.move(app.desktop().screen().rect().center() - main.rect().center())
    main.show()
    sys.exit(app.exec_())

```