Qt 5 C++ GUI Development For Beginners : The Fundamentals
4.4 (960 ratings)
Course Ratings are calculated from individual students’ ratings and a variety of other signals, like age of rating and reliability, to ensure that they reflect course quality fairly and accurately.
4,503 students enrolled

Qt 5 C++ GUI Development For Beginners : The Fundamentals

Build Cross Platform C++ GUI Applications with Qt, Run them on Windows, Mac, Linux, Android, iOS and Embedded Devices
4.4 (960 ratings)
Course Ratings are calculated from individual students’ ratings and a variety of other signals, like age of rating and reliability, to ensure that they reflect course quality fairly and accurately.
4,503 students enrolled
Created by Daniel Gakwaya
Last updated 6/2020
Current price: $13.99 Original price: $19.99 Discount: 30% off
5 hours left at this price!
30-Day Money-Back Guarantee
This course includes
  • 14.5 hours on-demand video
  • 4 articles
  • 53 downloadable resources
  • Full lifetime access
  • Access on mobile and TV
  • Certificate of Completion
Training 5 or more people?

Get your team access to 4,000+ top Udemy courses anytime, anywhere.

Try Udemy for Business
What you'll learn
  • The fundamentals of working with Qt to build C++ Gui Applications
  • Working with Qt Widget Classes
  • Working with Dialog Classes
  • Using the Qt Resource System
  • Styling Qt Applications
  • Working with Networks to fetch HTTP Data
  • Working with the File System
  • Model View Architecture
Course content
Expand all 75 lectures 14:38:35
+ Getting Started
6 lectures 59:08

Welcome! How to make the most out of this course.

Preview 06:34
Join the Official Support Channels

An Overview of the Qt Creator UI and the tools used to build your Application. Content include 

  • Basic understanding of the Qt Creator User interface
  • Your build tools
  • Kits, Compilers, Debuggers
  • Compile process
  • The location of your executable when built
  • Configuring your Kits and more
Qt-An Overview of Qt Creator and Tooling (Compilers,Debuggers)
+ C++ Beginner Crash Course
12 lectures 02:13:03

Run  your very first C++ program in the Qt Creator Environment : 

  • Understand what a console program is
  • Create a C++ Console Application in Qt Creator
  • Understand the structure of the main.cpp file and the main function inside it
  • use std::cout to print things out
Your First C++ console Program

Learn how to use streams to input and output data :

  • Input and output streams basics explained
  • std::cout , std::cerr, std::clog and their usage
  • std::cin and its usage in data input
Streams-Input and Output

Know your variables and what kind of data you can stuff inside : 

  • Variables and data types visualized
  • Know about primitive data types, abstract data types and custom data types
  • Know how much space  your data types occupy in computer memory
  • Know the ranges of data  you can stuff in your variables
  • Know how to use your type modifiers : short, long ,signed and unsigned
  • and more ...
C++ Variables and Data Types

All about controlling where your program goes and what it does in there

  • Use math operators to manipulate your variables
  • Use logical operators coupled with if clauses to control the whereabouts of your program
  • Use logical operators to compare your variables
  • Use for, do while and while loops to do repetitive tasks in your applications
  • Put all these together in a fun and easy to understand way
C++ Operators and Flow Control

You've learnt a great deal so far. Put your knowledge together and build a fun number guessing console game. Along the way : 

  • You'll learn how to generate random numbers
  • You'll use a loop to keep the user doing something until you tell them to stop
  • You'll do something when the loop has exited : Congratulate the user on nailing the game!
C++ Demo Game Program : Guess My Number
Qt5.12 With srand()

Functions are the most basic way to keep your code organized . You'll :

  • See how to port  your code into a function you can call multiple times
  • Learn about function signatures, pass parameters and capture the returned value
  • Define function overrides to work on different data types
C++ Functions

Learn the basics of working with the Class construct in C++ . You'll : 

  • Appreciate how classes are used to model real life objects
  • Learn how to define your own custom classes
  • Add member variables to your class
  • Add member methods ( functions) to manipulate member variables inside the class
  • Instantiate objects of your classes and call methods on it
  • See how to implement methods in your class OUTSIDE the class
C++ Classes Part 1 of 3

Learn more about classes : 

  • Define default and custom constructors for your classes
  • Instantiate an object of your class so that the default constructor is called
  • Define custom constructors with your own parameters and Instantiate objects with them
  • Use initializer lists to initialize member variables in your classes
  • Define a class that uses your custom class as a member variable
C++ Classes Part 2 of 3

Learn about inheritance and splitting your classes into multiple files : 

  • Define a class that inherits another one
  • Work with your classes from multiple files
C++ Classes Part 3 of 3

Enough of the console. Time to work with actual graphical user interfaces built with Qt !

Preview 08:50

Build a GUI Version of the Number Guessing Game we built in Lecture 9.This lecture may be challenging as it uses UI components before we explain them but this is intended to kind of get  your wheels spinning before we dive deep into these components in section 4. Along the way : 

  • You'll have your first shot on adding ui components on a user interface
  • Don't worry if you don't fully understand them, that's what the entire next section is all about :-)
  • You'll respond when a user does something in the UI and do something in code : Go to Slot.
  • Do a brain connection of how you can take your console program and build a UI on top of it
Demo-Guess Numbers Gui
+ Signals And Slots
3 lectures 44:44

Lambda functions are a great way to do inline functions in C++, you'll have the bare basics about them laid down here and be able to use them in your C++ applications, along the way you'll : 

  • Learn the signature of lambda functions
  • Define a lambda function and attach a function name to it, and call it
  • Define a nameless lambda function and call it right away
  • Define a lambda function that takes parameters
  • Define a lambda function that returns a value
  • Learn what capture lists are all about
  • Learn about capturing variables in context by value and by reference
  • Learn about capturing everything  in context by value and by reference
C++ Lambda Basics

Learn what a signal and slot is in Qt and different ways to connect them in your Qt applications. Along the way, you'll : 

  • Use the string notation to connect signals and slots
  • Use the functor notation to connect signals and slots
  • Use the functor notation with lambdas to connect signals in Qt
  • Build a Qt widgets project and play with all these types of connections.
Connecting Signals to Slots : 3 Different Ways

Have your try on signals and slots in a sightly more exciting way : 

  • You'll define a slider and progress bar component in the UI
  • Connect to the value changed signal of the slider and feed the data to the progress bar that moves  around when you move your slider.
  • It's going to be fun!
Demo -Your Try on Signals and Slots
+ A Tour of Qt Widgets
19 lectures 04:27:04

We've been using the QWidget class on occasion without really having explained it. This is the time to clear the fog. You'll : 

  • Understand the different files you have in a Qt Widgets application and the purpose of each
  • Understand how things are initialized in the main function
  •  See how the code in the Widget.cpp file is connected to the ui form containing your UI components
  • Add UI components on the widget form and access them in code from the class cpp file
  • Create your class from scratch without using UI forms : This gives you the necessary muscle to work with other C++ objects in code. Will revert back to using UI froms later in the course
  • Set properties to your defined class and add a simple UI component to it. IN CODE.
  • See how great the Qt documentation is . You should use it to your advantage!
QWidget Class Part 1 of 2

The last lecture left us with a Widget that we defined in code with a label component on it. Time to take it further . You'll : 

  • Add other UI components and programmatically move them around the widget for better visibility
  • Apply a font to your widgets to make them look different
  • Apply color palettes to your labels to control the text color and the background color
  • Programmatically add a button in and connect a slot to it
  • Give a size hint to your widget for it preferred size
  • See how great the Qt documentation is. Use it to your advantage!
QWidget Class Part 2 of 2

QMainWindow is the main widget for a good number of Qt applications out there. It lets you use things like Menus , Toolbars, status bars very easily.You'll try it in your own Qt application and along the way you'll : 

  • See the different parts it can contain
  • Set a central widget to the QMainWindow class
  • Add menus to your main window
  • Add menu options to your menus
  • Use the QAction class to make your menu options operational ( We'll use that to kill our application from the Quit menu option)
  • connect slots to the triggered signal of the QAction class.
  • Learn how to kill ( Quit ) your Qt application
  • Learn how to show status bar messages
QMainWindow Class

QMessageBox class allows you to show messages to your users. You'll learn different ways you can use this class and look at numerous convenience methods it provides to make your live easier. Along the way, you'll : 

  • Define and use your own QMessageBox from scratch and see all the quirks needed to use it
  • Use different static methods of the class to show information, warning, critical and question messages
  • Add the buttons you want in the message box
  • Respond when a given button is clicked in the message box
  • Set default button to your message box.
Preview 16:32

It's almost impossible to write a Qt UI application without using the QPushButton class. That's why we've been using  it quite a lot before we even explain it. In this lecture you'll : 

  • Connect a slot to its clicked signal, AGAIN 
  • Look at two other signals the class can emit and connect slots to them
QPushButton Class

The QLineEdit class allows you to capture one liner input data in your Qt Ui applications. Your task in this lecture is to build an input form completely from code ( position widgets and all that stuff) and make it fully operational. Along the way , you 'll :

  • Capture data from the QLineEdit ui component
  • Check your line edits for emptiness
  • Connect slots to many of the QLineEdit class signals, including cursorPositionChanged, editingFinished, returnPressed,selectionChanged and many more
  • Learn how to set hint text in your line edits
QLineEdit Class

The QTextEdit class gives you an area were you can type longer pieces of texts with paragraphs. You'll going to use it and see some of its important signals. Along the way, you'll : 

  • See the important signals of the component like textChanged,copy,cut,paste and many more
  • Learn how to grap the text/html in the text edit and use it in your program
  • Learn how to set the text/html programmaticaly to the text edit
  • Organize a big chunk of your code into a method to leave the constructor of your class more manageable
QTextEdit Class

QLabel class is mostly used to show text labels in widgets. But its more exciting use is displaying images on widgets. In this lecture you're going to see it in action. Along the way you'll : 

  • Add your UI components on your widget using the widget.ui form file ( We'll be using forms onward in the course) 
  • Have your first encounter with using resources ( images) in your application
  • Prepare a QPixmap objects for use in your labels and set them in there

QLabel Class

The layout system in Qt takes away all the burden of positioning widgets manually ( the moving we've been doing all over the place). This lecture is a simple introduction to the topic before we dive deep into using them in the following lectures.

Qt Layouts

QHBoxLayout allows you to layout widgets horizontally in another widget. In this lecture you'll : 

  • Add UI components to the UI form
  • Declare your own instance of QHBoxLayout
  • Add widgets to your new layout
  • set the layout to the widget
  • The steps above effectively allow you to declare and use your layout in code
  • You'll then tear down the layout ( comment out ) and redo the layout from the UI form so you are aware of the two sides of the coin.

QVBoxLayout allows you to layout widgets vertically in another widget. In this lecture you'll : 

  • Add UI components to the UI form
  • Declare your own instance of QVBoxLayout
  • Add widgets to your new layout
  • set the layout to the widget
  • The steps above effectively allow you to declare and use your layout in code
  • You'll then tear down the layout ( comment out ) and redo the layout from the UI form so you are aware of the two sides of the coin.

The QSizePolicy class control how wigets behave ( grow/shrink) when the containing ( also called parent) widget is resized,  in this lecture, you'll : 

  • Learn the effects of some of the most common size policies on your widgets and how to set them
  • Learn the effects of size policy stretches on wigets contained in your layout
  • See easy to understand examples of how these two control points give  you greater flexibility in building your layouts.
Size Policy and Stretches

QGridLayout is what it sounds like, lays out your widgets in a grid structure, In this lecture you'll : 

  • Learn how to set up a grid layout for y our widgets
  • Learn about the spanning concepts when you need a widget to occupy multiple cells in the grid.

Checkboxes and radiobuttons are a must have in UIs that require you to collect a set of choices from a user. This lecture explores and sheds some light on different ways you can use them, including : 

  • Laying them out in a groupbox
  • Grouping them in logical groups using QButtonGroup so you can apply a common property to them
  • Connect to their toggled signal and capture the checked state in your code
  • Set them programmatically when you need to
  • Grab all the data in your sets of radiobuttons and checkboxes as a result of some event happening ( button click) 
QCheckBox and QRadioButton Classes

QList is one of the implementations of lists in Qt. It lets  you store objects in contiguous locations and gives you easy ways to grab  your data back when you need to. In this lecture, you'll : 

  • Declare your list of objects
  • Add data to it in different ways
  • Check on the number of items in your list
  • Loop through the elements of your list and use them in your code
The QList Class : Store your Objects in a List

The QComboBox widget is a combined button and popup list. You click on it and a list appears. You then can choose items from that list. In this lecture you'll get handy with this UI component, along the way , you'll : 

  • Add QCombBox component on the form
  • Add elements to in in code
  • Add elements to it as a result of an action on the ui
  • Delete elements from it
  • Let the user add elements to it at run time 
  • Loop through the elements inside and take action on them in your code
QComboBox Class

QListWidtet is a combined widget and list. It shows all the elements of the list in the widget without the need of popping them up like the combo box does. In this lecture, you'll get handy with this class and see it used in a more realistic way. You'll : 

  • Add a List Widget component to your UI
  • Add elements to it from the UI
  • Add elements in code
  • Delete elements
  • Select single/multiple elements in the list
  • Grab the selected elements in the list widget
QListWidge Class

QTabWidet allows to stuff different widgets in different tabs. This lecture will take you to a tour on this widget and different ways you can manipulate it. You will : 

  • Add relatively complex sets of layouts in different tabs of the tab widget
  • Add your own new tabs to the tab widget
  • Add your own new tabs and content FROM CODE
  • Respond to events like  you would in any other widget ( the tabwidget is just  a way to organize your widgets)
QTabWidget Class

We have used menus before but we never really got to connect actions in the menu option to actions in the tool bars. This lecture aims at addressing that and lets you build a more realistic mini-text handling application. Along the way you will : 

  • Add menus to your main window
  • Add menu options to them
  • Add a resource file that will contain images icons to be used by your actions generated when you add menu options to your menus
  • Set icons to your actions
  • Add actions to the toolbar
  • Connect the triggered signal of your actions to appropriate slots for handling
  • Show status bar message and use QTimer to schedule a kill of your application
Menus and Toolbars : QAction, QMenu, QToolbar
+ Working With Dialogs
8 lectures 01:15:33

Learn how to leverage QDialog to build your own dialog Classes

QDialog Part 1 of 2
QDialog Part 2 of 2

Put QMessageBox in Context as a Dialog Class


Learn about different static methods  you might call on QFileDialog to help you choose files and directory paths in your file system

File Dialogs

Learn how to let the user specify the fond they want to use for text shown in their widgets

Font Dialog

Learn how to let the user choose colors in your Qt applications

Color Dialog

Learn how to let the user choose one liner pieces of data in your Qt Applications

+ Working with Resources
2 lectures 15:30

Learn what the Qt resource system is all about, the syntax of it , prefixes and aliases.

The Qt Resource System Explained

Get to use image resources correctly in your Qt applications.

Working with Resource Files in your Qt Application
+ Styling your Qt Applications
5 lectures 51:52

An overview of how QStyle, QPalette and Style sheets can help in cooking up a custom look and feel for your Qt Application

An Overview on Qt Styling Offerings

QPalette used to control the colors of your widgets

QPalette Used Right

Style Sheets used to control the look and feel of your Qt Applications

Working with Style Sheets

Style sheets used from external files in your resource files to keep things neat and organized.

Style Sheets in External Files

Use style sheets to control more than just colors about the look and feel of your Qt Applications.

Demo : Doing More with Style Sheets
+ Working with Settings
2 lectures 33:25

See things you should be careful about when saving and loading your settings with QSettings

QSettings Explained

Get to use QSettings in your Qt applications by Saving and Loading your Colors.

Working with QSettings in Qt App
+ Working with Files and Directories
2 lectures 45:28

Leverage the QFile Class to read from and write to external files.

QFile: Reading and Writting Files

Learn how to leverage QDir to manipulate directories in your Qt Applications.

QDir : Manipulating Directories
+ Model View Architecture Framework
10 lectures 01:43:30
Introduction to the Model View Framework of Qt
Your first try on QModelIndexes
Working with QFileSystemModel
Working with QStandardItemModel
Working with QStringListModel
Building your Custom Model
Working with Roles in the Model
Notifying the view of Changes in the Model
Managing View Header Data
QStandardItem API and QSelectionModel
  • Basic knowledge of working with Computers
  • Open mind and strong willingness to learn how to build Qt C++ Gui applications
  • Basic understanding of programming will be useful but not required

This course will take you from zero to a level where you can write any Qt C++ Gui application you may want. It is aimed at complete beginners but people with varying levels of experience wishing to learn Qt C++ Gui will equally find it useful.

Qt is second to none in the field of building cross platform GUI application based on C++. It can currently be used to build software that runs on virtually any platform out there: Windows, Mac, Linux, Android, IOS and even embedded systems. You basically build your software once and all you have to do is build it for your desired platform and voila !

The course starts with a complete beginner to both C++ and Qt in mind, and we take  you through the the process of getting your environment set up on your platform of choice :

  • We do a live install of Qt Creator on Windows

  • We do a live install of Qt Creator on Linux

  • We guide you though how you would install Qt Creator on a Mac

  • We guide you through Qt Creator showing you the tools that work together to get your application built

We then take you on a tour of the C++ programming language, covering the concepts deemed important to start working with Qt to build your shinny GUI applications. You don't need to be a C++ wizard to start writing your applications using Qt. One of the goals behind Qt itself is to be as easy to use as possible, helping you to focus on your application logic rather than the C++ complex plumbing. This does not mean that you can do with zero C++ knowledge though. That's why we take you on a tour to cover the basic concepts of the language covering topics like:

  • Running your first console application and understanding the main function

  • Streams that help you write and read data from your C++ applications

  • Variables and Data Types

  • Basic C++ Operators and Control flow where among other things you learn about if clauses and loops

  • Build an app to guess numbers and put together the concepts learned so far

  • C++ Functions

  • C++ classes

  • Building your first Qt C++ GUI Application

  • Building a GUI Version of your Number guessing game

We then visit the fascinating concept signals and slots in Qt where  you learn the most flexible way to respond to events : 

  • We'll explore lambda functions in C++ in general, we'll need them to use their SIGNAL SLOT syntax

  • We explore different ways to connect signals to slots in Qt

  • We then do a concept enforcing demo for you to try them out

Next we dive in the Qt Widgets section and visit some of the most important widget classes in Qt : 

  • QWiget

  • QMainWindow

  • QMessageBox

  • QPushButton

  • QLineEdit

  • QTextEdit

  • QLabel

  • QHBoxLayout, QVBoxLayout, QGridLayout

  • We visit size policies and stretches and how they help tie the knots in  your layouts

  • QCheckBox and QRadioButton

  • QList

  • QComboBox

  • QListWidget

  • QTabWidget

  • QMenu, QToolBar, QAction

Dialogs are explored next , we look at QDialog and how to build  your own custom dialog class from scratch , QDialogButtonBox, QMessageBox, QFontDialog, QFileDialog, QInputDialog and how they add a layer of interactivity to your Qt GUI applications.

We then go on and explore how to work with the Qt Resource System , Styling your Qt applications with QStyle, QPalette and Style Sheets, Saving your application settings with QSetting, Working with Files and Directories using QFile and QDir and we wrap up the course with a tour of the network capabilities of Qt where we : 

  • See the different classes that are available to work with networks in Qt

  • Build an application to download web pages in our Qt Applications

  • Build an application to consume Rest APIs in your Qt Applications

This course was designed to help you succeed in becoming a Qt Gui application developer regardless of your current level of expertise. The only requirement is to bring in an open mind and a strong willingness to learn. Now, please check out some of the preview videos andl let's get you STARTED building cross platform GUI applications using Qt.

Who this course is for:
  • Anyone willing to Build Cross Platform Gui Software using Qt
  • Complete Beginners
  • Anyone willing to get a job building Qt Gui Applications
  • Students and Researchers willing to use Qt Gui features in their projects