Ok guys, I managed to figure out how this could be done.
Implemented the keyPressEvent and handled as below
if (pKeyEvent->key() == Qt::Key_C && pKeyEvent->modifiers() & Qt::ControlModifier)
{
listCopiedItems = this->selectedItems();
}
if (pKeyEvent->key() == Qt::Key_V && pKeyEvent->modifiers() & Qt::ControlModifier)
{
for(int i=0; i< listCopiedItems.count(); i++)
{
//the same implementation I did to construct the original item during creation after taking the co-ordinates from the original and did a setPos of the item to paste it with a small offset from the original item
}
}
if (pKeyEvent->key() == Qt::Key_C && pKeyEvent->modifiers() & Qt::ControlModifier)
{
listCopiedItems = this->selectedItems();
}
if (pKeyEvent->key() == Qt::Key_V && pKeyEvent->modifiers() & Qt::ControlModifier)
{
for(int i=0; i< listCopiedItems.count(); i++)
{
//the same implementation I did to construct the original item during creation after taking the co-ordinates from the original and did a setPos of the item to paste it with a small offset from the original item
}
}
To copy to clipboard, switch view to plain text mode
Thanks everyone who tried to think about this.
cheers!
Bookmarks