r24872 by jghali - Qt6: build fixes

scribus-commit scribus-commit at lists.scribus.net
Mon Jan 31 00:53:03 UTC 2022


Author: jghali
Date: Mon Jan 31 00:53:03 2022
New Revision: 24872

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=24872
Log:
Qt6: build fixes

Modified:
    trunk/Scribus/scribus/plugins/gettext/htmlim/htmlreader.cpp
    trunk/Scribus/scribus/plugins/gettext/sxwim/stylereader.cpp
    trunk/Scribus/scribus/plugins/import/ai/importai.cpp
    trunk/Scribus/scribus/plugins/short-words/prefs_shortwords.cpp
    trunk/Scribus/scribus/plugins/tools/2geomtools/meshdistortion/meshdistortiondialog.cpp
    trunk/Scribus/scribus/ui/sclistwidgetdelegate.cpp

Modified: trunk/Scribus/scribus/plugins/gettext/htmlim/htmlreader.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24872&path=/trunk/Scribus/scribus/plugins/gettext/htmlim/htmlreader.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/gettext/htmlim/htmlreader.cpp	(original)
+++ trunk/Scribus/scribus/plugins/gettext/htmlim/htmlreader.cpp	Mon Jan 31 00:53:03 2022
@@ -248,7 +248,7 @@
 		bool lcis = (chr.length() > 0 && chr[0].isSpace());
 		if (inPre)
 		{
-			if (tmp.at(0) == "\n")
+			if (tmp.at(0) == '\n')
 				tmp = tmp.right(tmp.length() - 2);
 		}
 		else

Modified: trunk/Scribus/scribus/plugins/gettext/sxwim/stylereader.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24872&path=/trunk/Scribus/scribus/plugins/gettext/sxwim/stylereader.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/gettext/sxwim/stylereader.cpp	(original)
+++ trunk/Scribus/scribus/plugins/gettext/sxwim/stylereader.cpp	Mon Jan 31 00:53:03 2022
@@ -666,11 +666,11 @@
 		style->getFont()->setHscale(static_cast<int>(getSize(value, -1.0)));
 	else if ((key == "style:text-position") &&
 			 ((value.indexOf("sub") != -1) ||
-			  ((value.at(0) == "-") && (value.at(0) != "0"))))
+			  ((value.at(0) == '-') && (value.at(0) != '0'))))
 		style->getFont()->toggleEffect(SUBSCRIPT);
 	else if ((key == "style:text-position") &&
 			 ((value.indexOf("super") != -1) ||
-			  ((value.at(0) != "-") && (value.at(0) != "0"))))
+			  ((value.at(0) != '-') && (value.at(0) != '0'))))
 		style->getFont()->toggleEffect(SUPERSCRIPT);
 	else if ((key == "fo:margin-top") && (pstyle != nullptr))
 		pstyle->setSpaceAbove(getSize(value));

Modified: trunk/Scribus/scribus/plugins/import/ai/importai.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24872&path=/trunk/Scribus/scribus/plugins/import/ai/importai.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/ai/importai.cpp	(original)
+++ trunk/Scribus/scribus/plugins/import/ai/importai.cpp	Mon Jan 31 00:53:03 2022
@@ -15,6 +15,7 @@
 #include <QRegExp>
 #include <QScopedPointer>
 #include <QStack>
+#include <QStringView>
 #include <QTemporaryFile>
 #include <QDebug>
 
@@ -2958,7 +2959,7 @@
 			for (int a = 1; a < tmp.length(); a += 2)
 			{
 				bool ok;
-				ushort data = tmp.midRef(a, 2).toUShort(&ok, 16);
+				ushort data = QStringView(tmp).sliced(a, 2).toUShort(&ok, 16);
 				psdata[dataPointer++] = data;
 			}
 		}

Modified: trunk/Scribus/scribus/plugins/short-words/prefs_shortwords.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24872&path=/trunk/Scribus/scribus/plugins/short-words/prefs_shortwords.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/short-words/prefs_shortwords.cpp	(original)
+++ trunk/Scribus/scribus/plugins/short-words/prefs_shortwords.cpp	Mon Jan 31 00:53:03 2022
@@ -86,7 +86,7 @@
 			 "<qt>" + tr("Cannot write file %1.").arg(RC_PATH_USR) + "</qt>");
 	}
 	QTextStream stream(&f);
-	stream.setCodec("UTF-8");
+	stream.setEncoding(QStringConverter::Utf8);
 	stream << cfgEdit->toPlainText();
 	f.close();
 	messageLabel->setText( tr("User settings saved"));
@@ -119,7 +119,7 @@
 	}
 	cfgEdit->clear();
 	QTextStream stream(&f);
-	stream.setCodec("UTF-8");
+	stream.setEncoding(QStringConverter::Utf8);
 	while (!stream.atEnd())
 		cfgEdit->append(stream.readLine());
 	f.close();

Modified: trunk/Scribus/scribus/plugins/tools/2geomtools/meshdistortion/meshdistortiondialog.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24872&path=/trunk/Scribus/scribus/plugins/tools/2geomtools/meshdistortion/meshdistortiondialog.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/tools/2geomtools/meshdistortion/meshdistortiondialog.cpp	(original)
+++ trunk/Scribus/scribus/plugins/tools/2geomtools/meshdistortion/meshdistortiondialog.cpp	Mon Jan 31 00:53:03 2022
@@ -58,15 +58,16 @@
 void NodeItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *item, QWidget* widget)
 {
 	Q_UNUSED(widget);
+	qreal painterLevelOfDetail = item->levelOfDetailFromTransform(painter->worldTransform());
 	if (item->state & QStyle::State_Selected)
 	{
 		painter->setBrush(Qt::red);
-		painter->setPen(QPen(Qt::red, qMax(0.1, 1.0 / item->levelOfDetail)));
+		painter->setPen(QPen(Qt::red, qMax(0.1, 1.0 / painterLevelOfDetail)));
 	}
 	else
 	{
 		painter->setBrush(Qt::NoBrush);
-		painter->setPen(QPen(Qt::red, qMax(0.2, 2.0 / item->levelOfDetail)));
+		painter->setPen(QPen(Qt::red, qMax(0.2, 2.0 / painterLevelOfDetail)));
 	}
 	painter->drawEllipse(rect());
 }

Modified: trunk/Scribus/scribus/ui/sclistwidgetdelegate.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24872&path=/trunk/Scribus/scribus/ui/sclistwidgetdelegate.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/sclistwidgetdelegate.cpp	(original)
+++ trunk/Scribus/scribus/ui/sclistwidgetdelegate.cpp	Mon Jan 31 00:53:03 2022
@@ -42,7 +42,7 @@
 		if (option.state & QStyle::State_Selected)
 		{
 			QColor sele = option.palette.brush(cg, QPalette::Highlight).color();
-			sele.setAlphaF(0.3);
+			sele.setAlphaF(0.3f);
 			painter->fillRect(option.rect, sele);
 		}
 		painter->restore();




More information about the scribus-commit mailing list