Thanks for the quick reply.
I get similar error messages when inheriting from QObject:
1>c:\users\dave\my software\stats helper\heat_message.h(127): error C2248: 'QObject:perator =' : cannot access private member declared in class 'QObject'
1> c:\opencv\dep\qt\qt-everywhere-opensource-src-4.8.2\include\qtcore\../../src/corelib/kernel/qobject.h(333) : see declaration of 'QObject:perator ='
1> c:\opencv\dep\qt\qt-everywhere-opensource-src-4.8.2\include\qtcore\../../src/corelib/kernel/qobject.h(112) : see declaration of 'QObject'
1> This diagnostic occurred in the compiler generated function 'HeatMessage &HeatMessage:perator =(const HeatMessage &)'
1> main_window.cpp
1>c:\users\dave\my software\stats helper\heat_message.h(127): error C2248: 'QObject::QObject' : cannot access private member declared in class 'QObject'
1> c:\opencv\dep\qt\qt-everywhere-opensource-src-4.8.2\include\qtcore\../../src/corelib/kernel/qobject.h(333) : see declaration of 'QObject::QObject'
1> c:\opencv\dep\qt\qt-everywhere-opensource-src-4.8.2\include\qtcore\../../src/corelib/kernel/qobject.h(112) : see declaration of 'QObject'
1> This diagnostic occurred in the compiler generated function 'HeatMessage::HeatMessage(const HeatMessage &)'
1> moc_collect_stats.cpp
1>c:\users\dave\my software\stats helper\heat_message.h(127): error C2248: 'QObject::QObject' : cannot access private member declared in class 'QObject'
1> c:\opencv\dep\qt\qt-everywhere-opensource-src-4.8.2\include\qtcore\../../src/corelib/kernel/qobject.h(333) : see declaration of 'QObject::QObject'
1> c:\opencv\dep\qt\qt-everywhere-opensource-src-4.8.2\include\qtcore\../../src/corelib/kernel/qobject.h(112) : see declaration of 'QObject'
1> This diagnostic occurred in the compiler generated function 'HeatMessage::HeatMessage(const HeatMessage &)'
1> moc_main_window.cpp
1>c:\users\dave\my software\stats helper\heat_message.h(127): error C2248: 'QObject::QObject' : cannot access private member declared in class 'QObject'
1> c:\opencv\dep\qt\qt-everywhere-opensource-src-4.8.2\include\qtcore\../../src/corelib/kernel/qobject.h(333) : see declaration of 'QObject::QObject'
1> c:\opencv\dep\qt\qt-everywhere-opensource-src-4.8.2\include\qtcore\../../src/corelib/kernel/qobject.h(112) : see declaration of 'QObject'
1> This diagnostic occurred in the compiler generated function 'HeatMessage::HeatMessage(const HeatMessage &)'
1> Generating Code...
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:07.10
It compiles fine without the Q_OBJECT and inheritance from QObject.
Do I need a different constructor that passes 0 to the Bo
Here's the relevant part of header file:
#ifndef HEAT_MESSAGE_H
#define HEAT_MESSAGE_H
#include <QtCore/QCoreApplication>
#include <QRegExp>
#include <QMap>
#include <iostream>
#include <fstream>
#include <QTextStream>
#include <QWidget>
{
Q_OBJECT
public:
HeatMessage(void);
QList<HeatRecord> heat_records;
float get_time(char lane, char id);
float get_sum_time(char lane);
char get_result(char lane);
int get_race(void) {return heat_records.begin()->get_race();};
int get_heat(void) {return heat_records.begin()->get_heat();};
int num_dogs(char lane);
#ifndef HEAT_MESSAGE_H
#define HEAT_MESSAGE_H
#include <QtCore/QCoreApplication>
#include <QRegExp>
#include <QMap>
#include <iostream>
#include <fstream>
#include <QTextStream>
#include <QWidget>
class HeatMessage : public QObject
{
Q_OBJECT
public:
HeatMessage(QByteArray &,QObject *parent=0);
HeatMessage(void);
QList<HeatRecord> heat_records;
float get_time(char lane, char id);
float get_sum_time(char lane);
char get_result(char lane);
int get_race(void) {return heat_records.begin()->get_race();};
int get_heat(void) {return heat_records.begin()->get_heat();};
int num_dogs(char lane);
static void print_header(QTextStream &);
void print(char lane, QTextStream &);
void print(QTextStream &);
To copy to clipboard, switch view to plain text mode
};
#endif
Bookmarks