我有一个这样的结构:
struct Flow
{
QLayoutItem * item;
bool shown;
};
我想像这样使用QList
这个结构:
QList<Flow> itemList;
以下函数给出编译错误:
void FlowLayout::add(QLayoutItem *item)
{
itemList.item = item;
itemList.shown = true;
itemList.append(itemlist);
}
错误是:
class "QList<FlowLayout::Flow *>" has no member "item"
如何访问项目成员并将其附加到列表中?