Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    [Solved] 'webivew' does not name a type

    Qt WebKit
    3
    7
    6033
    Loading More Posts
    • 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
      developer 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

      1 Reply Last reply Reply Quote 0
      • G
        goetz 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?

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

        1 Reply Last reply Reply Quote 0
        • D
          developer 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]

          1 Reply Last reply Reply Quote 0
          • D
            developer last edited by

            i think this is suffeicient

            1 Reply Last reply Reply Quote 0
            • G
              goetz last edited by

              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 Reply Quote 0
              • F
                fcrochik 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

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

                1 Reply Last reply Reply Quote 0
                • D
                  developer 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 Reply Last reply Reply Quote 0
                  • First post
                    Last post