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. cant passing 'QList<QSqlRecord>&'
QtWS25 Last Chance

cant passing 'QList<QSqlRecord>&'

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 5 Posters 659 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.
  • R Offline
    R Offline
    rifky
    wrote on last edited by
    #1

    Hi,
    I found the error at my debug log

    QObject::connect: Cannot queue arguments of type 'QList<QSqlRecord>&'
    (Make sure 'QList<QSqlRecord>&' is registered using qRegisterMetaType().)
    

    how can i pass the QList<QSqlRecord>& with signal slot ?

    JonBJ Christian EhrlicherC 2 Replies Last reply
    0
    • R rifky

      Hi,
      I found the error at my debug log

      QObject::connect: Cannot queue arguments of type 'QList<QSqlRecord>&'
      (Make sure 'QList<QSqlRecord>&' is registered using qRegisterMetaType().)
      

      how can i pass the QList<QSqlRecord>& with signal slot ?

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by JonB
      #2

      @rifky
      You cannot have QList<QObject-type>, QObjects are not copyable. I'm guessing you might mean QList<QSqlRecord &> or QList<QSqlRecord *>?

      Furthermore, the fact that you only find this in some runtime log rather than at compile-time indicates to me that you are using the old-style SIGNAL/SLOT() macros. You would get this right at compile-time if you changed over to https://wiki.qt.io/New_Signal_Slot_Syntax, which is highly recommended.

      1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Hi,

        @rifky The error message already tels you what to do, however using a reference in a signal is pretty unusual. When passing containers around, it's more common to use const references to avoid unnecessary duplication.

        @JonB QSqlRecord is not QObject based. It can be copied without problem.

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        JonBJ R 2 Replies Last reply
        1
        • SGaistS SGaist

          Hi,

          @rifky The error message already tels you what to do, however using a reference in a signal is pretty unusual. When passing containers around, it's more common to use const references to avoid unnecessary duplication.

          @JonB QSqlRecord is not QObject based. It can be copied without problem.

          JonBJ Offline
          JonBJ Offline
          JonB
          wrote on last edited by
          #4

          @SGaist said in cant passing 'QList<QSqlRecord>&':

          @JonB QSqlRecord is not QObject based

          Well it ought to be ;-) Yeah, OK, I didn't check!

          1 Reply Last reply
          0
          • SGaistS SGaist

            Hi,

            @rifky The error message already tels you what to do, however using a reference in a signal is pretty unusual. When passing containers around, it's more common to use const references to avoid unnecessary duplication.

            @JonB QSqlRecord is not QObject based. It can be copied without problem.

            R Offline
            R Offline
            rifky
            wrote on last edited by
            #5

            @SGaist

            is it like this ?

            void executeOneTime2(const QString &queryId, const QString &sql,const QList<QSqlRecord> recs, int &last_insert_id, bool &returnUD);
            
            jsulmJ 1 Reply Last reply
            0
            • R rifky

              Hi,
              I found the error at my debug log

              QObject::connect: Cannot queue arguments of type 'QList<QSqlRecord>&'
              (Make sure 'QList<QSqlRecord>&' is registered using qRegisterMetaType().)
              

              how can i pass the QList<QSqlRecord>& with signal slot ?

              Christian EhrlicherC Offline
              Christian EhrlicherC Offline
              Christian Ehrlicher
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @rifky said in cant passing 'QList<QSqlRecord>&':

              how can i pass the QList<QSqlRecord>& with signal slot ?

              The error messsage tells you exactly what you have to do: Make sure 'QList<QSqlRecord>&' is registered using qRegisterMetaType()

              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
              1
              • R rifky

                @SGaist

                is it like this ?

                void executeOneTime2(const QString &queryId, const QString &sql,const QList<QSqlRecord> recs, int &last_insert_id, bool &returnUD);
                
                jsulmJ Offline
                jsulmJ Offline
                jsulm
                Lifetime Qt Champion
                wrote on last edited by
                #7

                @rifky said in cant passing 'QList<QSqlRecord>&':

                const QList<QSqlRecord> recs

                Const reference is

                const QList<QSqlRecord> &recs
                

                https://forum.qt.io/topic/113070/qt-code-of-conduct

                1 Reply Last reply
                1

                • Login

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