<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
</head>
<body bgcolor="#ffffff" text="#000000">
Hi,<br>
<br>
I'm trying to build a SIP wrappers for a simple C++ subclass of
QGLWidget.<br>
<br>
I keep running into this error:<br>
&nbsp;&nbsp;&nbsp; sip: QFileIconProvider is undefined<br>
<br>
I'm working from the examples in the SIP reference manual.<br>
My build environment is atypical to the documentation examples in that <br>
I use packages of Python, Qt, PyQt, SIP that are built on one machine
and then <br>
used by developers on other machines. These are installed locally in
different <br>
directories than on the original build machine.<br>
<br>
This leads to problems where pyqtconfig has paths that refer to the <br>
original build system that are not valid on my development machines.<br>
<br>
So far, I've been modifying items in pyqtconfig._pkg_config to match my
<br>
sandbox configuration, something like this:<br>
<br>
<blockquote>SANDBOX="~/qtsandbox"<br>
pyqtconfig._pkg_config['qt_data_dir']&nbsp; = SANDBOX<br>
pyqtconfig._pkg_config['qt_dir']&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = SANDBOX<br>
pyqtconfig._pkg_config['qt_inc_dir']&nbsp;&nbsp; = SANDBOX + "/include/"<br>
pyqtconfig._pkg_config['qt_lib_dir']&nbsp;&nbsp; = SANDBOX + "/lib/"<br>
pyqtconfig._pkg_config['pyqt_mod_dir'] = SANDBOX +
"/lib/python/site-packages/PyQt4/"<br>
pyqtconfig._pkg_config['pyqt_bin_dir'] = SANDBOX+ "/bin/"<br>
</blockquote>
<br>
Then I find the pyqtconfig._pkg_config["pyqt_config_args"] has
additional <br>
paths from the build machine for things like qmake, share/sip,
lib/python/site-packages, etc.<br>
<br>
It becomes kinda cumbersome. Do I actually need to modify
"pyqt_config_args"?<br>
Is there a better way to manage this stuff for my situation? I am new
to SIP/PyQt so <br>
I may just be flailing like a noob. ;)<br>
<br>
Here's the output/info from my attempt to build my wrapper:<br>
<blockquote>&gt; python configure.py<br>
Python 2.5.2 is being used.<br>
PyQt 4.7 is being used.<br>
Qt v4.6.1 free edition is being used.<br>
SIP 4.10 is being used.<br>
  <br>
Configuration:<br>
pyqt_modules : QtCore QtGui QtHelp QtMultimedia QtNetwork QtOpenGL
QtScript QtScriptTools QtSql QtSvg QtTest QtWebKit QtXml QtXmlPatterns
QtAssistant QtDesigner<br>
qt_dir : ~/qtsandbox<br>
pyqt_version_str : 4.7<br>
pyqt_mod_dir : ~/qtsandbox/lib/python/site-packages/PyQt4/<br>
pyqt_bin_dir : ~/qtsandbox/bin/<br>
pyqt_config_args : --confirm-license -q
/invalid/path/from/build/machine/bin/qmake -b
/invalid/path/from/build/machine/bin -p&nbsp;
/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<br>
qt_version : 263681<br>
qt_data_dir : ~/qtsandbox<br>
qt_edition : free<br>
qt_threaded : 1<br>
qt_framework : 0<br>
pyqt_version : 263936<br>
qt_inc_dir : ~/qtsandbox/include/<br>
qt_lib_dir : ~/qtsandbox/lib/<br>
pyqt_sip_dir : ~/qtsandbox/share/sip/<br>
pyqt_sip_flags : -x VendorID -t WS_X11 -x PyQt_NoPrintRangeBug -t
Qt_4_6_0 -x Py_v3 -g<br>
qt_winconfig : shared<br>
  <br>
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 <br>
  <br>
sip: QFileIconProvider is undefined<br>
Error: Unable to open "./SimpleGLWidget.sbf"<br>
</blockquote>
<br>
Here's my .sip file:<br>
<br>
<blockquote>=============SimpleGLWidget.sip===============<br>
// Defines the SIP wrapper for a SimpleGLWidget<br>
  <br>
%Import QtOpenGL/QtOpenGLmod.sip<br>
%Module SimpleGLWidget 0<br>
  <br>
class SimpleGLWidget : QGLWidget<br>
{<br>
%TypeHeaderCode<br>
#include "SimpleGLWidget.hpp"<br>
#include &lt;QGLWidget&gt;<br>
%End<br>
  <br>
public:<br>
&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; SimpleGLWidget(QWidget *parent = 0);<br>
  <br>
&nbsp;&nbsp;&nbsp; QSize aFunction() const;<br>
&nbsp;&nbsp;&nbsp; <br>
signals:<br>
&nbsp;&nbsp;&nbsp; void clicked(QPoint, QSize);<br>
  <br>
public slots:<br>
&nbsp;&nbsp;&nbsp; void handleClick(QPoint, QSize);<br>
&nbsp;<br>
};<br>
================end=================<br>
</blockquote>
<br>
Here's the configure.py to generate the sip command &amp; Makefile:<br>
<br>
<blockquote>=============configure.py===============<br>
import os<br>
import sipconfig<br>
import pyqtconfig<br>
  <br>
moduleName = "SimpleGLWidget"<br>
  <br>
sipFile = moduleName + ".sip"<br>
  <br>
# The name of the SIP build file generated by SIP and used by the build<br>
# system.<br>
buildFile = moduleName + ".sbf"<br>
  <br>
# Get the SIP configuration information.<br>
config = sipconfig.Configuration()<br>
  <br>
config.sip_bin = "/sandbox/tools/bin/sip"<br>
  <br>
sipShare = "/sandbox/tools/share/sip/"<br>
  <br>
# Run SIP to generate the code.<br>
sipOptions = " ".join(["-w", "-c", ".", "-I", sipShare,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "-t WS_X11", -t Qt_4_6_0", -b",&nbsp; buildFile,
sipFile])<br>
  <br>
sipCmdLine = " ".join([config.sip_bin, sipOptions])<br>
  <br>
print "SIP Command Line:", sipCmdLine, "\r\n"<br>
  <br>
os.system(sipCmdLine)<br>
  <br>
# Create the Makefile.<br>
makefile = pyqtconfig.QtGLModuleMakefile(config, buildFile)<br>
  <br>
print "Makefile:", makefile<br>
  <br>
# Add the library we are wrapping.&nbsp; The name doesn't include any
platform<br>
# specific prefixes or extensions (e.g. the "lib" prefix on UNIX, or the<br>
# ".dll" extension on Windows).<br>
makefile.extra_libs = [moduleName]<br>
  <br>
# Generate the Makefile itself.<br>
makefile.generate()<br>
  <br>
================end================<br>
  <br>
</blockquote>
Any pointers greatly appreciated.<br>
<br>
Josh<br>
</body>
</html>