mirror of
https://github.com/HIllya51/LunaTranslator.git
synced 2025-01-13 15:43:53 +08:00
.
This commit is contained in:
parent
3d422a4dd4
commit
14cdd4d4f7
@ -225,15 +225,17 @@ class TagWidget(QWidget):
|
|||||||
self.__addTag((tag, _type, refdata))
|
self.__addTag((tag, _type, refdata))
|
||||||
self.__calltagschanged(signal)
|
self.__calltagschanged(signal)
|
||||||
|
|
||||||
@tryprint
|
|
||||||
def __removeTag(self, key):
|
def __removeTag(self, key):
|
||||||
_w = self.tag2widget[key]
|
_w = self.tag2widget[key]
|
||||||
self.layout().removeWidget(_w)
|
self.layout().removeWidget(_w)
|
||||||
self.tag2widget.pop(key)
|
self.tag2widget.pop(key)
|
||||||
|
|
||||||
def removeTag(self, key, signal=True):
|
def removeTag(self, key, signal=True):
|
||||||
self.__removeTag(key)
|
try:
|
||||||
self.__calltagschanged(signal)
|
self.__removeTag(key)
|
||||||
|
self.__calltagschanged(signal)
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
def __calltagschanged(self, signal):
|
def __calltagschanged(self, signal):
|
||||||
if signal:
|
if signal:
|
||||||
@ -241,7 +243,10 @@ class TagWidget(QWidget):
|
|||||||
|
|
||||||
def clearTag(self, signal=True):
|
def clearTag(self, signal=True):
|
||||||
for key in self.tag2widget.copy():
|
for key in self.tag2widget.copy():
|
||||||
self.__removeTag(key)
|
try:
|
||||||
|
self.__removeTag(key)
|
||||||
|
except:
|
||||||
|
pass
|
||||||
self.__calltagschanged(signal)
|
self.__calltagschanged(signal)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user