Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
qtws26_logo

The Qt Event of the Year: Qt World Summit 2026

Save Your Spot >
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. QDoc probelm: no Qt-specific types are detected.
Qt 6.12 LTS is out! See what's new in the release blog

QDoc probelm: no Qt-specific types are detected.

Scheduled Pinned Locked Moved Solved Qt Creator and other tools
10 Posts 3 Posters 2.2k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Ankalagon
    wrote on last edited by
    #1

    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.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      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.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • A Offline
        A Offline
        Ankalagon
        wrote on last edited by
        #3

        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_H
        
        

        myclass.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
        
        
        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Shouldn't fn be the first line ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • A Offline
            A Offline
            Ankalagon
            wrote on last edited by
            #5

            Sadly that doesnt change anything.

            1 Reply Last reply
            0
            • JoeCFDJ Offline
              JoeCFDJ Offline
              JoeCFD
              wrote on last edited by
              #6

              Just curious(not doc related): how can sampleFunc(qreal input) be called since m_pThis is static?

              A 1 Reply Last reply
              0
              • SGaistS Offline
                SGaistS Offline
                SGaist
                Lifetime Qt Champion
                wrote on last edited by
                #7

                Which version of Qt are you using ?
                On which OS ?

                Interested in AI ? www.idiap.ch
                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                1 Reply Last reply
                0
                • A Offline
                  A Offline
                  Ankalagon
                  wrote on last edited by
                  #8

                  I'm using Qt 5.15.2 on openSUSE 15.3

                  1 Reply Last reply
                  0
                  • JoeCFDJ JoeCFD

                    Just curious(not doc related): how can sampleFunc(qreal input) be called since m_pThis is static?

                    A Offline
                    A Offline
                    Ankalagon
                    wrote on last edited by
                    #9

                    @JoeCFD

                    MyClass *mc = MyClass::instance();
                    qDebug() << mc->sampleFunc(1);
                    
                    1 Reply Last reply
                    0
                    • A Offline
                      A Offline
                      Ankalagon
                      wrote on last edited by
                      #10

                      Hm, strange. When I use qdoc-6 it works as intended. Maybe something is broken.

                      1 Reply Last reply
                      0

                      • Login

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • Users
                      • Groups
                      • Search
                      • Get Qt
                      • Unsolved