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.cppI 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?
-
Maybe "this":http://developer.qt.nokia.com/doc/qt-4.8/qgraphicspolygonitem.html 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.Regards,
Jake -
Hey thanks,QGraphicScene class helped me!
its working !