Python Forum
[PyQt] AttributeError: 'NoneType' object has no attribute 'text'
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[PyQt] AttributeError: 'NoneType' object has no attribute 'text'
#9
(Sep-25-2021, 05:02 PM)Axel_Erfurt Wrote: If you don't need row and column you can use simple

item = self.table.selectedItems()[0]
if not item == None:
    name = item.text()
else:
    name = ""
print(name)

I click on a data from the table, but the print function does not work. It doesn't give an error either.
Reply


Messages In This Thread
RE: AttributeError: 'NoneType' object has no attribute 'text' - by speedev - Sep-25-2021, 06:01 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  'NoneType' object has no attribute 'get' zunebuggy 8 1,457 Oct-13-2023, 06:39 PM
Last Post: zunebuggy
  tkinter AttributeError: 'GUI' object has no attribute pfdjhfuys 3 1,622 May-18-2023, 03:30 PM
Last Post: pfdjhfuys
  [Kivy] Windows 10: AttributeError: 'WM_PenProvider' object has no attribute 'hwnd' mikepy 1 2,368 Feb-20-2023, 09:26 PM
Last Post: deanhystad
  [Tkinter] Can't update label in new tk window, object has no attribute tompranks 3 3,594 Aug-30-2022, 08:44 AM
Last Post: tompranks
  [PyQt] Determining the format attributes on text in a QTextEdit object DrakeSoft 7 3,602 Apr-18-2022, 06:40 PM
Last Post: DrakeSoft
  AttributeError: 'NoneType' object has no attribute 'get' George87 5 15,578 Dec-23-2021, 04:47 AM
Last Post: George87
  [Tkinter] Glow text of clickable object on hover with transition andy 6 6,167 May-11-2021, 07:39 AM
Last Post: andy
  [Tkinter] AttributeError: '' object has no attribute 'tk' Maryan 2 14,750 Oct-29-2020, 11:57 PM
Last Post: Maryan
  [Tkinter] AttributeError: 'tuple' object has no attribute 'replace' linuxhacker 7 6,926 Aug-08-2020, 12:47 AM
Last Post: linuxhacker
  [Kivy] AttributeError: 'NoneType' object has no attribute 'bind' faszination_92 2 6,308 Apr-12-2020, 07:01 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020