[Qt-interest] Why does QWinWidget has a minimum size?
cheng long
kevinclcn at gmail.com
Tue May 25 10:03:15 CEST 2010
I hosted a QGraphicsView with QWinWidget in a MFC CView and want to resize
the QWinWidget and QGraphicsView along with zooming. The issue is when width
< 26 and height < 8, QWinWidget::resize() fails to work. The QWinWidget
becomes a large square, while the QGraphicsView is still a smaller
rectangle. The area not occupied by QGraphicsView is gray, i.e. the
QWinWidget's background color. Any one experiences that? What's the problem?
Thanks!
Qt 4.5.2, Win7
Codes:
QRectF sceneRect = view->scene()->itemsBoundingRect();
QRect rect = view->mapFromScene(sceneRect).boundingRect();
view->resize(rect.size()); // resize view
CChildView::m_pWinWidget->resize(rect.size()); // resize QWinWidget
view->scene()->items()[0]->setPos(view->mapToScene(0, 0)); //
center the QGraphicsItem
Thanks,
Kevin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100525/f1562619/attachment.html
More information about the Qt-interest-old
mailing list