Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
5.14.2
-
None
Description
When the QGraphicsView is resized, and it's viewport owns a widget that is aligned right by setting the left content margin, resizing the QGraphicsView to any width wider than it's initial width causes the widget to be clipped.
The following is a minimum working example where a QLabel displaying a pixmap gets clipped when resizing the application wider.
class MyGraphicsView : public QGraphicsView
{
public:
MyGraphicsView()
: pm(":/image.svg")
, compass(new QLabel(viewport()))
private:
void resizeEvent(QResizeEvent* event) override
QLabel* compass;
QPixmap pm;
};
int main(int argc, char *argv[])
{ QApplication app(argc, argv); QMainWindow win; win.setCentralWidget(new MyGraphicsView()); win.show(); return app.exec(); }