<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Proper custom control sizing?]]></title><description><![CDATA[<p dir="auto">I've been working on a variation of the GroupBox control where the label lives outside the content rectangle (above the upper left corner) so it looks a bit like a filing cabinet folder tab.  But I'm having some difficulty getting the bounding box of it to account for this label in column layouts so the spacing looks right.</p>
<pre><code>T.GroupBox {
    id: control

    implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
                            contentWidth + leftPadding + rightPadding,
                            implicitLabelWidth + leftPadding + rightPadding)
    implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
                             contentHeight + topPadding + bottomPadding)

    spacing: 6
    padding: 0
    verticalPadding: 0
    topPadding: 0
    horizontalPadding: 0
    bottomPadding: 0

    label: Label {
        text: control.title
        color: control.palette.windowText
        anchors.leftMargin: 10
        anchors.bottom: parent.top
        topPadding: 0
        bottomPadding: 0
        leftPadding: 10

        background: Frame {
            z: -1
            y: -1
            width: parent.width + 10
            height: parent.height + 2
        }
    }

    background: Frame {
        anchors.top: control.top
        anchors.fill: parent
    }
}

</code></pre>
<p dir="auto"><img src="https://ddgobkiprc33d.cloudfront.net/a23475f3-c578-401c-a09f-e938aa77017f.jpg" alt="GroupBox.jpg" class=" img-fluid img-markdown" /></p>
]]></description><link>https://forum.qt.io/topic/145856/proper-custom-control-sizing</link><generator>RSS for Node</generator><lastBuildDate>Fri, 30 Oct 2026 00:03:45 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/145856.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 18 Jun 2023 20:33:12 GMT</pubDate><ttl>60</ttl></channel></rss>