Qt: add tooltip to MappingBool

Tooltip code is identical to MappingDouble and the tooltips (UI description)
are present in the underlying setting object.
This commit is contained in:
Filoppi 2021-05-06 11:50:29 +03:00
parent 26f6648421
commit f3ffac0058
1 changed files with 3 additions and 0 deletions

View File

@ -75,6 +75,9 @@ void MappingDouble::Update()
MappingBool::MappingBool(MappingWidget* parent, ControllerEmu::NumericSetting<bool>* setting)
: QCheckBox(parent), m_setting(*setting)
{
if (const auto ui_description = m_setting.GetUIDescription())
setToolTip(tr(ui_description));
connect(this, &QCheckBox::stateChanged, this, [this, parent](int value) {
m_setting.SetValue(value != 0);
ConfigChanged();