Results 1 to 4 of 4

Thread: Static connection analysis tool?

  1. #1
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,233
    Thanks
    303
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Static connection analysis tool?

    I am wondering if there is a tool for static analysis of SIGNAL-SLOT connections in source code. When using Visual Studio to run an app in debug mode, Qt will report when connect() is called with non-existent SIGNAL or SLOT methods. In general, however, these message are output only when the connect() code is executed, so unless you exercise all parts of the UI, you may not see all of the incomplete connections in the code. When making changes to code that involve renaming signals, slots, or changes to their signatures, it is often easy to miss something that needs to be fixed after the change.

    Is there a tool that will statically analyze source code and identify these dangling connections?

    I am aware of Conan, but this is a run-time analyzer.

  2. #2
    Join Date
    Jul 2009
    Location
    Enschede, Netherlands
    Posts
    462
    Thanked 69 Times in 67 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Static connection analysis tool?

    In Qt 5 it is likely that you will be able to do connections using the function pointers:

    Qt Code:
    1. connect(sender, &Sender::someSignal, receiver, &Receiver::someSlot)
    To copy to clipboard, switch view to plain text mode 

    However, the precise syntax hasn't been definitively decided on. This will give you compile-time checking.
    Horse sense is the thing that keeps horses from betting on people. --W.C. Fields

    Ask Smart Questions

  3. The following user says thank you to franz for this useful post:

    d_stranz (24th September 2011)

  4. #3
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,233
    Thanks
    303
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Static connection analysis tool?

    Thanks. That will be very nice when that happens. Slots and signals are one of the best features of Qt, but also the hardest to maintain.

  5. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,360
    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: Static connection analysis tool?

    Be aware some slots or signals are generated on the fly during runtime so such errors may not be possible to be deteremined in some cases.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Replies: 0
    Last Post: 15th August 2011, 20:17
  2. Static code analysis tool for application developed using Qt
    By newtolinux in forum Qt Programming
    Replies: 4
    Last Post: 29th March 2011, 23:14
  3. Gambit - genome alignment viewer and analysis workbench
    By pezmaster31 in forum Qt-based Software
    Replies: 1
    Last Post: 10th June 2010, 18:33
  4. Grouping of Tool buttons in Tool bar
    By febil in forum Qt Programming
    Replies: 1
    Last Post: 24th March 2009, 11:51
  5. View Shed Analysis
    By csvivek in forum Qt Programming
    Replies: 0
    Last Post: 24th April 2008, 11:01

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.