Results 1 to 10 of 10

Thread: implementing drawForeGround

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Apr 2007
    Posts
    9
    Thanks
    3

    Question implementing drawForeGround

    Hi,
    I'm quite new to Qt. I have a problem with drawing on a QGraphicsView. I have added a working example in the zip file:

    I create a MainWindow app in Designer, and add a GraphicsView to it. In the code from MainWindow.cpp I create a QGraphicsscene, draw 256 little green rectangles on it (the rectangles are an instance from my own made class Graphics, which implements QGraphicItem), and let the GraphicsViewer select the scene. And this all works fine.

    But now I want to change the color of a rectangle when clicked on it. I know that I have to use te mousepressedEvent (propably in the Graphics class), and that I maybe should use the drawForeGround methode. But I don't really get how that works Anyone who can help me, and help me on the right way?

    Thanx in advance,
    Wirloff
    Attached Files Attached Files

Similar Threads

  1. Implementing scale-invariant QGraphicsItems
    By spud in forum Qt Programming
    Replies: 12
    Last Post: 13th January 2012, 05:18
  2. Implementing MenuBar AutoHide function
    By viking in forum Qt Programming
    Replies: 31
    Last Post: 1st April 2011, 20:17
  3. Implementing IME using QT
    By pmohod in forum Qt Programming
    Replies: 0
    Last Post: 16th February 2007, 12:22
  4. Implementing Resize funtionality
    By PiXeL16 in forum Qt Programming
    Replies: 2
    Last Post: 14th February 2007, 23:12
  5. Making 3D controls in QT, implementing a game loop in QT
    By smurrish in forum Qt Programming
    Replies: 10
    Last Post: 26th April 2006, 04:37

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
  •  
Qt is a trademark of The Qt Company.