[Qt-interest] QWinWidget's pos() always returns (0, 0)

william.crocker at analog.com william.crocker at analog.com
Wed May 26 16:03:24 CEST 2010



Long Cheng wrote:
> I tried to change QWinWidget's position by calling pWinWidget->move(50, 
> 50), but after that the position returned by pWinWidget->pos() was still 
> (0, 0);
> 
> QWinWidget* pWinWidget = new QWinWidget(pCView);
> pWinWidget->move(50, 50);


I find that a call to qApp->processEvents(...),
placed here, usualy takes care of this.


> QPoint pos = pWinWidget->pos(); //****NOTE: the pos equals to (0, 0)*****
> 
> The code is based on Qt 4.5.2
> 
> Thanks,
> Long
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest



More information about the Qt-interest-old mailing list