From 4f09fb9f64951340d140badb00b336dd99c68f2b Mon Sep 17 00:00:00 2001 From: Jan-Marek Glogowski Date: Fri, 11 Sep 2020 16:07:41 +0200 Subject: Qt5 add some output formaters for Qt classes This simply converts them to LO equivalents. Since this is just for easier debugging, there is IMHO no need for "more optimized" variants. Change-Id: I283d0e2b69f945517aaa79f3c6dbea38dcb50ef0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102489 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski --- vcl/inc/qt5/Qt5Tools.hxx | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/vcl/inc/qt5/Qt5Tools.hxx b/vcl/inc/qt5/Qt5Tools.hxx index 971ae42b5bab..1110c7099d80 100644 --- a/vcl/inc/qt5/Qt5Tools.hxx +++ b/vcl/inc/qt5/Qt5Tools.hxx @@ -151,4 +151,32 @@ sal_uInt16 GetMouseModCode(Qt::MouseButtons eButtons); QImage toQImage(const Image& rImage); +template +inline std::basic_ostream& operator<<(std::basic_ostream& stream, + const QString& rString) +{ + return stream << toOUString(rString); +} + +template +inline std::basic_ostream& operator<<(std::basic_ostream& stream, + const QRect& rRect) +{ + return stream << toRectangle(rRect); +} + +template +inline std::basic_ostream& operator<<(std::basic_ostream& stream, + const QSize& rSize) +{ + return stream << toSize(rSize); +} + +template +inline std::basic_ostream& operator<<(std::basic_ostream& stream, + const QPoint& rPoint) +{ + return stream << toPoint(rPoint); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit