How much computer programming do physicists do

C ++ programming:
Basics and applications with the Qt class library (4SWSt, 6 LPs)

Organizer: Faculty of Physics, Dr. Fritz W√ľnsch; Lecturer: Peter Georg

  1. requirements
  2. Registration via LSF
  3. Bogus requirements
  4. FlexNow
  5. structure
  6. Lecture and exercise
  7. Qt in the CIP pool
  8. Project work
  9. Course materials
  10. Pictures from previous projects
  11. Current version of Qt
  12. literature
  13. usefull links

This course is aimed at everyone who already has prior knowledge of the programming language C. and want to gain insights into object-oriented programming. Ideally, you will visit our basic course Programming in C and C ++ recommended, but the Qt course can also be attended completely independently of it.
It has two goals:
  • Learn the object-oriented programming techniques of C ++
  • Practice these techniques using the example of a finished class library
As a class library, we have Qt selected - many are certainly the desktop environment KDE known on Linux, which is based on the Qt library. Thus, in the course you also get a practice-oriented introduction to the basic techniques of GUI programming. With Qt you can easily create cross-platform graphical applications. Use is possible for Unix-like operating systems (Linux, Mac OS X, ...) as well as for Microsoft Windows under various licenses:
  • GPL v3
  • LGPL v2.1
  • LGPL v3
  • Proprietary: various commercial versions with extended support

Qt is used especially for the software development of hybrid applications for mobile radio telephones that rely on Sailfish OS, Maemo, MeeGo, Symbian or Windows Mobile. Developing for Windows RT, Android or iOS is also possible.

Requirements and previous knowledge for attending this event

  • Passable programming skills in C (dealing with pointer should be familiar)
  • Dealing with Debian 8 and / or Windows 8.1 (the computers in the Windows CIP pool and Linux CIP pool are made available for the course)
  • Alternatively, you can bring your own computer (preferably a laptop), as all tools used are cross-platform and open-source
  • Knowledge of English as the documentation is only available in English

Registration via LSF

In order to be able to participate in the course, you should, if possible, register via the LSF platform. Make sure that you adapt your current semester to the lecture.

Bogus requirements

The following points apply as sham criteria:
  • Attendance in the exercises and proof of a completed exercise
  • Creation of a small final project

FlexNow

Students who need a FlexNow entry must successfully complete their FlexNow registration within the course days. This course is under the name Programming of portable graphic applications in the category IT training accompanying the course registered. Further modularization for other courses is possible. If the acquired credit points are to be used for the IT training during the course, the certificate must be graded. Paper tickets are only issued for diploma and university students.

structure

  1. C ++ (part 1)
    • Basics of the C ++ programming language and differences to the C language
    • object oriented programing
      • Classes
      • Inheritance
      • Virtual functions
      • Templates
      • Exceptions
  2. Programming with Qt (Part 2)
    • Licenses
    • Signal slot mechanism
    • Introduction to general usage of the Qt library
    • Creation and use of GUI elements with QtGui
    • Programming with QtCreator
    • graphical applications via drag & drop with QtDesigner
    • Internationalization with QtLinguist
    • what else Qt has to offer

Lecture and exercise

The lecture and exercise take place all day from 9:15 a.m. to 5:00 p.m. (one hour lunch break) in the CIP pool.

Qt in the CIP pool

The development environment of the Qt5 package is already preinstalled on the computers in the CIP pool for both Linux and Windows.

under Windows

After logging on to Windows by running the script in the command prompt CMD Access to the development environment of the QtCreator. The paths to the Qt libraries are not yet explicitly included in Windows.

under Linux

To be able to use Qt under Linux you have to run the C-Shell script to set the path variables. Then the libraries as well as the QtCreator can be used.

Project

The knowledge acquired should be demonstrated in a small project. You can work alone or in pairs on a project, which should be presentable by the end of the course. There are no specifications whatsoever when it comes to the choice of projects, mostly small games are programmed. The quality of the source code is primarily decisive for a good project.

Course materials

Documentation for the course will be provided during the course. scripttasks

Pictures from previous projects

This picture gallery shows some screenshots from previous projects.

Current version of Qt

Qt offers many possibilities to solve special problems:
  • Qt Core - the main libraries used by many other Qt modules
  • Qt GUI - base class for developing graphic components (including OpenGL)
  • Qt Multimedia - Classes for audio, video, radio and camera functionalities
  • Qt Multimedia Widgets - graphical window components for implementing multimedia content
  • Qt Network - Classes for easy network programming
  • Qt QML - classes for processing QML and JavaScript
  • Qt Quick - Framework for creating your own user interfaces
  • Qt Quick Controls - a UI based on Qt Quick to create classic desktop displays
  • Qt Quick Layouts - to arrange Qt Quick elements in your own user interface
  • Qt SQL - classes for SQL database processing
  • Qt test classes around unit test for Qt classes and libraries
  • Qt WebKit - Classes to implement WebKit2 and the QML API
  • Qt WebKit Widgets - Compatibility classes for WebKit1 and QWidget from Qt 4
  • Qt widgets - classes to extend the Qt GUI with C ++ widgets

Examples of professional projects in which Qt is used: Bitcoin, Google Earth, last.fm, Mathematica, Opera, Origin, QtiPlot, Spotify, Skype, VLC media player, ...

literature

Literature on C ++

In addition to various completely sufficient scripts from the Internet and / or the script from the University of Hanover (available from the information desk of the computer center), the following more detailed literature is recommended:
  • Ulrich Breymann: "The C ++ programmer", Hanser 2009
  • Bjarne Stroustroup: "The C ++ Programming Language", Addison Wesley 1999
    Bjarne Stroustroup: "The C ++ Programming Language", Addison Wesley, 1998
  • Ira Pohl: "C ++ for C Programmers", Third Edition, Addison Wesley, 1999
  • Bruce Eckel: "Think in C ++", Markt und Technik 1998
    Bruce Eckel, "Thinking in C ++", Prentice Hall
  • Ulrich Breymann: "C ++, an introduction", Hanser 1999

A current list of good literature is maintained on the homepage of the C / C ++ course and the course homepage Techniques for Generic and Object-Oriented Programming with C ++. A tip for everyone who wants to buy a book: Don't shy away from English books! Much of the useful documentation is in English anyway, so you don't have to constantly get used to new terms.

Literature on Qt

We recommend the book by Jasmin Blanchette and Mark Summerfield: "C ++ GUI Programming with Qt 4 (2nd Revised edition) - The official C ++ / Qt book", Prentice Hall International.
The book that has not been revised (i.e. in its 1st constitution) is freely available as a download.
Unfortunately, so far there is no literature that deals exclusively with Qt 5. However, there is an extensive chapter from Galileo Press that deals with the latest Qt standard.

usefull links