[PyKDE] qstringlist.sip question

Bjorn Pettersen BPettersen at narex.com
Tue May 7 20:55:00 BST 2002


I'm having some problems understanding the sipParseArgs call in
qstringlist.sip __getitem__. From the extending and embedding manual I'm
guessing the "i" format specifier signifies an integer argument. I can't
see the idx variable being parsed to sipParseArgs however, so I'm
wondering how it's being set?

I also couldn't find any reference to an "n" format specifier in the
Python docs, so I'm guessing it's unique to SIP and stands for the
'self' argument?

-- bjorn

	QString __getitem__(int) /NonLazy/;
%MemberCode
		QStringList *ptr;
		int idx;

		if
(sipParseArgs(&sipArgsParsed,sipArgs,"ni",&sipSelfObj,sipClass_QStringLi
st,&ptr))
		{
			if (idx < 0 || idx >= ptr -> count())
			{
	
PyErr_Format(PyExc_IndexError,"QStringList index out of range");
				return NULL;
			}

			return
sipMapCppToSelf(&(*ptr)[idx],sipClass_QString);
		}
%End




More information about the PyQt mailing list