1

I have six different classes for different dock widget (for different content).

I tabify all these six in a "DockView" class, until here everything works without any problems.

Now my problem, i must have some icons on the tabified dock widgets. I've tried it with many things, but cant the icon on the tabs

Things i tried:

 this->setStyleSheet("QTabBar::tab 
    {width: 40px; height: 40px}"
    "::tab#gvResultsDock {background-image: url(" + resultsIcon + ")}"
    "QTabBar#gvResultsDock {background-image: url(" + resultsIcon + ")}"
    "QTabBar::tab#gvResultsDock {background-image: url(" + resultsIcon + ")}");

dockName->setWindowIcon(QIcon("iconPath"));

dockName->setTitleBarWidget(QToolButton[withIcon]);

I appreciate any help!

DockView, in red the tabs

"DockView" with tabifiedDockWidgets

EDIT Is it maybe possible, that I use a "standard" QTabWidget? I saw that there is already a function, where you can add a icon (QTabWidget::setTabIcon). If so, is there a way, that i can make the tabs movable and floatable like the DockWidgets (QDockWidget::setFeatures(...) ?


eyllanesc
  • 235,170
  • 19
  • 170
  • 241
erniberni
  • 313
  • 5
  • 17
  • My guess is that it is not possible out of the box. We re-wrote the functionality of dock widgets completely from scratch at my last job, and if I remember correctly, it was mostly because we had to have the dock, undock, close buttons as part of the tab header. – SteakOverflow Dec 06 '17 at 10:05
  • Thanks for your answer. Do you know, if there is something "similar" to tabified docks? Because I need this "DockView", where I can undock all the single tabs. – erniberni Dec 07 '17 at 06:23
  • Nope. As I said, we implemented it from scratch. Using only Widgets, TabViews and Drag and Drop – SteakOverflow Dec 07 '17 at 06:31
  • Hm, ok...I hope that I am able to do something like that too :D – erniberni Dec 07 '17 at 07:14

0 Answers0