![]() ![]() ui file in the program.įirst, execute the following command to convert the login_form.ui file to login_form.py file: ui file to Python code and use the generated code from the program. There’re two ways to use the login_form.ui from a Python program: menu or the keyboard shortcut Ctrl-R to preview the form: Third, right-click the widget and set its layout to Form Layout:įourth, change the size of the Login button by setting its Horizontal Size Policy to Fixed:įifth, save the form to the D:\pyqt6 directory as login_form.ui file. ![]() Second, set the echo mode of the password field to Password: The following table lists the fields, their types, and names: Field In the Property Editor, you can set a name for the widget e.g., login_formĪnd the window title: Adding widgets to the login formįirst, add the widgets QLabel, QLineEdit, and QPushButton to the form: You can set the layout for the widget, and drag and drop widgets from the Widget Box to the form. Second, select the Widget from the templates\forms and click the Create button: We’ll create a simple login form using the Qt designer and load it into our Python program.įirst, select File > New or press Ctrl-N keyboard shortcut to open the New Form dialog: The Qt Designer will look like this: Creating a login form (pyqt6-env) d:\pyqt6\pyqt6-env\Scripts>designer Code language: Python ( python )
0 Comments
Leave a Reply. |