Hello,
I am new to Qt and it could be that the answer to my question is really simple but still I can't find it. I have two threads in my application. One of them is gui thread and the other is database query thread. I have queued connections between these two and they work fine but I need to share data across them. I tried to use Q_DECLARE_METATYPE macro
Q_DECLARE_METATYPE (QSqlQueryModel)
To copy to clipboard, switch view to plain text mode
and I get the following error:
/usr/local/Trolltech/Qt-4.3.4/include/QtCore/qabstractitemmodel.h: In copy constructor 'QSqlQueryModel::QSqlQueryModel(const QSqlQueryModel&)':
/usr/local/Trolltech/Qt-4.3.4/include/QtSql/qsqlquerymodel.h:60: instantiated from 'void* qMetaTypeConstructHelper(const T*) [with T = QSqlQueryModel]'
/usr/local/Trolltech/Qt-4.3.4/include/QtCore/qmetatype.h:151: instantiated from 'int qRegisterMetaType(const char*, T*) [with T = QSqlQueryModel]'
database.h:62: instantiated from here
/usr/local/Trolltech/Qt-4.3.4/include/QtCore/qabstractitemmodel.h:324: error: 'QAbstractTableModel::QAbstractTableModel(const QAbstractTableModel&)' is private
/usr/local/Trolltech/Qt-4.3.4/include/QtSql/qsqlquerymodel.h:60: error: within this context
/usr/local/Trolltech/Qt-4.3.4/include/QtCore/qmetatype.h: In function 'void* qMetaTypeConstructHelper(const T*) [with T = QSqlQueryModel]':
/usr/local/Trolltech/Qt-4.3.4/include/QtCore/qmetatype.h:126: note: synthesized method 'QSqlQueryModel::QSqlQueryModel(const QSqlQueryModel&)' first required here
/usr/local/Trolltech/Qt-4.3.4/include/QtCore/qabstractitemmodel.h: In copy constructor 'QSqlQueryModel::QSqlQueryModel(const QSqlQueryModel&)':
/usr/local/Trolltech/Qt-4.3.4/include/QtSql/qsqlquerymodel.h:60: instantiated from 'void* qMetaTypeConstructHelper(const T*) [with T = QSqlQueryModel]'
/usr/local/Trolltech/Qt-4.3.4/include/QtCore/qmetatype.h:151: instantiated from 'int qRegisterMetaType(const char*, T*) [with T = QSqlQueryModel]'
database.h:62: instantiated from here
/usr/local/Trolltech/Qt-4.3.4/include/QtCore/qabstractitemmodel.h:324: error: 'QAbstractTableModel::QAbstractTableModel(const QAbstractTableModel&)' is private
/usr/local/Trolltech/Qt-4.3.4/include/QtSql/qsqlquerymodel.h:60: error: within this context
/usr/local/Trolltech/Qt-4.3.4/include/QtCore/qmetatype.h: In function 'void* qMetaTypeConstructHelper(const T*) [with T = QSqlQueryModel]':
/usr/local/Trolltech/Qt-4.3.4/include/QtCore/qmetatype.h:126: note: synthesized method 'QSqlQueryModel::QSqlQueryModel(const QSqlQueryModel&)' first required here
To copy to clipboard, switch view to plain text mode
I know that later I need to use qRegisterMetatype function but I even didn't get that far.
I am using linux/gcc with eclipse and Qt 4.3.
Thank you in advance for any help you offer.
Bookmarks