Qt 6.12 LTS is out! See what's new in the release
blog
QDoc probelm: no Qt-specific types are detected.
-
Hi,
I've the following problem when using qdoc:
everything that has to do with qt-specific types like "qreal". "QString" etc. is not recognized. The generated files show only "int" as type.
When using the \fn tag there is a warning:(qdoc) warning: clang couldn't find function when parsing \fn qreal MyClass::sampleFunc(qreal input)I'm very new to QDoc so I'm a little lost here.
-
Hi,
Can you share the header and code of that class ?
From the looks of it, it seems to not find the implementation of the function. -
Sorry, forgot about that.
myclass.h:
#ifndef MYCLASS_H #define MYCLASS_H #include <QtCore> #include <QObject> #include <QQuickItem> class MyClass : public QObject { Q_OBJECT Q_DISABLE_COPY(MyClass) QML_SINGLETON public: explicit MyClass(QObject *parent = nullptr); static MyClass *instance(); static QObject* qmlInstance(QQmlEngine *engine, QJSEngine* scriptEngine); void registerTypes() { qmlRegisterSingletonType<MyClass>("MyClass",1,0,"MyClass",&MyClass::qmlInstance); } qreal sampleFunc(qreal input); private: static MyClass *m_pThis; }; #endif // MYCLASS_Hmyclass.cpp:
#include "myclass.h" MyClass *MyClass::m_pThis = nullptr; MyClass *MyClass::instance() { if(m_pThis == nullptr) { m_pThis = new MyClass; } return m_pThis; } MyClass::MyClass(QObject *parent) : QObject(parent) { registerTypes(); } /*! * \brief MyClass::sampleFunc. * \fn qreal MyClass::sampleFunc(qreal input) * \a input */ qreal MyClass::sampleFunc(qreal input) { return input; }MyClass.qdoc:
/*! \class MyClass \inmodule MyClass \title MyClass */MyClass.qdocconf:
project = MyClass description = MyClass Doc sourcedirs = . headerdirs = . sources.fileextensions = "*.cpp *.qdoc *.mm *.qml" headers.fileextensions = "*.h *.ch *.h++ *.hh *.hpp *.hxx" outputdir = ./html outputformats = HTML -
Shouldn't fn be the first line ?
-
Which version of Qt are you using ?
On which OS ? -
Just curious(not doc related): how can sampleFunc(qreal input) be called since m_pThis is static?