PDA

View Full Version : QwtThermo size and alarm questions



akL
3rd May 2013, 15:37
Hi,
for a project I am currently working on I have to imitate a storage basin. I found QwtThermo suitable for that, as one can easily display the actual level of the basin with it. I now have two questions concerning QwtThermo:
1) I found setPipeWidth() in order to change the width of the thermo pipe. Is there any equivalent for adjusting the height of the pipe?
2) The possibility of setting an alarm level is quite useful but is it possible to set two different alarm levels for one thermometer widget? I need that because a storage basin may not underrun a certain level as well as it is not allowed to overrun one.

I looked through the API but got no clue for those. In fact, my clue is that both is not possible, but it is likely I missed something.
Hopefully one of you can answer my questions and maybe also give me hint for a workaround, if the answer to both questions is no.

Thanks in advance!
Kind regards
Alex

Uwe
5th May 2013, 11:41
1) I found setPipeWidth() in order to change the width of the thermo pipe. Is there any equivalent for adjusting the height of the pipe?

One dimension is set with setPipeWidth, the other one is adjusted to the geometry of the widget - depending on the orientation of the thermo. So you are probably looking for the trivial QWidget APIs like setGeometry, setWidth(), setHeight(), sizeHint() ..



2) The possibility of setting an alarm level is quite useful but is it possible to set two different alarm levels for one thermometer widget? I need that because a storage basin may not underrun a certain level as well as it is not allowed to overrun one.
The alarm level API is left over for compatibility reasons only - using a color map is much more powerful and allows to implement an unlimited number of levels.

I recommend to use Qwt 6.1 - all control widgets have been cleaned up and offer more functionality. The new controls example shows more use cases of QwtThermo including what you are looking for. It might also be interesting to have a look at SVN trunk - the only difference to Qwt 6.1 rc3 is an extension for QwtThermo, that adds a new mode where the origin of the liquid might be inside the scale.

Uwe