Results 1 to 14 of 14

Thread: i need to use Alt+Ctrl+arrow keys combination

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jun 2013
    Location
    Bangalore
    Posts
    27
    Thanks
    7
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default i need to use Alt+Ctrl+arrow keys combination

    i need to use Alt+Ctrl+arrow keys on custamised QGraphicsItem, i have tried below one, not working can any one suggest me better one

    Qt Code:
    1. void CBoxViewItem::keyPressEvent(QKeyEvent* f_event) //CBoxViewItem derived from Qgraphicsitem
    2. {
    3. if(Qt::ControlModifier & Qt::AltModifier & f_event->modifiers()) // i tried this also if( (Qt::ControlModifier && Qt::AltModifier) == f_event->modifiers())
    4. {
    5. qDebug()<<"ctrl+Alt";
    6.  
    7. switch(f_event->key())
    8. {
    9. case Qt::Key_Up:
    10.  
    11. break;
    12. case Qt::Key_Down:
    13.  
    14. break;
    15. case Qt::Key_Left:
    16.  
    17. break;
    18. case Qt::Key_Right:
    19.  
    20. break;
    21. }
    22. }
    To copy to clipboard, switch view to plain text mode 
    Last edited by high_flyer; 4th September 2013 at 10:07. Reason: code tags

Similar Threads

  1. Detect Arrow Keys
    By Ebonair in forum Qt Programming
    Replies: 4
    Last Post: 1st October 2010, 03:55
  2. Replies: 2
    Last Post: 4th August 2010, 20:10
  3. Replies: 5
    Last Post: 10th March 2010, 15:50
  4. Replies: 1
    Last Post: 6th July 2009, 13:48
  5. How can I associate arrow keys?
    By Mariane in forum Newbie
    Replies: 2
    Last Post: 20th January 2006, 18:31

Tags for this Thread

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.