forked from LubosD/twinkle
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
qt5+: Switch from
QRegExp
to QRegularExpression
`QRegularExpression` was introduced in Qt 5.0 as a successor to `QRegExp`, and while it is still supported under Qt6 (via `Core5Compat`), the corresponding `QRegExpValidator` is not. Hence, migrating will be required before being able to port to Qt 6 (LubosD#297). While `QRegularExpressionValidator` is not always a drop-in replacement for `QRegExp` (see the documentation¹ for details), in our case, it is. Our use doesn't run into any of the situations listed, while our only instance of `exactMatch()` uses a pattern that is already anchored. ¹ https://doc.qt.io/qt-5/qregularexpression.html#notes-for-qregexp-users
- Loading branch information
Showing
9 changed files
with
50 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,9 +5,9 @@ | |
#include "util.h" | ||
#include "audits/memman.h" | ||
#include "sys_settings.h" | ||
#include <QRegExp> | ||
#include <QRegularExpression> | ||
#include <QValidator> | ||
#include <QRegExpValidator> | ||
#include <QRegularExpressionValidator> | ||
|
||
/* | ||
Copyright (C) 2005-2009 Michel de Boer <[email protected]> | ||
|
@@ -46,8 +46,8 @@ void InviteForm::init() | |
setDisabledIcon(addressToolButton, ":/icons/images/kontact_contacts-disabled.png"); | ||
|
||
// A QComboBox accepts a new line through copy/paste. | ||
QRegExp rxNoNewLine("[^\\n\\r]*"); | ||
inviteComboBox->setValidator(new QRegExpValidator(rxNoNewLine, this)); | ||
QRegularExpression rxNoNewLine("[^\\n\\r]*"); | ||
inviteComboBox->setValidator(new QRegularExpressionValidator(rxNoNewLine, this)); | ||
} | ||
|
||
void InviteForm::destroy() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters