[Qt-interest] QLineEdit embedded in GraphicsView does not accept pasting with mouse

Uwe Drechsel vym at InSilmaril.de
Thu Oct 15 10:32:42 CEST 2009


Hi,

On Linux one usuall can paste selected text with middle mouse button.
This still works for every dialog, just the LineEdit embedded in my
GraphicsView doesn't see it. The mouse event is noticed by the view
instead.

Any hints how to get pasting to work again?

Qt 4.5

In constructor:
    lineEdit=new QLineEdit;
    lineEdit->hide();
    QGraphicsProxyWidget *pw=scene()->addWidget (lineEdit);
    pw->setZValue (Z_LINEEDIT);


when activating:
    lineEdit->setText (bi->getHeading());
    QPoint p = mapTo (this,bo->getAbsPos().toPoint() );
    lineEdit->setGeometry(p.x(),p.y(),230,25);
    lineEdit->show();
    lineEdit->setFocus();
    lineEdit->grabKeyboard();

Thanks
Uwe



More information about the Qt-interest-old mailing list