COS2614 is the module where C++ “grows up.” You move away from the black-and-white console window of First Year and step into the world of Graphical User Interfaces (GUIs) using the Qt Framework.
But be warned: This module is not just about dragging and dropping buttons. You have to understand the deep architecture behind the code. You need to master Design Patterns, XML Serialization, and the unique Signal & Slot mechanism of Qt.
This guide breaks down the curriculum based on the specific skills needed for the exam.

1. The Qt Framework (The GUI Engine)
Qt is massive, but you only need to master specific parts.
Signals and Slots
This is how objects talk to each other in Qt.
- The Concept: When a user clicks a button, it emits a Signal. A function (called a Slot) catches that signal and runs code.
- The Syntax: You must memorize the connect syntax.
connect(button, SIGNAL(clicked()), this, SLOT(calculateTotal()));
- The “Q_OBJECT” Macro: This is the most common exam mistake. If you create a class that uses signals/slots, you must include the
Q_OBJECTmacro at the top of the class definition. If you forget it, the code compiles but the signals won’t work.
Memory Management (Parent-Child)
- The Rule: Qt handles memory differently than standard C++. If you create a widget (like a Button) and give it a Parent (like the Main Window), you do not need to delete it manually. When the Parent is destroyed, it automatically deletes all its children. This saves you from memory leaks.
2. Design Patterns (The Theory Core)
This is usually 30-40% of the exam. You cannot just define them; you must be able to write the C++ code for them.
- Singleton Pattern: Ensuring a class has only one instance (e.g., a Database Connection).
- Key Code: A private constructor and a static
getInstance()method.
- Key Code: A private constructor and a static
- Observer Pattern: The “Subscriber” model. When one object changes (the Subject), all its watchers (Observers) are automatically notified. This is actually how Signals and Slots work!
- Memento Pattern: The “Ctrl+Z” pattern. It captures an object’s internal state so you can restore it later.
- Factory Pattern: Creating objects without specifying the exact class of object that will be created.
3. Data Persistence (XML & Streams)
You need to save the user’s data. In COS2614, we don’t usually use databases; we use XML.
- Serialization: This means converting an object (like a Student object in memory) into a format that can be stored (like an XML file on disk).
- The Qt Classes:
QFile: To open the file on the hard drive.QDomDocument: To build the XML tree structure in memory.QTextStream: To write the text.
4. Advanced C++ Concepts
This module expects you to know modern C++.
- Templates: Writing generic code that works for any data type (e.g.,
QList<int>vsQList<QString>). - Exception Handling: Using
try,catch, andthrowto handle errors gracefully instead of crashing.
Decksh’s Top 3 Tips for a Distinction
Tip 1: Practice GUI Coding on Paper
This sounds insane, but in the exam, you have to write GUI code by hand. You need to memorize the setup for a basic window:
- Create
QApplication. - Create
QWidget(the window). - Create Layouts (
QVBoxLayoutorQHBoxLayout). - Add widgets to the layout.
window.show()andapp.exec().
Tip 2: Master the MVC Model
Qt uses a variation of Model-View-Controller called Model-View-Delegate.
- Understand that the View (what the user sees, like a Table) is separate from the Model (the data).
- If you change the data in the Model, the View updates automatically. This separation is crucial for clean code.

Tip 3: Know Your Qt Containers
Don’t use standard C++ vectors (std::vector). Use the Qt versions because they play nicely with the rest of the framework.
- Use
QList,QString(instead ofstd::string), andQMap. - Knowing the conversion between
QStringandstd::string(.toStdString()) saves marks when you mix libraries.
Conclusion
COS2614 is a professional-level module. It teaches you the framework used by companies like Tesla and Adobe. Don’t get lost in the syntax; focus on the patterns. If you understand Singleton, Observer, and the Parent-Child memory model, you will pass.
Good luck!