First page of the May/Jun 2017 INF2611 paperSee a real past paper — freeMay/Jun 2017 · 70 marks · the scan, as written

How often Forms, layouts and data modules is asked

2 of 3

papers asked it
avg 18 marks · last May 2018

Worth 2–6 marks when it appears as a written question.

Where it was asked

The questions

  1. May/Jun 2018, Q3.14 marks

    Define what is meant by a multiple-document interface (MDI), and include the code snippets that one would use to implement these document options.

  2. May/Jun 2018, Q3.26 marks

    Identify the layout options available, and explain which layout would be used for specific scenarios.

  3. Oct/Nov 2017, Q2.16 marks

    Figure 2 shows a MainWindow application titled 'MainWindow' containing a 'Windows' area with two subwindows ('This is the first Sub Window' and 'This is second Sub Window'), and six buttons arranged below the subwindows: Show Next, Show Previous, Close All, Cascade, Tile and SubWindow View. The application is implemented in the file callMDI.pyw as follows: 'import sys'; 'from mdi import *'; a class MyForm(QtGui.QMainWindow) whose __init__ method calls QtGui.QWidget.__init__(self, parent), creates self.ui = Ui_MainWindow(), calls self.ui.setupUi(self), adds two subwindows to the mdiArea via self.ui.mdiArea.addSubWindow(self.ui.subwindow) and self.ui.mdiArea.addSubWindow(self.ui.subwindow_2), and then connects each button's clicked() signal (and two menu actions' triggered() signals) to a handler method: self.ui.showNext to self.displayNext, self.ui.showPrevious to self.displayPrevious, self.ui.closeAll to self.closeAll, self.ui.cascadeButton to self.cascadeArrange, self.ui.tileButton to self.tileArrange, self.ui.SubWindowViewButton to self.SubWindowView, self.ui.actionFirst_Window (triggered) to self.displayNext, and self.ui.actionSecond_Window (triggered) to self.displayPrevious. Below these connections, six blank comment lines numbered 1 to 6 precede six method definitions: (1) def displayNext(self): self.ui.mdiArea.activateNextSubWindow(); (2) def displayPrevious(self): self.ui.mdiArea.activatePreviousSubWindow(); (3) def closeAll(self): self.ui.mdiArea.closeAllSubWindows(); (4) def cascadeArrange(self): self.ui.mdiArea.cascadeSubWindows(); (5) def tileArrange(self): self.ui.mdiArea.tileSubWindows(); (6) def SubWindowView(self): self.ui.mdiArea.setViewMode(0). The program ends with the usual 'if __name__ == "__main__":' block that creates a QApplication, instantiates MyForm, shows it and calls sys.exit(app.exec_()). Supply the six missing comments, numbered 1 to 6, that explain what each of the dispNext, dispPrevious, closeAll, cascadeArrange, tileArrange and SubWindowView button-handler methods does in the callMDI.pyw application shown in Figure 2.

  4. Oct/Nov 2017, Q2.12 marks

    Provide a definition of what a data module is.

  5. Oct/Nov 2017, Q2.22 marks

    Figure 2 shows a MainWindow application titled 'MainWindow' containing a 'Windows' area with two subwindows ('This is the first Sub Window' and 'This is second Sub Window'), and six buttons arranged below the subwindows: Show Next, Show Previous, Close All, Cascade, Tile and SubWindow View. The application is implemented in the file callMDI.pyw as follows: 'import sys'; 'from mdi import *'; a class MyForm(QtGui.QMainWindow) whose __init__ method calls QtGui.QWidget.__init__(self, parent), creates self.ui = Ui_MainWindow(), calls self.ui.setupUi(self), adds two subwindows to the mdiArea via self.ui.mdiArea.addSubWindow(self.ui.subwindow) and self.ui.mdiArea.addSubWindow(self.ui.subwindow_2), and then connects each button's clicked() signal (and two menu actions' triggered() signals) to a handler method: self.ui.showNext to self.displayNext, self.ui.showPrevious to self.displayPrevious, self.ui.closeAll to self.closeAll, self.ui.cascadeButton to self.cascadeArrange, self.ui.tileButton to self.tileArrange, self.ui.SubWindowViewButton to self.SubWindowView, self.ui.actionFirst_Window (triggered) to self.displayNext, and self.ui.actionSecond_Window (triggered) to self.displayPrevious. Below these connections, six blank comment lines numbered 1 to 6 precede six method definitions: (1) def displayNext(self): self.ui.mdiArea.activateNextSubWindow(); (2) def displayPrevious(self): self.ui.mdiArea.activatePreviousSubWindow(); (3) def closeAll(self): self.ui.mdiArea.closeAllSubWindows(); (4) def cascadeArrange(self): self.ui.mdiArea.cascadeSubWindows(); (5) def tileArrange(self): self.ui.mdiArea.tileSubWindows(); (6) def SubWindowView(self): self.ui.mdiArea.setViewMode(0). The program ends with the usual 'if __name__ == "__main__":' block that creates a QApplication, instantiates MyForm, shows it and calls sys.exit(app.exec_()). Name and explain two types of layout managers that can be used to arrange widgets in Qt Designer.

The full Spot Map and the marks by year.