title: PyQt4: How to change title of sub window when it is modified
body: <pre><code>class MdiChild(QtGui.QTextEdit):
      sequenceNumber = 1
  
      def __init__(self):
          super(MdiChild, self).__init__()
  
          self.setAttribute(QtCore.Qt.WA_DeleteOnClose)
          self.isUntitled = True
  
      def newFile(self):
          self.isUntitled = True
          self.curFile = "document%d.txt" % MdiChild.sequenceNumber
          MdiChild.sequenceNumber += 1
          self.setWindowTitle(self.curFile + '[*]')
  
          self.document().contentsChanged.connect(self.documentWasModified)
  
      def documentWasModified(self):
          self.setWindowModified(self.document().isModified())
  </code></pre>
  
  <p>this code display the document1.txt as title of sub window when new sub window is created and keep increamenting. The title of sub window change from document1.txt to document1.txt.* when i change text in QTextedit and if i remove [] around * it display document1.txt.* when a new window is opened. so i want to know what is the working of [] in this code for document title and how * is append to document title.
  And please also tell the meaning of the following line:<br/></p>
  
  <pre><code>self.setAttribute(QtCore.Qt.WA_DeleteOnClose)
  </code></pre>