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