Python code generation with pyside-uic

前端 未结 8 1116
野的像风
野的像风 2020-12-01 12:18

How can I generate python code from a QtDesigner file ? I found pyside-uic but I can\'t find an example for the syntax. I run win7 and pythonxy with spyder.

8条回答
  •  無奈伤痛
    2020-12-01 12:59

    pyside-uic is more or less identical to pyuic4, as such the man page specifies:

    Usage:
            pyside-uic [options] 
    
    Options:
        --version
            show program's version number and exit
    
        -h,--help
            show this help message and exit
    
        -oFILE,--output=FILE
            write generated code to FILE instead of stdout
    
        -x,--execute
            generate extra code to test and display the class
    
        -d,--debug
            show debug output
    
        -iN,--ident=N
            set indent width to N spaces, tab if N is 0 (default: 4)
    

    I usually use it like this:

    pyside-uic -o output.py input.ui
    

提交回复
热议问题