Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Language Bindings
  4. Crash calling C++ method using QUiLoader from PyQt4
QtWS25 Last Chance

Crash calling C++ method using QUiLoader from PyQt4

Scheduled Pinned Locked Moved Language Bindings
1 Posts 1 Posters 1.9k Views
  • 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 Offline
    N Offline
    NathanW
    wrote on last edited by
    #1

    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
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved