How not to write Python text because it's lagging?

Asked 2 years ago, Updated 2 years ago, 15 views

First the code is

self.rank.textChanged.connect(self.textch)

def textch(self):
     items = self.listWidget.selectedItems()
     for item in items:
          item.setText(item.text()+'('+self.rank.text()+'etc')

It looks like this, but if you click on the list and enter the ranking,

It comes out like this But I want to change my rank over there, so if I do it again,

I'm going to have another one next to me, and the result I want is to get rid of the 4th place and get 5th place I want to do it, but I don't know how to do it Thank you very much for your reply.

python

2022-09-20 11:04

1 Answers

def textch(self):
    items = self.listWidget.selectedItems()
    for item in items:
     if "back>" in item.text():
        item.setText(lines[self.listWidget.currentRow()].strip())
     item.setText(item.text()+'<'+self.rank.text()+'etc>')

I solved it like this Thank you


2022-09-20 11:04

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.