en:code:examples
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
en:code:examples [2024/11/24 12:44] – richard | en:code:examples [2024/11/24 12:52] (current) – richard | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ===example for selection and it goes to another line.=== | + | ===Show a custom dialog box=== |
<code javascript> | <code javascript> | ||
- | var stuff = { | + | var window |
- | " | + | var layout = new QFormLayout(window); |
- | " | + | var nameLineEdit = new QLineEdit(window); |
- | }; | + | var ageSpinBox = new QSpinBox(window); |
- | // choice no or yes. | + | var buttonBox |
- | var choice; | + | |
- | var dialogforAntiRaid | + | buttonBox.addButton(QDialogButtonBox.Ok); |
- | | + | buttonBox.addButton(QDialogButtonBox.Cancel); |
- | | + | |
- | items: [" | + | buttonBox.accepted.connect(window.accept); |
- | onValueChanged: | + | buttonBox.rejected.connect(window.reject); |
- | | + | |
- | } | + | layout.addRow(" |
- | }); | + | layout.addRow("Age:", ageSpinBox); |
- | // Variable Condition: if true go to line 1, if false go to line 10. | + | layout.addRow(buttonBox); |
- | if (choice == "yes" | + | |
- | | + | if(window.exec() |
- | } else { | + | MessageBox().setText(" |
- | | + | |
- | } | + | |
</ | </ |
en/code/examples.txt · Last modified: 2024/11/24 12:52 by richard