就是照着pizzaentry的例子写的.
MyformImpl.cpp
#include "MyformImpl.h"
#include <qmessagebox.h>
void MyformImpl::sendOrder()
{
QMessageBox::information( this, "Myform Information", "you order has been sent", QMessageBox::Ok );
}
MyformImpl.h
#ifndef MYFORMIMPL_H
#define MYFORMIMPL_H
#include "Myform.h"
class MyformImpl : public Myform
{
Q_OBJECT
public :
MyformImpl( Qwidget *parent = 0, const char *name = 0, bool modal = FALSE, WFlags fl = 0) : Myform( parent, name, modal, fl ){}
public slots:
virtual void sendOrder();
};
#endif
编译错误:
In file included from MyformImpl.cpp:1:
MyformImpl.h:11: parse error before `*' token
MyformImpl.h:11: missing ';' before right brace
MyformImpl.h:12: semicolon missing after declaration of `MyformImpl'
MyformImpl.h:12: parse error before `:' token
MyformImpl.cpp:6: no `void MyformImpl::sendOrder()' member function declared in
class `MyformImpl'
make: *** [MyformImpl.o] Error 1
[ 此贴被XChinux在2006-06-22 12:20重新编辑 ]