如何检查小部件是否在布局中?我有一个可能包含小部件的布局.
infoClientverticalLayout_3需要检查布局中是否存在窗口小部件,然后不添加新窗口小部件.
如果不存在,请添加一个新的.
怎么做?
void MainWindow::slotPush1()
{
if <there is no infoClient> ui->verticalLayout_3->addWidget(new infoClient(this));
}
Run Code Online (Sandbox Code Playgroud) qt ×1