summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* OpenGL, PlatformSupport: use QStringRef to optimize memory allocationAnton Kudryavtsev2016-04-076-13/+15
| | | | | | | | | | | | | Replace substring functions that return QString with corresponding functions that return QStringRef where it's possible. Create QString from QStringRef only where necessary. While touching the code, also port loops to C++11 style. Change-Id: Ib94d29b6ecec1cdab2604d0277a743e8b340be5e Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Reduce verbosity for QT_XCB_GL_INTEGRATION=noneGatis Paeglis2016-04-071-9/+11
| | | | | | | | | | | | | When QT_XCB_GL_INTEGRATION=none we were printing: 1) qt.xcb.glintegration: QT_XCB_GL_INTEGRATION is set to "none" 2) qt.xcb.glintegration: Choosing xcb gl-integration based on following priority () 3) qt.xcb.glintegration: Failed to create xcb gl-integration Omit line 2 (useless) and line 3 (misleading). Change-Id: If5e65a5bc8cc4a1fa97858049a26aac9a9535950 Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
* QStringRef: add missing {c,}r{begin,end}()Marc Mutz2016-04-073-18/+116
| | | | | | | | | | | | | | Most containers have them in Qt 5.7, so add them to QStringRef, too. Brush up the docs, use the const_iterator typedef in the API, for consistency with QString's docs. [ChangeLog][QtCore][QStringRef] Added reverse iterators, rbegin(), rend(), crbegin(), crend(). Change-Id: I3d2884a1b2faae02c610ab3871552b65bc6e2521 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-04-0746-456/+430
|\ | | | | | | | | | | | | | | | | | | Conflicts: src/network/access/qftp.cpp src/widgets/itemviews/qheaderview.cpp src/widgets/itemviews/qlistview.cpp tests/auto/network/access/qftp/tst_qftp.cpp Change-Id: I9f928f25d45d8944dd60bb583f649fc1615bc5d9
| * QFtp: Use UTF-8 encoding.Friedemann Kleint2016-04-072-7/+8
| | | | | | | | | | | | | | | | | | | | According to RFC 2640, FTP uses UTF-8 encoding. Fix the conversions accordingly. Task-number: QTBUG-52303 Change-Id: I615199b3d074fc3861f25df113dda672525766b6 Reviewed-by: Edward Welbourne <edward.welbourne@theqtcompany.com> Reviewed-by: Richard J. Moore <rich@kde.org>
| * Fix QPrinter PDF output using fonts with spaces in the PostScript name.Jake Petroules2016-04-061-3/+4
| | | | | | | | | | | | | | Task-number: QTBUG-52352 Done-with: Andy Shaw <andy.shaw@theqtcompany.com> Change-Id: Id8dcb4a57520c2cc53483672f6578e5ab0bb5de5 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
| * QFontDialog: re-enable X close button in window decorationMarc Mutz2016-04-061-1/+1
| | | | | | | | | | | | Change-Id: Id8d9dab7a0e4cf22abefd9bdc7bf2fd4cba1f445 Task-number: QTBUG-32240 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
| * QStringRef: fix some QStringRef <> const char * relational operatorsMarc Mutz2016-04-061-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | Their implementations were swapped. Found while extending tst_qstringapisymmetry, which only exists in dev, so test will be added to dev once this change has merged up. [ChangeLog][QtCore][QStringRef] Fixed relational operators against (const char*) to return the correct result. Change-Id: I3f331037571b9a543a6885802836b768143d1c1a Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
| * Avoid unnecessary allocation in QClipData::setClipRegion()Gabriel de Dietrich2016-04-061-1/+1
| | | | | | | | | | Change-Id: I1280a496478ec6839ac432ffd63ecea28dbb972a Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
| * Refactor QWindowsXPStylePrivate::drawBackground() and helpers.Friedemann Kleint2016-04-062-9/+7
| | | | | | | | | | | | | | | | | | | | Pass the DC obtained drawBackground() to drawBackgroundDirectly(), saving a call to hdcForWidgetBackingStore() to find it. Pass the error code from the Win32 API DrawThemeBackground() to the calling functions. Change-Id: I1c25241f53d87e4429ad924f7b2e29da215d7e4f Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
| * Windows QPA: Scale hotspot of custom cursors correctly.Friedemann Kleint2016-04-061-5/+5
| | | | | | | | | | | | | | | | | | | | Separate factors in QWindowsCursor::createPixmapCursor() and apply factor to the hotspot. Task-number: QTBUG-52276 Change-Id: Ia5a5db39ddc2bc4215a23ff8625431af9b4a76d8 Reviewed-by: Adam Light <aclight@gmail.com> Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
| * Remove empty first lines of files.Friedemann Kleint2016-04-065-5/+0
| | | | | | | | | | | | | | They might upset licensing related tools. Change-Id: I858d21fc418ba16959c88847b559b11bea29ed6b Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
| * QtXml/htmlnfo example: Remove Nokia-related HTML demo file.Friedemann Kleint2016-04-062-216/+0
| | | | | | | | | | Change-Id: I0b0ebcf20747a607ad9eed130d7b4fe810a1f2e1 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
| * Direct2D QPA: Fix build with clang-cl.Friedemann Kleint2016-04-061-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove overzealous constexpr triggering errors like: in file included from .\qwindowsdirect2dpaintengine.cpp:44: ./qwindowsdirect2dhelpers.h(58,37) : error: constexpr function never produces a constant expression [-Winvalid-constexpr] Q_DECL_CONSTEXPR inline D2D1_RECT_F to_d2d_rect_f(const QRectF &qrect) ^ ./qwindowsdirect2dhelpers.h(60,12) : note: non-constexpr function 'RectF' cannot be used in a constant expression return D2D1::RectF(qrect.x(), qrect.y(), qrect.x() + qrect.width(), qrect.y() + qrect.height()); ^ C:\Program Files (x86)\Windows Kits\10\include\10.0.10586.0\um\d2d1helper.h(160,5) : note: declared here RectF( ^ Task-number: QTBUG-50860 Change-Id: I0bb4d17b7a7db69c5cc7e286ef0b8ff104f72b2e Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
| * Explain QTimeZonePrivate::isValidId a bit more carefully.Edward Welbourne2016-04-061-17/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Its "rules" are actually guidelines, its suggested regex was wrong, its actual implementation was fuzzier than its documentation suggested and the exception it tacitly permitted should be distinguished from the stricter rules it otherwise appears to implement. There was also a redundant check ('-' had been handled earlier in the chained if). Explain why the situation is tricky, fix the regex mentioned (making it more readable, too) and note what might be worth doing a little more fussily, without actually changing code behavior. Change-Id: I93fa0da0640a134e5d84011b435a186576824063 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
| * Add some QChar::unicode() calls to brush over deprecation warninghjk2016-04-061-1/+1
| | | | | | | | | | Change-Id: I16383254373289584818cd2b590d51d9e4a649c5 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
| * Fix abuse of assignment-in-conditional (and the resulting warning)Joerg Bornemann2016-04-061-2/+2
| | | | | | | | | | Change-Id: I2025e3360151c76982c45764cbee332855409dd0 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
| * Remove superfluous includes from qlocalsocket_win.cppJoerg Bornemann2016-04-061-4/+0
| | | | | | | | | | Change-Id: I4f641966af3443d0c487df95d2e565182a945bf3 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
| * Qt Meta macros: Allow tools to define annotationsOlivier Goffart2016-04-062-25/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This might be useful for IDE or other tools to be made aware of Qt macros. This is inspired to what QtCreator[1] and moc-ng[2] does. But they are forced to redefine or inject code at precise location which might be difficult. This is going to make it easier to use libclang in qdoc. With this change, the tooling can just predefine the macro QT_ANNOTATE_FUNCTION and QT_ANNOTATE_CLASS to get what they need. Example with libclang: "-DQT_ANNOTATE_CLASS(type,...)=static_assert(sizeof(#__VA_ARGS__),#type);" "-DQT_ANNOTATE_CLASS2(type,a1,a2)=static_assert(sizeof(#a1,#a2),#type);" "-DQT_ANNOTATE_FUNCTION(a)=__attribute__((annotate(#a)))" "-DQT_ANNOTATE_ACCESS_SPECIFIER(a)=__attribute__((annotate(#a)))" "-DQ_CLASSINFO(name,value)=static_assert(sizeof(name,value),\"qt_classinfo\");" "-DQ_REVISION(v)=__attribute__((annotate(\"qt_revision:\" QT_STRINGIFY2(v))))" [1] qt-creator/cplusplus/wrappedQtHeaders/QtCore/qobjectdefs.h [2] https://code.woboq.org/mocng/src/qobjectdefs-injected.h.html Change-Id: I88fcb28f1dbb3d26ea82f10e9948e68a18c795e9 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com> Reviewed-by: Kevin Funk <kevin.funk@kdab.com> Reviewed-by: Milian Wolff <milian.wolff@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
| * Windows QPA: Check QWindowsStaticOpenGLContext in ↵Friedemann Kleint2016-04-061-2/+4
| | | | | | | | | | | | | | | | | | | | nativeResourceForIntegration(). The instance of QWindowsStaticOpenGLContext has been observed to be 0. Task-number: QTBUG-52387 Change-Id: I1ca97c6df0d96e732ae62354e03f465cd461bcb4 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
| * QToolButton: always restart the menu popup timerGiuseppe D'Angelo2016-04-062-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The logic for activating a delayed popup menu on QToolButton is a bit cumbersome: when the button is pressed, a timer is started. This timer however doesn't get reset if the button is released before the timer expires. Instead, the function triggered by the timer checks if the button is pressed at that time. If so, the popup menu is shown. This logic allows the user to press-release a QToolButton many times and suddenly get a popup menu appear way before the expected timeout for the popup expired. That's because the first press started the timer, and then the button happened to be down when the timer expired. Instead, always *re*start the timer on a button press, and cancel the timer when the button is released. Change-Id: I3e0849264fdb6f670d018ebb5012eb15fa699cfb Task-number: QTBUG-48906 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
| * QListView: propagate the source of wheel eventsAlexander Volkov2016-04-061-1/+1
| | | | | | | | | | Change-Id: I3ff5dd1f7e02a8a6a0610d71707c26fd5ea74650 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
| * ANGLE: Do not use march=nativeOliver Wolff2016-04-062-3/+1
| | | | | | | | | | | | | | | | | | | | That configuration causes gcc to create non portable code and thus should not be used. Task-number: QTBUG-51938 Change-Id: Ib134bd0b12811c15805943180c41af8f411e6453 Reviewed-by: Andrew Knight <andrew.knight@intopalo.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
| * Make sure QStyleOption is correctly initialized.Hannah von Reth2016-04-052-7/+110
| | | | | | | | | | | | | | | | | | | | | | Ensures that QStyleOption is correctly initialized. This prevents possible styling issues due to QStyleOption's reporting version 0, see qstyleoption_cast. This enables users to handle more cases in their QProxyStyle. For now the test is only used for QCommonStyle. Change-Id: I768db00b12b46890343fffe44e4f562762e9cf80 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
| * Fix regression in scaled QLabel on hi-res display.Jason Haslam2016-04-051-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The change in bc1796f for QTBUG-42503 only works for scaling down pixel-doubled images. Smaller images scale up incorrectly. Fixed by setting the devicePixelRatio of the scaled pixmap to the devicePixelRatio of the label. Also, caching was broken by not accounting for scaling by devicePixelRatio in the condition. Change-Id: I6e1503652e61683a16312c74f46b79d28c880848 Task-number: QTBUG-46846 Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
| * QDateTimeParser: Avoid repetition in sectionMaxSizeEdward Welbourne2016-04-051-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | The format to use was computed, every time round a loop, in both branches of a ?: choice, duplicating code and potentially computation. Pull it out into a const computed once before the loop. A conditional return 2 is pointless for the #if-branch which returns 2 unconditionally, so move it into the #else. Change-Id: Ia583e958e24f9f37b92cb3f2a173bc07e88bcd06 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
| * winrt: Change input panel behavior to platform defaultMaurice Kalinowski2016-04-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Native applications do open the native input pane when the touch release happens, not during press. Widget applications seem to not ask the theme, so it was acting like native there already. For Qt Quick applications the platform theme is queried, now returning true for SetFocusOnTouchRelease. As a side-effect this also fixes QTBUG-52295, as showInputPanel() at press time causes issues with focus handling, causing the input pane to disappear again. Task-number: QTBUG-52295 Change-Id: I6da6a0126f695233b7c8a399a1549a8b7c824af2 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
| * Do not disconnect with nullptr when unplugging screensLaszlo Agocs2016-04-051-1/+3
| | | | | | | | | | | | | | Task-number: QTBUG-42803 Change-Id: I080ec3f0cc2cb55b43a9b8792f03b002b2e0f982 Reviewed-by: Gunnar Sletta <gunnar@sletta.org> Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
| * QHeaderView::setStretchLastSection: make it a noop when setting the same valueGiuseppe D'Angelo2016-04-051-0/+2
| | | | | | | | | | | | | | | | | | | | For some reason this setter wasn't protected against setting the same value again, and always did work (including resizing the last section when setting it to false). Change-Id: I044404eef95d52d165100254f3afd489997e0872 Task-number: QTBUG-52308 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
| * Accept partial line scrollsAllan Sandfeld Jensen2016-04-051-1/+9
| | | | | | | | | | | | | | | | | | | | | | QAbstractSlider might register and use small scroll events that would scroll less than a single line. Since we consume the scroll-event we should accept it, so it doesn't scroll other widgets too. Task-number: QTBUG-49549 Change-Id: I7c64c5f6cae46f02ba21058abbecb791fc3c88eb Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
| * Vista style animation: Create images with device pixel ratio.Friedemann Kleint2016-04-052-17/+18
| | | | | | | | | | | | Change-Id: Ic404c8ac8b0e4c1b8d0dd7877611443e0afac270 Task-number: QTBUG-49374 Reviewed-by: Alessandro Portale <alessandro.portale@theqtcompany.com>
| * Windows XP style: Change theme logic to use qreal.Friedemann Kleint2016-04-055-69/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | Avoid rounding errors, thus preventing sizes becoming too small when High DPI scaling is in effect. Also fix division by zero crashes should a scale factor be below 1. Task-number: QTBUG-49374 Task-number: QTBUG-51552 Change-Id: I72718521bc3c7f6b0e42392ea2d2d3bbc61e2faa Reviewed-by: Marko Kangas <marko.kangas@theqtcompany.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com> Reviewed-by: Alessandro Portale <alessandro.portale@theqtcompany.com>
| * Windows XP style: Allow High DPI scaling to draw directly.Friedemann Kleint2016-04-052-11/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, the style defaulted to drawing via pixmaps when the device transformation of the QPainter was more complex than TxTranslate. Introduce an enumeration describing the transformation to be able to identify the scaling used by High DPI scaling and allow for direct drawing in that case as well. Add scale factors. Create pixmaps with device pixel ration in drawBackgroundThruNativeBuffer() if High DPI scaling is in effect. Issues: Borders may go missing due to the up-scaling/rounding. Code branches for DrawBackgroundEx==0 are not touched since it is assumed these old versions of Windows do not run in High DPI. Task-number: QTBUG-49374 Change-Id: Idfe1887e4fac3be2843438dc76cb4971a198ab2a Reviewed-by: Alessandro Portale <alessandro.portale@theqtcompany.com>
| * Doc: Simple offline CSS: Remove font-size declarationsTopi Reinio2016-04-051-15/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove the font-size declarations from the CSS, rely on the default sizes for each element. This solves two issues: - The user-configured font size (both in Assistant and Qt Creator Help) is correctly taken into use. Previously, adjusting the font size resulted in resizing fonts only for some of the text elements. - QTextBrowser backend seems to assume a DPI of 96 for all platforms, and font-sizes in 'pt' units are scaled accordingly. However, on OS X this resulted in font sizes too small to read. Change-Id: Iaab3ad07e387912ad7391df982d4bfe7047f0b20 Task-number: QTBUG-51709 Task-number: QTBUG-51885 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com>
| * Fix assert with Meta modifierJoni Poikelin2016-04-051-2/+1
| | | | | | | | | | | | | | | | | | Meta modifier is not found in some configurations which triggers an assert. Instead of assert, ignore the modifier if it is not found. Task-number: QTBUG-52298 Change-Id: I258cee4014a30162afebb423eadaf07ef0ed6a1f Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
| * Windows QPA: Don't send geometry change after window creation for ↵Friedemann Kleint2016-04-051-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | maximized/fullscreen. For these states, geometry change will be sent from the code called by setWindowState(); the geometry obtained immediately after window creation is then no longer valid. Task-number: QTBUG-52231 Change-Id: Ia7cbe95e73c5dd4126bb63d448b83f2cab6a53a1 Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
| * QDir: use QString::splitRef on all platformsAnton Kudryavtsev2016-04-051-6/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | ... to avoid unnecessary allocations with both case sensitive and case insensitive paths. Optimize 4413254ff603fa19f4fa22d4936e69f4a6dbbc2b Change-Id: I4288831d641f7a0ee67f2efd2f5d4f023df0d39c Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Edward Welbourne <edward.welbourne@theqtcompany.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
| * network-settings.h: don't crash when running without the test serverMarc Mutz2016-04-051-1/+6
| | | | | | | | | | | | | | | | | | | | Don't access first() of a potentially-empty QList. Check for QHostInfo::error() first. Also change to constFirst() to prevent a detach. Change-Id: I91fa0bbfb21f62af29abdb23b4869a7f039b259e Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
| * Fix UB (shift of negative number) in qHash(QModelIndex)Marc Mutz2016-04-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Found by UBSan: itemmodels/qabstractitemmodel.h:426:28: runtime error: left shift of negative value -1 Fix by casting the lhs of the left-shift operator to uint before shifting. Since Qt assumes two's complement repre- sentation of signed integers, this should yield the same result as the old code, but without UBs. It is critically important that the result is identical to the old code (modulo the compiler exploiting the UB, which this patch aims to prevent even in future compilers), because the function is inline, and changing the hash value would mean changing the layout of a QHash<QModelIndex,.> between users compiled against the old and new libraries. Change-Id: I7b826a34fb78b02021e40c3f85fd11af398dbec4 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | Add support for ImhAnchorRectangleJan Arve Sæther2016-04-065-10/+63
| | | | | | | | | | | | | | | | | | | | | | | | Adds the following API: * QInputMethod::anchorRectangle() * QPlatformInputContext::setSelectionOnFocusObject() This will be used for determining how to display selection handles. Change-Id: If57e3fd58ff0f1ba7899f7dd62bfa9c006028667 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com>
* | Widgets: use QStringRef to optimize memory allocationAnton Kudryavtsev2016-04-068-20/+24
| | | | | | | | | | | | | | | | | | | | | | Replace substring functions that return QString with corresponding functions that return QStringRef where it's possible. Create QString from QStringRef only where necessary. Change-Id: Id1c39093199519f2794b11560c2c0ded2d52b928 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | Move QThread::currentThreadId() down to the loop using it.Erik Verbruggen2016-04-061-2/+2
| | | | | | | | | | | | | | | | | | This prevents the call from happening in case no C++ signal is connected. Change-Id: I32027df446391f3fc979528738a106223042d632 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | Fix slow scrolling by wheel after setting a custom scrollbarAlexander Volkov2016-04-051-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The bug was introduced by 410aa20f073b5e45e73366773b7d173f840a9cfe (QAIV - allow users to control single step in ScrollPerPixel mode). QAbstractSliderPrivate::viewMayChangeSingleStep is reponsible for the expected behavior when scrolling by wheel. It is set to true by default, but calling QAbstractScrollArea::set*ScrollBar() results to always setting it to false. So we should copy viewMayChangeSingleStep manually from the old scrollbar. Change-Id: I2ee218054e473fa96785b123805e3943a5d74dbd Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
* | fix namespaced buildOswald Buddenhagen2016-04-051-0/+2
| | | | | | | | | | Change-Id: I4df9e4874da2e86b61db7e5984503c0856492d87 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* | Merge "Merge remote-tracking branch 'origin/5.6' into 5.7" into refs/staging/5.7Timur Pocheptsov2016-04-0574-162/+545
|\ \
| * | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-04-0474-162/+545
| |\| | | | | | | | | | Change-Id: I35ca979395620e104e50b06366d0869433a4ffc2
| | * QAbstractItemView: don't call restart() on invalid QElapsedTimerMarc Mutz2016-04-032-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In keyboardSearch(), QAbstractItemView unconditionally called QElapsedTimer::restart(). Calling restart() on an invalid QElapsedTimer is undefined behavior: qelapsedtimer_unix.cpp:192:9: runtime error: signed integer overflow: 3313808 - -9223372036854775808 cannot be represented in type 'long int' qelapsedtimer_unix.cpp:193:10: runtime error: signed integer overflow: 534150461 - -9223372036854775808 cannot be represented in type 'long int' qelapsedtimer_unix.cpp:194:17: runtime error: signed integer overflow: -9223372036851462000 * 1000000000 cannot be represented in type 'long long int' The code already checked the timer for validity, and did not use the return value of restart() in case of an invalid timer, but the check came too late. Fix by checking the return value of QElapsedTimer::isValid() earlier, and calling start() instead of restart() instead. Fix the same error in QTreeView, which has a c'n'p copy of the buggy code. Change-Id: I9751465394707d9348d5c05a0b1b2be147eceb2e Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
| | * QVariant: Fix flags for type-erased associative iterator keyStephen Kelly2016-04-032-1/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The flags here are passed to a private QVariant constructor, and they really represent a boolean - IsPointer or not. Because the flag for the key_type was incorrectly populated with the flag for the value_type, memory would be corrupted when using a mapping type whose value_type is a pointer, but whose key type was not, such as QMap<QString, int*> This typo has been there since the concept was introduced in commit v5.2.0-alpha1~807 (Add container access functionality for associative containers in QVariant., 2013-04-05). Task-number: QTBUG-52246 Change-Id: I9ecb13c603015eed2dc2ca43947fa0ecd6be8b5a Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| | * QGraphicsView: clarify documentation for viewportTransformGiuseppe D'Angelo2016-04-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | d->matrix holds the scene->viewport transform, not vice versa. Change-Id: I997cbdfbf519f39f242cd0dbbd00621e59ec9307 Task-number: QTBUG-48705 Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name>
| | * QScrollerTimer: fix a memory leakGiuseppe D'Angelo2016-04-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The QScrollerTimer instance allocated by QScrollerPrivate was never freed. I've absolutely no idea why QScroller has such a messy d-pointer handling, so go for the easiest approach: exploit the fact that QScrollerPrivate is a QObject and parent the QScrollerTimer to it. Change-Id: I500edc9d0d14b2fb9eec02712229970eb2b9fe81 Task-number: QTBUG-52280 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>