ddonate
21st September 2017, 17:04
Hi,
I have a QML TextArea, and I need to know the text pasted using the 'paste' option in the contexte menu (mouse right button).
I can check the paste using keys with:
Keys.onPressed: function(keyEvent) {
.....
if (keyEvent.matches(StandardKey.Paste)){
....
and there I can use QT code:
QClipboard* pClipboard = qApp->clipboard();
if (pClipboard)
{
QClipboard::Mode eMode = QClipboard::Clipboard;
const QMimeData* pMimeData = pClipboard->mimeData( eMode );
....
to get the text in clipboard, before being pasted.
How can I do the same using whe mouse 'paste' option?
Thanks,
Diego
I have a QML TextArea, and I need to know the text pasted using the 'paste' option in the contexte menu (mouse right button).
I can check the paste using keys with:
Keys.onPressed: function(keyEvent) {
.....
if (keyEvent.matches(StandardKey.Paste)){
....
and there I can use QT code:
QClipboard* pClipboard = qApp->clipboard();
if (pClipboard)
{
QClipboard::Mode eMode = QClipboard::Clipboard;
const QMimeData* pMimeData = pClipboard->mimeData( eMode );
....
to get the text in clipboard, before being pasted.
How can I do the same using whe mouse 'paste' option?
Thanks,
Diego