repos
/
qt.examples
/ annotate_shade
summary
|
shortlog
|
log
|
tree
|
commit
|
commitdiff
|
headdiff
|
annotate
|
headblob
|
headfilediff
|
filehistory
normal
|
plain
|
shade
|
zebra
Lisp image loading
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
2009-06-21 tobias
9
(let ((loader (make-instance 'qt.uitools:ui-loader))
2009-07-01 tobias
10
(file (make-instance 'qt:file))
11:01:24 '
11
(widget))
'
12
(setf (cxx:file-name file)
2009-05-14 tobias
13
(namestring
12:27:03 '
14
(qt:search-file "widget.ui"
'
15
*default-pathname-defaults*
'
16
(directory-namestring
'
17
(mb.sysdef:input-file
'
18
(mb.sysdef:find-component :qt.examples "src" "ui"))))))
2009-07-01 tobias
19
(assert (cxx:exists file) (file)
11:01:24 '
20
"File ~A does not exists" (cxx:file-name file))
'
21
(unless (cxx:open file qt:iodevice.+read-only+)
'
22
(error "open failed"))
'
23
(setf widget (cxx:load loader file))
'
24
(when (cffi:null-pointer-p (smoke:pointer widget))
'
25
(error "load failed"))
'
26
(cxx:close file)
'
27
(cxx:show widget)
'
28
(qt:exec))))