1
votes

I want that user could rename tabs: clicking on current tab label should turn on editable mode. The only way I can see is to use stacked layout + scrollarea + custom widgets + stackedwidget. Can I do it with standard QTabWidget?

And one more question. Can I create custom pseudo states (like predefined :hover, :selected etc)?

1

1 Answers

0
votes
  1. You can reimplement QTabWidget to get access to QTabBar and use QTabBar::setTabButton method. But sometimes it is difficult to adjust position of inserted widgets ;)
  2. You can't create custom states, but you can use custom properties. See Q_PROPERTY macro and related QSS syntax. Note, that styles will not updated on property change, so you should manually call polish/unpolish to force widget to use QSS.