
This video provides an overview of the entire course.
Why should you use C++ in 2018? Is the language still useful?
• Identify how C++ is used today
• Compare the advantages that C++ has over other languages
• Analyze the particular reasons for using C++
How do you set up a C++ development environment on Windows 10?
• Download and install Visual Studio
• Download and install CMake
• Test with a small check
What is the basic C++ language “grammar”?
• Identify the primitive integer types
• Understand primitive floating-point types
• Know how to control the code execution flow
How do you install Qt5 on Windows 10?
• Download installer from the web
• Run installer
• Select the correct items in installer to install
How to use the course source code?
• Obtain the source code
• Open CMake and open source directory in CMake
• Configure the project via CMake and then generate the solution
How do you generate random numbers in C++?
• Introduce cppreference for C++ documentation
• Understand probability distributions and which one is appropriate for a die
• Use the classes available in the C++ standard template library to generate a random number
How to display formatted output to the user?
• Know printf() via cppreference
• Use printf() to show formatted statements
• Implement different placeholders to print different values
How to get input from the user and use it in the virtual die?
• Introduce std::cin
• Show a brief example of using std::cin
• Allow viewers to implement the coding exercise to get user input on die range and number of rolls
What are the available containers for storing data in C++?
• Look at cppreference on available container classes
• Code small examples on how to use containers
• Run samples and observe the output to understand how the containers work
What is the proper use of std::vector?
• Analyze cppreference to show nuances of using std::vector
• Show the difference between push_back and emplace_back
• Understand the “proper” ways to initialize a std::vector
What algorithms are available in the standard template library?
• Introduce algorithms available in the standard template library via the documentation
• Implement examples of use of the various algorithms
• Show the output from program runs using the STL algorithms
How do you use STL algorithms with C++ containers?
• Explain iterators
• Show examples to further illustrate how they work
• Analyze the results of the examples via print statements
How to build a mini address book that is sortable by first name, last name, and phone number?
• Introduce std::pair and std::tuple
• Create fake data for “phone book”
• Show how to use the std::sort function to sort by first name, last name, and phone number
Why should you bother about classes/structures in C++?
• Learn to design code logically
• Understand how to re-use code
• Encapsulate ideas/models in code
How do you use/declare classes and structures in C++?
• Use the ‘class’ and ‘struct’ keywords
• Analyze { and }; to define where a class begins/ends
• Implement access modifiers such as ‘public’, ‘private’, and ‘protected’
What is the difference between a class and a structure?
• Understand that they basically do the same thing
• Default access modifier for classes is private. For structures, it’s public
• Structures are still around to preserve C compatibility
How can you use classes/structures to make a game?
• Think of the parts of the game
• Imagine what each class in the game should do
• Implement the game and play
How to structure and plan an application?
• Identify key parts of the application
• Plan out the class structure using class diagrams (UML)
• Create a class implementation using UML diagrams
How to build a library management system (books)?
• Plan out the classes
• Implement the classes based on the plan
• Compare functions for basic functionality in the application
How to add test data to the application?
• Define basic data in code
• Add a test .csv file with fake data
• Edit the .csv file to see how the library works
How can you add search functionality to the application?
• Learn what algorithms could be used from the STL
• Implement search by book title
• Experiment with search by author
How do you use CMake to set up a GUI project?
• Install Qt5
• Implement CMake for your Qt5 directory as shown in the video
• Reconfigure and generate the project via CMake
How can you add UI elements to your GUI application?
• Open Qt Creator
• Create a new Qt class
• Add the files to the correct folders in the course code
In what ways can you run your GUI application?
• Run the app through Visual Studio
• Run the app through PowerShell
• Run the app through File Explorer
How do you use CMake to set up a GUI project?
• Use the basic project setup provided by instructor
• Open Qt Creator and created the needed files as shown
• Put the files in the correct folders
How to use Qt Creator to make a basic GUI?
• Open the *.ui file in Qt Creator
• Add the QPlainTextEdit widget to the UI
• Arrange the layout contents vertically and add menu items
What are signals and slots in Qt?
• Go through the Qt documentation
• Understand that signals get emitted when something happens
• Learn that slots can be “connected” to signals to react to events
How do you write your own slots?
• Use access modifier “public” + keyword “slots”
• Implement the function declaration like any other class method
• Define the implementation like any other class method
How do you save the file on the system and open the same on the system later?
• Remove unnecessary signal and slot connections
• Allow for saving the text file to anywhere on the system
• Open any text file on the computer
How to set up a basic application?
• Use basic project setup provided by instructor
• Open Qt Creator and created needed files as shown
• Put the files in the correct folders
How do Qt5 widgets work under the hood?
• Look at the Qt5 documentation
• Understand that Qt widgets are “painted”
• Understand that Qt5 widgets use painters to “paint” their content
How do you create your own Qt5 widget?
• Look at the Qt documentation
• Inherit from QWidget
• Override parent methods that we need in the class
How can we react to user input in our custom widget?
• Look at the Qt documentation
• Override mouse event functions
• Print data to the console to confirm that the app is reacting properly
How can we paint user input on the screen?
• Introduce the QPainterPath class along with QPainter
• Update the list of paths in the widget and draw them
• Update the current path as the user uses the widget
How can we add the ability to draw shapes?
• Look at the QPainterPath documentation
• Change drawing style on a custom widget based on user selection
• Use the ‘addEllipse’ and ‘addRect’ functions
How can we allow for shapes to be resized as they’re drawn?
• Demo of what the result should look like
• Create simple structs to model a circle and square
• Use QPainter directly to update the widget when drawing shapes
C++ is a flexible and generic language that offers a wide range of benefits with key strengths being software infrastructure and resource-constrained applications. This course is an introductory guide to C++ that will help you learn the language through multiple hands-on examples.
You’ll begin by diving into the C++ basics, syntax, and generic programming features. We’ll then move on to using data structures and algorithms with C++. Next, you’ll delve into the object-oriented features of C++ with another practical example.
Finally, you’ll further enhance your C++ programming skills by creating multiple GUI, desktop applications using Qt5. By the end of this course, you will have gained knowledge of core programming concepts in C++, and how to implement them effectively.
About The Author
Alberto Ricardo Rodriguez has been a C++ Developer fan since more than 12 years. He has been working with a wide variety of C++ framework from Qt 3 to Qt 5.9, OpenGL, SDL and standards like C++98 to C++17 Standard. He has been developing from Desktop application to embedded applications, single threading apps to multi-threading applications. He has journeyed through a wide variety of companies, like Invap Se, Motorola Mobility, Intel Security, Globant SA, now working on Poland at Luxoft on navigation software for autonomous vehicles.Currently his main focus on Machine Learning and computer vision, and continually working on embedded devices for using this kind of technologies.