Adds QClipboard docs
This commit is contained in:
parent
0ff2c8d2a9
commit
97f4fdca28
@ -53,6 +53,8 @@
|
|||||||
- [FlexLayout](api/FlexLayout.md)
|
- [FlexLayout](api/FlexLayout.md)
|
||||||
- [QPixmap](api/QPixmap.md)
|
- [QPixmap](api/QPixmap.md)
|
||||||
- [QIcon](api/QIcon.md)
|
- [QIcon](api/QIcon.md)
|
||||||
|
- [QCursor](api/QCursor.md)
|
||||||
|
- [QClipboard](api/QClipboard.md)
|
||||||
- [Qt Enums](api/QtEnums.md)
|
- [Qt Enums](api/QtEnums.md)
|
||||||
|
|
||||||
### Internal Modules
|
### Internal Modules
|
||||||
|
|||||||
@ -21,10 +21,14 @@ qApp.quit();
|
|||||||
|
|
||||||
QApplication can access all the static methods defined in [Component](api/Component.md). Additionally it also has the following static methods.
|
QApplication can access all the static methods defined in [Component](api/Component.md). Additionally it also has the following static methods.
|
||||||
|
|
||||||
#### `qApp.instance()`
|
#### `QApplication.instance()`
|
||||||
|
|
||||||
Returns the already initialised QApplication instance. It calls the native method [QApplication: instance](https://doc.qt.io/qt-5/qcoreapplication.html#instance).
|
Returns the already initialised QApplication instance. It calls the native method [QApplication: instance](https://doc.qt.io/qt-5/qcoreapplication.html#instance).
|
||||||
|
|
||||||
|
#### `QApplication.clipboard()`
|
||||||
|
|
||||||
|
Returns the object for interacting with the clipboard. It calls the native method [QApplication: clipboard](https://doc.qt.io/qt-5/qguiapplication.html#clipboard). See QClipboard.
|
||||||
|
|
||||||
### Instance Properties
|
### Instance Properties
|
||||||
|
|
||||||
QApplication can access all the instance properties defined in [Component](api/Component.md)
|
QApplication can access all the instance properties defined in [Component](api/Component.md)
|
||||||
|
|||||||
52
docs/api/QClipboard.md
Normal file
52
docs/api/QClipboard.md
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
## Class: QClipboard
|
||||||
|
|
||||||
|
> The QClipboard class provides access to the window system clipboard.
|
||||||
|
|
||||||
|
**This class is a JS wrapper around Qt's [QClipboard class](https://doc.qt.io/qt-5/QClipboard.html)**
|
||||||
|
|
||||||
|
**QClipboard inherits from [Component](api/Component.md)**
|
||||||
|
|
||||||
|
### Example
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
const {
|
||||||
|
QClipboard,
|
||||||
|
QClipboardMode,
|
||||||
|
QApplication
|
||||||
|
} = require("@nodegui/nodegui");
|
||||||
|
|
||||||
|
const clipboard = QApplication.clipboard();
|
||||||
|
const text = clipboard.text(QClipboardMode.Clipboard);
|
||||||
|
```
|
||||||
|
|
||||||
|
### Static Methods
|
||||||
|
|
||||||
|
QClipboard can access all the static methods defined in [Component](api/Component.md)
|
||||||
|
|
||||||
|
### Instance Properties
|
||||||
|
|
||||||
|
QClipboard can access all the instance properties defined in [Component](api/Component.md)
|
||||||
|
|
||||||
|
### Instance Methods
|
||||||
|
|
||||||
|
QClipboard can access all the instance methods defined in [Component](api/Component.md). Additionally it has:
|
||||||
|
|
||||||
|
### `clipboard.clear(mode)`
|
||||||
|
|
||||||
|
Clear the clipboard contents. It calls the native method [QClipboard: clear](https://doc.qt.io/qt-5/qclipboard.html#clear).
|
||||||
|
|
||||||
|
- `mode` - This enum type is used to control which part of the system clipboard is used. See https://doc.qt.io/qt-5/qclipboard.html#Mode-enum
|
||||||
|
|
||||||
|
### `clipboard.setText(text, mode)`
|
||||||
|
|
||||||
|
Copies text into the clipboard as plain text. It calls the native method [QClipboard: setText](https://doc.qt.io/qt-5/qclipboard.html#setText).
|
||||||
|
|
||||||
|
- `text` - The text you want to copy to clipboard.
|
||||||
|
|
||||||
|
- `mode` - This enum type is used to control which part of the system clipboard is used. See https://doc.qt.io/qt-5/qclipboard.html#Mode-enum
|
||||||
|
|
||||||
|
### `clipboard.text(mode)`
|
||||||
|
|
||||||
|
Returns the clipboard text as plain text, or an empty string if the clipboard does not contain any text. It calls the native method [QClipboard: text](https://doc.qt.io/qt-5/qclipboard.html#text).
|
||||||
|
|
||||||
|
- `mode` - This enum type is used to control which part of the system clipboard is used. See https://doc.qt.io/qt-5/qclipboard.html#Mode-enum
|
||||||
@ -19,6 +19,9 @@ export class QClipboard extends Component {
|
|||||||
setText = (text: string, mode: QClipboardMode) => {
|
setText = (text: string, mode: QClipboardMode) => {
|
||||||
this.native.setText(text, mode);
|
this.native.setText(text, mode);
|
||||||
};
|
};
|
||||||
|
text = (mode: QClipboardMode) => {
|
||||||
|
return this.native.text(mode);
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum QClipboardMode {
|
export enum QClipboardMode {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user