r24842 by jghali - More fixes for Qt6
scribus-commit
scribus-commit at lists.scribus.net
Sat Jan 29 23:08:39 UTC 2022
Author: jghali
Date: Sat Jan 29 23:08:39 2022
New Revision: 24842
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=24842
Log:
More fixes for Qt6
Modified:
trunk/Scribus/scribus/ui/customfdialog.cpp
trunk/Scribus/scribus/ui/storyeditor.cpp
Modified: trunk/Scribus/scribus/ui/customfdialog.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24842&path=/trunk/Scribus/scribus/ui/customfdialog.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/customfdialog.cpp (original)
+++ trunk/Scribus/scribus/ui/customfdialog.cpp Sat Jan 29 23:08:39 2022
@@ -138,8 +138,8 @@
QFileInfo fi(name);
if (fi.isDir())
return;
- int w = pixmap()->width();
- int h = pixmap()->height();
+ int w = pixmap().width();
+ int h = pixmap().height();
bool mode = false;
QString ext = fi.suffix().toLower();
QString formatD(FormatsManager::instance()->extensionListForFormat(FormatsManager::IMAGESIMGFRAME, 1));
@@ -177,7 +177,7 @@
QPainter p;
QBrush b(QColor(205, 205, 205), IconManager::instance().loadPixmap("testfill.png"));
// Qt4 FIXME imho should be better
- pm = *pixmap();
+ pm = pixmap();
p.begin(&pm);
p.fillRect(0, 0, w, h - 44, b);
p.fillRect(0, h - 44, w, 44, QColor(255, 255, 255));
@@ -215,7 +215,7 @@
im = im.scaled(w - 5, h - 21, Qt::KeepAspectRatio, Qt::SmoothTransformation);
QPainter p;
QBrush b(QColor(205, 205, 205), IconManager::instance().loadPixmap("testfill.png"));
- pm = *pixmap();
+ pm = pixmap();
p.begin(&pm);
p.fillRect(0, 0, w, h - 21, b);
p.fillRect(0, h - 21, w, 21, QColor(255, 255, 255));
@@ -240,7 +240,7 @@
im = im.scaled(w - 5, h - 21, Qt::KeepAspectRatio, Qt::SmoothTransformation);
QPainter p;
QBrush b(QColor(205, 205, 205), IconManager::instance().loadPixmap("testfill.png"));
- pm = *pixmap();
+ pm = pixmap();
p.begin(&pm);
p.fillRect(0, 0, w, h - 21, b);
p.fillRect(0, h - 21, w, 21, QColor(255, 255, 255));
@@ -356,7 +356,7 @@
QSpacerItem* spacer2 = new QSpacerItem( 2, 2, QSizePolicy::Expanding, QSizePolicy::Minimum );
Layout1C->addItem( spacer2 );
vboxLayout->addWidget(LayoutC);
- fileDialog->setFileMode(QFileDialog::DirectoryOnly);
+ fileDialog->setFileMode(QFileDialog::Directory);
fileDialog->forceDoubleClickActivation(false);
filePreview->hide();
showPreview->setVisible(false);
@@ -547,7 +547,7 @@
if (selFile.isEmpty())
return;
QFileInfo fi(selFile);
- if (fi.isDir() && (fileDialog->fileMode() != QFileDialog::DirectoryOnly))
+ if (fi.isDir() && (fileDialog->fileMode() != QFileDialog::Directory))
fileDialog->gotoSelectedDirectory();
else
accept();
Modified: trunk/Scribus/scribus/ui/storyeditor.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24842&path=/trunk/Scribus/scribus/ui/storyeditor.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/storyeditor.cpp (original)
+++ trunk/Scribus/scribus/ui/storyeditor.cpp Sat Jan 29 23:08:39 2022
@@ -43,6 +43,7 @@
#include <QPalette>
#include <QPixmap>
#include <QRegExp>
+#include <QRegularExpression>
#include <QScopedPointer>
#include <QScopedValueRollback>
#include <QScreen>
@@ -481,7 +482,7 @@
QString addedChars = cursor.selectedText();
if (addedChars.length() > 0)
{
- addedChars.replace(QString(0x2029), SpecialChars::PARSEP);
+ addedChars.replace(QChar(0x2029), SpecialChars::PARSEP);
StyledText.insertChars(position, addedChars, true);
}
//qDebug("handleContentsChange : - %01d, + %01d, len %01d", charsRemoved, charsAdded, addedChars.length());
@@ -1055,10 +1056,10 @@
QString data = QApplication::clipboard()->text(QClipboard::Clipboard);
if (!data.isEmpty())
{
- data.replace(QRegExp("\r"), "");
+ data.replace(QRegularExpression("\r"), "");
// newParaCount=data.count("\n");
// lengthLastPara=data.length()-data.lastIndexOf("\n");
- data.replace(QRegExp("\n"), SpecialChars::PARSEP);
+ data.replace(QRegularExpression("\n"), SpecialChars::PARSEP);
// inserted=true;
advanceLen = data.length() /*- newParaCount*/;
insertCharsInternal(data, pos);
@@ -3365,8 +3366,8 @@
QString txt;
if (Serializer::readWithEncoding(fileName, textEncoding, txt))
{
- txt.replace(QRegExp("\r"), "");
- txt.replace(QRegExp("\n"), QChar(13));
+ txt.replace(QRegularExpression("\r"), "");
+ txt.replace(QRegularExpression("\n"), QChar(13));
Editor->loadText(txt, m_item);
seActions["editPaste"]->setEnabled(false);
seActions["editCopy"]->setEnabled(false);
More information about the scribus-commit
mailing list