Qtools和qwt曲线图:如何添加点?

时间:2018-07-28 23:43:30

标签: qt lisp common-lisp qwt smoke

我正在尝试使用Common Lisp和Qtools库创建QT4 / qwt5曲线图。

这是到目前为止我得到的摘要:

(define-widget main-window (QWidget)
  ())

(define-subwidget (main-window plot) (q+:make-qwtplot main-window))
(define-subwidget (main-window c1) (q+:make-qwtplotcurve "data")
  (setf (q+:data c1)
    ;... -> what goes here?
  (q+:attach c1 plot))

(define-subwidget (main-window layout) (q+:make-qvboxlayout main-window)
  (q+:add-widget layout plot))

(defun main () (with-main-window (window 'main-window)))

出现一个空图可以,但是如何添加数据?

我尝试过:

(setf (q+:data c1)
      (values '(1.0 1.0) '(2.0 2.0) 2))

(setf (q+:data c1)
      (values #(1.0 1.0) #(2.0 2.0) 2))

产生: 在#带有参数((1.0                                                                                          1.0)                                                                                         (2.0                                                                                          2.0)                                                                                         2)

我也尝试过将其传递给QPolygonF,但是我不知道如何正确构造它。它可以与空的QPolygonF一起使用,但是如何添加点呢? documentation建议使用流操作符来添加点,但是lisp / qtools的等效点是什么?

我还尝试创建QwtArrayData对象,例如:

(q+:make-qwtarraydata #(1.0 2.0) #(1.0 2.0))

哪个会产生错误:“找不到适用于参数的构造函数QwtArrayData(#(1.0                                                               2.0)                                                             #(1.0                                                               2.0))“

0 个答案:

没有答案