[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#339357: libqt4-dev: a simple test



Artur Wiebe <wibix@gmx.de> writes:

> No, I could not find anything. I've just played around with this: A
> QTreeWidget with setContextMenuPolicy(Qt::CustomContextMenu) and the signal
> customContextMenuRequested(const QPoint&) connected to a my_slot(const
> QPoint&) which looks like
>
> void myView::my_slot(const QPoint& pos)
> {
>     QMenu popup(this);
>
>     popup.addAction("test 1");
>     popup.addAction("test 2");
>     popup.addAction("test 3");
>
>     //QAction* retval = popup.exec(m_tw->mapToGlobal(pos));
>     QAction* retval = popup.exec(QCursor::pos());
>     qDebug() << retval;
> }
>
> This works. The commented out version does not. It opens a popup but
> clicking left outside the menu returns not 0.

Well, I just looked over the QMenu code to try to see what could be
happening here, but nothing obvious stood out.

Would you like to file a bug upstream and see if the trolls can figure
it out?

-- 
Captain Logic is not steering this tugboat.



Reply to: