Make clipboard image scalable (SVG)

This commit is contained in:
Robin Stuart 2017-04-22 12:44:32 +01:00
parent 536f217e78
commit fa40676691
2 changed files with 10 additions and 2 deletions

View File

@ -103,7 +103,7 @@
<string notr="true"/> <string notr="true"/>
</property> </property>
<property name="currentIndex"> <property name="currentIndex">
<number>0</number> <number>1</number>
</property> </property>
<widget class="QWidget" name="tabGeneral"> <widget class="QWidget" name="tabGeneral">
<attribute name="title"> <attribute name="title">
@ -627,6 +627,9 @@ p, li { white-space: pre-wrap; }
<height>0</height> <height>0</height>
</size> </size>
</property> </property>
<property name="toolTip">
<string>Copy to clipboard</string>
</property>
<property name="text"> <property name="text">
<string>&amp;Copy</string> <string>&amp;Copy</string>
</property> </property>

View File

@ -274,7 +274,10 @@ void MainWindow::copy_to_clipboard()
{ {
QClipboard *clipboard = QGuiApplication::clipboard(); QClipboard *clipboard = QGuiApplication::clipboard();
QMimeData *data = new QMimeData; 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)) { if (!m_bc.bc.save_to_file(filename)) {
return; return;
@ -284,6 +287,8 @@ void MainWindow::copy_to_clipboard()
clipboard->setMimeData(data, QClipboard::Clipboard); clipboard->setMimeData(data, QClipboard::Clipboard);
QFile::remove(filename); QFile::remove(filename);
spnScale->setValue(scale);
} }
void MainWindow::change_options() void MainWindow::change_options()