PDA

View Full Version : MVC example not working



yyiu002
29th June 2010, 23:23
I am trying implement a MVC model, downloaded the source code from http://doc.trolltech.com/qq/qq10-mvc.html

But I can't compile, it says following:


In file included from ..\mvc\palettemodelmanager.cpp:28:
..\mvc\/palettemodelmanager.h: In constructor 'PaletteModelManager::PaletteModelManager(QObject* , const char*)':
..\mvc\/palettemodelmanager.h:59: error: no matching function for call to 'QObject::QObject(QObject*&, const char*&)'
..\..\..\Qt\2010.02.1\qt\include/QtCore/../../src/corelib/kernel/qobject.h:309: note: candidates are: QObject::QObject(const QObject&)
..\..\..\Qt\2010.02.1\qt\include/QtCore/../../src/corelib/kernel/qobject.h:293: note: QObject::QObject(QObjectPrivate&, QObject*)
..\..\..\Qt\2010.02.1\qt\include/QtCore/../../src/corelib/kernel/qobject.h:128: note: QObject::QObject(QObject*)

Zlatomir
30th June 2010, 00:07
The problem seems to be QObject::QObject(QObject*&, const char*&), the constructor doesn't have that second argument.

But that example is kind of old, because it uses headers like this: #include <qapplication.h>
//i think this is Qt3 example, but i'm not sure

You can try to port that to Qt4, or use some newer resource, like this (http://doc.qt.nokia.com/4.6/model-view-introduction.html)