PDA

View Full Version : Best practice to implement a graphic item



Jon Heron
4th December 2010, 19:10
Hello All,

I am a beginner when it comes to Qt/C++ coding and an absolute beginner when it comes to coding graphics...
I am developing an application involving liquid levels in a tank, I would like to have a graphic that shows the liquid level of two different liquids in the tank based on the user input.
I am thinking I will need an image for my tank that I draw a line on for the liquid level and then fill the tank with a colour up to the line.
Is this the right approach?
What class[s] should I look into to accomplish this if this is the right approach?
This may be way more complicated then a rookie should be tackling?
Thanks for any input!
Cheers,
Jon

marcvanriet
4th December 2010, 22:20
Hi,

Maybe you can use this widget : QGauge (http://qt-apps.org/content/show.php/QGauge+?content=72918). Or you can just use a QSlider.

I would advise to keep it simple at first and use existing widgets. If you get the rest of your application working, you'll be more familiar with Qt and may try and implement your own widget or graphics representation.

Best regards,
Marc