1

I want to create a Qt widget that looks like a QTabWidget but where the list of tabs is drawn from a (Qt Model View architecture) data model, like QListView etc. Since QTabWidget has to have separate widgets on each page, this will probably be something like a QTabBar and a single set of widgets under it (eg some buttons and a QTreeView).

  • Can QTabBar get its list of tabs from a data model? I'm pretty sure not.
  • Is there an equivalent widget that can?
  • Can you for example make a QListView with flow=LeftToRight look like a tab bar?

Using Qt4 at the moment. Will consider Qt5.

I'm using PyQt but C++ examples would be fine.

eyllanesc
  • 235,170
  • 19
  • 170
  • 241
Joe P
  • 466
  • 3
  • 8
  • Surprisingly little of QtGui is model driven, which is unfortunate, because that solution is much more flexible, cleaner and easier to maintain. You can easily make your own GUI element versions, thou it will take a while to refine them. My GUI is almost entirely model driven, although I use QML where development speed is much faster. – dtech Sep 15 '17 at 00:02

0 Answers0