Мне нужно добавить функцию (метод) к QCryptographicHash
Делаю для примера
class MyMD5Sum : public QCryptographicHash
{
public:
int test(){return 0;};
};
...
MyMD5Sum a; //(1)
или
MyMD5Sum a(QCryptographicHash::Md5); //(2)
В случаю (1) получаю:
./untitled/mainwindow.cpp: In constructor ‘MyMD5Sum::MyMD5Sum()’:
../untitled/mainwindow.cpp:8: error: no matching function for call to ‘QCryptographicHash::QCryptographicHash()’
/home/f3ex/qtsdk-2010.04/qt/include/QtCore/qcryptographichash.h:76: note: candidates are: QCryptographicHash::QCryptographicHash(const QCryptographicHash&)
/home/f3ex/qtsdk-2010.04/qt/include/QtCore/qcryptographichash.h:64: note: QCryptographicHash::QCryptographicHash(QCryptographicHash::Algorithm)
../untitled/mainwindow.cpp: In constructor ‘MainWindow::MainWindow(QWidget*)’:
../untitled/mainwindow.cpp:18: note: synthesized method ‘MyMD5Sum::MyMD5Sum()’ first required here
make: *** [mainwindow.o] Ошибка 1
В случаю (2) получаю:
../untitled/mainwindow.cpp: In constructor ‘MainWindow::MainWindow(QWidget*)’:
../untitled/mainwindow.cpp:18: error: no matching function for call to ‘MyMD5Sum::MyMD5Sum(QCryptographicHash::Algorithm)’
../untitled/mainwindow.cpp:8: note: candidates are: MyMD5Sum::MyMD5Sum()
../untitled/mainwindow.cpp:8: note: MyMD5Sum::MyMD5Sum(const MyMD5Sum&)
make: *** [mainwindow.o] Ошибка 1
Как правильно надо сделать наследование и сделать свой класс ?