February 15, 2012

sweety sweety
Lab Rat
3 posts

simple 2d graphics using qt


hello,i m quite new to qt.I m developing a project which is supposed to display vector image in a visualizer..the project contains visualizer class inherited from QMainWindow.
Main.cpp creates visualizer object “visualizer w and w.show”
visualizer.ui contains a menubar,toolbar,Qtreeview and QtabWidget.
I have another vecImg class that reads vector file and stores points,lines n polygon info. I want to display the info of vecImg class in
QTabWidget of the ui.
main.cpp calls visualizer which in turn invokes vecImg.cpp

I tried inheriting vecImg from QWidget and override paintEvent to draw lines on tabWidget but that didn’t work.

What should I do to draw vecImg containing info on QTabWidget of the visualizer.ui?

2 replies

February 15, 2012

Jake007 Jake007
Lab Rat
231 posts

Maybe this [developer.qt.nokia.com] is (QGraphicsPolygonItem) what you are looking for.
There is also an example “Diagram Scene Example” in Qt Creator on how to use it.
Hope it helps.



Code is poetry

February 24, 2012

sweety sweety
Lab Rat
3 posts

Hey thanks,QGraphicScene class helped me!
its working !

  ‹‹ Managing locations of multiple, separate applications from one      Is there any parser available to convert Qml code to JavaScript ››

You must log in to post a reply. Not a member yet? Register here!