Using Horizontal Layout
A horizontal layout arranges widgets next to each other in a row that is, widgets are horizontally aligned using Horizontal Layout
. Let's understand this concept by making an application.
How to do it...
In this application, we will prompt the user to enter an email address and password. The main focus of this recipe is to understand how two pairs of the Label
and Line Edit
widgets are horizontally aligned. Here is the step-by-step procedure to create this application:
- Let's create an application based on the
Dialog without Buttons
template and add twoQLabel
, twoQlineEdit
, and oneQPushButton
widget to the form by dragging and dropping twoLabel
, twoLine Edit
, and aPush Button
widget on the form. - Set the
text
property of the twoLabel
widgets toName
andEmail Address
. - Also, set the
text
property of thePush Button
widget toSubmit
. - As the purpose of this application is to understand the layout and nothing else, we won't be setting the
objectName
property of any of...