howto run commonqt asynchronously

Ivan Shvedunov ivan4th at gmail.com
Mon Jan 4 23:23:33 UTC 2016


Don't create/exec QApplication when you're using qt-repl,
it's already created for you.
Put that into separate function and only call it in "production"
setting, i.e. when you're not using REPL.

On Mon, Jan 4, 2016 at 3:43 PM, Orm Finnendahl <
orm.finnendahl at selma.hfmdk-frankfurt.de> wrote:

> 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
>
>


-- 
Ivan Shvedunov <ivan4th at gmail.com>
;; My GPG fingerprint is: 2E61 0748 8E12 BB1A 5AB9  F7D0 613E C0F8 0BC5 2807
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/commonqt-devel/attachments/20160105/5dc7594b/attachment.html>


More information about the commonqt-devel mailing list