This commit is contained in:
恍兮惚兮 2024-09-15 15:25:57 +08:00
parent 2af907a048
commit de8c104672
2 changed files with 10 additions and 25 deletions

View File

@ -486,37 +486,22 @@ class TextBrowser(QWidget, dataget):
if text[i] != "\n": if text[i] != "\n":
subtext[-1] += text[i] subtext[-1] += text[i]
used = set()
collects = [] collects = []
for i in range(len(subtext)): for i in range(len(subtext)):
finded = -1
for j in range(len(self.iteryinyinglabelsave[iter_context_class])):
if j in used:
continue
if (
self.iteryinyinglabelsave[iter_context_class][j].text()
== subtext[i]
):
finded = j
used.add(j)
break
if finded >= 0:
_ = self.iteryinyinglabelsave[iter_context_class][finded]
_.move(subpos[i].x(), subpos[i].y() + self.labeloffset_y)
_.show()
else:
if i >= len(self.iteryinyinglabelsave[iter_context_class]): if i >= len(self.iteryinyinglabelsave[iter_context_class]):
self.iteryinyinglabelsave[iter_context_class].append( self.iteryinyinglabelsave[iter_context_class].append(
self.currentclass(self.toplabel2) self.currentclass(self.toplabel2)
) )
_ = self.iteryinyinglabelsave[iter_context_class][i] _ = self.iteryinyinglabelsave[iter_context_class][i]
if _.text() != subtext[i]:
_.setColor(color) _.setColor(color)
_.setText(subtext[i]) _.setText(subtext[i])
_.setFont(font) _.setFont(font)
_.adjustSize() _.adjustSize()
_.move(subpos[i].x(), subpos[i].y() + self.labeloffset_y) _.move(subpos[i].x(), subpos[i].y() + self.labeloffset_y)
_.show() _.show()
self.textcursor.setPosition(pos) self.textcursor.setPosition(pos)
self.textbrowser.setTextCursor(self.textcursor) self.textbrowser.setTextCursor(self.textcursor)
tl1 = self.textbrowser.cursorRect(self.textcursor).topLeft() tl1 = self.textbrowser.cursorRect(self.textcursor).topLeft()

View File

@ -29,7 +29,7 @@ include(generate_product_version)
set(VERSION_MAJOR 5) set(VERSION_MAJOR 5)
set(VERSION_MINOR 35) set(VERSION_MINOR 35)
set(VERSION_PATCH 7) set(VERSION_PATCH 8)
add_library(pch pch.cpp) add_library(pch pch.cpp)
target_precompile_headers(pch PUBLIC pch.h) target_precompile_headers(pch PUBLIC pch.h)