<?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[QTabBar-like list of &quot;x-clickable&quot; buttons?]]></title><description><![CDATA[<p dir="auto">There's a common pattern in web UIs where they show a list of items via "buttons" (more precisely, "labels" in the Qt sense because the widget as a whole is not clickable) with a small, clickable "x" in the top-left corner.  Clicking on the "x" removes the label from the list.  The label is usually in a flat-button style with a thin border.  In Qt, one might add labels to the list by choosing from a QComboBox.</p>
<p dir="auto">As far as I know, Qt has no native buttons/labels with this kind of functionality.  However, it is similar to how QTabBar works with tabsClosable set to true.   So maybe a list of such buttons could be implemented via an ordinary QTabBar and changing the styling.  However, this is obviously an atypical use of QTabBar and it might take a lot of work to get the style right so it doesn't confuse the user; there's no QStackWidget being controlled by the tab bar.</p>
<p dir="auto">Is  there a 3rd party library that might have such as QLabel subclass implemented already?</p>
]]></description><link>https://forum.qt.io/topic/165094/qtabbar-like-list-of-x-clickable-buttons</link><generator>RSS for Node</generator><lastBuildDate>Mon, 21 Sep 2026 21:06:39 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/165094.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 15 Sep 2026 19:25:08 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to QTabBar-like list of &quot;x-clickable&quot; buttons? on Wed, 16 Sep 2026 16:54:06 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/igkh">@<bdi>IgKh</bdi></a> said in <a href="/post/840168">QTabBar-like list of "x-clickable" buttons?</a>:</p>
<blockquote>
<p dir="auto">adding a tag is to type it and hit return</p>
</blockquote>
<p dir="auto">Fair enough.  I think different from what I took from the OP's description.  At least I understand.</p>
<p dir="auto">(I get it now.  Your "Tags Input" is those adding a bunch of tags to a topic by typing in words on little "cards", and "x" to delete one.)</p>
]]></description><link>https://forum.qt.io/post/840169</link><guid isPermaLink="true">https://forum.qt.io/post/840169</guid><dc:creator><![CDATA[JonB]]></dc:creator><pubDate>Wed, 16 Sep 2026 16:54:06 GMT</pubDate></item><item><title><![CDATA[Reply to QTabBar-like list of &quot;x-clickable&quot; buttons? on Wed, 16 Sep 2026 16:46:19 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jonb">@<bdi>JonB</bdi></a> A text edit (often with a completer and/or a combo box style drop down menu) is a typical part of such a component, as the UX for adding a tag is to type it and hit return. You can see a live example like <a href="https://www.chakra-ui.com/docs/components/tags-input" target="_blank" rel="noopener noreferrer nofollow ugc">https://www.chakra-ui.com/docs/components/tags-input</a>.</p>
]]></description><link>https://forum.qt.io/post/840168</link><guid isPermaLink="true">https://forum.qt.io/post/840168</guid><dc:creator><![CDATA[IgKh]]></dc:creator><pubDate>Wed, 16 Sep 2026 16:46:19 GMT</pubDate></item><item><title><![CDATA[Reply to QTabBar-like list of &quot;x-clickable&quot; buttons? on Wed, 16 Sep 2026 16:31:09 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/igkh">@<bdi>IgKh</bdi></a><br />
I know nothing about this.  Ooi why do you want a <code>QLineEdit</code>, which is ostensibly for text input, rather than a <code>QLabel</code>?</p>
]]></description><link>https://forum.qt.io/post/840167</link><guid isPermaLink="true">https://forum.qt.io/post/840167</guid><dc:creator><![CDATA[JonB]]></dc:creator><pubDate>Wed, 16 Sep 2026 16:31:09 GMT</pubDate></item><item><title><![CDATA[Reply to QTabBar-like list of &quot;x-clickable&quot; buttons? on Wed, 16 Sep 2026 16:04:07 GMT]]></title><description><![CDATA[<p dir="auto">The common name for the kind of component you describe is a "Tags Input". Just so you can more easily search for it. A quick search finds some previous efforts to build one for Qt Widgets.</p>
<p dir="auto">If I had to do something like this myself, the initial approach I would have taken is to subclass <code>QLineEdit</code> and override the <code>paintEvent</code> to draw the tag pills in a margin (the margins are customizable). A rectangle with an X and a  little bit of text is relatively easy to draw yourself with the <code>QPainter</code> API, there is no need to reach for QLabel. Detecting clicks can be done in an override of mouse down events. You can go fancy with making the backspace key work deleting tags when at the beginning of the line edit area, and what not.</p>
]]></description><link>https://forum.qt.io/post/840165</link><guid isPermaLink="true">https://forum.qt.io/post/840165</guid><dc:creator><![CDATA[IgKh]]></dc:creator><pubDate>Wed, 16 Sep 2026 16:04:07 GMT</pubDate></item></channel></rss>