sedi
15th August 2012, 13:35
Hi,
my project is quite big (174 files as of now) so I can't really put up the code here, I'll try to provide the essential parts (see below).
Nonetheless I would ask you to help me to understand a runtime error message:
can't find linker symbol for virtual table for `QString::Data' value
found `QString::shared_null' instead
This appears when I instantiate a QObject derived class. There are several QStrings being passed to the object with the construction.
The above error message appears when both of the following facts are given:
One of the QStrings is empty (doesn't matter if I pass an empty String variable, "" or QString("))
I have a breakpoint inside the object
A signal that should be emitted from that QObject is *not* being emitted in case of 1..
I have tried to narrow down the problem, but as of now it seems to be in the very moment of construction.
I thought it was perfectly normal to pass empty Strings - isn't it?
I have cleaned, run qmake, built everything new, restarted QtCreator, erased the -pro-user file - all to no avail.
Any ideas how to hunt down this problem?
I have a tendency of not knowing basic things because I've only started c++/Qt about a year ago.
Header of the abstract class:
class AbstractApp: public QObject
{
Q_OBJECT
public:
AbstractApp(QString passedAppName,
QString kursName,
QString passedRoomId,
MyModel* myModel,
MyRoomModel* passedRoomModel,
MySchedModel* passedSchedModel,
ClassroomGraphicsScene *scene,
QObject *parent);
//and much more
Implementation of the abstract class:
AbstractApp::AbstractApp(QString passedAppName,
QString kursName,
QString passedRoomId,
MyModel* parentModel,
MyRoomModel* passedRoomModel,
MySchedModel* passedSchedModel,
ClassroomGraphicsScene *scene,
QObject *parent)
:QObject(parent)
{
//much
}
Header of a derived class:
class App_Raumbau : public AbstractApp
{
Q_OBJECT
public:
App_Raumbau(QString passedAppName,
QString kursName,
QString passedRoomId,
QVector<TischKlasse*> passedTischVektor,
MyModel* parentModel,
MyRoomModel* passedRoomModel,
MySchedModel* passedSchedModel,
ClassroomGraphicsScene *scene,
QObject *parent);
//and much more
Implementation of a derived class:
App_Raumbau::App_Raumbau(QString passedAppName,
QString kursName,
QString passedRoomId,
QVector<TischKlasse*> passedTischVektor,
MyModel *parentModel,
MyRoomModel *passedRoomModel,
MySchedModel* passedSchedModel,
ClassroomGraphicsScene *scene,
QObject *parent)
:AbstractApp(passedAppName,
kursName,
passedRoomId,
parentModel,
passedRoomModel,
passedSchedModel,
scene,
parent)
{ //much
I can assure the pointers are not the problem - the error message depends on empty strings:
Constructing in mainWindow.cpp (gives error message):
app=new App_Raumbau("Raumbau", "Test", "", this->tischVektor, this->model,this->roomModel, this->schedModel, this->scene, 0);
Constructing in mainWindow.cpp (gives NO error message):
app=new App_Raumbau("Raumbau", "Test", "Test", this->tischVektor, this->model,this->roomModel, this->schedModel, this->scene, 0);
my project is quite big (174 files as of now) so I can't really put up the code here, I'll try to provide the essential parts (see below).
Nonetheless I would ask you to help me to understand a runtime error message:
can't find linker symbol for virtual table for `QString::Data' value
found `QString::shared_null' instead
This appears when I instantiate a QObject derived class. There are several QStrings being passed to the object with the construction.
The above error message appears when both of the following facts are given:
One of the QStrings is empty (doesn't matter if I pass an empty String variable, "" or QString("))
I have a breakpoint inside the object
A signal that should be emitted from that QObject is *not* being emitted in case of 1..
I have tried to narrow down the problem, but as of now it seems to be in the very moment of construction.
I thought it was perfectly normal to pass empty Strings - isn't it?
I have cleaned, run qmake, built everything new, restarted QtCreator, erased the -pro-user file - all to no avail.
Any ideas how to hunt down this problem?
I have a tendency of not knowing basic things because I've only started c++/Qt about a year ago.
Header of the abstract class:
class AbstractApp: public QObject
{
Q_OBJECT
public:
AbstractApp(QString passedAppName,
QString kursName,
QString passedRoomId,
MyModel* myModel,
MyRoomModel* passedRoomModel,
MySchedModel* passedSchedModel,
ClassroomGraphicsScene *scene,
QObject *parent);
//and much more
Implementation of the abstract class:
AbstractApp::AbstractApp(QString passedAppName,
QString kursName,
QString passedRoomId,
MyModel* parentModel,
MyRoomModel* passedRoomModel,
MySchedModel* passedSchedModel,
ClassroomGraphicsScene *scene,
QObject *parent)
:QObject(parent)
{
//much
}
Header of a derived class:
class App_Raumbau : public AbstractApp
{
Q_OBJECT
public:
App_Raumbau(QString passedAppName,
QString kursName,
QString passedRoomId,
QVector<TischKlasse*> passedTischVektor,
MyModel* parentModel,
MyRoomModel* passedRoomModel,
MySchedModel* passedSchedModel,
ClassroomGraphicsScene *scene,
QObject *parent);
//and much more
Implementation of a derived class:
App_Raumbau::App_Raumbau(QString passedAppName,
QString kursName,
QString passedRoomId,
QVector<TischKlasse*> passedTischVektor,
MyModel *parentModel,
MyRoomModel *passedRoomModel,
MySchedModel* passedSchedModel,
ClassroomGraphicsScene *scene,
QObject *parent)
:AbstractApp(passedAppName,
kursName,
passedRoomId,
parentModel,
passedRoomModel,
passedSchedModel,
scene,
parent)
{ //much
I can assure the pointers are not the problem - the error message depends on empty strings:
Constructing in mainWindow.cpp (gives error message):
app=new App_Raumbau("Raumbau", "Test", "", this->tischVektor, this->model,this->roomModel, this->schedModel, this->scene, 0);
Constructing in mainWindow.cpp (gives NO error message):
app=new App_Raumbau("Raumbau", "Test", "Test", this->tischVektor, this->model,this->roomModel, this->schedModel, this->scene, 0);