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. Passing signal from QML to C++ with parameter
QtWS25 Last Chance

Passing signal from QML to C++ with parameter

Scheduled Pinned Locked Moved QML and Qt Quick
2 Posts 2 Posters 1.1k 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.
  • P Offline
    P Offline
    psbhardwaj09gmail.com
    wrote on last edited by
    #1

    Hi,
    I have an application where i want to pass signal from qml to c++.
    code in qml as

    signal blockUri(int uri)

    mainView.blockUri(index)// calling signal

    in c++ is as

    QObject *rootObject = mpView->rootObject();
    QObject::connect(rootObject, SIGNAL(blockUri(int)), this, SLOT(printData(int)));

    void someclass::printData(int uri)
    {
    qDebug()<<"Text From QML:"<<uri;
    }

    but text is not printing in C++ code.
    i know i am doing something wrong.
    So please any one can help me.

    Pardeep Sharma

    1 Reply Last reply
    0
    • A Offline
      A Offline
      aabc
      wrote on last edited by
      #2

      Can you write the exact connect command you using ?

      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