-1
问题,我划分子类QGraphicsView
:Qt Creator中促进了QWidget,用构造
class CustomGraphicsView : public QGraphicsView
{
public:
CustomGraphicsView(QWidget *parent = 0);
...
}
在.cpp文件中的构造函数,然后实现这样的:
CustomGraphicsView::CustomGraphicsView(QWidget * parent):
QGraphicsView(parent)
{
}
现在我通过提拔了的QGraphicsView的Widget一个Qt创建者到CustomGraphicsView。但是当我想连接到我的ImageWindow类的构造函数中的提升小部件时;
ImageWindow::ImageWindow(QWidget *parent) :
QDialog(parent),
ui(new Ui::ImageWindow)
{
ui->setupUi(this);
CustomGraphicsView * view = ui->graphicsView();
}
我得到的错误消息:
term does not evaluate to a function taking 0 arguments.
予指定的构造即QWidget的*父= 0的默认值,并在ui_image_window.h
一个参数被设置:
graphicsView = new CustomGraphicsView(ImageWindow);
那么,什么会导致这个错误呢?
F **** CK!这花了我很多时间。我认为这是一个返回指针的方法:(谢谢! – newandlost