|
utilities.qApp().clipboard().setText(self._value) |
If desired, it might be useful to support iterables in value.
Paths could be joined with os.pathsep
https://docs.python.org/3/library/os.html#os.pathsep
Text could be joined with newlines.
dicts could be encoded with json or cast as str() (its a stretch but sometimes useful).
I've found this pattern useful in such a generic function, although it does make some assumptions.
qute/qute/extensions/buttons.py
Line 41 in 3c5e1c3
If desired, it might be useful to support iterables in value.
Paths could be joined with os.pathsep
https://docs.python.org/3/library/os.html#os.pathsep
Text could be joined with newlines.
dicts could be encoded with json or cast as str() (its a stretch but sometimes useful).
I've found this pattern useful in such a generic function, although it does make some assumptions.