I am creating QStandardItem and recursively appending rows..
child_node = QtGui.QStandardItem("ITEM TEXT")
root.appendRow(child_node)
"ITEM TEXT" - is getting directly from sqlite...for each iteration...
I am creating QStandardItem and recursively appending rows..
child_node = QtGui.QStandardItem("ITEM TEXT")
root.appendRow(child_node)
"ITEM TEXT" - is getting directly from sqlite...for each iteration...
Well then it is easy - when you create the QStandardItem, just callWhen you get the selected item, then it is justQt Code:
To copy to clipboard, switch view to plain text mode(or whatever the appropriate syntax is - I'm not a python programmer).Qt Code:
ID = selected_node.data( Qt::UserRole )To copy to clipboard, switch view to plain text mode
serj (4th April 2015)
It works! Thanks! This is exactly what I need..
child_node.setData(QtCore.QVariant(str(chld["ID"]))) #setting data
selected_id = str(index.model().itemFromIndex(index).data().toSt ring()) #getting data
Bookmarks