Solved qt designer graphicview and qwidget
-
using qt designer i create qwidget which include a graphicview box. how do i add item such as rect etc to this view in c++?
also anyway to auto resize the graphicview inside teh qwidget when i expand/shrink the main window?
-
@s002wjh
Hi
You can access the graphicview via the UI variable if a normal Creator/Designer
created form. -
somethign like
ui->graphviewname->but how would i add rect? i usually use scene->additem(rect) but since graphicview is part of widget now. so i guess i use qpaint to draw rect in graphicview?
-
Hi,
Just as usual, create a scene and set it on your
ui->graphviewname
. -
thanks i made a stupid mistake by
setScene before ui->setupUI(this), so it crash.