Results 1 to 5 of 5

Thread: What Doxygen tag should I use when a function emits a signal?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2014
    Posts
    36
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default What Doxygen tag should I use when a function emits a signal?

    I'm trying to document my code using doxygen, and I'm trying to figure out what the correct tag (if any exists) to use.

    I've got a member function that is called whenever an internal QTimer's timeout() signal is emitted. When this happens, this class emits a signal of it's own to notify external class that the timeout happened. So here's my current documentation and function:

    Qt Code:
    1. /**
    2.  * @brief Called when timer times out
    3.  *
    4.  * This function is called when the timer times out.
    5.  * Emits sigTimeout().
    6.  */
    7. void myClass::slotTimeout()
    8. {
    9. qDebug("Slot timeout, stopping timer");
    10. mTimer->stop(); // stop timer if it isn't already
    11. emit sigTimeout();
    12. }
    To copy to clipboard, switch view to plain text mode 

    So I'd like for the generated HTML documentation for this function to have the "sigTimeout()" as a hyperlink that takes the reader back to the signal documentation. Right now it just shows up as plain text.

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,349
    Qt products
    Qt5
    Platforms
    Windows
    Thanks
    318
    Thanked 872 Times in 859 Posts

    Default Re: What Doxygen tag should I use when a function emits a signal?

    I don't know if there is a Qt signal-specific tag. I'm not a doxygen guru. I usually use the "see also" (sa) tag followed by the name of the signal.

    Apparently there are some Qt-specific tags, because you see things like "[signal]" in Qt documentation. Maybe the best way is to find a bit of Qt documentation that looks like what you want, then search the source code to see how it is tagged.

  3. #3
    Join Date
    Oct 2012
    Posts
    132
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows Android
    Thanks
    10
    Thanked 21 Times in 21 Posts

    Default Re: What Doxygen tag should I use when a function emits a signal?

    How is the signal declared (did you really use the uncommon "sig"-prefix)? Prints doxygen any error messages?

    Normally doxygen should be able to detect signals proberly. You can document signals itself like you would document pure virtual methods (using "\fn ..."). Does this work?

  4. #4
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,349
    Qt products
    Qt5
    Platforms
    Windows
    Thanks
    318
    Thanked 872 Times in 859 Posts

    Default Re: What Doxygen tag should I use when a function emits a signal?

    I think the OP is asking how to document the fact that a function emits a signal, not the declaration of the signal itself.

Similar Threads

  1. Replies: 2
    Last Post: 26th October 2013, 05:40
  2. QProcess finishes but never emits finished signal
    By BettaUseYoNikes in forum Qt Programming
    Replies: 2
    Last Post: 3rd December 2011, 08:01
  3. Passing pointer to object that emits a signal
    By Gadgetman53 in forum Qt Programming
    Replies: 2
    Last Post: 17th April 2011, 21:04
  4. Replies: 3
    Last Post: 2nd April 2011, 13:13
  5. Replies: 4
    Last Post: 23rd January 2011, 10:08

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.