2
我有一個QList和QVector。我填充Qlist,然後嘗試複製到QVector。 Ovector有一個fromList()方法。但它不起作用。從QList填充QVector
我的代碼:
QList<int> listA;
QVector<int> vectorA; //I also tried QVector<int>vectorA(100);
for(int i=0; i<100; i++)
{
listA.append(i);
}
vectorA.fromList(listA);
此代碼後vectorA返回空
我使用Qt 4.8.5 Linux的
下
謝謝@Lohrun – user4757345
我只好也模板定義添加到靜態方法,它的工作:QVector :: fromlist裏(名單) –
KuramaYoko