How to check if there is something in the clipboard
-
How do i check if there is something in the clipboard? i mean if there is something to paste...
-
QClipboard has the mimeData() method. It can tell you what is on the clipboard.
-
The documentation has an example of this.
"Documentation":http://qt-project.org/doc/qt-5/qclipboard.html
-
i dont want to know what is on the clipboard but if there is something there...
-
[quote author="brlebtag" date="1391639035"]i dont want to know what is on the clipboard but if there is something there...[/quote]
The hint I gave you before will tell you that too... Note at quite often, the answer will be "yes, there is". Whether it is something you can paste is another matter.
-
do i have to do mimeData().text().isEmpty() to check if clipboard is empty ?
-
I'd just take the count of formats... Or, you just take the data, and check its size. Or, you use the hasText(), hasHtml, etc. functions to see if the formats you support are on the clipboard.
-
I got it now.. Thx a lot!...