A possible solution would be to refactor your widget into two separate components -- one would be the original QTextEdit and the other would be all your modifications encapsulated into a separate class with signals, slots and properties. Then you can reuse this component with Qt Quick's text edit item by providing a QML bridge between this C++ component and the item itself.
e.g.
// MyTextEdit.qml
import QtQuick 2.0
import TextEditEngine 1.0
TextEdit {
TextEditEngine { id: engine; }
onSelectedTextChanged: engine.createMimeDataFromSelection(selectedText)
}
// MyTextEdit.qml
import QtQuick 2.0
import TextEditEngine 1.0
TextEdit {
TextEditEngine { id: engine; }
onSelectedTextChanged: engine.createMimeDataFromSelection(selectedText)
}
To copy to clipboard, switch view to plain text mode
Bookmarks