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 Buttonstemplate, then add twoQLabel, twoQlineEdit, and threeQPushButtonwidgets to the form by dragging and dropping twoLabel, twoLine Edit, and threePush Buttonwidgets on the form. - Set the
textproperty of the twoLabelwidgets toNameandEmail Address.
- Set the
textproperty of the threePush Buttonwidgets toSubmit,Cancel, andForgot Password. - Because the purpose...