Book Image

Mastering Qt 5

By : Guillaume Lazar, Robin Penea
Book Image

Mastering Qt 5

By: Guillaume Lazar, Robin Penea

Overview of this book

Qt 5.7 is an application development framework that provides a great user experience and develops full-capability applications with Qt Widgets, QML, and even Qt 3D. This book will address challenges in successfully developing cross-platform applications with the Qt framework. Cross-platform development needs a well-organized project. Using this book, you will have a better understanding of the Qt framework and the tools to resolve serious issues such as linking, debugging, and multithreading. Your journey will start with the new Qt 5 features. Then you will explore different platforms and learn to tame them. Every chapter along the way is a logical step that you must take to master Qt. The journey will end in an application that has been tested and is ready to be shipped.
Table of Contents (20 chapters)
Mastering Qt 5
Credits
About the Authors
About the Reviewer
www.PacktPub.com
Preface

Composing your Gallery app


Alright, we completed AlbumListWidgetAlbumWidget, and PictureWidget. If you remember correctly, AlbumListWidget and AlbumWidget are contained in a widget called GalleryWidget.

Let's take a look at the GalleryWidget.ui file:

This widget does not contain any standard Qt widgets but only our created widgets. Qt provides two ways to use your own widgets in the Qt designer:

  • Promoting widgets: This is the fastest and easiest way

  • Creating widget plugin for Qt designer: This is more powerful but more complex

In this chapter, we will use the first way, which consists of placing a generic QWidget as a placeholder and then promoting it to our custom widget class. You can follow these steps to add the albumListWidget and the albumWidget objects to the GalleryWidget.ui file from the Qt designer:

  1. Drag and drop a Widget from Containers to your form.

  2. Set the objectName (for example, albumListWidget) from the Property Editor.

  3. Select Promote to... from the widget contextual menu.

  4. Set the...