Use new qt:with-app.
src/ui.lisp
Wed Jul 1 13:01:24 CEST 2009 Tobias Rautenkranz <tobias@rautenkranz.ch>
* Use new qt:with-app.
--- old-qt.examples/src/ui.lisp 2014-10-01 18:09:22.000000000 +0200
+++ new-qt.examples/src/ui.lisp 2014-10-01 18:09:22.000000000 +0200
@@ -5,24 +5,24 @@
(defun load-ui-file ()
"Load a Qt Designer .ui file"
- (qt:with-app
- (let ((loader (make-instance 'qt:ui-loader))
- (file (make-instance 'qt:file))
- (widget))
- (setf (cxx:file-name file)
- (namestring
- (qt:search-file "widget.ui"
- *default-pathname-defaults*
- #+mudballs (directory-namestring
- (mb.sysdef:input-file
- (mb.sysdef:find-component :qt.examples "src" "ui"))))))
- (assert (cxx:exists file) (file)
- "File ~A does not exists" (cxx:file-name file))
- (unless (cxx:open file qt:iodevice.+read-only+)
- (error "open failed"))
- (setf widget (cxx:load loader file))
- (when (cffi:null-pointer-p (smoke:pointer widget))
- (error "load failed"))
- (cxx:close file)
- (cxx:show widget)
- (qt:exec))))
+ (qt:with-app ()
+ (let ((loader (make-instance 'qt:ui-loader))
+ (file (make-instance 'qt:file))
+ (widget))
+ (setf (cxx:file-name file)
+ (namestring
+ (qt:search-file "widget.ui"
+ *default-pathname-defaults*
+ #+mudballs (directory-namestring
+ (mb.sysdef:input-file
+ (mb.sysdef:find-component :qt.examples "src" "ui"))))))
+ (assert (cxx:exists file) (file)
+ "File ~A does not exists" (cxx:file-name file))
+ (unless (cxx:open file qt:iodevice.+read-only+)
+ (error "open failed"))
+ (setf widget (cxx:load loader file))
+ (when (cffi:null-pointer-p (smoke:pointer widget))
+ (error "load failed"))
+ (cxx:close file)
+ (cxx:show widget)
+ (qt:exec))))