<?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[QComboBox returns incorrect rect on Mac]]></title><description><![CDATA[<p dir="auto">I am doing some custom painting inside a QComboBox. I call QComboBox::rect() to get the area to paint into inside paintEvent() in my derived class. This works fine on Windows. But is incorrect on Mac.</p>
<p dir="auto">What I want:</p>
<p dir="auto"><img src="https://ddgobkiprc33d.cloudfront.net/07843ca0-597a-465d-8e5a-244da3feaa10.png" alt="0_1555067656190_2019-04-12_12-11-21.png" class=" img-fluid img-markdown" /><br />
What I get painting inside QComboBox::rect():</p>
<p dir="auto"><img src="https://ddgobkiprc33d.cloudfront.net/efc4feb9-fb75-4d85-93ea-4f38480c8e5b.png" alt="0_1555067663931_2019-04-12_12-12-33.png" class=" img-fluid img-markdown" /><br />
The QRect returned is 30 pixels high, but the actual QComboBox is only 20 pixels high. I can adjust the QRect by a few pixels to get the correct area, but I am worried this fudge won't work on all versions of macOS (past and present). Is there a reliable way get the QRect?</p>
<p dir="auto">I use a QItemDelegate to paint the customized drop-down menu for the QComboBox and that works fine (QStyleOptionViewItem::rect is correct). But there doesn't seem to be  way to use the delegate to paint the unclicked state.</p>
<p dir="auto"><img src="https://ddgobkiprc33d.cloudfront.net/0f252879-224c-42a1-80d2-f9334e610cf3.png" alt="0_1555068032595_2019-04-12_12-19-15.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">Any ideas?</p>
<p dir="auto">--<br />
Andy Brice<br />
<a href="http://www.hyperplan.com" target="_blank" rel="noopener noreferrer nofollow ugc">http://www.hyperplan.com</a></p>
]]></description><link>https://forum.qt.io/topic/101718/qcombobox-returns-incorrect-rect-on-mac</link><generator>RSS for Node</generator><lastBuildDate>Sun, 03 May 2026 16:47:10 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/101718.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 12 Apr 2019 11:21:33 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to QComboBox returns incorrect rect on Mac on Mon, 15 Apr 2019 21:40:02 GMT]]></title><description><![CDATA[<p dir="auto">Did you check with a more recent version ?</p>
]]></description><link>https://forum.qt.io/post/523195</link><guid isPermaLink="true">https://forum.qt.io/post/523195</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Mon, 15 Apr 2019 21:40:02 GMT</pubDate></item><item><title><![CDATA[Reply to QComboBox returns incorrect rect on Mac on Sun, 14 Apr 2019 21:50:27 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sgaist">@<bdi>SGaist</bdi></a> I am using Qt 5.12.0 on Mac.</p>
]]></description><link>https://forum.qt.io/post/522995</link><guid isPermaLink="true">https://forum.qt.io/post/522995</guid><dc:creator><![CDATA[AndyBrice]]></dc:creator><pubDate>Sun, 14 Apr 2019 21:50:27 GMT</pubDate></item><item><title><![CDATA[Reply to QComboBox returns incorrect rect on Mac on Fri, 12 Apr 2019 20:42:49 GMT]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">What version of Qt are you using ?</p>
]]></description><link>https://forum.qt.io/post/522823</link><guid isPermaLink="true">https://forum.qt.io/post/522823</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Fri, 12 Apr 2019 20:42:49 GMT</pubDate></item><item><title><![CDATA[Reply to QComboBox returns incorrect rect on Mac on Fri, 12 Apr 2019 11:27:48 GMT]]></title><description><![CDATA[<p dir="auto">It might be related to high DPI. I am on a Mac Retina display.</p>
<p dir="auto">--<br />
Andy Brice<br />
<a href="http://www.hyperplan.com" target="_blank" rel="noopener noreferrer nofollow ugc">http://www.hyperplan.com</a></p>
]]></description><link>https://forum.qt.io/post/522708</link><guid isPermaLink="true">https://forum.qt.io/post/522708</guid><dc:creator><![CDATA[AndyBrice]]></dc:creator><pubDate>Fri, 12 Apr 2019 11:27:48 GMT</pubDate></item><item><title><![CDATA[Reply to QComboBox returns incorrect rect on Mac on Fri, 12 Apr 2019 11:25:35 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/andybrice">@<bdi>AndyBrice</bdi></a> Just an idea: could it be related to High DPI scaling?</p>
]]></description><link>https://forum.qt.io/post/522706</link><guid isPermaLink="true">https://forum.qt.io/post/522706</guid><dc:creator><![CDATA[jsulm]]></dc:creator><pubDate>Fri, 12 Apr 2019 11:25:35 GMT</pubDate></item></channel></rss>