From 4c0e27ae6f56cc43b871d7659b77747d9ba969bc Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Sun, 24 Apr 2016 17:37:29 +0200 Subject: 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 --- examples/widgets/painting/pathstroke/pathstroke.cpp | 4 ++++ examples/widgets/painting/pathstroke/pathstroke.h | 1 + 2 files changed, 5 insertions(+) (limited to 'examples/widgets/painting') 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(); } -- cgit v1.2.3