drag tab from QTabBar



  • Hello Community,

    I am trying to drag/drop a tab from a QTabBar. I am subclassing QTabBar but I can't find how to access each single tab in the bar ...
    I think that's the only thing I need is : get the tab under the cursor (hopefully it will be a widget ?) so I can generate a pixmap from it and attach it to the drag.

    How could I get this tab (widget ?) if I am going in the right direction...
    I want the tab from the QTabBar not from the QTabWidget

    Thank you very much for any info !


  • Qt Champions 2016

    Hi
    If you look at
    https://github.com/openwebos/qt/blob/master/src/gui/widgets/qtabbar.cpp

    line 1531
    void QTabBar::paintEvent(QPaintEvent *)

    it seems that it uses
    p.drawControl(QStyle::CE_TabBarTab, tab);

    So its not widgets. Its drawn. It seems.

    But, you can use same call to make your own image as drag image if u need.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.