From 9915e229a2f88227f3e8ccc0a8c60ea7de1d1946 Mon Sep 17 00:00:00 2001 From: Alexandru Fikl Date: Sun, 10 Mar 2024 16:06:02 +0200 Subject: [PATCH] porting: remove deprecated flag init --- app/editreplacewidget.cpp | 4 ++-- app/tikzeditor.cpp | 2 +- app/tikzeditorview.h | 7 ++++--- common/utils/file.h | 2 +- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/app/editreplacewidget.cpp b/app/editreplacewidget.cpp index 38b4286..8858164 100644 --- a/app/editreplacewidget.cpp +++ b/app/editreplacewidget.cpp @@ -91,7 +91,7 @@ void ReplaceWidget::doFind() if (ui.comboBoxFind->findText(currentText) < 0) ui.comboBoxFind->addItem(currentText); - QTextDocument::FindFlags flags = 0; + QTextDocument::FindFlags flags = QTextDocument::FindFlags(); if (ui.checkBoxCaseSensitive->isChecked()) flags |= QTextDocument::FindCaseSensitively; if (ui.checkBoxWholeWords->isChecked()) @@ -112,7 +112,7 @@ void ReplaceWidget::doReplace() if (ui.comboBoxReplace->findText(replacementText) < 0) ui.comboBoxReplace->addItem(replacementText); - QTextDocument::FindFlags flags = 0; + QTextDocument::FindFlags flags = QTextDocument::FindFlags(); if (ui.checkBoxCaseSensitive->isChecked()) flags |= QTextDocument::FindCaseSensitively; if (ui.checkBoxWholeWords->isChecked()) diff --git a/app/tikzeditor.cpp b/app/tikzeditor.cpp index 2c124af..2b5790a 100644 --- a/app/tikzeditor.cpp +++ b/app/tikzeditor.cpp @@ -505,7 +505,7 @@ void TikzEditor::keyPressEvent(QKeyEvent *event) else if (event->key() == Qt::Key_Tab || event->key() == Qt::Key_Backtab) { QTextCursor cursor = textCursor(); QTextBlock block = cursor.block(); - QTextDocument::FindFlags flags = 0; + QTextDocument::FindFlags flags = QTextDocument::FindFlags(); if (event->key() == Qt::Key_Backtab) flags = QTextDocument::FindBackward; if (cursor.hasSelection() && cursor.selectedText().contains(QChar::ParagraphSeparator)) { diff --git a/app/tikzeditorview.h b/app/tikzeditorview.h index 097fba0..db8cba1 100644 --- a/app/tikzeditorview.h +++ b/app/tikzeditorview.h @@ -88,12 +88,13 @@ private Q_SLOTS: void editReplace(); void tabIndent(bool isUnindenting = false); void indent(QChar insertChar, int numOfInserts, bool isUnindenting = false); - bool search(const QString &text, QTextDocument::FindFlags flags = 0, bool startAtCursor = true, - bool continueFromBeginning = false); + bool search(const QString &text, QTextDocument::FindFlags flags = QTextDocument::FindFlags(), + bool startAtCursor = true, bool continueFromBeginning = false); void search(); void replace(const QString &replacement); void replace(const QString &text, const QString &replacement, - QTextDocument::FindFlags flags = 0, bool startAtCursor = true); + QTextDocument::FindFlags flags = QTextDocument::FindFlags(), + bool startAtCursor = true); void replace(); void replaceAll(); diff --git a/common/utils/file.h b/common/utils/file.h index ca76412..10afa6f 100644 --- a/common/utils/file.h +++ b/common/utils/file.h @@ -100,7 +100,7 @@ class File : public QObject File(const QUrl &url, const OpenMode &mode); ~File(); - bool open(const QFile::OpenMode &mode = 0); + bool open(const QFile::OpenMode &mode = QFile::OpenMode()); bool close(); QFile *file(); QString errorString() const;