Split up in qt.gui & cleanup name prefix.
examples/hello-world.lisp
Sun Jan 10 09:52:49 CET 2010 Tobias Rautenkranz <tobias@rautenkranz.ch>
* Split up in qt.gui & cleanup name prefix.
--- old-qt.gui/examples/hello-world.lisp 2014-10-30 07:41:31.000000000 +0100
+++ new-qt.gui/examples/hello-world.lisp 1970-01-01 01:00:00.000000000 +0100
@@ -1,63 +0,0 @@
-(in-package :qt-examples)
-(declaim (optimize (debug 3)))
-
-(defun hello-world ()
- "Hello world"
- (qt:with-app
- (let ((widget (make-instance 'qt:push-button :args '("Hello world"))))
- (cxx:show widget)
- (qt:exec))))
-
-
-(defun hello-world-quit ()
- "Quit on push-button click"
- (qt:with-app
- (let ((quit (make-instance 'qt:push-button :args '("Quit"))))
- (cxx:resize quit 75 30)
- (cxx:set-font quit (make-instance 'qt:font :args (list "Times"
- 18
- qt:font.+bold+)))
-
- (qt:object.connect quit (qt:qsignal "clicked()")
- (qt:app) (qt:qslot "quit()"))
- (cxx:show quit)
- (qt:exec))))
-
-(defun hello-world-gc ()
- "GC on push-button click"
- (qt:with-app
- (let ((gc (make-instance 'qt:widget)))
- (let ((layout (make-instance 'qt:vbox-layout))
- (button (make-instance 'qt:push-button :args '("GC"))))
- (trivial-garbage:gc :full t)
- (cxx:add-widget layout button)
- (trivial-garbage:gc :full t)
- (cxx:set-layout gc layout)
- (trivial-garbage:gc :full t)
- (qt:connect-function button "clicked()"
- #'(lambda ()
- (format t "GC-ing~%")
- (trivial-garbage:gc :full t))))
- (trivial-garbage:gc :full t)
- (cxx:show gc)
- (trivial-garbage:gc :full t)
- (qt:exec))))
-
-;; You need to run cmake & make to generate the .po and .qm files
-(defun i18n-hello-world ()
- "i18n hello world"
- (qt:with-app
- (qt:with-translator "hello-world"
- (let ((widget (make-instance 'qt:label)))
- (setf (qt:property widget 'window-title)
- (qt:tr "Lisp Qt Example" "hello-world"))
- (cxx:set-text widget
- (format nil (qt:tr "<h1>Hello world</h1>
-
-You are running ~A version ~A on a ~A ~A")
- (lisp-implementation-type)
- (lisp-implementation-version)
- (software-type)
- (software-version)))
- (cxx:show widget)
- (qt:exec)))))