Results 1 to 5 of 5

Thread: Signal and slot connection graph

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Oct 2006
    Posts
    8
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Question Signal and slot connection graph

    Hi. I was wondering if there is any application out there which can take a Qt project file, scan the source files and draw the signal/slot connection graph. I'm looking for something in the lines of
    qtobjectinspector, but I'm really only interested in a static connection graph, i.e. sort of a class diagram showing the connections between signals and slots. It wouldn't take into account that signals and slots actually are connected between class instances and not classes.

    I guess I'm just lazy, but for my current project it would help in getting and overview of the application.

    Thanks

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Signal and slot connection graph

    It wouldn't take into account that signals and slots actually are connected between class instances and not classes.
    What do you mean "it wouldn't"?
    Signals and slot ARE only between instances, not between classes.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  3. #3
    Join Date
    Oct 2006
    Posts
    8
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Signal and slot connection graph

    Exactly. Signals and slots are between instances. And I would like to autogenerate a "class diagram" displaying connections between signals and slots, _ignoring_ that very fact. If there is ever a connection made between an object of ClassA and an object of ClassB, then I want to show this connection in the diagram. Maybe to most, this doesn't seem like a very helpful feature, but to me it does. It would help me to get a _sketchy_ overview of the app, and I put ephasis on sketchy. Some apps are driven by signals triggering the execution of slots more than others, and sometimes it can be difficult to get a quick overview. But I take it from your answer that there isn't any such utility around, as such a diagram wouldn't be an entirely correct representation, so I won't keep looking.

  4. #4
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Signal and slot connection graph

    But I take it from your answer that there isn't any such utility around, as such a diagram wouldn't be an entirely correct representation, so I won't keep looking.
    Well, the fact I don't know any doesn't mean there are none.
    I would be surprised if you would find such an application through, since it make no sense to have this feature - except in in your view of your case.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  5. #5
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Signal and slot connection graph

    It's possible to do such a graph using grep, sed or awk (or both) and graphviz. First grep your sources for connect statements and extract the data from them (sender, signal, receiver, slot), then grep sources again to find classes for each of the sender and receiver objects and then use graphviz to create a graph.

Similar Threads

  1. signal and slot across threads having event loop
    By travis in forum Qt Programming
    Replies: 6
    Last Post: 5th November 2007, 23:56
  2. Replies: 2
    Last Post: 16th August 2007, 00:20
  3. signal slot connection
    By Big Duck in forum Newbie
    Replies: 2
    Last Post: 4th July 2006, 13:31
  4. signal not getting communicated to slot
    By quickNitin in forum Qt Programming
    Replies: 17
    Last Post: 2nd June 2006, 04:56
  5. signal slot conection using a string, not a SLOT
    By rianquinn in forum Qt Programming
    Replies: 6
    Last Post: 5th February 2006, 18:52

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.