Monday, August 3, 2009

DigiFlip

I add some sample programs to my graphics-dojo clone repository. 'DigiFlip' sample(the one of added programs this time) is not simple-rewritable one from Qt to QtRuby. There are some points hard to implement. I will now list these.

point 1: Qt::Painter#setBrush
point 2: Qt::Pixmap#fill
  • It's similar with above point. A type of Qt::transparent is Qt::GlobalColor, but argument type of Qt::Pixmap#fill is Qt::Color. So Qt::GlobalColor object have to be wrapped with Qt::Color class.

point 3: Enum
  • This sample program manages 3 switching mode with enums: Slide, Flip, and Rotate. These are constants and declared as Qt::Enum instance. See also phosphorescence: Qt::Enum.

point 4: Qt::Painter#begin
  • If point 1~3 solved, some warning still occur.
    QPaintEngine::setSystemRect: Should not be changed while engine is active
    This message tells "Forgetting the method call Qt::Painter#begin". So I add this call with checking whether Qt::Painter is active.
        p = Qt::Painter.new(self)
        p.begin(@pixmap) unless p.active?

After implement correctly, let's run it.

'DigiFlip' is here, and others are found from repository top.

No comments:

Post a Comment