Results 1 to 2 of 2

Thread: The best way to having 'cad layers' at Graphics scene-view ?

  1. #1
    Join Date
    Sep 2010
    Posts
    654
    Thanks
    56
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default The best way to having 'cad layers' at Graphics scene-view ?

    As Up I know I cant have some sceneviews to paint at the same GraphicsView.
    To 'emulate' the 'cad layers' concept, what can be best ?
    - Can I try to have some Graphicsview, ones above other ? (using transparent backgrounds)
    - Have I to think on Pixmap & render strategy ? (draw data to pixmaps and send them to the view ?
    Any idea will be useful . Thanks

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: The best way to having 'cad layers' at Graphics scene-view ?

    Make each layer a QGraphicsItem, and set its zValue to be the layer number (so the zValue for layer 0 is 0.0, which means it is at the bottom of the display stack, zValue for layer 1 is 1.0, etc.). Then, for each layer, add child QGraphicsItems to the QGraphicsItem for that layer. QGraphicsItems are drawn with lowest zValue first, so if a QGraphicsItem with higher zValue overlaps a lower one, it will hide it if it is not transparent.

    To display only a single layer, setVisible = false for all other layers. To make an upper layer "hide" layers below it, setOpacity = 1.0. To make all layers show from the bottom up, setOpacity = 0.0 for all layers.

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

    tonnot (28th November 2011)

Similar Threads

  1. Replies: 6
    Last Post: 8th June 2009, 21:44
  2. graphics scene
    By dognzhe in forum Qt Programming
    Replies: 3
    Last Post: 3rd June 2009, 08:55
  3. Graphics View - Scene & Item hierarchy
    By mooreaa in forum Qt Programming
    Replies: 0
    Last Post: 29th June 2008, 23:49
  4. real world coordinates in graphics view / scene
    By robertson1 in forum Qt Programming
    Replies: 2
    Last Post: 7th December 2007, 23:21
  5. Buttons in Graphics Scene
    By aamer4yu in forum Qt Programming
    Replies: 3
    Last Post: 28th November 2007, 19:24

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.