r25014 by jghali - More removal of deprecated globalPos() calls
scribus-commit
scribus-commit at lists.scribus.net
Fri Mar 11 19:08:42 UTC 2022
Author: jghali
Date: Fri Mar 11 19:08:42 2022
New Revision: 25014
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=25014
Log:
More removal of deprecated globalPos() calls
Modified:
trunk/Scribus/scribus/canvas.cpp
trunk/Scribus/scribus/canvas.h
trunk/Scribus/scribus/canvasmode_copyproperties.cpp
trunk/Scribus/scribus/canvasmode_create.cpp
trunk/Scribus/scribus/canvasmode_editarc.cpp
trunk/Scribus/scribus/canvasmode_editgradient.cpp
trunk/Scribus/scribus/canvasmode_editmeshgradient.cpp
trunk/Scribus/scribus/canvasmode_editmeshpatch.cpp
trunk/Scribus/scribus/canvasmode_editpolygon.cpp
trunk/Scribus/scribus/canvasmode_editspiral.cpp
trunk/Scribus/scribus/canvasmode_editweldpoint.cpp
trunk/Scribus/scribus/canvasmode_eyedropper.cpp
trunk/Scribus/scribus/canvasmode_imageimport.cpp
trunk/Scribus/scribus/canvasmode_objimport.cpp
trunk/Scribus/scribus/canvasmode_panning.cpp
trunk/Scribus/scribus/scribusview.h
trunk/Scribus/scribus/ui/vruler.cpp
Modified: trunk/Scribus/scribus/canvas.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=25014&path=/trunk/Scribus/scribus/canvas.cpp
==============================================================================
--- trunk/Scribus/scribus/canvas.cpp (original)
+++ trunk/Scribus/scribus/canvas.cpp Fri Mar 11 19:08:42 2022
@@ -247,13 +247,11 @@
}
-/*
QRectF Canvas::globalToCanvas(QRectF p) const
{
FPoint org = globalToCanvas(p.topLeft());
- return QRectF(org.x(), org.y(), p.width() / m_viewMode.scale, p.height() / m_viewMode.scale);
-}
-*/
+ return { org.x(), org.y(), p.width() / m_viewMode.scale, p.height() / m_viewMode.scale };
+}
// ________________________
@@ -434,10 +432,10 @@
}
-PageItem* Canvas::itemUnderCursor(QPoint globalPos, PageItem* itemAbove, bool allowInGroup, bool allowMasterItems) const
+PageItem* Canvas::itemUnderCursor(QPointF globalPos, PageItem* itemAbove, bool allowInGroup, bool allowMasterItems) const
{
PageItem* currItem;
- QRectF mouseArea = globalToCanvas(QRect(globalPos, QSize(2*m_doc->guidesPrefs().grabRadius, 2*m_doc->guidesPrefs().grabRadius)));
+ QRectF mouseArea = globalToCanvas(QRectF(globalPos, QSizeF(2 * m_doc->guidesPrefs().grabRadius, 2 * m_doc->guidesPrefs().grabRadius)));
// look for masterpage items first
if (allowMasterItems && !m_doc->masterPageMode() && m_doc->currentPage()->FromMaster.count() != 0)
{
Modified: trunk/Scribus/scribus/canvas.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=25014&path=/trunk/Scribus/scribus/canvas.h
==============================================================================
--- trunk/Scribus/scribus/canvas.h (original)
+++ trunk/Scribus/scribus/canvas.h Fri Mar 11 19:08:42 2022
@@ -161,7 +161,7 @@
FPoint globalToCanvas(QPoint p) const;
FPoint globalToCanvas(QPointF p) const;
QRectF globalToCanvas(QRect p) const;
-// QRectF globalToCanvas(QRectF p) const;
+ QRectF globalToCanvas(QRectF p) const;
bool hitsCanvasPoint(QPoint globalPoint, const FPoint& canvasPoint) const;
bool hitsCanvasPoint(QPointF globalPoint, const FPoint& canvasPoint) const;
bool hitsCanvasPoint(QPoint globalPoint, QPointF canvasPoint) const;
@@ -181,7 +181,7 @@
The flag 'allowMasterItems' controls if items from a masterpage are considered.
(this flag is ignored in masterpage mode, since all items are masterpage items then).
*/
- PageItem* itemUnderCursor(QPoint globalPos, PageItem* itemAbove=nullptr, bool allowInGroup=false, bool allowMasterItems=false) const;
+ PageItem* itemUnderCursor(QPointF globalPos, PageItem* itemAbove=nullptr, bool allowInGroup=false, bool allowMasterItems=false) const;
PageItem* itemInGroup(PageItem* group, const QRectF& mouseArea) const;
PageItem* itemUnderItem(PageItem* item, int& index) const;
Modified: trunk/Scribus/scribus/canvasmode_copyproperties.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=25014&path=/trunk/Scribus/scribus/canvasmode_copyproperties.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_copyproperties.cpp (original)
+++ trunk/Scribus/scribus/canvasmode_copyproperties.cpp Fri Mar 11 19:08:42 2022
@@ -120,7 +120,7 @@
if ((m_canvas->m_viewMode.m_MouseButtonPressed) && (m->buttons() & Qt::LeftButton))
{
QPoint startP = m_canvas->canvasToGlobal(QPointF(Mxp, Myp));
- m_view->redrawMarker->setGeometry(QRect(startP, m->globalPos()).normalized());
+ m_view->redrawMarker->setGeometry(QRect(startP, m->globalPosition().toPoint()).normalized());
m_view->setRedrawMarkerShown(true);
m_view->HaveSelRect = true;
return;
@@ -131,7 +131,7 @@
{
// const double mouseX = m->globalX();
// const double mouseY = m->globalY();
- 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;
@@ -140,9 +140,9 @@
m_doc->DragP = false;
m_doc->leaveDrag = false;
m->accept();
- m_view->registerMousePress(m->globalPos());
- Mxp = mousePointDoc.x(); //qRound(m->x()/m_canvas->scale() + 0*m_doc->minCanvasCoordinate.x());
- Myp = mousePointDoc.y(); //qRound(m->y()/m_canvas->scale() + 0*m_doc->minCanvasCoordinate.y());
+ m_view->registerMousePress(m->globalPosition());
+ Mxp = mousePointDoc.x();
+ Myp = mousePointDoc.y();
double Rxp = m_doc->ApplyGridF(FPoint(Mxp, Myp)).x();
Mxp = qRound(Rxp);
double Ryp = m_doc->ApplyGridF(FPoint(Mxp, Myp)).y();
@@ -221,8 +221,8 @@
#ifdef GESTURE_FRAME_PREVIEW
clearPixmapCache();
#endif // GESTURE_FRAME_PREVIEW
- const FPoint mousePointDoc = m_canvas->globalToCanvas(m->globalPos());
- PageItem *currItem;
+ const FPoint mousePointDoc = m_canvas->globalToCanvas(m->globalPosition());
+ PageItem *currItem { nullptr };
m_canvas->m_viewMode.m_MouseButtonPressed = false;
m_canvas->resetRenderMode();
m->accept();
@@ -242,11 +242,11 @@
const unsigned SELECT_BENEATH = Qt::ControlModifier;
PageItem *currItem;
m_canvas->m_viewMode.m_MouseButtonPressed = true;
- FPoint mousePointDoc = m_canvas->globalToCanvas(m->globalPos());
- Mxp = mousePointDoc.x(); //m->x()/m_canvas->scale());
- Myp = mousePointDoc.y(); //m->y()/m_canvas->scale());
- int MxpS = static_cast<int>(mousePointDoc.x()); //m->x()/m_canvas->scale() + 0*m_doc->minCanvasCoordinate.x());
- int MypS = static_cast<int>(mousePointDoc.y()); //m->y()/m_canvas->scale() + 0*m_doc->minCanvasCoordinate.y());
+ FPoint mousePointDoc = m_canvas->globalToCanvas(m->globalPosition());
+ Mxp = mousePointDoc.x();
+ Myp = mousePointDoc.y();
+ int MxpS = static_cast<int>(mousePointDoc.x());
+ int MypS = static_cast<int>(mousePointDoc.y());
m_doc->nodeEdit.deselect();
if (!m_doc->masterPageMode())
{
@@ -313,7 +313,7 @@
{
m_view->deselectItems(false);
}
- currItem = m_canvas->itemUnderCursor(m->globalPos(), currItem, (m->modifiers() & SELECT_IN_GROUP));
+ currItem = m_canvas->itemUnderCursor(m->globalPosition(), currItem, (m->modifiers() & SELECT_IN_GROUP));
if (currItem)
{
m_doc->m_Selection->delaySignalsOn();
Modified: trunk/Scribus/scribus/canvasmode_create.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=25014&path=/trunk/Scribus/scribus/canvasmode_create.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_create.cpp (original)
+++ trunk/Scribus/scribus/canvasmode_create.cpp Fri Mar 11 19:08:42 2022
@@ -242,7 +242,7 @@
void CreateMode::mouseMoveEvent(QMouseEvent *m)
{
- const FPoint mousePointDoc = m_canvas->globalToCanvas(m->globalPos());
+ const FPoint mousePointDoc = m_canvas->globalToCanvas(m->globalPosition());
modifiers = m->modifiers();
double newX, newY;
@@ -250,7 +250,7 @@
QPainter p;
// QRect tx;
m->accept();
-// qDebug() << "legacy mode move:" << m->x() << m->y() << m_canvas->globalToCanvas(m->globalPos()).x() << m_canvas->globalToCanvas(m->globalPos()).y();
+// qDebug() << "legacy mode move:" << m->x() << m->y() << m_canvas->globalToCanvas(m->globalPosition()).x() << m_canvas->globalToCanvas(m->globalPosition()).y();
// emit MousePos(m->x()/m_canvas->scale(),// + m_doc->minCanvasCoordinate.x(),
// m->y()/m_canvas->scale()); // + m_doc->minCanvasCoordinate.y());
@@ -336,7 +336,7 @@
void CreateMode::mousePressEvent(QMouseEvent *m)
{
- const FPoint mousePointDoc = m_canvas->globalToCanvas(m->globalPos());
+ const FPoint mousePointDoc = m_canvas->globalToCanvas(m->globalPosition());
modifiers = m->modifiers();
double Rxp = 0, Ryp = 0;
@@ -347,7 +347,7 @@
inItemCreation = false;
// oldClip = 0;
m->accept();
- m_view->registerMousePress(m->globalPos());
+ m_view->registerMousePress(m->globalPosition());
// QRect mpo(m->x()-m_doc->guidesPrefs().grabRadius, m->y()-m_doc->guidesPrefs().grabRadius, m_doc->guidesPrefs().grabRadius*2, m_doc->guidesPrefs().grabRadius*2);
// mpo.moveBy(qRound(m_doc->minCanvasCoordinate.x() * m_canvas->scale()), qRound(m_doc->minCanvasCoordinate.y() * m_canvas->scale()));
canvasPressCoord = mousePointDoc;
@@ -439,7 +439,7 @@
void CreateMode::selectPage(QMouseEvent *m)
{
m_MouseButtonPressed = true;
- FPoint mousePointDoc = m_canvas->globalToCanvas(m->globalPos());
+ FPoint mousePointDoc = m_canvas->globalToCanvas(m->globalPosition());
canvasPressCoord = mousePointDoc;
// QRect mpo(m->x()-m_doc->guidesPrefs().grabRadius, m->y()-m_doc->guidesPrefs().grabRadius, m_doc->guidesPrefs().grabRadius*2, m_doc->guidesPrefs().grabRadius*2);
// mpo.moveBy(qRound(Doc->minCanvasCoordinate.x() * m_canvas->scale()), qRound(m_doc->minCanvasCoordinate.y() * m_canvas->scale()));
Modified: trunk/Scribus/scribus/canvasmode_editarc.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=25014&path=/trunk/Scribus/scribus/canvasmode_editarc.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_editarc.cpp (original)
+++ trunk/Scribus/scribus/canvasmode_editarc.cpp Fri Mar 11 19:08:42 2022
@@ -318,7 +318,7 @@
void CanvasMode_EditArc::mouseMoveEvent(QMouseEvent *m)
{
- const FPoint mousePointDoc = m_canvas->globalToCanvas(m->globalPos());
+ const FPoint mousePointDoc = m_canvas->globalToCanvas(m->globalPosition());
m->accept();
double newX = mousePointDoc.x();
double newY = mousePointDoc.y();
@@ -379,7 +379,7 @@
void CanvasMode_EditArc::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;
@@ -388,9 +388,9 @@
m_doc->DragP = false;
m_doc->leaveDrag = false;
m->accept();
- m_view->registerMousePress(m->globalPos());
- m_Mxp = mousePointDoc.x(); //m->x();
- m_Myp = mousePointDoc.y(); //m->y();
+ m_view->registerMousePress(m->globalPosition());
+ m_Mxp = mousePointDoc.x();
+ m_Myp = mousePointDoc.y();
if (m->button() == Qt::MiddleButton)
{
m_view->MidButt = true;
@@ -408,13 +408,13 @@
shPoint = itemMatrix.map(shPoint);
QPointF sPoint = m_widthPoint;
sPoint = itemMatrix.map(sPoint);
- if (m_canvas->hitsCanvasPoint(m->globalPos(), stPoint))
+ if (m_canvas->hitsCanvasPoint(m->globalPosition(), stPoint))
m_arcPoint = useControlStart;
- else if (m_canvas->hitsCanvasPoint(m->globalPos(), swPoint))
+ else if (m_canvas->hitsCanvasPoint(m->globalPosition(), swPoint))
m_arcPoint = useControlSweep;
- else if (m_canvas->hitsCanvasPoint(m->globalPos(), shPoint))
+ else if (m_canvas->hitsCanvasPoint(m->globalPosition(), shPoint))
m_arcPoint = useControlHeight;
- else if (m_canvas->hitsCanvasPoint(m->globalPos(), sPoint))
+ else if (m_canvas->hitsCanvasPoint(m->globalPosition(), sPoint))
m_arcPoint = useControlWidth;
else
m_arcPoint = noPointDefined;
Modified: trunk/Scribus/scribus/canvasmode_editgradient.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=25014&path=/trunk/Scribus/scribus/canvasmode_editgradient.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_editgradient.cpp (original)
+++ trunk/Scribus/scribus/canvasmode_editgradient.cpp Fri Mar 11 19:08:42 2022
@@ -316,7 +316,7 @@
void CanvasMode_EditGradient::mouseMoveEvent(QMouseEvent *m)
{
- const FPoint mousePointDoc = m_canvas->globalToCanvas(m->globalPos());
+ const FPoint mousePointDoc = m_canvas->globalToCanvas(m->globalPosition());
m->accept();
if (m_gradientPoint == noPointDefined)
return;
@@ -716,7 +716,7 @@
void CanvasMode_EditGradient::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;
@@ -725,10 +725,10 @@
m_doc->DragP = false;
m_doc->leaveDrag = false;
m->accept();
- m_view->registerMousePress(m->globalPos());
+ m_view->registerMousePress(m->globalPosition());
m_gradientPoint = noPointDefined;
- m_Mxp = mousePointDoc.x(); //m->x();
- m_Myp = mousePointDoc.y(); //m->y();
+ m_Mxp = mousePointDoc.x();
+ m_Myp = mousePointDoc.y();
if (m->button() == Qt::MiddleButton)
{
m_view->MidButt = true;
@@ -863,37 +863,37 @@
gradientCenter = itemMatrix.map(gradientCenter);
if (m_view->editStrokeGradient == 3)
{
- if (m_canvas->hitsCanvasPoint(m->globalPos(), gradientStart))
+ if (m_canvas->hitsCanvasPoint(m->globalPosition(), gradientStart))
m_gradientPoint = useControl1;
- else if (m_canvas->hitsCanvasPoint(m->globalPos(), gradientEnd))
+ else if (m_canvas->hitsCanvasPoint(m->globalPosition(), gradientEnd))
m_gradientPoint = useControl2;
- else if (m_canvas->hitsCanvasPoint(m->globalPos(), gradientFocal))
+ else if (m_canvas->hitsCanvasPoint(m->globalPosition(), gradientFocal))
m_gradientPoint = useControl3;
- else if (m_canvas->hitsCanvasPoint(m->globalPos(), gradientScale))
+ else if (m_canvas->hitsCanvasPoint(m->globalPosition(), gradientScale))
m_gradientPoint = useControl4;
}
else if (m_view->editStrokeGradient == 4)
{
- if (m_canvas->hitsCanvasPoint(m->globalPos(), gradientStart))
+ if (m_canvas->hitsCanvasPoint(m->globalPosition(), gradientStart))
m_gradientPoint = useControl1;
- else if (m_canvas->hitsCanvasPoint(m->globalPos(), gradientEnd))
+ else if (m_canvas->hitsCanvasPoint(m->globalPosition(), gradientEnd))
m_gradientPoint = useControl2;
- else if (m_canvas->hitsCanvasPoint(m->globalPos(), gradientFocal))
+ else if (m_canvas->hitsCanvasPoint(m->globalPosition(), gradientFocal))
m_gradientPoint = useControl3;
- else if (m_canvas->hitsCanvasPoint(m->globalPos(), gradientScale))
+ else if (m_canvas->hitsCanvasPoint(m->globalPosition(), gradientScale))
m_gradientPoint = useControl4;
- else if (m_canvas->hitsCanvasPoint(m->globalPos(), gradientCenter))
+ else if (m_canvas->hitsCanvasPoint(m->globalPosition(), gradientCenter))
m_gradientPoint = useControl5;
}
else
{
- if (m_canvas->hitsCanvasPoint(m->globalPos(), gradientStart))
+ if (m_canvas->hitsCanvasPoint(m->globalPosition(), gradientStart))
m_gradientPoint = useGradientStart;
- else if (m_canvas->hitsCanvasPoint(m->globalPos(), gradientEnd))
+ else if (m_canvas->hitsCanvasPoint(m->globalPosition(), gradientEnd))
m_gradientPoint = useGradientEnd;
- else if (m_canvas->hitsCanvasPoint(m->globalPos(), gradientFocal))
+ else if (m_canvas->hitsCanvasPoint(m->globalPosition(), gradientFocal))
m_gradientPoint = useGradientFocal;
- else if (m_canvas->hitsCanvasPoint(m->globalPos(), gradientScale))
+ else if (m_canvas->hitsCanvasPoint(m->globalPosition(), gradientScale))
m_gradientPoint = useGradientSkew;
}
m_canvas->m_viewMode.m_MouseButtonPressed = true;
Modified: trunk/Scribus/scribus/canvasmode_editmeshgradient.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=25014&path=/trunk/Scribus/scribus/canvasmode_editmeshgradient.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_editmeshgradient.cpp (original)
+++ trunk/Scribus/scribus/canvasmode_editmeshgradient.cpp Fri Mar 11 19:08:42 2022
@@ -564,7 +564,7 @@
void CanvasMode_EditMeshGradient::mouseMoveEvent(QMouseEvent *m)
{
- const FPoint mousePointDoc = m_canvas->globalToCanvas(m->globalPos());
+ const FPoint mousePointDoc = m_canvas->globalToCanvas(m->globalPosition());
m->accept();
if (m_selectedMeshPoints.count() == 0)
return;
@@ -631,7 +631,7 @@
void CanvasMode_EditMeshGradient::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;
@@ -640,9 +640,9 @@
m_doc->DragP = false;
m_doc->leaveDrag = false;
m->accept();
- m_view->registerMousePress(m->globalPos());
- m_Mxp = mousePointDoc.x(); //m->x();
- m_Myp = mousePointDoc.y(); //m->y();
+ m_view->registerMousePress(m->globalPosition());
+ m_Mxp = mousePointDoc.x();
+ m_Myp = mousePointDoc.y();
if (m->button() == Qt::MiddleButton)
{
m_view->MidButt = true;
Modified: trunk/Scribus/scribus/canvasmode_editmeshpatch.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=25014&path=/trunk/Scribus/scribus/canvasmode_editmeshpatch.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_editmeshpatch.cpp (original)
+++ trunk/Scribus/scribus/canvasmode_editmeshpatch.cpp Fri Mar 11 19:08:42 2022
@@ -561,7 +561,7 @@
void CanvasMode_EditMeshPatch::mouseMoveEvent(QMouseEvent *m)
{
- const FPoint mousePointDoc = m_canvas->globalToCanvas(m->globalPos());
+ const FPoint mousePointDoc = m_canvas->globalToCanvas(m->globalPosition());
m->accept();
FPoint npfN;
double nx = mousePointDoc.x();
@@ -735,7 +735,7 @@
void CanvasMode_EditMeshPatch::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;
@@ -744,9 +744,9 @@
m_doc->DragP = false;
m_doc->leaveDrag = false;
m->accept();
- m_view->registerMousePress(m->globalPos());
- m_Mxp = mousePointDoc.x(); //m->x();
- m_Myp = mousePointDoc.y(); //m->y();
+ m_view->registerMousePress(m->globalPosition());
+ m_Mxp = mousePointDoc.x();
+ m_Myp = mousePointDoc.y();
if (m->button() == Qt::MiddleButton)
{
m_view->MidButt = true;
Modified: trunk/Scribus/scribus/canvasmode_editpolygon.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=25014&path=/trunk/Scribus/scribus/canvasmode_editpolygon.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_editpolygon.cpp (original)
+++ trunk/Scribus/scribus/canvasmode_editpolygon.cpp Fri Mar 11 19:08:42 2022
@@ -336,7 +336,7 @@
void CanvasMode_EditPolygon::mouseMoveEvent(QMouseEvent *m)
{
- const FPoint mousePointDoc = m_canvas->globalToCanvas(m->globalPos());
+ const FPoint mousePointDoc = m_canvas->globalToCanvas(m->globalPosition());
m->accept();
double newX = mousePointDoc.x();
double newY = mousePointDoc.y();
@@ -406,7 +406,7 @@
void CanvasMode_EditPolygon::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;
@@ -415,9 +415,9 @@
m_doc->DragP = false;
m_doc->leaveDrag = false;
m->accept();
- m_view->registerMousePress(m->globalPos());
- m_Mxp = mousePointDoc.x(); //m->x();
- m_Myp = mousePointDoc.y(); //m->y();
+ m_view->registerMousePress(m->globalPosition());
+ m_Mxp = mousePointDoc.x();
+ m_Myp = mousePointDoc.y();
if (m->button() == Qt::MiddleButton)
{
m_view->MidButt = true;
@@ -435,10 +435,10 @@
shPoint = itemMatrix.map(shPoint);
QPointF sPoint = m_outerCPoint;
sPoint = itemMatrix.map(sPoint);
- bool useOuter = m_canvas->hitsCanvasPoint(m->globalPos(), stPoint);
- bool useInner = m_canvas->hitsCanvasPoint(m->globalPos(), swPoint);
- bool useInnerC = m_canvas->hitsCanvasPoint(m->globalPos(), shPoint);
- bool useOuterC = m_canvas->hitsCanvasPoint(m->globalPos(), sPoint);
+ bool useOuter = m_canvas->hitsCanvasPoint(m->globalPosition(), stPoint);
+ bool useInner = m_canvas->hitsCanvasPoint(m->globalPosition(), swPoint);
+ bool useInnerC = m_canvas->hitsCanvasPoint(m->globalPosition(), shPoint);
+ bool useOuterC = m_canvas->hitsCanvasPoint(m->globalPosition(), sPoint);
if (useOuter && useOuterC)
{
if (m->modifiers() == Qt::ShiftModifier)
@@ -478,7 +478,7 @@
void CanvasMode_EditPolygon::mouseReleaseEvent(QMouseEvent *m)
{
- 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();
@@ -490,7 +490,7 @@
double newX = mousePointDoc.x();
double newY = mousePointDoc.y();
QPointF cPoint = itemMatrix.map(m_centerPoint);
- QLineF stLinA = QLineF(cPoint, QPointF(newX, newY));
+ QLineF stLinA(cPoint, QPointF(newX, newY));
uint cx = m_polyUseFactor ? m_polyCorners * 2 : m_polyCorners;
double seg = 360.0 / cx;
double trueLength = sqrt(pow(sin(seg / 180.0 * M_PI) * (currItem->width() / 2.0), 2) + pow(cos(seg / 180.0 * M_PI) * (currItem->height() / 2.0) + (currItem->height()/2.0) - currItem->height(), 2));
Modified: trunk/Scribus/scribus/canvasmode_editspiral.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=25014&path=/trunk/Scribus/scribus/canvasmode_editspiral.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_editspiral.cpp (original)
+++ trunk/Scribus/scribus/canvasmode_editspiral.cpp Fri Mar 11 19:08:42 2022
@@ -281,7 +281,7 @@
void CanvasMode_EditSpiral::mouseMoveEvent(QMouseEvent *m)
{
- const FPoint mousePointDoc = m_canvas->globalToCanvas(m->globalPos());
+ const FPoint mousePointDoc = m_canvas->globalToCanvas(m->globalPosition());
m->accept();
double newX = mousePointDoc.x();
double newY = mousePointDoc.y();
@@ -340,7 +340,7 @@
void CanvasMode_EditSpiral::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;
m_canvas->m_viewMode.operItemMoving = false;
@@ -348,9 +348,9 @@
m_doc->DragP = false;
m_doc->leaveDrag = false;
m->accept();
- m_view->registerMousePress(m->globalPos());
- m_Mxp = mousePointDoc.x(); //m->x();
- m_Myp = mousePointDoc.y(); //m->y();
+ m_view->registerMousePress(m->globalPosition());
+ m_Mxp = mousePointDoc.x();
+ m_Myp = mousePointDoc.y();
if (m->button() == Qt::MiddleButton)
{
m_view->MidButt = true;
@@ -364,9 +364,9 @@
stPoint = itemMatrix.map(stPoint);
QPointF swPoint = m_endPoint;
swPoint = itemMatrix.map(swPoint);
- if (m_canvas->hitsCanvasPoint(m->globalPos(), stPoint))
+ if (m_canvas->hitsCanvasPoint(m->globalPosition(), stPoint))
m_arcPoint = useControlStart;
- else if (m_canvas->hitsCanvasPoint(m->globalPos(), swPoint))
+ else if (m_canvas->hitsCanvasPoint(m->globalPosition(), swPoint))
m_arcPoint = useControlEnd;
else
m_arcPoint = noPointDefined;
Modified: trunk/Scribus/scribus/canvasmode_editweldpoint.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=25014&path=/trunk/Scribus/scribus/canvasmode_editweldpoint.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_editweldpoint.cpp (original)
+++ trunk/Scribus/scribus/canvasmode_editweldpoint.cpp Fri Mar 11 19:08:42 2022
@@ -342,7 +342,7 @@
void CanvasMode_EditWeldPoint::mouseMoveEvent(QMouseEvent *m)
{
- const FPoint mousePointDoc = m_canvas->globalToCanvas(m->globalPos());
+ const FPoint mousePointDoc = m_canvas->globalToCanvas(m->globalPosition());
m->accept();
FPoint npfN;
double nx = mousePointDoc.x();
@@ -384,7 +384,7 @@
void CanvasMode_EditWeldPoint::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;
@@ -393,9 +393,9 @@
m_doc->DragP = false;
m_doc->leaveDrag = false;
m->accept();
- m_view->registerMousePress(m->globalPos());
- m_Mxp = mousePointDoc.x(); //m->x();
- m_Myp = mousePointDoc.y(); //m->y();
+ m_view->registerMousePress(m->globalPosition());
+ m_Mxp = mousePointDoc.x();
+ m_Myp = mousePointDoc.y();
if (m->button() == Qt::MiddleButton)
{
m_view->MidButt = true;
Modified: trunk/Scribus/scribus/canvasmode_eyedropper.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=25014&path=/trunk/Scribus/scribus/canvasmode_eyedropper.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_eyedropper.cpp (original)
+++ trunk/Scribus/scribus/canvasmode_eyedropper.cpp Fri Mar 11 19:08:42 2022
@@ -140,7 +140,7 @@
m_doc->DragP = false;
m_doc->leaveDrag = false;
m->accept();
- m_view->registerMousePress(m->globalPos());
+ m_view->registerMousePress(m->globalPosition());
}
void CanvasMode_EyeDropper::mouseReleaseEvent(QMouseEvent *m)
Modified: trunk/Scribus/scribus/canvasmode_imageimport.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=25014&path=/trunk/Scribus/scribus/canvasmode_imageimport.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_imageimport.cpp (original)
+++ trunk/Scribus/scribus/canvasmode_imageimport.cpp Fri Mar 11 19:08:42 2022
@@ -159,13 +159,13 @@
void CanvasMode_ImageImport::mouseMoveEvent(QMouseEvent *m)
{
- m_Mx = m->globalPos().x();
- m_My = m->globalPos().y();
+ m_Mx = m->globalPosition().x();
+ m_My = m->globalPosition().y();
QToolTip::showText(m->globalPosition().toPoint(), m_tipText, qApp->activeWindow());
QToolTip::showText(m->globalPosition().toPoint(), m_tipText + "<b></b>", qApp->activeWindow());
m->accept();
PageItem *item;
- if ((item = m_canvas->itemUnderCursor(m->globalPos())) != nullptr)
+ if ((item = m_canvas->itemUnderCursor(m->globalPosition())) != nullptr)
{
PageItem_ImageFrame *currItem;
if ((currItem = item->asImageFrame()) != nullptr)
@@ -188,11 +188,11 @@
m_doc->DragP = false;
m_doc->leaveDrag = false;
m->accept();
- m_view->registerMousePress(m->globalPos());
+ m_view->registerMousePress(m->globalPosition());
PageItem *item;
if (!m_imageList.empty())
{
- if ((item = m_canvas->itemUnderCursor(m->globalPos())) != nullptr)
+ if ((item = m_canvas->itemUnderCursor(m->globalPosition())) != nullptr)
{
PageItem_ImageFrame *currItem;
if ((currItem = item->asImageFrame()) != nullptr)
Modified: trunk/Scribus/scribus/canvasmode_objimport.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=25014&path=/trunk/Scribus/scribus/canvasmode_objimport.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_objimport.cpp (original)
+++ trunk/Scribus/scribus/canvasmode_objimport.cpp Fri Mar 11 19:08:42 2022
@@ -144,7 +144,7 @@
{
// const double mouseX = m->globalX();
// const double mouseY = m->globalY();
- 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;
@@ -154,7 +154,7 @@
m_doc->leaveDrag = false;
// oldClip = 0;
m->accept();
- m_view->registerMousePress(m->globalPos());
+ m_view->registerMousePress(m->globalPosition());
m_Mxp = mousePointDoc.x();
m_Myp = mousePointDoc.y();
double Rxp = m_doc->ApplyGridF(FPoint(m_Mxp, m_Myp)).x();
@@ -183,8 +183,8 @@
undoTransaction = UndoManager::instance()->beginTransaction(*m_trSettings);
}
// Creating QDragEnterEvent outside of Qt is not recommended per docs :S
- QPoint dropPos = m_view->widget()->mapFromGlobal(m->globalPos());
- const FPoint mousePointDoc = m_canvas->globalToCanvas(m->globalPos());
+ QPointF dropPos = m_view->widget()->mapFromGlobal(m->globalPosition());
+ const FPoint mousePointDoc = m_canvas->globalToCanvas(m->globalPosition());
QDropEvent dropEvent(dropPos, Qt::CopyAction|Qt::MoveAction, m_mimeData, m->buttons(), m->modifiers());
m_view->contentsDropEvent(&dropEvent);
if (m_doc->m_Selection->count() > 0)
Modified: trunk/Scribus/scribus/canvasmode_panning.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=25014&path=/trunk/Scribus/scribus/canvasmode_panning.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_panning.cpp (original)
+++ trunk/Scribus/scribus/canvasmode_panning.cpp Fri Mar 11 19:08:42 2022
@@ -104,7 +104,7 @@
m_doc->DragP = false;
m_doc->leaveDrag = false;
m->accept();
- m_view->registerMousePress(m->globalPos());*/
+ m_view->registerMousePress(m->globalPosition());*/
m_view->startGesture(m_panGesture);
m_panGesture->mousePressEvent(m);
Modified: trunk/Scribus/scribus/scribusview.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=25014&path=/trunk/Scribus/scribus/scribusview.h
==============================================================================
--- trunk/Scribus/scribus/scribusview.h (original)
+++ trunk/Scribus/scribus/scribusview.h Fri Mar 11 19:08:42 2022
@@ -284,7 +284,7 @@
int m_previousMode;
QMenu *pmen3;
QMenu *pmenResolution;
- QPoint m_pressLocation;
+ QPointF m_pressLocation;
QElapsedTimer m_moveTimer;
QTimer *m_dragTimer;
bool m_dragTimerFired;
@@ -320,10 +320,10 @@
void inputMethodEvent(QInputMethodEvent * event) override;
QVariant inputMethodQuery(Qt::InputMethodQuery query) const override;
- inline void registerMousePress(QPoint p);
+ inline void registerMousePress(QPointF p);
bool mousePressed();
void resetMousePressed();
- inline QPoint mousePressLocation();
+ inline QPointF mousePressLocation();
inline bool moveTimerElapsed();
inline void resetMoveTimer();
@@ -375,7 +375,7 @@
-inline void ScribusView::registerMousePress(QPoint p)
+inline void ScribusView::registerMousePress(QPointF p)
{
m_pressLocation = p;
m_moveTimer.start();
@@ -383,7 +383,7 @@
}
-inline QPoint ScribusView::mousePressLocation()
+inline QPointF ScribusView::mousePressLocation()
{
return m_pressLocation;
}
Modified: trunk/Scribus/scribus/ui/vruler.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=25014&path=/trunk/Scribus/scribus/ui/vruler.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/vruler.cpp (original)
+++ trunk/Scribus/scribus/ui/vruler.cpp Fri Mar 11 19:08:42 2022
@@ -59,7 +59,7 @@
return;
qApp->setOverrideCursor(QCursor(Qt::SplitHCursor));
m_view->startGesture(rulerGesture);
- m_view->registerMousePress(m->globalPos());
+ m_view->registerMousePress(m->globalPosition());
}
void Vruler::mouseReleaseEvent(QMouseEvent *m)
More information about the scribus-commit
mailing list