August 18, 2011

sierdzio sierdzio
Area 51 Engineer
2545 posts

QDoc not generating code for overloaded static method

 

Hi!

As those of you following Qt5-feedback may know, I am currently writing QWebService. All’s going well, except one detail I encountered:
in QDoc, \overload does not seem to include a static overloaded method. It also refuses to include it in generated doc when I declare it as a separate \fn. No errors are reported. Any thoughts on solving that? Or maybe it’s a bug/ feature ( :) )?

Below, I post relevant part of the code, full source (including resulting QDoc) can be found at https://gitorious.org/qwebservice

  1.  
  2. /*!
  3.     \fn QWebMethod::sendMessage()
  4.  
  5.     Sends the message asynchronously, assuming that all neccessary data was specified earlier.
  6.     Returns true on success.
  7.  
  8.     \sa setParameters(), setProtocol(), setTargetNamespace()
  9.   */
  10. bool QWebMethod::sendMessage()
  11. {
  12.     // Body. This gets included in QDoc.
  13.     return true;
  14. }
  15.  
  16. /*!
  17.     \overload sendMessage()
  18.  
  19.     Sends the message asynchronously using parameters specified in \a params.
  20.   */
  21. bool QWebMethod::sendMessage(QMap<QString, QVariant> params)
  22. {
  23.     // Body. This also gets included in QDoc.
  24.     return true;
  25. }
  26.  
  27. /*!
  28.   \overload sendMessage()
  29.  
  30.      STATIC method. Sends the message synchronously, using \a url, \a _messageName, \a params and \a parent.
  31.      Protocol can optionally be specified by \a protocol (default is SOAP 1.2), as well as HTTP \a method
  32.      (default is POST).
  33.      Returns with web service reply.
  34.   */
  35. QVariant QWebMethod::sendMessage(QObject *parent, QUrl url,
  36.                                  QString _messageName, QMap<QString, QVariant> params,
  37.                                  Protocol protocol, HttpMethod method)
  38. {
  39.     // Body. Yes, return type is different than in other methods. QDoc does not include that method.
  40. }

 Signature 

(Z(:^

5 replies

August 18, 2011

peppe peppe
Ant Farmer
1026 posts

How does QObject::connect do it? :)

 Signature 

Software Engineer
KDAB (UK) Ltd., a KDAB Group company

August 18, 2011

sierdzio sierdzio
Area 51 Engineer
2545 posts

I’ve tried making it similar to QDoc in QObject, thanks for the hint. But it still does not work. The only difference is that I at least get an error message:

  1. ./sources/qwebmethod.cpp:308: Cannot find 'sendMessage(...)' in '\fn'
  2.     [I cannot find any function of that name with the specified signature. Make sure that the signature is identical to the declaration, including 'const' qualifiers.]

For code (I’ve also tried many other combinations, to no avail):

  1. /*!
  2.   \fn QVariant QWebMethod::sendMessage(QObject *parent, QUrl url, QString _messageName, QMap<QString, QVariant> params, Protocol protocol, HttpMethod httpMethod)
  3.   \overload sendMessage()
  4.  
  5.      STATIC method. Sends the message synchronously, using \a url, \a _messageName, \a params and \a parent.
  6.      Protocol can optionally be specified by \a protocol (default is SOAP 1.2), as well as HTTP \a method
  7.      (default is POST).
  8.      Returns with web service reply.
  9.   */
  10. QVariant QWebMethod::sendMessage(QObject *parent, QUrl url,
  11.                                  QString _messageName, QMap<QString, QVariant> params,
  12.                                  Protocol protocol, HttpMethod method)
  13. {
  14.     // Body.
  15. }

 Signature 

(Z(:^

October 30, 2011

sierdzio sierdzio
Area 51 Engineer
2545 posts

I’ve checked the code today, and it still does not get generated… Not a big problem for me, as I know the method is there, but other people may have problems with that.

I’ve removed the “\fn” statements in the code, it has not helped this case. Method is now located in QWebServiceMethod [gitorious.org] class. The resulting doc file can be found here [gitorious.org]. All other docs are generated without problems (well, almost. QDoc seems to also be quite selective when it comes to Q_PROPERTY documentation).

 Signature 

(Z(:^

October 31, 2011

Andre Andre
Area 51 Engineer
6076 posts

Perhaps you can bring this up at the qt-project development mailinglist? I think QDoc should be properly documented and maintained for non-nokians to be able to make decent, documented ccode ontributions. Perhaps a move to doxygen could even be considdered?

 Signature 

Looking for Qt developers to join our team @ i-Optics: https://qt-project.org/forums/viewthread/25393/

October 31, 2011

sierdzio sierdzio
Area 51 Engineer
2545 posts

Might be a good idea, thanks.

I think doxygen was being discussed back in the qt5-feedback days, and was voted down on the basis of it being to much work to transfer. There were some problem with using it for QML, too. Not that QDoc performs there amazingly, it seems to have undergone extensive hacking to allow Qt Quick documentation.

Anyway, thanks, I think I will raise the subject on development-request soon(-ish).

 Signature 

(Z(:^

 
  ‹‹ New build system for Qt?      square wave runs fine in terminal but not in Qt Creator[SOLVED] ››

You must log in to post a reply. Not a member yet? Register here!