I am using Qt 4.1: In a QTableWidget I am storing a void* pointer as the data for a QTableWidgetItem. As the application is filling the rows (driven from an outside source) I may get a crash resulting from:
QVariant::compare: type 128 unknown to QVariant. In release mode the program just goes away.
I am not sure what 'type 128' means with respect to QVariant. Every place I use QVariant with the void*, I use QVariant::UserType ( == 127 ).
Using the same input, this does not happen every time nor in the same place (possibly a timing thing.) The code driving the input is mature and well tested by other applications so it's clear the error is in my stuff.
I also get dozens of "QFont: It is not safe to use text and fonts outside the gui thread" debug text, but nowhere in the code is QFont used.
// All data is set using Qt::UserRole
v.setValue( pData ); // pData is a void*
item( nRow, nCol )->setData( Qt::UserRole, v );
// All data is retrieved using Qt::UserRole
void* pData = item( nRow, nCol )->data( Qt::UserRole ).value<void*>();
// All data is set using Qt::UserRole
Variant v( QVariant::UserType );
v.setValue( pData ); // pData is a void*
item( nRow, nCol )->setData( Qt::UserRole, v );
// All data is retrieved using Qt::UserRole
void* pData = item( nRow, nCol )->data( Qt::UserRole ).value<void*>();
To copy to clipboard, switch view to plain text mode
1) Can someone explain the error: QVariant::compare: type 128 unknown to QVariant?
2) What can cause the QFont message and could this have something to do with the QVariant problem?
Bookmarks