summaryrefslogtreecommitdiffstats
path: root/src/kernel/qapplication.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/kernel/qapplication.cpp')
-rw-r--r--src/kernel/qapplication.cpp37
1 files changed, 35 insertions, 2 deletions
diff --git a/src/kernel/qapplication.cpp b/src/kernel/qapplication.cpp
index 7296f4c..0478cf1 100644
--- a/src/kernel/qapplication.cpp
+++ b/src/kernel/qapplication.cpp
@@ -2557,6 +2557,21 @@ bool QApplication::event( QEvent *e )
return QObject::event(e);
}
+#define HOVER_SENSITIVE_WIDGET_SELECT if ( widget->inherits("QPushButton") \
+ || widget->inherits("QComboBox") \
+ || widget->inherits("QSpinWidget") \
+ || widget->inherits("QCheckBox") \
+ || widget->inherits("QRadioButton") \
+ || widget->inherits("QToolButton") \
+ || widget->inherits("QSlider") \
+ || widget->inherits("QScrollBar") \
+ || widget->inherits("QTabBar") \
+ || widget->inherits("QDockWindowHandle") \
+ || widget->inherits("QSplitterHandle") )
+
+#define FOCUS_SENSITIVE_WIDGET_SELECT if ( widget->inherits("QLineEdit") )
+#define FOCUS_SENSITIVE_PARENT_WIDGET_SELECT if ( widget->parentWidget() && widget->parentWidget()->inherits("QSpinWidget") )
+
/*!\internal
Helper function called by notify()
@@ -2579,10 +2594,28 @@ bool QApplication::internalNotify( QObject *receiver, QEvent * e)
QWidget *widget = (QWidget*)receiver;
// toggle HasMouse widget state on enter and leave
- if ( e->type() == QEvent::Enter || e->type() == QEvent::DragEnter )
+ if ( e->type() == QEvent::Enter || e->type() == QEvent::DragEnter ) {
widget->setWState( WState_HasMouse );
- else if ( e->type() == QEvent::Leave || e->type() == QEvent::DragLeave )
+ HOVER_SENSITIVE_WIDGET_SELECT {
+ widget->repaint(false);
+ }
+ }
+ else if ( e->type() == QEvent::Leave || e->type() == QEvent::DragLeave ) {
widget->clearWState( WState_HasMouse );
+ HOVER_SENSITIVE_WIDGET_SELECT {
+ widget->repaint(false);
+ }
+ }
+
+ // repaint information entry widgets on focus set/unset
+ if ( e->type() == QEvent::FocusIn || e->type() == QEvent::FocusOut ) {
+ FOCUS_SENSITIVE_WIDGET_SELECT {
+ widget->repaint(false);
+ }
+ FOCUS_SENSITIVE_PARENT_WIDGET_SELECT {
+ widget->parentWidget()->repaint(false);
+ }
+ }
// throw away any mouse-tracking-only mouse events
if ( e->type() == QEvent::MouseMove &&