add QML ini for SailfishOS
This commit is contained in:
parent
49261f5031
commit
8e0a6a6e0c
3 changed files with 30 additions and 1 deletions
|
|
@ -9,7 +9,7 @@
|
|||
#include <QStringList>
|
||||
#include <QDebug>
|
||||
|
||||
const char EQL::version[] = "21.3.2"; // March 2021
|
||||
const char EQL::version[] = "21.3.3"; // March 2021
|
||||
|
||||
extern "C" void ini_EQL(cl_object);
|
||||
|
||||
|
|
|
|||
|
|
@ -127,6 +127,7 @@
|
|||
#:file-to-url
|
||||
#:find-quick-item
|
||||
#:ini-quick-view
|
||||
#:ini-sailfish
|
||||
#:js
|
||||
#:js-arg
|
||||
#:qml-call
|
||||
|
|
|
|||
|
|
@ -209,3 +209,31 @@
|
|||
(|showFullScreen| *quick-view*)
|
||||
(|show| *quick-view*))))
|
||||
|
||||
;;; for SailfishOS
|
||||
|
||||
(defun ini-sailfish (file/url &optional root quick-view)
|
||||
(when (and root
|
||||
(qt-object-p root)
|
||||
(= (qid "QUrl") (qt-object-id root)))
|
||||
(setf *root* (x:cc (|toString| root) "/")))
|
||||
(setf *quick-view* (or quick-view (qnew "QQuickView")))
|
||||
(qconnect (|engine| *quick-view*) "quit()" 'qquit)
|
||||
(qnew "QQmlFileSelector(QQmlEngine*,QObject*)" (|engine| *quick-view*) *quick-view*)
|
||||
(|setSource| *quick-view* (if (stringp file/url)
|
||||
(file-to-url file/url)
|
||||
file/url))
|
||||
(when (= |QQuickView.Error| (|status| *quick-view*))
|
||||
;; display eventual QML errors (don't use QMSG, doesn't work on Sailfish)
|
||||
(print (x:join (mapcar '|toString| (|errors| *quick-view*))
|
||||
#.(make-string 2 :initial-element #\Newline))))
|
||||
(|setResizeMode| *quick-view* |QQuickView.SizeRootObjectToView|)
|
||||
(|show| *quick-view*)
|
||||
(when quick-view
|
||||
;; for compiled app;
|
||||
;; we add a fallback restart for eventual connections from Slime;
|
||||
;; this is needed if an exception occurs during event driven
|
||||
;; function calls (which would otherwise block the Slime REPL)
|
||||
(loop
|
||||
(with-simple-restart (restart-qt-events "Restart Qt event processing.")
|
||||
(qexec)))))
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue