• 3723阅读
  • 1回复

quit程序出现问题,请大家帮忙看看 [复制链接]

上一主题 下一主题
离线fzusuper
 
只看楼主 倒序阅读 楼主  发表于: 2008-12-01
— 本帖被 XChinux 执行加亮操作(2009-01-06) —
我的版本是qt3,make后出现:

quit.cpp: In function `int main(int, char**)':
quit.cpp:7: no matching function for call to `QPushButton::QPushButton(const
  char[5])'
/usr/lib/qt-3.1/include/qpushbutton.h:134: candidates are:
  QPushButton::QPushButton(const QPushButton&)
/usr/lib/qt-3.1/include/qpushbutton.h:66:
  QPushButton::QPushButton(const QIconSet&, const QString&, QWidget*, const
  char* = 0)
/usr/lib/qt-3.1/include/qpushbutton.h:65:
  QPushButton::QPushButton(const QString&, QWidget*, const char* = 0)
/usr/lib/qt-3.1/include/qpushbutton.h:64:
  QPushButton::QPushButton(QWidget*, const char* = 0)
make: *** [quit.o] Error 1


贴上本人的程序,不知道错哪里,请大家给个建议

#include <qapplication.h>
#include <qpushbutton.h>

int main(int argc, char *argv[])
{
    QApplication app(argc, argv);
    QPushButton *button = new QPushButton("Quit");
    QObject::connect(button, SIGNAL(clicked()),
                    &app, SLOT(quit()));
    button->show();
    return app.exec();
}
离线fzusuper
只看该作者 1楼 发表于: 2008-12-01
问题解决了 在后头QPushButton *button = new QPushButton("Quit");
改为QPushButton *button = new QPushButton("Quit",0);
快速回复
限100 字节
 
上一个 下一个