Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Qt6: create QVariant with specific QMetaType
QtWS25 Last Chance

Qt6: create QVariant with specific QMetaType

Scheduled Pinned Locked Moved Unsolved General and Desktop
qt6qvariantqmetatype
1 Posts 1 Posters 378 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    voltron
    wrote on 3 Oct 2022, 10:17 last edited by
    #1

    I'm porting an app from Qt5 to Qt6. This app heavily uses QVariants and one of the use-cases is creating invalid QVariant with the specific QVariant::Type, for example

    return QVariant( QVariant::Double );
    

    In Qt6 QVariant::Type was replaced with QMetaType::Type, but when I make corresponding changes in the code

    return QVariant( QMetaType::Double );
    

    I get following error

    error: use of deleted function ‘QVariant::QVariant(QMetaType::Type)’
    

    According to the docs such constructor still exists, so I'm a bit lost what is wrong and how to fix this error.

    1 Reply Last reply
    0

    1/1

    3 Oct 2022, 10:17

    • Login

    • Login or register to search.
    1 out of 1
    • First post
      1/1
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved