Python shiboken2.wrapInstance() Examples

def get_nav_layout():
    def find_first_frame_layout(layout):
        "" "は、最初のフレームレイアウト" ""が見つかるまで、すべての子レイアウトを取得します
        children = cmds.layout(layout、ca = True、q = True)
        子供の子供のため:
            もしchild.startswith( 'frameLayout'):
                子供を返す
            そうしないと:
                find_first_frame_layout(child)を返します
    nav_layout = find_first_frame_layout( 'AttrEdsporeNodeFormLayout')
    return wrapInstance(long(omui.MQtUtil.findControl(nav_layout))、QWidget)
from shiboken2 import getCppPointer, wrapInstance

def testAdresses(self):
        q = QtCore.QObject()
        ptr = wrapper.getCppPointer(q)
        print("CppPointer to an instance of PySide.QtCore.QObject = 0x%016X" % ptr[0])
        # None of the following is expected to raise an
        # OverflowError on 64-bit systems
        # largest 32-bit address
        wrapper.wrapInstance(0xFFFFFFFF, QtCore.QObject)
        # a regular, slightly smaller 32-bit address
        wrapper.wrapInstance(0xFFFFFFF, QtCore.QObject)
        # an actual 64-bit address (> 4 GB, the first non 32-bit address)
        wrapper.wrapInstance(0x100000000, QtCore.QObject)
        # largest 64-bit address
        wrapper.wrapInstance(0xFFFFFFFFFFFFFFFF, QtCore.QObject)

コメントを残す

メールアドレスが公開されることはありません。

Next Post

Qt.py

木 8月 6 , 2020
https://github.com/mottosso/Qt.py