I'm new in pyqt5 and I'm working on a gui that runs tasks from a txt file (each line is a task) and I have 8 QTextBrowser's ,i want to display each line into a QTextBrowser (for example the first line will be shown in the first QTextBrowser, the second line in the second QTextBrowser ..., but the ninth line will be displayed in the first QTextBrowser , the tenth line in the second QTextBrowser ...) and keep looping thru my eight QTextBrowser's
I tried something but it didn't work :
def execute_all(self) :
file = open("taches.txt")
lines = file.readlines()
t1 = QTextBrowser()
t2 = QTextBrowser()
t3 = QTextBrowser()
t4 = QTextBrowser()
t5 = QTextBrowser()
t6 = QTextBrowser()
t7 = QTextBrowser()
t8 = QTextBrowser()
for line in lines :
for i in t1,t2,t3,t4,t5,t6,t7,t8 :
widget.addWidget(i)
widget.setCurrentIndex(widget.currentIndex()+1)
self.i.setText(line)
Thanks for your support!