QContextMenu in an embeded widget
I embed a widget(using QGraphicsProxyWidget) inside a QGraphicsItem and arranged my items to a scene and they are about 10 pixels apart, now My widgets has QContextMenu in it i noticed that when i show my context menu in a particular widget it is shown at the back of the nieghboring widget. I don't like it to be this way , since its a pop up menu it should be painted on top of everything in its way.
Can someone help me with my goal? maybe i miss something in embedding my widget
here a snippet of the constructor
Code:
RoundRectItem
::RoundRectItem(const QRectF &rect,
const QBrush &brush,GraphicsView
*graphWidget,
QWidget *embeddedWidget
) m_graph(graphWidget),
m_brush(brush),
m_opacity(50),
m_proxyWidget(0)
{
setFlag(ItemIsMovable);
setCacheMode(DeviceCoordinateCache);
setZValue(3);
if (embeddedWidget)
{
m_proxyWidget = new QGraphicsProxyWidget(this);
m_proxyWidget->setWidget(embeddedWidget);
m_proxyWidget->setZValue(zValue()+1);
setRect(embeddedWidget->rect());
}
}
baray98
Re: QContextMenu in an embeded widget
Here's a small test case the reproduce the problem:
Code:
#include <QtGui>
int main(int argc, char* argv[])
{
scene.
addWidget(new QTextEdit)->moveBy
(50,
50);
view.show();
return app.exec();
}
I'd report it as a bug to the Task Tracker.