LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Template/example for simple 2d drawings in Qt (https://www.linuxquestions.org/questions/linux-software-2/template-example-for-simple-2d-drawings-in-qt-598517/)

snjv 11-10-2007 01:34 AM

Template/example for simple 2d drawings in Qt
 
Hello,
I am new to Qt and have been searching for tutorials for drawing simple objects like lines, circles, arcs, etc using Qt. I would like to use Qt to display these through C++. I tried modifying various "Hello World" programs that compiled and opened windows with the messages, but whenever I tried QRect, etc., either I ended up with error messages or them not being drawn in the window. Web searching has not been useful as all the examples that I found are connected through some signals or part of some classes. Can someone give me a simple (starting) program to draw a circle or a line or a rectangle so that I can use it as a base for further extensions please?
TIA,
-S

Peter_APIIT 11-10-2007 03:02 AM

You can get it from QT documentation. There are tons of guide out there.

I never used QT before but this tools is extremely good compare to others.

I hope this help.

Sinedie 11-10-2007 05:27 AM

I too had gone through the documentation and it's a mountain. They also give examples, but they are not standalone or simple. For instance, if you look into the documentation of qimage, you'd see QRect, but it does not really tell you how to put the things on the window! It's all part of some class or part of code, etc. That's what is really frustrating.

Even more frustrating, and a bit infuirating part is that many of the available examples have something like, '#include <lib.h>'. Now we don't put that extra '.h' for reasons well known and when the compiler warns 'out of scope', it'll confuse like nothing else! Add to it the case-sensitivity and mistakes there of in the names of the header files! x(

Sinedie 11-10-2007 06:33 AM

Finally found this. Hope it helps!

http://www.digitalfanatics.org/proje...chapter12.html

snjv 11-10-2007 11:12 PM

Thanks Sinedie. That was really helpful! :)


All times are GMT -5. The time now is 05:41 PM.