View Full Version : QTextEdit does not hold Object Id behind

16th April 2008, 15:55
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?

16th April 2008, 22:27
What exactly that "object" is? Is it some class instance or a record in a database?

18th April 2008, 08:55
For example I have a XMl file

<Student ID="1">

Student ID="2">


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.

19th April 2008, 01:25
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.