![]() |
|
Quick Links
Project DescriptionIn this assignment, you will implement a (simplified) "Paint" for drawing based on the solution of lab 5, "Bitmaps and mouse click events". You will use object-oriented technique to implement "Paint". After this project, you are expected to learn how to develop a Qt GUI program and look for materials by yourself from the Qt API Reference.About QtQt is a multiplatform C++ GUI toolkit created and maintained byTrolltech. It provides application developers with all the functionality needed to build applications with state-of-the-art graphical user interfaces. Qt is fully object-oriented, easily extensible, and allows true component programming. Qt is supported on the following platforms:
The Qt Free Edition is available for Unix/X11, Macintosh and Embedded Linux. The Free Edition is for the development of Free and Open Source software only. To use Qt, you need to inherit the classes of Qt for your application. Project RequirementCreate a menu bar that support the following functions:
Create a tool bar that contains shortcuts of tools. You need to inherit from Qt::QToolBar to implement your own toolbar and handle the event when the toolbar is redraw. Overload the following mouse event handler to handle the corresponding mouse events:
To draw on an image, you need to see the API of QPainter, QPen, QBrush and QPixmap. Note the differences between drawing on a widget and an image. There are four kinds of tools: Pen, Line, Eraser and Rectangle. For each kind of tools, create a properties dialog that allow user to modify the properties of tool. You need to inherit from QDialog to implement your own dialog, and use QRadioButton, QButtonGroup and QSlider to implement the slider and button. If you are using QT designer for implementation, please choose 2 of the following to implement:
If you have any difficulties in understanding the project requirement, please see the sample solution. Hints
Grading SchemeA main objective of this course is to learn and practise good design principles so that you can eventually write very large programs comfortably and professionally. As such, you should not just turn in a program that works.You are expected to have a good design too so that your program is comprehensible and can be extended easily in case the specification changes later.Whether you like it or not, it is a fact in life that user requirements keep changing while a program is being developed.Your design should be flexible enough to cater for such possibilities.You should describe your design clearly in a separate file, named README.txt. As it is always the case, you should use meaningful identifier names in your program so that other people can understand your code easily.You are also expected to break your program into functionally distinct pieces kept in different files, with the C++ source files compiled separately.Brief yet informative comments should be added throughout the program to improve its comprehensibility. The grading scheme is as follows:
|
design by Yu Wing TAI, maintenance by Chi Keung Tang. | CS 2012h Object Oriented Programming and Data Structures
Spring Semester 2013 |
![]() | |
Last modified: Fri Feb 4 17:15:19 HKT 2013 |