我正在使用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
如何解决此异常?