Reputation: 11
Can anyone help me reading the text from QByteArray as iam new to Qt. Also its a internal drag and drop from QTreeWidget to a QFrame. How can i get the QTreeWidgetItem if i am dragging the item from Qtrewidgetitem to QFrame in dropEvent function?
void DragWidget::dropEvent(QDropEvent *event)
{
if (event->mimeData()->hasFormat("application/x-
abstractitemmodeldatalist")) {
QByteArray i
temData = event->mimeData()->data("application/x-
abstractitemmodeldatalist");
//how to read the string from itemData//mystring is 'LDA'
Upvotes: 0
Views: 370
Reputation: 458
QByteArray encapsulates chars. Either access them directly using [] operator or use data or constData member functions that return a (const) pointer to c char array.
Upvotes: 1