mirror of
https://gitlab.com/eql/EQL5.git
synced 2026-04-27 15:20:55 -07:00
"quick": add properties dialog to every example, see SHOW-PROPERTIES-DIALOG
This commit is contained in:
parent
e8aa7601e8
commit
1281b68a8b
13 changed files with 69 additions and 29 deletions
|
|
@ -1,4 +1,8 @@
|
|||
INFO
|
||||
====
|
||||
|
||||
This is a port of a QtQuick1/Qt4 example.
|
||||
Please note that this is _old_ QML code (QtQuick 1).
|
||||
|
||||
The JS game logic has (obviously) been ported to Lisp, see "game-logic.lisp".
|
||||
|
||||
|
|
|
|||
11
examples/M-modules/quick/Tic-Tac-Toe/properties.lisp
Normal file
11
examples/M-modules/quick/Tic-Tac-Toe/properties.lisp
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
;;; properties dialog
|
||||
|
||||
(defun sym (name package)
|
||||
(find-symbol (symbol-name name) package))
|
||||
|
||||
(defun show-properties-dialog (&optional item)
|
||||
(unless (find-package :properties)
|
||||
(load (in-home "gui/properties")))
|
||||
(funcall (sym :show :properties)
|
||||
(or item qml:*caller*)
|
||||
t)) ; all instance properties (for QML)
|
||||
|
|
@ -14,6 +14,7 @@
|
|||
|
||||
(require :qml-lisp "qml-lisp")
|
||||
(require :game-logic "game-logic")
|
||||
(require :properties "properties")
|
||||
|
||||
(defun run ()
|
||||
;; *quick-view* can be either a QQuickView or a QQuickWidget
|
||||
|
|
|
|||
|
|
@ -5,7 +5,8 @@
|
|||
|
||||
(qrequire :quick)
|
||||
|
||||
(require :qml-lisp "qml-lisp")
|
||||
(require :qml-lisp "qml-lisp")
|
||||
(require :properties "properties")
|
||||
|
||||
(use-package :qml)
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,8 @@
|
|||
|
||||
(qrequire :quick)
|
||||
|
||||
(require :qml-lisp "qml-lisp")
|
||||
(require :qml-lisp "qml-lisp")
|
||||
(require :properties "properties")
|
||||
|
||||
(use-package :qml)
|
||||
|
||||
|
|
|
|||
11
examples/M-modules/quick/item-model/properties.lisp
Normal file
11
examples/M-modules/quick/item-model/properties.lisp
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
;;; properties dialog
|
||||
|
||||
(defun sym (name package)
|
||||
(find-symbol (symbol-name name) package))
|
||||
|
||||
(defun show-properties-dialog (&optional item)
|
||||
(unless (find-package :properties)
|
||||
(load (in-home "gui/properties")))
|
||||
(funcall (sym :show :properties)
|
||||
(or item qml:*caller*)
|
||||
t)) ; all instance properties (for QML)
|
||||
|
|
@ -10,21 +10,12 @@
|
|||
|
||||
(qrequire :quick)
|
||||
|
||||
(require :qml-lisp "qml-lisp")
|
||||
(require :clock "clock")
|
||||
(require :qml-lisp "qml-lisp")
|
||||
(require :clock "clock")
|
||||
(require :properties "properties")
|
||||
|
||||
(use-package :qml)
|
||||
|
||||
;; properties
|
||||
|
||||
(defun sym (name package)
|
||||
(find-symbol (symbol-name name) package))
|
||||
|
||||
(defun show-properties-dialog (item)
|
||||
(unless (find-package :properties)
|
||||
(load (in-home "gui/properties")))
|
||||
(funcall (sym :show :properties) item t))
|
||||
|
||||
;; clock
|
||||
|
||||
(defun clock ()
|
||||
|
|
|
|||
11
examples/M-modules/quick/painted-item/properties.lisp
Normal file
11
examples/M-modules/quick/painted-item/properties.lisp
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
;;; properties dialog
|
||||
|
||||
(defun sym (name package)
|
||||
(find-symbol (symbol-name name) package))
|
||||
|
||||
(defun show-properties-dialog (&optional item)
|
||||
(unless (find-package :properties)
|
||||
(load (in-home "gui/properties")))
|
||||
(funcall (sym :show :properties)
|
||||
(or item qml:*caller*)
|
||||
t)) ; all instance properties (for QML)
|
||||
|
|
@ -5,22 +5,11 @@
|
|||
|
||||
(qrequire :quick)
|
||||
|
||||
(require :qml-lisp "qml-lisp")
|
||||
(require :qml-lisp "qml-lisp")
|
||||
(require :properties "properties")
|
||||
|
||||
(use-package :qml)
|
||||
|
||||
;; for example (5) in "qml/example.qml"
|
||||
|
||||
(defun sym (name package)
|
||||
(find-symbol (symbol-name name) package))
|
||||
|
||||
(defun show-properties-dialog ()
|
||||
(unless (find-package :properties)
|
||||
(load (in-home "gui/properties")))
|
||||
(funcall (sym :show :properties) qml:*caller* t))
|
||||
|
||||
;; ini
|
||||
|
||||
(defun run ()
|
||||
;; *quick-view* can be either a QQuickView or a QQuickWidget
|
||||
(setf qml:*quick-view* (qnew "QQuickView"))
|
||||
|
|
|
|||
11
examples/M-modules/quick/qml-lisp/properties.lisp
Normal file
11
examples/M-modules/quick/qml-lisp/properties.lisp
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
;;; properties dialog
|
||||
|
||||
(defun sym (name package)
|
||||
(find-symbol (symbol-name name) package))
|
||||
|
||||
(defun show-properties-dialog (&optional item)
|
||||
(unless (find-package :properties)
|
||||
(load (in-home "gui/properties")))
|
||||
(funcall (sym :show :properties)
|
||||
(or item qml:*caller*)
|
||||
t)) ; all instance properties (for QML)
|
||||
|
|
@ -11,6 +11,7 @@
|
|||
(defvar *main* (qload-ui (in-home "gui/properties")))
|
||||
|
||||
(defvar-ui *main*
|
||||
*class-name*
|
||||
*view*
|
||||
*depth*
|
||||
*label*
|
||||
|
|
@ -24,6 +25,9 @@
|
|||
(defvar *object* nil)
|
||||
|
||||
(defun ini ()
|
||||
(let ((font (|font.QApplication|)))
|
||||
(! "setBold" font t)
|
||||
(! "setFont" *class-name* font))
|
||||
(! "setReadOnly" *view* t)
|
||||
(! "setMinimum" *depth* 1)
|
||||
(! "resize" *main* '(650 500))
|
||||
|
|
@ -53,9 +57,11 @@
|
|||
(when object
|
||||
(setf *object* object)
|
||||
(let ((depth 1)
|
||||
(name (qt-object-name object)))
|
||||
(name (qt-object-name *object*)))
|
||||
(! "setText" *label* name)
|
||||
(! "setWindowTitle" *main* name)
|
||||
(let ((name (! "className" (! "metaObject" *object*))))
|
||||
(! "setText" *class-name* (subseq name 0 (position #\_ name))))
|
||||
(x:while (setf name (qsuper-class-name name))
|
||||
(incf depth))
|
||||
(! "setMaximum" *depth* depth)
|
||||
|
|
|
|||
|
|
@ -14,6 +14,9 @@
|
|||
<string>Properties</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="class_name"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QTextEdit" name="view"/>
|
||||
</item>
|
||||
|
|
|
|||
|
|
@ -1647,7 +1647,7 @@ cl_object qapropos2(cl_object l_search, cl_object l_class, cl_object l_type, cl_
|
|||
search = toCString(l_search); }
|
||||
bool all = (Cnil == l_type);
|
||||
bool q = all ? false : (Ct == cl_eql(q_keyword(), l_type));
|
||||
bool no_offset = (Ct == l_no_offset);
|
||||
bool no_offset = (l_no_offset != Cnil);
|
||||
StrList classes;
|
||||
bool qt_eql = false;
|
||||
const QMetaObject* mo = 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue