Using Grid Layout
Grid Layout
arranges widgets in a stretchable grid. To understand how the Gird Layout
widget arranges the widgets, let's create an application.
How to do it...
In this application, we will make a simple sign-in form, prompting the user to enter an email address and password, followed by clicking the Submit
button. Below the Submit
button, there will be two buttons, Cancel
and Forgot Password
. The application will help you understand how these widgets are arranged in a grid pattern. Following are the steps to create this application:
- Launch Qt Designer and create an application based on the
Dialog without Buttons
template, then add twoQLabel
, twoQlineEdit
, and threeQPushButton
widgets to the form by dragging and dropping twoLabel
, twoLine Edit
, and threePush Button
widgets on the form. - Set the
text
property of the twoLabel
widgets toName
andEmail Address
.
- Set the
text
property of the threePush Button
widgets toSubmit
,Cancel
, andForgot Password
. - Because the purpose...