I am trying to do something like this:
Qt Code:
QVariantMap payload; payload["children"] = d.entryInfoList();To copy to clipboard, switch view to plain text mode
but the compiler doesn't seem to have an 'operator=':
I know that qRegisterMetaType<QFileInfo>("QFileInfo"); goes in there somewhere, plus the Q_DECLARE_METATYPE ( QFileInfo ) but I can't seem to figure out where... no combination works. I think Q_DECLARE_METATYPE ( QFileInfo ) goes at the top, and qRegisterMetaType goes in the function, before the assignment.fileserverWindow.cpp:50: error: no match for 'operator=' in '(+ payload)->QMap<Key, T>::operator[] [with Key = QString, T = QVariant](((const QString&)(& QString(((const char*)"children"))))) = QDir::entryInfoList(QFlags<QDir::Filter>, QFlags<QDir::SortFlag>) const(QFlags<QDir::Filter>(NoFilter), QFlags<QDir::SortFlag>(NoSort))'
How do I assign QFileInfoList to a QVariant?
Bookmarks