Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Crash calling C++ method using QUiLoader from PyQt4

    Language Bindings
    1
    1
    1759
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • N
      NathanW last edited by

      I'm getting this really strange problem with a PyQt4 and Qt C++ application.

      In the C++ application I have a method that loads a UI file using QUiLoader, nothing crazy about the code:

      @QUiLoader loader;
      QFileInfo fi( vl->editForm() );
      loader.setWorkingDirectory( fi.dir() );
      QWidget *myWidget = loader.load( &file, parent );
      file.close(); @

      This works fine until I tried to call it from PyQt4 giving it a form with a custom widget. It will crash on the QUiLoader loader; line.

      Example python code:

      @myobject.openform(path)@

      However if I call openform from within C++ using one of the C++ based tools in my application it will open the form correctly. After that I can call myobject.openform() from Python and it will work fine.

      The error that I get when trying to call myobject.openform() from Python is:

      !http://i.imgur.com/7oZOwTn.png!

      with python27!PyByteArray_Size being were it crahes at.

      1 Reply Last reply Reply Quote 0
      • First post
        Last post