Results 1 to 4 of 4

Thread: 4.4 back compatibility of the class QGraphicColorizeEffect

  1. #1
    Join Date
    Nov 2009
    Posts
    5
    Thanks
    1
    Qt products
    Qt4
    Platforms
    MacOS X

    Default 4.4 back compatibility of the class QGraphicColorizeEffect

    Hi all, the class QGraphicColorizeEffect let you change the color of a QgraphicPixmapItem,

    unfortunatly this class was introduced only in 4.6,
    i'm developing a project that must use the qt 4.3 so, i need to know how to change the color of a QGraphicPixmapItem

    another issue is the setX and setY method on the QgraphicPixmapItem, again this was introduced only in 4.6 but looks like there wasn't any of similar on previous versions...


    any tips ?!

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: 4.4 back compatibility of the class QGraphicColorizeEffect

    I doubt you'll be able to mimic graphics effects easily. I can only advise you to create your own pixmap item class that would have a setColor() method that would take the original pixmap, colorize it so that you can draw it instead of the original. To colorize you can probably just set an appropriate composition mode and fill the pixmap with colour of your choice.

    You should be able to implement setX and setY with a subclass as well, it's just a matter of returning a different bounding rect and a bit different painting routine.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. The following user says thank you to wysota for this useful post:

    Snick (21st November 2009)

  4. #3
    Join Date
    Nov 2009
    Posts
    5
    Thanks
    1
    Qt products
    Qt4
    Platforms
    MacOS X

    Default Re: 4.4 back compatibility of the class QGraphicColorizeEffect

    an you pls tell me more about

    " set an appropriate composition mode and fill the pixmap with colour of your choice "

    is exactly what i need .. i have a gray figure, and want to set it with different colors ..



    ps: i saw you wwWidget and i have to say they are super cool, great works, probably i will use the colorweel so tnx in advice

  5. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: 4.4 back compatibility of the class QGraphicColorizeEffect

    Quote Originally Posted by Snick View Post
    an you pls tell me more about

    " set an appropriate composition mode and fill the pixmap with colour of your choice "

    is exactly what i need .. i have a gray figure, and want to set it with different colors ..
    Open Qt Assistant and type in "composition" in the index tab.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. QT Class GUI Interactions??
    By mikey33 in forum Newbie
    Replies: 3
    Last Post: 19th November 2009, 02:01
  2. class QHBoxLayout
    By csvivek in forum Installation and Deployment
    Replies: 2
    Last Post: 10th April 2008, 07:57
  3. Qt designer plugin errors on OSX Leopard
    By mpotocnik in forum Qt Tools
    Replies: 10
    Last Post: 21st January 2008, 09:45
  4. Distributing QT application for Mac OS
    By mb0 in forum Qt Programming
    Replies: 1
    Last Post: 31st May 2007, 18:59
  5. Replies: 15
    Last Post: 21st April 2007, 17:46

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.