fr:code:examples
Afficher une boîte de dialogue personnalisée
var window = new QDialog(); var layout = new QFormLayout(window); var nameLineEdit = new QLineEdit(window); var ageSpinBox = new QSpinBox(window); var buttonBox = new QDialogButtonBox(window); buttonBox.addButton(QDialogButtonBox.Ok); buttonBox.addButton(QDialogButtonBox.Cancel); buttonBox.accepted.connect(window.accept); buttonBox.rejected.connect(window.reject); layout.addRow("Nom :", nameLineEdit); layout.addRow("Age :", ageSpinBox); layout.addRow(buttonBox); if(window.exec() == QDialog.Accepted) MessageBox().setText("Votre nom est " + nameLineEdit.text + "\nAvez " + ageSpinBox.value + " ans.").showModal();
fr/code/examples.txt · Dernière modification : 2021/02/13 11:23 de 127.0.0.1