Class contains Q_OBJECT macro error ?
-
wrote on 9 Feb 2023, 15:04 last edited by Anonymous_Banned275 2 Sept 2023, 15:33
Class contains Q_OBJECT macro ....
why am I getting the error - basically missing inheritance.
I do follow the QtCreator "add class ....
If that is not sufficient , how do I add inheritance using SAME "add class" .
It looks as I have to use anther process to add the inheritance...Not sure it can be used when the initial "build class " is not completed.
/mnt/07b7c3f8-0efb-45ab-8df8-2a468771de1f/PROJECTS/JAN21/BLUETOOTH/SOURCE/CCC_SOURCE/configuration.h:8: error: Class contains Q_OBJECT macro but does not inherit from QObject
#ifndef CONFIGURATION_H
#define CONFIGURATION_H#include <QObject>
class Configuration
{
Q_OBJECT
public:
Configuration();
};#endif // CONFIGURATION_H
#ifndef CONFIGURATION_H
#define CONFIGURATION_H#include <QObject>
class Configuration
{
Q_OBJECT
public:
Configuration();
};#endif // CONFIGURATION_H
SOLVED
For unknown reason my initial usage of "Define Class" had the <Custom> option grayed out / disabled . -
Class contains Q_OBJECT macro ....
why am I getting the error - basically missing inheritance.
I do follow the QtCreator "add class ....
If that is not sufficient , how do I add inheritance using SAME "add class" .
It looks as I have to use anther process to add the inheritance...Not sure it can be used when the initial "build class " is not completed.
/mnt/07b7c3f8-0efb-45ab-8df8-2a468771de1f/PROJECTS/JAN21/BLUETOOTH/SOURCE/CCC_SOURCE/configuration.h:8: error: Class contains Q_OBJECT macro but does not inherit from QObject
#ifndef CONFIGURATION_H
#define CONFIGURATION_H#include <QObject>
class Configuration
{
Q_OBJECT
public:
Configuration();
};#endif // CONFIGURATION_H
#ifndef CONFIGURATION_H
#define CONFIGURATION_H#include <QObject>
class Configuration
{
Q_OBJECT
public:
Configuration();
};#endif // CONFIGURATION_H
SOLVED
For unknown reason my initial usage of "Define Class" had the <Custom> option grayed out / disabled .@AnneRanch said in Class contains Q_OBJECT macro error ?:
Class contains Q_OBJECT macro but does not inherit from QObject
This error message tells you exactly where the problem is - you added Q_OBJECT but do not derive from QObject.
-
1/2