work around a bug in QGraphicsProxyWidget where, for whatever reason, the line edit isn't getting a focusInEvent when the QGraphicsProxyWidget does. normally i don't like working around bugs like this, but QGraphicsView seems to be bitrotting.
CCMAIL:menard@kde.org svn path=/trunk/KDE/kdelibs/; revision=1175309
This commit is contained in:
parent
48b1b36fa0
commit
e4c6d2e92b
@ -19,6 +19,7 @@
|
||||
|
||||
#include "lineedit.h"
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include <QPainter>
|
||||
#include <QIcon>
|
||||
#include <QGraphicsSceneResizeEvent>
|
||||
@ -205,6 +206,15 @@ void LineEdit::mousePressEvent(QGraphicsSceneMouseEvent *event)
|
||||
QGraphicsProxyWidget::mousePressEvent(event);
|
||||
}
|
||||
|
||||
void LineEdit::focusInEvent(QFocusEvent *event)
|
||||
{
|
||||
QGraphicsProxyWidget::focusInEvent(event);
|
||||
if (!nativeWidget()->hasFocus()) {
|
||||
// as of Qt 4.7, apparently we have a bug here in QGraphicsProxyWidget
|
||||
QCoreApplication::sendEvent(nativeWidget(), event);
|
||||
}
|
||||
}
|
||||
|
||||
void LineEdit::focusOutEvent(QFocusEvent *event)
|
||||
{
|
||||
QGraphicsWidget *widget = parentWidget();
|
||||
|
@ -120,6 +120,7 @@ protected:
|
||||
void changeEvent(QEvent *event);
|
||||
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
|
||||
void mousePressEvent(QGraphicsSceneMouseEvent *event);
|
||||
void focusInEvent(QFocusEvent *event);
|
||||
void focusOutEvent(QFocusEvent *event);
|
||||
|
||||
Q_SIGNALS:
|
||||
|
Loading…
Reference in New Issue
Block a user