79078357

Date: 2024-10-11 13:09:28
Score: 0.5
Natty:
Report link

I have been able to do it by adding the margin into the minimum size calculations of the window:

minimumWidth: rootLayout.Layout.minimumWidth + rootLayout.anchors.margins * 2
minimumHeight: rootLayout.Layout.minimumHeight + rootLayout.anchors.margins * 2

I find it a bit tricky and I am getting random error messages when resizing the window:

QWindowsWindow::setGeometry: Unable to set geometry 1316x776+1292+656 (frame: 1338x832+1281+611) on Main_QMLTYPE_0/"" on "DELL U2723QE". Resulting geometry: 1316x806+1292+656 (frame: 1338x862+1281+611) margins: 11, 45, 11, 11 minimum size: 453x537 MINMAXINFO(maxSize=POINT(x=0, y=0), maxpos=POINT(x=0, y=0), maxtrack=POINT(x=0, y=0), mintrack=POINT(x=702, y=862)))
QWindowsWindow::setGeometry: Unable to set geometry 1208x812+1292+656 (frame: 1230x868+1281+611) on Main_QMLTYPE_0/"" on "DELL U2723QE". Resulting geometry: 1208x842+1292+656 (frame: 1230x898+1281+611) margins: 11, 45, 11, 11 minimum size: 453x561 MINMAXINFO(maxSize=POINT(x=0, y=0), maxpos=POINT(x=0, y=0), maxtrack=POINT(x=0, y=0), mintrack=POINT(x=702, y=898)))
QWindowsWindow::setGeometry: Unable to set geometry 1293x776+1292+656 (frame: 1315x832+1281+611) on Main_QMLTYPE_0/"" on "DELL U2723QE". Resulting geometry: 1293x806+1292+656 (frame: 1315x862+1281+611) margins: 11, 45, 11, 11 minimum size: 453x537 MINMAXINFO(maxSize=POINT(x=0, y=0), maxpos=POINT(x=0, y=0), maxtrack=POINT(x=0, y=0), mintrack=POINT(x=702, y=862)))
QWindowsWindow::setGeometry: Unable to set geometry 1277x812+1292+656 (frame: 1299x868+1281+611) on Main_QMLTYPE_0/"" on "DELL U2723QE". Resulting geometry: 1277x842+1292+656 (frame: 1299x898+1281+611) margins: 11, 45, 11, 11 minimum size: 453x561 MINMAXINFO(maxSize=POINT(x=0, y=0), maxpos=POINT(x=0, y=0), maxtrack=POINT(x=0, y=0), mintrack=POINT(x=702, y=898)))
QWindowsWindow::setGeometry: Unable to set geometry 1289x776+1292+656 (frame: 1311x832+1281+611) on Main_QMLTYPE_0/"" on "DELL U2723QE". Resulting geometry: 1289x806+1292+656 (frame: 1311x862+1281+611) margins: 11, 45, 11, 11 minimum size: 453x537 MINMAXINFO(maxSize=POINT(x=0, y=0), maxpos=POINT(x=0, y=0), maxtrack=POINT(x=0, y=0), mintrack=POINT(x=702, y=862)))
Reasons:
  • RegEx Blacklisted phrase (1): I am getting random error
  • Long answer (-1):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: Jaime02