From b8ccacbb03cb8d265209970c4443218dac33fc81 Mon Sep 17 00:00:00 2001 From: BogDan Vatra Date: Mon, 2 Dec 2013 16:48:18 +0200 Subject: Default to 5.2 source repository for Qt 5.2.x We can't use latest anymore because the qreal change is not back compatible and all the apps that used latest will stop to run when Ministro will upgrade the libs. Change-Id: I5286e72eccf86b4dead773a637aa28e29d120605 Reviewed-by: Paul Olav Tvete --- src/android/java/res/values/libs.xml | 2 +- src/android/java/src/org/qtproject/qt5/android/bindings/QtActivity.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/android/java/res/values/libs.xml b/src/android/java/res/values/libs.xml index 231406d224..797e6bb8c4 100644 --- a/src/android/java/res/values/libs.xml +++ b/src/android/java/res/values/libs.xml @@ -1,7 +1,7 @@ - https://download.qt-project.org/ministro/android/qt5/latest + https://download.qt-project.org/ministro/android/qt5/qt-5.2 index mapping Entries m_entries; int m_index; + QByteArray m_className; }; Q_DECLARE_OPERATORS_FOR_FLAGS(QMetaObjectBuilder::AddMembers) diff --git a/src/dbus/qdbusmetaobject.cpp b/src/dbus/qdbusmetaobject.cpp index 51c0b27668..13c538bb59 100644 --- a/src/dbus/qdbusmetaobject.cpp +++ b/src/dbus/qdbusmetaobject.cpp @@ -445,8 +445,7 @@ void QDBusMetaObjectGenerator::write(QDBusMetaObject *obj) data_size += 2 + mm.inputTypes.count() + mm.outputTypes.count(); idata.resize(data_size + 1); - QMetaStringTable strings; - strings.enter(className.toLatin1()); + QMetaStringTable strings(className.toLatin1()); int offset = header->methodData; int parametersOffset = offset + header->methodCount * 5; -- cgit v1.2.3 From 8be546d107ac69bc48ec278396e9c3f63470fd0d Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Sat, 7 Dec 2013 08:49:34 +0100 Subject: Revert "Move the glxfbconfig configtest to qpa and rename it to glx" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit a2d3b7c99165cb5c4be6f0dd83a967e1119cf732. That commit broke -opengl es2 builds on Linux desktops (when GLX is available). /usr/include/GL/gl.h:162:17: error: conflicting declaration ‘typedef double GLdouble’ qopengl.h:97:17: error: ‘GLdouble’ has a previous declaration as ‘typedef GLfloat GLdouble’ Change-Id: Id5f48c05803be1a8c03eeffca139b80e9a85a0eb Reviewed-by: Thiago Macieira --- src/plugins/platforms/xcb/xcb-plugin.pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/plugins/platforms/xcb/xcb-plugin.pro b/src/plugins/platforms/xcb/xcb-plugin.pro index 49a1c1b320..8968d020c4 100644 --- a/src/plugins/platforms/xcb/xcb-plugin.pro +++ b/src/plugins/platforms/xcb/xcb-plugin.pro @@ -81,7 +81,7 @@ contains(QT_CONFIG, xcb-sm) { } contains(QT_CONFIG, opengl) { - contains(QT_CONFIG, xcb-xlib):contains(QT_CONFIG, glx) { + contains(QT_CONFIG, xcb-xlib):!contains(QT_CONFIG, opengles2) { DEFINES += XCB_USE_GLX HEADERS += qglxintegration.h SOURCES += qglxintegration.cpp -- cgit v1.2.3 From 5bf67f5f41ab110eb41ab74f2a87e649735af435 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 3 Dec 2013 23:25:27 -0800 Subject: Don't check the Qt version across modules in -developer-build MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Instead of enforcing the check, we'll simply trust developers to do the right thing. For one, it's useful to mix libraries during testing (regression testing, git bisects, etc.). For another, Qt developers are faced day-to-day with binary incompatibility issues anyway, so this check is mostly superfluous. If there's one commit we could be sure that isn't breaking binary compatibility, that's the "Bump Qt version" commit. And yet that's the one that would cause the fatal to trip... Change-Id: I8965f764a6ca1b2d125b42bce7ac6b27e3afc8ac Reviewed-by: Olivier Goffart Reviewed-by: Friedemann Kleint Reviewed-by: Jędrzej Nowacki Reviewed-by: Stephen Kelly Reviewed-by: Marc Mutz --- src/corelib/kernel/qobject.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp index a65cf517ce..50fb1e5970 100644 --- a/src/corelib/kernel/qobject.cpp +++ b/src/corelib/kernel/qobject.cpp @@ -194,9 +194,15 @@ QMetaObject *QObjectData::dynamicMetaObject() const QObjectPrivate::QObjectPrivate(int version) : threadData(0), connectionLists(0), senders(0), currentSender(0), currentChildBeingDeleted(0) { +#ifdef QT_BUILD_INTERNAL + // Don't check the version parameter in internal builds. + // This allows incompatible versions to be loaded, possibly for testing. + Q_UNUSED(version); +#else if (version != QObjectPrivateVersion) qFatal("Cannot mix incompatible Qt library (version 0x%x) with this library (version 0x%x)", version, QObjectPrivateVersion); +#endif // QObjectData initialization q_ptr = 0; -- cgit v1.2.3 From 77cd033e44f9b899749994b17fc0bbfa7a164a3b Mon Sep 17 00:00:00 2001 From: John Layt Date: Sun, 8 Dec 2013 00:16:45 +0100 Subject: QPrintDialog - Fix setting of PageOrder The print dialog was setting the PageOrder on the QPrinter as soon as the check box was toggled and not when the Print button was pressed, meaning the change is not forgotten when Cancel is pressed. Change-Id: I19637b7efacfb5388c70d2e7d9d05a05ecc5b2ea Reviewed-by: Andy Shaw --- src/printsupport/dialogs/qprintdialog.h | 1 - src/printsupport/dialogs/qprintdialog_unix.cpp | 14 +------------- 2 files changed, 1 insertion(+), 14 deletions(-) (limited to 'src') diff --git a/src/printsupport/dialogs/qprintdialog.h b/src/printsupport/dialogs/qprintdialog.h index c822aa0533..886cd1e08d 100644 --- a/src/printsupport/dialogs/qprintdialog.h +++ b/src/printsupport/dialogs/qprintdialog.h @@ -106,7 +106,6 @@ Q_SIGNALS: private: #if defined (Q_OS_UNIX) && !defined(Q_OS_MAC) - Q_PRIVATE_SLOT(d_func(), void _q_chbPrintLastFirstToggled(bool)) Q_PRIVATE_SLOT(d_func(), void _q_togglePageSetCombo(bool)) Q_PRIVATE_SLOT(d_func(), void _q_collapseOrExpandDialog()) # if !defined(QT_NO_MESSAGEBOX) diff --git a/src/printsupport/dialogs/qprintdialog_unix.cpp b/src/printsupport/dialogs/qprintdialog_unix.cpp index fe7e43814c..41a01abf3b 100644 --- a/src/printsupport/dialogs/qprintdialog_unix.cpp +++ b/src/printsupport/dialogs/qprintdialog_unix.cpp @@ -203,7 +203,6 @@ public: void selectPrinter(const QPrinter::OutputFormat outputFormat); - void _q_chbPrintLastFirstToggled(bool); void _q_togglePageSetCombo(bool); #ifndef QT_NO_MESSAGEBOX void _q_checkFields(); @@ -363,9 +362,6 @@ void QPrintDialogPrivate::init() #endif QObject::connect(buttons, SIGNAL(rejected()), q, SLOT(reject())); - QObject::connect(options.reverse, SIGNAL(toggled(bool)), - q, SLOT(_q_chbPrintLastFirstToggled(bool))); - QObject::connect(options.printSelection, SIGNAL(toggled(bool)), q, SLOT(_q_togglePageSetCombo(bool))); @@ -429,6 +425,7 @@ void QPrintDialogPrivate::setupPrinter() } p->setColorMode(options.color->isChecked() ? QPrinter::Color : QPrinter::GrayScale); + p->setPageOrder(options.reverse->isChecked() ? QPrinter::LastPageFirst : QPrinter::FirstPageFirst); // print range if (options.printAll->isChecked()) { @@ -486,15 +483,6 @@ void QPrintDialogPrivate::setupPrinter() top->d->setupPrinter(); } -void QPrintDialogPrivate::_q_chbPrintLastFirstToggled(bool checked) -{ - Q_Q(QPrintDialog); - if (checked) - q->printer()->setPageOrder(QPrinter::LastPageFirst); - else - q->printer()->setPageOrder(QPrinter::FirstPageFirst); -} - void QPrintDialogPrivate::_q_togglePageSetCombo(bool checked) { if (printerOutputFormat == QPrinter::PdfFormat) -- cgit v1.2.3 From 1698369924e5f14769fc4b107697626660d9ddf4 Mon Sep 17 00:00:00 2001 From: John Layt Date: Sun, 8 Dec 2013 11:13:01 +0100 Subject: QPageSetupWidget - Fix copying of printer settings Don't copy the dialog settings to the QPrinter before the Print button is pressed, in case the Cancel button is pressed instead. The settings already get copied in the right place. Change-Id: I84d0053b450cf5839bf1a879af013f305a8fd377 Reviewed-by: Andy Shaw --- src/printsupport/dialogs/qpagesetupdialog_unix.cpp | 3 --- 1 file changed, 3 deletions(-) (limited to 'src') diff --git a/src/printsupport/dialogs/qpagesetupdialog_unix.cpp b/src/printsupport/dialogs/qpagesetupdialog_unix.cpp index 8809b52751..c1b9828a23 100644 --- a/src/printsupport/dialogs/qpagesetupdialog_unix.cpp +++ b/src/printsupport/dialogs/qpagesetupdialog_unix.cpp @@ -457,9 +457,6 @@ void QPageSetupWidget::selectPrinter() unitChanged(widget.unit->currentIndex()); m_pagePreview->setMargins(m_leftMargin, m_topMargin, m_rightMargin, m_bottomMargin); - - // setup printer here the first time - setupPrinter(); } void QPageSetupWidget::selectPdfPsPrinter(const QPrinter *p) -- cgit v1.2.3 From d9fd2085f9c2105187732a2c14fa78c414678d8b Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Sun, 8 Dec 2013 13:19:46 +0100 Subject: Reinitialize the printer after changing the custom paper size Task-number: QTBUG-34276 Change-Id: Ie382c39cb7b7b8307fcd1130702ca97e80e4a4f5 Reviewed-by: John Layt --- src/printsupport/kernel/qprintengine_win.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/printsupport/kernel/qprintengine_win.cpp b/src/printsupport/kernel/qprintengine_win.cpp index e2446c19b1..67e7c34fca 100644 --- a/src/printsupport/kernel/qprintengine_win.cpp +++ b/src/printsupport/kernel/qprintengine_win.cpp @@ -1453,6 +1453,7 @@ void QWin32PrintEngine::setProperty(PrintEnginePropertyKey key, const QVariant & d->devMode->dmPaperLength = qRound(sizeMM.height() * 10.0); d->devMode->dmPaperWidth = qRound(sizeMM.width() * 10.0); } + d->doReinit(); break; } -- cgit v1.2.3 From fbc6240cc6f4846fbde1ee8dff6cda28863ed55f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9rgio=20Martins?= Date: Fri, 6 Dec 2013 15:12:50 +0000 Subject: Windows: Fix corner case where frameless windows would cover the taskbar. In commit 0c936ca83c40b73f30195a619900f2be98b9e968 we fixed the case where the window was maximized programmatically, but if the window gets restored by clicking on the taskbar we don't get to set WithinMaximize flag, since we immediately get the WM_GETMINMAXINFO request from Windows. To reproduce the problem, run tests/manual/windowflags, remove frames, maximize, minimize, and restore by clicking on the taskbar. Task-number: QTBUG-8361 Change-Id: I8a7cf4fccbb2c3dac5f570848501ac1e8d2c2307 Reviewed-by: Friedemann Kleint --- src/plugins/platforms/windows/qwindowswindow.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp index 89b5bdbf0e..51902385e1 100644 --- a/src/plugins/platforms/windows/qwindowswindow.cpp +++ b/src/plugins/platforms/windows/qwindowswindow.cpp @@ -1912,7 +1912,8 @@ void QWindowsWindow::getSizeHints(MINMAXINFO *mmi) const const QWindowsGeometryHint hint(window(), m_data.customMargins); hint.applyToMinMaxInfo(m_data.hwnd, mmi); - if (testFlag(WithinMaximize) && (m_data.flags & Qt::FramelessWindowHint)) { + if ((testFlag(WithinMaximize) || (window()->windowState() == Qt::WindowMinimized)) + && (m_data.flags & Qt::FramelessWindowHint)) { // This block fixes QTBUG-8361: Frameless windows shouldn't cover the // taskbar when maximized if (const QScreen *screen = effectiveScreen(window())) { -- cgit v1.2.3 From b0f83f2284af777f17e06e084a2399f9ad2a87f8 Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Tue, 3 Dec 2013 15:38:50 +0100 Subject: Simplify linking to different jpeg libs. This makes it slightly more obvious which compiler should be used with which. Task-number: QTBUG-23119 Change-Id: Ie3e5cf995d686bfa846902a040668716c8b5f526 Reviewed-by: Andy Shaw --- src/gui/image/qjpeghandler.pri | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/gui/image/qjpeghandler.pri b/src/gui/image/qjpeghandler.pri index 3cb35c95ed..c8de33d8b4 100644 --- a/src/gui/image/qjpeghandler.pri +++ b/src/gui/image/qjpeghandler.pri @@ -3,8 +3,10 @@ INCLUDEPATH *= $$PWD HEADERS += $$PWD/qjpeghandler_p.h SOURCES += $$PWD/qjpeghandler.cpp contains(QT_CONFIG, system-jpeg) { - if(unix|win32-g++*): LIBS += -ljpeg - else:win32: LIBS += libjpeg.lib + msvc: \ + LIBS += libjpeg.lib + else: \ + LIBS += -ljpeg } else { include($$PWD/../../3rdparty/libjpeg.pri) } -- cgit v1.2.3 From bd1a609aef4b2e2e36c0fe43c18b175a951b2e55 Mon Sep 17 00:00:00 2001 From: John Layt Date: Sat, 7 Dec 2013 20:17:52 +0100 Subject: QPrintDialog - Fix Cups printer setup sequence First set up the selected output format, printer and page size, and then setup the selected job options. This ensures all values are correctly setup for the requested format and printer as not all settings may be able to persist across the change in output format or printer. Change-Id: I67f261f4e3be479a9018139633886ee8e570f42a Reviewed-by: Andy Shaw --- src/printsupport/dialogs/qprintdialog_unix.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/printsupport/dialogs/qprintdialog_unix.cpp b/src/printsupport/dialogs/qprintdialog_unix.cpp index 41a01abf3b..a903d170f2 100644 --- a/src/printsupport/dialogs/qprintdialog_unix.cpp +++ b/src/printsupport/dialogs/qprintdialog_unix.cpp @@ -412,6 +412,10 @@ void QPrintDialogPrivate::applyPrinterProperties() void QPrintDialogPrivate::setupPrinter() { + // First setup the requested OutputFormat, Printer and Page Size first + top->d->setupPrinter(); + + // Then setup Print Job options Q_Q(QPrintDialog); QPrinter* p = q->printer(); @@ -479,8 +483,6 @@ void QPrintDialogPrivate::setupPrinter() // copies p->setCopyCount(options.copies->value()); p->setCollateCopies(options.collate->isChecked()); - - top->d->setupPrinter(); } void QPrintDialogPrivate::_q_togglePageSetCombo(bool checked) -- cgit v1.2.3 From 3c7231a9800e4e2de3f90b175f9bb39a9f046b18 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Fri, 6 Dec 2013 20:25:12 +0100 Subject: QMetaStringTable: make ctor explicit Recent commit 105d10de introduced the QMetaStringTable(QByteArray) constructor, but failed to mark it as explicit. The argument, the class' name, is not an equivalent representation of a string table, so mark the constructor explicit. Change-Id: I2f141969400b98d3253283bd6fb0b9d18f2d53b3 Reviewed-by: Simon Hausmann Reviewed-by: Olivier Goffart --- src/corelib/kernel/qmetaobjectbuilder_p.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/corelib/kernel/qmetaobjectbuilder_p.h b/src/corelib/kernel/qmetaobjectbuilder_p.h index 110aaf9ce2..3a1b43c3ed 100644 --- a/src/corelib/kernel/qmetaobjectbuilder_p.h +++ b/src/corelib/kernel/qmetaobjectbuilder_p.h @@ -323,7 +323,7 @@ private: class Q_CORE_EXPORT QMetaStringTable { public: - QMetaStringTable(const QByteArray &className); + explicit QMetaStringTable(const QByteArray &className); int enter(const QByteArray &value); -- cgit v1.2.3 From a115fdbe024b7336910ba58c6e4f037b68e9622f Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Fri, 6 Dec 2013 20:30:10 +0100 Subject: QWidgetTextControl: drop some actions when QT_NO_CLIPBOARD Drop the Cut, Copy, and Copy Link Address actions from the context menu for QT_NO_CLIPBOARD builds. This mirrors what QWidgetLineControl already does. Change-Id: Icd6e92c044a11d336fb8d7fbf54b826712bd240e Reviewed-by: Friedemann Kleint --- src/widgets/widgets/qwidgettextcontrol.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/widgets/widgets/qwidgettextcontrol.cpp b/src/widgets/widgets/qwidgettextcontrol.cpp index 0255183c87..b8f8762240 100644 --- a/src/widgets/widgets/qwidgettextcontrol.cpp +++ b/src/widgets/widgets/qwidgettextcontrol.cpp @@ -2158,11 +2158,14 @@ QMenu *QWidgetTextControl::createStandardContextMenu(const QPointF &pos, QWidget setActionIcon(a, QStringLiteral("edit-redo")); menu->addSeparator(); +#ifndef QT_NO_CLIPBOARD a = menu->addAction(tr("Cu&t") + ACCEL_KEY(QKeySequence::Cut), this, SLOT(cut())); a->setEnabled(d->cursor.hasSelection()); setActionIcon(a, QStringLiteral("edit-cut")); +#endif } +#ifndef QT_NO_CLIPBOARD if (showTextSelectionActions) { a = menu->addAction(tr("&Copy") + ACCEL_KEY(QKeySequence::Copy), this, SLOT(copy())); a->setEnabled(d->cursor.hasSelection()); @@ -2175,9 +2178,10 @@ QMenu *QWidgetTextControl::createStandardContextMenu(const QPointF &pos, QWidget a = menu->addAction(tr("Copy &Link Location"), this, SLOT(_q_copyLink())); a->setEnabled(!d->linkToCopy.isEmpty()); } +#endif // QT_NO_CLIPBOARD if (d->interactionFlags & Qt::TextEditable) { -#if !defined(QT_NO_CLIPBOARD) +#ifndef QT_NO_CLIPBOARD a = menu->addAction(tr("&Paste") + ACCEL_KEY(QKeySequence::Paste), this, SLOT(paste())); a->setEnabled(canPaste()); setActionIcon(a, QStringLiteral("edit-paste")); -- cgit v1.2.3 From e6799c6e336ef1e79ce4ade33db336f67b7f588b Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Fri, 6 Dec 2013 22:35:29 -0800 Subject: Remove unused function "quadraticRoots" qbezier.cpp(122): warning #177: function "quadraticRoots" was declared but never referenced Change-Id: I590f59ed6e41462d0a14a9239adb8bd0acbeeae4 Reviewed-by: Gunnar Sletta Reviewed-by: Frederik Gladhorn Reviewed-by: Lars Knoll --- src/gui/painting/qbezier.cpp | 31 ------------------------------- 1 file changed, 31 deletions(-) (limited to 'src') diff --git a/src/gui/painting/qbezier.cpp b/src/gui/painting/qbezier.cpp index 2762560da7..33075b640d 100644 --- a/src/gui/painting/qbezier.cpp +++ b/src/gui/painting/qbezier.cpp @@ -119,37 +119,6 @@ QBezier QBezier::getSubRange(qreal t0, qreal t1) const return result; } -static inline int quadraticRoots(qreal a, qreal b, qreal c, - qreal *x1, qreal *x2) -{ - if (qFuzzyIsNull(a)) { - if (qFuzzyIsNull(b)) - return 0; - *x1 = *x2 = (-c / b); - return 1; - } else { - const qreal det = b * b - 4 * a * c; - if (qFuzzyIsNull(det)) { - *x1 = *x2 = -b / (2 * a); - return 1; - } - if (det > 0) { - if (qFuzzyIsNull(b)) { - *x2 = qSqrt(-c / a); - *x1 = -(*x2); - return 2; - } - const qreal stableA = b / (2 * a); - const qreal stableB = c / (a * stableA * stableA); - const qreal stableC = -1 - qSqrt(1 - stableB); - *x2 = stableA * stableC; - *x1 = (stableA * stableB) / stableC; - return 2; - } else - return 0; - } -} - void QBezier::addToPolygon(QPolygonF *polygon, qreal bezier_flattening_threshold) const { QBezier beziers[10]; -- cgit v1.2.3 From 6d8b84e8d574ea583d54b3de5cb3d275c41f2caf Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Thu, 5 Dec 2013 10:36:00 +0200 Subject: GitIgnore updates * ANGLE artifacts * qfeatures Change-Id: I3cb8f78bf02119233f115ec53d536c05dd9776e7 Reviewed-by: Friedemann Kleint Reviewed-by: Oswald Buddenhagen --- src/angle/src/.gitignore | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 src/angle/src/.gitignore (limited to 'src') diff --git a/src/angle/src/.gitignore b/src/angle/src/.gitignore new file mode 100644 index 0000000000..9cbadb59ef --- /dev/null +++ b/src/angle/src/.gitignore @@ -0,0 +1,6 @@ +/libGLESv2/renderer/ +/compiler/glslang_lex.cpp +/compiler/glslang_tab.cpp +/compiler/glslang_tab.h +/compiler/preprocessor/ExpressionParser.cpp +/compiler/preprocessor/Tokenizer.cpp -- cgit v1.2.3 From cb2549740e53e6aa04a3112febf95f99173198a0 Mon Sep 17 00:00:00 2001 From: Caroline Chao Date: Wed, 26 Jun 2013 13:51:08 +0200 Subject: Styles: Fix upRule used instead of downRule Change-Id: Icd157fa522836fab9128322f98b2916cfff35c61 Reviewed-by: J-P Nurmi --- src/widgets/styles/qstylesheetstyle.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/widgets/styles/qstylesheetstyle.cpp b/src/widgets/styles/qstylesheetstyle.cpp index ab98dfbdcf..2f36e0e53c 100644 --- a/src/widgets/styles/qstylesheetstyle.cpp +++ b/src/widgets/styles/qstylesheetstyle.cpp @@ -5271,7 +5271,7 @@ QRect QStyleSheetStyle::subControlRect(ComplexControl cc, const QStyleOptionComp QRenderRule downRule = renderRule(w, opt, PseudoElement_SpinBoxDownButton); bool ruleMatch = rule.hasBox() || !rule.hasNativeBorder(); bool upRuleMatch = upRule.hasGeometry() || upRule.hasPosition(); - bool downRuleMatch = downRule.hasGeometry() || upRule.hasPosition(); + bool downRuleMatch = downRule.hasGeometry() || downRule.hasPosition(); if (ruleMatch || upRuleMatch || downRuleMatch) { switch (sc) { case SC_SpinBoxFrame: -- cgit v1.2.3 From 639b4e85ae72224133a978236331989796e7431c Mon Sep 17 00:00:00 2001 From: Dominik Holland Date: Mon, 9 Dec 2013 11:29:16 +0100 Subject: Disable the eglfs input handlers by Environment variable Added a Enironment variable to make it possible to disable the automatic installation of EVDEV input handlers. This is needed if you want to use your own generic plugin instead, which also uses evdev Change-Id: I17d47008c10999bf918db62a22a3b6a38d7abb80 Reviewed-by: Laszlo Agocs --- src/plugins/platforms/eglfs/qeglfsintegration.cpp | 5 ++++- src/plugins/platforms/eglfs/qeglfsintegration.h | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/plugins/platforms/eglfs/qeglfsintegration.cpp b/src/plugins/platforms/eglfs/qeglfsintegration.cpp index 55a822b887..d6832493f1 100644 --- a/src/plugins/platforms/eglfs/qeglfsintegration.cpp +++ b/src/plugins/platforms/eglfs/qeglfsintegration.cpp @@ -87,6 +87,8 @@ QEglFSIntegration::QEglFSIntegration() , mScreen(0) , mInputContext(0) { + mDisableInputHandlers = qgetenv("QT_QPA_EGLFS_DISABLE_INPUT").toInt(); + initResources(); } @@ -176,7 +178,8 @@ void QEglFSIntegration::initialize() mInputContext = QPlatformInputContextFactory::create(); - createInputHandlers(); + if (!mDisableInputHandlers) + createInputHandlers(); } QEglFSScreen *QEglFSIntegration::createScreen() const diff --git a/src/plugins/platforms/eglfs/qeglfsintegration.h b/src/plugins/platforms/eglfs/qeglfsintegration.h index f685eec2d4..12c8158bd1 100644 --- a/src/plugins/platforms/eglfs/qeglfsintegration.h +++ b/src/plugins/platforms/eglfs/qeglfsintegration.h @@ -97,6 +97,7 @@ private: QScopedPointer mServices; QEglFSScreen *mScreen; QPlatformInputContext *mInputContext; + bool mDisableInputHandlers; }; QT_END_NAMESPACE -- cgit v1.2.3 From 7eecbb07184bc8b2c5e7645af2805ba0a2488082 Mon Sep 17 00:00:00 2001 From: Peter Hartmann Date: Tue, 10 Dec 2013 09:21:43 +0100 Subject: SSL: blacklist ANSSI intermediate certificate ... because it was used to operate a man-in-the-middle proxy. Task-number: QTBUG-35474 Change-Id: Ic7f19708b278b866e4f06533cbd84e0ff43357e9 Reviewed-by: Richard J. Moore --- src/network/ssl/qsslcertificate.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/network/ssl/qsslcertificate.cpp b/src/network/ssl/qsslcertificate.cpp index 286a6fd668..b4c593fa73 100644 --- a/src/network/ssl/qsslcertificate.cpp +++ b/src/network/ssl/qsslcertificate.cpp @@ -1214,6 +1214,8 @@ static const char *certificate_blacklist[] = { "08:27", "*.EGO.GOV.TR", // Turktrust mis-issued intermediate certificate "08:64", "e-islem.kktcmerkezbankasi.org", // Turktrust mis-issued intermediate certificate + + "03:1d:a7", "AC DG Tr\xC3\xA9sor SSL", // intermediate certificate linking back to ANSSI French National Security Agency 0 }; -- cgit v1.2.3 From a134b57152964e1279f62606cce0a7e7f521c32a Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 3 Dec 2013 12:45:29 +0100 Subject: Windows: Show context menu on mouse release. Introduce a hint to QPlatformTheme to control the behavior. Task-number: QTBUG-35231 Change-Id: Ia28e153a8dd3f1931321a222d8906ca87166ed62 Reviewed-by: Shawn Rutledge Reviewed-by: Joerg Bornemann --- src/gui/kernel/qplatformtheme.cpp | 3 +++ src/gui/kernel/qplatformtheme.h | 3 ++- src/plugins/platforms/windows/qwindowstheme.cpp | 2 ++ src/widgets/kernel/qwidgetwindow.cpp | 8 ++++++-- 4 files changed, 13 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/gui/kernel/qplatformtheme.cpp b/src/gui/kernel/qplatformtheme.cpp index 1844232efe..3548ec0199 100644 --- a/src/gui/kernel/qplatformtheme.cpp +++ b/src/gui/kernel/qplatformtheme.cpp @@ -142,6 +142,8 @@ QT_BEGIN_NAMESPACE \value DialogSnapToDefaultButton (bool) Whether the mouse should snap to the default button when a dialog becomes visible. + \value ContextMenuOnMouseRelease (bool) Whether the context menu should be shown on mouse release. + \sa themeHint(), QStyle::pixelMetric() */ @@ -487,6 +489,7 @@ QVariant QPlatformTheme::defaultThemeHint(ThemeHint hint) case IconPixmapSizes: return QVariant::fromValue(QList()); case DialogSnapToDefaultButton: + case ContextMenuOnMouseRelease: return QVariant(false); } return QVariant(); diff --git a/src/gui/kernel/qplatformtheme.h b/src/gui/kernel/qplatformtheme.h index 4bddac5b1b..5cdec48ca3 100644 --- a/src/gui/kernel/qplatformtheme.h +++ b/src/gui/kernel/qplatformtheme.h @@ -106,7 +106,8 @@ public: TabAllWidgets, IconPixmapSizes, PasswordMaskCharacter, - DialogSnapToDefaultButton + DialogSnapToDefaultButton, + ContextMenuOnMouseRelease }; enum DialogType { diff --git a/src/plugins/platforms/windows/qwindowstheme.cpp b/src/plugins/platforms/windows/qwindowstheme.cpp index eb1bbd1ab0..00a5da8f44 100644 --- a/src/plugins/platforms/windows/qwindowstheme.cpp +++ b/src/plugins/platforms/windows/qwindowstheme.cpp @@ -383,6 +383,8 @@ QVariant QWindowsTheme::themeHint(ThemeHint hint) const } case DialogSnapToDefaultButton: return QVariant(booleanSystemParametersInfo(SPI_GETSNAPTODEFBUTTON, false)); + case ContextMenuOnMouseRelease: + return QVariant(true); default: break; } diff --git a/src/widgets/kernel/qwidgetwindow.cpp b/src/widgets/kernel/qwidgetwindow.cpp index 2e96247873..167102c633 100644 --- a/src/widgets/kernel/qwidgetwindow.cpp +++ b/src/widgets/kernel/qwidgetwindow.cpp @@ -49,6 +49,7 @@ #endif #include #include +#include #include QT_BEGIN_NAMESPACE @@ -354,6 +355,9 @@ void QWidgetWindow::handleNonClientAreaMouseEvent(QMouseEvent *e) void QWidgetWindow::handleMouseEvent(QMouseEvent *event) { + static const QEvent::Type contextMenuTrigger = + QGuiApplicationPrivate::platformTheme()->themeHint(QPlatformTheme::ContextMenuOnMouseRelease).toBool() ? + QEvent::MouseButtonRelease : QEvent::MouseButtonPress; if (qApp->d_func()->inPopupMode()) { QWidget *activePopupWidget = qApp->activePopupWidget(); QWidget *popup = activePopupWidget; @@ -438,7 +442,7 @@ void QWidgetWindow::handleMouseEvent(QMouseEvent *event) } qt_replay_popup_mouse_event = false; #ifndef QT_NO_CONTEXTMENU - } else if (event->type() == QEvent::MouseButtonPress + } else if (event->type() == contextMenuTrigger && event->button() == Qt::RightButton && (openPopupCount == oldOpenPopupCount)) { QWidget *popupEvent = popup; @@ -487,7 +491,7 @@ void QWidgetWindow::handleMouseEvent(QMouseEvent *event) qt_last_mouse_receiver); #ifndef QT_NO_CONTEXTMENU - if (event->type() == QEvent::MouseButtonPress && event->button() == Qt::RightButton) { + if (event->type() == contextMenuTrigger && event->button() == Qt::RightButton) { QContextMenuEvent e(QContextMenuEvent::Mouse, mapped, event->globalPos(), event->modifiers()); QGuiApplication::sendSpontaneousEvent(receiver, &e); } -- cgit v1.2.3 From 7009843ae3b12fe86d21040ad96add335c7df5a5 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Mon, 9 Dec 2013 10:54:12 +0100 Subject: QProcess/Win: allow child processes to change modes of the stdin pipe To be able to call SetNamedPipeHandleState on stdin in a child process, we must create a read-end pipe handle with the FILE_WRITE_ATTRIBUTES flag set. This can't be done with CreateNamedPipe but only with CreateFile. Therefore we're creating the handles for the child process always with CreateFile now. Besides, it's conceptually cleaner to have the server handle of the named pipe in the calling process. [ChangeLog][QtCore][Windows] Fix regression from Qt4 in QProcess. It wasn't possible anymore to alter pipe modes of stdin in child processes. Task-number: QTBUG-35357 Change-Id: I85f09753d0c924bdc8a6cef1ea5dbe6b2299c604 Reviewed-by: Friedemann Kleint Reviewed-by: Oswald Buddenhagen --- src/corelib/io/qprocess_win.cpp | 70 ++++++++++++++++++++++++----------------- 1 file changed, 42 insertions(+), 28 deletions(-) (limited to 'src') diff --git a/src/corelib/io/qprocess_win.cpp b/src/corelib/io/qprocess_win.cpp index dba9f62b98..fc2adb783e 100644 --- a/src/corelib/io/qprocess_win.cpp +++ b/src/corelib/io/qprocess_win.cpp @@ -73,10 +73,11 @@ static void qt_create_pipe(Q_PIPE *pipe, bool isInputPipe) // Anomymous pipes do not support asynchronous I/O. Thus we // create named pipes for redirecting stdout, stderr and stdin. + // The write handle must be non-inheritable for input pipes. + // The read handle must be non-inheritable for output pipes. SECURITY_ATTRIBUTES secAtt = { sizeof(SECURITY_ATTRIBUTES), 0, false }; - secAtt.bInheritHandle = isInputPipe; // The read handle must be non-inheritable for output pipes. - HANDLE hRead; + HANDLE hServer; wchar_t pipeName[256]; unsigned int attempts = 1000; forever { @@ -85,19 +86,29 @@ static void qt_create_pipe(Q_PIPE *pipe, bool isInputPipe) _snwprintf(pipeName, sizeof(pipeName) / sizeof(pipeName[0]), L"\\\\.\\pipe\\qt-%X", qrand()); + DWORD dwOpenMode = FILE_FLAG_OVERLAPPED; + DWORD dwOutputBufferSize = 0; + DWORD dwInputBufferSize = 0; + const DWORD dwPipeBufferSize = 1024 * 1024; + if (isInputPipe) { + dwOpenMode |= PIPE_ACCESS_OUTBOUND; + dwOutputBufferSize = dwPipeBufferSize; + } else { + dwOpenMode |= PIPE_ACCESS_INBOUND; + dwInputBufferSize = dwPipeBufferSize; + } DWORD dwPipeFlags = PIPE_TYPE_BYTE | PIPE_WAIT; if (QSysInfo::windowsVersion() >= QSysInfo::WV_VISTA) dwPipeFlags |= PIPE_REJECT_REMOTE_CLIENTS; - const DWORD dwPipeBufferSize = 1024 * 1024; - hRead = CreateNamedPipe(pipeName, - PIPE_ACCESS_INBOUND | FILE_FLAG_OVERLAPPED, - dwPipeFlags, - 1, // only one pipe instance - 0, // output buffer size - dwPipeBufferSize, // input buffer size - 0, - &secAtt); - if (hRead != INVALID_HANDLE_VALUE) + hServer = CreateNamedPipe(pipeName, + dwOpenMode, + dwPipeFlags, + 1, // only one pipe instance + dwOutputBufferSize, + dwInputBufferSize, + 0, + &secAtt); + if (hServer != INVALID_HANDLE_VALUE) break; DWORD dwError = GetLastError(); if (dwError != ERROR_PIPE_BUSY || !--attempts) { @@ -106,28 +117,31 @@ static void qt_create_pipe(Q_PIPE *pipe, bool isInputPipe) } } - // The write handle must be non-inheritable for input pipes. - secAtt.bInheritHandle = !isInputPipe; - - HANDLE hWrite = INVALID_HANDLE_VALUE; - hWrite = CreateFile(pipeName, - GENERIC_WRITE, - 0, - &secAtt, - OPEN_EXISTING, - FILE_FLAG_OVERLAPPED, - NULL); - if (hWrite == INVALID_HANDLE_VALUE) { + secAtt.bInheritHandle = TRUE; + const HANDLE hClient = CreateFile(pipeName, + (isInputPipe ? (GENERIC_READ | FILE_WRITE_ATTRIBUTES) + : GENERIC_WRITE), + 0, + &secAtt, + OPEN_EXISTING, + FILE_FLAG_OVERLAPPED, + NULL); + if (hClient == INVALID_HANDLE_VALUE) { qErrnoWarning("QProcess: CreateFile failed."); - CloseHandle(hRead); + CloseHandle(hServer); return; } // Wait until connection is in place. - ConnectNamedPipe(hRead, NULL); + ConnectNamedPipe(hServer, NULL); - pipe[0] = hRead; - pipe[1] = hWrite; + if (isInputPipe) { + pipe[0] = hClient; + pipe[1] = hServer; + } else { + pipe[0] = hServer; + pipe[1] = hClient; + } } static void duplicateStdWriteChannel(Q_PIPE *pipe, DWORD nStdHandle) -- cgit v1.2.3 From 2f284d3632cb786446b0b95bf30afdaaf2c1a7ff Mon Sep 17 00:00:00 2001 From: Robin Burchell Date: Thu, 5 Dec 2013 02:43:53 +0100 Subject: Move notification of layout change up from QApplication to QGuiApplication. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit QGuiApplication-using things (like QtQuick) need to know about this, too -- this makes QGuiApplication::setLayoutDirection actually work. Task-number: QTBUG-21573 Change-Id: I2d2ac7dc07f11be5c7e501a3575b1d0978d8ac31 Reviewed-by: Friedemann Kleint Reviewed-by: Jan Arve Sæther --- src/gui/kernel/qguiapplication.cpp | 5 +++++ src/widgets/kernel/qapplication.cpp | 10 ---------- src/widgets/kernel/qapplication_p.h | 1 - 3 files changed, 5 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index bc4a135e03..1db252ca61 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -2548,6 +2548,11 @@ void QGuiApplication::setFont(const QFont &font) void QGuiApplicationPrivate::notifyLayoutDirectionChange() { + const QWindowList list = QGuiApplication::topLevelWindows(); + for (int i = 0; i < list.size(); ++i) { + QEvent ev(QEvent::ApplicationLayoutDirectionChange); + QCoreApplication::sendEvent(list.at(i), &ev); + } } void QGuiApplicationPrivate::notifyActiveWindowChange(QWindow *) diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp index 9056ffe461..d8c37d6ca0 100644 --- a/src/widgets/kernel/qapplication.cpp +++ b/src/widgets/kernel/qapplication.cpp @@ -1888,16 +1888,6 @@ bool QApplication::event(QEvent *e) \obsolete */ -void QApplicationPrivate::notifyLayoutDirectionChange() -{ - QWidgetList list = QApplication::topLevelWidgets(); - for (int i = 0; i < list.size(); ++i) { - QWidget *w = list.at(i); - QEvent ev(QEvent::ApplicationLayoutDirectionChange); - QCoreApplication::sendEvent(w, &ev); - } -} - /*! \fn void QApplication::setActiveWindow(QWidget* active) diff --git a/src/widgets/kernel/qapplication_p.h b/src/widgets/kernel/qapplication_p.h index 29c6902c78..860e89bb4f 100644 --- a/src/widgets/kernel/qapplication_p.h +++ b/src/widgets/kernel/qapplication_p.h @@ -116,7 +116,6 @@ public: QApplicationPrivate(int &argc, char **argv, int flags); ~QApplicationPrivate(); - virtual void notifyLayoutDirectionChange(); virtual void notifyActiveWindowChange(QWindow *); virtual bool shouldQuit(); -- cgit v1.2.3 From 37f99502f9006c5681686e4a43bc80c2b1d0b089 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Mon, 9 Dec 2013 15:09:29 +0100 Subject: iOS: Fix failing assert in QUIView displayLayer() In layoutSubviews we take the root viewcontroller position into account when determening the new QWindow geometry, but we were missing this logic in displayLayer, and would assert if the in-call statusbar was visible. Since we don't really need the position of the window in displayLayer, we change the assert to only check the size of the exposed area, which is independent of the position of the root viewcontroller. Change-Id: I774b8d9b075518e729f488a789b3a9e584c3f4d3 Reviewed-by: Richard Moe Gustavsen --- src/plugins/platforms/ios/qioswindow.mm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/plugins/platforms/ios/qioswindow.mm b/src/plugins/platforms/ios/qioswindow.mm index 1acd9ee354..7a0ff055ec 100644 --- a/src/plugins/platforms/ios/qioswindow.mm +++ b/src/plugins/platforms/ios/qioswindow.mm @@ -204,11 +204,12 @@ - (void)displayLayer:(CALayer *)layer { - QRect geometry = fromCGRect(layer.frame).toRect(); - Q_ASSERT(m_qioswindow->geometry() == geometry); + QSize bounds = fromCGRect(layer.bounds).toRect().size(); + + Q_ASSERT(m_qioswindow->geometry().size() == bounds); Q_ASSERT(self.hidden == !m_qioswindow->window()->isVisible()); - QRegion region = self.hidden ? QRegion() : QRect(QPoint(), geometry.size()); + QRegion region = self.hidden ? QRegion() : QRect(QPoint(), bounds); QWindowSystemInterface::handleExposeEvent(m_qioswindow->window(), region); QWindowSystemInterface::flushWindowSystemEvents(); } -- cgit v1.2.3 From 4d8a12904a49d6724098610f7e39b11821377b3a Mon Sep 17 00:00:00 2001 From: ABBAPOH Date: Sat, 30 Nov 2013 21:06:57 +0400 Subject: Check if device is opened before trying to create image handler. Change-Id: I60f1f6890fdd73e489da4aab9928370163f55f58 Reviewed-by: Friedemann Kleint Reviewed-by: aavit --- src/gui/image/qimagewriter.cpp | 49 ++++++++++++++++++++++++++++++------------ 1 file changed, 35 insertions(+), 14 deletions(-) (limited to 'src') diff --git a/src/gui/image/qimagewriter.cpp b/src/gui/image/qimagewriter.cpp index 900093b51b..8dd5fdd111 100644 --- a/src/gui/image/qimagewriter.cpp +++ b/src/gui/image/qimagewriter.cpp @@ -245,6 +245,8 @@ class QImageWriterPrivate public: QImageWriterPrivate(QImageWriter *qq); + bool canWriteHelper(); + // device QByteArray format; QIODevice *device; @@ -282,6 +284,31 @@ QImageWriterPrivate::QImageWriterPrivate(QImageWriter *qq) q = qq; } +bool QImageWriterPrivate::canWriteHelper() +{ + if (!device) { + imageWriterError = QImageWriter::DeviceError; + errorString = QT_TRANSLATE_NOOP(QImageWriter, + QLatin1String("Device is not set")); + return false; + } + if (!device->isOpen()) + device->open(QIODevice::WriteOnly); + if (!device->isWritable()) { + imageWriterError = QImageWriter::DeviceError; + errorString = QT_TRANSLATE_NOOP(QImageWriter, + QLatin1String("Device not writable")); + return false; + } + if (!handler && (handler = createWriteHandlerHelper(device, format)) == 0) { + imageWriterError = QImageWriter::UnsupportedFormatError; + errorString = QT_TRANSLATE_NOOP(QImageWriter, + QLatin1String("Unsupported image format")); + return false; + } + return true; +} + /*! Constructs an empty QImageWriter object. Before writing, you must call setFormat() to set an image format, then setDevice() or @@ -561,21 +588,15 @@ void QImageWriter::setText(const QString &key, const QString &text) */ bool QImageWriter::canWrite() const { - if (d->device && !d->handler && (d->handler = createWriteHandlerHelper(d->device, d->format)) == 0) { - d->imageWriterError = QImageWriter::UnsupportedFormatError; - d->errorString = QT_TRANSLATE_NOOP(QImageWriter, - QLatin1String("Unsupported image format")); - return false; + if (QFile *file = qobject_cast(d->device)) { + const bool remove = !file->isOpen() && !file->exists(); + const bool result = d->canWriteHelper(); + if (!result && remove) + file->remove(); + return result; } - if (d->device && !d->device->isOpen()) - d->device->open(QIODevice::WriteOnly); - if (!d->device || !d->device->isWritable()) { - d->imageWriterError = QImageWriter::DeviceError; - d->errorString = QT_TRANSLATE_NOOP(QImageWriter, - QLatin1String("Device not writable")); - return false; - } - return true; + + return d->canWriteHelper(); } /*! -- cgit v1.2.3 From 70c70aef7ee35009bb00614fdd6d4d282f9c4e57 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Wed, 11 Dec 2013 13:14:18 +0100 Subject: Make QTemporaryDir file name more random qrand() returns a number between 0 and RAND_MAX, which is only guaranteed to be bigger than 32767. Dividing it repeatedly means that the last bytes are always 0. [ChangeLog][QtCore][QTemporaryDir] Fixed bug in QTemporaryDir name generator that dramatically reduced randomness of the name. Change-Id: I90613a652e6384296aed827e2714fe63cd8797ee Reviewed-by: Rafael Roquetto Reviewed-by: Tim Jenssen --- src/corelib/io/qtemporarydir.cpp | 39 +++++++++++++++++++++++++-------------- 1 file changed, 25 insertions(+), 14 deletions(-) (limited to 'src') diff --git a/src/corelib/io/qtemporarydir.cpp b/src/corelib/io/qtemporarydir.cpp index 483a76fa82..2c526847b4 100644 --- a/src/corelib/io/qtemporarydir.cpp +++ b/src/corelib/io/qtemporarydir.cpp @@ -94,9 +94,19 @@ static QString defaultTemplateName() return QDir::tempPath() + QLatin1Char('/') + baseName + QLatin1String("-XXXXXX"); } +#if defined(Q_OS_QNX ) || defined(Q_OS_WIN) || defined(Q_OS_ANDROID) + +static int nextRand(int &v) +{ + int r = v % 62; + v /= 62; + if (v < 62) + v = qrand(); + return r; +} + static char *q_mkdtemp(char *templateName) { -#if defined(Q_OS_QNX ) || defined(Q_OS_WIN) || defined(Q_OS_ANDROID) static const char letters[] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; const size_t length = strlen(templateName); @@ -110,16 +120,11 @@ static char *q_mkdtemp(char *templateName) int v = qrand(); /* Fill in the random bits. */ - XXXXXX[0] = letters[v % 62]; - v /= 62; - XXXXXX[1] = letters[v % 62]; - v /= 62; - XXXXXX[2] = letters[v % 62]; - v /= 62; - XXXXXX[3] = letters[v % 62]; - v /= 62; - XXXXXX[4] = letters[v % 62]; - v /= 62; + XXXXXX[0] = letters[nextRand(v)]; + XXXXXX[1] = letters[nextRand(v)]; + XXXXXX[2] = letters[nextRand(v)]; + XXXXXX[3] = letters[nextRand(v)]; + XXXXXX[4] = letters[nextRand(v)]; XXXXXX[5] = letters[v % 62]; QString templateNameStr = QFile::decodeName(templateName); @@ -137,11 +142,17 @@ static char *q_mkdtemp(char *templateName) } } return 0; -#else - return mkdtemp(templateName); -#endif } +#else // defined(Q_OS_QNX ) || defined(Q_OS_WIN) || defined(Q_OS_ANDROID) + +static char *q_mkdtemp(char *templateName) +{ + return mkdtemp(templateName); +} + +#endif + void QTemporaryDirPrivate::create(const QString &templateName) { QByteArray buffer = QFile::encodeName(templateName); -- cgit v1.2.3 From 444914839541154b0927cd1d49890677b8368148 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Thu, 12 Dec 2013 17:30:44 +0100 Subject: QMetaType: Rename template type of type-erased iterator operations. This struct is a specialization for the case that the const_iterator is a pointer to the value type. Reflect that in the type name. Change-Id: I0a4ac03840658056285080860baec8313746c71c Reviewed-by: Simon Hausmann --- src/corelib/kernel/qmetatype.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/corelib/kernel/qmetatype.h b/src/corelib/kernel/qmetatype.h index a2e6960949..06adf7cffd 100644 --- a/src/corelib/kernel/qmetatype.h +++ b/src/corelib/kernel/qmetatype.h @@ -805,17 +805,17 @@ struct IteratorOwner return &*it; } }; -template -struct IteratorOwner +template +struct IteratorOwner { - static void assign(void **ptr, const const_iterator *iterator ) + static void assign(void **ptr, const value_type *iterator ) { - *ptr = const_cast(iterator); + *ptr = const_cast(iterator); } static void advance(void **iterator, int step) { - const_iterator *it = static_cast(*iterator); + value_type *it = static_cast(*iterator); std::advance(it, step); *iterator = it; } @@ -829,7 +829,7 @@ struct IteratorOwner return *iterator; } - static const void *getData(const const_iterator *it) + static const void *getData(const value_type *it) { return it; } -- cgit v1.2.3 From 0da7e0fa8fa0f4e216899e24b3cedf1e09759628 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Thu, 12 Dec 2013 17:33:09 +0100 Subject: QMetaType: Fix copy of type erased iterator Behavior differs depending on whether the iterator is a value_type*, or a different class entirely. Ensure that the correct behavior is used when copying. Task-number: QTBUG-33997 Change-Id: Ib6db2a3c4a5aa861b851833a7f0ecb855a3e828f Reviewed-by: Simon Hausmann --- src/corelib/kernel/qmetatype.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/corelib/kernel/qmetatype.h b/src/corelib/kernel/qmetatype.h index 06adf7cffd..986d22b5a6 100644 --- a/src/corelib/kernel/qmetatype.h +++ b/src/corelib/kernel/qmetatype.h @@ -783,6 +783,10 @@ struct IteratorOwner { *ptr = new const_iterator(iterator); } + static void assign(void **ptr, void * const * src) + { + *ptr = new const_iterator(*static_cast(*src)); + } static void advance(void **iterator, int step) { @@ -812,6 +816,10 @@ struct IteratorOwner { *ptr = const_cast(iterator); } + static void assign(void **ptr, void * const * src) + { + *ptr = static_cast(*src); + } static void advance(void **iterator, int step) { @@ -942,7 +950,7 @@ public: template static void copyIterImpl(void **dest, void * const * src) - { IteratorOwner::assign(dest, *static_cast(*src)); } + { IteratorOwner::assign(dest, src); } public: template QSequentialIterableImpl(const T*p) @@ -1122,7 +1130,7 @@ public: template static void copyIterImpl(void **dest, void * const * src) - { IteratorOwner::assign(dest, *static_cast(*src)); } + { IteratorOwner::assign(dest, src); } public: template QAssociativeIterableImpl(const T*p) -- cgit v1.2.3 From b7cb0613f0dc92a5abfd7eedc44ba9f0ee310cae Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Thu, 12 Dec 2013 17:45:34 +0100 Subject: QMetaType: Fix equality comparison of type-erased iterators. Task-number: QTBUG-33997 Change-Id: I0d4da562540df0e3732769881ba124cb980f6b82 Reviewed-by: Simon Hausmann --- src/corelib/kernel/qmetatype.h | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/corelib/kernel/qmetatype.h b/src/corelib/kernel/qmetatype.h index 986d22b5a6..745487627e 100644 --- a/src/corelib/kernel/qmetatype.h +++ b/src/corelib/kernel/qmetatype.h @@ -808,6 +808,11 @@ struct IteratorOwner { return &*it; } + + static bool equal(void * const *it, void * const *other) + { + return *static_cast(*it) == *static_cast(*other); + } }; template struct IteratorOwner @@ -841,6 +846,11 @@ struct IteratorOwner { return it; } + + static bool equal(void * const *it, void * const *other) + { + return static_cast(*it) == static_cast(*other); + } }; enum IteratorCapability @@ -942,7 +952,7 @@ public: template static bool equalIterImpl(void * const *iterator, void * const *other) - { return *static_cast(*iterator) == *static_cast(*other); } + { return IteratorOwner::equal(iterator, other); } template static VariantData getImpl(void * const *iterator, int metaTypeId, uint flags) @@ -1126,7 +1136,7 @@ public: template static bool equalIterImpl(void * const *iterator, void * const *other) - { return *static_cast(*iterator) == *static_cast(*other); } + { return IteratorOwner::equal(iterator, other); } template static void copyIterImpl(void **dest, void * const * src) -- cgit v1.2.3 From 9b621f38619d8d9b3e61723f4cd4e821f909697a Mon Sep 17 00:00:00 2001 From: Robin Burchell Date: Fri, 13 Dec 2013 12:36:45 +0100 Subject: Partially revert "Move notification of layout change up from QApplication to QGuiApplication." We can't rely on QGuiApplication::topLevelWindows containing top level QWidgets, because they only exist as actual windows once QWidgetPrivate::create_sys is called. Thus, make sure to send notifications to all top level widgets, if a QApplication is being used. This reverts commit f82ed5b3e30282bb8dc1da321a0d04ad4d463e59. Task-number: QTBUG-35589 Change-Id: Iac517089af1c22f20094ba6e185d5ed44ebe3d6f Reviewed-by: Friedemann Kleint --- src/widgets/kernel/qapplication.cpp | 25 +++++++++++++++++++++++++ src/widgets/kernel/qapplication_p.h | 1 + 2 files changed, 26 insertions(+) (limited to 'src') diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp index d8c37d6ca0..c9d6593662 100644 --- a/src/widgets/kernel/qapplication.cpp +++ b/src/widgets/kernel/qapplication.cpp @@ -1888,6 +1888,31 @@ bool QApplication::event(QEvent *e) \obsolete */ +// ### FIXME: topLevelWindows does not contain QWidgets without a parent +// until create_sys is called. So we have to override the +// QGuiApplication::notifyLayoutDirectionChange +// to do the right thing. +void QApplicationPrivate::notifyLayoutDirectionChange() +{ + const QWidgetList list = QApplication::topLevelWidgets(); + QWindowList windowList = QGuiApplication::topLevelWindows(); + + // send to all top-level QWidgets + for (int i = 0; i < list.size(); ++i) { + QWidget *w = list.at(i); + windowList.removeAll(w->windowHandle()); + QEvent ev(QEvent::ApplicationLayoutDirectionChange); + QCoreApplication::sendEvent(w, &ev); + } + + // in case there are any plain QWindows in this QApplication-using + // application, also send the notification to them + for (int i = 0; i < windowList.size(); ++i) { + QEvent ev(QEvent::ApplicationLayoutDirectionChange); + QCoreApplication::sendEvent(windowList.at(i), &ev); + } +} + /*! \fn void QApplication::setActiveWindow(QWidget* active) diff --git a/src/widgets/kernel/qapplication_p.h b/src/widgets/kernel/qapplication_p.h index 860e89bb4f..29c6902c78 100644 --- a/src/widgets/kernel/qapplication_p.h +++ b/src/widgets/kernel/qapplication_p.h @@ -116,6 +116,7 @@ public: QApplicationPrivate(int &argc, char **argv, int flags); ~QApplicationPrivate(); + virtual void notifyLayoutDirectionChange(); virtual void notifyActiveWindowChange(QWindow *); virtual bool shouldQuit(); -- cgit v1.2.3 From fc10bfd55035d27c9352c1678c3aad87c4be2e09 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Wed, 27 Nov 2013 16:10:20 +0100 Subject: Correct debug bit setting with WGL No need to tie the debug bit to OpenGL 3.0+. xcb is correct in this respect, let's correct the windows plugin too. Change-Id: I13ea48de067d3fb61575be8f71b97bb547d8eb02 Reviewed-by: Friedemann Kleint Reviewed-by: Gunnar Sletta --- src/plugins/platforms/windows/qwindowsglcontext.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/plugins/platforms/windows/qwindowsglcontext.cpp b/src/plugins/platforms/windows/qwindowsglcontext.cpp index b7de368fa8..82deb0f473 100644 --- a/src/plugins/platforms/windows/qwindowsglcontext.cpp +++ b/src/plugins/platforms/windows/qwindowsglcontext.cpp @@ -586,15 +586,17 @@ static HGLRC createContext(const QOpenGLStaticContext &staticContext, attributes[attribIndex++] = WGL_CONTEXT_MINOR_VERSION_ARB; attributes[attribIndex++] = minorVersion; } + + int flags = 0; + if (format.testOption(QSurfaceFormat::DebugContext)) + flags |= WGL_CONTEXT_DEBUG_BIT_ARB; if (requestedVersion >= 0x0300) { - attributes[attribIndex++] = WGL_CONTEXT_FLAGS_ARB; - attributes[attribIndex] = 0; if (!format.testOption(QSurfaceFormat::DeprecatedFunctions)) - attributes[attribIndex] |= WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB; - if (format.testOption(QSurfaceFormat::DebugContext)) - attributes[attribIndex] |= WGL_CONTEXT_DEBUG_BIT_ARB; - attribIndex++; + flags |= WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB; } + attributes[attribIndex++] = WGL_CONTEXT_FLAGS_ARB; + attributes[attribIndex++] = flags; + if (requestedVersion >= 0x0302) { switch (format.profile()) { case QSurfaceFormat::NoProfile: -- cgit v1.2.3 From a935b3fbd8297e6e2ae6ffdf8ed2790fdf0d46f1 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 10 Dec 2013 17:42:22 +0100 Subject: Windows: Fix printing. Clear custom paper size flag in QWin32PrintEnginePrivate::updateCustomPaperSize(). Breakage introduced by 3396ba5612c1047d1b21a90c4996dff848c00114 . Task-number: QTBUG-35500 Change-Id: I7e7708444cd7201af35e0f5d9b16d6c73fee77f6 Reviewed-by: John Layt --- src/printsupport/kernel/qprintengine_win.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/printsupport/kernel/qprintengine_win.cpp b/src/printsupport/kernel/qprintengine_win.cpp index 67e7c34fca..fc462e9a0a 100644 --- a/src/printsupport/kernel/qprintengine_win.cpp +++ b/src/printsupport/kernel/qprintengine_win.cpp @@ -1959,8 +1959,9 @@ static void draw_text_item_win(const QPointF &pos, const QTextItemInt &ti, HDC h void QWin32PrintEnginePrivate::updateCustomPaperSize() { const uint paperSize = devMode->dmPaperSize; - has_custom_paper_size = true; + has_custom_paper_size = false; if (paperSize > 0 && mapDevmodePaperSize(paperSize) == QPrinter::Custom) { + has_custom_paper_size = true; const QList > paperSizes = printerPaperSizes(name); for (int i=0; i Date: Mon, 16 Dec 2013 12:17:33 +0800 Subject: Fix QBackingStore object leaking Check q->isTopLevel() before calling setBackingStore() in QWidgetPrivate::create_sys() to prevent QBackingStore leaking. This is because QWidget::setBackingStore() will return if isTopLevel() is true and the newly created QBackingStore object will be leaked. Change-Id: I2777acd4c317d5019f5b266feae005042026b8be Reviewed-by: Friedemann Kleint --- src/widgets/kernel/qwidget_qpa.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/widgets/kernel/qwidget_qpa.cpp b/src/widgets/kernel/qwidget_qpa.cpp index 93234f3958..3b6127e4e7 100644 --- a/src/widgets/kernel/qwidget_qpa.cpp +++ b/src/widgets/kernel/qwidget_qpa.cpp @@ -148,10 +148,12 @@ void QWidgetPrivate::create_sys(WId window, bool initializeWindow, bool destroyO QBackingStore *store = q->backingStore(); if (!store) { - if (win && q->windowType() != Qt::Desktop) - q->setBackingStore(new QBackingStore(win)); - else + if (win && q->windowType() != Qt::Desktop) { + if (q->isTopLevel()) + q->setBackingStore(new QBackingStore(win)); + } else { q->setAttribute(Qt::WA_PaintOnScreen, true); + } } setWindowModified_helper(); -- cgit v1.2.3