[Kde-bindings] Parameter decoration

Adam Treat manyoso at yahoo.com
Sat Jan 11 15:30:18 UTC 2003


Two things:

1.  NJaaard brought up a possible problem with our Mode tag.
Basically, he wanted to know how we'd handle stuff like:

SomeObject::someMethod(const char * const & someParam)

And here was his solution:

<Parameter Name="something">
	<Reference>
		<Pointer Const="True">
			<Type Name="char" Const="True" />
		</Pointer>
	</Reference>
</Parameter>

Besides the fact that it someone should be shot for this, should the DTD 
handle something like this?

2.  I am wondering what todo about this difference in QtC and our subset:

*** QtC ***

QPushButtonBridge(const QString& text, QWidget* parent, const char* name) : 
QPushButton(text, parent, name)
 {}

extern "C"
{

qt_QPushButton * qt_new_QPushButton1(qt_QString * text, qt_QWidget * parent, 
char* name){
        return (qt_QPushButton *) new QPushButtonBridge((QString&)* 
(QString*)text, (QWidget*)parent, (char*)name);
}

} // extern "C"


*** Qt# subset glue ***

QPushButtonGlue (const QString& text, QWidget* parent, const char* name): 
QPushButton ((const QString&)text, (QWidget*)parent, (const char*)name) {}

extern "C"
{

QPushButton* new_QPushButton1 (void* managedPtr, const QString& text, QWidget* 
parent, const char* name)
        {
                QPushButtonGlue* glue = new QPushButtonGlue ((const 
QString&)text, (QWidget*)parent, (const char*)name);
                glue->managedObject = managedPtr;
                return (QPushButton*)glue;
        }

} // extern "C"

The 'difference' I'm talking about here is the fact that we declare the 
QString a reference in our Extern C method and QtC declares it a pointer ...

I am wondering why QtC does this.  The Qt docs declare it a reference to a 
QString.

In C# we can declare a param with the 'ref' and 'out' keywords 
(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/csref/html/vcgrfMethodParameters.asp)
so am wondering of a good reason against just declaring all references as 
'ref'.

Cheers,

Adam



More information about the Kde-bindings mailing list