[Bug 260882] Sometimes the textfield of the composer vanishes. (A central widget is lost or not created.)
Andreas Holzammer
andreas.holzammer at kdab.com
Tue Jan 18 15:22:51 GMT 2011
https://bugs.kde.org/show_bug.cgi?id=260882
Andreas Holzammer <andreas.holzammer at kdab.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
--- Comment #4 from Andreas Holzammer <andreas holzammer kdab com> 2011-01-18 16:22:50 ---
commit 63c9088c79a87ccb8a6a24e71851002aea345f11
branch master
Author: Andreas Holzammer <andreas.holzammer at kdab.com>
Date: Tue Jan 18 16:19:52 2011 +0100
fix that widgets get lost
It seems that widgets get a setVisiable(false) from somewhere in qt,
to fix this issue we revert its hiding. This should be fixed in qt.
But i didnt found where it is called.
BUG:260882
diff --git a/mobile/lib/declarativewidgetbase.cpp
b/mobile/lib/declarativewidgetbase.cpp
index 6ba5a75..65f25b4 100644
--- a/mobile/lib/declarativewidgetbase.cpp
+++ b/mobile/lib/declarativewidgetbase.cpp
@@ -24,6 +24,19 @@
#include <QtGui/QGraphicsScene>
#include <QtGui/QWidget>
+#ifdef _WIN32_WCE
+bool DeclarativeWidgetBaseHelper::eventFilter(QObject *obj, QEvent *event)
+{
+ if (event->type() == QEvent::Hide) {
+ QWidget *wid = static_cast<QWidget *>(obj);
+ wid->show();
+ qDebug("Ate hide event");
+ }
+
+ return QObject::eventFilter(obj, event);
+}
+#endif
+
DeclarativeWidgetBaseHelper::DeclarativeWidgetBaseHelper( QWidget * widget,
QGraphicsItem * parent, const RegisterFunction & registerFunc )
: QGraphicsProxyWidget( parent ),
m_registerFunc( registerFunc ),
@@ -37,9 +50,17 @@ DeclarativeWidgetBaseHelper::DeclarativeWidgetBaseHelper(
QWidget * widget, QGra
StyleSheetLoader::applyStyle( m_widget );
setWidget( m_widget );
setFocusPolicy( Qt::StrongFocus );
+#ifdef _WIN32_WCE
+ m_widget->installEventFilter(this);
+#endif
}
-DeclarativeWidgetBaseHelper::~DeclarativeWidgetBaseHelper() {}
+DeclarativeWidgetBaseHelper::~DeclarativeWidgetBaseHelper()
+{
+#ifdef _WIN32_WCE
+ m_widget->removeEventFilter(this);
+#endif
+}
QVariant DeclarativeWidgetBaseHelper::itemChange( GraphicsItemChange change,
const QVariant & value )
{
diff --git a/mobile/lib/declarativewidgetbase.h
b/mobile/lib/declarativewidgetbase.h
index fee4a58..b849c12 100644
--- a/mobile/lib/declarativewidgetbase.h
+++ b/mobile/lib/declarativewidgetbase.h
@@ -43,6 +43,9 @@ protected:
protected:
/* reimp */ QVariant itemChange( GraphicsItemChange change, const QVariant
& value );
+#ifdef _WIN32_WCE
+ bool eventFilter(QObject *obj, QEvent *event);
+#endif
private:
const RegisterFunction m_registerFunc;
--
Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the Kdepim-bugs
mailing list