Contex menu appear multiple times
Hey,
i have this issue:
i added contexmenu to qtreewidget
Code:
tree.setContextMenuPolicy(ContextMenuPolicy.CustomContextMenu);
tree.customContextMenuRequested.connect(this, "treeMenu(QPoint)");
....
private void treeMenu
(QPoint point
) {
... add some actions ...
menu.exec(ui.tree.mapToGlobal(point));
}
it works just fine but ..
if i right click on it it fires up 3 times,
so multiple times is the signal emitted.
How to deal with it and filter the signals or block ?
Greets,
Kubas
Re: Contex menu appear multiple times
another cause might be that you (maybe) connect 3 times to that signal; check that, too.
Re: Contex menu appear multiple times
You were right, i connected to it 3 times.
If i clicked, mouse sent 3 "click signals", and called this function
which made the connection.
Thanks very much :)
I wouldnt find it by my own :)
Greets,
Kubas