Deklaration
Code: Alles auswählen
QMap<QPixmap, QPointF> Area;
Code: Alles auswählen
void TEST::dropEvent(QDropEvent *event)
{
if (event->mimeData()->hasFormat("image/terrain-piece")) {
QByteArray pieceData = event->mimeData()->data("image/terrain-piece");
QDataStream dataStream(&pieceData, QIODevice::ReadOnly);
QPixmap pixmap;
dataStream >> pixmap;
//Area.insert(pixmap, QPointF(mouse_pos.x() - pixmap.width(), mouse_pos.y() - pixmap.height() ) );
Area[pixmap] = *(new QPointF) ;
event->setDropAction(Qt::MoveAction);
event->accept();
}
else
event->ignore();
}
Code: Alles auswählen
../../../Qt/4.3.1/include/QtCore/../../src/corelib/tools/qmap.h:99: error: no match for 'operator<' in 'key1 < key2'Code: Alles auswählen
template <class Key> inline bool qMapLessThanKey(const Key &key1, const Key &key2)
{
return key1 < key2;
}