I have a function that has as a parameter a pointer to a widget. In the function I add the widget in a layout of a frame. I wish to scale the widget at a maximum size because I do not wish to let it resize the frame.
void resizeWidget(QWidget *drawingBoard)
{
QSize widgetSize = drawingBoard -> size();
widgetSize.scale(100, 100, Qt::KeepAspectRatio);
drawingBoard -> setFixedSize(widgetSize);
ui->layPieceFrameContainerLayout -> addWidget(drawingBoard);
}
The problem is the widget is sectioned and incomplete when displayed in the frame (the frame is displayed at full size and has a size of 400 x 400). If I display the widget without scale the widget is complete. Do anyone see a solution?