Results 1 to 2 of 2

Thread: GraphicsItems and layouts

  1. #1
    Join Date
    Mar 2008
    Posts
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default GraphicsItems and layouts

    Hello everyone! I'm currently programming a tool to design CD covers. The user can drag all kinds of items onto a QGraphicsScene like images, text, drawings, etc... Images for example are subclassed from QGraphicsPixmapItem, so I can get the most basic functionality very easily. The user can perform very basic operations like moving, resizing and rotating with the items.

    So far so good. Now, I'd like the possibility to add items to layouts (horizontal/vertical) similar to the layouts of Qt. I thought I could inherit from QGraphicsLayoutItem and reimplement the important functions. Then I could use the items in a QGraphicsLayout. But I've read all over the net that there are problems with this approach and that it can sometimes crash!

    Is this true? If it is, what would be the best way to accomplish this?

    Thanks in advance,
    Jeroen

  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: GraphicsItems and layouts

    I think the layout item is only for graphics view widgets. If you want to position regular items, use an item group.

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.