void ScreenshotGrabber::acceptRegion() { QRect rect = this->chooserRect->chosenRect(); if (rect.width() < 1 || rect.height() < 1) return; // qDebug() << "Screenshot accepted, chosen region" << rect; emit screenshotTaken(this->screenGrab.copy(rect)); this->window->close(); }
void ScreenshotGrabber::acceptRegion() { QRect rect = this->chooserRect->chosenRect(); if (rect.width() < 1 || rect.height() < 1) return; // qDebug() << "Screenshot accepted, chosen region" << rect; emit screenshotTaken(this->screenGrab.copy(rect)); this->window->close(); Widget::getInstance()->setVisible(true); // show window if it was hidden }
void ScreenshotGrabber::acceptRegion() { QRect rect = this->chooserRect->chosenRect(); if (rect.width() < 1 || rect.height() < 1) return; // Scale the accepted region from DIPs to actual pixels rect.setRect(rect.x() * pixRatio, rect.y() * pixRatio, rect.width() * pixRatio, rect.height() * pixRatio); emit regionChosen(rect); qDebug() << "Screenshot accepted, chosen region" << rect; QPixmap pixmap = this->screenGrab.copy(rect); restoreHiddenWindows(); emit screenshotTaken(pixmap); deleteLater(); }