[Solved] 'webivew' does not name a type
-
wrote on 23 Apr 2012, 11:10 last edited by
i am creating a project and a strange error occured
'webivew' does not name a type
in this source code:
tab.h
@#ifndef TAB_H
#define TAB_H#include <QWidget>
#include "mainwindow.h"
#include "webview.h"
#include <QHBoxLayout>
class MainWindow;
class tab : public QWidget
{
Q_OBJECT
public:
tab(MainWindow *parent = 0);signals:
public slots:
void loadurl(QString url);
private:
webview * view;
QHBoxLayout * layout;
};#endif // TAB_H
@
tab.cpp:
@#include "tab.h"tab::tab(MainWindow *parent) :
QWidget(parent)
{
view = new webview(this);
layout = new QHBoxLayout(this);
layout->addWidget(view);
}
void tab::loadurl(QString url)
{
view->loadurl(url);
}
@
webview is a QWebView sub class
really strange error but i am sure any body nows the solution -
wrote on 23 Apr 2012, 21:44 last edited by
what's in your webview.h header file? Is it actually included or do you happen do have a duplicated double-include guard in it?
-
wrote on 24 Apr 2012, 08:54 last edited by
@
#ifndef WEBVIEW_H
#define WEBVIEW_H#include <QWebView>
#include <QWebFrame>
#include <QMenu>
#include "tab.h"
class tab;
class webview : public QWebView
{
Q_OBJECT
private slots:
public:
webview(tab *parent = 0);signals:
void tabcloserequested();
public slots:
void loadurl(QString url);
void customContextMenuRequested(const QPoint &pos);
protected:
QWebView * createWindow(QWebPage::WebWindowType type);
};#endif // WEBVIEW_H
@[Edit: Added @ tags around code; mlong]
-
wrote on 24 Apr 2012, 09:09 last edited by
i think this is suffeicient
-
wrote on 25 Apr 2012, 21:57 last edited by
This doesn't look suspicious to me. Can you prepare a small, self contained project that just demonstrates the error?
-
wrote on 25 Apr 2012, 22:20 last edited by
Have you tried to comment out the #ifndef line on your webview.h just to make sure?
The exact/complete output of the compilation would also help -
wrote on 26 Apr 2012, 09:13 last edited by
the problem has been solved the problem was because webview requires tab and tab requires webview so there will be error now i have done something different thanks all
1/7