On Mon, Mar 7, 2011 at 11:24 AM, Benjamin Root <[email protected]> wrote:
>
>
> On Mon, Mar 7, 2011 at 10:20 AM, Darren Dale <[email protected]> wrote:
>>
>> On Mon, Mar 7, 2011 at 11:04 AM, Benjamin Root <[email protected]> wrote:
>> >
>> >
>> > On Fri, Mar 4, 2011 at 4:23 AM, Martin Teichmann
>> > <[email protected]>
>> > wrote:
>> >>
>> >> Hi Ben, Hi list,
>> >>
>> >> > Exactly. That's all I found too. Nothing indicates that we need to
>> >> > change anything. We are throwing away the second part of the tuple
>> >> > which has the returned filter. The only reason I see for the new
>> >> > function is so the coder can get back the filter string, which we
>> >> > don't seem to use.
>> >>
>> >> It took me a while to see the problem, too. The point is: there is one
>> >> parameter
>> >> missing in the new API of getSaveFileName, called selectedFilter,
>> >> which we use, and
>> >> given that it is missing, python takes it to be the next parameter,
>> >> which
>> >> must be an int, and you get a TypeError. I discussed this with
>> >> Phil Thompson (the author of PyQt4) over at the PyQt4 mailing list
>> >> (see
>> >>
>> >> http://www.mail-archive.com/pyqt%40riverbankcomputing.com/msg23733.html)
>> >> and he told me to use getSaveFileNameAndFilter.
>> >>
>> >> The other option would be to change PyQt4, dunno which is best.
>> >>
>> >> Greetings
>> >>
>> >> Martin
>> >>
>> >
>> > Martin, thanks for the explanation. That made a lot more sense. I will
>> > go
>> > ahead with the patch.
>>
>> getSaveFileNameAndFilter was only added in pyqt-4.6.
>
>
> oy! Why the heck did qt4 change their API like this?
To make it more pythonic for python-3. You can set the api to v2 with
python-2, but it is not the default.
> What should we do?
I think the change being discussed is only necessary when the QString
api is set to v2. So, we should be able to do something along the
lines of:
import sip
try:
if sip.getapi("QString") > 1:
# support the new api
else:
# support the old api
except (AttributeError, KeyError): # call to getapi may fail with
older versions of sip
# support the old api
> I also assume that some sort of fix should be applied to the v1.0.x?
I think it should be, if the fix does not break backward compatibility
with <PyQt4-4.6.
Darren
------------------------------------------------------------------------------
What You Don't Know About Data Connectivity CAN Hurt You
This paper provides an overview of data connectivity, details
its effect on application quality, and explores various alternative
solutions. http://p.sf.net/sfu/progress-d2d
_______________________________________________
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel