Conversation
| var modelValue = testModel.get(i, sorter.roleName); | ||
| verify(modelValue === sorter.expectedValues[i], | ||
| "Expected testModel value " + sorter.expectedValues[i] + ", actual: " + modelValue); | ||
| let actualValues = []; |
There was a problem hiding this comment.
This results in clearer error messages:
FAIL! : SortFilterProxyModel::RoleSorterTests::test_roleSorters(mixedCaseStringRole) Compared values are not the same
Actual (): [A,C,D,b,e]
Expected (): [A,b,C,D,e]
Loc: [/Users/mitch/dev/SortFilterProxyModel/tests/tst_rolesorter.qml(67)]
| for (var i = 0; i < testModel.count; i++) { | ||
| actualValues.push(testModel.get(i, sorter.roleName)); | ||
| } | ||
| compare(actualValues, sorter.expectedValues); |
There was a problem hiding this comment.
There is one failing test that I don't know how to fix:
FAIL! : SortFilterProxyModel::StringSorterTests::test_stringSorters(doNotIgnorePunctuation) Compared values are not the same
Actual (): [a-a,aa,b-b,b-c,b.c,bc]
Expected (): [aa,a-a,b.c,b-b,bc,b-c]
Loc: [/Users/mitch/dev/SortFilterProxyModel/tests/tst_stringsorter.qml(82)]
There was a problem hiding this comment.
Yeah this test is finnicky, it depends on ICU. I think it passes on Windows
There was a problem hiding this comment.
I blacklisted it on macOS.
|
About the QVariant compare, does it work for bools ? Could you add QDate/QTime/QDateTime support ? |
Not currently, but I can make it. Not sure what it should do though... so I just made false < true. |
The PatternSyntax enum had to be removed as QRegularExpression only supports Perl-compatible regular expressions. As QVariant's comparison operators were removed, a simplified comparison is now done as a starting point, but should probably be extended to support more types. Fixes oKcerG#84 Fixes oKcerG#86
cmake: fix c++17 build requirement for msvc
I was getting the following error:
/usr/bin/ld: isle/3rdparty/SortFilterProxyModel/CMakeFiles/SortFilterProxyModel.dir/SortFilterProxyModel_autogen/mocs_compilation.cpp.o: relocation R_X86_64_PC32 against symbol `__asan_option_detect_stack_use_after_return' can not be used when making a shared object; recompile with -fPIC
And:
/home/mitch/dev/bgv/isle/3rdparty/SortFilterProxyModel/qqmlsortfilterproxymodel.cpp:1: error: In included file: "You must build your code with position independent code if Qt was configured with -reduce-relocations. " "Compile your code with -fPIC (and not with -fPIE)."
Initially I fixed this with:
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
but was told the proper solution is to add the missing
target_link_libraries.
|
Have an additional commit in MenloSystems:qt6 that allows compiling against Qt5 and Qt6 from the same codebase. |
Which implementation is preferable: |
|
Why not use built-in variant comparison? https://doc.qt.io/qt-6/qvariant.html#compare |
|
Qt added support for SortFilterProxyModel in 6.10: https://doc-snapshots.qt.io/qt6-dev/qml-qtqml-models-sortfilterproxymodel.html |
The PatternSyntax enum had to be removed as QRegularExpression only
supports Perl-compatible regular expressions.
As QVariant's comparison operators were removed, a simplified
comparison is now done as a starting point, but should probably
be extended to support more types.
Fixes #84
Fixes #86