Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Application Development with Qt Creator - Second Edition
  • Toc
  • feedback
Application Development with Qt Creator - Second Edition

Application Development with Qt Creator - Second Edition

4 (25)
close
Application Development with Qt Creator - Second Edition

Application Development with Qt Creator - Second Edition

4 (25)

Overview of this book

This book is great for developers who are new to Qt and Qt Creator and who are interested in harnessing the power of Qt for cross-platform development. If you have basic experience programming in C++, you have what it takes to create engaging cross-platform applications using Qt and Qt Creator!
Table of Contents (15 chapters)
close
14
Index

Managing the widget layout with layouts


Qt Widgets includes a robust layout system to control the presentation of widgets on the display. In Qt Creator Designer, you can pick from the following layouts:

  • QBoxLayout: This lays out its view children horizontally or vertically

  • QHBoxLayout: This lays out its view children horizontally

  • QVBoxLayout: This lays out its view children vertically

  • QFormLayout: This lays out pairs of widgets (such as labels and textboxes) side by side and then tiles those pairs vertically, giving the appearance of a form

  • QGridLayout: This lays out widgets in a grid

  • QStackedLayout: This shows only a single widget at a time

Using one of these layouts is easy: simply choose the appropriate layout in Qt Creator Designer and drag it to the widget or window you're building. If you're constructing a hierarchy of widgets in the code, you add the widgets to the layout and set the parent widget's layout, like this:

QWidget *window = new QWidget();
QPushButton *button1 = new QPushButton...
bookmark search playlist download font-size

Change the font size

margin-width

Change margin width

day-mode

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Delete Bookmark

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete