Hello,
I ran into some trouble trying to instantiate a QWebView in a little test app. I'm using Qt 4.7 and SBCL on a Debian testing (wheezy) system. Here is the distilled code that produces the error:
(in-package :qt-user) (qt:enable-syntax) (ensure-smoke :qtwebkit) (setf qt-user:*application* (qt:make-qapplication "-display" ":0")) (defvar *window* (#_new QWidget)) (defvar *webview* (#_new QWebView *window*))
The error:
The value NIL is not of type (UNSIGNED-BYTE 22). [Condition of type TYPE-ERROR]
And the backtrace:
0: (QT::UNBASH NIL)[:EXTERNAL] 1: (QT::PERFORM-CAST #<QWebView 0x0066B920> #.(SB-SYS:INT-SAP #X7FFFEFF3C260) 5568 NIL) 2: ((LAMBDA (QT::SUPER)) 15432) 3: ((LABELS QT::RECURSE) 15432) 4: ((LABELS QT::RECURSE) 28936) 5: ((LABELS QT::RECURSE) 5568) 6: (QT::MAP-CPL #<CLOSURE (LAMBDA #) {1003187359}> 5568)[:EXTERNAL] 7: (QT::CACHE! #<QWebView 0x0066B920>) 8: (SB-INT:SIMPLE-EVAL-IN-LEXENV (QT-INTERNAL::|QWebView50| *WINDOW*) #<NULL-LEXENV>) 9: (EVAL (QT-INTERNAL::|QWebView50| *WINDOW*))
Here is what I have learned by debugging and experimenting.
The NIL value spoken of comes from FIND-QCLASS-IN-MODULE, which is called by RESOLVE-CAST, which is called by PERFORM-CAST. That value then gets passed to UNBASH, where it results in an error. I don't fully understand the purpose of CACHE! or MAP-CPL, but it looks like MAP-CPL is traversing up the chain of superclasses for QWebView, casting the original object to each base class, and then..? The casts are successful until it gets to the superclass called QPaintDevice (indicated by 15432 in backtrace, frames 3 & 2). In other words, this returns the problematic NIL as its second return value:
(qt::resolve-cast (qt::find-qclass "QWebView") (qt::find-qclass "QPaintDevice")) =>
#.(SB-SYS:INT-SAP #X7FFFEFF3C260) NIL
The 28936 in the backtrace (frame 4) is the class QWidget, and for sake of experiment, I tried it, and that cast works:
(qt::resolve-cast (qt::find-qclass "QWebView") (qt::find-qclass "QWidget")) =>
#.(SB-SYS:INT-SAP #X7FFFEFF3C260) 5696
So why does casting from QWebView to QPaintDevice fail?
That is about as far as I have been able to go in narrowing down this issue. Hopefully this is helpful to somebody on this mailing list who understands this better than I do. Let me know if I can be of further assistance in debugging & whatnot.
Thank you!
"John J. Foerch" jjfoerch@earthlink.net writes:
Hello,
I ran into some trouble trying to instantiate a QWebView in a little test app. I'm using Qt 4.7 and SBCL on a Debian testing (wheezy) system. Here is the distilled code that produces the error:
(in-package :qt-user) (qt:enable-syntax) (ensure-smoke :qtwebkit) (setf qt-user:*application* (qt:make-qapplication "-display" ":0")) (defvar *window* (#_new QWidget)) (defvar *webview* (#_new QWebView *window*))
The error:
The value NIL is not of type (UNSIGNED-BYTE 22). [Condition of type TYPE-ERROR]
Try commonqt from this branch: http://gitorious.org/commonqt/commonqt/commits/qwebview-fix
On Tue, Sep 27, 2011 at 01:38:13PM +0400, Stas Boukarev wrote:
"John J. Foerch" jjfoerch@earthlink.net writes:
Hello,
I ran into some trouble trying to instantiate a QWebView in a little test app. I'm using Qt 4.7 and SBCL on a Debian testing (wheezy) system. Here is the distilled code that produces the error:
(in-package :qt-user) (qt:enable-syntax) (ensure-smoke :qtwebkit) (setf qt-user:*application* (qt:make-qapplication "-display" ":0")) (defvar *window* (#_new QWidget)) (defvar *webview* (#_new QWebView *window*))
The error:
The value NIL is not of type (UNSIGNED-BYTE 22). [Condition of type TYPE-ERROR]
Try commonqt from this branch: http://gitorious.org/commonqt/commonqt/commits/qwebview-fix
Hi Stas,
The qwebview-fix branch works perfectly. Thank you! Are there other issues with this branch that prevent it from being merged into master?
Another question.. in the README of your cl-qt-web-browser, it says that the version of commonqt on your github is required. Is this still true, and if so, are there plans to merge whatever fixes this branch has?
Thank you,
"John J. Foerch" jjfoerch@earthlink.net writes:
On Tue, Sep 27, 2011 at 01:38:13PM +0400, Stas Boukarev wrote:
"John J. Foerch" jjfoerch@earthlink.net writes:
Hello,
I ran into some trouble trying to instantiate a QWebView in a little test app. I'm using Qt 4.7 and SBCL on a Debian testing (wheezy) system. Here is the distilled code that produces the error:
(in-package :qt-user) (qt:enable-syntax) (ensure-smoke :qtwebkit) (setf qt-user:*application* (qt:make-qapplication "-display" ":0")) (defvar *window* (#_new QWidget)) (defvar *webview* (#_new QWebView *window*))
The error:
The value NIL is not of type (UNSIGNED-BYTE 22). [Condition of type TYPE-ERROR]
Try commonqt from this branch: http://gitorious.org/commonqt/commonqt/commits/qwebview-fix
Hi Stas,
The qwebview-fix branch works perfectly. Thank you! Are there other issues with this branch that prevent it from being merged into master?
I don't remember why David didn't commit it into the master, but I hope he does remember.
Another question.. in the README of your cl-qt-web-browser, it says that the version of commonqt on your github is required. Is this still true, and if so, are there plans to merge whatever fixes this branch has?
That branch is basically some of my changes plus the qwebview-fix, I think only qwebview-fix is really required for webkit.
On Tue, Sep 27, 2011 at 09:25:59PM +0400, Stas Boukarev wrote:
"John J. Foerch" jjfoerch@earthlink.net writes:
On Tue, Sep 27, 2011 at 01:38:13PM +0400, Stas Boukarev wrote:
"John J. Foerch" jjfoerch@earthlink.net writes:
Hello,
I ran into some trouble trying to instantiate a QWebView in a little test app. I'm using Qt 4.7 and SBCL on a Debian testing (wheezy) system. Here is the distilled code that produces the error:
(in-package :qt-user) (qt:enable-syntax) (ensure-smoke :qtwebkit) (setf qt-user:*application* (qt:make-qapplication "-display" ":0")) (defvar *window* (#_new QWidget)) (defvar *webview* (#_new QWebView *window*))
The error:
The value NIL is not of type (UNSIGNED-BYTE 22). [Condition of type TYPE-ERROR]
Try commonqt from this branch: http://gitorious.org/commonqt/commonqt/commits/qwebview-fix
Hi Stas,
The qwebview-fix branch works perfectly. Thank you! Are there other issues with this branch that prevent it from being merged into master?
I don't remember why David didn't commit it into the master, but I hope he does remember.
Another question.. in the README of your cl-qt-web-browser, it says that the version of commonqt on your github is required. Is this still true, and if so, are there plans to merge whatever fixes this branch has?
That branch is basically some of my changes plus the qwebview-fix, I think only qwebview-fix is really required for webkit.
Okay, thank you.
commonqt-devel@common-lisp.net