79414397

Date: 2025-02-05 10:24:15
Score: 2
Natty:
Report link

Compilation works now that the inclusion inside the class has been moved outside:

headerWorking.h
#ifndef HEADER_WORKING_H
#define HEADER_WORKING_H

#include <QObject>
#include <qqml.h>
#include "header1.h"

class ClassWorking: public QObject
{
    Q_OBJECT
    QML_ELEMENT
public:
    Q_ENUM(TestType_t)
    .
    .
    .
};
#endif
headerNotWorking.h
#ifndef HEADER_NOT_WORKING_H
#define HEADER_NOT_WORKING_H

#include <QObject>
#include <qqml.h>
#include "header1.h"

class ClassNotWorking: public QObject
{
    Q_OBJECT
    QML_ELEMENT
public:
    Q_ENUM(TestType_t)
    Q_INVOKABLE void foo(TestType_t testType);
    .
    .
    .
};
#endif

I just recently started working on this project and didn't question why the inclusion happened inside the class.

Thanks @Some programmer dude and @Marek R

Reasons:
  • Blacklisted phrase (0.5): Thanks
  • Long answer (-0.5):
  • Has code block (-0.5):
  • User mentioned (1): @Some
  • User mentioned (0): @Marek
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: user44791