如何将结构值添加到QStringList?

时间:2017-10-17 13:38:56

标签: c++ qt vector struct qstring

我正在尝试将存储在vector中的值复制为空QStringList(如下面的代码所示):

QStringList acceptedIPListFromFile()
{
..............

    // Read the file until the end
    while(!inFile.eof())
    {
        getline (inFile,line);

        string token;
        stringstream stream(line);          
        vector<string> vect;
        while(getline(stream, token, delim) )
        {
            vect.push_back(token);
        }
        d.Name = vect[0];
        d.IP = vect[1];
        d.Port = vect[2];
        AllData.push_back(d);
        accepted_ip_list.append(d.IP);
        count++;
        vect.clear();
    }
.....................
}

但是我在编译时收到错误:

no matching function for call to 'QStringList::append(std::__cxx11::string&)'

0 个答案:

没有答案