Hi,
I have qtabwidget with corner widget. I added QToolButton as corner widget.

Qt Code:
  1. btnMenu = new QToolButton(this);
  2. btnMenu->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
  3. btnMenu->setAutoRaise(true);
  4. btnMenu->setIcon(QIcon::fromTheme("tab-new"));
  5. btnMenu->setText(trUtf8("Pars"));
  6. btnMenu->setShortcut(QKeySequence::AddTab);
  7. btnMenu->setMenu(menu);
  8. btnMenu->setPopupMode(QToolButton::MenuButtonPopup);
  9. setCornerWidget(btnMenu,Qt::TopLeftCorner);
To copy to clipboard, switch view to plain text mode 

And I have "mouseRelaseEvent" for tabwidget like this:


Qt Code:
  1. void PTabWidget::mouseReleaseEvent(QMouseEvent *event)
  2. {
  3. if (event->button() == Qt::MidButton)
  4. {
  5. int index = tabBar()->tabAt(event->pos());
  6. if (index != -1)
  7. {
  8. this->removeTab(index);
  9. qDebug() << QString::number(index);
  10. return;
  11. }
  12. else
  13. {
  14. return;
  15. }
  16. }
  17.  
  18. PTabWidget::mouseReleaseEvent(event);
  19. }
To copy to clipboard, switch view to plain text mode 

When I click with mid-button to tabbar, the output is "The program has unexpectedly finished.". But when i remove the tool button, it works fine. Is it bug or I miss something ??

Sorry for my poor English.
Best regards.