Bug 438999 - QVariant assignment (-Wclazy-qt6-deprecated-api-fixes)
Summary: QVariant assignment (-Wclazy-qt6-deprecated-api-fixes)
Status: RESOLVED FIXED
Alias: None
Product: clazy
Classification: Developer tools
Component: general (show other bugs)
Version: unspecified
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: Jörg Bornemann
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-06-21 14:55 UTC by Jonas Kvinge
Modified: 2021-06-30 13:22 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jonas Kvinge 2021-06-21 14:55:13 UTC
SUMMARY
QVariant assignment (-Wclazy-qt6-deprecated-api-fixes)

STEPS TO REPRODUCE
The following code gives warning:

QVariant variant;
QString string;
variant = string;


OBSERVED RESULT
warning:  operator does not exist in Qt6. Using QVariant::compare() instead [-Wclazy-qt6-deprecated-api-fixes]


EXPECTED RESULT
No warning.

Is this a bug?
I'm compiling with Qt dev branch and it does compile and work.
Changing it setValue instead does not produce the warning: variant.setValue(string);

SOFTWARE/OS VERSIONS
Qt Version: Latest dev branch
clazy version: 1.9
clang version: 12.0.0
Comment 1 Sergio Martins 2021-06-21 19:29:45 UTC
Maybe also fixed in master
Comment 2 Nicolas Fella 2021-06-30 12:46:43 UTC
This is still happening in master
Comment 3 Bug Janitor Service 2021-06-30 13:01:38 UTC
A possibly relevant merge request was started @ https://invent.kde.org/sdk/clazy/-/merge_requests/43
Comment 4 Nicolas Fella 2021-06-30 13:05:43 UTC
Git commit e223fd501c5835eb46048681d84d4db7887221c7 by Nicolas Fella.
Committed on 30/06/2021 at 13:02.
Pushed by smartins into branch 'master'.

Fix container find operation

Make sure we compare with the end of the correct container

M  +1    -1    src/checks/manuallevel/qt6-deprecated-api-fixes.cpp

https://invent.kde.org/sdk/clazy/commit/e223fd501c5835eb46048681d84d4db7887221c7
Comment 5 Sergio Martins 2021-06-30 13:22:43 UTC
Git commit 83a41301e72cf30a8be1fa9c3eba7173a298c958 by Sergio Martins, on behalf of Nicolas Fella.
Committed on 30/06/2021 at 13:07.
Pushed by smartins into branch '1.9'.

Fix container find operation

Make sure we compare with the end of the correct container
(cherry picked from commit e223fd501c5835eb46048681d84d4db7887221c7)

M  +1    -1    src/checks/manuallevel/qt6-deprecated-api-fixes.cpp

https://invent.kde.org/sdk/clazy/commit/83a41301e72cf30a8be1fa9c3eba7173a298c958