Results 1 to 3 of 3

Thread: QGraphicsWidget - How does it work?

  1. #1
    Join Date
    Oct 2008
    Posts
    306
    Thanks
    6
    Thanked 9 Times in 8 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Question QGraphicsWidget - How does it work?

    I've been reading the Docs and searching for examples on QGraphicsWidget. I've been doing my project with QGraphicsItem, but now I found out only QGraphicsWidget has a layout. Now I want to use all the QGraphicsWidget functionality.
    But I really cant understand how it works. Do I add a QGraphicsItem to it, or can I directly add a QPixmap?
    It says
    Qt Code:
    1. QGraphicsWidget::QGraphicsWidget ( QGraphicsItem * parent = 0, Qt::WindowFlags wFlags = 0 )
    2. "The optional parent argument is passed to QGraphicsItem's constructor."
    To copy to clipboard, switch view to plain text mode 
    What does that mean? That to each QGraphicsItem I have I need to create a new QGraphicsWidget for it?
    Thats it. If anyone can help me "see the light", I am most grateful.

  2. #2
    Join Date
    Dec 2007
    Posts
    628
    Thanks
    3
    Thanked 89 Times in 87 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QGraphicsWidget - How does it work?

    Quote Originally Posted by been_1990 View Post
    I've been reading the Docs and searching for examples on QGraphicsWidget. I've been doing my project with QGraphicsItem, but now I found out only QGraphicsWidget has a layout. Now I want to use all the QGraphicsWidget functionality.
    But I really cant understand how it works.
    This approach is useful for widgets that only serve the purpose of organizing child widgets into a layout. QGraphicsWidget can be used as a base item for your own custom item if you require advanced input focus handling, e.g., tab focus and activation, or layouts.


    Do I add a QGraphicsItem to it, or can I directly add a QPixmap?

  3. #3
    Join Date
    Oct 2008
    Posts
    306
    Thanks
    6
    Thanked 9 Times in 8 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: QGraphicsWidget - How does it work?

    Okay, so maybe I got the wrong idea about QGraphicsWidget.
    This approach is useful for widgets that only serve the purpose of organizing child widgets into a layout.
    So QGraphicsWidget is a "container" for Widgets inside QGraphicsView?
    Can I organize QGraphicsItem with QGraphicsWidget?

Similar Threads

  1. QwebPage within a QGraphicsWidget
    By Osprey in forum Qt Programming
    Replies: 0
    Last Post: 16th June 2009, 17:32
  2. getting MySQL to work with Qt
    By Ashish in forum Installation and Deployment
    Replies: 7
    Last Post: 19th May 2009, 08:57
  3. Qt4 : QPainter::setRedirected doesn't work
    By Ankitha Varsha in forum Qt Programming
    Replies: 2
    Last Post: 20th June 2008, 17:52
  4. QActions don't work with menubar hidden
    By Pepe in forum Qt Programming
    Replies: 1
    Last Post: 16th August 2007, 01:04
  5. Change work area OS
    By pakulo in forum Qt Programming
    Replies: 15
    Last Post: 15th May 2007, 07:20

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.