add function QPROPERTIES* for QQuickItems (for QML defined properties); some revisions;

This commit is contained in:
polos 2017-02-13 10:59:09 +01:00
parent 27289c1166
commit 733cc55033
13 changed files with 38 additions and 15 deletions

View file

@ -417,6 +417,14 @@ Prints all current properties of <code>object</code>, searching both all Qt prop
(qproperties *tool-button* 2) ; depth 2: both QToolButton and QAbstractButton
</pre>
<br><br>
<b>QPROPERTIES* (object)</b>
<br><br>
Similar to <code>qproperties</code>, but listing the custom properties of the passed <code>object</code> instance only.<br>This is only useful for e.g. <code>QQuickItem</code>, in order to list all QML user defined properties of the passed item.
<br>
<pre>
(qproperties* (qml:find-quick-item "myItem"))
</pre>
<br><br>
<b>QPROPERTY (object name)</b>
<br>
<b>QGET</b>

View file

@ -1,10 +1,7 @@
#-qt-wrapper-functions ; see README-OPTIONAL.txt
(load (in-home "src/lisp/all-wrappers"))
;;; hello world
(in-package :eql-user)
(qnew* "QLabel" ; QNEW* is QNEW followed by |show|
(qnew* "QLabel" ; 'qnew*' is 'qnew' followed by 'show'
"text" "<h1>hello world</h1>"
"pos" '(50 50))

View file

@ -57,6 +57,7 @@
"qoverride"
"qprocess-events"
"qproperties"
"qproperties*"
"qproperty"
"qq"
"qquit"

View file

@ -20,6 +20,20 @@ You need to tell QML-SET to call |update| after any change to data which
QML:PAINT depends on.
Only in this exceptional case there is no way to do it implicitly using QML.
Examples:
;; pass T as last argument for repainting
(qml-set "left" "color" "transparent" t)
(qml-set "right" "ellipse" '(40 40 20 20) t)
HELP
====
Use function QPROPERTIES* to list all user defined QML properties of an item.
Example:
(qml-set "left" "color" "orange" t) ; pass T for repainting
(qproperties* (qml:find-quick-item "left"))

View file

@ -50,7 +50,6 @@ QRadioData
QRegularExpressionMatch
QRegularExpressionMatchIterator
QSGRootNode
QSharedPointer<QQuickItemGrabResult>
QStaticText
QStringRef
QStyleHintReturn

View file

@ -57,6 +57,7 @@
"QIconEngine"
"QPaintEngine"
"QPrintEngine"
"QSharedPointer"
"FILE"
"FT_Face"
"GLfloat *"

View file

@ -3625,7 +3625,6 @@
"void forceActiveFocus ()"
"void forceActiveFocus ( Qt::FocusReason )"
"void grabMouse ()"
"QSharedPointer<QQuickItemGrabResult> grabToImage ( const QSize & = QSize() )"
"void grabTouchPoints ( const QVector<int> & )"
"bool hasActiveFocus () const"
"bool hasFocus () const"

View file

@ -7,7 +7,7 @@
#include <QTimer>
#include <QStringList>
const char EQL::version[] = "17.2.4"; // Feb 2017
const char EQL::version[] = "17.2.5"; // Feb 2017
extern "C" void ini_EQL(cl_object);

View file

@ -177,7 +177,6 @@ public:
Q_INVOKABLE void MforceActiveFocus(QQuickItem* o) { o->forceActiveFocus(); }
Q_INVOKABLE void MforceActiveFocus(QQuickItem* o, Qt::FocusReason x1) { o->forceActiveFocus(x1); }
Q_INVOKABLE void MgrabMouse(QQuickItem* o) { o->grabMouse(); }
Q_INVOKABLE QSharedPointer<QQuickItemGrabResult> MgrabToImage(QQuickItem* o, const QSize& x1 = QSize()) { return o->grabToImage(x1); }
Q_INVOKABLE void MgrabTouchPoints(QQuickItem* o, const QVector<int>& x1) { o->grabTouchPoints(x1); }
Q_INVOKABLE bool MhasActiveFocus(QQuickItem* o) const { return o->hasActiveFocus(); }
Q_INVOKABLE bool MhasFocus(QQuickItem* o) const { return o->hasFocus(); }

View file

@ -691,7 +691,6 @@
#:|grabKeyboard|
#:|grabMouse|
#:|grabShortcut|
#:|grabToImage|
#:|grabTouchPoints|
#:|grabWindow|
#:|grab|

View file

@ -2073,9 +2073,6 @@
(defun |grabShortcut| (object &rest arguments)
(%qinvoke-method object nil "grabShortcut" arguments))
(defun |grabToImage| (object &rest arguments)
(%qinvoke-method object nil "grabToImage" arguments))
(defun |grabTouchPoints| (object &rest arguments)
(%qinvoke-method object nil "grabTouchPoints" arguments))

View file

@ -204,7 +204,7 @@
'string< :key 'cdr)
'string< :key 'car))))
(defun qproperties (object &optional (depth 1))
(defun qproperties (object &optional (depth 1) of-instance)
"args: (object &optional (depth 1))
Prints all current properties of <code>object</code>, searching both all Qt properties and all Qt methods which don't require arguments (marked with '<b>*</b>').<br>Optionally pass a <code>depth</code> indicating how many super-classes to include. Pass <code>T</code> to include all super-classes.
(qproperties (|font.QApplication|))
@ -246,7 +246,8 @@
(let ((name (qt-object-name object*))
documentations functions properties)
(x:while (and name (not (eql 0 depth)))
(push (first (qapropos* nil name)) documentations)
(push (first (qapropos* nil (if of-instance object* name)))
documentations)
(setf name (qsuper-class-name name))
(when (numberp depth)
(decf depth)))
@ -292,6 +293,12 @@
(terpri)
(values)))))))
(defun qproperties* (object)
"args: (object)
Similar to <code>qproperties</code>, but listing the custom properties of the passed <code>object</code> instance only.<br>This is only useful for e.g. <code>QQuickItem</code>, in order to list all QML user defined properties of the passed item.
(qproperties* (qml:find-quick-item \"myItem\"))"
(qproperties object 1 t))
(defun ignore-io-streams ()
(setf *standard-output* (make-broadcast-stream)
*trace-output* *standard-output*
@ -808,6 +815,7 @@
(cons 'qobject-names '(&optional type))
(cons 'qoverride '(object name function))
(cons 'qproperties '(object &optional (depth 1)))
(cons 'qproperties* '(object))
(cons 'qproperty '(object name))
(cons 'qquit '(&optional (exit-status 0) (kill-all-threads t)))
(cons 'qremove-event-filter '(handle))

View file

@ -68,6 +68,7 @@
#:qoverride
#:qprocess-events
#:qproperties
#:qproperties*
#:qproperty
#:qq
#:qquit