本文介绍了QList< T> :: operator []中的ASSERT失败:“索引超出范围”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是面向此问题的代码部分..



 QString line = in.readLine(); 
QStringList fields = line.split(,);
fields.replaceInStrings(,);
QString IDstr = fields [0];
int slotDec = fields [1] .toInt(& ok,16);
int IDstrdec = IDstr.toInt(& ok,16);
int BaseID = MainWindow :: NodeBaseID(IDstrdec);
int NodeID = IDstrdec-BaseID;





如果有人指导我如何解决这个问题会很好吗?

解决方案



here is the section of code which facing this problem..

QString line = in.readLine();
        QStringList fields = line.split(",");
        fields.replaceInStrings(" ", "");
        QString IDstr = fields[0];
        int slotDec = fields[1].toInt(&ok, 16);
        int IDstrdec = IDstr.toInt(&ok, 16);
        int BaseID = MainWindow::NodeBaseID(IDstrdec);
        int NodeID= IDstrdec-BaseID;



would be nice if someone guide me how to come out of this problem??

解决方案




这篇关于QList< T> :: operator []中的ASSERT失败:“索引超出范围”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-23 02:57
查看更多