Add C++ clipboard image provider

Will be used to show a preview before uploading image from clipboard.
Transforming the clipboard image to PNG (or any other real format) is
slow and freezes the GUI, with the provider we can display it directly.
This commit is contained in:
miruka
2020-07-16 13:54:17 -04:00
parent cc8d552adc
commit 74c4d63c16
4 changed files with 61 additions and 11 deletions

View File

@@ -82,6 +82,7 @@ public:
}
signals:
void contentChanged();
void textChanged();
void imageChanged();
void hasImageChanged();
@@ -91,6 +92,7 @@ private:
QClipboard *clipboard = QGuiApplication::clipboard();
void mainClipboardChanged() {
contentChanged();
this->hasImage() ? this->imageChanged() : this->textChanged();
this->hasImageChanged();
};