What is the type of item and what is the type of "PLC"?
And in your code lnx is a local variable in different method so how do you want to reference it in this method?
I think you need to revise your C++ knowledge...
Why can't you use QTreeWidgetItem methods like for example text() to get know what item did you clicked?
You can event set your data with QTreeWidgetItem::setData() with Qt::UserRole while creating item to let you know what item it is.
Qt Code:
lnx->setData(0, Qt::UserRole, "lnx"); // and check it: if (item->data().toString() == "lnx")To copy to clipboard, switch view to plain text mode
P.S. And use CODE tags for pasting code! Your code is already a mess in terms of formatting and without CODE tags it is even worse.
Bookmarks