Results 1 to 2 of 2

Thread: QGraphicsItem focusInEvent mousePressEvent

  1. #1
    Join Date
    Dec 2009
    Posts
    50
    Thanks
    9
    Qt products
    Qt4
    Platforms
    Windows

    Default QGraphicsItem focusInEvent mousePressEvent

    Hi everybody!

    I have class CLVideoWindow inherited from QGraphicsItem.
    I want to handle focusInEvent event and mousePressEvent.
    I've reimplemented

    Qt Code:
    1. void CLVideoWindow::focusInEvent( QFocusEvent * event )
    2. {
    3. QGraphicsItem::focusInEvent(event);
    4.  
    5. }
    6.  
    7.  
    8. void CLVideoWindow::mousePressEvent ( QGraphicsSceneMouseEvent * event )
    9. {
    10. QGraphicsItem::mousePressEvent(event);
    11. }
    To copy to clipboard, switch view to plain text mode 


    But this functions never gets called.

    What am I missing ?

    In CLVideoWindow constructor I do:

    Qt Code:
    1. setAcceptHoverEvents(true);
    2. setFlag(QGraphicsItem::ItemIsFocusable);
    3. setAcceptedMouseButtons(Qt::MouseButton::LeftButton);
    4. setAcceptedMouseButtons(Qt::MouseButton::RightButton);
    To copy to clipboard, switch view to plain text mode 


    Thank you!

  2. #2
    Join Date
    Dec 2009
    Posts
    50
    Thanks
    9
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QGraphicsItem focusInEvent mousePressEvent

    The problem is solved by complete rebuild :-)
    Thank you.

Similar Threads

  1. Replies: 2
    Last Post: 25th March 2011, 09:18
  2. destruction of QGraphicsItem
    By killkolor in forum Qt Programming
    Replies: 2
    Last Post: 5th December 2009, 10:31
  3. QGraphicsItem inheritence
    By bajarangi in forum Newbie
    Replies: 4
    Last Post: 12th August 2009, 00:45
  4. Replies: 1
    Last Post: 25th February 2009, 00:34
  5. Replies: 6
    Last Post: 30th April 2007, 23:59

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.