{
qDebug("tab under mouse is %i", tabBar()->tabAt(event->pos()));
}
void OutputTabWidget::dragMoveEvent(QDragMoveEvent* event)
{
qDebug("tab under mouse is %i", tabBar()->tabAt(event->pos()));
}
To copy to clipboard, switch view to plain text mode
OutputTabWidget is a subclass of QTabWidget. The UI work was done in Designer (if you want me to post the code it generated I can), which would be where the TabPosition is set to South, mouseTracking is set to true, etc.
The debug output spits out the correct indexes for the tab under the cursor (during the drag) if the tabs are in the North position (if I change it in Designer).
Bookmarks