howto run commonqt asynchronously

Orm Finnendahl orm.finnendahl at selma.hfmdk-frankfurt.de
Mon Jan 4 12:43:36 UTC 2016


I still have problems with qt-repl and qt:

As expected, running the following code in qt works fine, but the repl
is blocked until the window is closed:

(ql:quickload "qt")
(in-package :qt)

(let* ((app (make-qapplication)))
  (with-objects ((window (#_new QWidget)))
    (#_setGeometry window 0 0 300 200)
    (#_setWindowTitle window "TestWindow")
    (#_show window)
    (#_exec app)))

Trying the same code in the qt-repl doesn't show the window:

(ql:quickload "qt-repl")
(in-package :qt-repl)
(start-gui-thread)

(let* ((app (make-qapplication)))
  (with-objects ((window (#_new QWidget)))
    (#_setGeometry window 0 0 300 200)
    (#_setWindowTitle window "TestWindow")
    (#_show window)
    (#_exec app)))

----
On the other hand, opening a window using an external ui file works
fine from the qt-repl:

(ql:quickload "qt-repl")
(in-package :qt-repl)
(start-gui-thread)
(ensure-smoke :qtuitools)

(let* ((app       (make-qapplication))
       (pathname  "/home/orm/work/programmieren/lisp/ui-design/mainwindow.ui")
       (ui-loader (#_new QUiLoader))
       (ui-file   (#_new QFile pathname))
       (toplevel  (#_load ui-loader
                          (progn
                            (#_open ui-file (#_QFile::ReadOnly))
                            ui-file))))
  (#_close ui-file)
  (#_delete ui-loader)
  (#_show toplevel)
  (#_exec app))


Does anybody know what I'm missing?

--
Orm



More information about the commonqt-devel mailing list