use (setf instead of setter methods.
Mon May 11 20:30:39 CEST 2009 Tobias Rautenkranz <tobias@rautenkranz.ch>
* use (setf instead of setter methods.
diff -rN -u old-qt.examples/src/class-browser.lisp new-qt.examples/src/class-browser.lisp
--- old-qt.examples/src/class-browser.lisp 2014-10-30 07:00:02.000000000 +0100
+++ new-qt.examples/src/class-browser.lisp 2014-10-30 07:00:02.000000000 +0100
@@ -32,7 +32,7 @@
:initform (make-instance 'qt:label))
(web-view :reader web-view
:initform (make-instance 'qt.webkit:web-view)))
- (:metaclass smoke::smoke-wrapper-class))
+ (:metaclass cxx:class))
(defun setup-class-list (classes)
(do-external-symbols (symbol :qt)
@@ -58,20 +58,19 @@
(cxx:keyboard-search (classes-list browser)
text))))
(let ((scroll (make-instance 'qt:scroll-area)))
- (cxx:set-widget scroll (class-info browser))
- (cxx:set-widget-resizable scroll t)
+ (setf (cxx:widget scroll) (class-info browser)
+ (cxx:widget-resizable scroll) t)
(cxx:add-widget layout scroll))
- (cxx:set-layout w layout)
+ (setf (cxx:layout w) layout)
(cxx:add-widget browser w))
(cxx:add-widget browser (web-view browser))
(qt:do-delayed-initialize
(setup-class-list (classes browser))
- (cxx:set-uniform-item-sizes (classes-list browser) t)
- (cxx:set-selection-mode (classes-list browser) qt:abstract-item-view.+single-selection+)
- (cxx:set-model (classes-list browser) (classes browser))
- (cxx:set-word-wrap (class-info browser) t)
- (cxx:set-window-title browser "CL Qt Classes")
-
+ (setf (cxx:uniform-item-sizes (classes-list browser)) t
+ (cxx:selection-mode (classes-list browser)) qt:abstract-item-view.+single-selection+
+ (cxx:model (classes-list browser)) (classes browser)
+ (cxx:word-wrap (class-info browser)) t
+ (cxx:window-title browser) "CL Qt Classes")
(qt:connect (qt:get-signal (cxx:selection-model (classes-list browser))
"currentChanged(QModelIndex, QModelIndex)")
#'(lambda (current previous)
@@ -83,7 +82,7 @@
(let* ((class (class-at model-index)))
(cxx:load web-view (format nil "http://doc.trolltech.com/~A/~A.html"
(subseq (qt:q-version) 0 3)
- (remove #\: (smoke::name class) :count 1)))
+ (remove #\: (smoke:name class) :count 1)))
(cxx:set-text info
(format nil "<h1>qt:~A</h1>
<p>~A</p>
@@ -97,7 +96,7 @@
</ul>
"
(string-downcase (class-name class))
- (smoke::name class)
+ (smoke:name class)
(mapcar #'(lambda (c) (string-downcase (class-name c)))
(closer-mop:class-direct-superclasses class))
(mapcar #'(lambda (c) (string-downcase (class-name c)))
diff -rN -u old-qt.examples/src/hello-world-quit.lisp new-qt.examples/src/hello-world-quit.lisp
--- old-qt.examples/src/hello-world-quit.lisp 2014-10-30 07:00:02.000000000 +0100
+++ new-qt.examples/src/hello-world-quit.lisp 2014-10-30 07:00:02.000000000 +0100
@@ -9,9 +9,9 @@
(let ((quit (make-instance 'qt:push-button :args '("Quit")))
(font (make-instance 'qt:font :args (list "Times"
18
- (value qt:font.+bold+)))))
+ qt:font.+bold+))))
(cxx:resize quit 75 30)
- (cxx:set-font quit font)
+ (setf (cxx:font quit) font)
(qt:connect (qt:get-signal quit "pressed()")
#'(lambda ()
diff -rN -u old-qt.examples/src/hello-world_de.po new-qt.examples/src/hello-world_de.po
--- old-qt.examples/src/hello-world_de.po 2014-10-30 07:00:02.000000000 +0100
+++ new-qt.examples/src/hello-world_de.po 2014-10-30 07:00:02.000000000 +0100
@@ -6,7 +6,7 @@
msgstr ""
"Project-Id-Version: hello-world\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2009-04-16 16:29+0200\n"
+"POT-Creation-Date: 2009-05-11 18:00+0200\n"
"PO-Revision-Date: 2009-03-21 11:41+0100\n"
"Last-Translator: Tobias Rautenkranz <tobias@rautenkranz.ch>\n"
"Language-Team: German <>\n"
@@ -16,12 +16,12 @@
"X-Generator: Lokalize 0.3\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
-#: i18n-hello-world.lisp:20
+#: i18n-hello-world.lisp:18
msgctxt "hello-world"
msgid "Lisp Qt Example"
msgstr "Lisp Qt Beispiel"
-#: i18n-hello-world.lisp:22
+#: i18n-hello-world.lisp:19
#, lisp-format
msgid ""
"<h1>Hello world</h1>\n"
diff -rN -u old-qt.examples/src/i18n-hello-world.lisp new-qt.examples/src/i18n-hello-world.lisp
--- old-qt.examples/src/i18n-hello-world.lisp 2014-10-30 07:00:02.000000000 +0100
+++ new-qt.examples/src/i18n-hello-world.lisp 2014-10-30 07:00:02.000000000 +0100
@@ -10,16 +10,13 @@
;; ensures that the message catalogs are found regardless
;; of the current directory.
(concatenate 'string
-
(directory-namestring
(mb.sysdef:input-file
(mb.sysdef:find-component :qt.examples "src" "i18n-hello-world")))
"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>
+ (setf (cxx:window-title widget) (qt:tr "Lisp Qt Example" "hello-world")
+ (cxx:text widget) (format nil (qt:tr "<h1>Hello world</h1>
You are running ~A version ~A on a ~A ~A")
(lisp-implementation-type)
diff -rN -u old-qt.examples/src/launcher.lisp new-qt.examples/src/launcher.lisp
--- old-qt.examples/src/launcher.lisp 2014-10-30 07:00:02.000000000 +0100
+++ new-qt.examples/src/launcher.lisp 2014-10-30 07:00:02.000000000 +0100
@@ -22,7 +22,7 @@
(do-external-symbols (example :qt.examples)
(when (fboundp example)
(cxx:add-widget layout (make-launcer-button (symbol-function example)))))
- (cxx:set-layout launcher layout)))
+ (setf (cxx:layout launcher) layout)))
(defun launcher ()
"Launch the Qt examples"
diff -rN -u old-qt.examples/src/repl.lisp new-qt.examples/src/repl.lisp
--- old-qt.examples/src/repl.lisp 2014-10-30 07:00:02.000000000 +0100
+++ new-qt.examples/src/repl.lisp 2014-10-30 07:00:02.000000000 +0100
@@ -5,7 +5,7 @@
(defclass repl (qt:widget)
((model :reader model
- :initform (make-instance 'qt:string-list-model))
+ :initform (make-instance 'qt:string-list-model))
(output :reader output
:initform (make-instance 'qt:list-view))
(input :reader input
@@ -18,11 +18,11 @@
(unless (cxx:insert-row list-model index)
(error "insert-row ~A for ~A failed." index list-model))
(cxx:set-data list-model (cxx:index list-model index)
- (qt::make-variant string))))
+ (qt:make-variant string))))
(defmethod initialize-instance :after ((repl repl) &rest args)
(declare (ignore args))
- (cxx:set-model (output repl) (model repl))
+ (setf (cxx:model (output repl)) (model repl))
(qt:connect (qt:get-signal (input repl) "returnPressed()")
#'(lambda ()
(append-list-model ;; Input
@@ -33,11 +33,11 @@
(format nil "~S"
(handler-case (eval (read-from-string (cxx:text (input repl))))
(error (condition) condition))))
- (cxx:set-text (input repl) "")))
+ (setf (cxx:text (input repl)) "")))
(let ((layout (make-instance 'qt:vbox-layout)))
(cxx:add-widget layout (output repl))
(cxx:add-widget layout (input repl))
- (cxx:set-layout repl layout))
+ (setf (cxx:layout repl) layout))
(cxx:set-focus (input repl)))
(defun repl ()
diff -rN -u old-qt.examples/src/tick-tack-toe.lisp new-qt.examples/src/tick-tack-toe.lisp
--- old-qt.examples/src/tick-tack-toe.lisp 2014-10-30 07:00:02.000000000 +0100
+++ new-qt.examples/src/tick-tack-toe.lisp 2014-10-30 07:00:02.000000000 +0100
@@ -8,18 +8,18 @@
((board :accessor board
:initform (make-array '(3 3)))
(check :accessor check-slot))
- (:metaclass smoke::smoke-wrapper-class))
+ (:metaclass cxx:class))
(defclass chell-button (qt:push-button)
((x :reader x
:initarg :x)
(y :reader y
:initarg :y))
- (:metaclass smoke::smoke-wrapper-class))
+ (:metaclass cxx:class))
(defun update-cell (widget cell)
(when (= 0 (state cell))
- (cxx:set-text cell "X")
+ (setf (cxx:text cell) "X")
(check-end widget)
(computer-move (board widget))
(check-end widget)))
@@ -31,7 +31,7 @@
(dotimes (y 3)
(when (= 0 (state (aref board x y)))
(when (= 0 cell)
- (cxx:set-text (aref board x y) "O")
+ (setf (cxx:text (aref board x y)) "O")
(return-from top))
(decf cell)))))))
@@ -52,7 +52,7 @@
(defun reset-board (board)
(dotimes (x 3)
(dotimes (y 3)
- (cxx:set-text (aref board x y) ""))))
+ (setf (cxx:text (aref board x y)) ""))))
(defun state (cell)
@@ -94,22 +94,20 @@
(defmethod initialize-instance :after ((widget tick-tack-toe) &rest args)
(declare (ignore args))
- (setf (check-slot widget) (qt::make-slot #'(lambda ()
- (update-cell widget
- (qt:sender)))))
-
+ (setf (check-slot widget) (qt:make-slot #'(lambda ()
+ (update-cell widget
+ (qt:sender)))))
(let ((layout (make-instance 'qt:grid-layout)))
(dotimes (x (array-dimension (board widget) 0))
(dotimes (y (array-dimension (board widget) 1))
(setf (aref (board widget) x y)
(make-instance 'chell-button :x x :y y))
- (qt::connect (make-instance 'qt::qt-signal
- :sender (aref (board widget) x y)
- :name "clicked()")
- (check-slot widget))
+ (qt:connect (qt:get-signal (aref (board widget) x y)
+ "clicked()")
+ (check-slot widget))
(cxx:add-widget layout (aref (board widget) x y)
x y)))
- (cxx:set-layout widget layout)))
+ (setf (cxx:layout widget) layout)))
(defun tick-tack-toe ()
"Tick Tack Toe"
diff -rN -u old-qt.examples/src/ui.lisp new-qt.examples/src/ui.lisp
--- old-qt.examples/src/ui.lisp 2014-10-30 07:00:02.000000000 +0100
+++ new-qt.examples/src/ui.lisp 2014-10-30 07:00:02.000000000 +0100
@@ -6,22 +6,22 @@
(defun load-ui-file ()
"Load a Qt Designer .ui file"
(qt:with-app
- (let ((loader (make-instance 'qt.uitools:ui-loader))
- (file (make-instance 'qt:file))
- (widget))
- (cxx:set-file-name file
- (concatenate 'string
- (directory-namestring
- (mb.sysdef:input-file
- (mb.sysdef:find-component :qt.examples "src" "ui")))
- "widget.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))))
+ (let ((loader (make-instance 'qt.uitools:ui-loader))
+ (file (make-instance 'qt:file))
+ (widget))
+ (setf (cxx:file-name file)
+ (concatenate 'string
+ (directory-namestring
+ (mb.sysdef:input-file
+ (mb.sysdef:find-component :qt.examples "src" "ui")))
+ "widget.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))))