[Qtcsharp-list] CS0508 Errors
Status: Inactive
Brought to you by:
manyoso
From: Nick <ni...@ch...> - 2002-08-07 10:08:38
|
What a pain. These errors should now be fixed. Here's a list of the classes that were affected, and what I did to fix them (to see the specific methods, see the compiler output at the end of this message). ---- o QFontDialog.style o QFontDialog.size The definitions of these methods are declared in qfontdialog.h inside a '#if 0' block, so they shouldn't even exist in our API definition. Throttled. o QMessageBox.icon According to qmessagebox.h, this method is obsolete. Throttled. o QCacheIterator QCache and QCacheIterator aren't exposed via any method return type in Qt. I assume they're used internally. Removed from qtcsharp/Makefile.am. o QAsciiCacheIterator QAsciiCache and QAsciiCacheIterator, same case as QCacheIterator. o QAsciiCacheIterator QAsciiDict and QAsciiDictIterator are used by QObjectDictionary, which isn't exposed via any method return type in Qt. Removed all three from qtcsharp/Makefile.am. o QMemArray This is used indirectly by some important classes, namely QCString and QPointArray, and the latter of these is used by a ton of classes. Throttled the offending methods. o QBitArray Same case as QCacheIterator. o QPtrListIterator Used for important classes that are exposed in C#. Throttled the offending methods. o QDictIterator QDict and QDictIterator, same case as QCacheIterator. o QIntCacheIterator QIntCache and QIntCacheIterator, same case as QCacheIterator. o QIntDictIterator QIntDict and QIntDictIterator are used by QWidgetIntDict and QWidgetIntDictIt, but none of these are exposed to the user via method return types. Removed all from qtcsharp/Makefile.am. o QPtrDictIterator Same case as QCacheIterator. o QSignalVec Same case as QCacheIterator. o QSqlEditorFactory Don't need to use Qt's SQL support, removed QSQL*, QDataBrowser, QDataView, and QDataTable from QDataqtcsharp/Makefile.am. ---- Now, on to how I throttled them. Adam, from what I could tell, the only throttling that is done is through Converter.cs when a method signature has already been added to the sigs list. I couldn't find any way to throttle specific methods by name. Please tell me if that is a correct assessment, or if I am stupid, retarded, or both. So, I added five lines to Parser.cs to check for a 'throttled="true"' attribute on <qmethod> tags, and added throttled="true" to each offending method in QtAPI.xml. This is in no way an elegant solution. As I discussed with Marcus, I feel that the API XML representation should _only_ contain information relevant to the API, and nothing having to do with generating bindings. However, this was the approach that required the least code change in the generator and to the API. Some other alternatives I came up with were storing the methods to be throttled in a file and modifying the generator to take a --throttle <file> flag, specifying methods to be throttled on the command line, or some similar paradigm. This would require modifying a few parts of the generator. Not very desirable. Also, commenting out the offending methods in QtAPI.xml with <!-- ---> came to mind, but adding a throttle attribute required much less modification to QtAPI.xml, and seems more correct for now. The real way to solve these problems, as far as I can tell, is marking offending methods with the 'new' keyword. I can't think of an easy way to have the generator know when to do this. A related problem is virtual methods using the 'override' keyword where appropriate, which we fixed by using --nowarn 0108 with mcs and csc. This isn't very elegant, either, but like the 0508 error, I can think of no easy solution. The type tree representation I mentioned should allow us to detect occurrences of these cases during generation and take the appropriate action (using new or override). Though not elegant, the temporary fixes that've put in place shouldn't be an inconvenience to users, and in light of our plans to reimplement the binding generator, it should suffice for now. I've tested these changes with scribblewindow and mandelbrot; all seems well. If the changes I've made aren't acceptable for some reason, just let me know and I can undo all of these changes by reverting to previous versions in CVS. Nick ----- Here's the complete output from mcs relating to my fixes. error CS0508: `Qt.QAsciiCacheIterator.toFirst': cannot change return type when overriding inherited member QGCacheIterator.toFirst error CS0508: `Qt.QAsciiCacheIterator.toLast': cannot change return type when overriding inherited member QGCacheIterator.toLast error CS0508: `Qt.QAsciiDictIterator.toFirst': cannot change return type when overriding inherited member QGDictIterator.toFirst error CS0508: `Qt.QMemArray.data': cannot change return type when overriding inherited member QGArray.data error CS0508: `Qt.QMemArray.at': cannot change return type when overriding inherited member QGArray.at error CS0508: `Qt.QBitArray.at': cannot change return type when overriding inherited member QGArray.at error CS0508: `Qt.QBitmap.xForm': cannot change return type when overriding inherited member QPixmap.xForm error CS0508: `Qt.QCacheIterator.toFirst': cannot change return type when overriding inherited member QGCacheIterator.toFirst error CS0508: `Qt.QCacheIterator.toLast': cannot change return type when overriding inherited member QGCacheIterator.toLast error CS0508: `Qt.QPtrListIterator.toFirst': cannot change return type when overriding inherited member QGListIterator.toFirst error CS0508: `Qt.QPtrListIterator.toLast': cannot change return type when overriding inherited member QGListIterator.toLast error CS0508: `Qt.QDictIterator.toFirst': cannot change return type when overriding inherited member QGDictIterator.toFirst error CS0508: `Qt.QFontDialog.style': cannot change return type when overriding inherited member QWidget.style error CS0508: `Qt.QFontDialog.size': cannot change return type when overriding inherited member QWidget.size error CS0508: `Qt.QIntCacheIterator.toFirst': cannot change return type when overriding inherited member QGCacheIterator.toFirst error CS0508: `Qt.QIntCacheIterator.toLast': cannot change return type when overriding inherited member QGCacheIterator.toLast error CS0508: `Qt.QIntDictIterator.toFirst': cannot change return type when overriding inherited member QGDictIterator.toFirst error CS0508: `Qt.QMessageBox.icon': cannot change return type when overriding inherited member QWidget.icon error CS0508: `Qt.QPtrDictIterator.toFirst': cannot change return type when overriding inherited member QGDictIterator.toFirst error CS0508: `Qt.QSignalVec.at': cannot change return type when overriding inherited member QPtrVector.at error CS0508: `Qt.QSqlEditorFactory.defaultFactory': cannot change return type when overriding inherited member QEditorFactory.defaultFactory Compilation failed: 21 error(s), 0 warnings |