en:code:examples
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| en:code:examples [2024/11/24 12:42] – 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); |
| - | | + | |
| - | | + | buttonBox.accepted.connect(window.accept); |
| - | | + | buttonBox.rejected.connect(window.reject); |
| - | | + | |
| - | } | + | layout.addRow(" |
| - | }); | + | layout.addRow(" |
| - | // Variable Condition: if true go to line 1, if false go to line 10. | + | layout.addRow(buttonBox); |
| - | if (myObject | + | |
| - | | + | if(window.exec() |
| - | } else { | + | MessageBox().setText(" |
| - | Script.nextLine = 10; | + | |
| - | } | + | |
| </ | </ | ||
en/code/examples.1732452144.txt.gz · Last modified: by richard
