将Qt5升级到5.6.2版本

2024-04-26 10:05:51 发布

您现在位置:Python中文网/ 问答频道 /正文

我最近更新了我的ubuntu系统,Qt5库更新到了5.6.2版本 我的python文件中使用了一个现有的ui文件:

class Window(QtWidgets.QMainWindow):
    def __init__(self):
        super(Window,self).__init__()
        print("into init")
        uic.loadUi('main.ui',self)
        print("loaded main.ui")
        self.pushButton_2.clicked.connect(lambda: self.reset())
        self.pushButton.clicked.connect(lambda: self.submit())      
        self.pushButton_3.clicked.connect(self.close)

但是现在uic.loadUi('main.ui',self)给出了一个分段错误。你知道吗

我尝试在designer中打开ui文件,但打开时出现以下错误

 Error while reparenting!
Designer: A class name mismatch occurred when creating a widget using the custom widget factory registered for widgets of class KDialog. It returned a widget of class QDialog.
QMetaProperty::read: Unable to handle unregistered datatype 'SelectionBehavior' for property 'QTabBar::selectionBehaviorOnRemove'
appmenu-qt: registerWindow 206 "&File"
appmenu-qt: registerWindow 206 "&Edit"
appmenu-qt: registerWindow 206 "F&orm"
appmenu-qt: registerWindow 206 "&View"
appmenu-qt: registerWindow 206 "&Settings"
appmenu-qt: registerWindow 206 "&Window"
appmenu-qt: registerWindow 206 "&Help"

注意:ui文件确实按预期打开了,但我无法从python函数加载它并获得Segmentation Fault


Tags: 文件selfuiinitmainconnectwidgetwindow