Skip to content

replace deprecated QVariant::canConvert with templated version#4434

Merged
Be-ing merged 1 commit intomixxxdj:mainfrom
Be-ing:canConvert
Oct 16, 2021
Merged

replace deprecated QVariant::canConvert with templated version#4434
Be-ing merged 1 commit intomixxxdj:mainfrom
Be-ing:canConvert

Conversation

@Be-ing
Copy link
Copy Markdown
Contributor

@Be-ing Be-ing commented Oct 16, 2021

No description provided.

Copy link
Copy Markdown
Member

@Swiftb0y Swiftb0y left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see anywhere in the Qt docs that the Metatype based version got deprecated, though I guess using the templated version may allow the compiler to optimize more.

@Be-ing
Copy link
Copy Markdown
Contributor Author

Be-ing commented Oct 16, 2021

@Swiftb0y
Copy link
Copy Markdown
Member

Right, passing the int got deprecated, but passing the member of the QVariant::Type enum is still valid. I'm not sure what overload exactly we were calling in the previous version, but it seemed to be the overload taking the enum member.

@Be-ing
Copy link
Copy Markdown
Contributor Author

Be-ing commented Oct 16, 2021

The enum is an int.

QVariant was rewritten in Qt6 to use QMetaType. https://doc.qt.io/qt-6/qtcore-changes-qt6.html#meta-type-system

@Be-ing Be-ing merged commit 28be756 into mixxxdj:main Oct 16, 2021
@Be-ing Be-ing deleted the canConvert branch October 16, 2021 19:12
@Swiftb0y
Copy link
Copy Markdown
Member

Sorry, waited for CI yesterday but then forgot to merge once it passed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants