Results 1 to 4 of 4

Thread: QML's autogenerated signal handlers with C++ declared signals

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    May 2013
    Posts
    1
    Thanked 1 Time in 1 Post

    Default QML's autogenerated signal handlers with C++ declared signals

    Hey all,

    I have a program that I’m working on which uses QML. I’m relatively new to it. I’m finding some features are extremely useful and others are rather confusing. Currently, I’m trying to work with signals which are declared in my “workhorse” class (a QThread which processes data) and QML’s signal handlers that are supposed to be automatically created for them.

    The problem is that my QML doesn’t seem to see them. Essentially, I’m expecting it to simply look like this:

    Qt Code:
    1. class WorkHorse : public QThread
    2. {
    3. //...header code...
    4.  
    5. signals:
    6. void myValueChanged();
    7.  
    8. //...more header code...
    9. }
    10.  
    11. //...QML initializations...
    12. //...QML file beginning...
    13. Item{
    14. //...QML code...
    15.  
    16. onMyValueChanged: someOtherItem.text = someValue;
    17.  
    18. //...More QML code...
    19. }
    To copy to clipboard, switch view to plain text mode 


    Most everything else works in the interactions between QML and my workhorse but all I get is red squigglies for the “onMyValueChanged” part of my code. It hasn’t made it or can’t see it. If I type “workHorse.” and hit CTRL+Space the intellisense will show me “onMyValueChanged” as an option. If I choose it, however, “workHorse” gets redsquigglied. Deleting “workHorse” gets me red squigglies on the signal handler name.

    If you guys could help me change what I need to change I’d appreciate it. Perhaps some includes in the project files or adding Q_INVOKABLE to something or rebuilding or qmake… I’m just not sure what I’m missing. Thanks.

  2. The following user says thank you to CHerit for this useful post:


Similar Threads

  1. [Signals & Slots] Custom class' signal not detected
    By Mr_Cloud in forum Qt Programming
    Replies: 5
    Last Post: 26th July 2012, 10:35
  2. Replies: 0
    Last Post: 26th September 2011, 23:14
  3. Problem with signal handlers
    By chiru in forum Qt Quick
    Replies: 0
    Last Post: 11th November 2010, 07:57
  4. Properly close database handlers
    By ruben.rodrigues in forum Newbie
    Replies: 5
    Last Post: 23rd September 2010, 16:10
  5. Mapping menu actions to handlers
    By xtal256 in forum Qt Programming
    Replies: 1
    Last Post: 25th August 2010, 07:41

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
  •  
Qt is a trademark of The Qt Company.