Skip to content

use Variant alias types everywhere in place of QVariant#48320

Merged
jkarneges merged 1 commit intomainfrom
jkarneges/use-variant-alias
Apr 9, 2026
Merged

use Variant alias types everywhere in place of QVariant#48320
jkarneges merged 1 commit intomainfrom
jkarneges/use-variant-alias

Conversation

@jkarneges
Copy link
Copy Markdown
Member

This follows up on #48319 by updating the whole codebase to use the aliases. This PR includes the following changes:

  • Use Variant everywhere instead of QVariant.
  • Use VariantHash everywhere instead of QVariantHash.
  • Use VariantMap everywhere instead of QVariantMap.
  • Use VariantList everywhere instead of QVariantList.
  • Replace all #include <QVariant*> directives with #include "variant.h".
  • Add an include guard to qtcompat.h.

Since the types are aliases to the Qt types, the code still actually uses the Qt types and compiles to the same thing, so there should be no change in behavior.

Note that even with these changes, call sites are not fully Qt-free. For example, the QHashIterator type is used to iterate VariantHash, and variant types are compared against enum values like QMetaType::QVariantHash. These will be addressed later.

@jkarneges jkarneges requested a review from a team April 9, 2026 16:56
@jkarneges jkarneges merged commit 38b405b into main Apr 9, 2026
19 checks passed
@jkarneges jkarneges deleted the jkarneges/use-variant-alias branch April 9, 2026 17: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.

2 participants