Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. error lnk2019 in slot and signal qt visual studio 2017
Forum Updated to NodeBB v4.3 + New Features

error lnk2019 in slot and signal qt visual studio 2017

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 3 Posters 811 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.
  • A Offline
    A Offline
    Aminmlp
    wrote on last edited by Aminmlp
    #1

    Re: [[SOLVED] Qt Visual Studio Add-in](Signal & Slots problems)

    this is my .h file:

    #pragma once

    #include <QtWidgets/QMainWindow>
    #include <QtWidgets/QTreeWidgetItem>
    #include <QtCore/QUrl>
    #include <QtWebKit/QWebElement>
    #include <QtCore/QObject>

    #include "ui_window.h"

    class window : public QMainWindow, QObject
    {
    Q_OBJECT
    public:
    window(QWidget *parent = 0);
    void detUrl(const QUrl &url);
    void on_webView_loadFinished();
    public slots:
    void check();
    private:
    Ui::windowClass ui;
    void examineChildElements(const QWebElement &parentElement,QTreeWidgetItem *parentItem);
    };

    when I compile that I have this error:
    Severity Code Description Project File Line Suppression State
    Error LNK2019 unresolved external symbol "public: void __cdecl window::check(void)" (?check@window@@QEAAXXZ) referenced in function "private: static void __cdecl window::qt_static_metacall(class QObject *,enum QMetaObject::Call,int,void * *)" (?qt_static_metacall@window@@CAXPEAVQObject@@W4Call@QMetaObject@@HPEAPEAX@Z) window C:\Users\Amin\Documents\Visual Studio 2017\Projects\window\window\moc_window.obj 1

    I use VS 2017 C++ Qt, where is the problem?

    jsulmJ 1 Reply Last reply
    0
    • A Aminmlp

      Re: [[SOLVED] Qt Visual Studio Add-in](Signal & Slots problems)

      this is my .h file:

      #pragma once

      #include <QtWidgets/QMainWindow>
      #include <QtWidgets/QTreeWidgetItem>
      #include <QtCore/QUrl>
      #include <QtWebKit/QWebElement>
      #include <QtCore/QObject>

      #include "ui_window.h"

      class window : public QMainWindow, QObject
      {
      Q_OBJECT
      public:
      window(QWidget *parent = 0);
      void detUrl(const QUrl &url);
      void on_webView_loadFinished();
      public slots:
      void check();
      private:
      Ui::windowClass ui;
      void examineChildElements(const QWebElement &parentElement,QTreeWidgetItem *parentItem);
      };

      when I compile that I have this error:
      Severity Code Description Project File Line Suppression State
      Error LNK2019 unresolved external symbol "public: void __cdecl window::check(void)" (?check@window@@QEAAXXZ) referenced in function "private: static void __cdecl window::qt_static_metacall(class QObject *,enum QMetaObject::Call,int,void * *)" (?qt_static_metacall@window@@CAXPEAVQObject@@W4Call@QMetaObject@@HPEAPEAX@Z) window C:\Users\Amin\Documents\Visual Studio 2017\Projects\window\window\moc_window.obj 1

      I use VS 2017 C++ Qt, where is the problem?

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @Aminmlp said in error lnk2019 in slot and signal qt visual studio 2017:

      void check();

      Did you implement it in your cpp file?

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      A 1 Reply Last reply
      3
      • jsulmJ jsulm

        @Aminmlp said in error lnk2019 in slot and signal qt visual studio 2017:

        void check();

        Did you implement it in your cpp file?

        A Offline
        A Offline
        Aminmlp
        wrote on last edited by
        #3

        @jsulm you are right, problem solved. thanks

        Christian EhrlicherC 1 Reply Last reply
        0
        • A Aminmlp

          @jsulm you are right, problem solved. thanks

          Christian EhrlicherC Online
          Christian EhrlicherC Online
          Christian Ehrlicher
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @Aminmlp Then please mark this topic as solved, thx.

          Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
          Visit the Qt Academy at https://academy.qt.io/catalog

          1 Reply Last reply
          1

          • Login

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