How to do it...

Let's follow these steps to customize widget properties and sub-controls:

  1. Let's create a new Qt project. I have prepared the UI for this purpose. The UI contains three buttons on the left side and a Tab Widget with three pages located on the right side, as shown in the following screenshot:
  1. The three buttons are blue because I've added the following style sheet to the main window (not to the individual button):
QPushButton {    color: white;    background-color: #27a9e3;    border-width: 0px;    border-radius: 3px;}
  1. I will explain what pseudo-states are in Qt by adding the following style sheet to the main window, which you might ...

Get Qt5 C++ GUI Programming Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.