From fa40676691a7f965a388810ca4f1e1055727a368 Mon Sep 17 00:00:00 2001 From: Robin Stuart Date: Sat, 22 Apr 2017 12:44:32 +0100 Subject: [PATCH] Make clipboard image scalable (SVG) --- frontend_qt/mainWindow.ui | 5 ++++- frontend_qt/mainwindow.cpp | 7 ++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/frontend_qt/mainWindow.ui b/frontend_qt/mainWindow.ui index caf9b72a..3566532e 100644 --- a/frontend_qt/mainWindow.ui +++ b/frontend_qt/mainWindow.ui @@ -103,7 +103,7 @@ - 0 + 1 @@ -627,6 +627,9 @@ p, li { white-space: pre-wrap; } 0 + + Copy to clipboard + &Copy diff --git a/frontend_qt/mainwindow.cpp b/frontend_qt/mainwindow.cpp index 1a56713f..0aef858c 100644 --- a/frontend_qt/mainwindow.cpp +++ b/frontend_qt/mainwindow.cpp @@ -274,7 +274,10 @@ void MainWindow::copy_to_clipboard() { QClipboard *clipboard = QGuiApplication::clipboard(); QMimeData *data = new QMimeData; - QString filename = ".zint.gif"; + QString filename = ".zint.svg"; + double scale = spnScale->value(); + + spnScale->setValue(10); if (!m_bc.bc.save_to_file(filename)) { return; @@ -284,6 +287,8 @@ void MainWindow::copy_to_clipboard() clipboard->setMimeData(data, QClipboard::Clipboard); QFile::remove(filename); + + spnScale->setValue(scale); } void MainWindow::change_options()