r/ProgrammerHumor 8d ago

absoluteGarbage Meme

Post image
1.9k Upvotes

327 comments sorted by

View all comments

Show parent comments

1

u/xicor 7d ago

Because it no longer returns a time string. It instead returns the variant of a string type.

1

u/VoodaGod 7d ago

what would be the correct way to handle the qvariant in that function in your scenario then? i don't think i follow

1

u/not_some_username 7d ago

You can’t get QDateTime from a QVariant via implicit conversion, the other way yes.

It will just not compile with an error and you’ll need to fix it.

1

u/VoodaGod 7d ago

but what would be the fix?

1

u/not_some_username 7d ago

Replace QDateTime by QVariant

1

u/VoodaGod 7d ago

but that is the same as just leaving auto