From 26e218d29e82e95378b75dfb813c0e49ff97c435 Mon Sep 17 00:00:00 2001 From: polos Date: Fri, 17 Feb 2017 10:16:30 +0100 Subject: [PATCH] revisions of "quick" examples docu --- README-1.txt | 2 +- examples/M-modules/quick/Tic-Tac-Toe/README.txt | 14 +++++++++++++- .../M-modules/quick/Tic-Tac-Toe/properties.lisp | 7 ++++--- examples/M-modules/quick/item-model/README.txt | 6 ++++-- .../M-modules/quick/item-model/properties.lisp | 7 ++++--- examples/M-modules/quick/painted-item/README.txt | 13 +++++-------- .../M-modules/quick/painted-item/properties.lisp | 7 ++++--- examples/M-modules/quick/qml-lisp/README.txt | 4 +++- examples/M-modules/quick/qml-lisp/properties.lisp | 7 ++++--- 9 files changed, 42 insertions(+), 25 deletions(-) diff --git a/README-1.txt b/README-1.txt index b64088d..7a4f56a 100644 --- a/README-1.txt +++ b/README-1.txt @@ -163,7 +163,7 @@ To build an EQL module (corresponding to a Qt module), do the following in src/: [Linux,OSX] You need to create links to the modules, see EQL library above. -In Lisp, use the function QREQUIRE to load a module: +In Lisp, use function QREQUIRE to load a module: (qrequire :network) diff --git a/examples/M-modules/quick/Tic-Tac-Toe/README.txt b/examples/M-modules/quick/Tic-Tac-Toe/README.txt index c8baf50..7891531 100644 --- a/examples/M-modules/quick/Tic-Tac-Toe/README.txt +++ b/examples/M-modules/quick/Tic-Tac-Toe/README.txt @@ -66,6 +66,19 @@ Please see also "../qml-lisp/qml/example.lisp" for documentation on calling Lisp functions from QML. +HELP +==== + +To display the output of QPROPERTIES*, run + + (show-properties-dialog) ; see "properties.lisp" + +and use [Select] to explore the single QML items; +hint: click exactly inside a button text, and do + + (qml-set qsel:*q* "text" "ciao") + + TIP === @@ -79,4 +92,3 @@ QML Example: id: myItem objectName: "myItem" } - diff --git a/examples/M-modules/quick/Tic-Tac-Toe/properties.lisp b/examples/M-modules/quick/Tic-Tac-Toe/properties.lisp index 8675d48..35ac325 100644 --- a/examples/M-modules/quick/Tic-Tac-Toe/properties.lisp +++ b/examples/M-modules/quick/Tic-Tac-Toe/properties.lisp @@ -7,7 +7,8 @@ "Lists all instance properties of a QML item (either a QQuickItem or an 'objectName'). If no item is passed, QML:*CALLER* will be used." (unless (find-package :properties) (load (in-home "gui/properties"))) - (when (stringp item) - (setf item (qml:find-quick-item item))) (funcall (sym :show :properties) - (or item qml:*caller*))) + (or (if (stringp item) + (qml:find-quick-item item) + item) + qml:*caller*))) diff --git a/examples/M-modules/quick/item-model/README.txt b/examples/M-modules/quick/item-model/README.txt index 6e3be0f..2939ae4 100644 --- a/examples/M-modules/quick/item-model/README.txt +++ b/examples/M-modules/quick/item-model/README.txt @@ -15,6 +15,8 @@ Please run it from this directory. HELP ==== -To list all properties of the 'ListView', do: +To display the output of QPROPERTIES*, run - (show-properties-dialog (root-item)) ; see "properties.lisp" + (show-properties-dialog) ; see "properties.lisp" + +and use [Select] to explore the single QML items. diff --git a/examples/M-modules/quick/item-model/properties.lisp b/examples/M-modules/quick/item-model/properties.lisp index 8675d48..35ac325 100644 --- a/examples/M-modules/quick/item-model/properties.lisp +++ b/examples/M-modules/quick/item-model/properties.lisp @@ -7,7 +7,8 @@ "Lists all instance properties of a QML item (either a QQuickItem or an 'objectName'). If no item is passed, QML:*CALLER* will be used." (unless (find-package :properties) (load (in-home "gui/properties"))) - (when (stringp item) - (setf item (qml:find-quick-item item))) (funcall (sym :show :properties) - (or item qml:*caller*))) + (or (if (stringp item) + (qml:find-quick-item item) + item) + qml:*caller*))) diff --git a/examples/M-modules/quick/painted-item/README.txt b/examples/M-modules/quick/painted-item/README.txt index fb14f07..2e539b5 100644 --- a/examples/M-modules/quick/painted-item/README.txt +++ b/examples/M-modules/quick/painted-item/README.txt @@ -11,8 +11,8 @@ RUN Run "painted-item.lisp" from this directory. -NOTE -==== +NOTES +===== Use QQuickWidget here, because QQuickView would crash (e.g. on Windows). @@ -32,11 +32,8 @@ Examples: HELP ==== -Use function QPROPERTIES* to list all QML properties of an item instance, -including user defined ones. +To display the output of QPROPERTIES*, run -Examples: + (show-properties-dialog) ; see "properties.lisp" - (qproperties* (qml:find-quick-item "left")) - - (show-properties-dialog "left") ; see "properties.lisp" +and use [Select] to explore the single QML items. diff --git a/examples/M-modules/quick/painted-item/properties.lisp b/examples/M-modules/quick/painted-item/properties.lisp index 8675d48..35ac325 100644 --- a/examples/M-modules/quick/painted-item/properties.lisp +++ b/examples/M-modules/quick/painted-item/properties.lisp @@ -7,7 +7,8 @@ "Lists all instance properties of a QML item (either a QQuickItem or an 'objectName'). If no item is passed, QML:*CALLER* will be used." (unless (find-package :properties) (load (in-home "gui/properties"))) - (when (stringp item) - (setf item (qml:find-quick-item item))) (funcall (sym :show :properties) - (or item qml:*caller*))) + (or (if (stringp item) + (qml:find-quick-item item) + item) + qml:*caller*))) diff --git a/examples/M-modules/quick/qml-lisp/README.txt b/examples/M-modules/quick/qml-lisp/README.txt index fe8611e..2004752 100644 --- a/examples/M-modules/quick/qml-lisp/README.txt +++ b/examples/M-modules/quick/qml-lisp/README.txt @@ -78,7 +78,9 @@ Examples: (qproperties* (qml:find-quick-item "label")) - (show-properties-dialog "label") ; see "properties.lisp +Using a dialog, where you can use button [Select] to visually select items: + + (show-properties-dialog "label") ; see "properties.lisp" TIP diff --git a/examples/M-modules/quick/qml-lisp/properties.lisp b/examples/M-modules/quick/qml-lisp/properties.lisp index 8675d48..35ac325 100644 --- a/examples/M-modules/quick/qml-lisp/properties.lisp +++ b/examples/M-modules/quick/qml-lisp/properties.lisp @@ -7,7 +7,8 @@ "Lists all instance properties of a QML item (either a QQuickItem or an 'objectName'). If no item is passed, QML:*CALLER* will be used." (unless (find-package :properties) (load (in-home "gui/properties"))) - (when (stringp item) - (setf item (qml:find-quick-item item))) (funcall (sym :show :properties) - (or item qml:*caller*))) + (or (if (stringp item) + (qml:find-quick-item item) + item) + qml:*caller*)))