查看完整版本: [-- 在mainwindow定义个qstringlist,然后在别的dlg调用添加字符串,总是报错,为什么? --]

QTCN开发网 -> Qt基础编程 -> 在mainwindow定义个qstringlist,然后在别的dlg调用添加字符串,总是报错,为什么? [打印本页] 登录 -> 注册 -> 回复主题 -> 发表主题

iloveghq 2020-05-27 15:51

在mainwindow定义个qstringlist,然后在别的dlg调用添加字符串,总是报错,为什么?


void brightDlg::BtnRightClick()
{
parentDlg->onAddLogInfo(tr("1111"));
}

void MainWindow::onAddLogInfo(QString str)
{
    if(strListLog->count()<INFO_COUNT)
    {
        strListLog.insert(0,str);
    }
    else
    {
        strListLog.removeLast();
        strListLog.insert(0,str);
    }
}

20091001753 2020-05-27 17:32
strListLog->count()

strListLog.insert()

细心点。

九重水 2020-05-27 20:06
编译不报错的吗?


查看完整版本: [-- 在mainwindow定义个qstringlist,然后在别的dlg调用添加字符串,总是报错,为什么? --] [-- top --]



Powered by phpwind v8.7 Code ©2003-2011 phpwind
Gzip disabled