Commit 0f36dfe5 authored by Peter Zhigalov's avatar Peter Zhigalov

[svg-dev] Починил совместимость с Qt 4.4

parent e99b2175
......@@ -16,6 +16,10 @@ greaterThan(QT_MAJOR_VERSION, 4) {
DEFINES += HAVE_QT5
}
lessThan(QT_VERSION, 4.5.0) {
DEFINES += HAVE_LESS_THAN_QT45
}
SOURCES += \
src_qt/paintwidget.cpp \
src_qt/main.cpp \
......
......@@ -238,9 +238,11 @@ void MainWindow::on_actionSave_Image_File_triggered()
QSvgGenerator generator;
generator.setFileName(fileName);
generator.setSize(QSize(ui->widget->width(), ui->widget->height()));
#if !defined HAVE_LESS_THAN_QT45
generator.setViewBox(QRect(0, 0, ui->widget->width(), ui->widget->height()));
generator.setTitle(ui->widget->title);
generator.setDescription(trUtf8("An SVG drawing created by FEM Draw."));
#endif
ui->widget->draw(& generator, ui->actionTransparent_Image->isChecked());
saved = true;
}
......
......@@ -998,6 +998,11 @@ void paintwidget::draw(QPaintDevice * device, bool transparency)
fnt_serif.setPixelSize(fnt_serif_h < fnt_serif_w ? fnt_serif_h : fnt_serif_w);
fnt_serif.setBold(true);
#if defined HAVE_LESS_THAN_QT45
fnt_mono.setPointSizeF(qreal(fnt_mono.pixelSize()) * qreal(0.75));
fnt_serif.setPointSizeF(qreal(fnt_serif.pixelSize()) * qreal(0.75));
#endif
// Подписи осей
painter.setFont(fnt_serif);
painter.setPen(QPen(Qt::black, 1.0f));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment