[PyKDE] PyQt: compile problem with gcc 2.95

Wayne Larsen wayne at analogsynthesis.com
Sat Apr 1 17:56:53 BST 2000


Hi, I ran into a problem compiling the PyQt library for gcc 2.95.  The
problem arises when assigning a const string (&QString::null) to a non
const QString (which is an error, not a warning with gcc 2.95)  I solved
the problem by manually editing all of the sip generated files that
caused the problems.  For qregexp (and others) the problem was in the
.sip file itself.

change:       
      QString *a1 = &QString::null;
to:
      QString *a1 = const_cast<QString*>(&QString::null);

Here is a list of the files requiring changes:
sipqtQTranslator.cpp
sipqtQTextView.cpp:4772:
sipqtQTextView.cpp:5893: initialization to `QString *' from `const
QString *' discards qualifiers
make: *** [sipqtQTextView.lo] Error 1
sipqtQWhatsThis.cpp
sipqtQTranslator.cpp
sipqtQTextBrowser.cpp:5194:
sipqtQMessageBox.cpp:6322: (and multiple other places)
sipqtQListViewItem.cpp:5582: (and multiple other places)
sipqtQListBoxText.cpp:465, 500
sipqtQFileDialog.cpp:6600: (and multiple..)
sipqtQPixmap.cpp:1948:

For these files, the change was to remove the const from the appropriate
definition that was causing problems.

qregexp.sip:106:  -> sipqtQRegExp.cpp
qwindowsstyle.sip:160: -> sipqtQWindowsStyle.cpp
qwindowsstyle.sip:191: -> sipqtQWindowsStyle.cpp
qplatinumstyle.sip:103: -> sipqtQPlatinumStyle.cpp
qfontdialog.sip:63: -> sipqtQFontDialog.cpp
qcommonstyle.sip:87: -> sipqtQCommonStyle.cpp
qmotifstyle.sip:128, 159 -> sipqtQMotifStyle.cpp


I imagine the .sip files are relatively easy to change.  However, if my
understanding is correct, the others will require change to the actual
qt source?

Regards,
Wayne





More information about the PyQt mailing list