Results 1 to 2 of 2

Thread: Implementing paint in a child of a parent

  1. #1
    Join Date
    Jun 2007
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Implementing paint in a child of a parent

    I followed along in a couple of tutorials and keep stubbing my toes but making progress..

    I placed a couple of qgraphicview widgets in a grid layout, in a qvboxlayout. I found out quickly that qgraphicsview doesn't have a 'clicked' signal. I see mousePressEvent and I try to override? what's out there in order to check the mouse press event over the graphics item.

    How would I go about using my own mousepressevent function and point to each graphics view?

    Thanks.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Implementing paint in a child of a parent

    Quote Originally Posted by drarem View Post
    I see mousePressEvent and I try to override?
    You should rather override QGraphicsScene::mousePressEvent(), not the one from QGraphicsView.

    Quote Originally Posted by drarem View Post
    what's out there in order to check the mouse press event over the graphics item.
    Take a look at graphicsview/elasticnodes example.

Similar Threads

  1. QProcess : child process listening parent output ?
    By Nyphel in forum Qt Programming
    Replies: 16
    Last Post: 20th March 2007, 14:40
  2. initialize child widgets within parent?
    By ucomesdag in forum Newbie
    Replies: 6
    Last Post: 6th June 2006, 09:11
  3. Move child widget along with the parent widget
    By sreedhar in forum Qt Programming
    Replies: 2
    Last Post: 15th May 2006, 13:00
  4. Infinite loop - resize parent from child
    By bitChanger in forum Qt Programming
    Replies: 3
    Last Post: 5th May 2006, 14:21
  5. Referencing Parent Widget from Child
    By taylor34 in forum Qt Programming
    Replies: 8
    Last Post: 11th April 2006, 16:13

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.