PDA

View Full Version : Qt::Key_Enter not working?



adutzu89
8th February 2014, 09:07
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:

selectRow=new QShortcut(QKeySequence(Qt::Key_Return),table);
selectRow2=new QShortcut(QKeySequence(Qt::Key_Enter),table);
This is how I connect them:

connect(selectRow,SIGNAL(activated()),this,SLOT(em itSelect()));
connect(selectRow2,SIGNAL(activated()),this,SLOT(e mitSelect()));
The slot:

void WidgetClass::emitSelect(){
QModelIndex qmi=table->currentIndex();
if(qmi.isValid())
emit selectedRowIdx(qmi);

}

adutzu89
17th April 2014, 11:40
This is a bug appearently......it's working on Windows but not in Ubuntu.