[求助]Qlist 如何正确的append
Tofloor
poster avatar
司南
deepin
2018-01-30 21:53
Author
QList里面都是一个自定义对象
自定义对象中包含下一级的QList

Cell cell(cellName);
bodyList.at(b_index).OrganList.at(v_index).CellList.append(cell)

error: no matching member function for call to 'append'
请问如何解决?

Reply Favorite View the author
All Replies
avatar
pikachuhy
deepin
2018-01-30 23:12
#1
你的调用链好长啊
Reply View the author
avatar
六七八九十
deepin
2018-01-30 23:44
#2
看提示,很明显
Reply View the author
avatar
司南
deepin
2018-01-30 23:45
#3
https://bbs.deepin.org/post/152643
你的调用链好长啊

下面还要一级一级调用呢!
我在函数里创建一个常量
const Cell *cell = new Cell(newCellName);
没想到居然成了!!
Reply View the author
avatar
司南
deepin
2018-01-30 23:46
#4

在函数里创建const对象还是第一次遇到
Reply View the author
avatar
wtz
deepin
2018-02-04 08:00
#5
https://bbs.deepin.org/post/152643
下面还要一级一级调用呢!
我在函数里创建一个常量
const Cell *cell = new Cell(newCellName);
  1. bodyList.at(b_index).OrganList.at(v_index).CellList.append(&cell)
Copy the Code

这样?
Reply View the author
avatar
司南
deepin
2018-02-04 20:09
#6
wtz 发表于 2018-2-4 00:00
这样?

对,不过不能用at,会报错,要用List[index]
Reply View the author