Error: no matching member function for call to 'addTab' qtabwidget
-
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?
-
incomplete type 'QHelpContentWidget *'
If you want to use a class, you should include the header where it's defined in.
-
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");
@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...
-
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
-
Where did you add:
#include <QHelpIndexWidget>
?
-
@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