February 2019
Beginner
136 pages
3h 7m
English
The QHBoxLayout layout class is very similar in use to QVBoxLayout. Widgets are added to the layout by calling the addWidget() method.
Consider the following diagram:

The arrow in the diagram shows the direction in which widgets grow in number as they are added to a QHBoxLayout. The first widget added to this layout is widget 1, while widget 3 is the last widget to be added to the layout.
A small application to allow users to enter a URL makes use of this layout type:
#include <QApplication>#include <QHBoxLayout>#include <QPushButton>#include <QLineEdit>int main(int argc, char *argv[]){ QApplication app(argc, argv); QWidget *window ...Read now
Unlock full access