<table><tr><td style="">rkflx planned changes to this revision.<br />rkflx added a comment.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D7164" rel="noreferrer">View Revision</a></tr></table><br /><div><div><p>Thanks for looking at this so quickly, Christoph! I believe you inspired me to find a good solution. I'll submit updates over the weekend.</p>

<p>If you are interested in the backstory, read on:</p>

<blockquote style="border-left: 3px solid #a7b5bf; color: #464c5c; font-style: italic; margin: 4px 0 12px 0; padding: 4px 12px; background-color: #f8f9fc;"><p>I probably miss the big picture here. Why are these attributes needed? The lineWidth attribute, for example, looks like a thing from the past, where you could control the thickness of frames (CDE vs. Motif style).</p></blockquote>

<p>These are public API of <tt style="background: #ebebeb; font-size: 13px;">KSqueezedLabel</tt> (via <tt style="background: #ebebeb; font-size: 13px;">QLabel</tt>), thus any bug in them should be fixed. The main motivation was <a href="https://phabricator.kde.org/D6696#130719" style="background-color: #e7e7e7;
          border-color: #e7e7e7;
          border-radius: 3px;
          padding: 0 4px;
          font-weight: bold;
          color: black;text-decoration: none;" rel="noreferrer">D6696#130719</a> for <tt style="background: #ebebeb; font-size: 13px;">setMargin</tt>, but I don't see a reason why we should leave the rest buggy if the fix is just the same.</p>

<blockquote style="border-left: 3px solid #a7b5bf; color: #464c5c; font-style: italic; margin: 4px 0 12px 0; padding: 4px 12px; background-color: #f8f9fc;"><p>QLabel sends out a QEvent::ContentsRectChange event when the margins change or the frame style causes a size change. Could this be catched (using an event filter) instead of reimplementing the properties?</p></blockquote>

<p>My first reaction was: "Sadly there is no such event to be observed.", because that's what I concluded in <a href="https://phabricator.kde.org/D7164#134363" style="background-color: #e7e7e7;
          border-color: #e7e7e7;
          border-radius: 3px;
          padding: 0 4px;
          font-weight: bold;
          color: black;text-decoration: none;" rel="noreferrer">D7164#134363</a> and observed again today (e.g. for <tt style="background: #ebebeb; font-size: 13px;">setMargin</tt>, <tt style="background: #ebebeb; font-size: 13px;">KSqueezedTextLabel::resizeEvent</tt> was never called, so the duplication of <tt style="background: #ebebeb; font-size: 13px;">squeezeTextToLabel</tt> in <tt style="background: #ebebeb; font-size: 13px;">setMargin</tt> was needed). Then I thought: "Surely, such behaviour must be a bug in Qt." (¹). After playing around some more, I now think the issue is just a misunderstanding in the autotests (see <a href="https://phabricator.kde.org/D7163" style="background-color: #e7e7e7;
          border-color: #e7e7e7;
          border-radius: 3px;
          padding: 0 4px;
          font-weight: bold;
          color: black;text-decoration: none;" rel="noreferrer">D7163</a>): If I remove <tt style="background: #ebebeb; font-size: 13px;">squeezeTextToLabel</tt> from <tt style="background: #ebebeb; font-size: 13px;">setMargin</tt>, then</p>

<div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="text" data-sigil="remarkup-code-block"><pre class="remarkup-code" style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; padding: 12px; margin: 0; background: rgba(71, 87, 120, 0.08);">label->setProperty(attribute.toLatin1().data(), amount);
QVERIFY(label->isSqueezed());</pre></div>

<p>fails for <tt style="background: #ebebeb; font-size: 13px;">ksqueezedtextlabelautotest testChrome:margin</tt>, while</p>

<div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="text" data-sigil="remarkup-code-block"><pre class="remarkup-code" style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; padding: 12px; margin: 0; background: rgba(71, 87, 120, 0.08);">label->setProperty(attribute.toLatin1().data(), amount);
QTest::qWaitForWindowExposed(label);
QVERIFY(label->isSqueezed());</pre></div>

<p>passes. This means I can rip out all three property reimplementations (²) and we should be good to go (³). Next challenge: Finding a new reviewer for <a href="https://phabricator.kde.org/D6696" style="background-color: #e7e7e7;
          border-color: #e7e7e7;
          border-radius: 3px;
          padding: 0 4px;
          font-weight: bold;
          color: black;text-decoration: none;" rel="noreferrer">D6696</a>.</p>

<hr class="remarkup-hr" />

<p>(¹) E.g. there's a difference between <tt style="background: #ebebeb; font-size: 13px;">setMargin</tt> and <tt style="background: #ebebeb; font-size: 13px;">setContentsMargin</tt>: The former is between text and (Q)frame aka "inside", the latter is between (Q)frame and the surrounding widgets aka "outside". I suspected both behaved differently regarding event emission.</p>

<p>(²) Now not needed anymore, but I'm curious anyway: Do you know of any tool available to help check BC automatically?</p>

<p>(³) I'll also change <tt style="background: #ebebeb; font-size: 13px;">contentsRect</tt> to be public (it's a reimplementation of a public function, after all) and update the <tt style="background: #ebebeb; font-size: 13px;">@since</tt> to 5.39.</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R236 KWidgetsAddons</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D7164" rel="noreferrer">https://phabricator.kde.org/D7164</a></div></div><br /><div><strong>To: </strong>rkflx, Frameworks, cfeck<br /><strong>Cc: </strong>cfeck, dhaumann<br /></div>