Results 1 to 2 of 2

Thread: I want to change color of a part of QGraphicsLineItem

  1. #1
    Join Date
    Feb 2008
    Posts
    36
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    1

    Default I want to change color of a part of QGraphicsLineItem

    Hi,

    I added 100 pixel length of QgrahicsLineItem in QGraphicsScene. I want to change color 30 length of QGraphicsItem. How can I do that

    QGraphicsLineItem
    -----------------------------------------
    -----------------------------------------

    <-------><---------------------------->
    30 pixel 70 pixel
    yellow blue

    <--------------------------------------->
    100 pixel

  2. #2
    Join Date
    Dec 2006
    Posts
    849
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanks
    6
    Thanked 163 Times in 151 Posts

    Default Re: I want to change color of a part of QGraphicsLineItem

    Basically: create 2 QGraphicsLineItems, I guess.
    If you need this often, wrap it in a custom QGraphicsItem subclass.

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
  •  
Qt is a trademark of The Qt Company.