Well, I *think* that the last (non-"end") statement of your function should be Qt::TabWidget::mousePressEvent(event).
But what exactly do you mean by "doesn't work"?
Well, I *think* that the last (non-"end") statement of your function should be Qt::TabWidget::mousePressEvent(event).
But what exactly do you mean by "doesn't work"?
By doesn't work i mean that it acts like I wouldn't change anything at all: tab widget reacts as it is supposed to to the left mouse button, but no reaction whatsoever when I use the right one.
The "Qt::TabWidget::mousePressEvent(event)" statement won't work, in fact it prevents whole program from running. Probably you ment something else but Ruby syntax made it incorrect, if so please write what the statement you suggested would look like in C++ or whatever language you use.
And now I realized that I don't call the original function in that posted code, I've changed it already but still no difference. I believe that I must change 'mousePressEvent' in some other widget, but still don't now in which one.
What I meant was the following, given in C++:
Qt Code:
{ if (event->button() == Qt::RightButton) { ... } }To copy to clipboard, switch view to plain text mode
emka (29th August 2010)
Yes, of course you are right, that's not the problem though. Still, thanks for that hint.
But I figured it out: the mousePressEvent had to be changed not in QTabWidget, but in QTabBar. So I had to make my own child class from QTabBar and reimplement that method there.
Urthas (29th August 2010)
Bookmarks