[Qt-interest] Why does QWinWidget has a minimum size?
cheng long
kevinclcn at gmail.com
Tue May 25 10:57:58 CEST 2010
After debugging, I found that QWinWidget can't be smaller than 69 * 69, is
it a bug? Or can we change it by setting some option? Thanks!
On Tue, May 25, 2010 at 4:03 PM, cheng long <kevinclcn at gmail.com> wrote:
> 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/c26114c3/attachment.html
More information about the Qt-interest-old
mailing list