29 |
30 |
30 if (widget->whatsThis() != NULL) |
31 if (widget->whatsThis() != NULL) |
31 abstractpage->setButtonDescription(widget->whatsThis()); |
32 abstractpage->setButtonDescription(widget->whatsThis()); |
32 else if (widget->toolTip() != NULL) |
33 else if (widget->toolTip() != NULL) |
33 abstractpage->setButtonDescription(widget->toolTip()); |
34 abstractpage->setButtonDescription(widget->toolTip()); |
|
35 } |
|
36 else if (event->type() == QEvent::FocusIn) |
|
37 { |
|
38 abstractpage = qobject_cast<AbstractPage*>(ui->Pages->currentWidget()); |
34 |
39 |
35 // play a sound when mouse hovers certain ui elements |
40 // play a sound when mouse hovers certain ui elements |
36 QPushButton * button = dynamic_cast<QPushButton*>(dist); |
41 QPushButton * button = dynamic_cast<QPushButton*>(dist); |
37 QLineEdit * textfield = dynamic_cast<QLineEdit*>(dist); |
42 QLineEdit * textfield = dynamic_cast<QLineEdit*>(dist); |
38 QCheckBox * checkbox = dynamic_cast<QCheckBox*>(dist); |
43 QCheckBox * checkbox = dynamic_cast<QCheckBox*>(dist); |
39 QComboBox * droplist = dynamic_cast<QComboBox*>(dist); |
44 QComboBox * droplist = dynamic_cast<QComboBox*>(dist); |
40 QSlider * slider = dynamic_cast<QSlider*>(dist); |
45 QSlider * slider = dynamic_cast<QSlider*>(dist); |
41 QTabWidget * tab = dynamic_cast<QTabWidget*>(dist); |
46 QTabWidget * tab = dynamic_cast<QTabWidget*>(dist); |
42 if (button || textfield || checkbox || droplist || slider || tab) |
47 QListView * listview = dynamic_cast<QListView*>(dist); |
|
48 if (button || textfield || checkbox || droplist || slider || tab || listview) |
43 { |
49 { |
44 SDLInteraction::instance().playSoundFile("/Sounds/steps.ogg"); |
50 SDLInteraction::instance().playSoundFile("/Sounds/steps.ogg"); |
45 } |
51 } |
46 |
52 |
47 return true; |
53 return true; |
48 } |
54 } |
49 else if (event->type() == QEvent::Leave) |
55 else if (event->type() == QEvent::Leave) |
50 { |
56 { |
51 abstractpage = qobject_cast<AbstractPage*>(ui->Pages->currentWidget()); |
57 abstractpage = qobject_cast<AbstractPage*>(ui->Pages->currentWidget()); |
52 |
58 |
53 if (abstractpage->getDefautDescription() != NULL) |
59 if (abstractpage->getDefaultDescription() != NULL) |
54 { |
60 { |
55 abstractpage->setButtonDescription( * abstractpage->getDefautDescription()); |
61 abstractpage->setButtonDescription( * abstractpage->getDefaultDescription()); |
56 } |
62 } |
57 else |
63 else |
58 abstractpage->setButtonDescription(""); |
64 abstractpage->setButtonDescription(""); |
59 } |
65 } |
60 |
66 |