Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt WebKit
  4. [Solved] 'webivew' does not name a type
QtWS25 Last Chance

[Solved] 'webivew' does not name a type

Scheduled Pinned Locked Moved Qt WebKit
7 Posts 3 Posters 6.5k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    developer
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    0
    • G Offline
      G Offline
      goetz
      wrote on last edited by
      #2

      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?

      http://www.catb.org/~esr/faqs/smart-questions.html

      1 Reply Last reply
      0
      • D Offline
        D Offline
        developer
        wrote on last edited by
        #3

        @
        #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]

        1 Reply Last reply
        0
        • D Offline
          D Offline
          developer
          wrote on last edited by
          #4

          i think this is suffeicient

          1 Reply Last reply
          0
          • G Offline
            G Offline
            goetz
            wrote on last edited by
            #5

            This doesn't look suspicious to me. Can you prepare a small, self contained project that just demonstrates the error?

            http://www.catb.org/~esr/faqs/smart-questions.html

            1 Reply Last reply
            0
            • F Offline
              F Offline
              fcrochik
              wrote on last edited by
              #6

              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

              Certified Specialist & Qt Ambassador <a href="http://www.crochik.com">Maemo, Meego, Symbian, Playbook, RaspberryPi, Desktop... Qt everywhere!</a>

              1 Reply Last reply
              0
              • D Offline
                D Offline
                developer
                wrote on last edited by
                #7

                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 Reply Last reply
                0

                • Login

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved