• 6524阅读
  • 1回复

error: no matching function for call to,请高手帮忙看看问题出在哪? [复制链接]

上一主题 下一主题
离线zw978
 

只看楼主 倒序阅读 楼主  发表于: 2009-10-30
主文件:

#include <qapplication.h>
#include "imageprocess.h"

int main( int argc, char **argv )
{
    QApplication a( argc, argv );
    
    ImageProcess *w =
            new ImageProcess(0, "new window", Qt::WA_DeleteOnClose);
    
    w->setWindowTitle("Image Process");    const char* winName="new window";
    w->show();
    QObject::connect(qApp, SIGNAL(lastWindowClosed()), qApp, SLOT(quit()));

    return a.exec();
}

ImageProcess类的定义在imageprocess.h中:

#ifndef IMAGEPROCESS_H
#define IMAGEPROCESS_H

#include <qvariant.h>
#include <qmainwindow.h>
#include <qimage.h>
#include <qpixmap.h>
#include <QList>
#include <QWidget>
#include "tooldialog.h"

class QVBoxLayout;
class QHBoxLayout;
class QGridLayout;
class QAction;
class QActionGroup;
class QToolBar;
class QPopupMenu;

class ImageProcess : public QMainWindow
{
    Q_OBJECT

public:
    ImageProcess( QWidget* parent = 0, const char* name = 0, Qt::WindowFlags fl = 0 );
    ~ImageProcess();
……


编译提示错误:

main.cpp: In function 'int main(int, char**)':
main.cpp:10: error: no matching function for call to 'ImageProcess::ImageProcess(int, const char [11], Qt::WidgetAttribute, int)'
imageprocess.h:34: note: candidates are: ImageProcess::ImageProcess(QWidget*, const char*, Qt::WindowFlags)
imageprocess.h:30: note: ImageProcess::ImageProcess(const ImageProcess&)

请问这是什么原因?感觉这样创建对象没错阿
离线午小夜

只看该作者 1楼 发表于: 2009-11-01
报错信息有认真看过么?
[操作系统版本]  Windows XP;Linux Ubuntu;Linux Fedora;
[Qt SDK版本]    4.7.0
[SDK 发布日期]  2010.05
[IDE(集成开发环境)] QtCreator
个人网页:http://hi.baidu.com/午小夜
學歷:Royal Jalidon
快速回复
限100 字节
 
上一个 下一个