QDialogButtonBox standard dialog button in Qt Designer (Python)

QDialogButtonBox standard dialog button in Qt Designer (Python)

QDialogButtonBox is a widget that predefines a variety of standard buttons, which can be easily added to dialog boxes. When creating user interfaces with Qt Designer, you can use QDialogButtonBox to more easily add standard buttons to dialogs.

Here are the steps to add a standard button using QDialogButtonBox:

  1. Drag a QDialogButtonBox from the "Widgets" section of Qt Designer onto your window.

2. Double-click the QDialogButtonBox to open the QDialogButtonBox property editor.

  1. In the property editor, you can set the kind of standard button. Common standard buttons are Ok, Cancel, Apply and Help.

  2. Once you have determined the set of standard buttons you need, click the Apply button, and then click the OK button.

  3. In sample code similar to the following, you can use buttons in a QDialogButtonBox to handle user interaction.

from PyQt5.QtWidgets import QDialog, QVBoxLayout, QDialogButtonBox, QLabel

class

Guess you like

Origin blog.csdn.net/update7/article/details/131671942