Description
In standard Qt, the content has padding values at the top, bottom, left and right. Howver, if we do anchors.fill: parent, then the content takes the same size as that of the parent.
import QtQuick 2.7 import QtQuick.Controls 2.3 Rectangle { color: "red" anchors.fill: parent Button { contentItem: Rectangle { color: "yellow" anchors.fill:parent } } }
However, in QtForMCU this does not work. The padding values are not over-written. The content will only take the size of the parent when we explicitly set all padding values to 0. We also tried to force height and width of the contentItem to be the same as parent but that also didn't work.
import QtQuick 2.7 import QtQuick.Controls 2.3 Rectangle { color: "red" anchors.fill: parent Button { topPadding: 0 bottomPadding: 0 leftPadding: 0 rightPadding: 0 contentItem: Rectangle { color: "yellow" anchors.fill:parent } } }