2026 | Detailed Questions & Verified Answers
| PyQt5, GUI, Database, Menus | A+ Grade
Description
Prepare for your INF2611 Visual Programming II exam with this
comprehensive 2026 exam pack featuring detailed questions and
verified answers based on the latest module outcomes .
This resource covers all critical topics tested in the INF2611 module,
including PyQt5 GUI development, widget handling, event-driven
programming with signals and slots, database connectivity, and
menu/toolbar implementation . Each question includes a clear, verified
answer to reinforce your understanding and help you achieve a top grade.
Key topics covered:
GUI Fundamentals – QWidget base class, dialog types (Modal vs.
Modeless), .pyw and .ui file extensions
Widgets – QLineEdit, QLabel, QPushButton, QComboBox, QCheckBox,
QRadioButton, QTableWidget, QCalendarWidget, QLCDNumber
, Event Handling – Signals and slots, connecting widgets, timeout signals
with QTimer
Menus & Toolbars – Action Editor, shortcut keys, placeholders, resource
files, and toolbar icons
Database Handling – MySQLdb connection, SQL statements (show tables,
describe, select), commit() method, referential integrity
Date & Time – QDate, QTime, QCalendarWidget, and QDateEdit
properties
Section 1: GUI Fundamentals and PyQt Basics (Questions 1-40)
1. What does the abbreviation GUI stand for?
A) Graphical User Interchange
B) Graphical User Interface
C) General User Interaction
D) Graphic Usage Interaction
Correct Answer: B
Rationale: GUI stands for Graphical User Interface, which allows users to interact with
software using graphical elements like icons, buttons, and windows rather than text
commands .
, 2. How many ways are there to write a GUI application in PyQt?
A) One way only
B) Two ways: from scratch or with Qt Designer
C) Three ways: from scratch, with Qt Designer, or with a template
D) Four ways
Correct Answer: B
Rationale: There are two ways to write a GUI application: from scratch (coding manually) or
by using Qt Designer (a visual design tool) .
3. What file extension is used for GUI applications created with Python?
A) .py
B) .pyw
C) .exe
D) .ui
Correct Answer: B
Rationale: GUI applications are saved with the .pyw extension. The .ui extension is used for
user interface files created in Qt Designer .
, 4. In a PyQt4 application, which module contains the basic GUI widgets?
A) QtCore
B) QtGui
C) QtWidgets
D) QtDesigner
Correct Answer: B
Rationale: The basic GUI widgets are located in the QtGui module. The import statement is:
from PyQt4 import QtGui, QtCore .
5. What is the base class of all user interface objects in PyQt4?
A) QDialog
B) QMainWindow
C) QWidget
D) QApplication
Correct Answer: C
Rationale: QWidget is the base class of all user interface objects in PyQt4. All other widgets
inherit from QWidget .
6. What is a widget with no parent called?