question about Table1.currentItem()

15 views
Skip to first unread message

stefano cerbioni

unread,
Feb 21, 2024, 5:07:52 PMFeb 21
to The Ring Programming Language
Hi guys i try to recover data inside of table , i try to use this  code

alista=Table1.currentItem()
?alista
?alista[1]

but  tell me 
[This Attribute Contains A List]
Line 156 Object does not support operator overloading

how  is possible read a data?
thanks

Ilir Liburn

unread,
Feb 21, 2024, 8:39:55 PMFeb 21
to The Ring Programming Language
Hello Stefano,

Indeed, currentitem() returns list, but it is a special kind of list called object (QTableWidgetItem). This object has only one attribute: pObject (pointer to object).
In short, you first need to check if there is current item (pointer is not NULL) and then you can call text() like this

obj = Table1.currentItem()
? obj.pObject
if getpointer(obj.pObject)
? obj.text()
ok

You get pointer not NULL once you double click item in the table and you edit text.

Greetings,
Ilir
Reply all
Reply to author
Forward
0 new messages