Giter Site home page Giter Site logo

commonqt's People

Contributors

eudoxia0 avatar ivan4th avatar lichtblau avatar luismbo avatar markcox80 avatar shinmera avatar stassats avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

commonqt's Issues

list arguments cause method-applicable-p failed.

I have just installed commonqt, and want to give t14.lisp a try.

Then I meet the following error

No applicable method drawPie found on # with arguments ( # < QRect 0xB1E1B590 >
0
(* 90 16))
[Condition of type SIMPLE-ERROR]
see detail in bactrace at the end.

After redefined method-applicable-p as this:

(in-package :qt)
(defun method-applicable-p (method args &optional fix-types)
"Assumes that ARGS has the correct number of arguments"
(block nil
(map-qmethod-argument-types
(lambda (arg-type)
(let ((fix-type (pop fix-types)))
(unless (and (or (not fix-type)
(eq (qtype-interned-name arg-type)
fix-type))
(let ((a (pop args)))
(format t "arg:~a, type:a%" a (qtype-interned-name arg-type))
(can-marshal-p a arg-type)))
(return))))
method)
t))
the last print out is:

arg:(* 90 16), type:int

It seems (* 90 16) in

(#_drawPie painter rect 0 (* 90 16)))
cause method-applicable-p failed.

After change (* 90 16) to 1440, t14.lisp worked.

How could we fixed this issue?

Backtrace:

No applicable method drawPie found on # <QPainter 0xB6BC9890> with arguments ( # < QRect 0xB1E1B590 >
0
(* 90 16))
[Condition of type SIMPLE-ERROR]

Restarts:
0: [ABORT] Abort smoke callback
1: [RETRY] Retry SLIME REPL evaluation request.
2: [*ABORT] Return to SLIME's top level.
3: [ABORT] Abort thread (#<THREAD "repl-thread" RUNNING {B653551}>)

Backtrace:
0: (QT::RESOLVE-CALL T #<QPainter 0xB6BC9890> "drawPie" (#<QRect 0xB1E1B590> 0 (* 90 16)) (NIL NIL NIL))
1: (QT-TUTORIAL-14::PAINT-CANNON #<QT-TUTORIAL-14::CANNON-FIELD QWidget 0xB6B7E190> #<QPainter 0xB6BC9890>)
2: ((:METHOD QT-TUTORIAL-14::PAINT-EVENT (QT-TUTORIAL-14::CANNON-FIELD T)) #<QT-TUTORIAL-14::CANNON-FIELD QWidget 0xB6B7E190> #) [fast-method]
3: (QT::OVERRIDE QT-TUTORIAL-14::PAINT-EVENT #<QT-TUTORIAL-14::CANNON-FIELD QWidget 0xB6B7E190> "paintEvent" (#<QPaintEvent 0xB50B7830>))
4: (QT::%DYNAMIC-INVOCATION-CALLBACK #.(SB-SYS:INT-SAP #XB6B10798) #.(SB-SYS:INT-SAP #XB6B7E190) 15627 1 #.(SB-SYS:INT-SAP #XB50B7468))
5: ((LAMBDA (QT::SMOKE METHOD QT::OVERRIDE-ID QT::OBJ QT::ARGS) :IN "/home/qt/quicklisp/dists/quicklisp/software/commonqt-20130312-git/ffi.lisp") #.(SB-SYS:INT-SAP #XB6B10798) 15627 1 #.(SB-SYS:INT-SAP #..
6: ((LAMBDA (SB-ALIEN::ARGS-POINTER SB-ALIEN::RESULT-POINTER FUNCTION) :IN "/home/qt/.cache/common-lisp/sbcl-1.1.8-linux-x86/home/qt/quicklisp/dists/quicklisp/software/commonqt-20130312-git/ffi.fasl") -3..
7: ("foreign function: call_into_lisp")
8: ("foreign function: funcall3")
9: ("foreign function: #x11009B5")
10: ("foreign function: _ZN14DynamicBinding10callMethodEsPvPN5Smoke9StackItemEb")
11: ("foreign function: _ZN12__smokeqtgui9x_QWidget10paintEventEP11QPaintEvent")
12: ("foreign function: #x3195B420")
13: ((LABELS QT::ARGLIST-MARSHALLER :IN QT::ARGLIST-MARSHALLER) NIL #<CLOSURE (LAMBDA (QT::STACK) :IN QT::%%CALL) {E30878D}>)
14: (QT::%%CALL #.(SB-SYS:INT-SAP #XB1E2D2F0) NIL #<CLOSURE (LABELS QT::ARGLIST-MARSHALLER :IN QT::ARGLIST-MARSHALLER) {E3086CD}> #.(SB-SYS:INT-SAP #XB3F814D0) 20 #<CLOSURE (LAMBDA (QT::STACK-ITEM) :IN QT..
15: ((LAMBDA (QT::ACTUAL-INSTANCE QT::ARGS) :IN QT::RESOLVE-CALL) #<QEventLoop 0xB1E2D2F0> NIL)
16: (QT-TUTORIAL-14:MAIN)
17: (SB-INT:SIMPLE-EVAL-IN-LEXENV (QT-TUTORIAL-14:MAIN) #)
18: (EVAL (QT-TUTORIAL-14:MAIN))
19: (SWANK::EVAL-REGION " (qt-tutorial-14:main) ..)
20: ((LAMBDA NIL :IN SWANK::REPL-EVAL))
21: (SWANK::TRACK-PACKAGE #<CLOSURE (LAMBDA NIL :IN SWANK::REPL-EVAL) {DAF1FDD}>)
22: ((LAMBDA NIL :IN SWANK::REPL-EVAL))
23: (SWANK::CALL-WITH-RETRY-RESTART "Retry SLIME REPL evaluation request." #<CLOSURE (LAMBDA NIL :IN SWANK::REPL-EVAL) {DAF0F9D}>)
24: ((LAMBDA NIL :IN SWANK::REPL-EVAL))
25: (SWANK-BACKEND:CALL-WITH-SYNTAX-HOOKS #<CLOSURE (LAMBDA NIL :IN SWANK::REPL-EVAL) {DAF0F8D}>)
26: (SWANK::CALL-WITH-BUFFER-SYNTAX NIL #<CLOSURE (LAMBDA NIL :IN SWANK::REPL-EVAL) {DAF0F8D}>)
27: (SWANK::REPL-EVAL " (qt-tutorial-14:main) ..)
28: (SWANK:LISTENER-EVAL " (qt-tutorial-14:main) ..)
29: (SB-INT:SIMPLE-EVAL-IN-LEXENV (SWANK:LISTENER-EVAL " (qt-tutorial-14:main) ..)
30: (EVAL (SWANK:LISTENER-EVAL " (qt-tutorial-14:main) ..)
31: (SWANK:EVAL-FOR-EMACS (SWANK:LISTENER-EVAL " (qt-tutorial-14:main) ..)
32: (SWANK::PROCESS-REQUESTS NIL)
33: ((LAMBDA NIL :IN SWANK::HANDLE-REQUESTS))
34: ((LAMBDA NIL :IN SWANK::HANDLE-REQUESTS))
35: (SWANK-BACKEND::CALL-WITH-BREAK-HOOK # #<CLOSURE (LAMBDA NIL :IN SWANK::HANDLE-REQUESTS) {B65E09D}>)
36: ((FLET SWANK-BACKEND:CALL-WITH-DEBUGGER-HOOK :IN "/home/qt/quicklisp/dists/quicklisp/software/slime-20130312-cvs/swank-sbcl.lisp") # #<CLOSURE (LAMBDA NIL :IN SWANK..
37: (SWANK-BACKEND:CALL-WITH-DEBUGGER-HOOK # #<CLOSURE (LAMBDA NIL :IN SWANK::HANDLE-REQUESTS) {B65E09D}>)
38: ((LAMBDA NIL :IN SWANK::HANDLE-REQUESTS))
39: (SWANK::CALL-WITH-BINDINGS ((STANDARD-OUTPUT . #1=#<SWANK-BACKEND::SLIME-OUTPUT-STREAM {B64AEC9}>) (STANDARD-INPUT . #2=#<SWANK-BACKEND::SLIME-INPUT-STREAM {AC59021}>) (TRACE-OUTPUT . #1#) (*ERR..
40: ((FLET #:FORM-FUN-1936 :IN SWANK::HANDLE-REQUESTS))
41: (SWANK::HANDLE-REQUESTS #<SWANK::MULTITHREADED-CONNECTION {C29BD01}> NIL)
42: (SWANK::REPL-LOOP #<SWANK::MULTITHREADED-CONNECTION {C29BD01}>)
43: ((LAMBDA NIL :IN SWANK::SPAWN-REPL-THREAD))
44: (SWANK::CALL-WITH-BINDINGS NIL #<CLOSURE (LAMBDA NIL :IN SWANK::SPAWN-REPL-THREAD) {B65E08D}>)
45: ((LAMBDA NIL :IN SWANK::SPAWN-REPL-THREAD))
46: ((FLET #:WITHOUT-INTERRUPTS-BODY-1101 :IN SB-THREAD::INITIAL-THREAD-FUNCTION-TRAMPOLINE))
47: ((FLET SB-THREAD::WITH-MUTEX-THUNK :IN SB-THREAD::INITIAL-THREAD-FUNCTION-TRAMPOLINE))
48: ((FLET #:WITHOUT-INTERRUPTS-BODY-537 :IN SB-THREAD::CALL-WITH-MUTEX))
49: (SB-THREAD::CALL-WITH-MUTEX #<CLOSURE (FLET SB-THREAD::WITH-MUTEX-THUNK :IN SB-THREAD::INITIAL-THREAD-FUNCTION-TRAMPOLINE) {B50B9125}> #<SB-THREAD:MUTEX "thread result lock" owner: #<SB-THREAD:THREAD ..
50: (SB-THREAD::INITIAL-THREAD-FUNCTION-TRAMPOLINE #<SB-THREAD:THREAD "repl-thread" RUNNING {B653551}> #S(SB-THREAD:SEMAPHORE :NAME "Thread setup semaphore" :%COUNT 0 :WAITCOUNT 0 :MUTEX #<SB-THREAD:MUTEX..
51: ("foreign function: call_into_lisp")
52: ("foreign function: funcall0")
53: ("foreign function: new_thread_trampoline")
54: ("foreign function: #xB7FC2CF0")

Accessing items from QList returned by QGraphicsScene::views()

I'm trying to retrieve the set of views of a graphics scene is bound to, but could find no way to access individual items from the QList<QGraphicsView*> returned by QGraphicsScene::views(). The QList methods e.g. (#_front x) don't work or exist according to qt:qapropos.

Identity of implicitly created objects.

(with-objects ((message-box (#_new QMessageBox)))
    (let ((added (#_addButton message-box(#_QMessageBox::Yes)))
          (fetched (#_button message-box (#_QMessageBox::Yes))))
      (values (eq added fetched)
              added
              fetched)))
=>
NIL
#<QPushButton 0x7FFFE8111D00>
#<QPushButton 0x7FFFE8111D00>

The same object is not EQ.
Just caching all returned values is not going to work since they are not removed upon being freed, causing subsequent clashes.
Capturing all ChildAdded events and keeping track of them and deleting them when the parent is deleted is an option, but it may be too expensive.

#_layout doesn't work properly on QLayoutItem

(defun test ()
  (qt:make-qapplication)
  (let ((vbox (#_new QVBoxLayout))
        (hbox (#_new QHBoxLayout)))
    (#_addLayout vbox hbox)
    (#_layout (#_itemAt vbox 0))))

Returns #<QLayout NULL>, while it should return #<QHBoxLayout 0x080FD500>. This happens because the method layout is called from QLayoutItem class.

QModelIndex::internalId() should return integer

Calling QModelIndex::internalId() from Lisp yields garbled pointer like #.(SB-SYS:INT-SAP #X7FFFAC223F50) in SBCL and #foreign :VOID> in ECL.

Using Qt 4.8.6 on Linux x64, SBCL 1.3.0 , ECL 16.1.2 . As seen below, return type seems to be detected correctly:

> (qdescribe "QModelIndex::internalId")
240321 <3755,0,1> is a smoke method
    class: 4928
    name: internalId
    return type: 40195
    flags: #x2 (QMETHOD-CONST-P)
  argument types:
    (none)

> (qdescribe 40195)
40195 <628,0,3> is a type

    name: long long

Unmarshalling previously marshalled QList<T*> object fails

This snippet defines a custom signal/slot pair that take a QList<QObject*> as argument.

(defclass qobject-that-takes-qlist ()
  ()
  (:metaclass qt:qt-class)
  (:qt-superclass "QObject")
  (:slots ("take(QList<QObject*>)"
           (lambda (o s)
             (declare (ignore o))
             (assert (null s)))))
  (:signals ("send(QList<QObject*>)")))

(defmethod initialize-instance :after ((o qobject-that-takes-qlist) &key)
  (qt:new o)
  (qt:connect o "send(QList<QObject*>)" o "take(QList<QObject*>)"))

(defun qlist<qobject*>/signal ()
  (qt:with-objects ((o (make-instance 'qobject-that-takes-qlist)))
    (qt:emit-signal o "send(QList<QObject*>)" nil)))

Invoking qlist<qobject*>/signal yields:

Unhandled memory fault at #x7C.
   [Condition of type SB-SYS:MEMORY-FAULT-ERROR]

Backtrace:
  0: ("bogus stack frame")
  1: (SB-DEBUG::TRACE-CALL #<SB-DEBUG::TRACE-INFO QT::SW_QLIST_VOID_SIZE> #<FUNCTION QT::SW_QLIST_VOID_SIZE> #.(SB-SYS:INT-SAP #X5B4F09F8))
  2: (QT::|QList<QObject*>-UNMARSHALLER| #.(SB-SYS:INT-SAP #X5B4F09F8) #<unused argument>)
  3: (QT::UNMARSHAL-SLOT-ARGS #<QT::SLOT-SPEC take(QList<QObject*>) {1019C659A3}> #.(SB-SYS:INT-SAP #X0127E410))
  4: (QT::QT_METACALL-OVERRIDE #.(SB-SYS:INT-SAP #X00130170) 5 1 #.(SB-SYS:INT-SAP #X0127E410))
  5: ((LAMBDA (QT::OBJ QT::ID QT::SLOT-OR-SIGNAL-ID QT::ARGS) :IN "commonqt/ffi.lisp") #.(SB-SYS:INT-SAP #X00130170) 5 1 #.(SB-SYS:INT-SAP #X0127..
  6: ((LAMBDA (SB-ALIEN::ARGS-POINTER SB-ALIEN::RESULT-POINTER FUNCTION) :IN "commonqt/ffi.lisp") #<unavailable argument> #<unavailable argument>..
  7: ("foreign function: #x42EC8B")
  8: ("foreign function: #x404174")
  9: ((LABELS QT::ARGLIST-MARSHALLER :IN QT::ARGLIST-MARSHALLER) (#<QOBJECT-THAT-TAKES-QLIST QObject 0x00130170> 4 #.(SB-SYS:INT-SAP #X0127E410)) #<CLOSURE (LAMBDA (QT::STACK) :IN QT::%%CALL) {101B0F717B}>..
 10: ((LAMBDA (QT::STACK) :IN QT::ACTIVATE-SIGNAL) #.(SB-SYS:INT-SAP #X0127E410))
 11: ((LABELS QT::|QList<QObject*>-MARSHALLER| :IN "commonqt/qlist.lisp") NIL #<CLOSURE (LABELS QT::MARSHAL-AROUND-INNER :IN QT::MARSHALLER) {101..
 12: (QT::CALL-WITH-SIGNAL-MARSHALLING #<CLOSURE (LAMBDA (QT::STACK) :IN QT::ACTIVATE-SIGNAL) {101B0F575B}> (12355) (NIL))
 13: (QLIST<QOBJECT*>/SIGNAL)

Random observations:

  1. Exception seems to be coming from sw_qlist_void_size().
  2. Having traced QT::SW_QLIST_VOID_NEW, I can see that the unmarshaller sees a different pointer. Presumably, either SMOKE or Qt copied the QList object. Is there any difference in copying QList<void*> vs QList<QObject*>?
  3. Calling #_QObject::children, which returns a QList<QObject*> seems to work fine, which seems to shift the blame to the marshalling rather than the unmarshalling, maybe?

Using SBCL 2.0.2-ish on Windows 10 with whichever Qt version qt-libs bundles.

Signal name is corrupted - first letter is chopped off

We have the following code:

(defclass test-label (widget) ()
  (:qt-superclass "QLabel")
  (:metaclass widget-class)
  (:signals ("requestChangeText()"))
  (:slots ("changeText()"
           (lambda (this)
             (#_setText this "Boo!")))))

(defun test ()
  (with-main-window (this (make-instance 'test-label))
    (#_setText this "Peek a...")
    (connect this "requestChangeText()" this "changeText()")
    (#_QTimer::singleShot 2000 this "requestChangeText()")))

Evaluating (test) shows the following in the *inferior-lisp* buffer:

Object::connect: No such signal FOX5/QT::TEST-LABEL::equestChangeText()

But if we modify TEST's last line:

(defun test ()
  (with-main-window (this (make-instance 'test-label))
    (#_setText this "Peek a...")
    (connect this "requestChangeText()" this "changeText()")
    (#_QTimer::singleShot 2000 this "rrequestChangeText()")))

The code works as expected - after two seconds, the text on the label is changed.

The bug: the signal name mentioned in the *inferior-lisp* buffer is FOX5/QT::TEST-LABEL::equestChangeText() and is missing the initial r letter. Adding a single letter to the signal name, "rrequestChangeText()" in this example, makes the code work. Therefore I suspect that something is chopping off that initial letter of the signal name.

can-marshal-p and QKeySequence confusion

(can-marshal-p (#_new QKeySequence) (find-qtype "QKeySequence::StandardKey"))

returns T (but it can't marshall it).

Which breaks
(#_new QKeySequence (#_new QKeySequence))

Which ultimately breaks Qlist<QKeySequence> unmarshalling:
(defun test ()
(let ((action (#_new QAction (null-qobject (find-qclass "QAction"))))
(keys (list (#_new QKeySequence :|int| (#_Qt::Key_Backspace))
(#_new QKeySequence (#_QKeySequence::Back)))))
(#_setShortcuts action keys)
(#_shortcuts action)))

(test)
#<QKeySequence 0x083158E4> fell through ETYPECASE expression.
Wanted one of (ENUM INTEGER).

Tutorial by CommonQT

Hello!
I propose to make this tutorial: https://github.com/lispnik/iup
New users (like me) need explanation on how to find classes and methods descriptions, what are the main development paths, etc.
Very important to explaine how to use C++ documentation for CommonQT
Thanks!

QColor(QRgb) constructor segfaults

;; let's use the http://doc.qt.io/archives/qt-4.8/qcolor.html#QColor-3 constructor
> (#_new QColor (#_QGlobalSpace::qRgba 0 0 0 0))
#<Qt::QColor :R 255 :G 255 :B 255 {1005A025A3}> ;; 255? I gave it 0

> (#_new QColor (#_QGlobalSpace::qRgba 0 0 0 1))
;; Unhandled memory fault at #x7FBCDF93D4E0.
;;    [Condition of type SB-SYS:MEMORY-FAULT-ERROR]

;; a little bit of context - these ones work just fine
> (#_QGlobalSpace::qRgba 0 0 0 0)
0 ;; #x00000000

> (#_QGlobalSpace::qRgba 0 0 0 1)
16777216 ;; #x01000000

Same stuff happens if I call qRgb instead of qRgba.

#_extraSelections returning a pointer / #_setExtraSelections broken

For a QTextEdit bound to text-edit, (#_extraSelections text-edit) returns a #.(SB-SYS:INT-SAP #X7FAAF40B4090) According to http://doc.qt.io/archives/qt-4.8/qtextedit.html#extraSelections it should return a list, though.

Similarly, setExtraSelections is broken: (#_setExtraSelections text-edit '()) enters the debugger,

The value
  NIL
is not of type
  SB-SYS:SYSTEM-AREA-POINTER
   [Condition of type TYPE-ERROR]

Restarts:
 0: [ABORT] Abort smoke callback
 1: [RETRY] Retry SLIME REPL evaluation request.
 2: [*ABORT] Return to SLIME's top level.
 3: [ABORT] abort thread (#<THREAD "repl-thread" RUNNING {10027E0603}>)

Backtrace:
  0: ((LAMBDA (QT::VAL QT::STACK QT::I) :IN QT::SET-THUNK) NIL #.(SB-SYS:INT-SAP #X7FAAF4327A60) 1)
      Locals:
        #:G148 = 1
        #:G148151 = 1
        #:G653 = NIL
        QT::I = 1
        QT::STACK = #.(SB-SYS:INT-SAP #X7FAAF4327A60)
        #:STACK147 = #.(SB-SYS:INT-SAP #X7FAAF4327A60)
        #:STACK147150 = #.(SB-SYS:INT-SAP #X7FAAF4327A60)
        #:STORE149 = NIL
        #:STORE152 = NIL
        QT::VAL = NIL
        #:VALUE155 = NIL
  1: ((LABELS QT::MARSHAL-DEFAULT :IN QT::MARSHALLER) NIL #.(SB-SYS:INT-SAP #X7FAAF4327A60) 1 #<CLOSURE (LAMBDA NIL :IN QT::ARGSTEP-MARSHALLER) {101106C11B}>)
      Locals:
        QT::CONT = #<CLOSURE (LAMBDA () :IN QT::ARGSTEP-MARSHALLER) {101106C11B}>
        QT::I = 1
        QT::SET-THUNK = #<FUNCTION (LAMBDA (QT::VAL QT::STACK QT::I) :IN QT::SET-THUNK) {22AA96FB}>
        QT::STACK = #.(SB-SYS:INT-SAP #X7FAAF4327A60)
        QT::VALUE = NIL
  2: ((LAMBDA (QT::STACK QT::ARGLIST QT::FINAL-CONT) :IN QT::ARGSTEP-MARSHALLER) #.(SB-SYS:INT-SAP #X7FAAF4327A60) (NIL) #<CLOSURE (LAMBDA (QT::STACK) :IN QT::%%CALL) {101106C0DB}>)
      Locals:
        QT::ARGLIST = (NIL)
        QT::FINAL-CONT = #<CLOSURE (LAMBDA (QT::STACK) :IN QT::%%CALL) {101106C0DB}>
        QT::I = 1
        QT::MARSHAL-THUNK = #<CLOSURE (LABELS QT::MARSHAL-DEFAULT :IN QT::MARSHALLER) {101106BF2B}>
        QT::NEXT-THUNK = #<FUNCTION (LAMBDA (QT::STACK QT::ARGLIST QT::FINAL-CONT) :IN QT::ARGSTEP-MARSHALLER) {22ABEBFB}>
        QT::STACK = #.(SB-SYS:INT-SAP #X7FAAF4327A60)
  3: ((LABELS QT::ARGLIST-MARSHALLER :IN QT::ARGLIST-MARSHALLER) (NIL) #<CLOSURE (LAMBDA (QT::STACK) :IN QT::%%CALL) {101106C0DB}>)
      Locals:
        QT::ARGLIST = (NIL)
        QT::FINAL-CONT = #<CLOSURE (LAMBDA (QT::STACK) :IN QT::%%CALL) {101106C0DB}>
        QT::N = 2
        #:SIZE0 = 16
        QT::STACK = #.(SB-SYS:INT-SAP #X7FAAF4327A60)
        QT::THUNK = #<CLOSURE (LAMBDA (QT::STACK QT::ARGLIST QT::FINAL-CONT) :IN QT::ARGSTEP-MARSHALLER) {101106BF4B}>
  4: ((LAMBDA (QT::ACTUAL-INSTANCE QT::ARGS) :IN QT::RESOLVE-CALL) #<SPELLCHECKED-TEXT-EDIT QTextEdit 0x7FAAF4309E60> (NIL))
      Locals:
        QT::<FROM> = 25092
        QT::<TO> = 25092
        QT::ACTUAL-INSTANCE = #<SPELLCHECKED-TEXT-EDIT QTextEdit 0x7FAAF4309E60>
        QT::ARGLIST-MARSHALLER = #<CLOSURE (LABELS QT::ARGLIST-MARSHALLER :IN QT::ARGLIST-MARSHALLER) {101106BF7B}>
        QT::ARGLIST-MARSHALLER#1 = #<CLOSURE (LABELS QT::ARGLIST-MARSHALLER :IN QT::ARGLIST-MARSHALLER) {101106BF7B}>
        QT::ARGS = (NIL)
        QT::ARGS#1 = (NIL)
        QT::CASTED-INSTANCE-POINTER = #.(SB-SYS:INT-SAP #X7FAAF4309E60)
        QT::CASTFN = #.(SB-SYS:INT-SAP #X7FAAF91DC1A0)
        QT::CLASSFN = #.(SB-SYS:INT-SAP #X7FAAF933EDD0)
        QT::CLASSFN#1 = #.(SB-SYS:INT-SAP #X7FAAF933EDD0)
        QT::METHOD-INDEX = 63
        QT::METHOD-INDEX#1 = 63
        QT::RETURN-VALUE-FUNCTION = #<CLOSURE (LAMBDA (&REST SB-IMPL::ARGUMENTS) :IN CONSTANTLY) {101106BFAB}>
        QT::RETURN-VALUE-FUNCTION#1 = #<CLOSURE (LAMBDA (&REST SB-IMPL::ARGUMENTS) :IN CONSTANTLY) {101106BFAB}>

(qdescribe "QsciScintilla") error caused by QAbstractScrollArea

On Linux x64, both in SBCL and ECL. Output from SBCL-1.3.0 with qt-libs loaded by quicklisp:

* (qt:qdescribe "QsciScintilla")
5504 <86,0,0> is a smoke class

    name: QsciScintilla
    flags: #x5 (VIRTUAL, CONSTRUCTOR)

Superclasses:
    QsciScintillaBase

debugger invoked on a TYPE-ERROR in thread
#<THREAD "main thread" RUNNING {1002ADC5A3}>:
  The value NIL is not of type (UNSIGNED-BYTE 4).
0] backtrace

Backtrace for: #<SB-THREAD:THREAD "main thread" RUNNING {1002ADC5A3}>
0: (QT:FIND-QCLASS "QAbstractScrollArea" T)
1: (QT:LIST-QCLASS-SUPERCLASSES 5568)
2: ((LABELS QT::RECURSE :IN QT::DESCRIBE-QCLASS) 5568 8)
3: ((LABELS QT::RECURSE :IN QT::DESCRIBE-QCLASS) 5504 4)
4: (QT::DESCRIBE-QCLASS 5504 NIL)
5: (QT:QDESCRIBE "QsciScintilla" NIL)
6: (SB-INT:SIMPLE-EVAL-IN-LEXENV (QT:QDESCRIBE "QsciScintilla") #<NULL-LEXENV>)
7: (EVAL (QT:QDESCRIBE "QsciScintilla"))
8: (INTERACTIVE-EVAL (QT:QDESCRIBE "QsciScintilla") :EVAL NIL)
9: (SB-IMPL::REPL-FUN NIL)
10: ((LAMBDA NIL :IN SB-IMPL::TOPLEVEL-REPL))
11: (SB-IMPL::%WITH-REBOUND-IO-SYNTAX #<CLOSURE (LAMBDA NIL :IN SB-IMPL::TOPLEVEL-REPL) {10047B2C7B}>)
12: (SB-IMPL::TOPLEVEL-REPL NIL)
13: (SB-IMPL::TOPLEVEL-INIT)
14: ((FLET #:WITHOUT-INTERRUPTS-BODY-82 :IN SAVE-LISP-AND-DIE))
15: ((LABELS SB-IMPL::RESTART-LISP :IN SAVE-LISP-AND-DIE))

The result of standalone (qt:qdescribe "QAbstractScrollArea") is NIL.

qt-repl - QApplication was not created in the main() thread

Hi,
I've been trying to get qt-repl going so I can modify my application through the repl while it is running. Ideally I'd like to be able to create and open windows, draw graphics etc. on the fly with slime.

Whenever I try (start-gui-thread) I get the following message in my inferior-lisp buffer:

WARNING: QApplication was not created in the main() thread.

Then, whenever I try and create a window in the repl (or by calling a function previously compile/load-ed) it flashes on the screen for a fraction of a second before disappearing with a return value of nil.

I am running sbcl 1.3.4 on Windows 8.1 with Emacs 25.4.1 / slime

Looking at the source code to start-gui-thread (in repl-integration.lisp), I noticed that on osx it searches for the main thread, and then gets it to run the qt setup routine. I tried hacking the code so this is also done on Windows. (I also renamed the search string to "main thread" to match what sbcl (bt:all-threads) prints up on my machine) However, I still get the "not created in the main() thread" warning.

After running my modified (start-gui-thread) I evaluated gui-thread and it said it was "main thread" - So I don't know what is going on :)

QT-REPL> *gui-thread*
#<SB-THREAD:THREAD "main thread" RUNNING {10029DCBC3}>

Am I looking in the wrong place? I am a Lisp beginner, but I wanted to dive in and see if I could find out what was happening.

QWebView and Javascript

I'm having a problem with getting Javascript to load in a QWebView component, which seems to just ignore all Javascript. I'm running commonqt in sbcl 1.3.13 on OS X 10.11.

Cannot subclass QGraphicsItem

Subclassing QGraphicsItem throws the following error in SBCL:

debugger invoked on a TYPE-ERROR in thread
#<THREAD "main thread" RUNNING {1002A9B9F3}>:
  The value NIL is not of type (SIGNED-BYTE 16).

Type HELP for debugger help, or (SB-EXT:EXIT) to exit from SBCL.

restarts (invokable by number or by possibly-abbreviated name):
  0: [RETRY   ] Retry EVAL of current toplevel form.
  1: [CONTINUE] Ignore error and continue loading file "/home/kaixiong/Documents/projects/expt/test-qgraphicsitem.lisp".
  2: [ABORT   ] Abort loading file "/home/kaixiong/Documents/projects/expt/test-qgraphicsitem.lisp".
  3:            Ignore runtime option --load "test-qgraphicsitem.lisp".
  4:            Skip rest of --eval and --load options.
  5:            Skip to toplevel READ/EVAL/PRINT loop.
  6: [EXIT    ] Exit SBCL (calling #'EXIT, killing the process).

(QT::SW_MAKE_DYNAMIC_BINDING #.(SB-SYS:INT-SAP #X00660B30) #.(SB-SYS:INT-SAP #X008AC180) NIL NIL #.(SB-SYS:INT-SAP #X20100FD0) #.(SB-SYS:INT-SAP #X201010D0) #.(SB-SYS:INT-SAP #X20101150))
; file: /home/kaixiong/quicklisp/dists/quicklisp/software/commonqt-20131111-git/ffi.lisp

   source: (DEFCFUN "sw_make_dynamic_binding" :POINTER (SMOKE :POINTER)
            (META-OBJECT :POINTER) (META-OBJECT-INDEX :SHORT)
            (METACALL-INDEX :SHORT) (DELETION-CALLBACK :POINTER)
            (METHOD-CALLBACK :POINTER) (METACALL-CALLBACK :POINTER))

Below is the code that reproduces the error:

(ql:quickload :qt)

(defpackage :test-qgraphicsitem
  (:use :cl :qt))

(in-package :test-qgraphicsitem)

(named-readtables:in-readtable :qt)

(defclass test-item ()
  ()
  (:metaclass qt-class)
  (:qt-superclass "QGraphicsItem"))

(defmethod initialize-instance :after ((this test-item) &key)
  (new this))

(make-qapplication)
(make-instance 'test-item)

I'm using Ubuntu 13.10 x64 and running SBCL 1.1.14, Qt 4.8.4, and the CommonQt package installed with Quicklisp.

Instantiating Objects from Phonon is Broken

Whenever you try to instantiate a phonon object through, for example (optimized-new "Phonon::AudioOoutput") it complains about not finding an applicable method, even though an appropriate constructor clearly exists.

The problem seems to lie in resolve-new:

(qclass-find-applicable-method class
                               (qclass-name class)
                               args
                               fix-types)

The class-name of a phonon class is preceded by Phonon:: whereas the constructor method is not. This could be fixed --albeit not so elegantly-- by changing resolve-new as follows:

(defun resolve-new (instance args &optional fix-types)
  ;; (format *trace-output* "cache miss for #_new ~A~%" instance)
  (let* ((class (qobject-class instance))
         (class-name (qclass-name class))
         (constructor (let ((colonpos (position #\: class-name :from-end T)))
                        (if colonpos
                            (subseq class-name (1+ colonpos))
                            class-name)))
         (method
           (qclass-find-applicable-method class
                                          constructor
                                          args
                                          fix-types)))
    (unless method
      (error "No applicable constructor ~A found for arguments ~S"
             (qclass-name class) args))
    (assert (eql class (qtype-class (qmethod-return-type method))))
    (let ((classfn (qclass-trampoline-fun (qmethod-class method)))
          (method-index (qmethod-classfn-index method))
          (binding (binding-for-ctor method instance))
          (arglist-marshaller
            (arglist-marshaller args (list-qmethod-argument-types method))))
      (named-lambda new-continuation (instance args)
        (%%new instance
               args
               arglist-marshaller
               classfn
               method-index
               binding)))))

I'm not familiar with what smoke offers / what's possible, so a cleaner fix than this primitive solution might be possible (hence why I'm submitting an issue instead of a pull request).

(#_new QFileDialog) segfaults SBCL

(progn (qt:make-qapplication) (qt:optimized-new "QFileDialog"))
CORRUPTION WARNING in SBCL pid 21299(tid 140737009362688):
Received signal 11 in non-lisp thread 140737009362688, resignalling to a lisp thread.
The integrity of this image is possibly compromised.
Continuing with fingers crossed.
zsh: segmentation fault sbcl

While it works fine on CCL (including calling exec on it).

Unmarshalling leaks Qt objects

PR #47 partially plugs the memory leak, for QStrings only. Bumped into issue #43 while trying to test with QLists. PR #45 has some WIP code for plugging the memory leak for QList and QVariant too.

use (:qt-superclass "QGraphicsEllipseItem") error

i have a question abort use QGraphicsEllipseItem, this is my code

(defclass node-connector ()
  ()
  (:metaclass qt-class)
  (:qt-superclass "QGraphicsEllipseItem")
  )

(defmethod initialize-instance :after ((instance node-connector) &key parent)
  (if parent
      (new instance parent)
      (new instance))
  )

when i use (make-instance 'node-connector) it goes wrong aboat this:
``
The value
NIL
is not of type
(SIGNED-BYTE 16)
when binding SB-ALIEN::VALUE
[Condition of type TYPE-ERROR]

Restarts:
0: [RETRY] Retry SLIME REPL evaluation request.
1: [*ABORT] Return to SLIME's top level.
2: [ABORT] abort thread (#<THREAD "repl-thread" RUNNING {25007EE1}>)

Backtrace:
0: (QT::SW_MAKE_DYNAMIC_BINDING #.(SB-SYS:INT-SAP #X00A4E880) #.(SB-SYS:INT-SAP #X05600D00) NIL NIL #.(SB-SYS:INT-SAP #X221106A8) #.(SB-SYS:INT-SAP #X221106F8) #.(SB-SYS:INT-SAP #X22110720))
1: (QT::SET-CLASS-BINDING #<QT:QT-CLASS QT-TEST:NODE-CONNECTOR>)
2: (QT::ENSURE-QT-CLASS-CACHES #<QT:QT-CLASS QT-TEST:NODE-CONNECTOR>)
3: ((:METHOD INITIALIZE-INSTANCE (QT:DYNAMIC-OBJECT)) #<QT-TEST:NODE-CONNECTOR uninitialized>) [fast-method]
4: ((SB-PCL::EMF INITIALIZE-INSTANCE) # # #<QT-TEST:NODE-CONNECTOR uninitialized>)
5: ((:METHOD INITIALIZE-INSTANCE :AROUND (QT:DYNAMIC-OBJECT)) #<QT-TEST:NODE-CONNECTOR uninitialized>) [fast-method]
6: (SB-PCL::FAST-MAKE-INSTANCE # #<unavailable &MORE argument>)
7: ((:METHOD INITIALIZE-INSTANCE :AFTER (QT-TEST:GAME-BOARD)) #<QT-TEST:GAME-BOARD QWidget 0x00B1F160> :PARENT NIL) [fast-method]
8: ((SB-PCL::EMF INITIALIZE-INSTANCE) # # #<QT-TEST:GAME-BOARD QWidget 0x00B1F160>)
9: ((:METHOD INITIALIZE-INSTANCE :AROUND (QT:DYNAMIC-OBJECT)) #<QT-TEST:GAME-BOARD QWidget 0x00B1F160>) [fast-method]
10: (SB-PCL::FAST-MAKE-INSTANCE # #<unavailable &MORE argument>)
11: (QT-TEST:MAIN)
12: (SB-INT:SIMPLE-EVAL-IN-LEXENV (QT-TEST:MAIN) #)
13: (EVAL (QT-TEST:MAIN))
--more--

``

how can i resolve this problem, thank you

Mismatched types in :QT-SUPERCLASS messages

(defclass palette (widget) ()
  (:qt-superclass 'qwidget)
  (:metaclass widget-class))
 
'QWIDGET fell through ETYPECASE expression.
Wanted one of (FIXNUM STRING SYMBOL QOBJECT).
   [Condition of type SB-KERNEL:CASE-FAILURE]
(defclass palette (widget) ()
  (:qt-superclass qwidget)
  (:metaclass widget-class))
 
The value of QT::NAME is QWIDGET, which is not of type STRING.
   [Condition of type SIMPLE-TYPE-ERROR]

The messages The value of QT::NAME is QWIDGET, which is not of type STRING. and Wanted one of (FIXNUM STRING SYMBOL QOBJECT). contradict each other. It's a minor annoyance, but might want to fix it one day.

Segfault when creating QGraphicsScene

Evaluating (#_new QGraphicsScene) results in a segfault on my machine.

*inferior-lisp* says:

CORRUPTION WARNING in SBCL pid 25607(tid 0x7ffff47ef700):
Memory fault at 0x8 (pc=0x7fffe6eaa295, sp=0x7ffff47edaa0)
The integrity of this image is possibly compromised.
Continuing with fingers crossed.

Backtrace from SBCL 1.4.3:

Unhandled memory fault at #x8.
   [Condition of type SB-SYS:MEMORY-FAULT-ERROR]

Restarts:
 0: [RETRY] Retry SLIME REPL evaluation request.
 1: [*ABORT] Return to SLIME's top level.
 2: [ABORT] abort thread (#<THREAD "repl-thread" RUNNING {100526FF93}>)

Backtrace:
  0: (SB-SYS:MEMORY-FAULT-ERROR #<unused argument> #.(SB-SYS:INT-SAP #X00000008))
      Locals:
        SB-KERNEL::ADDRESS-SAP = #.(SB-SYS:INT-SAP #X00000008)
  1: ("foreign function: call_into_lisp")
      [No Locals]
  2: ("foreign function: funcall2")
      [No Locals]
  3: ("foreign function: handle_trap")
      [No Locals]
  4: ("foreign function: #x4195A0")
      [No Locals]
  5: ((LABELS QT::ARGLIST-MARSHALLER :IN QT::ARGLIST-MARSHALLER) NIL #<CLOSURE (LAMBDA (QT::STACK) :IN QT::%%CALL) {1004D588FB}>)
      Locals:
        QT::ARGLIST = NIL
        QT::FINAL-CONT = #<CLOSURE (LAMBDA (QT::STACK) :IN QT::%%CALL) {1004D588FB}>
  6: (QT::%%NEW #<Qt::QGraphicsScene  {1004D58233}> NIL #<CLOSURE (LABELS QT::ARGLIST-MARSHALLER :IN QT::ARGLIST-MARSHALLER) {1004D5886B}> #.(SB-SYS:INT-SAP #X7FFFE2D7BF60) 123 #.(SB-SYS:INT-SAP #X7FFFEC03..
      Locals:
        QT::ARGLIST-MARSHALLER = #<CLOSURE (LABELS QT::ARGLIST-MARSHALLER :IN QT::ARGLIST-MARSHALLER) {1004D5886B}>
        QT::ARGS = NIL
        QT::BINDING = #.(SB-SYS:INT-SAP #X7FFFEC03B600)
        QT::CLASSFN = #.(SB-SYS:INT-SAP #X7FFFE2D7BF60)
        QT::INSTANCE = #<Qt::QGraphicsScene  {1004D58233}>
        QT::METHOD-INDEX = 123
  7: (SB-INT:SIMPLE-EVAL-IN-LEXENV ((LAMBDA NIL (OPTIMIZED-NEW "QGraphicsScene"))) #<NULL-LEXENV>)
  8: (EVAL ((LAMBDA NIL (OPTIMIZED-NEW "QGraphicsScene"))))
 --more--

My OS is Linux localhost 4.13.0-26-generic #29~16.04.2-Ubuntu SMP Tue Jan 9 22:00:44 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

Issue happens both on CommonQt available currently on Quicklisp and on CommonQt cloned from git master.

Issue happens both on SBCL 1.4.2 and 1.4.3.

This issue is weird, because @Shinmera was unable to reproduce it on their machine.

Defining a text() override on QProgressBar crashes SBCL

Via Qtools:

(define-widget busy-progress-bar (qprogressbar) ()) 
(define-override (busy-progress-bar text) () "")
(with-main-window (main-window 'busy-progress-bar))

I get the following crash on SBCL 1.4.2:

*** Error in `/home/emiherd/.roswell/impls/x86-64/linux/sbcl-bin/1.4.2/bin/sbcl': double free or corruption (fasttop): 0x00007fffec25dc30 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x777e5)[0x7ffff735a7e5]
/lib/x86_64-linux-gnu/libc.so.6(+0x8037a)[0x7ffff736337a]
/lib/x86_64-linux-gnu/libc.so.6(cfree+0x4c)[0x7ffff736753c]
/home/emiherd/.roswell/lisp/quicklisp/dists/quicklisp/software/qt-libs-20171130-git/standalone/qtlibs!smokeqtgui.so(_ZNK12__smokeqtgui14x_QProgressBar4textEv+0x5d)[0x7fffe2f59a9d]
/home/emiherd/.roswell/lisp/quicklisp/dists/quicklisp/software/qt-libs-20171130-git/standalone/qtlibs!QtGui.so(_ZNK12QProgressBar15initStyleOptionEP23QStyleOptionProgressBar+0x79)[0x7fffe66ba019]
/home/emiherd/.roswell/lisp/quicklisp/dists/quicklisp/software/qt-libs-20171130-git/standalone/qtlibs!QtGui.so(_ZNK12QProgressBar8sizeHintEv+0x3f)[0x7fffe66ba0ef]
/home/emiherd/.roswell/lisp/quicklisp/dists/quicklisp/software/qt-libs-20171130-git/standalone/qtlibs!smokeqtgui.so(_ZNK12__smokeqtgui14x_QProgressBar8sizeHintEv+0x2d)[0x7fffe2f591ed]
/home/emiherd/.roswell/lisp/quicklisp/dists/quicklisp/software/qt-libs-20171130-git/standalone/qtlibs!QtGui.so(_ZNK14QWidgetPrivate12adjustedSizeEv+0x1d)[0x7fffe62c79dd]
/home/emiherd/.roswell/lisp/quicklisp/dists/quicklisp/software/qt-libs-20171130-git/standalone/qtlibs!QtGui.so(_ZN7QWidget10adjustSizeEv+0x1a)[0x7fffe62d5a3a]
/home/emiherd/.roswell/lisp/quicklisp/dists/quicklisp/software/qt-libs-20171130-git/standalone/qtlibs!QtGui.so(_ZN7QWidget10setVisibleEb+0x3c0)[0x7fffe62d76a0]
/home/emiherd/.roswell/lisp/quicklisp/dists/quicklisp/software/qt-libs-20171130-git/standalone/qtlibs!smokeqtgui.so(_ZN12__smokeqtgui14x_QProgressBar10setVisibleEb+0x44)[0x7fffe2f544c4]
/home/emiherd/.roswell/lisp/quicklisp/dists/quicklisp/software/qt-libs-20171130-git/standalone/qtlibs!smokeqtgui.so(_ZN12__smokeqtgui13xcall_QWidgetEsPvPN5Smoke9StackItemE+0xd05)[0x7fffe2fd70f5]
[0x22a576d0]

Exception when marshaling arglist on Windows 7

SBCL reports an exception when commonqt tries to marshal lisp arguments to Qt.

The exception code corresponds to hexadecimal 0xE06D7363, detailed here: https://support.microsoft.com/en-us/help/185294/prb-exception-code-0xe06d7363-when-calling-win32-seh-apis

Repro steps:

(ql:quickload '("qt-libs" "qt"))
(named-readtables:in-readtable :qt)
(qt:with-main-window (window (#_new QWidget))
  (#_QFileDialog::getOpenFileName window))

Exception:

An exception occurred in context #.(SB-SYS:INT-SAP #X05EF6C70): #.(SB-SYS:INT-SAP #X05EF7E80). (Exception code: 3765269347)
Backtrace:
  0: ("bogus stack frame")
  1: ((LABELS QT::ARGLIST-MARSHALLER :IN QT::ARGLIST-MARSHALLER) (#<QWidget 0x002E3E70>) #<CLOSURE (LAMBDA (QT::STACK) :IN QT::%%CALL) {1003C7811B}>)
      Locals:
        QT::ARGLIST = (#<QWidget 0x002E3E70>)
        QT::FINAL-CONT = #<CLOSURE (LAMBDA (QT::STACK) :IN QT::%%CALL) {1003C7811B}>
  2: ((LAMBDA ()))
  3: (SB-INT:SIMPLE-EVAL-IN-LEXENV (QT:WITH-OBJECTS ((WINDOW #)) ((LAMBDA NIL #)) ((LAMBDA NIL #)) ((LAMBDA NIL #))) #<NULL-LEXENV>)
  4: (SB-INT:SIMPLE-EVAL-IN-LEXENV (QT:WITH-MAIN-WINDOW (WINDOW (#)) ((LAMBDA NIL #))) #<NULL-LEXENV>)
  5: (EVAL (QT:WITH-MAIN-WINDOW (WINDOW (#)) ((LAMBDA NIL #))))

This happens with a fresh install of SBCL 1.4.2 (AMD64) and quicklisp on Windows 7, 64bit.
Running the same on Linux works as expected.

This used to work in Windows 7, but I'm unable to pin point the exact version (shipped in quicklisp) when it stopped working.

Support various Qt modules

Qt has a bunch of useful modules on top of Core and Gui. It would be great if CommonQt could be extended to support them all.

I find myself in particular need of QtDesigner and QtSvg at the moment.

Returning data from table model crashes SBCL

The following implementation of QAbstractItemModel::data() crashes SBCL with the memory corruption error:
*** Error in `sbcl': double free or corruption (fasttop): 0x00000000009c21e0 ***

I'm not sure what I did wrong. Here is the offending code extract:

(defclass test-model ()
  ...
  (:metaclass qt-class)
  (:qt-superclass "QAbstractTableModel")
  (:override
    ("data" test-model-data)
    ...))

(defmethod test-model-data ((this test-model) index role)
  (if (= role (enum-value (#_Qt::DisplayRole)))
      (#_new QVariant :|const QString&| (format nil "(~a,~a)" (1+ (#_row index)) (1+ (#_column index))))
      (#_new QVariant)))

I'm using Ubuntu 13.10 x64 and running SBCL 1.1.14, Qt 4.8.4, and the CommonQt package installed with Quicklisp.

Overrided event methods not called.

I have a class derived from QGraphicsSvgItem which has method overrides for the mouse event handlers mouseMoveEvent and mousePressEvent. Neither of them runs when I click or drag the graphics item.

On the other hand, the overrided methods forpaint and boundingRect are called normally.

The issue does not arise when the class is derived from QGraphicsObject instead. Note that QGraphicsSvgItem is its direct descendant and does not override mouseMoveEvent or mousePressEvent.

Doing the same thing in QtRuby works, so it should be a bug in CommonQt.

Below is my test code.

(require "qt")

(defpackage :test-qgraphicssvgitem
  (:use :cl :qt))

(in-package :test-qgraphicssvgitem)
(named-readtables:in-readtable :qt)

(ensure-smoke 'qtsvg)

(defclass simple-item ()
  ()
  (:metaclass qt-class)
  (:qt-superclass "QGraphicsSvgItem")
  (:override
   ("boundingRect"
    (lambda (this)
      (declare (ignore this))
      (let ((pen-width 1))
        (#_new QRectF
               (- -10 (floor pen-width 2))
               (- -10 (floor pen-width 2))
               (+ 20 pen-width)
               (+ 20 pen-width)))))
   ("paint"
    (lambda (this painter option widget)
      (declare (ignore this))
      (declare (ignore option))
      (declare (ignore widget))
      (#_drawRoundedRect painter -10 -10 20 20 5 5)))
   ("mousePressEvent"
    (lambda (this event)
      (declare (ignore this))
      (format t "Mouse press received~%")
      (#_accept event)))
   ("mouseMoveEvent"
    (lambda (this event)
      (declare (ignore this))
      (let ((mouse-pos (#_pos event)))
        (format t "Mouse move: ~a ~a~%" (#_x mouse-pos) (#_y mouse-pos)))
      (#_accept event)))))

(defmethod initialize-instance :after ((this simple-item) &key parent)
  (if parent
      (new this parent)
      (new this)))

(defclass main-window ()
  (scene scene-view)
  (:metaclass qt-class)
  (:qt-superclass "QMainWindow"))

(defmethod initialize-instance :after ((this main-window) &key parent)
  (if parent
      (new this parent)
      (new this))
  (#_setWindowTitle this "QGraphicsSvgItem test")
  (with-slots (scene scene-view) this
    (setf scene (#_new QGraphicsScene))
    (setf scene-view (#_new QGraphicsView scene))
    (#_setCentralWidget this scene-view)
    (#_addItem scene (make-instance 'simple-item))))

(with-main-window (window (make-instance 'main-window))
  nil)

The equivalent in Ruby:

#!/usr/bin/env ruby

require 'Qt'

class SimpleItem < Qt::GraphicsSvgItem
  def initialize
    super
  end

  def boundingRect
    penWidth = 1
    Qt::RectF.new -10 - penWidth / 2, -10 - penWidth / 2, 20 + penWidth, 20 + penWidth
  end

  def paint(painter, option, widget)
    painter.drawRoundedRect -10, -10, 20, 20, 5, 5
  end

  def mousePressEvent(event)
    puts "Mouse press received!"
    event.accept
  end

  def mouseMoveEvent(event)
    printf "Mouse move: %d %d\n" % [event.pos.x, event.pos.y]
    event.accept
  end
end

class MainWindow < Qt::MainWindow
  def initialize
    super

    setWindowTitle "QGraphicsSvgItem test"

    @scene = Qt::GraphicsScene.new
    @sceneView = Qt::GraphicsView.new @scene
    setCentralWidget @sceneView

    @scene.addItem SimpleItem.new
  end
end

app = Qt::Application.new ARGV
mainWindow = MainWindow.new
mainWindow.show
app.exec

qt-libs + commonqt, libcommonqt.so: No such file or directory

On a freshly installed Common Lisp environment, (ql:quickload :qt-libs) followed by (ql:quickload :commonqt) fails with:

* (ql:quickload :qt-libs)
To load "qt-libs":
  Load 1 ASDF system:
    qt-libs
; Loading "qt-libs"
....
(:QT-LIBS)
* (ql:quickload :commonqt)
To load "commonqt":
  Load 1 ASDF system:
    commonqt
; Loading "commonqt"

debugger invoked on a CFFI:LOAD-FOREIGN-LIBRARY-ERROR in thread
#<THREAD "main thread" RUNNING {1000510083}>:
  Unable to load foreign library (LIBCOMMONQT.SO-511).
  Error opening shared object "libcommonqt.so":
  libcommonqt.so: cannot open shared object file: No such file or directory.

Type HELP for debugger help, or (SB-EXT:EXIT) to exit from SBCL.

restarts (invokable by number or by possibly-abbreviated name):
  0: [RETRY                        ] Try loading the foreign library again.
  1: [USE-VALUE                    ] Use another library instead.
  2: [TRY-RECOMPILING              ] Recompile ffi and try loading it again
  3: [RETRY                        ] Retry
                                     loading FASL for #<CL-SOURCE-FILE "qt+libs" "ffi">.
  4: [ACCEPT                       ] Continue, treating
                                     loading FASL for #<CL-SOURCE-FILE "qt+libs" "ffi">
                                     as having been successful.
  5:                                 Retry ASDF operation.
  6: [CLEAR-CONFIGURATION-AND-RETRY] Retry ASDF operation after resetting the
                                     configuration.
  7:                                 Retry ASDF operation.
  8:                                 Retry ASDF operation after resetting the
                                     configuration.
  9: [ABORT                        ] Give up on "commonqt"
 10:                                 Exit debugger, returning to top level.

(CFFI::FL-ERROR "Unable to load foreign library (~A).~%  ~A" #:LIBCOMMONQT.SO-511 "Error opening shared object \"libcommonqt.so\":
  libcommonqt.so: cannot open shared object file: No such file or directory.")
   source: (ERROR 'LOAD-FOREIGN-LIBRARY-ERROR :FORMAT-CONTROL CONTROL
                  :FORMAT-ARGUMENTS ARGUMENTS)
0] BACKTRACE

Backtrace for: #<SB-THREAD:THREAD "main thread" RUNNING {1000510083}>
0: (CFFI::FL-ERROR "Unable to load foreign library (~A).~%  ~A" #:LIBCOMMONQT.SO-511 "Error opening shared object \"libcommonqt.so\":
  libcommonqt.so: cannot open shared object file: No such file or directory.")
1: (CFFI::REPORT-SIMPLE-ERROR #:LIBCOMMONQT.SO-511 #<SIMPLE-ERROR "Error opening ~:[runtime~;shared object ~:*~S~]:
  ~A." {1004FD5583}>)
2: (CFFI::LOAD-FOREIGN-LIBRARY-PATH #:LIBCOMMONQT.SO-511 "libcommonqt.so" NIL)
3: ((FLET CFFI::%DO-LOAD :IN CFFI::%DO-LOAD-FOREIGN-LIBRARY) #<CFFI:FOREIGN-LIBRARY LIBCOMMONQT.SO-511> #:LIBCOMMONQT.SO-511 "libcommonqt.so")
4: (CFFI::%DO-LOAD-FOREIGN-LIBRARY "libcommonqt.so" NIL)
5: (CFFI:LOAD-FOREIGN-LIBRARY "libcommonqt.so" :SEARCH-PATH NIL)
6: (LOAD-LIBCOMMONQT)
7: (SB-FASL::LOAD-FASL-GROUP #S(SB-FASL::FASL-INPUT :STREAM #<SB-SYS:FD-STREAM for "file /home/emiherd/.cache/common-lisp/sbcl-2.0.1-linux-x64/home/emiherd/.roswell/lisp/quicklisp/dists/quicklisp/software/commonqt-20191227-git/ffi.fasl" {1004ED44C3}> :TABLE #(37 SET *PACKAGE* "QT" #<PACKAGE "SB-IMPL"> SB-IMPL::%DEFVAR #<PACKAGE "QT"> *LOADED* #1="/home/emiherd/.roswell/lisp/quicklisp/dists/quicklisp/software/commonqt-20191227-git/ffi.lisp" #<SB-KERNEL:LAYOUT for SB-C:DEFINITION-SOURCE-LOCATION {50301883}> #S(SB-C:DEFINITION-SOURCE-LOCATION :NAMESTRING #1# :INDICES 65537) *LIBRARY-LOADED-P* ...) :STACK #(0 LOAD-LIBCOMMONQT LOAD-LIBCOMMONQT #<FUNCTION LOAD-LIBCOMMONQT> 13897 LOAD-LIBCOMMONQT NIL NIL ((SB-INT:SFUNCTION NIL BOOLEAN) . #(#(1 2 3 2 1 5 2 6) *LIBRARY-LOADED-P* LOAD-LIBRARY)) *LIBRARY-LOADED-P* "commonqt" #<SB-KERNEL:FDEFN LOAD-LIBRARY> ...) :NAME-BUFFER #("" "STANDARDNARYONQTP*") :DEPRECATED-STUFF NIL :SKIP-UNTIL NIL) NIL)
8: (SB-FASL::LOAD-AS-FASL #<SB-SYS:FD-STREAM for "file /home/emiherd/.cache/common-lisp/sbcl-2.0.1-linux-x64/home/emiherd/.roswell/lisp/quicklisp/dists/quicklisp/software/commonqt-20191227-git/ffi.fasl" {1004ED44C3}> NIL NIL)
9: ((FLET SB-FASL::THUNK :IN LOAD))
10: (SB-FASL::CALL-WITH-LOAD-BINDINGS #<CLOSURE (FLET SB-FASL::THUNK :IN LOAD) {7FC7DA3EE36B}> #<SB-SYS:FD-STREAM for "file /home/emiherd/.cache/common-lisp/sbcl-2.0.1-linux-x64/home/emiherd/.roswell/lisp/quicklisp/dists/quicklisp/software/commonqt-20191227-git/ffi.fasl" {1004ED44C3}>)
11: ((FLET SB-FASL::LOAD-STREAM :IN LOAD) #<SB-SYS:FD-STREAM for "file /home/emiherd/.cache/common-lisp/sbcl-2.0.1-linux-x64/home/emiherd/.roswell/lisp/quicklisp/dists/quicklisp/software/commonqt-20191227-git/ffi.fasl" {1004ED44C3}> T)
12: (LOAD #P"/home/emiherd/.cache/common-lisp/sbcl-2.0.1-linux-x64/home/emiherd/.roswell/lisp/quicklisp/dists/quicklisp/software/commonqt-20191227-git/ffi.fasl" :VERBOSE NIL :PRINT NIL :IF-DOES-NOT-EXIST T :EXTERNAL-FORMAT :DEFAULT)
13: (UIOP/UTILITY:CALL-WITH-MUFFLED-CONDITIONS #<CLOSURE (LAMBDA NIL :IN UIOP/LISP-BUILD:LOAD*) {1004ED2C2B}> ("Overwriting already existing readtable ~S." #(#:FINALIZERS-OFF-WARNING :ASDF-FINALIZERS)))
14: ((SB-PCL::EMF ASDF/ACTION:PERFORM) #<unused argument> #<unused argument> #<ASDF/LISP-ACTION:LOAD-OP > #<ASDF/LISP-ACTION:CL-SOURCE-FILE "qt+libs" "ffi">)
15: ((LAMBDA NIL :IN ASDF/ACTION:CALL-WHILE-VISITING-ACTION))
16: ((:METHOD ASDF/ACTION:PERFORM-WITH-RESTARTS (ASDF/LISP-ACTION:LOAD-OP ASDF/LISP-ACTION:CL-SOURCE-FILE)) #<ASDF/LISP-ACTION:LOAD-OP > #<ASDF/LISP-ACTION:CL-SOURCE-FILE "qt+libs" "ffi">) [fast-method]
17: ((:METHOD ASDF/ACTION:PERFORM-WITH-RESTARTS :AROUND (T T)) #<ASDF/LISP-ACTION:LOAD-OP > #<ASDF/LISP-ACTION:CL-SOURCE-FILE "qt+libs" "ffi">) [fast-method]
18: ((:METHOD ASDF/PLAN:PERFORM-PLAN (T)) #<ASDF/PLAN:SEQUENTIAL-PLAN {10041C9823}>) [fast-method]
19: ((FLET SB-C::WITH-IT :IN SB-C::%WITH-COMPILATION-UNIT))
20: ((:METHOD ASDF/PLAN:PERFORM-PLAN :AROUND (T)) #<ASDF/PLAN:SEQUENTIAL-PLAN {10041C9823}>) [fast-method]
21: ((:METHOD ASDF/OPERATE:OPERATE (ASDF/OPERATION:OPERATION ASDF/COMPONENT:COMPONENT)) #<ASDF/LISP-ACTION:LOAD-OP > #<QT-LIBS:FOREIGN-LIBRARY-SYSTEM "commonqt"> :PLAN-CLASS NIL :PLAN-OPTIONS NIL) [fast-method]
22: ((SB-PCL::EMF ASDF/OPERATE:OPERATE) #<unused argument> #<unused argument> #<ASDF/LISP-ACTION:LOAD-OP > #<QT-LIBS:FOREIGN-LIBRARY-SYSTEM "commonqt"> :VERBOSE NIL)
23: ((LAMBDA NIL :IN ASDF/OPERATE:OPERATE))
24: ((:METHOD ASDF/OPERATE:OPERATE :AROUND (T T)) #<ASDF/LISP-ACTION:LOAD-OP > #<QT-LIBS:FOREIGN-LIBRARY-SYSTEM "commonqt"> :VERBOSE NIL) [fast-method]
25: ((SB-PCL::EMF ASDF/OPERATE:OPERATE) #<unused argument> #<unused argument> ASDF/LISP-ACTION:LOAD-OP "commonqt" :VERBOSE NIL)
26: ((LAMBDA NIL :IN ASDF/OPERATE:OPERATE))
27: ((:METHOD ASDF/OPERATE:OPERATE :AROUND (T T)) ASDF/LISP-ACTION:LOAD-OP "commonqt" :VERBOSE NIL) [fast-method]
28: (ASDF/SESSION:CALL-WITH-ASDF-SESSION #<CLOSURE (LAMBDA NIL :IN ASDF/OPERATE:OPERATE) {1003EDDF3B}> :OVERRIDE T :KEY NIL :OVERRIDE-CACHE T :OVERRIDE-FORCING NIL)
29: ((LAMBDA NIL :IN ASDF/OPERATE:OPERATE))
30: (ASDF/SESSION:CALL-WITH-ASDF-SESSION #<CLOSURE (LAMBDA NIL :IN ASDF/OPERATE:OPERATE) {1003ED524B}> :OVERRIDE NIL :KEY NIL :OVERRIDE-CACHE NIL :OVERRIDE-FORCING NIL)
31: ((:METHOD ASDF/OPERATE:OPERATE :AROUND (T T)) ASDF/LISP-ACTION:LOAD-OP "commonqt" :VERBOSE NIL) [fast-method]
32: (ASDF/OPERATE:LOAD-SYSTEM "commonqt" :VERBOSE NIL)
33: (QUICKLISP-CLIENT::CALL-WITH-MACROEXPAND-PROGRESS #<CLOSURE (LAMBDA NIL :IN QUICKLISP-CLIENT::APPLY-LOAD-STRATEGY) {1003ED519B}>)
34: (QUICKLISP-CLIENT::AUTOLOAD-SYSTEM-AND-DEPENDENCIES "commonqt" :PROMPT NIL)
35: ((:METHOD QL-IMPL-UTIL::%CALL-WITH-QUIET-COMPILATION (T T)) #<unused argument> #<CLOSURE (FLET QUICKLISP-CLIENT::QL :IN QUICKLISP-CLIENT:QUICKLOAD) {10039DB34B}>) [fast-method]
36: ((:METHOD QL-IMPL-UTIL::%CALL-WITH-QUIET-COMPILATION :AROUND (QL-IMPL:SBCL T)) #<QL-IMPL:SBCL {1004F8D683}> #<CLOSURE (FLET QUICKLISP-CLIENT::QL :IN QUICKLISP-CLIENT:QUICKLOAD) {10039DB34B}>) [fast-method]
37: ((:METHOD QUICKLISP-CLIENT:QUICKLOAD (T)) :COMMONQT :PROMPT NIL :SILENT NIL :VERBOSE NIL) [fast-method]
38: (QL-DIST::CALL-WITH-CONSISTENT-DISTS #<CLOSURE (LAMBDA NIL :IN QUICKLISP-CLIENT:QUICKLOAD) {10039D313B}>)
39: (SB-INT:SIMPLE-EVAL-IN-LEXENV (QUICKLISP-CLIENT:QUICKLOAD :COMMONQT) #<NULL-LEXENV>)
40: (EVAL (QUICKLISP-CLIENT:QUICKLOAD :COMMONQT))
41: (SB-EXT:INTERACTIVE-EVAL (QUICKLISP-CLIENT:QUICKLOAD :COMMONQT) :EVAL NIL)
42: (SB-IMPL::REPL-FUN NIL)
43: ((FLET "LAMBDA0" :IN "SYS:SRC;CODE;TOPLEVEL.LISP"))
44: (SB-IMPL::%WITH-REBOUND-IO-SYNTAX #<CLOSURE (FLET "LAMBDA0" :IN "SYS:SRC;CODE;TOPLEVEL.LISP") {7FC7DA3EFB7B}>)
45: (SB-IMPL::TOPLEVEL-REPL NIL)
46: (SB-IMPL::TOPLEVEL-INIT)
47: ((FLET SB-UNIX::BODY :IN SB-EXT:SAVE-LISP-AND-DIE))
48: ((FLET "WITHOUT-INTERRUPTS-BODY-14" :IN SB-EXT:SAVE-LISP-AND-DIE))
49: ((LABELS SB-IMPL::RESTART-LISP :IN SB-EXT:SAVE-LISP-AND-DIE))

It seems that commonqt wants to load libcommonqt.so instead of qtlibs!commonqt.so available in qt-libs.

commonqt.so fails to compile.

when running make, I get the following errors. I suspect it is because I have qt5 installed.

g++ -c -pipe -g -D_REENTRANT -Wall -W -fPIC -DQT_GUI_LIB -DQT_CORE_LIB -I/usr/lib/qt/mkspecs/linux-g++ -I. -isystem /usr/include/qt -isystem /usr/include/qt/QtGui -isystem /usr/include/qt/QtCore -I. -o commonqt.o commonqt.cpp
commonqt.cpp: In function ‘void* sw_make_metaobject(void*, char*, int*)’:
commonqt.cpp:263:58: error: cannot convert ‘char*’ to ‘const QByteArrayData* {aka const QArrayData*}’ in initialization
         QMetaObject tmp = { { parent, strings, data, 0 } };
                                                          ^
commonqt.cpp:263:58: warning: missing initializer for member ‘QMetaObject::<anonymous struct>::relatedMetaObjects’ [-Wmissing-field-initializers]
commonqt.cpp:263:58: warning: missing initializer for member ‘QMetaObject::<anonymous struct>::extradata’ [-Wmissing-field-initializers]
commonqt.cpp: In function ‘void* sw_qlist_papersize_new()’:
commonqt.cpp:422:51: error: ‘QPrinter’ was not declared in this scope
 DEFINE_QLIST_SCALAR_MARSHALLER(QPrinter::PageSize,papersize)
                                                   ^
commonqt.cpp:422:69: error: template argument 1 is invalid
 DEFINE_QLIST_SCALAR_MARSHALLER(QPrinter::PageSize,papersize)
                                                                     ^
commonqt.cpp: In function ‘int sw_qlist_papersize_size(void*)’:
commonqt.cpp:422:121: error: ‘QPrinter’ was not declared in this scope
 DEFINE_QLIST_SCALAR_MARSHALLER(QPrinter::PageSize,papersize)
                                                                                                                         ^
commonqt.cpp:422:139: error: template argument 1 is invalid
 DEFINE_QLIST_SCALAR_MARSHALLER(QPrinter::PageSize,papersize)
                                                                                                                                           ^
commonqt.cpp:422:148: error: invalid type in declaration before ‘=’ token
 DEFINE_QLIST_SCALAR_MARSHALLER(QPrinter::PageSize,papersize)
                                                                                                                                                    ^
commonqt.cpp:422:186: error: type/value mismatch at argument 1 in template parameter list for ‘template<class T> class QList’
 DEFINE_QLIST_SCALAR_MARSHALLER(QPrinter::PageSize,papersize)
                                                                                                                                                                                          ^
commonqt.cpp:422:186: error:   expected a type, got ‘QPrinter’
commonqt.cpp:422:187: error: expected ‘>’ before ‘*’ token
 DEFINE_QLIST_SCALAR_MARSHALLER(QPrinter::PageSize,papersize)
                                                                                                                                                                                           ^
commonqt.cpp:422:187: error: expected ‘(’ before ‘*’ token
commonqt.cpp:422:188: error: expected primary-expression before ‘>’ token
 DEFINE_QLIST_SCALAR_MARSHALLER(QPrinter::PageSize,papersize)
                                                                                                                                                                                            ^
commonqt.cpp:422:194: error: expected ‘)’ before ‘;’ token
 DEFINE_QLIST_SCALAR_MARSHALLER(QPrinter::PageSize,papersize)
                                                                                                                                                                                                  ^
commonqt.cpp:422:210: error: request for member ‘size’ in ‘* qlist’, which is of non-class type ‘int’
 DEFINE_QLIST_SCALAR_MARSHALLER(QPrinter::PageSize,papersize)
                                                                                                                                                                                                                  ^
commonqt.cpp: In function ‘void sw_qlist_papersize_delete(void*)’:
commonqt.cpp:422:270: error: ‘QPrinter’ was not declared in this scope
 DEFINE_QLIST_SCALAR_MARSHALLER(QPrinter::PageSize,papersize)
                                                                                                                                                                                                                                                                              ^
commonqt.cpp:422:288: error: template argument 1 is invalid
 DEFINE_QLIST_SCALAR_MARSHALLER(QPrinter::PageSize,papersize)
                                                                                                                                                                                                                                                                                                ^
commonqt.cpp:422:297: error: invalid type in declaration before ‘=’ token
 DEFINE_QLIST_SCALAR_MARSHALLER(QPrinter::PageSize,papersize)
                                                                                                                                                                                                                                                                                                         ^
commonqt.cpp:422:335: error: type/value mismatch at argument 1 in template parameter list for ‘template<class T> class QList’
 DEFINE_QLIST_SCALAR_MARSHALLER(QPrinter::PageSize,papersize)
                                                                                                                                                                                                                                                                                                                                               ^
commonqt.cpp:422:335: error:   expected a type, got ‘QPrinter’
commonqt.cpp:422:336: error: expected ‘>’ before ‘*’ token
 DEFINE_QLIST_SCALAR_MARSHALLER(QPrinter::PageSize,papersize)
                                                                                                                                                                                                                                                                                                                                                ^
commonqt.cpp:422:336: error: expected ‘(’ before ‘*’ token
commonqt.cpp:422:337: error: expected primary-expression before ‘>’ token
 DEFINE_QLIST_SCALAR_MARSHALLER(QPrinter::PageSize,papersize)
                                                                                                                                                                                                                                                                                                                                                 ^
commonqt.cpp:422:343: error: expected ‘)’ before ‘;’ token
 DEFINE_QLIST_SCALAR_MARSHALLER(QPrinter::PageSize,papersize)
                                                                                                                                                                                                                                                                                                                                                       ^
commonqt.cpp: In function ‘const void* sw_qlist_papersize_at(void*, int)’:
commonqt.cpp:422:425: error: ‘QPrinter’ was not declared in this scope
 DEFINE_QLIST_SCALAR_MARSHALLER(QPrinter::PageSize,papersize)
                                                                                                                                                                                                                                                                                                                                                                                                                                         ^
commonqt.cpp:422:443: error: template argument 1 is invalid
 DEFINE_QLIST_SCALAR_MARSHALLER(QPrinter::PageSize,papersize)
                                                                                                                                                                                                                                                                                                                                                                                                                                                           ^
commonqt.cpp:422:452: error: invalid type in declaration before ‘=’ token
 DEFINE_QLIST_SCALAR_MARSHALLER(QPrinter::PageSize,papersize)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                    ^
commonqt.cpp:422:490: error: type/value mismatch at argument 1 in template parameter list for ‘template<class T> class QList’
 DEFINE_QLIST_SCALAR_MARSHALLER(QPrinter::PageSize,papersize)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ^
commonqt.cpp:422:490: error:   expected a type, got ‘QPrinter’
commonqt.cpp:422:491: error: expected ‘>’ before ‘*’ token
 DEFINE_QLIST_SCALAR_MARSHALLER(QPrinter::PageSize,papersize)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           ^
commonqt.cpp:422:491: error: expected ‘(’ before ‘*’ token
commonqt.cpp:422:492: error: expected primary-expression before ‘>’ token
 DEFINE_QLIST_SCALAR_MARSHALLER(QPrinter::PageSize,papersize)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            ^
commonqt.cpp:422:498: error: expected ‘)’ before ‘;’ token
 DEFINE_QLIST_SCALAR_MARSHALLER(QPrinter::PageSize,papersize)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  ^
commonqt.cpp:422:515: error: request for member ‘at’ in ‘* qlist’, which is of non-class type ‘int’
 DEFINE_QLIST_SCALAR_MARSHALLER(QPrinter::PageSize,papersize)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   ^
commonqt.cpp: In function ‘void sw_qlist_papersize_append(void*, void*)’:
commonqt.cpp:422:593: error: ‘QPrinter’ was not declared in this scope
 DEFINE_QLIST_SCALAR_MARSHALLER(QPrinter::PageSize,papersize)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 ^
commonqt.cpp:422:611: error: template argument 1 is invalid
 DEFINE_QLIST_SCALAR_MARSHALLER(QPrinter::PageSize,papersize)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   ^
commonqt.cpp:422:620: error: invalid type in declaration before ‘=’ token
 DEFINE_QLIST_SCALAR_MARSHALLER(QPrinter::PageSize,papersize)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            ^
commonqt.cpp:422:658: error: type/value mismatch at argument 1 in template parameter list for ‘template<class T> class QList’
 DEFINE_QLIST_SCALAR_MARSHALLER(QPrinter::PageSize,papersize)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  ^
commonqt.cpp:422:658: error:   expected a type, got ‘QPrinter’
commonqt.cpp:422:659: error: expected ‘>’ before ‘*’ token
 DEFINE_QLIST_SCALAR_MARSHALLER(QPrinter::PageSize,papersize)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   ^
commonqt.cpp:422:659: error: expected ‘(’ before ‘*’ token
commonqt.cpp:422:660: error: expected primary-expression before ‘>’ token
 DEFINE_QLIST_SCALAR_MARSHALLER(QPrinter::PageSize,papersize)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    ^
commonqt.cpp:422:666: error: expected ‘)’ before ‘;’ token
 DEFINE_QLIST_SCALAR_MARSHALLER(QPrinter::PageSize,papersize)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ^
commonqt.cpp:422:675: error: request for member ‘append’ in ‘* qlist’, which is of non-class type ‘int’
 DEFINE_QLIST_SCALAR_MARSHALLER(QPrinter::PageSize,papersize)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   ^
commonqt.cpp:422:695: error: ‘QPrinter’ does not name a type
 DEFINE_QLIST_SCALAR_MARSHALLER(QPrinter::PageSize,papersize)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       ^
commonqt.cpp:422:703: error: expected ‘>’ before ‘::’ token
 DEFINE_QLIST_SCALAR_MARSHALLER(QPrinter::PageSize,papersize)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               ^
commonqt.cpp:422:703: error: expected ‘(’ before ‘::’ token
commonqt.cpp:422:703: error: ‘::PageSize’ has not been declared
commonqt.cpp:422:714: error: expected primary-expression before ‘>’ token
 DEFINE_QLIST_SCALAR_MARSHALLER(QPrinter::PageSize,papersize)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ^
commonqt.cpp: In function ‘void* sw_qlist_papersize_new()’:
commonqt.cpp:422:72: warning: control reaches end of non-void function [-Wreturn-type]
 DEFINE_QLIST_SCALAR_MARSHALLER(QPrinter::PageSize,papersize)
                                                                        ^
commonqt.cpp: In function ‘int sw_qlist_papersize_size(void*)’:
commonqt.cpp:422:218: warning: control reaches end of non-void function [-Wreturn-type]
 DEFINE_QLIST_SCALAR_MARSHALLER(QPrinter::PageSize,papersize)
                                                                                                                                                                                                                          ^
commonqt.cpp: In function ‘const void* sw_qlist_papersize_at(void*, int)’:
commonqt.cpp:422:526: warning: control reaches end of non-void function [-Wreturn-type]
 DEFINE_QLIST_SCALAR_MARSHALLER(QPrinter::PageSize,papersize)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              ^
Makefile:651: recipe for target 'commonqt.o' failed
make: *** [commonqt.o] Error 1

fatal error: 'smoke.h' file not found

I have installed the qt4-mac port from macports on macOS 10.10.5 and after making sure that qmake is found (ln -s /opt/local/libexec/qt4/bin/qmake /opt/local/bin/qmake) I installed qt-libs without any problem.

(ql:quickload :qt-libs)
(qt-libs:ensure-standalone-libs :method :install-sources :force T)

But If I now do (ql:quickload :qt) I get

OPERATION-ERROR while invoking #<COMPILE-OP > on
#<CPP->SO "qt" "so" "commonqt">
   [Condition of type ASDF/BACKWARD-INTERFACE:OPERATION-ERROR]

as mentioned in the documentation. After running qmake in the corresponding directory

$ qmake
Project MESSAGE: qtAddLibrary: found framework QtGui in directory /opt/local/libexec/qt4/Library/Frameworks
Project MESSAGE: qtAddLibrary: found framework QtCore in directory /opt/local/libexec/qt4/Library/Frameworks

make fails with the following error:

$ make
/usr/bin/clang++ -c -pipe -g -arch x86_64 -Xarch_x86_64 -mmacosx-version-min=10.10 -Wall -W -fPIC -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/opt/local/libexec/qt4/share/mkspecs/macx-g++ -I. -I. -I/opt/local/libexec/qt4/Library/Frameworks/QtCore.framework/Versions/4/Headers -I/opt/local/libexec/qt4/Library/Frameworks/QtGui.framework/Versions/4/Headers -I/opt/local/libexec/qt4/Library/Frameworks/QtGui.framework/Versions/4/Headers -I/opt/local/libexec/qt4/Library/Frameworks/QtCore.framework/Versions/4/Headers -I/opt/local/libexec/qt4/include -F/opt/local/libexec/qt4/Library/Frameworks -F/opt/local/libexec/qt4/lib -o commonqt.o commonqt.cpp
commonqt.cpp:5:10: fatal error: 'smoke.h' file not found
#include <smoke.h>
         ^
1 error generated.
make: *** [commonqt.o] Error 1

As far as I understand qt-libs should make sure that smoke is found. How can I make sure that the right path for the libraries is known?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.