QTabWidget & co.
-
Hi all,
I do not understand my mistake here ..
@void QMyTabWidget::mousePressEvent(QMouseEvent *event)
{
QString str = "Mousebutton ";
int clickpos = -1; // for later use
switch (event->button())
{
case Qt::LeftButton:
str += " LEFT ";
break;
case Qt::RightButton:
str += " RIGHT ";
break;
default:
str += " unbekannt ";
break;
}
qDebug() << " pressed";
qDebug() << "Tab " << clickpos << " clicked"; // for later use
}
@
In this eventHandler i only get right - clicks .. which produce debug text.
but no Tab changeing ..Left clicks change the Tab, but i got no text ..
Please help!!!
Any Questions ?? .. call me !!
-
Hi,
mousePresseEvent is an event handler not a filter.
The documentation contains a good example "here":http://qt-project.org/doc/qt-5/qobject.html#eventFilter
Like frederik said, you should apply the filter on the QTabBar, not the QTabWidget