[PyQt] sip: QFileIconProvider is undefined

Josh jknox at irobot.com
Wed Mar 10 17:49:56 GMT 2010


Hi,

I'm trying to build a SIP wrappers for a simple C++ subclass of QGLWidget.

I keep running into this error:
    sip: QFileIconProvider is undefined

I'm working from the examples in the SIP reference manual.
My build environment is atypical to the documentation examples in that
I use packages of Python, Qt, PyQt, SIP that are built on one machine 
and then
used by developers on other machines. These are installed locally in 
different
directories than on the original build machine.

This leads to problems where pyqtconfig has paths that refer to the
original build system that are not valid on my development machines.

So far, I've been modifying items in pyqtconfig._pkg_config to match my
sandbox configuration, something like this:

    SANDBOX="~/qtsandbox"
    pyqtconfig._pkg_config['qt_data_dir']  = SANDBOX
    pyqtconfig._pkg_config['qt_dir']       = SANDBOX
    pyqtconfig._pkg_config['qt_inc_dir']   = SANDBOX + "/include/"
    pyqtconfig._pkg_config['qt_lib_dir']   = SANDBOX + "/lib/"
    pyqtconfig._pkg_config['pyqt_mod_dir'] = SANDBOX +
    "/lib/python/site-packages/PyQt4/"
    pyqtconfig._pkg_config['pyqt_bin_dir'] = SANDBOX+ "/bin/"


Then I find the pyqtconfig._pkg_config["pyqt_config_args"] has additional
paths from the build machine for things like qmake, share/sip, 
lib/python/site-packages, etc.

It becomes kinda cumbersome. Do I actually need to modify 
"pyqt_config_args"?
Is there a better way to manage this stuff for my situation? I am new to 
SIP/PyQt so
I may just be flailing like a noob. ;)

Here's the output/info from my attempt to build my wrapper:

     > python configure.py
    Python 2.5.2 is being used.
    PyQt 4.7 is being used.
    Qt v4.6.1 free edition is being used.
    SIP 4.10 is being used.

    Configuration:
    pyqt_modules : QtCore QtGui QtHelp QtMultimedia QtNetwork QtOpenGL
    QtScript QtScriptTools QtSql QtSvg QtTest QtWebKit QtXml
    QtXmlPatterns QtAssistant QtDesigner
    qt_dir : ~/qtsandbox
    pyqt_version_str : 4.7
    pyqt_mod_dir : ~/qtsandbox/lib/python/site-packages/PyQt4/
    pyqt_bin_dir : ~/qtsandbox/bin/
    pyqt_config_args : --confirm-license -q
    /invalid/path/from/build/machine/bin/qmake -b
    /invalid/path/from/build/machine/bin -p 
    /invalid/path/from/build/machine/plugins -d
    /invalid/path/from/build/machine/lib/python/site-packages -v
    /invalid/path/from/build/machine/share/sip --verbose
    qt_version : 263681
    qt_data_dir : ~/qtsandbox
    qt_edition : free
    qt_threaded : 1
    qt_framework : 0
    pyqt_version : 263936
    qt_inc_dir : ~/qtsandbox/include/
    qt_lib_dir : ~/qtsandbox/lib/
    pyqt_sip_dir : ~/qtsandbox/share/sip/
    pyqt_sip_flags : -x VendorID -t WS_X11 -x PyQt_NoPrintRangeBug -t
    Qt_4_6_0 -x Py_v3 -g
    qt_winconfig : shared

    SIP Command Line: ~/qtsandbox/bin/sip -w -c . -I
    ~/qtsandbox/share/sip/ -t WS_X11 -t Qt_4_6_1 -b BasicGLWidget.sbf
    BasicGLWidget.sip

    sip: QFileIconProvider is undefined
    Error: Unable to open "./SimpleGLWidget.sbf"


Here's my .sip file:

    =============SimpleGLWidget.sip===============
    // Defines the SIP wrapper for a SimpleGLWidget

    %Import QtOpenGL/QtOpenGLmod.sip
    %Module SimpleGLWidget 0

    class SimpleGLWidget : QGLWidget
    {
    %TypeHeaderCode
    #include "SimpleGLWidget.hpp"
    #include <QGLWidget>
    %End

    public:
      
        SimpleGLWidget(QWidget *parent = 0);

        QSize aFunction() const;
       
    signals:
        void clicked(QPoint, QSize);

    public slots:
        void handleClick(QPoint, QSize);
     
    };
    ================end=================


Here's the configure.py to generate the sip command & Makefile:

    =============configure.py===============
    import os
    import sipconfig
    import pyqtconfig

    moduleName = "SimpleGLWidget"

    sipFile = moduleName + ".sip"

    # The name of the SIP build file generated by SIP and used by the build
    # system.
    buildFile = moduleName + ".sbf"

    # Get the SIP configuration information.
    config = sipconfig.Configuration()

    config.sip_bin = "/sandbox/tools/bin/sip"

    sipShare = "/sandbox/tools/share/sip/"

    # Run SIP to generate the code.
    sipOptions = " ".join(["-w", "-c", ".", "-I", sipShare,
                           "-t WS_X11", -t Qt_4_6_0", -b",  buildFile,
    sipFile])

    sipCmdLine = " ".join([config.sip_bin, sipOptions])

    print "SIP Command Line:", sipCmdLine, "\r\n"

    os.system(sipCmdLine)

    # Create the Makefile.
    makefile = pyqtconfig.QtGLModuleMakefile(config, buildFile)

    print "Makefile:", makefile

    # Add the library we are wrapping.  The name doesn't include any
    platform
    # specific prefixes or extensions (e.g. the "lib" prefix on UNIX, or the
    # ".dll" extension on Windows).
    makefile.extra_libs = [moduleName]

    # Generate the Makefile itself.
    makefile.generate()

    ================end================

Any pointers greatly appreciated.

Josh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20100310/42b144c5/attachment.html>


More information about the PyQt mailing list