diff options
author | Jan-Marek Glogowski <glogow@fbihome.de> | 2021-04-11 14:05:59 +0200 |
---|---|---|
committer | Jan-Marek Glogowski <glogow@fbihome.de> | 2021-04-14 14:35:38 +0200 |
commit | dbdc0475097210ec88f1e867b4464fdcd17a5d37 (patch) | |
tree | 4106d1a4fa3011c3c46a9911b12e33c346e17fde /vcl/qt5 | |
parent | ec1e3977cad824da6017fe150d55c262cd68dccd (diff) |
Qt add additional info to ToolkitName
Adds the used font backend and the QPA platform name, so we don't
need to ask / verify all time (and less chance of wrong info).
Examples:
- qt5 (qfont+xcb) => QFont text rendering + X11 backend
- kf5 (cairo+wayland) => Cairo text rendering + Wayland backend
Change-Id: I1102dd6d83b0ed48318ac5c31c8ca09d4fdd73eb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113945
Tested-by: Jenkins
Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
Diffstat (limited to 'vcl/qt5')
-rw-r--r-- | vcl/qt5/Qt5Instance.cxx | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/vcl/qt5/Qt5Instance.cxx b/vcl/qt5/Qt5Instance.cxx index 5afbd8722418..3ea129b8aeea 100644 --- a/vcl/qt5/Qt5Instance.cxx +++ b/vcl/qt5/Qt5Instance.cxx @@ -196,6 +196,17 @@ void Qt5Instance::RunInMainThread(std::function<void()> func) } } +OUString Qt5Instance::constructToolkitID(std::u16string_view sTKname) +{ + OUString sID(sTKname + OUStringLiteral(u" (")); + if (m_bUseCairo) + sID += OUStringLiteral(u"cairo+"); + else + sID += OUStringLiteral(u"qfont+"); + sID += toOUString(QGuiApplication::platformName()) + OUStringLiteral(u")"); + return sID; +} + Qt5Instance::Qt5Instance(std::unique_ptr<QApplication>& pQApp, bool bUseCairo) : SalGenericInstance(std::make_unique<Qt5YieldMutex>()) , m_bUseCairo(bUseCairo) @@ -206,10 +217,7 @@ Qt5Instance::Qt5Instance(std::unique_ptr<QApplication>& pQApp, bool bUseCairo) , m_bUpdateFonts(false) { ImplSVData* pSVData = ImplGetSVData(); - if (bUseCairo) - pSVData->maAppData.mxToolkitName = OUString("qt5+cairo"); - else - pSVData->maAppData.mxToolkitName = OUString("qt5"); + pSVData->maAppData.mxToolkitName = constructToolkitID(u"qt5"); // this one needs to be blocking, so that the handling in main thread // is processed before the thread emitting the signal continues |