[SOLVED] C++ Function Calls
-
I get this error:
@C:\Users\Darrel\Desktop\smartphonebrainscanner2-Brain3D\qmlapplicationviewer\qmlapplicationviewer.cpp:77: error: no matching function for call to 'QQuickView::QQuickView(QWidget*&)'
, d(new QmlApplicationViewerPrivate())
^@From this code:
@
QmlApplicationViewer::QmlApplicationViewer(QWidget *parent)
: QQuickView(parent)
, d(new QmlApplicationViewerPrivate())
{
connect(engine(), SIGNAL(quit()), SLOT(close()));
setResizeMode(QQuickView::SizeRootObjectToView); //(QDeclarativeView::SizeRootObjectToView); Qt 4.8// Qt versions prior to 4.8.0 don't have QML/JS debugging services built in
#if defined(QMLJSDEBUGGER) && QT_VERSION < 0x040800
#if !defined(NO_JSDEBUGGER)
new QmlJSDebugger::JSDebuggerAgent(engine());
#endif
#if !defined(NO_QMLOBSERVER)
new QmlJSDebugger::QDeclarativeViewObserver(this, this);
#endif
#endif
}@@class QmlApplicationViewer : public QQuickView //QDeclarativeView // Qt 4.8
{
Q_OBJECTpublic:
enum ScreenOrientation {
ScreenOrientationLockPortrait,
ScreenOrientationLockLandscape,
ScreenOrientationAuto
};explicit QmlApplicationViewer(QWidget *parent = 0); virtual ~QmlApplicationViewer(); static QmlApplicationViewer *create(); void setMainQmlFile(const QString &file); void addImportPath(const QString &path); // Note that this will only have an effect on Fremantle. void setOrientation(ScreenOrientation orientation); void showExpanded();
private:
class QmlApplicationViewerPrivate *d;
};@It's been awhile since I've worked on C++ classes so I'm pretty rusty. I don't see the problem.
-
-
Well the first thing is that I don't see why you are using the key word "class" here
@private:
class QmlApplicationViewerPrivate *d;@
Indeed, if your class QmlApplicationViewerPrivate is defined in a .h you can simply include it in your QmlApplicationViewer file ;).As for this part of the code here :
@class QmlApplicationViewerPrivate
{
QString mainQmlFile;
friend class QmlApplicationViewer;
static QString adjustPath(const QString &path);
};@You are indeed defining a class with its attributes and methods, but I don't see any constructor which goes like : QmlApplicationViewer(type1 att1, type2 att2...){
}