显示不同的窗口1乘1

时间:2016-06-05 16:01:08

标签: c++

我的代码有问题。我想通过点击" Next"逐个显示不同的窗口。按钮显示下一个这样的:

int i = 0;
do {
    auto polyLines = new ExportPolyLines(nodeNames);
    polyLines->show();
    if (!polyLines->isVisible()) {
        i++;
    }
} while (i < 3);

编译但编码无效!
任何人都可以帮我解决这个问题吗?

1 个答案:

答案 0 :(得分:0)

作为评论的改进,我建议您修复内存泄漏。

if (_logIsSelected)
{
    for (int i = 0; i < _selectedWellLogs.size(); i++)
    {
        auto exportLogsData = new ExportsLogs(_selectedWellLogs[i], _wellLogsName[i], _folder);
        exportLogsData->exec();

        delete exportLogsData; // Free the memory that has been used for ExportLogs
        exportLogsData = nullptr; // Not really necessary here, but good practice
    }
}