modular smoke & cleanup.
Annotate for file src/ui.lisp
2009-04-14 tobias 1 ;;; Copyright 2009 Tobias Rautenkranz
14:29:22 ' 2 ;;; License: X11 license
' 3
2009-04-05 tobias 4 (in-package :qt.examples)
15:36:46 ' 5
' 6 (defun load-ui-file ()
' 7 "Load a Qt Designer .ui file"
2009-07-01 tobias 8 (qt:with-app ()
11:01:24 ' 9 (let ((loader (make-instance 'qt:ui-loader))
' 10 (file (make-instance 'qt:file))
' 11 (widget))
' 12 (setf (cxx:file-name file)
' 13 (namestring
' 14 (qt:search-file "widget.ui"
2010-01-10 tobias 15 *source-path*
2009-12-13 tobias 16 *default-pathname-defaults*)))
2009-07-01 tobias 17 (assert (cxx:exists file) (file)
11:01:24 ' 18 "File ~A does not exists" (cxx:file-name file))
' 19 (unless (cxx:open file qt:iodevice.+read-only+)
' 20 (error "open failed"))
' 21 (setf widget (cxx:load loader file))
' 22 (when (cffi:null-pointer-p (smoke:pointer widget))
' 23 (error "load failed"))
' 24 (cxx:close file)
' 25 (cxx:show widget)
' 26 (qt:exec))))