repos
/
qt.tests
/ annotate_shade
summary
|
shortlog
|
log
|
tree
|
commit
|
commitdiff
|
headdiff
|
annotate
|
headblob
|
headfilediff
|
filehistory
normal
|
plain
|
shade
|
zebra
initial import
Annotate for file src/click.lisp
2009-04-02 tobias
1
(in-package :qt.tests)
22:17:02 '
2
'
3
(5am:in-suite :qt.suite)
'
4
'
5
(defclass click-test-widget (qt:push-button)
'
6
()
'
7
(:metaclass cxx:class))
'
8
'
9
(5am:test (click-test :depends-on with-app)
'
10
"Test clicking a button."
'
11
(qt:with-app
'
12
(let ((widget (make-instance 'click-test-widget))
'
13
(click-count 0))
'
14
(qt:connect (qt:get-signal widget "clicked()")
'
15
#'(lambda ()
'
16
(incf click-count)))
'
17
'
18
(cxx:set-text widget "Hello World")
'
19
(5am:is (string= "Hello World" (cxx:text widget)))
'
20
'
21
(5am:is (= 0 click-count))
'
22
(qt.test:test.mouse-click widget qt:+left-button+)
'
23
(5am:is (= 1 click-count))
'
24
(qt.test:test.mouse-click widget qt:+right-button+)
'
25
(5am:is (= 1 click-count)))))
'
26
'
27
(5am:test (click-test-bool :depends-on click-test)
'
28
"Test clicking a button (bool argument)."
'
29
(qt:with-app
'
30
(let ((widget (make-instance 'click-test-widget))
'
31
(click-count 0))
'
32
(qt:connect (qt:get-signal widget "clicked(bool)")
'
33
#'(lambda (checked)
'
34
(5am:is (eql t checked))
'
35
(incf click-count)))
'
36
(5am:is (= 0 click-count))
'
37
(qt.test:test.mouse-click widget qt:+left-button+)
'
38
(5am:is (= 1 click-count))
'
39
(qt.test:test.mouse-click widget qt:+left-button+)
'
40
(5am:is (= 2 click-count)))))
'
41