12#include <QApplication>
45 :
KisCustomImageWidget(parent, defWidth, defHeight, resolution, defColorModel, defColorDepth, defColorProfile, imageName)
47 setObjectName(
"KisImageFromClipboard");
54 disconnect(newDialogConfirmationButtonBox, &QDialogButtonBox::accepted,
nullptr,
65 newDialogConfirmationButtonBox->button(QDialogButtonBox::Ok)->setEnabled(
false);
106 newDialogConfirmationButtonBox->button(QDialogButtonBox::Ok)->setEnabled(
true);
130 KisCursorOverrideLock cursorLock(Qt::BusyCursor);
132 QImage qimage = QApplication::clipboard()->image();
138 if (qimage.isNull()) {
139 doubleWidth->setValue(0);
140 doubleHeight->setValue(0);
141 newDialogConfirmationButtonBox->button(QDialogButtonBox::Ok)->setEnabled(
false);
143 tabWidget->setEnabled(
false);
145 lblDocumentInfo->setText(i18n(
"The clipboard is empty or does not have an image in it."));
147 QSize previewSize = QSize(75, 75) * devicePixelRatioF();
148 QPixmap preview = QPixmap::fromImage(qimage.scaled(previewSize, Qt::KeepAspectRatio));
149 preview.setDevicePixelRatio(devicePixelRatioF());
150 lblPreview->setPixmap(preview);
152 newDialogConfirmationButtonBox->button(QDialogButtonBox::Ok)->setEnabled(
true);
154 doubleWidth->setValue(qimage.width());
155 doubleHeight->setValue(qimage.height());
157 tabWidget->setEnabled(
true);
const quint8 OPACITY_OPAQUE_U8
connect(this, SIGNAL(optionsChanged()), this, SLOT(saveOptions()))
static KisClipboard * instance()
void setModified(bool _mod)
QString nextLayerName(const QString &baseName="") const
static void adaptClipToImageColorSpace(KisPaintDeviceSP dev, KisImageSP image)
void documentSelected(KisDocument *)
this signal is emitted (as defined by KisDocument) the moment the document is 'ready'
QRect exactBounds() const
static void copyAreaOptimized(const QPoint &dstPt, KisPaintDeviceSP src, KisPaintDeviceSP dst, const QRect &originalSrcRect)
#define KIS_SAFE_ASSERT_RECOVER_RETURN(cond)
void setOpacity(quint8 val)
bool addNode(KisNodeSP node, KisNodeSP parent=KisNodeSP(), KisNodeAdditionFlags flags=KisNodeAdditionFlag::None)
KisNodeSP firstChild() const
KisNodeSP nextSibling() const
KisPaintDeviceSP paintDevice