mirror of
https://github.com/LibreOffice/core.git
synced 2025-07-22 01:09:00 +00:00
tdf#130857 qt weld: Convert accelerators for check/radio buttons
Convert the accelerators between the Qt and VCL version as needed. In a WIP branch declaring support for the print dialog, this makes the correct text show up instead of a literal "~All Pages" for a radio button and "Page ba~ckground" for a checkbox. Change-Id: Ic73af5e654b00b4e6dae1d561465604c8e9b46c2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188038 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
This commit is contained in:
@ -40,13 +40,15 @@ TriState QtInstanceCheckButton::get_state() const
|
||||
void QtInstanceCheckButton::set_label(const OUString& rText)
|
||||
{
|
||||
SolarMutexGuard g;
|
||||
GetQtInstance().RunInMainThread([&] { m_pCheckBox->setText(toQString(rText)); });
|
||||
GetQtInstance().RunInMainThread(
|
||||
[&] { m_pCheckBox->setText(vclToQtStringWithAccelerator(rText)); });
|
||||
}
|
||||
OUString QtInstanceCheckButton::get_label() const
|
||||
{
|
||||
SolarMutexGuard g;
|
||||
OUString sLabel;
|
||||
GetQtInstance().RunInMainThread([&] { sLabel = toOUString(m_pCheckBox->text()); });
|
||||
GetQtInstance().RunInMainThread(
|
||||
[&] { sLabel = qtToVclStringWithAccelerator(m_pCheckBox->text()); });
|
||||
return sLabel;
|
||||
}
|
||||
|
||||
|
@ -37,13 +37,15 @@ bool QtInstanceRadioButton::get_active() const
|
||||
void QtInstanceRadioButton::set_label(const OUString& rText)
|
||||
{
|
||||
SolarMutexGuard g;
|
||||
GetQtInstance().RunInMainThread([&] { m_pRadioButton->setText(toQString(rText)); });
|
||||
GetQtInstance().RunInMainThread(
|
||||
[&] { m_pRadioButton->setText(vclToQtStringWithAccelerator(rText)); });
|
||||
}
|
||||
OUString QtInstanceRadioButton::get_label() const
|
||||
{
|
||||
SolarMutexGuard g;
|
||||
OUString sLabel;
|
||||
GetQtInstance().RunInMainThread([&] { sLabel = toOUString(m_pRadioButton->text()); });
|
||||
GetQtInstance().RunInMainThread(
|
||||
[&] { sLabel = qtToVclStringWithAccelerator(m_pRadioButton->text()); });
|
||||
return sLabel;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user