Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. drag tab from QTabBar
Forum Updated to NodeBB v4.3 + New Features

drag tab from QTabBar

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 772 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • GofferG Offline
    GofferG Offline
    Goffer
    wrote on last edited by
    #1

    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 !

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by mrjj
      #2

      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.

      1 Reply Last reply
      2

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved