I must use QtextEdit to fill and select object.I want to show name of object in QtextEdit and I want to use Id of Object but QtextEdit does not hold Id behind.
How can I do or not?
I must use QtextEdit to fill and select object.I want to show name of object in QtextEdit and I want to use Id of Object but QtextEdit does not hold Id behind.
How can I do or not?
What exactly that "object" is? Is it some class instance or a record in a database?
For example I have a XMl file
<Students>
<Student ID="1">
<Name>joo<Name/>
</Student>
Student ID="2">
<Name>foo<Name/>
</Student>
</Students>
I read xml file and I write names of student into QtextEdit .When I want to update in name of a student , I select a name from QTextEdit.I parse Xml according to student ID so I hold ID of student behind. How I can do this.
In that case I would use one of the QxxxView or QxxxWidget classes instead of QTextEdit. This way you won't have any problems in selecting particular items and you can easily store additional data for example in a model (in case of QxxxView classes) or member variables (in case of QxxxWidget classes).
Take a look at QTableWidgetItem.
Bookmarks