Fixes #578
Only made sure the code builds, not sure how to test.
Concept ACK.
As a preparation to Qt 6, I think this PR will benefit by incorporating of https://github.com/bitcoin/bitcoin/commit/f6adcadf643c3e3375d234ef0d0987f20bc9869b and https://github.com/bitcoin/bitcoin/commit/b649103d0554055470ea00cb46489c43c90796c9 in any reasonable way.
As a preparation to Qt 6, I think this PR will benefit by incorporating of bitcoin/bitcoin@f6adcad and bitcoin/bitcoin@b649103 in any reasonable way.
It seems the CI is failing because it does not recognize filterRegularExpression and indeed it was introduced in Qt 5.12 while we still do support Qt 5.11.
I updated the second commit of the PR to use QT_VERSION check - see 54980a7994a13fa77b80503ba8574490e80c9649
Does it make sense to extract the "Extract first suffix from filter pattern..." functionality into a testable utility function?
not sure how to test.
Here is a branch with tests for the AddressBookPage class -- https://github.com/hebasto/gui/commits/220423-test-ab
And test fails for the 54980a7994a13fa77b80503ba8574490e80c9649 commit.
<!--e57a25ab6845829454e8d69fc972939a-->
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
<!--174a7506f384e20aa4161008e828411d-->
Reviewers, this pull request conflicts with the following ones:
QRegularExpression in AddressBookSortFilterProxyModel class by hebasto)If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.
43 | @@ -44,8 +44,7 @@ HelpMessageDialog::HelpMessageDialog(QWidget *parent, bool about) : 44 | /// HTML-format the license message from the core 45 | QString licenseInfoHTML = QString::fromStdString(LicenseInfo()); 46 | // Make URLs clickable 47 | - QRegExp uri("<(.*)>", Qt::CaseSensitive, QRegExp::RegExp2); 48 | - uri.setMinimal(true); // use non-greedy matching 49 | + QRegularExpression uri("<(.*)>", QRegularExpression::InvertedGreedinessOption); // use non-greedy matching
A comment seems unneeded here because QRegularExpression::InvertedGreedinessOption is pretty self-explained.
Addressed in db71143629850e8c9bef22991ae054a0ae82c7ca
46 | @@ -46,12 +47,19 @@ class AddressBookSortFilterProxyModel final : public QSortFilterProxyModel 47 | 48 | auto address = model->index(row, AddressTableModel::Address, parent); 49 | 50 | + #if (QT_VERSION >= QT_VERSION_CHECK(5, 12, 0))
slight preference for flipping this around where we're checking if less than qt6, i think this makes the code cleaner and inline with how we've done some other qt6 preparation changes, but not a blocker
Current implementation allows to test without Qt 6.
<!--cf906140f33d8803c4a75a2196329ecb-->
🐙 This pull request conflicts with the target branch and needs rebase.
<sub>Want to unsubscribe from rebase notifications on this pull request? Just convert this pull request to a "draft".</sub>
I won't be able to work on this PR in the following days/weeks. Feel free to push into my branch (maintainers are allowed) or take over the PR completely if needed.