QMessageBox::information(this, "Information", "This is an informational message.");
int ret = QMessageBox::question(this, "Confirmation", "Are you sure you want to delete this item?", QMessageBox::Yes | QMessageBox::No); if (ret == QMessageBox::Yes) { // delete the item } else { // do nothing }
QMessageBox::critical(this, "Error", "An error has occurred.");QMessageBox belongs to the QtWidgets package library in Qt.