Results 1 to 2 of 2

Thread: A Signal with Parameter from Qt C++ to QML

  1. #1
    Join Date
    May 2009
    Location
    Austria
    Posts
    21
    Qt products
    Qt4
    Platforms
    Windows

    Default A Signal with Parameter from Qt C++ to QML

    Hello,

    i have a little problem...
    the problem is that i want to send from my Qt C++ class (QDeclarativeItem) a signal to my qml-file with parameter.

    for example my .h:
    Qt Code:
    1. signals: void sendString(QString text);
    To copy to clipboard, switch view to plain text mode 
    in my .cpp file:
    Qt Code:
    1. emit sendString("Testtext");
    To copy to clipboard, switch view to plain text mode 

    in my qml-file ??
    i don`t know how do get the signal and how do i came to my string.

    when i send a empty signal, it works great, but with parameter i don`t know how to do.
    maybye you can help me

  2. #2
    Join Date
    May 2009
    Location
    Austria
    Posts
    21
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: A Signal with Parameter from Qt C++ to QML

    the main problem for me is, how do i can get some strings, int`s etc. from my c++ file to my qml-file.

    i mean i have for example some data that i read in from the network - when i receive this data - i want to send them do my qml-file and show it there. i want to do only the graphic in qml - all other things in my qt c++ class.

Similar Threads

  1. Slot - Signal with parameter
    By Lodhart in forum Newbie
    Replies: 8
    Last Post: 10th April 2013, 11:08
  2. Replies: 3
    Last Post: 26th August 2011, 08:17
  3. Struggling with signal which has a default parameter.
    By JPNaude in forum Qt Programming
    Replies: 21
    Last Post: 21st January 2011, 09:40
  4. Replies: 2
    Last Post: 6th July 2009, 13:53
  5. Replies: 3
    Last Post: 3rd May 2009, 15:15

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.