Qt cpp code..how object.function1.function2有效

时间:2015-06-04 04:30:42

标签: c++ qt

我无法知道这将如何运作...... object.function1.function2如何工作 以下是代码 l_floatValue = l_objMeter.getWATTHrs()。getChannelA();

2 个答案:

答案 0 :(得分:1)

功能1返回你的对象并调用它的方法

答案 1 :(得分:0)

请考虑以下示例

  int len = QString(" TEST ").simplified().length();

假设

  QString test = QString(" TEST ");  // will create string object of lengh 6
  QString simTest = test.simplified(); // Will create string of len 4 remove white spaces
  int len = simTest.length(); // len 4

这是程序的工作方式