From 41a0be329c3f31345afc61b622e49fc4bc3bce08 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Wed, 30 Mar 2016 07:32:51 +0200 Subject: Do not disconnect with nullptr when unplugging screens Task-number: QTBUG-42803 Change-Id: I080ec3f0cc2cb55b43a9b8792f03b002b2e0f982 Reviewed-by: Gunnar Sletta Reviewed-by: Shawn Rutledge --- src/gui/kernel/qopenglcontext.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/gui') diff --git a/src/gui/kernel/qopenglcontext.cpp b/src/gui/kernel/qopenglcontext.cpp index 3c033ea39e..7588c36c9b 100644 --- a/src/gui/kernel/qopenglcontext.cpp +++ b/src/gui/kernel/qopenglcontext.cpp @@ -510,8 +510,10 @@ void QOpenGLContext::setScreen(QScreen *screen) void QOpenGLContextPrivate::_q_screenDestroyed(QObject *object) { Q_Q(QOpenGLContext); - if (object == static_cast(screen)) + if (object == static_cast(screen)) { + screen = 0; q->setScreen(0); + } } /*! -- cgit v1.2.3 From 5f8bd44adaab322a7564855a089edf7b3247ad1b Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Tue, 5 Apr 2016 18:03:38 -0700 Subject: Avoid unnecessary allocation in QClipData::setClipRegion() Change-Id: I1280a496478ec6839ac432ffd63ecea28dbb972a Reviewed-by: Marc Mutz --- src/gui/painting/qpaintengine_raster.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/gui') diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp index f70bef72d8..278d7bb99e 100644 --- a/src/gui/painting/qpaintengine_raster.cpp +++ b/src/gui/painting/qpaintengine_raster.cpp @@ -3887,7 +3887,7 @@ void QClipData::setClipRect(const QRect &rect) void QClipData::setClipRegion(const QRegion ®ion) { if (region.rectCount() == 1) { - setClipRect(region.rects().at(0)); + setClipRect(region.boundingRect()); return; } -- cgit v1.2.3 From 3ddb2c325e832afc7deef7a48c130408130f0d9e Mon Sep 17 00:00:00 2001 From: Jake Petroules Date: Tue, 5 Apr 2016 16:52:11 -0700 Subject: Fix QPrinter PDF output using fonts with spaces in the PostScript name. Task-number: QTBUG-52352 Done-with: Andy Shaw Change-Id: Id8dcb4a57520c2cc53483672f6578e5ab0bb5de5 Reviewed-by: Lars Knoll --- src/gui/painting/qpdf.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/gui') diff --git a/src/gui/painting/qpdf.cpp b/src/gui/painting/qpdf.cpp index d68d719c39..22a387bd28 100644 --- a/src/gui/painting/qpdf.cpp +++ b/src/gui/painting/qpdf.cpp @@ -1556,6 +1556,7 @@ void QPdfEnginePrivate::embedFont(QFontSubset *font) int toUnicode = requestObject(); QFontEngine::Properties properties = font->fontEngine->properties(); + QByteArray postscriptName = properties.postscriptName.replace(' ', '_'); { qreal scale = 1000/properties.emSquare.toReal(); @@ -1569,7 +1570,7 @@ void QPdfEnginePrivate::embedFont(QFontSubset *font) s << (char)('A' + (tag % 26)); tag /= 26; } - s << '+' << properties.postscriptName << "\n" + s << '+' << postscriptName << "\n" "/Flags " << 4 << "\n" "/FontBBox [" << properties.boundingBox.x()*scale @@ -1612,7 +1613,7 @@ void QPdfEnginePrivate::embedFont(QFontSubset *font) QPdf::ByteStream s(&cid); s << "<< /Type /Font\n" "/Subtype /CIDFontType2\n" - "/BaseFont /" << properties.postscriptName << "\n" + "/BaseFont /" << postscriptName << "\n" "/CIDSystemInfo << /Registry (Adobe) /Ordering (Identity) /Supplement 0 >>\n" "/FontDescriptor " << fontDescriptor << "0 R\n" "/CIDToGIDMap /Identity\n" @@ -1636,7 +1637,7 @@ void QPdfEnginePrivate::embedFont(QFontSubset *font) QPdf::ByteStream s(&font); s << "<< /Type /Font\n" "/Subtype /Type0\n" - "/BaseFont /" << properties.postscriptName << "\n" + "/BaseFont /" << postscriptName << "\n" "/Encoding /Identity-H\n" "/DescendantFonts [" << cidfont << "0 R]\n" "/ToUnicode " << toUnicode << "0 R" -- cgit v1.2.3