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:
parent
26f6648421
commit
f3ffac0058
|
@ -75,6 +75,9 @@ void MappingDouble::Update()
|
||||||
MappingBool::MappingBool(MappingWidget* parent, ControllerEmu::NumericSetting<bool>* setting)
|
MappingBool::MappingBool(MappingWidget* parent, ControllerEmu::NumericSetting<bool>* setting)
|
||||||
: QCheckBox(parent), m_setting(*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) {
|
connect(this, &QCheckBox::stateChanged, this, [this, parent](int value) {
|
||||||
m_setting.SetValue(value != 0);
|
m_setting.SetValue(value != 0);
|
||||||
ConfigChanged();
|
ConfigChanged();
|
||||||
|
|
Loading…
Reference in New Issue