Please nominate your Qt Champions for 2021! https://forum.qt.io/topic/132134/looking-for-the-2021-qt-champions
QgraphicsView not align to center if setFixedSize
GoldenAxe last edited by
When I setFixedSize for my QgraphicsView he get align to the top left corner of the centralwidget, when I don't setFixeSize it's centered but the view is spread on the entire centralwidghet meaning if I set mouseMoveEvent to the (x,y) position it will work for the entire screen even the part of the screen which don't have any QGrpahicsItem paint on.
some test code I was trying (I was trying to set it inside a layout as well):
@m_mapView = new MapView(this);
QGridLayout *mainLayout = new QGridLayout(this);
- mapView is a custom QGraphicsView, maybe I need to implement something there that will make it align to the center?
- I know that the default align for QGraphicsView is center...but doesn't seems to work for me