-
Notifications
You must be signed in to change notification settings - Fork 0
Week 1
!NB: Page numbers refer to the Qt Essentials Edition Slide Set!
This page contains all of the suggested topics of interest for the course week.
Each topic title will link to the related page (in this Wiki) on which the course material for said topic is being worked on.
The topic title also includes the suggested priority (0 = high, 1 = medium, 2 = low) and suggested amount of work the student will use on each topic (this may also be seen as a relative amount of hours/time spent on topics compared to other topics of the week).
On this page under each topic is also included the learning objectives planned as well as relevant material and links which may be of use for writing material and working on exercises related to each topic.
1.00 Creating and debugging Qt projects (P0 | 0,5h)
Objective: Being able to build, debug and run a trivial Qt project
- Pages: 38
- d00.en.pdf Ass 00
- http://wiki.qt.io/Basic_Qt_Programming_Tutorial
- http://wiki.qt.io/Getting_Started_on_the_Commandline
- http://doc.qt.io/qt-5/qdebug.html
Objective: Basic String manipulation
- Pages: 113-123, 90-108
- d00.en.pdf Ass 02
- http://doc.qt.io/qt-5/qstring.html
- http://doc.qt.io/qt-5/qstring.html#QStringLiteral
1.02 Item Containers (P2 | 2h)
Objective: Adding, iterating, manipulating data in some containers
- Pages: 133
- d00.en.pdf Ass 07
- http://doc.qt.io/qt-5/containers.html
1.03 QObject - Subclassing (P0 | 2h)
Objective: Custom QObjects with properties, enums
- Pages: 91->, ??
- d00.en.pdf Ass 01
- http://doc.qt.io/qt-5/qobject.html
- http://doc.qt.io/qt-5/qobject.html#Q_OBJECT
- http://doc.qt.io/qt-5/qobject.html#Q_ENUM
- http://doc.qt.io/qt-5/properties.html
1.04 Parent-Child relationship (P0 | 0,5h)
Objective: Qt memory management
- Pages: 49
- d00.en.pdf Ass 01
- http://doc.qt.io/qt-5/objecttrees.html
Objective:
- Pages: 58 ->
- d00.en.pdf Ass 03
- http://wiki.qt.io/How_to_Use_Signals_and_Slots
- http://doc.qt.io/qt-5/signalsandslots.html
- http://doc.qt.io/qt-5/qobject.html#Q_OBJECT
Objective: Different to direct connections
Objective:
- Pages: ...
- d00.en.pdf Ass 05
- http://doc.qt.io/qt-5/eventsandfilters.html
- http://doc.qt.io/qt-5/events.html
1.08 Object communicating: Custom Events (P2 | 1,5h)
Objective: Synthetic events and event handling
- Pages: -> 88
- d00.en.pdf Ass 05
- http://doc.qt.io/qt-5/eventsandfilters.html
- http://doc.qt.io/qt-5/events.html
Objective:
1.10 Shared Pointers (P2 | 2h)
Objective: Inter-Thread memory management
- Pages: 54?
- http://doc.qt.io/qt-5/qsharedpointer.html
1.11 Streaming (P2 | 2h)
Objective: Meta-Object System, File handling
- Pages: 129, 92?
- d00.en.pdf Ass 06
- http://doc.qt.io/qt-5/qmetaobject.html#details
- http://doc.qt.io/qt-5/io-functions.html
1.12 Implicitly Shared Custom Type (P2 | 2h)
Objective: Qt value type memory management
- Pages: 102, 91->
- http://doc.qt.io/qt-5/implicit-sharing.html
- https://stackoverflow.com/questions/47289282/implicit-sharing-for-custom-classes-in-qt
Complete the implementation of a trivial directory browser. You are provided with a simple browser QML UI and your task is to complete the implementation. Comment in the lines in the UI, when you add the required functionality. The UI shows a directory name and number of file entries and a list of all entries. If the gird at the top is clicked, the application should sort the files to descending or ascending order, depending on the current order. Clicking on the file will show the files in that folder or open a text editor, if the file is a text file.
- Derive QObject to implement the requested functionality. Instantiate and expose your object to QML in main.cpp lines 13 and 14.
- When a program is started, read at least file names and sizes of a directory, e.g. home, into a container. Note that the container must be a string list, so concatenate the name and size to a single string.
The QML UI expects the following API from your QObject sub-class.
- There must be two properties: dirName of type String and filesInDir of type int. The values should correspond the real values of the current directory.
- Provide the slot functions to be called from the UI.
- model() returns the container.
- fileContent() returns the content of a text file as String.
- sort() will sort entries in ascending or descending order.
- entryChanged(QString) is called from the UI. You should check, whether the entry is a directory or a file. In the former case, you should read new entries from the new directory and in the latter case, you should read content of the file and use fileContent() to return the content to the UI.
The UI is heavily based on signals.
- dirNameChanged() indicates the directory name has changed, i.e. the user has clicked on the directory name on the UI.
- Similarly, filesInDirChanged() indicates that the filesInDir value has changed.
- fileContentChanged() is similar, indicating the user has clicked on the file name in the UI and new data has been read from the file.
- dataChanged() notifies the container content has changed.
- entryClicked(QString) signal is emitted from the UI. You should handle this by checking the type of the entry and by reading either a directory content to the container or file content to the String, used in the UI.