[Qt-interest] QTreeWidgetItem checkState question

Frank Lutz frank422542 at googlemail.com
Sat Jul 4 22:10:51 CEST 2009


Yes,
you have to put a slot(method) into your header file

xyz.h---------------------------------------------
public slots:
     void setItemText(const QModelIndex & index );
--------------------------------------------------


now you can make a connection into your Methode

xyz.cpp---------------------------------------------
xyz::xyz(..){
connect(xyz,SIGNAL(clicked( const QModelIndex )),
	this, SLOT(setItemText(const QModelIndex )));
}
------------------------------------------------------
after implementation of TreeWidget.


and now implement the slot(method):

xyz.cpp-------------------------------------------------
void xyz::setItemText(const QModelIndex & index ){
	QString value;
	value = index.data(Qt::DisplayRole);
}
---------------------------------------------------------


Your post remember me on my beginning, don't go panic, you will getting
better and better,... . And than it's easy!
And take a look at :
http://doc.trolltech.com/4.4/signalsandslots.html ;)



More information about the Qt-interest-old mailing list