This example creates a custom dialog box that contains a QLabel, a QLineEdit, and two QPushButtons. The user can input their name in the QLineEdit, and the QDialog's accept() slot is called when the user clicks the OK button. The QDialog's reject() slot is called when the user clicks the Cancel button. Package library: Qt Example 2: A confirmation dialog box with yes/no buttonsc++ #include