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: no matching member function for call to 'addTab' qtabwidget
Forum Updated to NodeBB v4.3 + New Features

Error: no matching member function for call to 'addTab' qtabwidget

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 3 Posters 808 Views 1 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.
  • P Offline
    P Offline
    Panoss
    wrote on last edited by Panoss
    #1

    Hi.
    I 'm trying to make this example of (creating and) using a help file in my Qt project.
    But I get this error:

    articleswindow.cpp:439:14: error: no matching member function for call to 'addTab'
    qtabwidget.h:74:9: note: candidate function not viable: cannot convert argument of incomplete type 'QHelpContentWidget *' to 'QWidget *' for 1st argument
    qtabwidget.h:75:9: note: candidate function not viable: requires 3 arguments, but 2 were provided
    

    This is the code:

    tWidget->addTab(helpEngine->contentWidget(), "Contents");
    

    This is how helpEngine is created:

    QHelpEngine* helpEngine = new QHelpEngine(
                    QApplication::applicationDirPath() +
                    "/documentation/qgraphicshelpexample.qhc")
    

    And tWidget:

    QTabWidget* tWidget = new QTabWidget;
    

    Gow can I fix it?

    1 Reply Last reply
    0
    • Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      incomplete type 'QHelpContentWidget *'

      If you want to use a class, you should include the header where it's defined in.

      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
      3
      • P Offline
        P Offline
        Panoss
        wrote on last edited by
        #3

        I added the header.
        The error dissappeared from the above mentiond row.

        But remains for the next one:

        tWidget->addTab(helpEngine->contentWidget(), "Contents");
            tWidget->addTab(helpEngine->indexWidget(), "Index");
        
        Christian EhrlicherC 1 Reply Last reply
        0
        • P Panoss

          I added the header.
          The error dissappeared from the above mentiond row.

          But remains for the next one:

          tWidget->addTab(helpEngine->contentWidget(), "Contents");
              tWidget->addTab(helpEngine->indexWidget(), "Index");
          
          Christian EhrlicherC Offline
          Christian EhrlicherC Offline
          Christian Ehrlicher
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @Panoss said in Error: no matching member function for call to 'addTab' qtabwidget:

          But remains for the next one:

          You should tell us the error message...

          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
          • P Offline
            P Offline
            Panoss
            wrote on last edited by
            #5

            It's the same:

            articleswindow.cpp:440:14: error: no matching member function for call to 'addTab'
            qtabwidget.h:74:9: note: candidate function not viable: cannot convert argument of incomplete type 'QHelpIndexWidget *' to 'QWidget *' for 1st argument
            qtabwidget.h:75:9: note: candidate function not viable: requires 3 arguments, but 2 were provided
            
            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              Where did you add:

              #include <QHelpIndexWidget>
              

              ?

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

              P 1 Reply Last reply
              2
              • SGaistS SGaist

                Where did you add:

                #include <QHelpIndexWidget>
                

                ?

                P Offline
                P Offline
                Panoss
                wrote on last edited by Panoss
                #7

                @SGaist said in Error: no matching member function for call to 'addTab' qtabwidget:

                Where did you add:

                #include <QHelpIndexWidget>
                

                ?

                You are so RIGHT!!!
                I had not added this at all!
                I had added only "qhelpcontentwidget.h".

                Now it compiles and works ok!!...almost...
                I get some irrelevant (??) message (in the application output in Qt Creator) when I open the help window:

                QSqlDatabasePrivate::removeDatabase: connection 'QHelpCollectionHandler-281628994016-2' is still in use, all queries will cease to work.
                QTextBrowser: No document for qthelp://walletfox.qt.helpexample/doc/index.html
                
                1 Reply Last reply
                0

                • Login

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