repos
/
qt.tests
/ annotate_shade
summary
|
shortlog
|
log
|
tree
|
commit
|
commitdiff
|
headdiff
|
annotate
|
headblob
|
headfilediff
|
filehistory
normal
|
plain
|
shade
|
zebra
Test #'QT:GET-SLOT for function with this argument.
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."
2009-07-01 tobias
11
(qt:with-app
2009-04-02 tobias
12
(let ((widget (make-instance 'click-test-widget))
22:17:02 '
13
(click-count 0))
'
14
(qt:connect (qt:get-signal widget "clicked()")
'
15
#'(lambda ()
2009-04-08 tobias
16
(5am:is (eq widget (qt:sender)))
2009-04-02 tobias
17
(incf click-count)))
2009-07-01 tobias
18
2009-04-02 tobias
19
(cxx:set-text widget "Hello World")
22:17:02 '
20
(5am:is (string= "Hello World" (cxx:text widget)))
'
21
'
22
(5am:is (= 0 click-count))
2009-06-11 tobias
23
(qt.test:test.mouse-click widget qt:+left-button+)
2009-04-02 tobias
24
(5am:is (= 1 click-count))
2009-06-11 tobias
25
(qt.test:test.mouse-click widget qt:+right-button+)
2009-04-02 tobias
26
(5am:is (= 1 click-count)))))
22:17:02 '
27
'
28
(5am:test (click-test-bool :depends-on click-test)
'
29
"Test clicking a button (bool argument)."
2009-07-01 tobias
30
(qt:with-app
2009-04-02 tobias
31
(let ((widget (make-instance 'click-test-widget))
22:17:02 '
32
(click-count 0))
'
33
(qt:connect (qt:get-signal widget "clicked(bool)")
'
34
#'(lambda (checked)
2009-04-08 tobias
35
(5am:is (eql nil checked))
2009-04-02 tobias
36
(incf click-count)))
22:17:02 '
37
(5am:is (= 0 click-count))
2009-06-11 tobias
38
(qt.test:test.mouse-click widget qt:+left-button+)
2009-04-02 tobias
39
(5am:is (= 1 click-count))
2009-06-11 tobias
40
(qt.test:test.mouse-click widget qt:+left-button+)
2009-04-02 tobias
41
(5am:is (= 2 click-count)))))
22:17:02 '
42
2009-06-05 tobias
43
(5am:test (click-test-bool-this :depends-on click-test)
07:52:01 '
44
"Test clicking a button (bool argument) for a function with this argument."
'
45
(qt:with-app
'
46
(let ((widget (make-instance 'click-test-widget))
'
47
(click-count 0))
'
48
(qt:connect (qt:get-signal widget "clicked(bool)")
'
49
(qt:get-slot widget
'
50
#'(lambda (object checked)
'
51
(5am:is (eq nil checked))
'
52
(5am:is (eq widget object))
'
53
(incf click-count))))
'
54
(5am:is (= 0 click-count))
'
55
(qt.test:test.mouse-click widget qt:+left-button+)
'
56
(5am:is (= 1 click-count))
'
57
(qt.test:test.mouse-click widget qt:+left-button+)
'
58
(5am:is (= 2 click-count)))))