我正在使用 QTextBrowser 通过附加函数显示字符串。
void testing::displaytext()
{
qRegisterMetaType<QTextCursor>("QTextCursor");
ui.textBrowser->append("Welcome to the world of QT");
ui.textBrowser->append("Welcome to the world of QT");
ui.textBrowser->append("Welcome to the world of QT");
ui.textBrowser->append("Welcome to the world of QT");
ui.textBrowser->append("Welcome to the world of QT");
ui.textBrowser->append("Welcome to the world of QT");
ui.textBrowser->append("Welcome to the world of QT");
ui.textBrowser->append("Welcome to the world of QT");
ui.textBrowser->append("Welcome to the world of QT");
}
上面的函数被一个线程定期调用,但有时在被调用后会抛出这个错误:
ASSERT failure in QVector<T>::operator[]: "index out of range", file c:\iwmake\build_vs2010_opensource_________________padding_________________\include\qtcore\../../src/corelib/tools/qvector.h
我该如何解决这个异常?