mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-06-02 19:02:29 +02:00
[ui] Introduce ClipboardHelper for copying to clipboard from QML
* add ClipboardHelper class that contains a QClipboard and exposes its method as Slots * use Clipboard instead of hidden TextEdit where meaningful
This commit is contained in:
parent
9ce077778b
commit
438622a14b
6 changed files with 35 additions and 3 deletions
20
meshroom/ui/components/clipboard.py
Normal file
20
meshroom/ui/components/clipboard.py
Normal file
|
@ -0,0 +1,20 @@
|
|||
from PySide2.QtCore import Slot, QObject
|
||||
from PySide2.QtGui import QClipboard
|
||||
|
||||
|
||||
class ClipboardHelper(QObject):
|
||||
"""
|
||||
Simple wrapper around a QClipboard with methods exposed as Slots for QML use.
|
||||
"""
|
||||
|
||||
def __init__(self, parent=None):
|
||||
super(ClipboardHelper, self).__init__(parent)
|
||||
self._clipboard = QClipboard(parent=self)
|
||||
|
||||
@Slot(str)
|
||||
def setText(self, value):
|
||||
self._clipboard.setText(value)
|
||||
|
||||
@Slot()
|
||||
def clear(self):
|
||||
self._clipboard.clear()
|
Loading…
Add table
Add a link
Reference in a new issue