keyButton = new HWKeyButton(buttonGroup, hwKey,
QSize(GPC_KEYBUTTON_WIDTH, GPC_KEYBUTTON_HEIGHT));
- if (hwKey->getKeySequence().isEmpty() == false) {
- QString keySequence = hwKey->getKeySequence().toString();
+ QString tooltip = hwKey->getTooltip();
+ if (tooltip.isEmpty() == true) {
+ if (hwKey->getKeySequence().isEmpty() == false) {
+ tooltip = hwKey->getKeySequence().toString();
#ifdef CONFIG_DARWIN
- keySequence.replace(XML_QT_METAKEY_STRING, XML_QT_CTRLKEY_STRING);
+ tooltip.replace(XML_QT_METAKEY_STRING, XML_QT_CTRLKEY_STRING);
#endif
- keyButton->setToolTip(keySequence);
+ }
}
+ keyButton->setToolTip(tooltip);
layout->addWidget(keyButton);
}
<keyList>
<key name="Menu">
<keycode>169</keycode>
- <tooltip>Menu</tooltip>
<!-- shortcut: on MacOSX, "Ctrl" means not Command key but Control key -->
<shortcut>Ctrl+Shift+F6</shortcut>
</key>
<key name="Home">
<keycode>139</keycode>
- <tooltip>Home</tooltip>
<shortcut>Ctrl+Shift+F5</shortcut>
</key>
<key name="Back">
<keycode>158</keycode>
- <tooltip>Back</tooltip>
<shortcut>Esc</shortcut>
</key>
<key name="Power">
<keycode>116</keycode>
- <tooltip>Power</tooltip>
<shortcut>Ctrl+Shift+F7</shortcut>
</key>
<key name="Volume +">
<keycode>115</keycode>
- <tooltip>Volume +</tooltip>
<shortcut>Ctrl+Shift+]</shortcut>
</key>
<key name="Volume -">
<keycode>114</keycode>
- <tooltip>Volume -</tooltip>
<shortcut>Ctrl+Shift+[</shortcut>
</key>
</keyList>