Discussion:
how to draw line in QML
宫长辉
2011-12-05 01:38:41 UTC
Permalink
Hello.

I'd falled into the the trouble when I was desining my new product.
In my product I need draw some dynamic graphs, such as line and wave.
I read over the help of the QCreator, but I didn't find the solution.
Does anybody can help me out of it?

Thanks a lot


Regards.
肇鑫
2011-12-05 03:45:23 UTC
Permalink
You can read integration with c++ part of QML.

Owen
Post by 宫长辉
Hello.
I'd falled into the the trouble when I was desining my new product.
In my product I need draw some dynamic graphs, such as line and wave.
I read over the help of the QCreator, but I didn't find the solution.
Does anybody can help me out of it?
Thanks a lot
Regards.
_______________________________________________
Qt-qml mailing list
http://lists.qt.nokia.com/mailman/listinfo/qt-qml
--
ÕØöÎ
Owen Zhao
tel/miliao:18602412580
qq:66975918
msn:hutigers-***@public.gmane.org
宫长辉
2011-12-05 04:51:51 UTC
Permalink
Thank you for replay.



Can you show me some detail information about it?





Regards.





·¢ŒþÈË: ÕØöÎ [mailto:owenzx-***@public.gmane.org]
·¢ËÍʱŒä: 2011Äê12ÔÂ5ÈÕ 11:45
ÊÕŒþÈË: ¹¬³€»Ô
³­ËÍ: qt-qml-j2+ES3AKPrdWk0Htik3J/***@public.gmane.org
Ö÷Ìâ: Re: [Qt-qml] how to draw line in QML



You can read integration with c++ part of QML.

Owen

On Mon, Dec 5, 2011 at 9:38 AM, ¹¬³€»Ô <gongchanghui-n62DPVQ1/jMIhP1ydL5T/***@public.gmane.org> wrote:


Hello.

I'd falled into the the trouble when I was desining my new product.
In my product I need draw some dynamic graphs, such as line and wave.
I read over the help of the QCreator, but I didn't find the solution.
Does anybody can help me out of it?

Thanks a lot


Regards.

_______________________________________________
Qt-qml mailing list
Qt-qml-j2+ES3AKPrdWk0Htik3J/***@public.gmane.org
http://lists.qt.nokia.com/mailman/listinfo/qt-qml
--
ÕØöÎ
Owen Zhao
tel/miliao:18602412580
qq:66975918
msn:hutigers-***@public.gmane.org <mailto:msn%3Ahutigers-***@public.gmane.org>




ÔÚŽËÓÊŒþÖÐÎŽ·¢ÏÖ²¡¶Ÿ¡£
Œì²é¹€Ÿß£ºAVG - www.avg.com
°æ±Ÿ£º2012.0.1873 / ²¡¶ŸÊýŸÝ¿â£º2102/4657 - ·¢²ŒÈÕÆÚ£º12/04/11
b***@public.gmane.org
2011-12-05 05:37:16 UTC
Permalink
Hello,

With QtQuick 1.x, your options include:

* Subclassing QDeclarativeItem and override paint() to do custom painting with the QPainter API, or
* Using the qmlcanvas module (http://qt.gitorious.org/qt-labs/qmlcanvas) which allows for drawing lines and shapes directly from QML, without needing to touch C++

QtQuick 2.0 will come with a built-in Canvas element that basically has the same API as the qmlcanvas module. This API is based on the HTML 5 canvas.


cheers,

Bea
Post by 宫长辉
Thank you for replay.
Can you show me some detail information about it?
Regards.
发送时间: 2011年12月5日 11:45
收件人: 宫长辉
主题: Re: [Qt-qml] how to draw line in QML
You can read integration with c++ part of QML.
Owen
Hello.
I'd falled into the the trouble when I was desining my new product.
In my product I need draw some dynamic graphs, such as line and wave.
I read over the help of the QCreator, but I didn't find the solution.
Does anybody can help me out of it?
Thanks a lot
Regards.
_______________________________________________
Qt-qml mailing list
http://lists.qt.nokia.com/mailman/listinfo/qt-qml
--
肇鑫
Owen Zhao
tel/miliao:18602412580
qq:66975918
在此邮件中未发现病毒。
检查工具:AVG - www.avg.com
版本:2012.0.1873 / 病毒数据库:2102/4657 - 发布日期:12/04/11
_______________________________________________
Qt-qml mailing list
http://lists.qt.nokia.com/mailman/listinfo/qt-qml
宫长辉
2011-12-05 05:40:51 UTC
Permalink
Thank you fro reply.

It seems that using qmlcanvas module will be the nice way to resolve my
problem.

BTW, when QT quick 2.0 will be released ?

Regards.

-----邮件原件-----
发件人: ***@nokia.com [mailto:***@nokia.com]
发送时间: 2011年12月5日 13:37
收件人: ***@kingrich.com.cn
抄送: ***@gmail.com; qt-***@qt.nokia.com
主题: Re: [Qt-qml] 答复: how to draw line in QML

Hello,

With QtQuick 1.x, your options include:

* Subclassing QDeclarativeItem and override paint() to do custom painting
with the QPainter API, or
* Using the qmlcanvas module (http://qt.gitorious.org/qt-labs/qmlcanvas)
which allows for drawing lines and shapes directly from QML, without needing
to touch C++

QtQuick 2.0 will come with a built-in Canvas element that basically has the
same API as the qmlcanvas module. This API is based on the HTML 5 canvas.


cheers,

Bea
Post by 宫长辉
Thank you for replay.
Can you show me some detail information about it?
Regards.
发送时间: 2011年12月5日 11:45
收件人: 宫长辉
主题: Re: [Qt-qml] how to draw line in QML
You can read integration with c++ part of QML.
Owen
Hello.
I'd falled into the the trouble when I was desining my new product.
In my product I need draw some dynamic graphs, such as line and wave.
I read over the help of the QCreator, but I didn't find the solution.
Does anybody can help me out of it?
Thanks a lot
Regards.
_______________________________________________
Qt-qml mailing list
http://lists.qt.nokia.com/mailman/listinfo/qt-qml
--
肇鑫
Owen Zhao
tel/miliao:18602412580
qq:66975918
在此邮件中未发现病毒。
检查工具:AVG - www.avg.com
版本:2012.0.1873 / 病毒数据库:2102/4657 - 发布日期:12/04/11
_______________________________________________
Qt-qml mailing list
http://lists.qt.nokia.com/mailman/listinfo/qt-qml
-----
在此邮件中未发现病毒。
检查工具:AVG - www.avg.com
版本:2012.0.1873 / 病毒数据库:2102/4657 - 发布日期:12/04/11
b***@public.gmane.org
2011-12-05 06:26:15 UTC
Permalink
Post by 宫长辉
Thank you fro reply.
It seems that using qmlcanvas module will be the nice way to resolve my
problem.
BTW, when QT quick 2.0 will be released ?
It is part of Qt 5, which is scheduled for the first half of 2012: http://developer.qt.nokia.com/wiki/Qt_5.0
Jesus Fernandez
2011-12-05 08:11:57 UTC
Permalink
Anyway for the lines, you can use the rectangle and some math to calc the
angle and coords if the line is not horizontal or vertical.
Post by b***@public.gmane.org
Post by 宫长辉
Thank you fro reply.
It seems that using qmlcanvas module will be the nice way to resolve my
problem.
BTW, when QT quick 2.0 will be released ?
http://developer.qt.nokia.com/wiki/Qt_5.0
_______________________________________________
Qt-qml mailing list
http://lists.qt.nokia.com/mailman/listinfo/qt-qml
宫长辉
2011-12-05 08:37:20 UTC
Permalink
I need to draw a wave composed by 1000 continuous lines.

And mostly 8 waves were needed in one graph.

Even the product should be run in ARM.



So I¡¯m afraid that it will cost too much CPU and memory, If I implement it
with rectangle,



Regards.





·¢ŒþÈË: Jesus Fernandez [mailto:jsfdez-***@public.gmane.org]
·¢ËÍʱŒä: 2011Äê12ÔÂ5ÈÕ 16:12
ÊÕŒþÈË: bea.lam-***@public.gmane.org
³­ËÍ: gongchanghui-n62DPVQ1/jMIhP1ydL5T/***@public.gmane.org; qt-qml-j2+ES3AKPrdWk0Htik3J/***@public.gmane.org
Ö÷Ìâ: Re: [Qt-qml] ŽðžŽ: ŽðžŽ: how to draw line in QML



Anyway for the lines, you can use the rectangle and some math to calc the
angle and coords if the line is not horizontal or vertical.
Post by 宫长辉
Thank you fro reply.
It seems that using qmlcanvas module will be the nice way to resolve my
problem.
BTW, when QT quick 2.0 will be released ?
It is part of Qt 5, which is scheduled for the first half of 2012:
http://developer.qt.nokia.com/wiki/Qt_5.0


_______________________________________________
Qt-qml mailing list
Qt-qml-j2+ES3AKPrdWk0Htik3J/***@public.gmane.org
http://lists.qt.nokia.com/mailman/listinfo/qt-qml





ÔÚŽËÓÊŒþÖÐÎŽ·¢ÏÖ²¡¶Ÿ¡£
Œì²é¹€Ÿß£ºAVG - www.avg.com
°æ±Ÿ£º2012.0.1873 / ²¡¶ŸÊýŸÝ¿â£º2102/4657 - ·¢²ŒÈÕÆÚ£º12/04/11
Bo Thorsen
2011-12-05 09:08:46 UTC
Permalink
Then you should implement your own QDeclarativeItem subclass i C++ and
do the drawing with QPainter.

Bo.
Post by 宫长辉
I need to draw a wave composed by 1000 continuous lines.
And mostly 8 waves were needed in one graph.
Even the product should be run in ARM.
So I’m afraid that it will cost too much CPU and memory, If I implement
it with rectangle,
Regards.
*发送时间:*2011年12月5日16:12
*主题:*Re: [Qt-qml] 答复: 答复: how to draw line in QML
Anyway for the lines, you can use the rectangle and some math to calc
the angle and coords if the line is not horizontal or vertical.
Post by 宫长辉
Thank you fro reply.
It seems that using qmlcanvas module will be the nice way to resolve my
problem.
BTW, when QT quick 2.0 will be released ?
http://developer.qt.nokia.com/wiki/Qt_5.0
_______________________________________________
Qt-qml mailing list
http://lists.qt.nokia.com/mailman/listinfo/qt-qml
在此邮件中未发现病毒。
检查工具:AVG - www.avg.com <http://www.avg.com>
版本:2012.0.1873 / 病毒数据库:2102/4657 - 发布日期:12/04/11
_______________________________________________
Qt-qml mailing list
http://lists.qt.nokia.com/mailman/listinfo/qt-qml
Bo Thorsen,
Fionia Software.
--
Expert Qt and C++ developer for hire
Contact me if you need expert Qt help
http://www.fioniasoftware.dk
Carel Combrink
2011-12-05 09:11:56 UTC
Permalink
Hi,

A while back I also needed a line in one of my QML applications. I used the
code from this example
http://www.developer.nokia.com/Community/Wiki/CS001627_-_Creating_a_custom_QML_element_with_Qt


Regards,
Carel
I need to draw a wave composed by 1000 continuous lines.****
And mostly 8 waves were needed in one graph.****
Even the product should be run in ARM.****
** **
So I¡¯m afraid that it will cost too much CPU and memory, If I implement it
with rectangle,****
** **
Regards.****
** **
** **
*·¢ËÍʱŒä:* 2011Äê12ÔÂ5ÈÕ 16:12
*Ö÷Ìâ:* Re: [Qt-qml] ŽðžŽ: ŽðžŽ: how to draw line in QML****
** **
Anyway for the lines, you can use the rectangle and some math to calc the
angle and coords if the line is not horizontal or vertical.****
Post by 宫长辉
Thank you fro reply.
It seems that using qmlcanvas module will be the nice way to resolve my
problem.
BTW, when QT quick 2.0 will be released ?
****
http://developer.qt.nokia.com/wiki/Qt_5.0****
_______________________________________________
Qt-qml mailing list
http://lists.qt.nokia.com/mailman/listinfo/qt-qml****
****
ÔÚŽËÓÊŒþÖÐÎŽ·¢ÏÖ²¡¶Ÿ¡£
Œì²é¹€Ÿß£ºAVG - www.avg.com
°æ±Ÿ£º2012.0.1873 / ²¡¶ŸÊýŸÝ¿â£º2102/4657 - ·¢²ŒÈÕÆÚ£º12/04/11****
_______________________________________________
Qt-qml mailing list
http://lists.qt.nokia.com/mailman/listinfo/qt-qml
宫长辉
2011-12-05 12:10:20 UTC
Permalink
I¡¯d read this example too.

Only a blank dialog was displayed because of no ¡°CustomComponents¡±.

Could you tell me where I can get it ?



Regards.



·¢ŒþÈË: Carel Combrink [mailto:carel.combrink-***@public.gmane.org]
·¢ËÍʱŒä: 2011Äê12ÔÂ5ÈÕ 17:12
ÊÕŒþÈË: ¹¬³€»Ô
³­ËÍ: qt-qml-j2+ES3AKPrdWk0Htik3J/***@public.gmane.org
Ö÷Ìâ: Re: [Qt-qml] ŽðžŽ: ŽðžŽ: ŽðžŽ: how to draw line in QML



Hi,



A while back I also needed a line in one of my QML applications. I used the
code from this example
http://www.developer.nokia.com/Community/Wiki/CS001627_-_Creating_a_custom_Q
ML_element_with_Qt



Regards,

Carel

2011/12/5 ¹¬³€»Ô <gongchanghui-n62DPVQ1/jMIhP1ydL5T/***@public.gmane.org>

I need to draw a wave composed by 1000 continuous lines.

And mostly 8 waves were needed in one graph.

Even the product should be run in ARM.



So I¡¯m afraid that it will cost too much CPU and memory, If I implement it
with rectangle,



Regards.





·¢ŒþÈË: Jesus Fernandez [mailto:jsfdez-***@public.gmane.org]
·¢ËÍʱŒä: 2011Äê12ÔÂ5ÈÕ 16:12
ÊÕŒþÈË: bea.lam-***@public.gmane.org
³­ËÍ: gongchanghui-n62DPVQ1/jMIhP1ydL5T/***@public.gmane.org; qt-qml-j2+ES3AKPrdWk0Htik3J/***@public.gmane.org
Ö÷Ìâ: Re: [Qt-qml] ŽðžŽ: ŽðžŽ: how to draw line in QML



Anyway for the lines, you can use the rectangle and some math to calc the
angle and coords if the line is not horizontal or vertical.
Post by 宫长辉
Thank you fro reply.
It seems that using qmlcanvas module will be the nice way to resolve my
problem.
BTW, when QT quick 2.0 will be released ?
It is part of Qt 5, which is scheduled for the first half of 2012:
http://developer.qt.nokia.com/wiki/Qt_5.0


_______________________________________________
Qt-qml mailing list
Qt-qml-j2+ES3AKPrdWk0Htik3J/***@public.gmane.org
http://lists.qt.nokia.com/mailman/listinfo/qt-qml



ÔÚŽËÓÊŒþÖÐÎŽ·¢ÏÖ²¡¶Ÿ¡£
Œì²é¹€Ÿß£ºAVG - www.avg.com
°æ±Ÿ£º2012.0.1873 / ²¡¶ŸÊýŸÝ¿â£º2102/4657 - ·¢²ŒÈÕÆÚ£º12/04/11


_______________________________________________
Qt-qml mailing list
Qt-qml-j2+ES3AKPrdWk0Htik3J/***@public.gmane.org
http://lists.qt.nokia.com/mailman/listinfo/qt-qml



ÔÚŽËÓÊŒþÖÐÎŽ·¢ÏÖ²¡¶Ÿ¡£
Œì²é¹€Ÿß£ºAVG - www.avg.com
°æ±Ÿ£º2012.0.1873 / ²¡¶ŸÊýŸÝ¿â£º2102/4658 - ·¢²ŒÈÕÆÚ£º12/05/11
Loading...