First cut on a QtAgg backend

That probably leaves us with the OSX problems, though. Ahh,

    > fixed in CVS, ok then.

I'm lost here -- as far as I know the endianess problem *was not*
fixed in CVS. I did add an agg method tostring_bgra to CVS which
appears to fix the reversed color problem. I haven't had a chance to
test this on OSX since my powerbook is at home...

    > I think that QPixmap or better yet QCanvas would be the
    > appropriate if you are making a pure Qt-backend, but that
    > QImage is the choice for a backend with other rendering as
    > Agg or Cairo.

OK, I'll leave that to you, since I now next to nothing about qt.

    > Adding this to the end of FigureCanvasQtAgg.__init__ will
    > fix tracking:

    > self.setMouseTracking(True)

Yep, works. Easy enough.

Any thoughts about why the figure doesn't refresh during pan and zoom.
On my box (linux) the update only occurs after the mouse button is
released.

The other annoyance vis-a-vis nav toolbar I notice is the flicker when
doing the rubberbanding for zoom to rect. Any idea how to implement
double buffering to avoid the flicker?

Thanks!
JDH

John Hunter wrote:

   > That probably leaves us with the OSX problems, though. Ahh,
   > fixed in CVS, ok then.

I'm lost here -- as far as I know the endianess problem *was not*
fixed in CVS. I did add an agg method tostring_bgra to CVS which
appears to fix the reversed color problem. I haven't had a chance to
test this on OSX since my powerbook is at home...

Sorry about that, it came out wrong. Yes the inversed color could be fixed (I have not tested the CVS-version yet), the endiannes is not. You could try to change the endian in FigureCanvasQtAgg.draw()
        self.qimage = qt.QImage(self.stringBuffer,
                                self.renderer.width,
                                self.renderer.height,
                                32,
                                None,
                                0,
                                qt.QImage.IgnoreEndian,
                                )

to

        self.qimage = qt.QImage(self.stringBuffer,
                                self.renderer.width,
                                self.renderer.height,
                                32,
                                None,
                                0,
                                qt.QImage.BigEndian,
                                )

Or perhaps qt.QImage.LittleEndian if that is the way the conversion should go.

Good luck!

Regards,
Sigve