@Nathaniel said in QTabBar-like list of "x-clickable" buttons?:
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.
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.
Is there a 3rd party library that might have such as QLabel subclass implemented already?
I’d look for an existing Qt chip or tag widget with a close button, or use a custom widget if no suitable library is available.