[Qt-interest] show the needle of the compass
Matthias Pospiech
matthias.pospiech at gmx.de
Tue May 5 10:57:53 CEST 2009
Stefanos Antaris schrieb:
> Matthias Pospiech wrote:
>> Stefanos Antaris schrieb:
>>> I tried to install the qwt libraries on my Mac and i didn't manage
>>> it.So i took the code of qwt and i put it into my qt application in
>>> order to use it.Ok.I found this function too.But i don't know which
>>> parameteres should i pass.Which painter,palette,etc.This is my problem.
>> It took a look into the code of the dials example and there all
>> needles are created using setNeedle
>>
>> compass->setNeedle(new QwtDialSimpleNeedle(QwtDialSimpleNeedle::Ray,
>> false, Qt::white));
>>
>> Looking into the docs of QwtDialSimpleNeedle
>> (http://qwt.sourceforge.net/class_qwt_dial_simple_needle.html) I find
>> a member function setWidth.
>> That is probably what you need.
>>
>> Not tested though,
>> Matthias
>>
> Ok i made it.But the whole compass is just too small.And as i see on
> the qwt_compass.h code there is nowhere to change the size of the
> compass.Moreover the needle of the compass moves only when the mouse
> is clicked.And i can't make it to rotate with a variable.I mean
> something like rotate(59);Is there any function or i have to make one?
You should look more into how the code works.
The size is depending on how you integrated it into your layout. That
has nothing to do with qwt. And the value of the compass is very likely
set by setValue, the Orientation by setOrigin.
Matthias
More information about the Qt-interest-old
mailing list