KShare/screenshotutil.cpp
ArsenArsen 37ce6f1eda Add clang-format; Make text and blur less annoying
I didn't read the clang-format documentation properly
2017-05-09 17:26:00 +02:00

23 lines
499 B
C++

#include "screenshotutil.hpp"
#include <QApplication>
#include <QClipboard>
#include <QPixmap>
#include <QScreen>
QPixmap *screenshotutil::fullscreen() {
return window(0);
}
QPixmap *screenshotutil::window(long wid) {
QScreen *w = QApplication::primaryScreen();
QPixmap screen = w->grabWindow(wid);
QPixmap *pm = new QPixmap(screen.size());
screen.swap(*pm);
return pm;
}
void screenshotutil::toClipboard(QString value) {
QApplication::clipboard()->setText(value);
}