在QTextBrowser中无法显示作者,文档编制者,翻译者

时间:2019-07-01 15:22:34

标签: python linux python-3.x pyqt5 qtextbrowser

我现在可以在最后一个选项卡中显示许可证,但是对于第一个,第二个和第三个选项卡则无法显示。实际上,它与第一个选项卡是同一件事。

即使它是辅助GUI(在调用她时也显示在主窗口中)。这是积分屏幕的代码。

我已经尝试了几种方法,但没有得到输出(在神秘的Sig错误下)。我也尝试过python模块faulthandler,但没有成功。

您是否知道我做错了什么?

通过提前谢谢。

import os

from PyQt5.QtWidgets import QDialog

from ui.creditsui import Ui_creditscreen

OG = {'name': 'Olivier Girard', 'email': 'olivier@ecrxxxxx.org'}
CREDITS = {'code': [OG],
       'documentation': [OG],
       'translation': [OG],
       }
path_licence = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))


class Credits(QDialog):

def __init__(self, parent=None):

    super(Credits, self).__init__(parent)
    self.setupUi()
    self.showLicense()
    # self.showAuthors()

def setupUi(self):

    self.ui = Ui_creditscreen()
    self.ui.setupUi(self)

def showLicense(self):

    # path_li = os.path.join(path_licence, "licence.txt")

    with open('licence.txt', 'r') as my_licence:
        text = my_licence.read()
        self.ui.textBrowserlicense.setPlainText(text)
        # self.ui.textBrowserlicense.setText(text)

def showAuthors(self):

    authors = []
    for person in CREDITS['code']:
        name = person['name']
        email = person['email']
        authors.append("{} <{}>".format(name, email))
    self.ui.textBrowserwritten.setText(authors)

def showDocumenters(self):

    authors = []
    for person in CREDITS['documentation']:
        name = person['name']
        email = person['email']
        authors.append("{} <{}>".format(name, email))
    self.ui.textBrowserdocumented.setText(authors)

def showTranslators(self):

    authors = []
    for person in CREDITS['translation']:
        name = person['name']
        email = person['email']
        authors.append("{} <{}>".format(name, email))
    self.ui.textBrowsertranslated(authors)

0 个答案:

没有答案