Today I work on a small QML & C++ Project with some problems that I still didn't fix yet :)

import QtQuick 2.15
import QtQuick.Controls 2.12
import QtQuick.Layouts

ApplicationWindow{
    id: appWindow        
   
    property int margin: 11    

    title: "Basic Layout"
    visible: true
    width: 500
    height: 500     
}

ps: the thing was casing the problem is 

import QtQuick.Layouts

minimumWidth: mainLayout.Layout.minimumWidth + 2 * margin
minimumHeight: mainLayout.Layout.minimumHeight + 2 * margin