Results 1 to 2 of 2

Thread: Qt::Key_Enter not working?

  1. #1
    Join Date
    Oct 2013
    Posts
    142
    Thanks
    36
    Thanked 3 Times in 3 Posts
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows Android

    Default Qt::Key_Enter not working?

    I am trying to add shortcut that triggers the Enter key, but will not trigger.
    I do not mean the Return key.
    Example: I want to add shortcuts to table row when Return or Enter key is triggered and while the Return key does it's job well, the Enter key does nothing.
    I've searched over the internet but all I can find was people that mistakenly used Enter key instead Return.
    This is how I set them:
    Qt Code:
    1. selectRow=new QShortcut(QKeySequence(Qt::Key_Return),table);
    2. selectRow2=new QShortcut(QKeySequence(Qt::Key_Enter),table);
    To copy to clipboard, switch view to plain text mode 
    This is how I connect them:
    Qt Code:
    1. connect(selectRow,SIGNAL(activated()),this,SLOT(emitSelect()));
    2. connect(selectRow2,SIGNAL(activated()),this,SLOT(emitSelect()));
    To copy to clipboard, switch view to plain text mode 
    The slot:
    Qt Code:
    1. void WidgetClass::emitSelect(){
    2. QModelIndex qmi=table->currentIndex();
    3. if(qmi.isValid())
    4. emit selectedRowIdx(qmi);
    5.  
    6. }
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Oct 2013
    Posts
    142
    Thanks
    36
    Thanked 3 Times in 3 Posts
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows Android

    Default Re: Qt::Key_Enter not working?

    This is a bug appearently......it's working on Windows but not in Ubuntu.

Similar Threads

  1. Replies: 7
    Last Post: 24th September 2012, 07:17
  2. Working with map
    By naptizaN in forum Newbie
    Replies: 4
    Last Post: 28th August 2012, 12:57
  3. MVC example not working
    By yyiu002 in forum Newbie
    Replies: 1
    Last Post: 30th June 2010, 00:07
  4. Keypressevent - CTRL Key_Enter
    By qtuser20 in forum Qt Programming
    Replies: 2
    Last Post: 3rd March 2010, 20:47
  5. Mac OS X UI not working
    By hvengel in forum Qt Programming
    Replies: 3
    Last Post: 1st April 2006, 01:02

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.