Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [SOLVED] change the pen of a QGraphicsItemGroup

[SOLVED] change the pen of a QGraphicsItemGroup

Scheduled Pinned Locked Moved General and Desktop
qgraphicsitemqgraphicsscene
2 Posts 2 Posters 1.2k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • youzkingY Offline
    youzkingY Offline
    youzking
    wrote on last edited by youzking
    #1

    hello,

    i have QGraphicsItemGroup used to store a group of QGraphicsLineItem ,
    i want to change the pen of QGraphicsLineItem childs but the QGraphicsItemGroup does not have a such mlethod , so i did a cast from QGraphicsItemGroup to QGraphicsLineItem but the program has stopped !!

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mcosta
      wrote on last edited by
      #2

      Hi,

      the solution could be one of the following:

      • Iterate over the list returned by childItems(), then check if the item is a QGraphicsLineItem and set Pen to it
      • Create a class derived by QGraphicsLineItem and implement a method doing the above job

      Once your problem is solved don't forget to:

      • Mark the thread as SOLVED using the Topic Tool menu
      • Vote up the answer(s) that helped you to solve the issue

      You can embed images using (http://imgur.com/) or (http://postimage.org/)

      1 Reply Last reply
      1

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved