Hi,

Originally Posted by
jpn
and it will follow the size hint of the content. You just need to implement sizeHint() for your content widget and call updateGeometry() whenever the size hint changes.
The widget not will resize itself. On myDialog constructor I need to change the size of myWidget:
myDialog::myDialog(...)
{
...
int iWidth = obj->getWidth();
int iHeight = obj->getHeight();
float dAspRat = (float)iWidth/(float)iHeight;
int iWidthWidget, iHeightWidget;
iWidthWidget = 640;
iHeightWidget = (640/dAspRat );
m_pqWidget->resize(iWidthWidget,iHeightWidget);
...
//Here I want to force "this"(dialog) to fit the widgets size.
}
myDialog::myDialog(...)
{
...
int iWidth = obj->getWidth();
int iHeight = obj->getHeight();
float dAspRat = (float)iWidth/(float)iHeight;
int iWidthWidget, iHeightWidget;
iWidthWidget = 640;
iHeightWidget = (640/dAspRat );
m_pqWidget->resize(iWidthWidget,iHeightWidget);
...
//Here I want to force "this"(dialog) to fit the widgets size.
}
To copy to clipboard, switch view to plain text mode

Originally Posted by
jpn
Well, why do you care about the dialog size when the aspect ratio of the content is correct?

Because I want to force the Widget to be 640 width and Y width(that depends on the aspect ratio).
Thanks,
Bookmarks