Qt Forum

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

    Solved Where is the error here?

    General and Desktop
    4
    5
    796
    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.
    • H
      HenrikSt. last edited by

      void PagesTextEdit::WebBox() {
      
      QMainWindow *WebBoxWindow = new QMainWindow;
      QToolBar *WebBoxToolBar = new QToolBar;
      WebBoxToolBar->setStyleSheet("QToolBar {background: rgb(255, 255, 255) }");
      WebBoxToolBar->setFloatable(false);
      
      
      QAction *ActBack = new QAction;
      ActBack->setIcon(QIcon(":/ic_arrow_back.png"));
      WebBoxToolBar->addAction(ActBack);
      
      
      QAction *ActForward = new QAction;
      ActForward->setIcon(QIcon(":/ic_arrow_forward_black_24dp.png"));
      WebBoxToolBar->addAction(ActForward);
      
      
      WebBoxToolBar->show();
         QWebEngineView *view = new QWebEngineView(WebBoxWindow);
          view->setWindowTitle("Nachschlagen im Web mit Google");
      
      
          view->setWindowIcon(QIcon(":/ic_web_black_24dp_1x.png"));
          view->load(QUrl("http://www.google.de/"));
      
      
      
      
      WebBoxWindow->setCentralWidget(view);
      view->show();
      WebBoxWindow->show();
      WebBoxWindow->addToolBar(WebBoxToolBar);
      WebBoxWindow->setWindowTitle("Nachschlagen im Web");
      
      
      connect(ActBack, &QAction::triggered, this, &PagesTextEdit::ActBackF);
      connect(ActForward, &QAction::triggered, this, &PagesTextEdit::ActForwardF);
      
      
       }
      
      
      Where is the error here?
      

      pagestextedit.obj:-1: Fehler: LNK2019: unresolved external symbol "public: void __cdecl PagesTextEdit::ActBackF(void)" (?ActBackF@PagesTextEdit@@QEAAXXZ) referenced in function "public: void __cdecl PagesTextEdit::WebBox(void)" (?WebBox@PagesTextEdit@@QEAAXXZ)

      kshegunov 1 Reply Last reply Reply Quote 0
      • C
        Carmoneer last edited by

        The error is stating that you've declared your function 'ActBackF' but haven't defined it. Check your .cpp file and see if you forgot to use the scope resolution operator in it's definition. Just one idea.

        1 Reply Last reply Reply Quote 1
        • kshegunov
          kshegunov Moderators @HenrikSt. last edited by

          There's no error in this particular snippet. You haven't provided a definition for the PagesTextEdit::ActBackF method, so that's why the linker's complaining.

          Read and abide by the Qt Code of Conduct

          1 Reply Last reply Reply Quote 1
          • ?
            A Former User last edited by

            Yeah, or maybe just clean the project, re-run qmake, recompile and see if it links correctly then.

            1 Reply Last reply Reply Quote 2
            • H
              HenrikSt. last edited by

              It works, thanks

              1 Reply Last reply Reply Quote 0
              • First post
                Last post