[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    [PyQt] Rules for how SIP handles arguments?
From:       Shaheed Haque <srhaque () theiet ! org>
Date:       2017-05-27 15:20:19
Message-ID: CAHAc2jenvTY4RSNSWVKzntim76M7UZExEuMu=YUKwzkqa7EJoQ () mail ! gmail ! com
[Download RAW message or body]

Hi,

I'm looking into some corner cases in my test suite, and came across
some differences in how SIP handles similar-looking QFlags<xyz>
arguments in these two cases:

========
        virtual KIO::RenameDialog_Result askSkip(KJob*job,
QFlags<KIO::SkipDialog_Option>options, const QString &error_text) = 0
            [KIO::RenameDialog_Result (KJob* job,
QFlags<KIO::SkipDialog_Option> options, const QString &error_text)];
========

versus:

========
       virtual void copy(const QUrl &src, const QUrl &dest, int
permissions, QFlags<KIO::JobFlag>flags)
            [void (const QUrl &src, const QUrl &dest, int permissions,
QFlags<KIO::JobFlag> flags)];
========

In the askSkip case, the generated code has a1 as a pointer, and
initialises it using sipParseArgs like this:

========
        ::KJob* a0;
         ::KIO::SkipDialog_Options* a1;
        int a1State = 0;
        const  ::QString* a2;
        int a2State = 0;
         ::KIO::JobUiDelegateExtension *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "BJ8J1J1", &sipSelf,
sipType_KIO_JobUiDelegateExtension, &sipCpp, sipType_KJob, &a0,
sipType_KIO_SkipDialog_Options, &a1, &a1State, sipType_QString,&a2,
&a2State))
=========

whereas in the copy case, a2 is NOT a pointer, and is not initialised
by sipParseArgs:

=========
        const  ::QString* a0;
        int a0State = 0;
        const  ::QUrl* a1;
        QFlags<KIO::JobFlag> a2;
         ::KIO::ForwardingSlaveBase *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "BJ1J9", &sipSelf,
sipType_KIO_ForwardingSlaveBase, &sipCpp, sipType_QString,&a0,
&a0State, sipType_QUrl, &a1))

=========

How does SIP decide whether to use a pointer or not? I *think* that
because a2 is not initialised, SIP somehow thinks that a2 is an output
variable...either way, it would be good to know what rules SIP uses,
so the generated code can do the right thing.

Thanks, Shaheed
_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
https://www.riverbankcomputing.com/mailman/listinfo/pyqt
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic