summaryrefslogtreecommitdiff
path: root/vcl/qt5/Qt5Frame.cxx
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2019-06-22 02:25:24 +0200
committerJan-Marek Glogowski <glogow@fbihome.de>2019-06-22 19:28:12 +0200
commitab5f341efd144adb6b7d0e00fece76a2153acd10 (patch)
tree44f209fd16d851d8f9851ee8a8af1f8e1e904ca0 /vcl/qt5/Qt5Frame.cxx
parent4cbf5a4f666ac4d7b01746bc36ab01400e28ff40 (diff)
Qt5 directly show tooltips + respect the help area
I'm not sure why this redirection was implemented, which also ommited the provided help area. I tried hard to use vc::Window code in the beginning, but that also mirrors the cursor position for the window. Using Qt here is simply straight forward, so just do that, Change-Id: Ia8c4efc1e43b915c4b071ee26d4da37d7580817c Reviewed-on: https://gerrit.libreoffice.org/74548 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
Diffstat (limited to 'vcl/qt5/Qt5Frame.cxx')
-rw-r--r--vcl/qt5/Qt5Frame.cxx10
1 files changed, 5 insertions, 5 deletions
diff --git a/vcl/qt5/Qt5Frame.cxx b/vcl/qt5/Qt5Frame.cxx
index dbdc51ea9465..d585f627b7fd 100644
--- a/vcl/qt5/Qt5Frame.cxx
+++ b/vcl/qt5/Qt5Frame.cxx
@@ -155,9 +155,6 @@ Qt5Frame::Qt5Frame(Qt5Frame* pParent, SalFrameStyleFlags nStyle, bool bUseCairo)
else
m_pQWidget = new Qt5Widget(*this, aWinFlags);
- connect(this, &Qt5Frame::tooltipRequest, static_cast<Qt5Widget*>(m_pQWidget),
- &Qt5Widget::showTooltip);
-
if (pParent && !(pParent->m_nStyle & SalFrameStyleFlags::PLUG))
{
QWindow* pParentWindow = pParent->GetQWidget()->window()->windowHandle();
@@ -743,9 +740,12 @@ void Qt5Frame::Flush()
// destroyed, so that state should be safely flushed.
}
-bool Qt5Frame::ShowTooltip(const OUString& rText, const tools::Rectangle& /*rHelpArea*/)
+bool Qt5Frame::ShowTooltip(const OUString& rText, const tools::Rectangle& rHelpArea)
{
- emit tooltipRequest(rText);
+ QRect aHelpArea(toQRect(rHelpArea));
+ if (QGuiApplication::isRightToLeft())
+ aHelpArea.moveLeft(maGeometry.nWidth - aHelpArea.width() - aHelpArea.left() - 1);
+ QToolTip::showText(QCursor::pos(), toQString(rText), m_pQWidget, aHelpArea);
return true;
}