summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-10-277-66/+176
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/platforms/ios/ios.pro src/plugins/platforms/ios/kernel.pro src/plugins/platforms/ios/optional/nsphotolibrarysupport/qiosfileengineassetslibrary.h src/plugins/platforms/ios/optional/nsphotolibrarysupport/qiosfileengineassetslibrary.mm src/plugins/platforms/ios/optional/nsphotolibrarysupport/qiosfileenginefactory.h src/plugins/platforms/ios/qiosintegration.h src/widgets/widgets/qcombobox.cpp tests/auto/widgets/dialogs/qwizard/tst_qwizard.cpp tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp Change-Id: Ibaee7cbbba99e7c4b1d8926e55932ffa6030ce45
| * Autotest: fix silly mistake in assigning where a comparison was intendedThiago Macieira2016-10-251-1/+1
| | | | | | | | | | | | | | | | | | The file descriptor has been closed and this test is checking if we get EBADF. Change-Id: I33dc971f005a4848bb8ffffd1478eaffd99aa2e9 Reviewed-by: Jake Petroules <jake.petroules@qt.io> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
| * QCocoaMenuBar: Update even if no window is attachedGabriel de Dietrich2016-10-243-0/+73
| | | | | | | | | | | | | | | | | | | | | | | | | | Then we need to check if the current active (or focused) window has any menubar associated. In case there isn't, and the menubar has no window associated, then we should update immediately. The previous condition is still valid. Change-Id: I4532ccc87354d91c76b53f5433dc3944b9e29584 Task-number: QTBUG-56275 Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
| * Darwin: normalize all watched paths to composed fromErik Verbruggen2016-10-241-0/+21
| | | | | | | | | | | | | | | | | | | | This will be done by all POSIX APIs for strings coming in that way, but because other code (like NSWhateverViews) will most likely return decomposed form, we make sure that those are in composed form too. Task-number: QTBUG-55896 Change-Id: I065e11cee6b59706d4346ed20d4b59b9b95163b8 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
| * Plug leaks in tst_QWizardMarc Mutz2016-10-221-46/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This completely over-engineered piece of code has a hierarchy of Operation subclasses encapsulating but three actual operations on a QWizard. Because these operations and their containers were all allocated on the heap, but never deleted, asan went crazy and reported over 50 leaks (not the record so far, but a (distant) second). Since these collections are passed through addColumn/QFETCH, too, it's nearly impossible to track their lifetimes. So instead of trying, delegate that to the runtime, ie. pack the Operation objects into QSharedPointer and pass around those instead. Change-Id: I8a0fe7a60cd30aed618667affaa030e80cf2b1ac Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Sérgio Martins <sergio.martins@kdab.com>
| * tst_QGraphicsItem: plug remaining leaksMarc Mutz2016-10-221-19/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Store QGraphicsItems that are either not added to a scene or removed from it again and that are also not children of other items - iow: those that were leaked, even on successful runs of the tests, in either a QScopedPointer, or, where that'd cause too much churn due to adding of .data() calls, back the pointer by a stack-allocated object. This fixes the remaining leaks reported by GCC 6.2.1's ASan on successful runs of tests/auto/widgets/graphicsview/qgraphicsitem. Change-Id: I61c3a1cd39b9e96e83c5d7b8cf392e0b26ecbaf0 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Sérgio Martins <sergio.martins@kdab.com>
* | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-10-228-24/+107
|\| | | | | | | | | | | | | Conflicts: src/plugins/platforms/eglfs/qeglfshooks.cpp Change-Id: I483f0dbd876943b184803f0fe65a0c686ad75db2
| * Plug remaining leaks in tests/auto/widgets/kernelMarc Mutz2016-10-213-15/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The usual: - delete return values of QLayout::takeAt(), replaceWidget() - delete styles - delete top-level widgets - delete actions Either by naked delete, QScopedPointer or allocation on the stack instead of the heap. This fixes the remaining errors in GCC 6.1 Linux ASan runs of tests/auto/widgets/kernel. Change-Id: I8cc217be114b2e0edf34ad8d60dbf722f900bb7f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * Normalize realpath(3) output to composed formErik Verbruggen2016-10-211-0/+13
| | | | | | | | | | | | | | | | | | | | | | All strings coming out of POSIX API calls are converted to composed form by QFile::decodeName. Do the same for realpath(3) output. This is especially important for HFS+, which will store file names in decomposed form, and APIs will therefore return strings in decomposed form. Task-number: QTBUG-55896 Change-Id: I5e51f4e5712ff26bf9644cbcf9a9603995748892 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
| * QUrl effective TLDs: update tableKai Koehne2016-10-211-7/+7
| | | | | | | | | | | | | | | | | | | | There are more than 1000 new entries since the table has been generated the last time. The autotest needs to be tweaked because the rules for the .mz domains have changed; use the .ck domain instead. Change-Id: Ife692afd46ac41a66604e966e5e8cb57c7aa649c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * Don't crash while parsing malformed CSSSérgio Martins2016-10-191-0/+1
| | | | | | | | | | | | Task-Id: QTBUG-53919 Change-Id: I31a0e218e4e41ee217f8f87164f115450d69d42c Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| * xcb: fix passing of focus from child to its top level QWindowClinton Stimpson2016-10-191-1/+19
| | | | | | | | | | | | | | | | | | | | | | | | With the client message _NET_ACTIVE_WINDOW, not all window managers will pass focus from a child window to its root window, Detect this child-to-root case, and use xcb_set_input_focus() instead. Task-number: QTBUG-39362 Change-Id: Ib32193018e3b725b323f87d7306c9ae9493d78a7 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
| * Apple OS: Handle QSetting strings with embedded zero-bytesTor Arne Vestbø2016-10-181-1/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Saving strings with embedded zero-bytes (\0) as CFStrings would sometimes fail, and only write the part of the string leading up to the first zero-byte, instead of all the way to the final zero-terminator. This bug was revealed by the code-path that falls back to storing e.g. QTime as strings, via the helper method QSettingsPrivate::variantToString(). We now use the same approach as on platforms such as Windows and WinRT, where the string produced by variantToString() is checked for null-bytes, and if so, stored using a binary representation instead of as a string. For our case that means we fall back to CFData when detecting the null-byte. To separate strings from regular byte arrays, new logic has been added to variantToString() that wraps the null-byte strings in @String(). That way we can implement a fast-path when converting back from CFData, that doesn't go via the slow and lossy conversion via UTF8, and the resulting QVariant will be of type QVariant::ByteArray. The reason for using UTF-8 as the binary representation of the string is that in the case of storing a QByteArray("@foo") we need to still be able to convert it back to the same byte array, which doesn't work if the on-disk format is UTF-16. Task-number: QTBUG-56124 Change-Id: Iab2f71cf96cf3225de48dc5e71870d74b6dde1e8 Cherry-picked: 764f5bf48cc87f4c72550b853ab93b815454cd48 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-10-171-0/+28
|\| | | | | | | | | | | | | | | Conflicts: mkspecs/macx-ios-clang/features/resolve_config.prf src/testlib/qtestcase.qdoc Change-Id: Icefa63056ffb37106f35299a8f19165535571799
| * Unset qgl_current_fbo when the default FBO is boundAlexandru Croitor2016-10-131-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously when a new QOpenGLFramebufferObject was bound, the QOpenGLContextPrivate::qgl_current_fbo member was also updated to point to this new object. But if a user called QOpenGLFramebufferObject::bindDefault(), qgl_current_fbo was not unset, meaning that if the FBO object would be deleted at some point, qgl_current_fbo would be a dangling pointer. This patch makes sure to clear the value of qgl_current_fbo when bindDefault() is called. It is cleared, and not set to point to another object because the default platform OpenGL FBO is not backed by a QOpenGLFramebufferObject. Task-number: QTBUG-56296 Change-Id: I68b53d8b446660accdf5841df3d168ee2f133a90 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-10-135-20/+41
|\| | | | | | | | | | | | | | | | | | | | | Also bump minimum required Qt version for Android: Ministro updates. Conflicts: src/android/java/src/org/qtproject/qt5/android/bindings/QtActivityLoader.java src/android/java/src/org/qtproject/qt5/android/bindings/QtLoader.java src/plugins/platforms/android/androidjnimain.cpp Change-Id: I966f249bebf92da37bfdeb995ad21b027eb03301
| * Fix illegal memory access on simple image rotatesAllan Sandfeld Jensen2016-10-121-0/+19
| | | | | | | | | | | | | | | | | | | | Clip the transformed and rounded sourceClip to the source rectangle, so we don't try to rotate pixels outside the source. Task-number: QTBUG-56252 Change-Id: Ib9cb80f9856724118867aea37ead0b02a6c71495 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
| * Blacklist tst_MacNativeEvents::testMouseEnterAllan Sandfeld Jensen2016-10-121-2/+1
| | | | | | | | | | | | | | | | It is already blacklisted for 10.8 and 10.9, and is now failing on 10.11 blocking integration. Change-Id: I71b8119ab32ec64096bfc53d5e521714ad4ae11b Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| * tst_QWidget: Fix UB (invalid member access) in ↵Marc Mutz2016-10-121-7/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | EnterTestMainDialog::eventFilter() Found by UBSan: tst_qwidget.cpp:10207:29: runtime error: member access within address 0x6060000e8880 which does not point to an object of type 'EnterTestModalDialog' 0x6060000e8880: note: object is of type 'QWidget' eb 00 80 45 10 4b 32 ab 11 2b 00 00 80 df 08 00 60 61 00 00 c0 4c 32 ab 11 2b 00 00 00 00 be be ^~~~~~~~~~~~~~~~~~~~~~~ vptr for 'QWidget' #0 0x6ca13f in EnterTestMainDialog::eventFilter(QObject*, QEvent*) tst_qwidget.cpp:10207 #1 0x2b11b8bc90c3 in QCoreApplicationPrivate::sendThroughApplicationEventFilters(QObject*, QEvent*) qcoreapplication.cpp:1081 #2 0x2b11a3c49b4a in QApplicationPrivate::notify_helper(QObject*, QEvent*) qapplication.cpp:3716 #3 0x2b11a3c8ec72 in QApplication::notify(QObject*, QEvent*) qapplication.cpp:3704 #4 0x2b11b8bccd0f in QCoreApplication::notifyInternal2(QObject*, QEvent*) qcoreapplication.cpp:988 #5 0x2b11aea5c34d in QCoreApplication::sendEvent(QObject*, QEvent*) qcoreapplication.h:231 #6 0x2b11aea5c34d in QGuiApplicationPrivate::_q_updateFocusObject(QObject*) qguiapplication.cpp:3690 #7 0x2b11aea61360 in QGuiApplication::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) .moc/moc_qguiapplication.cpp:177 #8 0x2b11b8d1dc86 in QMetaObject::activate(QObject*, int, int, void**) qobject.cpp:3787 #9 0x2b11aea784a3 in QWindow::focusObjectChanged(QObject*) .moc/moc_qwindow.cpp:760 #10 0x2b11a3fb24f2 in QWidget::clearFocus() qwidget.cpp:6705 #11 0x2b11a3fc87b1 in QWidget::~QWidget() qwidget.cpp:1608 #12 0x2b11a526688c in QDialog::~QDialog() qdialog.cpp:352 #13 0x6c43e2 in EnterTestModalDialog::~EnterTestModalDialog() tst_qwidget.cpp:10160 #14 0x6c43e2 in EnterTestModalDialog::~EnterTestModalDialog() tst_qwidget.cpp:10160 #15 0x492be3 in EnterTestMainDialog::buttonPressed() tst_qwidget.cpp:10188 #16 0x492be3 in EnterTestMainDialog::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) .moc/tst_qwidget.moc:2056 #17 0x2b11b8d1dc86 in QMetaObject::activate(QObject*, int, int, void**) qobject.cpp:3787 #18 0x2b11a45cb833 in QAbstractButton::clicked(bool) .moc/moc_qabstractbutton.cpp:307 #19 0x2b11a45cd54b in QAbstractButtonPrivate::emitClicked() qabstractbutton.cpp:411 #20 0x2b11a45df73a in QAbstractButtonPrivate::click() qabstractbutton.cpp:404 [...] #41 0x6bb2cf in tst_QWidget::taskQTBUG_27643_enterEvents() tst_qwidget.cpp:10249 [...] Fix by checking the event type first, and accessing modal->button only if it's QEvent::Enter. Change-Id: I2c7df3a1f43ecbfe14741b5861729078a91a32d6 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| * Plug more than 4k leaks in tst_QGraphicsViewMarc Mutz2016-10-111-5/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The vast majority is due to leaking styles in a data-driven test with almost 100 rows (scrollBarRanges()). Fix by creating the style into a QScopedPointer. The remaining ~500 leaks were due to leaked QGraphicsScenes. They had no parent, and QGraphicsView::addScene() does not adopt them. Fix those by passing the resp. view as their (QObject) parent. Change-Id: I4316798019114ea3d7504d72cd83d534a21149c0 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
| * Plug leaks in tst_QXmlSimpleReaderMarc Mutz2016-10-101-6/+6
| | | | | | | | | | | | | | | | | | | | | | The QXmlInputSource objects were allocated on the heap, but never deleted. Fix by allocating them on the stack instead. Change-Id: Ifd8bd41d778c0634b7a426bbd22a367dfce511c9 Reviewed-by: David Faure <david.faure@kdab.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-10-084-2/+83
|\| | | | | | | | | | | | | | | Conflicts: src/network/access/qhttpnetworkconnection.cpp src/network/access/qhttpnetworkconnection_p.h Change-Id: I11f8641ef482efa8cee1b79977d19cc3182814b4
| * QAbstractItemView: use only a 1x1 QRect for selecting on mouse pressFrank Reininghaus2016-10-071-0/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before commit f1e90768095be37419ba4bf3c69ec5c860bdbcb6, mousePressEvent called the virtual method setSelection(const QRect&, SelectionFlags) with the 1x1 rectangle which contains only the clicked QPoint, unless the SelectionFlag "Current" was set because Shift was pressed during the mouse press. Since that commit, the behavior has been changed such that the rectangle is the one that is spanned by the center of the clicked item and the clicked pixel. In theory, the result should be the same (i.e., only the clicked item should be selected), but * the code path in QListView::setSelection for 1x1 QRects is more efficient, and * using a larger QRect can cause problems with custom views, see the comments in QTBUG-18009 This commit ensures that the 1x1 QRect is used again, unless the SelectionFlag "Current" is used. Change-Id: I70dd70c083c20a3af6cd6095aa89a489756b505f Task-number: QTBUG-18009 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
| * QPixmap::load: ensure QBitmap stays a QBitmap even on failureMarc Mutz2016-10-061-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ... and avoid detach()ing potentially large data for just preserving the QPlatformPixmap::pixelType(). A QBitmap differs from a QPixmap (its base class, urgh) by always having a data != nullptr and a Bitmap pixel type, yet load() was unconditionally setting 'data' to nullptr on failure, turning a QBitmap into a non-QBitmap. Fix by move-assigning a null QBitmap instead of resetting 'data'. Add some tests. Change-Id: Ida58b3b24d96472a5f9d0f18f81cc763edcf3c16 Reviewed-by: Anton Kudryavtsev <a.kudryavtsev@netris.ru> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
| * tst_QShortcut: Fix UB (invalid cast) in shortcutDestroyed()Marc Mutz2016-10-051-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The slot is invoked from QObject::destroyed(), which is emitted from ~QObject. By that time the object is no longer a QShortcut, so the static_cast it invalid. Found by UBSan: tst_qshortcut.cpp:1210:53: runtime error: downcast of address 0x6020000289d0 which does not point to an object of type 'QShortcut' 0x6020000289d0: note: object is of type 'QObject' 10 00 80 17 c0 ce 63 df 93 2b 00 00 b0 02 00 00 d0 60 00 00 02 00 00 00 ff ff ff 04 04 00 00 00 ^~~~~~~~~~~~~~~~~~~~~~~ vptr for 'QObject' #0 0x42b3bb in tst_QShortcut::shortcutDestroyed(QObject*) tst_qshortcut.cpp:1210 #1 0x446cc9 in tst_QShortcut::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) .moc/tst_qshortcut.moc:186 #2 0x2b93dba52c86 in QMetaObject::activate(QObject*, int, int, void**) qobject.cpp:3787 #3 0x2b93dba55400 in QObject::destroyed(QObject*) .moc/moc_qobject.cpp:213 #4 0x2b93dba8d80d in QObject::~QObject() qobject.cpp:967 #5 0x2b93c6b6e032 in QShortcut::~QShortcut() qshortcut.cpp:476 #6 0x2b93c6b6e370 in QShortcut::~QShortcut() qshortcut.cpp:481 #7 0x42a5de in void qDeleteAll<QList<QShortcut*>::const_iterator>(QList<QShortcut*>::const_iterator, QList<QShortcut*>::const_iterator) qalgorithms.h:317 #8 0x42a5de in void qDeleteAll<QList<QShortcut*> >(QList<QShortcut*> const&) qalgorithms.h:325 #9 0x42a5de in tst_QShortcut::clearAllShortcuts() tst_qshortcut.cpp:1136 Fix by replacing QVector::replaceAll() with the erase-remove idiom, which does not require the cast, because it can perform mixed-type lookups. Change-Id: I4251c1895fa4398023f489dbfd7108d90c1a6c94 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
| * Plug memleak in tst_QStackedWidgetMarc Mutz2016-10-051-1/+2
| | | | | | | | | | | | | | | | | | To keep the change minimal, keep 'sw' as a pointer variable, but back it by a stack-allocated QStackedWidget instead of a heap-allocated one that's never deleted. Change-Id: I9e2a8c07979b861eb7e7040c144d8e75c90d0bc9 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-10-054-41/+29
|\| | | | | | | Change-Id: I34b5e290233d0869fbafac094a939aec2bf83fd5
| * Fix some typos and minor sentence structure issues in docsFrederik Schwarzer2016-10-051-1/+1
| | | | | | | | | | Change-Id: Ibede1aeb046e2df6723e3041152bfae22a9fde32 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * Plug remaining leaks in tests/auto/widgets/utilMarc Mutz2016-10-023-40/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In tst_QCompleter, two completers were leaked because they had no parent and setCompleter() calls don't reparent. Fixed by giving them parents. In tst_QUndo*, fix lots of leaked QActions by storing them in a QScopedPointer. There were some half-hearted attempts to clean them up with manual deletes, but I ported these to scoped pointers, too, to make the code more robust in the face of failures. This fixes the remaining errors in GCC 6.1 Linux ASan runs of tests/auto/widgets/util. Change-Id: Icc5248cc9cf4514540915924df1c4d9e09c071fa Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | BIC data files for QtBase for Qt 5.7Milla Pohjanheimo2016-10-0311-0/+96381
| | | | | | | | | | | | | | Added the binary compatibility test data files for Qt 5.7 for QtBase Change-Id: I5b19571f5e266c52622027d820062afa5fd4fbf3 Reviewed-by: Sergio Ahumada <sahumada@texla.cl>
* | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-10-0114-28/+92762
|\| | | | | | | | | | | | | | | | | Conflicts: mkspecs/features/mac/default_pre.prf mkspecs/macx-ios-clang/features/resolve_config.prf qtbase.pro Change-Id: I65b5ebca4942a4f295bdd4ac1568e5c347333aea
| * Data files for binary compatibility tests updated for Qt 5.6Milla Pohjanheimo2016-09-3011-0/+92679
| | | | | | | | | | | | | | | | | | The generated data files for the binary compatibility test updated for QtBase. Change-Id: Idae703c83f55ff17cada4419db742ea12b22bf86 Reviewed-by: Sergio Ahumada <sahumada@texla.cl> Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
| * Plug remaining leaks in tests/auto/widgets/styleMarc Mutz2016-09-301-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The usual: - delete styles Either by using QScopedPointer. This fixes the remaining errors in GCC 6.1 Linux ASan runs of tests/auto/widgets/styles. Change-Id: Ifba59085c057d474bf964cbb93010c408d773a61 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| * tst_QAbstractSlider: fix strict-aliasing warningsMarc Mutz2016-09-301-25/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GCC warned: tst_qabstractslider.cpp:858:89: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] Qt::Orientation orientation = *reinterpret_cast<Qt::Orientation*>(&sliderOrientation); ^ tst_qabstractslider.cpp:867:72: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] orientation = *reinterpret_cast<Qt::Orientation*>(&wheelOrientation); ^ The solution, of course, would be to use a static_cast here, but why go via int in the first place? Qt::Orientation can perfectly well be used in QFETCH, as proven by tst_qmainwindow, among other things. Change-Id: I97916a50405e16d114837bc52580ce6666d74b17 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| * Fix crash when doing many text layouts with superscript/subscriptEskil Abrahamsen Blomfeldt2016-09-291-0/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After e109b8a0f3c89c595f0da689e7ee847130e2ee47, it is possible that the cache will be flushed as a result of inserting a new font rather than just when the timer event triggers. When doing superscript and subscript text layouts, we would first get a regular font engine, then a scaled one, and then reference the regular font engine *after* getting the scaled one. If the regular font engine was deleted as a result of inserting the scaled one, we would get a dangling pointer and crash. The situation was improved by 49926bb9ef983d4c19aed635a00b388252c065e4. You would now to switch between 256 different fonts in the layout in order to trigger it. The test in the commit will trigger the crash even with this change. [ChangeLog][Qt Gui][Text] Fixed a crash that could happen if you were doing many different text layouts with different fonts and superscript or subscript alignment. Task-number: QTBUG-53911 Change-Id: Ia33108252e030eff25924ef1b7c10b9d59b5bc8c Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Fix tst_QFiledialog::widgetlessNativeDialog()J-P Nurmi2016-09-301-0/+1
| | | | | | | | | | | | | | | | Restore Qt::AA_DontUseNativeDialogs that is disabled in the beginning of the test function. Change-Id: I4ff8eab4ecc458c478337824e66b5a59fbdd7c65 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-09-288-30/+190
|\| | | | | | | | | | | | | | | | | Conflicts: src/widgets/dialogs/qcolordialog.cpp src/widgets/dialogs/qfiledialog.cpp tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp Change-Id: I34bc8a990f8f526889a95a5c7099ef557b9681ad
| * Plug memleaks in tst_QWidgetMarc Mutz2016-09-281-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | We need to delete the style returned from QStyleFactory::create() ourselves, so put them into a QScopedPointer. The alternative would have been to create this once, as a member of tst_QWidget, but this is the minimal approach that ensures behavior just as the old code, but without the leak. Change-Id: I527f1031c57be6f05942f4acc057e7dae1af2571 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * tst_QApplication: Fix UBs (invalid cast) in focusMouseClick()Marc Mutz2016-09-281-22/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Found by UBSan: tst_qapplication.cpp:1754:48: runtime error: member access within address 0x7ffda11f2220 which does not point to an object of type 'SpontaneousEvent' 0x7ffda11f2220: note: object is of type 'QMouseEvent' The code attempted to model the layout of a QEvent with another class that allows public access to the memory location that (hopefully) corresponds to QEvent::spont, gaining access by casting a QEvent object to that specifically-crafted class. Fix by the using the existing QSpontaneKeyEvent::setSpontaneous() call, which, despite its name, works for all QEvent subclasses, and which has already been fixed to not invoke UB (in bc087db). Change-Id: I7db8b8a8a823f7d61ab17375142d19dc3874fea5 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| * Extend tested formats in lancelotAllan Sandfeld Jensen2016-09-271-0/+26
| | | | | | | | | | | | | | | | | | | | Adds two formats that does not have optimized code-paths in qdrawhelper to ensure the generic path has coverage. This has already uncovered one bug fixed before this patch could go in. Change-Id: I0e0a1a873555b27f6438f69a76982b8e06263dcf Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
| * QDateTimeEdit: synchronize time-spec before initializing displayEdward Welbourne2016-09-271-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QDateTimeEdit ignores the time-spec of its date-time value, using its own time-spec instead; mostly, this works because it first conforms the value to its own time-spec. However, during construction, before doing this, it set up its display data, which could leave it with a different time (rather than a different representation of the given time) than it was asked to use. Moved the updateTimeSpec() calls to immediately after setting value in QDateTimeEditPrivate::init() to ensure correct handling. Added test. Task-number: QTBUG-54781 Change-Id: I3b07c10997abb858fc0b40558bff96e3fdabbd83 Reviewed-by: Jesus Fernandez <jesus.fernandez@qt.io> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
| * QSslSocket: respect read buffer's max size (SecureTransport)Timur Pocheptsov2016-09-271-0/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. QSslSocketBackendPrivate::transmit was ignoring 'readBufferMaxSize'; as a result, we can have a user trying to set read buffer's size to a small value (and more important - reading slowly in a small chunks from this socket), but SSL itself socket reading 'too fast', potentially growing its internal buffer to a huge size. This also results in auto-tests failing - whenever we're trying to limit read rate in some test. 2. Update qsslsocket auto-test. Task-number: QTBUG-43388 Task-number: QTBUG-55170 Change-Id: Iedece26df0ac5b3b7cad62cc8c98aedc28e7ca5b Reviewed-by: Richard J. Moore <rich@kde.org>
| * Plug memleaks in tst_QGridLayoutMarc Mutz2016-09-271-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | In setMinAndMaxSize(), QLayout::removeItem() doesn't actually delete the removed item. We have to do that ourselves (RAII not necessary, since the spacer is owned by the layout until we remove it). In distributeMultiCell(), allocate the QStyle subclass on the stack so the compiler cleans it up properly on all exit paths (was: unconditional leak). Change-Id: I24f8f11af2bfc5abf78f9aab0139dcfe0187402b Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| * Plug memleaks in tst_QBoxLayoutMarc Mutz2016-09-271-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | In sizeConstraints(), QLayout::takeAt(), as the name suggests, doesn't actually delete the item. We have to do that ourselves. Likewise, in replaceWidget(), QLayout::replaceWidget() also doesn't delete the affected item, but returns it. That's spectacularly bad API design, but the leak is easy to fix: just delete the return value. Change-Id: I8dcbc59898949eabce766cda2c0edae2e1f2799e Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| * QObject test: check that throwing from a child's constructor worksGiuseppe D'Angelo2016-09-261-0/+76
| | | | | | | | | | | | | | | | A check "just in case" -- we don't want leaks nor crashes due to double deletions, and so on. Change-Id: I24f1a486f0d438595bbe352ab780b07c5d53acbd Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | QGuiApplication, platform plugins: don't modify AA_DontUseNativeMenuBarShawn Rutledge2016-09-262-44/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The default should be false, meaning the application will prefer to use a native menubar if the platform supports it. The application author can set it to true if he wants to always use a Qt-rendered menubar instead; or, he can call QMenuBar::setNativeMenuBar(). Qt and its plugins should not override the author's wishes. Instead, if the platform plugin cannot create a native menubar for whatever reason, createPlatformMenuBar() will return null, and QMenuBar will fall back to using a Qt menubar instead. The application can check the result via QMenuBar::isNativeMenuBar(). QMdiArea when maximized inside a QMainWindow with an empty title does not replace the main window's title if we are using native menus. This behavior turned out to be the same on Unity as it is on macOS, so the autotest needed adjustment to expect that behavior whenever the menubar is native, not only on certain platforms. tst_QMenuBar::allowActiveAndDisabled() tests a standalone QMenuBar. In f92f78094 it was disabled on macOS, but on Ubuntu it passes as long as we force it to be a non-native menubar, so it should pass that way on macOS too. Removed unused variable RESET to fix warning. Task-number: QTBUG-54793 Change-Id: I716e40da709f96331cbbf25213bd7bc153e4dbe2 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-09-232-8/+11
|\| | | | | | | | | | | | | Conflicts: src/corelib/global/qlogging.cpp Change-Id: I9cc8f25ad897efab6a42cb5c5161b1c9402952f0
| * Fix test for sandboxed platformsMaurice Kalinowski2016-09-231-3/+3
| | | | | | | | | | | | | | The test function tries to create a file inside the application bundle. Change-Id: Ia429b42b102d5e98f20694058fa2633e3c7de30a Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
| * tst_QGraphicsItem: Fix UB (invalid cast/member call) in prepareGeometryChange()Marc Mutz2016-09-221-5/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Found by UBSan: tst_qgraphicsitem.cpp:5066:29: runtime error: downcast of address 0x2afcb006c7f0 which does not point to an object of type 'GeometryChanger' 0x2afcb006c7f0: note: object is of type 'QGraphicsRectItem' 00 00 00 00 d8 64 ca 98 fc 2a 00 00 40 a9 0b b0 fc 2a 00 00 75 65 29 00 00 00 00 00 35 00 00 00 ^~~~~~~~~~~~~~~~~~~~~~~ vptr for 'QGraphicsRectItem' #0 0x4c5f1c in tst_QGraphicsItem::prepareGeometryChange() tst_qgraphicsitem.cpp:5066 Fix by actually instantiating a GeometryChanger, which incidentally is the pattern used by paint() a few lines below, too. While at it, allocate the item on the stack (as is done in paint()) and create a local QRectF variable to avoid repeating the same magic numbers over and over again. Change-Id: If5a3d56511000a17703d78d7dd1f0ea072b8bc11 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-09-212-62/+101
|\| | | | | | | Change-Id: I9cfefaf22b010fca937be77979f5fb50574bb71e