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. Q_ARG return type in Qt 6.5

Q_ARG return type in Qt 6.5

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 4 Posters 751 Views 1 Watching
  • 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.
  • F Offline
    F Offline
    flatland3r
    wrote on last edited by
    #1

    According to the documentation here, Q_ARG should return a QGenericArgument; however, in my testing it is returning a QMetaMethodArgument.

    The following simple line which worked in Qt 5.15:

    QGenericArgument arg = Q_ARG(int,1);
    

    has an error in Qt 6.5, "No viable conversion from 'QMetaMethodArgument' to 'QGenericArgument'. What am I doing wrong, or is this a mistake in the docs?

    Christian EhrlicherC A 2 Replies Last reply
    0
    • F flatland3r

      According to the documentation here, Q_ARG should return a QGenericArgument; however, in my testing it is returning a QMetaMethodArgument.

      The following simple line which worked in Qt 5.15:

      QGenericArgument arg = Q_ARG(int,1);
      

      has an error in Qt 6.5, "No viable conversion from 'QMetaMethodArgument' to 'QGenericArgument'. What am I doing wrong, or is this a mistake in the docs?

      Christian EhrlicherC Online
      Christian EhrlicherC Online
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      This seems to be an oversight in the documentation - I would suggess creating a bug report so the documentation gets fixed.

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      1 Reply Last reply
      0
      • F flatland3r

        According to the documentation here, Q_ARG should return a QGenericArgument; however, in my testing it is returning a QMetaMethodArgument.

        The following simple line which worked in Qt 5.15:

        QGenericArgument arg = Q_ARG(int,1);
        

        has an error in Qt 6.5, "No viable conversion from 'QMetaMethodArgument' to 'QGenericArgument'. What am I doing wrong, or is this a mistake in the docs?

        A Offline
        A Offline
        Asperamanca
        wrote on last edited by
        #3

        @flatland3r
        In any case, since the returned class is part of private API and not supposed to be used directly, I would suggest

        auto arg = Q_ARG(int,1);
        
        1 Reply Last reply
        1
        • M Offline
          M Offline
          mrcoffee
          wrote on last edited by
          #4

          I reviewed the old code and added the following definition:

          #define Q_ARG_OLD(type, data) QArgument<type >(#type, data)
          
          1 Reply Last reply
          0

          • Login

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