revision of example 'debug-ui'

This commit is contained in:
pls.153 2025-10-19 11:15:57 +02:00
parent 08c81af287
commit 502799eba5
7 changed files with 121 additions and 7 deletions

View file

@ -1,10 +1,7 @@
(defsystem :app (defsystem :app
:serial t :serial t
:depends-on () :depends-on (lqml-debug)
:components ((:file "lisp/package") :components ((:file "lisp/package")
(:file "lisp/ui-vars") (:file "lisp/ui-vars")
(:file "lisp/d-dialogs") ; for debug-ui
(:file "lisp/d-input-hook") ; for debug-ui
(:file "lisp/d-debug-ui") ; for debug-ui
(:file "lisp/main"))) (:file "lisp/main")))

View file

@ -0,0 +1,13 @@
(defsystem :app
:serial t
;; requires this CLOG fork: https://gitlab.com/eql/clog-for-mobile/-/blob/main/clog-2.2.tgz
:depends-on (lqml-debug
#-depends-loaded :clog)
:components ((:file "lisp/package")
(:file "lisp/ini")
(:file "lisp/ui-vars")
#+mobile (:file "lisp/swank-quicklisp")
;;(:file "lisp/eval")
(:file "lisp/clog-bridge")
(:file "clog-assets/demos/01-demo")
(:file "lisp/main")))

View file

@ -0,0 +1,24 @@
import QtQuick 2.15
import QtQuick.Controls 2.15
import "." as Ext
Rectangle {
color: "lavender"
//Ext.Repl {}
function log(message) {
logModel.append({ message: message })
listView.positionViewAtEnd()
}
ListView {
id: listView
anchors.fill: parent
model: ListModel { id: logModel }
delegate: Text {
font.pixelSize: 14
text: message
}
}
}

View file

@ -0,0 +1,72 @@
import QtQuick 2.15
import QtQuick.Controls 2.15
import "ext/" as Ext
import "debug/" as Dbg
StackView {
id: main
width: 400
height: 650
objectName: "main"
initialItem: mainRect
// show/hide dialogs
function pushDialog(name) {
switch (name) {
case "debug": main.push(dialogDebug); break
}
}
function popDialog() { main.pop() }
// log
function log(message) {
logPage.log(message)
}
FontLoader { id: fontIcons; source: "fonts/fontawesome-webfont.ttf" }
FontLoader { id: fontHack; source: "fonts/Hack-Regular.ttf" }
FontLoader { id: fontHackBold; source: "fonts/Hack-Bold.ttf" }
Rectangle {
id: mainRect
color: "#bbb"
SwipeView {
id: view
objectName: "view"
anchors.fill: parent
// page 1: webview (native on mobile)
Ext.Browser {}
// page 2: log
Ext.Log { id: logPage }
}
PageIndicator {
anchors.bottom: view.bottom
anchors.bottomMargin: 10
anchors.horizontalCenter: parent.horizontalCenter
count: view.count
currentIndex: view.currentIndex
}
// dialogs
Dbg.DebugDialog { id: dialogDebug }
}
Keys.onPressed: (event) => {
if (event.key === Qt.Key_Back) {
event.accepted = true
if (view.currentIndex === 0) {
Lisp.call("qml:qquit")
} else {
view.currentIndex--
}
}
}
}

Binary file not shown.

View file

@ -6,10 +6,9 @@ import 'debug/' as Dbg
StackView { StackView {
id: main id: main
objectName: "main" objectName: "main"
width: 800 // alternatively: Screen.desktopAvailableWidth width: 800
height: 600 // alternatively: Screen.desktopAvailableHeight height: 600
initialItem: mainRect initialItem: mainRect
Screen.orientationUpdateMask: Qt.LandscapeOrientation | Qt.PortraitOrientation | Qt.InvertedLandscapeOrientation
// show/hide dialogs // show/hide dialogs

View file

@ -12,6 +12,15 @@ This is especially helpful on android, where Lisp issues are hard to debug once
the app is installed. the app is installed.
Prepare
-------
* extract `local-projects/lqml-debug.tgz` under `~/quicklisp/local-projects/`
* add `lqml-debug` as your very first dependency in your `app.asd`
* modify your `main.qml` as can be seen in `examples/`
* comment out evtl. present `eval.lisp` (needed for repl) and `Ext.Repl {}`
Important note Important note
-------------- --------------