diff options
author | Kai Pastor <dg0yt@darc.de> | 2016-04-24 17:37:29 +0200 |
---|---|---|
committer | Kai Pastor <dg0yt@darc.de> | 2018-03-21 06:24:41 +0000 |
commit | 4c0e27ae6f56cc43b871d7659b77747d9ba969bc (patch) | |
tree | d50757027dc16d1350a9d6107c8082d465884332 /examples | |
parent | fc8fd508165c8e4dcfe0da397b63cf99f15178e3 (diff) |
Add Qt::SvgMiterJoin option to pathstroke example
Qt::SvgMiterJoin is more important than the name suggests: It is used
not only by SVG but also by PDF. It differs from Qt::MiterJoin in the
miter limit behavior.
Task-number: QTBUG-52640
Change-Id: I8ad04b1231958628caab18a233d54d42ea6449e7
Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
Diffstat (limited to 'examples')
-rw-r--r-- | examples/widgets/painting/pathstroke/pathstroke.cpp | 4 | ||||
-rw-r--r-- | examples/widgets/painting/pathstroke/pathstroke.h | 1 |
2 files changed, 5 insertions, 0 deletions
diff --git a/examples/widgets/painting/pathstroke/pathstroke.cpp b/examples/widgets/painting/pathstroke/pathstroke.cpp index 1e2f75b2a5..5a7b8fd9fe 100644 --- a/examples/widgets/painting/pathstroke/pathstroke.cpp +++ b/examples/widgets/painting/pathstroke/pathstroke.cpp @@ -87,10 +87,12 @@ void PathStrokeControls::createCommonControls(QWidget* parent) m_joinGroup->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed); QRadioButton *bevelJoin = new QRadioButton(m_joinGroup); QRadioButton *miterJoin = new QRadioButton(m_joinGroup); + QRadioButton *svgMiterJoin = new QRadioButton(m_joinGroup); QRadioButton *roundJoin = new QRadioButton(m_joinGroup); m_joinGroup->setTitle(tr("Join Style")); bevelJoin->setText(tr("Bevel")); miterJoin->setText(tr("Miter")); + svgMiterJoin->setText(tr("SvgMiter")); roundJoin->setText(tr("Round")); m_styleGroup = new QGroupBox(parent); @@ -145,6 +147,7 @@ void PathStrokeControls::createCommonControls(QWidget* parent) QVBoxLayout *joinGroupLayout = new QVBoxLayout(m_joinGroup); joinGroupLayout->addWidget(bevelJoin); joinGroupLayout->addWidget(miterJoin); + joinGroupLayout->addWidget(svgMiterJoin); joinGroupLayout->addWidget(roundJoin); QVBoxLayout *styleGroupLayout = new QVBoxLayout(m_styleGroup); @@ -167,6 +170,7 @@ void PathStrokeControls::createCommonControls(QWidget* parent) connect(bevelJoin, SIGNAL(clicked()), m_renderer, SLOT(setBevelJoin())); connect(miterJoin, SIGNAL(clicked()), m_renderer, SLOT(setMiterJoin())); + connect(svgMiterJoin, SIGNAL(clicked()), m_renderer, SLOT(setSvgMiterJoin())); connect(roundJoin, SIGNAL(clicked()), m_renderer, SLOT(setRoundJoin())); connect(curveMode, SIGNAL(clicked()), m_renderer, SLOT(setCurveMode())); diff --git a/examples/widgets/painting/pathstroke/pathstroke.h b/examples/widgets/painting/pathstroke/pathstroke.h index 71352c8cc2..7bc7e09003 100644 --- a/examples/widgets/painting/pathstroke/pathstroke.h +++ b/examples/widgets/painting/pathstroke/pathstroke.h @@ -92,6 +92,7 @@ public slots: void setBevelJoin() { m_joinStyle = Qt::BevelJoin; update(); } void setMiterJoin() { m_joinStyle = Qt::MiterJoin; update(); } + void setSvgMiterJoin() { m_joinStyle = Qt::SvgMiterJoin; update(); } void setRoundJoin() { m_joinStyle = Qt::RoundJoin; update(); } void setCurveMode() { m_pathMode = CurveMode; update(); } |