mirror of
https://gitlab.com/eql/EQL5.git
synced 2026-01-04 00:02:43 -08:00
revision of WebEngine example
This commit is contained in:
parent
63da51b412
commit
ceb797791d
1 changed files with 12 additions and 4 deletions
|
|
@ -7,11 +7,19 @@
|
|||
|
||||
(defvar *view* (qnew "QWebEngineView"))
|
||||
|
||||
;; N.B: The following functions are asynchronous (because WebEngine
|
||||
;; is all asynchronous).
|
||||
;; So, we won't have a return value, but need to pass a function.
|
||||
;; (See 'FunctorOrLambda' in both Qt Assistant and EQL sources.)
|
||||
|
||||
(defun to-text ()
|
||||
;; N.B: This call is asynchronous (because WebEngine is all asynchronous).
|
||||
;; So, we won't have a return value, but need to pass a function.
|
||||
;; (See 'FunctorOrLambda' in both Qt Assistant and EQL sources.)
|
||||
(|toPlainText| (|page| *view*) (lambda (text) (print text))))
|
||||
(|toPlainText| (|page| *view*)
|
||||
(lambda (text) (print text))))
|
||||
|
||||
(defun js (expression)
|
||||
;; example: (js "document.title")
|
||||
(|runJavaScript| (|page| *view*) expression
|
||||
(lambda (result) (qmsg result))))
|
||||
|
||||
(x:do-with *view*
|
||||
(|setUrl| (qnew "QUrl(QString)" "http://planet.lisp.org/"))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue