I have a TreeView class with QTreeWidgetItem's set as check boxes with the following code:
cities->setText(0, tr("Places"));
cities->setCheckState(0, Qt::Checked);
QTreeWidgetItem *cities = new QTreeWidgetItem(treeWidget);
cities->setText(0, tr("Places"));
cities->setCheckState(0, Qt::Checked);
To copy to clipboard, switch view to plain text mode
I try to send a signal with the following code:
connect(cities,
SIGNAL(itemClicked
(QTreeWidgetItem *,
int)),
this, setChecked
);
connect(cities, SIGNAL(itemClicked(QTreeWidgetItem *,int)), this, setChecked);
To copy to clipboard, switch view to plain text mode
When I compile the code, the following errors come up:
treeview.
cpp:56: error
: no matching function
for call to ‘TreeView
::connect(QTreeWidgetItem*&,
const char*, TreeView
* const, <unresolved overloaded function type>
)’
qobject.
h:209: candidates are
: static bool QObject::connect(const QObject*,
const char*,
const QObject*,
const char*, Qt
::ConnectionType)
qobject.
h:314: bool QObject::connect(const QObject*,
const char*,
const char*, Qt
::ConnectionType) const
treeview.cpp:56: error: no matching function for call to ‘TreeView::connect(QTreeWidgetItem*&, const char*, TreeView* const, <unresolved overloaded function type>)’
qobject.h:209: candidates are: static bool QObject::connect(const QObject*, const char*, const QObject*, const char*, Qt::ConnectionType)
qobject.h:314: bool QObject::connect(const QObject*, const char*, const char*, Qt::ConnectionType) const
To copy to clipboard, switch view to plain text mode
I'm not sure but I believe the reason for this is that there are no signals for QTreeWidgetItem. Please confirm if this is the reason, or if it's not, to show me a possible signal for it that will make it work. Thank you in advance.
Bookmarks