summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* QDateTimePrivate: replace out parameters with return-by-value in getDateTime()Marc Mutz2015-03-252-35/+35
| | | | | | | | | | | | Compilers don't like out parameters. Effects on Linux GCC 4.9 stripped release builds: text -584B data +-0B relocs +-0 Change-Id: Ie00c89b9edaced3a6adeb2707734c8f5238e67c1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QDateTime: prevent aggressive inliningMarc Mutz2015-03-251-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The function getDateFromJulianDay() is simple arithmetic, but still ~400 bytes in executable size. Yet GCC inlines this everywhere I looked, which makes some sense, as different users of the class only use parts of the return value and the optimizer has a field day removing all that dead code. However, that function has only one conditional, so presumably it executes at full pipeline speed and it doesn't matter that it calculates too much in some cases. More important is to use the I-cache more conservatively. That's what not inlining the function achieves. The function returns its result in registers and doesn't spill registers when called (at least on AMD64), so the effect on runtime should be negligible. Effects on Linux GCC 4.9 stripped release builds: text -1536B data +-0B relocs +-0 Change-Id: Ia16838102d29ad67ee5efdc8b7b0a26f2f921df1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QTime: optimize toString()Marc Mutz2015-03-251-3/+1
| | | | | | | | | | | | | Instead of using a QString::arg() cascade, which creates tons of temporaries, use good 'ol sprintf(). Effects on Linux GCC 4.9 stripped release builds: text -308B data +-0B relocs +-0 Change-Id: I348577491d1399b5040f7ed9e9f6b111a9528e5d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Micro-optimize QDate::{long,short}{Day,Month}Name()Marc Mutz2015-03-251-32/+28
| | | | | | | | | Save one return statement per function. I don't see why the compiler can't fuse these itself, but apparently it cannot, since this transformation saves 72B in text size. Change-Id: I3a661456554bf451ed53110ad546946ff7b84ec5 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QDate: don't spend code size covering the impossible caseMarc Mutz2015-03-251-1/+1
| | | | | | | | | | | | All other similar functions in QDate just return an empty string in case none of the switch labels would trigger (which would now cause a compiler warning, after removing the default case label), so do that here, too. Saves 44B in text size. Change-Id: I80ee4975082706adcd15fe89511d08c67e149324 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QDate: remove some useless default case labelsMarc Mutz2015-03-251-8/+0
| | | | | | | | | | | | They're pure whitespace, since in each case there is a fallback after the switch, anyway, and their presence prevents compiler warnings about unhandled enumeration values in switch statements, which is nice-to-have, when adding to the enum, eventually. No change in executable code size. Change-Id: I77aecaeff990601f957ec9ee827eff5ead25aaa1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Skip non-exported slots early when creating a XML interface description.Robert Griebl2015-03-251-1/+6
| | | | | | | | This will prevent unnecessary warnings about unknown types for signals or slots that are not even exported to the D-Bus. Change-Id: Iecda5beca5ebe6665a193245fe1c2578156f6abe Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Export the symbols of libdbus-1 when loading it at runtime.Robert Griebl2015-03-251-0/+1
| | | | | | | | | This allows applications that need additional symbols from the library to easily obtain them without needing to replicate the library open logic from qdbus_symbols.cpp. Change-Id: Ic65ef6684637fbcd1c9f4fe1dc7a57f0624b61a8 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Accessibility Linux: Fix text attributesBoris Dušek2015-03-251-2/+124
| | | | | | | | | | | | | Orca expects text attributes with different names (and sometimes also different values) than IAccessible2 ones (which Qt uses). So adapt the names and values accordingly. [ChangeLog][Accessibility] We now report text attributes correctly on Linux, so ORCA+F now works properly in QTextEdit and other text controls. Change-Id: Iad6d38168b309669c00069a6167f4f54cbd64cf0 Task-number: QTBUG-44479 Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
* OS X Accessibility: Make checkboxes etc. checkable with VoiceOverBoris Dušek2015-03-253-6/+10
| | | | | | | | | | | | NSAccessibility has no explicit analog for QAccessibleActionInterface::toggleAction(), checking checkboxes/radio buttons is handled by NSAccessibilityPressAction. So ensure exposing the action properly on OS X so that VoiceOver users can check/uncheck checkboxes, select radio buttons etc. Change-Id: Idc8b048de2313a3e875a929516baf3dded9c68cc Task-number: QTBUG-44852 Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
* Fix QAccessibleTextWidget::characterRect for off-cursor positionsBoris Dušek2015-03-251-1/+14
| | | | | | | | | | | | | | | | | | | | Current code retrieved the character format at position where the cursor currently was, irrespective of the position actually passed to the characterRect function. This is now fixed and we retrieve the character format for the QTextFragment containing the specified offset. This fixes display of visual bounds around text by screen reader in some cases. E.g. on OS X, when searching text using VoiceOver, VoiceOver first queries the visual bounds of the found text (and thus also characterRect), and only then it moves cursor position to the found text. If before the change of position the cursor was on some text with different metrics (i.e. a bigger font), the visual bounds for the found text reflected those metrics, not the metrics of the actual found text for which the bounds were drawn. This resulted in smaller/bigger rectangles around the found text than was actually correct. Change-Id: Ie2a4dfc714504b7923cdaf8ff875c438aeccddee Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
* Fix QAccessibleTextWidget::characterRect for complex linesBoris Dušek2015-03-251-1/+1
| | | | | | | | | | Current implementation of QAccessibleTextWidget::characterRect returned rect with correct vertical position only when the font point size did not vary inside the line. This commit makes it work for lines where point size changes by taking text ascent and descent into account. Change-Id: I4ee43701a30ce9bff1db2f2d0422227496c3df4c Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
* Support all underline types in accessibilityBoris Dušek2015-03-251-1/+36
| | | | | Change-Id: I9eccc66624f5d789cc8778d4376338207beb4a14 Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
* OSX: add another missing AutoReleasePool.Erik Verbruggen2015-03-231-0/+1
| | | | | | | No leaks no cry. Change-Id: Id44993f037447dd84e1ccd4d985877e7f57bb979 Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
* Use glFinish() in QOpenGLWidget unless glFlush() is known to be enoughLaszlo Agocs2015-03-233-4/+39
| | | | | | | | | | | | | | | | | | | | The driver used on the Odroid-XU3 does not like doing just glFlush() before accessing the texture in another context. There is no guarantee that glFlush() is enough to sync access to resources between contexts, so start using glFinish() as the default, except on common desktop hw + iOS where flush is enough and presumably more efficient. To unify the code pathes, remove the separate flushes and do it only once, before the backingstore compositor indicates that it is about to access the textures. This should improve performance a bit, esp. when doing multisampling since we flush only once then. A helper function is added to the internal QOpenGLExtensions because it is highly likely that QQuickWidget will need the same. Task-number: QTBUG-45106 Change-Id: Ifb405c5723f29f2f6c04df8e15fb70280681755e Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* eglfs: Unblank on startupLaszlo Agocs2015-03-231-0/+4
| | | | | | | Like linuxfb does. Change-Id: Icba224d710f241d9246450c7d112ce181b992d0e Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
* eglfs: Disable the blinking cursorLaszlo Agocs2015-03-232-7/+24
| | | | | | | | Make eglfs and linuxfb use the same code via QFbVtHandler. Task-number: QTBUG-45106 Change-Id: I876bbf5f13bab6d4a81f616c01f15f9c98edf5fc Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
* QVarLengthArray: Do not require operator!= for element comparisonKai Koehne2015-03-231-5/+4
| | | | | | | | | | The documentation claims that operator== is needed, not operator!=. While at it, we can also replace the loop with std::equal, which might even allow STL implementations to choose a hand-optimized version of the algorithm for C++ builtin types ... Change-Id: I988b326d6af3b767526952e303468e18ff6594f9 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* QVarLengthArray: Add initializer_list constructorKai Koehne2015-03-232-0/+22
| | | | | | | | | | | | | | | | | Implement an initializer_list constructor, which was probably just forgotten so far. Technically this is a SC incompatible change, since QVarLengthArray<int> array = {10}; will now create an array with one element 10, instead of an empty array with a reserved size of 10. Anyhow, keeping the inconsistency with the STL / other Qt containers here would certainly do more harm than good in the long run. Task-number: QTBUG-45047 Change-Id: I4675880f93e141181250939942fa32300916b0e3 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* QGLWidget: make renderText() work in high-dpi modeMorten Johan Sørvig2015-03-231-1/+4
| | | | | | | | | Keep the win_x/y position in device independent pixels. Call glViewport with the device pixel size. Change-Id: I96fa038b1a0a3e18cb7f467b65def09cb89692a3 Task-number: QTBUG-38778 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* QWidget: render() in correct resolution on retinaTimur Pocheptsov2015-03-231-1/+4
| | | | | | | | | Factor in the target devicePixelRatio when setting the size (and devicePixelRatio) on the target pixmap. Task-number: QTBUG-41682 Change-Id: I16a85cf7ba0adb6d6c05e9de4fd44ff5533b5f60 Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
* QSplashScreen: Center also on high-dpi screensMorten Johan Sørvig2015-03-231-1/+1
| | | | | | | | | Correctly compute QSplashScreen geometry based on pixmap geometry. Change-Id: Ibd7af54f0732c99116e1ec82a1aa4f8c4d7d390e Task-number: QTBUG-34334 Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
* Android: update android gradle plugin versionBogDan Vatra2015-03-231-1/+1
| | | | | Change-Id: Id2a53edd5206f57c3b281293ab561a7775f94546 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
* Android: Early spring QPA cleanupBogDan Vatra2015-03-232-13/+5
| | | | | | | | | | - Move m_eglDisplay to private section - needsBasicRenderloopWorkaround is needed only locally so, make it a static function - remove unused member variables. Change-Id: I3e845301ec66a322621c7d9e6fac257320a40f77 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
* QDoubleSpinBox: Set back an upper limit widthCaroline Chao2015-03-232-4/+16
| | | | | | | | | | The limit has been removed in the change a317ee0a6fa76d1166f6da8593d39eaf7afce83c. Task-number: QTBUG-44865 Change-Id: I7106f7e7a2653e1ab03d79861ac505d4666598eb Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com> Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
* Update bundled HarfBuzz to 0.9.40Konstantin Ritt2015-03-236-9/+17
| | | | | Change-Id: I88c3608c3f15e39e89a00cfc23c184aebe7097e4 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Report a correct Unicode version used by QtKonstantin Ritt2015-03-232-3/+3
| | | | | | | The version bump was forgotten in edfce46a6c0406af749ca7ef659df6315e36cd5d Change-Id: I99501bb314baab68f037417db4b3b14e11f2de02 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Relicense forkfd under an MIT licenseThiago Macieira2015-03-233-85/+47
| | | | | | | | | The difference between BSD and MIT is the need to reproduce the copyright in the documentation and the non-endorsement by a particular company (the name of which was stale in the forkfd code). Change-Id: Iee8cbc07c4434ce9b560ffff13cd0174934935e9 Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
* Fix problems with extended selection after changing the model contentsFrank Reininghaus2015-03-222-10/+13
| | | | | | | | | | | | | | | | | | | | | Storing the position of the first selected item in the view can lead to wrong extended selections if the contents of the model change. Future Shift-clicks will always use the previous position of the first selected item, which may not be correct any more, to calculate the current selection. To fix this problem, a QPersistentModelIndex is used to keep track of the first selected item. A new unit test is added. Moreover, one function of the QTableView unit test is changed such that it shows the view prior to performing the test. Without this change, this test may fail. That the test, which simulates mouse presses without showing the view, worked at all seems to be a coincidence, as pointed out in QTBUG-18009. Task-number: QTBUG-18009 Change-Id: I0d844fbd1a994c279a7c8ee5d9b5b9fccecd25bf Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Cocoa: Don't let key events triggering input method events close dialog.Christoph Schleifenbaum2015-03-213-0/+11
| | | | | | | | | | | Added a flag to QCocoaWindow to ignore shouldCloseWindow. This is set from within QNSView when escape is pressed and the current focus widgets is processing input method events (like QTextEdit). This lead to unwanted dialog rejects. Task-number: QTBUG-44076 Change-Id: Ic90a8a6ba8c5cddbc0d486563acad57dd384d179 Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
* Stop doing s/HAVE_CONFIG_H/PCRE_HAVE_CONFIG_H/g in bundled PCRE sourcesKonstantin Ritt2015-03-2026-34/+31
| | | | | | | | | As we build PCRE outside of QtCore, there is no need to do that anymore. Change-Id: Ib184966062f6afe7a449b860058e61e1ab2f7939 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* Build bundled PCRE copy as qt_helper_libKonstantin Ritt2015-03-205-41/+65
| | | | | | | We already have an infrastructure for that. Change-Id: I9110b74dcf7f93362586687da6f112e72cb663a4 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* Introduce icu_dependency.priKonstantin Ritt2015-03-202-13/+15
| | | | | | | Simply to hide the magic bahind the scenes. Change-Id: I69a159eb14712e68117f10e78745bdfbad46b6f2 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* Add a note about not requesting a profileLaszlo Agocs2015-03-201-1/+1
| | | | | | | | As per spec not requesting a profile on 3.2+ is same as requesting core since the profile mask defaults to core. Change-Id: I5d03ac08bcba20c273c1c32a51f6a105eba0629f Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Disable usage of glTexStorage on Mali ES 3.0Laszlo Agocs2015-03-201-2/+3
| | | | | | | | | | | | | | Even though immutable storage is available and the glTexStorage2D seems to succeed, the subsequent glTexSubImage2D calls always fail with GL_INVALID_OPERATION. Falling back to mutable storage works just fine. This makes QOpenGLTexture and examples like qtbase's textures functional on Mali T628 (tested with Odroid XU-3). Task-number: QTBUG-45106 Change-Id: If1b4fe6673ba924cfa7cfd7af7d4f0bc3b6a0fe8 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Sort the entries in QDir by using the QDateTime::msecsTo()Andy Shaw2015-03-201-1/+1
| | | | | | | | | By using the QDateTime::msecsTo to do the sorting it means that if there is support for a precise time on the file system then this ensures it sorts correctly. Change-Id: I00528596908bba7b586aeffe5b0aa81019ff5722 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* MySQL: Keep the precision of the field when formatting the valueAndy Shaw2015-03-201-0/+3
| | | | | Change-Id: I4ab08be5112167a617d6d1d109754f2404a9605f Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
* [QWindowsFontDatabase] Move code around to improve readabilityKonstantin Ritt2015-03-201-44/+30
| | | | | | | | Keep DirectWrite initialization code in a single place and fallback to GDI implementation if DirectWrite initialization has failed. Change-Id: I2da185dbc073c58a7ba47bae09957ecac877d712 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Simplify QWindowsFontDatabase::createEngine()Konstantin Ritt2015-03-203-15/+12
| | | | | | | Reduce code duplication and improve readability. Change-Id: Idf53c80077daa9bac03a72acfd2b6c7e3a24ad97 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* An attempt to fix font stretching with DirectFrite font engineKonstantin Ritt2015-03-201-17/+15
| | | | | | | | | Do the `lf.lfWidth = tm.tmAveCharWidth * request.stretch / 100` trick for the DirectWrite path, too. Task-number: QTBUG-22652 Change-Id: I5238bce1033555a4386cb48fed8c898a9632e0cd Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* Only get font metrics if we're going to use themKonstantin Ritt2015-03-201-26/+20
| | | | | Change-Id: If6b635e54f705c1e28b4e092a318d825a408ccfb Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* Do not re-create font if it is not of TMPF_TRUETYPEKonstantin Ritt2015-03-201-3/+1
| | | | | | | | | | | | | | | | For !ttf and stretch==100 case, it was: hfont = CreateFontIndirect(&lf); TEXTMETRIC tm = ..; if (!ttf) { DeleteObject(hfont); lf.lfWidth = tm.tmAveCharWidth; hfont = CreateFontIndirect(&lf); } Unless there is some special behavior for non-TrueType fonts I don't know about, it looks to me like a 100% waste. Change-Id: I864340e50591ba1d8006d1a80f36f6f06f2734b6 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* [QFontEngineFT] Get rid of redundant lockFace()/unlockFace() callsKonstantin Ritt2015-03-201-8/+0
| | | | | | | loadGlyphFor() locks the face when needed. Change-Id: Ia02dce08243499f9f11b345dcdfa5d9e0a3bc889 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* [QFontEngineFT] Fix memory leaks and possible double deletionsKonstantin Ritt2015-03-201-13/+18
| | | | | | | | | | | The glyph returned by loadGlyph() must be freed manually when caching is not enabled, except when it is a placeholder for a missing glyph. This is a fix-up for d18ccbb5be23eaea5eb5f1af2ae0fba334ab21d7. Task-number: QTBUG-32792 Task-number: QTBUG-44812 Change-Id: I410fa1b7703e306739d9dae35fff06af6c79dce0 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Apply Qt-specific changes to the bundled FreeTypeKonstantin Ritt2015-03-202-1/+3
| | | | | | | | Enable TT_CONFIG_OPTION_SUBPIXEL_HINTING instead of deprecated TT_CONFIG_OPTION_UNPATENTED_HINTING to improve hinted rendering. Change-Id: I63efae235a2abb1a9f4bbba5fec900670e1ffe9a Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Update bundled FreeType to 2.5.5Konstantin Ritt2015-03-20610-139644/+45347
| | | | | | | | | Removed everything, imported with help of import_from_tarball.sh script, and then added a pre-generated builds/unix/ftconfig.h Task-number: QTBUG-44648 Change-Id: Iea948e41f7761f1580382b3763d04c7a61383382 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Android: Use nullptr instead of Q_NULLPTRBogDan Vatra2015-03-202-38/+38
| | | | | | | | | | | Android QPA is built only for Android using Android toolchains which we know for sure that it supports C++11/14. Actually C++11 is enabled by default on Android, so there is no need to use more a macro instead of the real thing. Change-Id: I14a720f08320b2e4557f4f1c859454ced19340a6 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com> Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
* Proper screen change handling for devicePixelRatioPaul Olav Tvete2015-03-201-2/+17
| | | | | | | | | We need to make sure that we know which screen we are on, and use the correct devicePixelRatio, depending on the screen. Task-number: QTBUG-45076 Change-Id: Ic56ad4ca8a807d584ce4938b64905ce4dd10f7aa Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
* Windows: Activate popup when there is no active window.Friedemann Kleint2015-03-201-5/+8
| | | | | | | | | | | | Port af7d2b2127dadbdf828c60c75255bb1b4f591651 and 9ffdfa58b3ad2ed4100a7d223a85399b72c6deb7 for QTBUG-7386 from Qt 4. Task-number: QTBUG-44928 Task-number: QTBUG-7386 Change-Id: I119b75349ff30b19f56ecad7fdecf898ac0797d6 Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com> Reviewed-by: Andy Shaw <andy.shaw@digia.com>
* Windows: Fix touch registration.Friedemann Kleint2015-03-201-1/+1
| | | | | | | | | | | IsTouchWindow() returns false for windows that have not yet been registered for touch and the code bailed out. Fix the check so that registration is only suppressed when the flags match. Change-Id: Ia1e88553d2fd8f9acc4e3b9c5f4af6cdbe93b3f6 Task-number: QTBUG-45134 Reviewed-by: Andy Shaw <andy.shaw@digia.com>