Code:
// centre mouse uses an existing paste() function
{
if (event->button()==Qt::MidButton && clipboard->supportsSelection())
{
paste(); // calls paste function for spreadsheet (this function works fine just not with centre mouse)
}
}
// cell down functions
void Spreadsheet::moveDown()
{
int row=currentRow();
row += 1;
int column=currentColumn();
if (row>=RowCount) // check bounds are possible
{
row=0;
}
setCurrentCell(row, column);
}
bool Spreadsheet
::returnKey(QKeyEvent* event
) {
if (event
->type
()==QEvent::KeyPress) {
QKeyEvent *keyEvent
=static_cast<QKeyEvent
*>
(event
);
if ((keyEvent->key()==Qt::Key_Return) && (table->hasFocus()) ) // hasFocus probably not needed doesn't help
{
moveDown();
return true;
}
}
}