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. Can no longer build due to no matching function.
Forum Updated to NodeBB v4.3 + New Features

Can no longer build due to no matching function.

Scheduled Pinned Locked Moved General and Desktop
build
30 Posts 3 Posters 6.6k Views 3 Watching
  • 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.
  • S SGaist
    25 Mar 2015, 22:43

    You can copy it, just check that all names are correct

    D Offline
    D Offline
    dejarked
    wrote on 25 Mar 2015, 22:59 last edited by
    #7

    @SGaist So, I just copied over all the code to a completely new project in a new folder and Qt is still throwing me the same error as in the original post.

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 25 Mar 2015, 23:06 last edited by
      #8

      Don't overwrite the new files with the content of the old one, just cherry-pick the modifications you made e.g. slot added etc.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      D 1 Reply Last reply 25 Mar 2015, 23:37
      1
      • S SGaist
        25 Mar 2015, 23:06

        Don't overwrite the new files with the content of the old one, just cherry-pick the modifications you made e.g. slot added etc.

        D Offline
        D Offline
        dejarked
        wrote on 25 Mar 2015, 23:37 last edited by
        #9

        @SGaist Right, I only copied the code from the old slots directly into the ones in the new project made by Qt, still getting the same error.

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 25 Mar 2015, 23:39 last edited by
          #10

          So, recreating your widget from scratch in a new project and just copying the slot code gives you the same error ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          D 1 Reply Last reply 25 Mar 2015, 23:40
          1
          • S SGaist
            25 Mar 2015, 23:39

            So, recreating your widget from scratch in a new project and just copying the slot code gives you the same error ?

            D Offline
            D Offline
            dejarked
            wrote on 25 Mar 2015, 23:40 last edited by
            #11

            @SGaist Yup, new folder, new project I created all new files in Qt added all my GUI back, followed to slot, then copied the code in and still get the same error

            1 Reply Last reply
            0
            • S Offline
              S Offline
              SGaist
              Lifetime Qt Champion
              wrote on 26 Mar 2015, 00:11 last edited by
              #12

              Did you check that all names were matching ? Ui widget name vs C++ widget name ?

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              D 1 Reply Last reply 26 Mar 2015, 00:21
              1
              • S SGaist
                26 Mar 2015, 00:11

                Did you check that all names were matching ? Ui widget name vs C++ widget name ?

                D Offline
                D Offline
                dejarked
                wrote on 26 Mar 2015, 00:21 last edited by dejarked
                #13

                @SGaist Right, sorry to be causing so many problems, but thank you for the help! Everything is working now, I missed some of the includes, however I can't use .setModal(true); on a new window opening because it's saying the class has no member called setModal

                            behindlogin behindlogin;
                            behindlogin.setModal(true);
                            behindlogin.exec();
                            connClose();
                1 Reply Last reply
                0
                • S Offline
                  S Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on 26 Mar 2015, 00:22 last edited by
                  #14

                  You're welcome !

                  setModal and exec are methods from QDialog. From what I understood you have a QMainWindow, no ?

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  D 1 Reply Last reply 26 Mar 2015, 00:25
                  1
                  • S SGaist
                    26 Mar 2015, 00:22

                    You're welcome !

                    setModal and exec are methods from QDialog. From what I understood you have a QMainWindow, no ?

                    D Offline
                    D Offline
                    dejarked
                    wrote on 26 Mar 2015, 00:25 last edited by
                    #15

                    @SGaist Ahh yes, I've changed from a Dialog to a MainWindow as I wanted the menu bar at the top.

                    1 Reply Last reply
                    0
                    • S Offline
                      S Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote on 26 Mar 2015, 00:26 last edited by
                      #16

                      So problem solved ? :)

                      Interested in AI ? www.idiap.ch
                      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                      D 1 Reply Last reply 26 Mar 2015, 00:36
                      1
                      • S SGaist
                        26 Mar 2015, 00:26

                        So problem solved ? :)

                        D Offline
                        D Offline
                        dejarked
                        wrote on 26 Mar 2015, 00:36 last edited by
                        #17

                        @SGaist The code actually compiles now! Thank you, the only issue left is I've replaced the code with

                                    behindlogin behindlogin;
                                    behindlogin.show();
                                    connClose();
                        
                        
                        Which causes the window to open and them immediately close after
                        1 Reply Last reply
                        0
                        • S Offline
                          S Offline
                          SGaist
                          Lifetime Qt Champion
                          wrote on 26 Mar 2015, 00:38 last edited by
                          #18

                          If you have something like:

                          {
                              behindlogin behindlogin;
                              behindlogin.show();
                              connClose();
                          } <- behindlogin is destroyed here
                          

                          Interested in AI ? www.idiap.ch
                          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                          D 1 Reply Last reply 26 Mar 2015, 10:02
                          1
                          • S SGaist
                            26 Mar 2015, 00:38

                            If you have something like:

                            {
                                behindlogin behindlogin;
                                behindlogin.show();
                                connClose();
                            } <- behindlogin is destroyed here
                            
                            D Offline
                            D Offline
                            dejarked
                            wrote on 26 Mar 2015, 10:02 last edited by
                            #19

                            @SGaist Right, so I've replaced it with

                                            behindlogin *behindLogin;
                            

                            in the header file and then

                                        behindLogin =new behindlogin(this);
                                        behindLogin->show();
                            

                            in the main cpp file but it's saying that behindlogin does not name a type?

                            J 1 Reply Last reply 27 Mar 2015, 02:01
                            0
                            • S Offline
                              S Offline
                              SGaist
                              Lifetime Qt Champion
                              wrote on 26 Mar 2015, 22:30 last edited by
                              #20

                              Is behindlogin a member variable of a class ?

                              Interested in AI ? www.idiap.ch
                              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                              D 1 Reply Last reply 27 Mar 2015, 01:06
                              1
                              • S SGaist
                                26 Mar 2015, 22:30

                                Is behindlogin a member variable of a class ?

                                D Offline
                                D Offline
                                dejarked
                                wrote on 27 Mar 2015, 01:06 last edited by
                                #21

                                @SGaist Uh, honestly I'm not sure.. I'm very new to Qt and I've been following tutorials. Everything I've looked at makes it look like this should work but I can't figure out what I'm doing incorrectly.

                                1 Reply Last reply
                                0
                                • D dejarked
                                  26 Mar 2015, 10:02

                                  @SGaist Right, so I've replaced it with

                                                  behindlogin *behindLogin;
                                  

                                  in the header file and then

                                              behindLogin =new behindlogin(this);
                                              behindLogin->show();
                                  

                                  in the main cpp file but it's saying that behindlogin does not name a type?

                                  J Offline
                                  J Offline
                                  JKSH
                                  Moderators
                                  wrote on 27 Mar 2015, 02:01 last edited by
                                  #22

                                  Hi,

                                  @dejarked said:

                                  in the main cpp file but it's saying that behindlogin does not name a type?

                                  That means you forgot to #include the header that defines the behindlogin.

                                  @dejarked said:

                                  @SGaist Uh, honestly I'm not sure.. I'm very new to Qt and I've been following tutorials. Everything I've looked at makes it look like this should work but I can't figure out what I'm doing incorrectly.

                                  Is your code exactly the same as what's in the tutorial?

                                  Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

                                  D 1 Reply Last reply 27 Mar 2015, 10:50
                                  1
                                  • J JKSH
                                    27 Mar 2015, 02:01

                                    Hi,

                                    @dejarked said:

                                    in the main cpp file but it's saying that behindlogin does not name a type?

                                    That means you forgot to #include the header that defines the behindlogin.

                                    @dejarked said:

                                    @SGaist Uh, honestly I'm not sure.. I'm very new to Qt and I've been following tutorials. Everything I've looked at makes it look like this should work but I can't figure out what I'm doing incorrectly.

                                    Is your code exactly the same as what's in the tutorial?

                                    D Offline
                                    D Offline
                                    dejarked
                                    wrote on 27 Mar 2015, 10:50 last edited by
                                    #23

                                    @JKSH Hey, it is exactly the same as it is in the tutorial and the header file was the first thing I checked, behindlogin.h is included in my mainwindow.h which is where I'm trying to declare it.

                                    J 1 Reply Last reply 27 Mar 2015, 11:02
                                    0
                                    • D dejarked
                                      27 Mar 2015, 10:50

                                      @JKSH Hey, it is exactly the same as it is in the tutorial and the header file was the first thing I checked, behindlogin.h is included in my mainwindow.h which is where I'm trying to declare it.

                                      J Offline
                                      J Offline
                                      JKSH
                                      Moderators
                                      wrote on 27 Mar 2015, 11:02 last edited by
                                      #24

                                      @dejarked said:

                                      @JKSH Hey, it is exactly the same as it is in the tutorial and the header file was the first thing I checked, behindlogin.h is included in my mainwindow.h which is where I'm trying to declare it.

                                      Can you post:

                                      1. The contents of your .pro file
                                      2. The contents of behindlogin.h
                                      3. The contents of mainwindow.h ?

                                      Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

                                      1 Reply Last reply
                                      1
                                      • D Offline
                                        D Offline
                                        dejarked
                                        wrote on 27 Mar 2015, 11:53 last edited by
                                        #25

                                        Pro:

                                        #
                                        # Project created by QtCreator 2015-03-25T23:10:30
                                        #
                                        #-------------------------------------------------
                                        
                                        QT       += core gui sql
                                        
                                        greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
                                        
                                        TARGET = project
                                        TEMPLATE = app
                                        
                                        
                                        SOURCES += main.cpp\
                                                mainwindow.cpp \
                                            behindlogin.cpp \
                                            offlinebehind.cpp \
                                            savingwindow.cpp
                                        
                                        HEADERS  += mainwindow.h \
                                            behindlogin.h \
                                            offlinebehind.h \
                                            savingwindow.h
                                        
                                        FORMS    += mainwindow.ui \
                                            behindlogin.ui \
                                            offlinebehind.ui \
                                            savingwindow.ui
                                        

                                        behindlogin.h

                                        #ifndef BEHINDLOGIN_H
                                        #define BEHINDLOGIN_H
                                        
                                        #include <QMainWindow>
                                        #include "mainwindow.h"
                                        
                                        namespace Ui {
                                        class behindlogin;
                                        }
                                        
                                        class behindlogin : public QMainWindow
                                        {
                                            Q_OBJECT
                                        
                                        public:
                                            explicit behindlogin(QWidget *parent = 0);
                                            ~behindlogin();
                                        
                                        private slots:
                                            void on_actionExit_triggered();
                                        
                                            void on_actionNew_Data_triggered();
                                        
                                        private:
                                            Ui::behindlogin *ui;
                                        };
                                        
                                        #endif // BEHINDLOGIN_H
                                        

                                        mainwindow.h:

                                        
                                        #ifndef MAINWINDOW_H
                                        #define MAINWINDOW_H
                                        
                                        #include "behindlogin.h"
                                        #include <QMainWindow>
                                        #include <QtSql>
                                        #include <QtDebug>
                                        #include <QFileInfo>
                                        
                                        
                                        namespace Ui {
                                        class MainWindow;
                                        }
                                        
                                        class MainWindow : public QMainWindow
                                        {
                                            Q_OBJECT
                                        
                                        public:
                                            QSqlDatabase mydb;
                                            void  connClose(){
                                                mydb.close();
                                                mydb.removeDatabase(QSqlDatabase::defaultConnection);
                                            }
                                        
                                            bool connOpen()
                                            {
                                        
                                                mydb=QSqlDatabase::addDatabase("QSQLITE");
                                                mydb.setDatabaseName("C:/Users/Jack/Desktop/ProjNEW/SQlite/dataset.db.sqlite");
                                        
                                                if(!mydb.open()){
                                                   qDebug()<<("Disconnected..");
                                                   return false;
                                                }
                                                else{
                                                    qDebug()<<("Connected..");
                                                    return true;
                                                   }
                                        
                                            }
                                        
                                        public:
                                            explicit MainWindow(QWidget *parent = 0);
                                            ~MainWindow();
                                        
                                        private slots:
                                        
                                            void on_LoginButton_clicked();
                                        
                                            void on_actionOpen_triggered();
                                        
                                            void on_actionExit_triggered();
                                        
                                        private:
                                            Ui::MainWindow *ui;
                                            behindlogin *behindLogin;
                                        };
                                        
                                        #endif // MAINWINDOW_H
                                        1 Reply Last reply
                                        0
                                        • J Offline
                                          J Offline
                                          JKSH
                                          Moderators
                                          wrote on 27 Mar 2015, 16:25 last edited by
                                          #26

                                          Hmm... I can't see any mistakes in the code.

                                          What's the full error message? Which line in which file is the error in?

                                          Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

                                          D 1 Reply Last reply 27 Mar 2015, 18:52
                                          1

                                          16/30

                                          26 Mar 2015, 00:26

                                          • Login

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