Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add null QVariant constructor #312

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

direc85
Copy link
Contributor

@direc85 direc85 commented Aug 5, 2024

QVariant::default() yields an undefined value in QML, but in many places a null value is more suited. Add QVariant::null() function to achieve that. The test added help distinguishing this.

I would have used QVariant(nullptr) instead, but that doesn't seem to work well with the type system in Qt5. The QJsonValue().toVariant() is the next best option - and makes sense, since a JSON can also have an explicit null value.

@direc85 direc85 force-pushed the null-qvariant branch 2 times, most recently from e26c6b0 to 9fe1dc3 Compare August 5, 2024 10:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant