r24916 by jghali - Qt6: fix some deprecation warnings

scribus-commit scribus-commit at lists.scribus.net
Sat Feb 5 21:30:31 UTC 2022


Author: jghali
Date: Sat Feb  5 21:30:31 2022
New Revision: 24916

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=24916
Log:
Qt6: fix some deprecation warnings

Modified:
    trunk/Scribus/scribus/canvas.cpp
    trunk/Scribus/scribus/canvas.h
    trunk/Scribus/scribus/canvasmode_magnifier.cpp

Modified: trunk/Scribus/scribus/canvas.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24916&path=/trunk/Scribus/scribus/canvas.cpp
==============================================================================
--- trunk/Scribus/scribus/canvas.cpp	(original)
+++ trunk/Scribus/scribus/canvas.cpp	Sat Feb  5 21:30:31 2022
@@ -212,12 +212,23 @@
 }
 
 
+QPointF Canvas::canvasToGlobalF(QPointF p) const
+{
+	return mapToParent(QPointF(0, 0)) + parentWidget()->mapToGlobal(QPointF(0, 0)) + canvasToLocal(p);
+}
+
+
 QRect Canvas::canvasToGlobal(const QRectF& p) const
 {
 	return { mapToParent(QPoint(0,0) + canvasToLocal(p.topLeft())) + parentWidget()->mapToGlobal(QPoint(0, 0)),
 	         QSize(qRound(p.width() * m_viewMode.scale), qRound(p.height() * m_viewMode.scale)) };
 }
 
+QRectF Canvas::canvasToGlobalF(const QRectF& p) const
+{
+	return { mapToParent(QPointF(0,0) + canvasToLocal(p.topLeft())) + parentWidget()->mapToGlobal(QPointF(0, 0)),
+			 QSize(p.width() * m_viewMode.scale, p.height() * m_viewMode.scale) };
+}
 
 FPoint Canvas::globalToCanvas(QPoint p) const
 {

Modified: trunk/Scribus/scribus/canvas.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24916&path=/trunk/Scribus/scribus/canvas.h
==============================================================================
--- trunk/Scribus/scribus/canvas.h	(original)
+++ trunk/Scribus/scribus/canvas.h	Sat Feb  5 21:30:31 2022
@@ -151,9 +151,11 @@
 	QPoint canvasToLocal(QPointF p) const;
 	QPointF canvasToLocalF(QPointF p) const;
 	QPoint canvasToGlobal(QPointF p) const;
+	QPointF canvasToGlobalF(QPointF p) const;
 	QRect canvasToLocal(const QRectF& p) const;
 	QRectF canvasToLocalF(const QRectF& p) const;
 	QRect canvasToGlobal(const QRectF& p) const;
+	QRectF canvasToGlobalF(const QRectF& p) const;
 	FPoint localToCanvas(QPoint p) const;
 //	FPoint localToCanvas(QPointF p) const;
 	FPoint globalToCanvas(QPoint p) const;

Modified: trunk/Scribus/scribus/canvasmode_magnifier.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24916&path=/trunk/Scribus/scribus/canvasmode_magnifier.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_magnifier.cpp	(original)
+++ trunk/Scribus/scribus/canvasmode_magnifier.cpp	Sat Feb  5 21:30:31 2022
@@ -115,7 +115,7 @@
 
 void CanvasMode_Magnifier::mouseMoveEvent(QMouseEvent *m)
 {
-	const FPoint mousePointDoc = m_canvas->globalToCanvas(m->globalPos());
+	const FPoint mousePointDoc = m_canvas->globalToCanvas(m->globalPosition());
 	
 	m_lastPosWasOverGuide = false;
 	m->accept();
@@ -136,7 +136,7 @@
 
 void CanvasMode_Magnifier::mousePressEvent(QMouseEvent *m)
 {
-	const FPoint mousePointDoc = m_canvas->globalToCanvas(m->globalPos());
+	const FPoint mousePointDoc = m_canvas->globalToCanvas(m->globalPosition());
 	
 	m_canvas->PaintSizeRect(QRect());
 	m_canvas->m_viewMode.m_MouseButtonPressed = true;
@@ -184,7 +184,7 @@
 #ifdef GESTURE_FRAME_PREVIEW
 	clearPixmapCache();
 #endif // GESTURE_FRAME_PREVIEW
-	const FPoint mousePointDoc = m_canvas->globalToCanvas(m->globalPos());
+	const FPoint mousePointDoc = m_canvas->globalToCanvas(m->globalPosition());
 	m_canvas->m_viewMode.m_MouseButtonPressed = false;
 	m_canvas->resetRenderMode();
 	m->accept();




More information about the scribus-commit mailing list