0

I would like to be able to convert a std string to a QVariant.

#include<vector>
#include <QMetaType>   

using namespace std;
Q_DECLARE_METATYPE(vector<int>)
int main()
{ 
vector <int> blabla;
QVariant wanted=QVariant(blabla)
}

no matching function for call to 'QVariant::QVariant(std::vector&)' QVariant organsizes=QVariant(this->organsizes);

How can I solve this?

  • 1
    Possible duplicate of [convert function return from ‘std::vector’ to ‘QVariant’](https://stackoverflow.com/questions/9805023/convert-function-return-from-stdvectorqstring-to-qvariant) – eyllanesc May 31 '18 at 22:06
  • `std vector ` or `std string` .. correct yourself. – Mohammad Kanan May 31 '18 at 22:57

0 Answers0