Results 1 to 4 of 4

Thread: QGraphicsView - How to add item that is composed of more shapes

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Apr 2012
    Posts
    21
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Windows

    Default QGraphicsView - How to add item that is composed of more shapes

    I have to add one component to QGraphicsView which is composed of more different shapes/items. Each component's view is defined by ordered list of different shapes:
    1. Rectangle (0,0,100,100) -gray
    2. Rectangle (5,5, 70,70) - yellow
    3. Text (15,15) - black
    comp_ex.png

    How can i compose item like that and add it to QGraphicsView?

    I already tried with QGraphicsPathItem but it doesn't allows composition like this and more colors and so on..

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QGraphicsView - How to add item that is composed of more shapes

    QGraphicsItemGroup

    Cheers,
    _

Similar Threads

  1. Replies: 4
    Last Post: 22nd August 2013, 16:09
  2. Replies: 2
    Last Post: 25th June 2012, 10:54
  3. GUI entirely composed of qgraphicsproxywidgets
    By sabonis in forum Qt Programming
    Replies: 2
    Last Post: 3rd April 2012, 11:12
  4. How to fix an Item on QgraphicsView hole.
    By Zikoel in forum Qt Programming
    Replies: 1
    Last Post: 18th September 2011, 19:49
  5. QGraphicsView and item focus
    By Micawber in forum Qt Programming
    Replies: 3
    Last Post: 22nd June 2007, 20:36

Tags for this Thread

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.