20 { |
20 { |
21 } |
21 } |
22 |
22 |
23 bool MouseOverFilter::eventFilter( QObject *dist, QEvent *event ) |
23 bool MouseOverFilter::eventFilter( QObject *dist, QEvent *event ) |
24 { |
24 { |
25 if (event->type() == QEvent::FocusIn) |
25 if (event->type() == QEvent::Enter) |
26 { |
26 { |
27 QWidget * widget = dynamic_cast<QWidget*>(dist); |
27 QWidget * widget = dynamic_cast<QWidget*>(dist); |
28 |
28 |
29 abstractpage = qobject_cast<AbstractPage*>(ui->Pages->currentWidget()); |
29 abstractpage = qobject_cast<AbstractPage*>(ui->Pages->currentWidget()); |
30 |
30 |
31 if (widget->whatsThis() != NULL) |
31 if (widget->whatsThis() != NULL) |
32 abstractpage->setButtonDescription(widget->whatsThis()); |
32 abstractpage->setButtonDescription(widget->whatsThis()); |
33 else if (widget->toolTip() != NULL) |
33 else if (widget->toolTip() != NULL) |
34 abstractpage->setButtonDescription(widget->toolTip()); |
34 abstractpage->setButtonDescription(widget->toolTip()); |
|
35 } |
|
36 else if (event->type() == QEvent::FocusIn) |
|
37 { |
|
38 QWidget * widget = dynamic_cast<QWidget*>(dist); |
|
39 abstractpage = qobject_cast<AbstractPage*>(ui->Pages->currentWidget()); |
35 |
40 |
36 // play a sound when mouse hovers certain ui elements |
41 // play a sound when mouse hovers certain ui elements |
37 QPushButton * button = dynamic_cast<QPushButton*>(dist); |
42 QPushButton * button = dynamic_cast<QPushButton*>(dist); |
38 QLineEdit * textfield = dynamic_cast<QLineEdit*>(dist); |
43 QLineEdit * textfield = dynamic_cast<QLineEdit*>(dist); |
39 QCheckBox * checkbox = dynamic_cast<QCheckBox*>(dist); |
44 QCheckBox * checkbox = dynamic_cast<QCheckBox*>(dist); |