summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Ehrlicher <ch.ehrlicher@gmx.de>2019-05-27 20:22:17 +0200
committerChristian Ehrlicher <ch.ehrlicher@gmx.de>2019-05-27 20:22:17 +0200
commit357a5bd4d6682a50d85c88ba485ed34c745fae85 (patch)
tree5853bfa57606e7ceaaef931b228f0493bec2cfac
parenta21cf52e101ad50c330ad0b42416cc83318afea7 (diff)
downloadqtsvg-357a5bd4d6682a50d85c88ba485ed34c745fae85.tar.gz
QtSvg: remove deprecated functions and enumerations
Replace QPainter::HighQualityAntialiasing with Antialiasing and remove defines needed for Qt4. Change-Id: I866decad7d9c10da15e5b0e0bd79033d574f6a08 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
-rw-r--r--examples/svg/embedded/desktopservices/contenttab.cpp1
-rw-r--r--examples/svg/embedded/weatherinfo/weatherinfo.cpp4
-rw-r--r--examples/svg/network/bearercloud/cloud.cpp2
-rw-r--r--examples/svg/svgviewer/mainwindow.cpp14
-rw-r--r--examples/svg/svgviewer/mainwindow.h2
-rw-r--r--examples/svg/svgviewer/svgview.cpp8
-rw-r--r--examples/svg/svgviewer/svgview.h2
-rw-r--r--src/svg/qsvggenerator.cpp2
8 files changed, 10 insertions, 25 deletions
diff --git a/examples/svg/embedded/desktopservices/contenttab.cpp b/examples/svg/embedded/desktopservices/contenttab.cpp
index 8d467df..2dac351 100644
--- a/examples/svg/embedded/desktopservices/contenttab.cpp
+++ b/examples/svg/embedded/desktopservices/contenttab.cpp
@@ -124,6 +124,7 @@ void ContentTab::keyPressEvent(QKeyEvent *event)
switch (event->key()) {
case Qt::Key_Select:
openItem(currentItem());
+ Q_FALLTHROUGH();
default:
QListWidget::keyPressEvent(event);
break;
diff --git a/examples/svg/embedded/weatherinfo/weatherinfo.cpp b/examples/svg/embedded/weatherinfo/weatherinfo.cpp
index b64d8ca..21aa986 100644
--- a/examples/svg/embedded/weatherinfo/weatherinfo.cpp
+++ b/examples/svg/embedded/weatherinfo/weatherinfo.cpp
@@ -147,17 +147,13 @@ private slots:
void animate(int frame) {
qreal progress = static_cast<qreal>(frame) / 100;
-#if QT_VERSION >= 0x040500
m_iconItem->setOpacity(progress);
-#endif
qreal hw = width() / 2.0;
m_statusItem->setPos(-hw + hw * progress, 0);
for (int i = 0; i < m_forecastItems.count(); ++i) {
qreal ofs = i * 0.5 / m_forecastItems.count();
qreal alpha = qBound(qreal(0), 2 * (progress - ofs), qreal(1));
-#if QT_VERSION >= 0x040500
m_conditionItems[i]->setOpacity(alpha);
-#endif
QPointF pos = m_forecastItems[i]->pos();
if (width() > height()) {
qreal fx = width() - width() * 0.4 * alpha;
diff --git a/examples/svg/network/bearercloud/cloud.cpp b/examples/svg/network/bearercloud/cloud.cpp
index 4e0313a..1117c94 100644
--- a/examples/svg/network/bearercloud/cloud.cpp
+++ b/examples/svg/network/bearercloud/cloud.cpp
@@ -76,9 +76,7 @@ Cloud::Cloud(const QNetworkConfiguration &config, QGraphicsItem *parent)
this, SLOT(stateChanged(QNetworkSession::State)));
setFlag(ItemIsMovable);
-#if (QT_VERSION >= QT_VERSION_CHECK(4, 6, 0))
setFlag(ItemSendsGeometryChanges);
-#endif
setZValue(1);
icon = new QGraphicsSvgItem(this);
diff --git a/examples/svg/svgviewer/mainwindow.cpp b/examples/svg/svgviewer/mainwindow.cpp
index 7dd240a..d095416 100644
--- a/examples/svg/svgviewer/mainwindow.cpp
+++ b/examples/svg/svgviewer/mainwindow.cpp
@@ -118,14 +118,10 @@ MainWindow::MainWindow()
m_imageAction->setData(int(SvgView::Image));
rendererMenu->addSeparator();
- m_highQualityAntialiasingAction = rendererMenu->addAction(tr("&High Quality Antialiasing"));
- m_highQualityAntialiasingAction->setEnabled(false);
- m_highQualityAntialiasingAction->setCheckable(true);
- m_highQualityAntialiasingAction->setChecked(false);
- connect(m_highQualityAntialiasingAction, &QAction::toggled, m_view, &SvgView::setHighQualityAntialiasing);
-#ifdef QT_NO_OPENGL
- m_highQualityAntialiasingAction->setVisible(false);
-#endif
+ m_antialiasingAction = rendererMenu->addAction(tr("&Antialiasing"));
+ m_antialiasingAction->setCheckable(true);
+ m_antialiasingAction->setChecked(false);
+ connect(m_antialiasingAction, &QAction::toggled, m_view, &SvgView::setAntialiasing);
QActionGroup *rendererGroup = new QActionGroup(this);
rendererGroup->addAction(m_nativeAction);
@@ -191,8 +187,6 @@ bool MainWindow::loadFile(const QString &fileName)
void MainWindow::setRenderer(int renderMode)
{
-
- m_highQualityAntialiasingAction->setEnabled(renderMode == SvgView::OpenGL);
m_view->setRenderer(static_cast<SvgView::RendererType>(renderMode));
}
diff --git a/examples/svg/svgviewer/mainwindow.h b/examples/svg/svgviewer/mainwindow.h
index 6c2af7e..a102eaa 100644
--- a/examples/svg/svgviewer/mainwindow.h
+++ b/examples/svg/svgviewer/mainwindow.h
@@ -85,7 +85,7 @@ private:
QAction *m_nativeAction;
QAction *m_glAction;
QAction *m_imageAction;
- QAction *m_highQualityAntialiasingAction;
+ QAction *m_antialiasingAction;
QAction *m_backgroundAction;
QAction *m_outlineAction;
diff --git a/examples/svg/svgviewer/svgview.cpp b/examples/svg/svgviewer/svgview.cpp
index ecc8409..50b622b 100644
--- a/examples/svg/svgviewer/svgview.cpp
+++ b/examples/svg/svgviewer/svgview.cpp
@@ -153,13 +153,9 @@ void SvgView::setRenderer(RendererType type)
}
}
-void SvgView::setHighQualityAntialiasing(bool highQualityAntialiasing)
+void SvgView::setAntialiasing(bool antialiasing)
{
-#ifndef QT_NO_OPENGL
- setRenderHint(QPainter::HighQualityAntialiasing, highQualityAntialiasing);
-#else
- Q_UNUSED(highQualityAntialiasing);
-#endif
+ setRenderHint(QPainter::Antialiasing, antialiasing);
}
void SvgView::setViewBackground(bool enable)
diff --git a/examples/svg/svgviewer/svgview.h b/examples/svg/svgviewer/svgview.h
index 1b6b33e..7d5f7d1 100644
--- a/examples/svg/svgviewer/svgview.h
+++ b/examples/svg/svgviewer/svgview.h
@@ -79,7 +79,7 @@ public:
qreal zoomFactor() const;
public slots:
- void setHighQualityAntialiasing(bool highQualityAntialiasing);
+ void setAntialiasing(bool antialiasing);
void setViewBackground(bool enable);
void setViewOutline(bool enable);
void zoomIn();
diff --git a/src/svg/qsvggenerator.cpp b/src/svg/qsvggenerator.cpp
index 07f8d74..b671c44 100644
--- a/src/svg/qsvggenerator.cpp
+++ b/src/svg/qsvggenerator.cpp
@@ -1009,7 +1009,7 @@ void QSvgPaintEngine::updateState(const QPaintEngineState &state)
}
if (flags & QPaintEngine::DirtyTransform) {
- d->matrix = state.matrix();
+ d->matrix = state.transform().toAffine();
*d->stream << "transform=\"matrix(" << d->matrix.m11() << ','
<< d->matrix.m12() << ','
<< d->matrix.m21() << ',' << d->matrix.m22() << ','