Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Can't QML send rect type to c++?
Forum Updated to NodeBB v4.3 + New Features

Can't QML send rect type to c++?

Scheduled Pinned Locked Moved Solved QML and Qt Quick
5 Posts 3 Posters 371 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.
  • M Offline
    M Offline
    mirro
    wrote on last edited by mirro
    #1

    error:No suck signal when I replace the string with rect in the follow code.

    QObject* pObj = (QObject*)pQuickWidget->rootObject();
    connect(pObj,SIGAL(sendRect(QRect)),this,SLOT(onRecvRect(QRect)))
    
    Item{
           signal sendRect(rect rct)
    
    }
    
    J.HilkJ 1 Reply Last reply
    0
    • A Offline
      A Offline
      Allon
      wrote on last edited by
      #2

      @mirro said in Why are error:No suck signal when signal sent with rect param from QML into C++:

      SIGAL

      I did not test but did you forget a N ? SIGAL -> SIGNAL ?

      1 Reply Last reply
      0
      • M mirro

        error:No suck signal when I replace the string with rect in the follow code.

        QObject* pObj = (QObject*)pQuickWidget->rootObject();
        connect(pObj,SIGAL(sendRect(QRect)),this,SLOT(onRecvRect(QRect)))
        
        Item{
               signal sendRect(rect rct)
        
        }
        
        J.HilkJ Offline
        J.HilkJ Offline
        J.Hilk
        Moderators
        wrote on last edited by
        #3

        @mirro Is item the root object, possibly not,

        please post more code


        Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


        Q: What's that?
        A: It's blue light.
        Q: What does it do?
        A: It turns blue.

        M 2 Replies Last reply
        0
        • J.HilkJ J.Hilk

          @mirro Is item the root object, possibly not,

          please post more code

          M Offline
          M Offline
          mirro
          wrote on last edited by mirro
          #4

          @J-Hilk

          My test results are of type String and there is no problem

          //c++
          QQuickWidget* pQuickWidget = new QQuickWidget(this);
          QObject* pObj = (QObject*)pQuickWidget->rootObject();
          connect(pObj,SIGNAL(sendRect(QString)),this,SLOT(onRecvRect(QString)))
          
          //qml
          Item{
                 signal sendRect(string strRct)
          
          }
          
          1 Reply Last reply
          0
          • J.HilkJ J.Hilk

            @mirro Is item the root object, possibly not,

            please post more code

            M Offline
            M Offline
            mirro
            wrote on last edited by mirro
            #5
            This post is deleted!
            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