
- #Vray scene converter not in right click menu code
- #Vray scene converter not in right click menu windows
ui, this connection is automatic if the name of the slot complies with the void on_() rule (See this), and the second connection is the one you show in the code.
#Vray scene converter not in right click menu code
The first connection is the one made by using QtDesigner that uses the uic tool to generate C++ code using the. It gets 2 impressions because the on_graphView_customContextMenuRequested slot is invoked 2 times since there are 2 connections.
#Vray scene converter not in right click menu windows
How do I convert my pos to global coordinates relative to the entire Windows and not only the graphicsview. The coordinates in pos are relative the graphview dimensions, therefore when I uncomment the menu.exec in the above code, the menu is shown in a wrong location. I'm drawing Qgraphicsitems on my scene, the on_graphView_customContextMenuRequested seems to be triggered even when I right click a drawn item and not only a blank space in the scene, how do I get it to trigger only for graphview, in areas with nothing on top (no overlay of item on scene). The qdebug string is printed twice on my console on each single right click, why does that happen? It is supposed to appear only once. ` void MainWindow::on_graphView_customContextMenuRequested(const QPoint &pos) QObject::connect(ui->graphView ,SIGNAL(customContextMenuRequested(const QPoint &)),this,SLOT(on_graphView_customContextMenuRequested(const QPoint &))) Īnd the slot function that is called to handle the menu: MainWindow::MainWindow(QWidget *parent) : Since I'm trying to show a drop down menu on right click but I can't get it to work I added a connect and custom slot. When I do a right click in the area of my graphics view nothing happens (which is the default behavior afaik). I created a graphics view using the designer in Qt creator.
