r24913 by craig - Qt6 cleanup, QMetaType mostly
scribus-commit
scribus-commit at lists.scribus.net
Sat Feb 5 16:20:02 UTC 2022
Author: craig
Date: Sat Feb 5 16:20:01 2022
New Revision: 24913
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=24913
Log:
Qt6 cleanup, QMetaType mostly
Modified:
trunk/Scribus/scribus/canvasmode_nodeedit.cpp
trunk/Scribus/scribus/plugins/scriptplugin/cmdgetsetprop.cpp
trunk/Scribus/scribus/scribusapp.cpp
trunk/Scribus/scribus/styles/paragraphstyle.h
Modified: trunk/Scribus/scribus/canvasmode_nodeedit.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24913&path=/trunk/Scribus/scribus/canvasmode_nodeedit.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_nodeedit.cpp (original)
+++ trunk/Scribus/scribus/canvasmode_nodeedit.cpp Sat Feb 5 16:20:01 2022
@@ -1053,15 +1053,13 @@
if ((m_canvas->m_viewMode.m_MouseButtonPressed) && !m_doc->nodeEdit.hasNodeSelected() && (m_doc->nodeEdit.segP1() == -1) && (m_doc->nodeEdit.segP2() == -1))
{
if (!m_rectangleSelect)
- {
m_rectangleSelect = new RectSelect(this);
- }
m_rectangleSelect->prepare(m->globalPos());
m_view->startGesture(m_rectangleSelect);
return;
}
- int newX = m->x();
- int newY = m->y();
+ int newX = m->position().x();
+ int newY = m->position().y();
FPoint np(newX - m_Mxp, newY - m_Myp, 0, 0, currItem->rotation(), 1, 1, true);
np = np * (1.0 / m_canvas->scale());
m_canvas->m_viewMode.operItemMoving = true;
Modified: trunk/Scribus/scribus/plugins/scriptplugin/cmdgetsetprop.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24913&path=/trunk/Scribus/scribus/plugins/scriptplugin/cmdgetsetprop.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin/cmdgetsetprop.cpp (original)
+++ trunk/Scribus/scribus/plugins/scriptplugin/cmdgetsetprop.cpp Sat Feb 5 16:20:01 2022
@@ -9,6 +9,7 @@
#include <QMetaObject>
#include <QMetaProperty>
+#include <QMetaType>
#include <QList>
#include <QObject>
#include <QObjectList>
@@ -274,29 +275,29 @@
// Convert the property to an instance of the closest matching Python type.
PyObject* resultobj = nullptr;
// NUMERIC TYPES
- if (prop.type() == QVariant::Int)
+ if (prop.userType() == QMetaType::Int)
resultobj = PyLong_FromLong(prop.toInt());
- else if (prop.type() == QVariant::Double)
+ else if (prop.userType() == QMetaType::Double)
resultobj = PyFloat_FromDouble(prop.toDouble());
// BOOLEAN
- else if (prop.type() == QVariant::Bool)
+ else if (prop.userType() == QMetaType::Bool)
resultobj = PyBool_FromLong(prop.toBool());
// STRING TYPES
- else if (prop.type() == QVariant::ByteArray)
+ else if (prop.userType() == QMetaType::QByteArray)
{
QByteArray ba = prop.toByteArray();
resultobj = PyBytes_FromStringAndSize(ba.data(), ba.size());
}
- else if (prop.type() == QVariant::String)
+ else if (prop.userType() == QMetaType::QString)
resultobj = PyUnicode_FromString(prop.toString().toUtf8().data());
// HIGHER ORDER TYPES
- else if (prop.type() == QVariant::Point)
+ else if (prop.userType() == QMetaType::QPoint)
{
// Return a QPoint as an (x,y) tuple.
QPoint pt = prop.toPoint();
return Py_BuildValue("(ii)", pt.x(), pt.y());
}
- else if (prop.type() == QVariant::Rect)
+ else if (prop.userType() == QMetaType::QRect)
{
// Return a QRect as an (x,y,width,height) tuple.
// FIXME: We should really construct and return an object that
@@ -305,7 +306,7 @@
QRect r = prop.toRect();
return Py_BuildValue("(iiii)", r.x(), r.y(), r.width(), r.height());
}
- else if (prop.type() == QVariant::StringList)
+ else if (prop.userType() == QMetaType::QStringList)
{
QStringList tmp = prop.toStringList();
return convert_QStringList_to_PyListObject(tmp);
Modified: trunk/Scribus/scribus/scribusapp.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24913&path=/trunk/Scribus/scribus/scribusapp.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusapp.cpp (original)
+++ trunk/Scribus/scribus/scribusapp.cpp Sat Feb 5 16:20:01 2022
@@ -104,7 +104,6 @@
ScQApp = this;
ScCore = nullptr;
initDLMgr();
- setAttribute(Qt::AA_UseHighDpiPixmaps, true);
}
ScribusQApp::~ScribusQApp()
Modified: trunk/Scribus/scribus/styles/paragraphstyle.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24913&path=/trunk/Scribus/scribus/styles/paragraphstyle.h
==============================================================================
--- trunk/Scribus/scribus/styles/paragraphstyle.h (original)
+++ trunk/Scribus/scribus/styles/paragraphstyle.h Sat Feb 5 16:20:01 2022
@@ -68,7 +68,7 @@
struct TabRecord
{
- qreal tabPosition;
+ qreal tabPosition {0.0};
int tabType {0};
QChar tabFillChar;
bool operator==(const TabRecord& other) const;
More information about the scribus-commit
mailing list