cxccc
 isEmpty和isNull()区别
一个NULL字符串一定是一个空串,
一个空串未必是一个NULL字符串
例如:
QString().isNull():   //结果为true
QString().isEmpty();  //结果为true
QString("").isNull();   //结果为false
QString("").isEmpty();   //结果为true

批注:  一个NULL字符串就是使用QString的默认构造函数或者使用(const char*)0作为参数的构造函数创建的字符串对象。

QString((const char*)0).isNull();   //结果为true

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2021-11-03
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-23
猜你喜欢
  • 2021-11-23
  • 2021-11-23
  • 2021-07-13
  • 2021-08-09
  • 2021-05-20
相关资源
相似解决方案