Results 1 to 3 of 3

Thread: Changing QFrame to QGraphicsView in Draggable icons example

  1. #1
    Join Date
    Sep 2009
    Posts
    60
    Thanks
    6
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Changing QFrame to QGraphicsView in Draggable icons example

    In the Draggable Icons example, the DragWidget class inherits the QFrame class. I changed the code so that the DragWidget class now inherits the QGraphicsView class. Now the program does not work. The background color is not set to gray. I cannot drag the icons around anymore either.

    The QGraphicsView class inherits QAbstractScrollArea which inherits QFrame. So what has changed that doesn't allow the icons to be dragged?

  2. #2
    Join Date
    Sep 2009
    Posts
    60
    Thanks
    6
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Changing QFrame to QGraphicsView in Draggable icons example

    Anyone know?
    Thanks.

  3. #3
    Join Date
    Jan 2008
    Location
    Poland
    Posts
    687
    Thanks
    4
    Thanked 140 Times in 132 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Changing QFrame to QGraphicsView in Draggable icons example

    hmm did you read documentation about QGraphicsView? It is a bit more complicated than QFrame. Are you changing icons into QGraphicsPixmapItems? Did you setup the scene t your needs? I assume that the background is now white and I think it is the color it should be now so nothing weird...
    I would like to be a "Guru"

    Useful hints (try them before asking):
    1. Use Qt Assistant
    2. Search the forum

    If you haven't found solution yet then create new topic with smart question.

Similar Threads

  1. Replies: 1
    Last Post: 16th September 2009, 11:23
  2. Replies: 1
    Last Post: 2nd March 2009, 19:32
  3. Replies: 1
    Last Post: 8th February 2009, 11:37
  4. Is it possible to change the cursor on a QGraphicsView?
    By draftpunk in forum Qt Programming
    Replies: 2
    Last Post: 25th October 2008, 18:43
  5. Dynamically changing QFrame color
    By Doug Broadwell in forum Newbie
    Replies: 6
    Last Post: 16th October 2008, 08:22

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.