[Qt-interest] QToolBox and MouseEvents
Darryl Campbell
dutter at gmail.com
Tue Nov 3 19:43:38 CET 2009
Hello,
I am using a QToolBox in my application and I have added a context menu
to it. When the mouse event is fired and I grab the widget at place that was
clicked I get a generic widget that doesn't know which index it is. I need
the index so that I can tell which tab the context menu needs to greate new
widgets on. Is there any way to get this information? I hope I'm just
missing something obvious. Here is a snippet.
bool MyClass::eventFilter(QObject *watched, QEvent *event)
{
<snip>
QMouseEvent *me = (QMouseEvent *)event;
QWidget *w = this->ui.toolBox->childAt(me->pos());
// w contains a QToolBoxButton which in turn has
// has an "indexInPage" attribute (this is what I want)
<snip>
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20091103/606d453b/attachment.html
More information about the Qt-interest-old
mailing list