Back to index

scribus-ng  1.3.4.dfsg+svn20071115
Static Public Member Functions
QString_to_python_unicode Struct Reference

Boost::Python type converter for QString to Python `unicode' object. More...

List of all members.

Static Public Member Functions

static PyObject * convert (QString const &s)

Detailed Description

Boost::Python type converter for QString to Python `unicode' object.

Definition at line 23 of file scripter2_qttype_qstring.cpp.

Member Function Documentation

static PyObject* QString_to_python_unicode::convert ( QString const &  s) [inline, static]

Definition at line 26 of file scripter2_qttype_qstring.cpp.

        //FIXME: Done with Python/C API, needs Boost::Python-ifying
        //FIXME: UCS-4 case can probably be done a lot more effciently.
#if defined(Py_UNICODE_WIDE)
        int unichars = s.length();
        Py_UNICODE* buf = new Py_UNICODE[unichars];
        for (int i = 0; i < unichars; i++)
            buf[i] =;
        PyObject* tempObj = PyUnicode_FromUnicode(buf, unichars);
        delete[] buf;
        return tempObj;
        return PyUnicode_FromUnicode(s.utf16(), s.length());

The documentation for this struct was generated from the following file: