Yes I have. Here is all of the code that I have pertaining to it:
in treeview.h
public slots:
virtual void setChecked();
public slots:
virtual void setChecked();
To copy to clipboard, switch view to plain text mode
in treeview.cpp
connect(cities,
SIGNAL(itemClicked
(QTreeWidgetItem *,
int)),
this,
SLOT(setChecked
()));
void TreeView::setChecked()
{
if(Qt::Checked)
{
std::cout << "Checked\n" << std::endl;
//citiesChild->setCheckState(0, Qt::Checked);
}
else
{
std::cout << "Unchecked\n" << std::endl;
}
}
connect(cities, SIGNAL(itemClicked(QTreeWidgetItem *,int)), this, SLOT(setChecked()));
void TreeView::setChecked()
{
if(Qt::Checked)
{
std::cout << "Checked\n" << std::endl;
//citiesChild->setCheckState(0, Qt::Checked);
}
else
{
std::cout << "Unchecked\n" << std::endl;
}
}
To copy to clipboard, switch view to plain text mode
Added after 5 minutes:
Ok, I see that I accidentally made it a "public" slot instead of a "private" slot. But now I am recieving the error
:: error: collect2: ld returned 1 exit status
:: error: collect2: ld returned 1 exit status
To copy to clipboard, switch view to plain text mode
The code works without all of the code that I have displayed above, so the problem is within it.
Ok, I corrected that problem, but am now recieving the same errors as before:
treeview.
cpp:56: error
: no matching function
for call to ‘TreeView
::connect(QTreeWidgetItem*&,
const char*, TreeView
* const,
const char*)’
/opt
/qtsdk
-2010.04/qt
/include
/QtCore
/qobject.
h:209: candidates are
: static bool QObject::connect(const QObject*,
const char*,
const QObject*,
const char*, Qt
::ConnectionType)
/opt
/qtsdk
-2010.04/qt
/include
/QtCore
/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, const char*)’
/opt/qtsdk-2010.04/qt/include/QtCore/qobject.h:209: candidates are: static bool QObject::connect(const QObject*, const char*, const QObject*, const char*, Qt::ConnectionType)
/opt/qtsdk-2010.04/qt/include/QtCore/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
any ideas?
Bookmarks