QTabWidget: Tab Bar white space double click create new tab ?
Unsolved
General and Desktop
-
Like web browser operation
[signal] void QTabWidget::tabBarDoubleClicked(int index)
This signal is emitted when the user double clicks on a tab at an index.
index is the index of a clicked tab, or -1 if no tab is under the cursor.
No tab is under the cursor double clicks doesn't emit signal!connect(ui->tabWidget,SIGNAL(tabBarDoubleClicked(int)),this,SLOT(tabBarDoubleClick(int))); void MainWindow::tabBarDoubleClick(int index) { qDebug() << "tab" << index; if(index==-1){ newTab(); } }
-
Hi
You can subclass QTabWidget and see if mousePressed Events is triggered there
or use event filter to catch it and perform the wanted function.