• About UE4.24 Qt


    4.24只有python27没有3.X,所以byebye PySide2 :XX,改用PySide

    Framework:

    这边假设已经设计好UI并且转换为py文件:

    class Ui_Dialog(object):
        def setupUi(self, Dialog):
            Dialog.setObjectName("Dialog")
            Dialog.resize(647, 161)
            Dialog.setMinimumSize(QtCore.QSize(647, 161))
            Dialog.setMaximumSize(QtCore.QSize(647, 161))
            Dialog.setBaseSize(QtCore.QSize(647, 161))
            self.FileButton = QtGui.QPushButton(Dialog)
            self.FileButton.setGeometry(QtCore.QRect(530, 20, 75, 23))
            self.FileButton.setObjectName("FileButton")
            self.PathEdit = QtGui.QLineEdit(Dialog)
            self.PathEdit.setGeometry(QtCore.QRect(20, 20, 491, 20))
            self.PathEdit.setObjectName("PathEdit")
            self.DeleteButton = QtGui.QPushButton(Dialog)
            self.DeleteButton.setGeometry(QtCore.QRect(530, 80, 75, 23))
            self.DeleteButton.setObjectName("DeleteButton")
            self.FrameCountBox = QtGui.QSpinBox(Dialog)
            self.FrameCountBox.setGeometry(QtCore.QRect(420, 80, 91, 22))
            self.FrameCountBox.setMaximum(100000)
            self.FrameCountBox.setProperty("value", 100)
            self.FrameCountBox.setObjectName("FrameCountBox")
    
            self.retranslateUi(Dialog)
            QtCore.QMetaObject.connectSlotsByName(Dialog)
    
        def retranslateUi(self, Dialog):
            Dialog.setWindowTitle(QtGui.QApplication.translate("Dialog", "Dialog", None, QtGui.QApplication.UnicodeUTF8))
            self.FileButton.setText(QtGui.QApplication.translate("Dialog", "文件夹目录", None, QtGui.QApplication.UnicodeUTF8))
            self.DeleteButton.setText(QtGui.QApplication.translate("Dialog", "删除帧", None, QtGui.QApplication.UnicodeUTF8))


    然后自己写的MainUI这边:
    class MainUI(QtGui.QWidget, ui.Ui_Dialog):
        def __init__(self, parent= None):
            super(MainUI, self).__init__(parent)
            self.setupUi(self)
            self.setWindowTitle('FileDelete V1.0')
            self.create_context_menu()
    
        def create_context_menu(self):
            self.FileButton.clicked.connect(self.set_path)
        ...
    
    
    
    #最后main:
    if __name__ == '__main__':
    
        APP = None
        if not QtGui.QApplication.instance():
            APP = QtGui.QApplication(sys.argv)
    
        main = MainUI()
        main.show()
        sys.exit(APP.exec_()) #其中如果是UE内的插件不用exec_()
  • 相关阅读:
    不使用BeanUtils,利用Java反射机制:表单数据自动封装到JavaBean
    VS2010水晶报表的添加与使用
    使用SelectClipRgn注意事项
    使用SelectClipRgn注意事项
    使用事件CreateEvent注意事项
    【转】Delphi内嵌ASM简易教程
    栈顶和栈底示意图
    【转】对ARM堆栈的理解
    UISegmentedControl的基本使用
    C语言小知识总结
  • 原文地址:https://www.cnblogs.com/sunchuankai/p/13572325.html
Copyright © 2020-2023  润新知