Shinmera / qtools

Qtools is a collection of utilities to aid development with CommonQt
https://shinmera.github.io/qtools
zlib License
210 stars 17 forks source link

Running (main) only shows "... QWidget DELETED" #24

Closed vindarel closed 7 years ago

vindarel commented 7 years ago

Hello, I installed Qtools and its dependencies today, I tried to run the examples both from the documentation and from the repository. (installing and compiling some code can't be easier, that's really nice.) Running for example (qtools-helloworld:main) only shows

#<QTOOLS-HELLOWORLD:MAIN QWidget DELETED> ;; deleted ?

and nothing happens. Same with the other examples and the code snippets from the doc.

I didn't see error messages while compiling, only warnings

Implicitly creating new generic function

Any hints ? Thanks.

Shinmera commented 7 years ago

What OS is this?

phoe commented 7 years ago

What do you see in the *inferior-lisp* buffer?

What you see in the REPL is normal; each window is deleted by the time it reaches the REPL to be printed, because the REPL only takes control when Qt quits. Don't mind the "implicitly creating new generic function" warnings either. I'm more puzzled by why the window does not even show, even though it should.

vindarel commented 7 years ago

Oh, had forgotten *inferior-lisp*. This is all of it:

(progn (load "/home/vince/quicklisp/dists/quicklisp/software/slime-v2.20/swank-loader.lisp" :verbose t) (funcall (read-from-string "swank-loader:init")) (funcall (read-from-string "swank:start-server") "/tmp/slime.25865"))

WARNING: Setting locale failed.
  Check the following variables for correct values:
  LC_CTYPE=en_US.UTF-8
  LANG=fr_FR.UTF-8
This is SBCL 1.3.19, an implementation of ANSI Common Lisp.
More information about SBCL is available at <http://www.sbcl.org/>.

SBCL is free software, provided as is, with absolutely no warranty.
It is mostly in the public domain; some portions are provided under
BSD-style licenses.  See the CREDITS and COPYING files in the
distribution for more information.
* 
; loading #P"/home/vince/quicklisp/dists/quicklisp/software/slime-v2.20/swank-loader.lisp"
WARNING:
   redefining EMACS-INSPECT (#<SB-PCL:SYSTEM-CLASS COMMON-LISP:T>) in DEFMETHOD
;; Swank started at port: 44008.
44008
* WARNING:
   redefining THREAD-FOR-EVALUATION (#<STRUCTURE-CLASS SWANK::MULTITHREADED-CONNECTION>
                                     #<SB-MOP:EQL-SPECIALIZER :FIND-EXISTING>) in DEFMETHOD
QApplication::exec: Must be called from the main thread
QApplication::exec: Must be called from the main thread
QApplication::exec: Must be called from the main thread
QApplication::exec: Must be called from the main thread
QApplication::exec: Must be called from the main thread
QApplication::exec: Must be called from the main thread

On Debian (LMDE).

Shinmera commented 7 years ago

It seems like you were calling exec multiple times from different threads. Try not using C-c C-c to evaluate things, or running on a bare SBCL first before using Slime.

vindarel commented 7 years ago

It works well on a bare SBCL (sbcli is better than rlwrap sbcl :) ).

Do you have recommendations to develop with Slime then ?

Shinmera commented 7 years ago

Not using C-c C-c or anything that spawns background threads to load or run the code.

vindarel commented 7 years ago

That seems a regression of the workflow O_o What commands can we use instead ?

Shinmera commented 7 years ago

Just load the system from the REPL and run it from there too. Using C-c C-c to compile in definition changes after the initial load works just fine.

vindarel commented 7 years ago

Ok thanks !

phoe commented 7 years ago

That seems a regression of the workflow O_o

That is a limitation of Qt itself - you may only spawn the application in the main thread.

vindarel commented 7 years ago

ok. Maybe having a qtools-slime-mode.el that does the right thing with C-c C-c would be possible. I'll get some experience with Qt[ools] first :)

phoe commented 7 years ago

Such a plugin would need to detect that it is about to run Qtools code and would need to send it into the REPL for evaluation instead of spawning a Swank compilation thread. Doable, but tricky.