代码:QString recstr,tempstr81,tempstr82,tempstr83,tempstr84;
recstr = tempstr81.setNum(rect().x())+","+
tempstr82.setNum(rect().width())+","+
tempstr83.setNum(rect().y())+","+
tempstr84.setNum(rect().height());
Recvalue->setText(recstr); //Recvalue是一个QLabel;
报错:
E:\prooject\qt\chapter7\Geometry\geometry.cpp:74: error: expression cannot be used as a function
recstr = tempstr81.setNum(rect().x())+","+
^
觉得代码没有问题,是不是Qt版本的问题,还是在没有添加什么头文件?
已添加的头文件:
#include <QWidget>
#include <QLabel>
#include <QGridLayout>
MMMHUHU