<?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[Anchors problem with several texts]]></title><description><![CDATA[<p dir="auto">Hello,</p>
<p dir="auto">I try to align text fragments of different sizes (point). I thought if I anchor 2 elements at the top of each other, they would start at the same y-value. But it seems in texts there are existing special rules. The following example shows what I intend to do.</p>
<p dir="auto">@<br />
Rectangle<br />
{<br />
width: 360<br />
height: 360</p>
<pre><code>Text
{
     id: t1
     x: 50
     y: 40

     text: "A"

     font.family: "Verdana";
     font.weight: Font.Normal
     font.pointSize: 40
}

Text
{
     id: t2

     text: "B"

     font.family: "Verdana";
     font.weight: Font.Normal
     font.pointSize: 20

     anchors.bottom: t1.bottom
     anchors.left: t1.right
}

Text
{
     id: t3

     text: "C"

     font.family: "Verdana";
     font.weight: Font.Normal
     font.pointSize: 10

     anchors.top: t2.top
     anchors.left: t2.right
}
</code></pre>
<p dir="auto">}<br />
@</p>
<p dir="auto"><em>Edit: fixed code indentation for improved readability; Andre</em></p>
]]></description><link>https://forum.qt.io/topic/5043/anchors-problem-with-several-texts</link><generator>RSS for Node</generator><lastBuildDate>Sun, 09 Aug 2026 06:38:02 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/5043.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 12 Apr 2011 08:51:01 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Anchors problem with several texts on Wed, 13 Apr 2011 09:45:29 GMT]]></title><description><![CDATA[<p dir="auto">Of course, here is the image for baseline usage t1/t2 and code snippet from last post for t2/t3 :)</p>
<p dir="auto">!<a href="http://www.treggs.de/img/Image1.png" target="_blank" rel="noopener noreferrer nofollow ugc">http://www.treggs.de/img/Image1.png</a>(Baseline image)!</p>
<p dir="auto"><em>Edit: fixed image tag. Image tag gets screwed if you don't enter an alternative text; Andre</em></p>
]]></description><link>https://forum.qt.io/post/83915</link><guid isPermaLink="true">https://forum.qt.io/post/83915</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Wed, 13 Apr 2011 09:45:29 GMT</pubDate></item><item><title><![CDATA[Reply to Anchors problem with several texts on Wed, 13 Apr 2011 09:24:09 GMT]]></title><description><![CDATA[<p dir="auto">Could you post an image, complete with the relevant guide lines, of what you are trying to achieve please?</p>
]]></description><link>https://forum.qt.io/post/83908</link><guid isPermaLink="true">https://forum.qt.io/post/83908</guid><dc:creator><![CDATA[andre]]></dc:creator><pubDate>Wed, 13 Apr 2011 09:24:09 GMT</pubDate></item><item><title><![CDATA[Reply to Anchors problem with several texts on Wed, 13 Apr 2011 08:21:57 GMT]]></title><description><![CDATA[<p dir="auto">Hmm ... strange. I thought I made this test as well. :/<br />
It works like expected for the first 2 letters. So thank you again!</p>
<p dir="auto">But while t1 and t2 are sitting now on the same baseline, I still don't see a way to align t3 to the "topline" of letter t2 (both letters start on the same y-value). I tried something like this for t3:</p>
<p dir="auto">@<br />
anchors.baseline: t2.baseline<br />
anchors.baselineOffset: -( t2.paintedHeight - paintedHeight )<br />
@</p>
<p dir="auto">But don't work.</p>
]]></description><link>https://forum.qt.io/post/83893</link><guid isPermaLink="true">https://forum.qt.io/post/83893</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Wed, 13 Apr 2011 08:21:57 GMT</pubDate></item><item><title><![CDATA[Reply to Anchors problem with several texts on Tue, 12 Apr 2011 23:45:21 GMT]]></title><description><![CDATA[<p dir="auto">Do you have an image of what you are trying to achieve? If the goal is to have the different sized texts all "sitting on the same line", you should be able to use <em>anchors.baseline</em>.</p>
]]></description><link>https://forum.qt.io/post/83848</link><guid isPermaLink="true">https://forum.qt.io/post/83848</guid><dc:creator><![CDATA[mbrasser]]></dc:creator><pubDate>Tue, 12 Apr 2011 23:45:21 GMT</pubDate></item></channel></rss>