我查了一下,
void QLayout::addWidget(QWidget *w)
Adds widget w to this layout in a manner specific to the layout. This function uses addItem().
void QLayout::addItem(QLayoutItem *item)
。。。
Note: The ownership of item is transferred to the layout, and it's the layout's responsibility to delete it.
看起来感觉跟addAction不一致,是不是这个道理,action可以被多个widget添加(比如菜单、工具栏、右键菜单等),所以ownership不转移?