Menu

Pyhton AttributeError?

Help
Neosettler
2013-05-25
2013-05-25
  • Neosettler

    Neosettler - 2013-05-25

    Greetings,

    This is a follow up on my previous post: Compiling with PythonQt_QtAll::init(); in Visual Studio 2010 (64 bit)

    Here is my real problem:

    CPP:
    QVBoxLayout* vbox = new QVBoxLayout;
    mainModule.addObject("vbox", vbox);

    PY:
    vbox.addWidget(btnPlay)

    ERROR:
    AttributeError: QVBoxLayout has no attribute named 'addWidget'

    Is this error has anything to do with the fact that I do not PythonQt_QtAll::init() or because I'm not using the proper syntax?

    Thx

     
  • Florian Link

    Florian Link - 2013-05-25

    Yes, since QVBoxLayout::addWidget() is not a slot, PythonQt needs a wrapper for it, which is part of the QtGui wrappers. Without correct initialization of QtAll or QtGui, these wrappers are not available.

     
  • Neosettler

    Neosettler - 2013-05-25

    Oh I see, is there a way to initialize only QtCore and QtGui without initializing everything?

    I find very odd that PythonQt_QtAll is not part of the PythonQt library, is there any specific reason for that?

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.