<?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[Styling of QLineEdit&#x2F;QListView child of QCombobox on hover]]></title><description><![CDATA[<p dir="auto">So I wanted a QComboBox with checkboxes and after seeing lots of problems with the normal implementation I found this when I searched<br />
<a href="https://stackoverflow.com/questions/8422760/combobox-of-checkboxes" target="_blank" rel="noopener noreferrer nofollow ugc">https://stackoverflow.com/questions/8422760/combobox-of-checkboxes</a></p>
<p dir="auto">Especially this code:<br />
<a href="https://gist.github.com/mistic100/c3b7f3eabc65309687153fe3e0a9a720" target="_blank" rel="noopener noreferrer nofollow ugc">https://gist.github.com/mistic100/c3b7f3eabc65309687153fe3e0a9a720</a></p>
<p dir="auto">However, this has some limitations I don't know if it's possible to work around with styling which also is an important part of my project making it look just like the other comboboxes.</p>
<p dir="auto">The problem is my comboboxes uses padding and a background color on hover.</p>
<pre><code>QLineEdit:hover { background-color: red; }
</code></pre>
<p dir="auto">This would only work when my mouse is over the lineEdit and not the padded area leaving the QLineEdit with a white background when it's not over the exact QLineEdit</p>
<p dir="auto">So coming from CSS (which is absolutely superior to Qts styling btw) I tried this:</p>
<pre><code>QComboBox:hover QLineEdit { background-color: red; }
</code></pre>
<p dir="auto">But no change.</p>
<p dir="auto">Is there even a solution?</p>
<p dir="auto">Another problem would be that the selection-background-color of "QComboBox QAbstractView" doesn't work with this solution above and I'm not using any custom styled delegates yet.</p>
<p dir="auto">Hope you understand where I'm getting at.</p>
]]></description><link>https://forum.qt.io/topic/116213/styling-of-qlineedit-qlistview-child-of-qcombobox-on-hover</link><generator>RSS for Node</generator><lastBuildDate>Sun, 07 Jun 2026 22:33:53 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/116213.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 23 Jun 2020 09:11:35 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Styling of QLineEdit&#x2F;QListView child of QCombobox on hover on Tue, 07 Jul 2020 11:45:05 GMT]]></title><description><![CDATA[<p dir="auto">@mikael-larsson<br />
Hi<br />
You could try an event filter on the Combobox and call the code for hover effect but<br />
if your effect is purely stylesheet  based then i think you then must send it fake hover event to trigger it or something like that.</p>
<p dir="auto">You might also be able to subclass the combo and rig the paintEvent with<br />
if (someflag)<br />
option.state |= QStyle::State_MouseOver;</p>
<p dir="auto">to trigger hover on command from the event filter/ or combo hover or how you plan to trigger it.</p>
]]></description><link>https://forum.qt.io/post/605240</link><guid isPermaLink="true">https://forum.qt.io/post/605240</guid><dc:creator><![CDATA[mrjj]]></dc:creator><pubDate>Tue, 07 Jul 2020 11:45:05 GMT</pubDate></item><item><title><![CDATA[Reply to Styling of QLineEdit&#x2F;QListView child of QCombobox on hover on Tue, 07 Jul 2020 09:48:41 GMT]]></title><description><![CDATA[<p dir="auto">Still looking for help with this if its even possible this is how it looks on hover right now.<br />
<img src="https://ddgobkiprc33d.cloudfront.net/0abfa6ea-0b07-4d71-92b2-4fd88704c348.png" alt="Styling.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">Even thinking about subclassing QLineEdit to force hover-effect but not sure how.</p>
]]></description><link>https://forum.qt.io/post/605227</link><guid isPermaLink="true">https://forum.qt.io/post/605227</guid><dc:creator><![CDATA[mikael.larsson]]></dc:creator><pubDate>Tue, 07 Jul 2020 09:48:41 GMT</pubDate></item></channel></rss>