Solved Where is the error here?
-
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)
-
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.
-
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. -
Yeah, or maybe just clean the project, re-run qmake, recompile and see if it links correctly then.
-
It works, thanks