PDA

View Full Version : Can I Add two needle for QwtDial



validator
12th February 2008, 10:29
hi, I want to add new needle for qwtDial because I need to show two needle in qwtDial but setNeedle method takes one needle .How can I do that.

Uwe
13th February 2008, 08:22
You have to derive from QwtDial and implement the second needle feature.

What exactly needs to be done depends on what you want to do with the second needle. If it is only about displaying a value it might be enough to do it in YourDial::drawContents.

Uwe

validator
13th February 2008, 22:46
You have to derive from QwtDial and implement the second needle feature.

What exactly needs to be done depends on what you want to do with the second needle. If it is only about displaying a value it might be enough to do it in YourDial::drawContents.

Uwe

I want to display two value so I need two needles in a qwtdial .I implement drawContents but it does not work if you have sample code .can you share it.Thanks

Uwe
14th February 2008, 08:03
Copy the code in QwtDial::drawContents, that deals with calculating the parameters of the drawNeedle call. Then add this code like this:


virtual void YourDial::drawContents(...)
{
QwtDial::drawContents(...);

// now calculate the parameters for your second
// needle
...
drawNeedle(...);
}

Uwe

validator
14th February 2008, 09:57
Copy the code in QwtDial::drawContents, that deals with calculating the parameters of the drawNeedle call. Then add this code like this:


virtual void YourDial::drawContents(...)
{
QwtDial::drawContents(...);

// now calculate the parameters for your second
// needle
...
drawNeedle(...);
}

Uwe


Thaks for all replies . if You have a demo .Can you share if yo do I appreciate so much .I try but I can not do.