summaryrefslogtreecommitdiffstats
path: root/tests/auto/gui
Commit message (Collapse)AuthorAgeFilesLines
* tst_qimagewriter: Fix leaking temporary files.Friedemann Kleint2016-03-021-1/+1
| | | | | | | Add missing slash to the prefix pointing to the temporary directory. Change-Id: I0d00f706af58214a9922758a60d097cab7d6bc9d Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
* tst_qguimetatype::flags(): port to QTypeInfoQueryMarc Mutz2016-02-261-4/+4
| | | | | | | | | | | | | | | QTypeInfoQuery was introduced for 5.6 to decouple isStatic and isRelocatable so old code continues to work. But since this test still uses !isStatic to mean trivially-relocatable, it will fail as soon as one of the checked types is marked as Q_RELOCATABLE_TYPE instead of Q_MOVABLE_TYPE. Incidentally, such a change is in the pipeline for Qt 5.7/5.8, so fix the test by porting to QTypeInfoQuery. Do this in 5.6, because that's when QTypeInfoQuery was introduced. Change-Id: I06f815f26ca9b430e124c4a2f8de2a729999762b Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* QPixmap: check data ptr in isQBitmap()Anton Kudryavtsev2016-02-241-0/+9
| | | | | | | Task-number: QTBUG-51271 Change-Id: I670e074ced1217d2614fa334eb365e40ef80b8b1 Reviewed-by: Edward Welbourne <edward.welbourne@theqtcompany.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* xcb: Deliver mouse enter event to window when closing modal windowBłażej Szczygieł2016-02-242-0/+195
| | | | | | | | | | | | When a modal window is closed and the mouse is not under the modal window - find a proper window and send a fake enter event. Added auto test for checking enter event on window when modal window is closed. Task-number: QTBUG-35109 Change-Id: I370b52d386503820ac9de21e6d05fd019ca456ec Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.6.0' into 5.6Liang Qi2016-02-153-0/+30
|\ | | | | | | Change-Id: I0b190005377a23a91da3563428e223b8a3b18333
| * Crash fix: reject certain malformed bmp imagesEirik Aavitsland2016-02-052-0/+1
| | | | | | | | | | | | | | | | | | | | | | A malformed bmp file header could specify a negative color table size. The bmp handler would then return a QImage that claimed to be valid, but actually was invalid, having an empty color table. This would cause crash later, e.g. when attempting to paint it. Change-Id: I7df7c40867557a82dbcee44c7de061226ff232c0 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com> Reviewed-by: Richard J. Moore <rich@kde.org>
| * Merge 5.6 into 5.6.0Oswald Buddenhagen2016-02-025-2/+244
| |\ | | | | | | | | | Change-Id: I95962e28b6fc101cbbad41230585e2b61f1f6c0f
| * | Fix bounding rect of glyph runs in multi-line QTextLayoutEskil Abrahamsen Blomfeldt2016-01-301-0/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When getting the glyph runs from a QTextLayout with multiple lines, the glyph runs would be merged if possible, but not their bounding rects. This was an oversight. [ChangeLog][Text][QTextLayout] QTextLayout::glyphRuns() now returns united bounding rects for glyph runs that are merged. Change-Id: Ibbeaa99ecfc4e82e7965342efdae7c3c2b637343 Task-number: QTBUG-50715 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | | Autotest: Enable make check on rhel 7.1Simo Fält2016-02-111-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | Blacklisting all tests, which were failing locally. Task-number: QTQAINFRA-949 Change-Id: I40c25ab0155b8977596d61297ab252a546515f87 Reviewed-by: Tony Sarajärvi <tony.sarajarvi@theqtcompany.com>
* | | Provide QCss with the correct font for <pre> blocksAleix Pol2016-02-091-0/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Labels would use a statically defined font for <pre> blocks. Use the one defined by the QPlatformTheme instead, through QFontDatabase::systemFont(FixedFont) Task-number: QTBUG-50564 Change-Id: I5491bd0defce651bdf809bcbc6a529a900f4959b Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
* | | Fix rounding error in fetchTransformedBilinearAllan Sandfeld Jensen2016-02-021-0/+26
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | To calculate the real count we need to use the actual fixed point increment and can not use the floating point value increment wass based on since it might round differently. Includes auto-test by Gabriel de Dietrich. Task-number: QTBUG-50153 Change-Id: Ia973088f361c90370fa20bac14a4b8f373b5d234 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | Stop Q_AUTOTEST_EXPORTing QKeyBinding and QKeySequencePrivateDmitry Shachnev2016-02-021-1/+0
| | | | | | | | | | | | | | | | | | | | The QKeySequence test no longer uses private members (since commit 725bdc3fd2f88c7f49f59a151579fd128cf543dc), so that is no longer needed. Also, remove the unused include from the test. Change-Id: I4d252bb3efd7282f74c44e48444c23ab51d48ea5 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | Revert "QWindow::destroy(): only reset QGuiApp::focus_window and friends as ↵Tor Arne Vestbø2016-02-021-13/+0
| | | | | | | | | | | | | | | | | | | | | | | | a last resort" This reverts commit 4c71db756741d35ccb32dc4c32aa1823264c85df. It's too risky for 5.6, we should let it cook in dev for a while and backport when ready. Change-Id: I91e677e65d967f29c84a254cd3dffc8bb847b263 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
* | Add basic QKeyEvent auto-testTor Arne Vestbø2016-01-303-0/+194
| | | | | | | | | | Change-Id: I732723389edf0970e9688966407c728d38538d0a Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
* | QWindow::destroy(): only reset QGuiApp::focus_window and friends as a last ↵Tor Arne Vestbø2016-01-291-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | resort Resetting focus_window and other internal QGuiApplication variables before calling setVisible(false) and destroying the platform window means that the platform window can't reason about whether or not it was the focus window unless it can resolve that using native APIs. We should let the platform window take care of resetting the focus window and related states, and only execute our fallback logic if the plugin doesn't do the right thing. We also use QPA to update the state instead of modifying the internal QGuiApplication variables directly, so that events and signals are emitted as a result of the reset. The QLineEdit test gets two added calls to processEvents(), since assuming that activateWindow() is synchronous is not correct, and would result in the QMenu resetting the focus window to 0 on destroy. Task-number: QTBUG-46414 Change-Id: I562788393ed0ffd77d7a4be2279862322f721c1a Reviewed-by: Błażej Szczygieł <spaz16@wp.pl> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
* | QFont: Fix possible cache misses due to misprepared cache keyKonstantin Ritt2016-01-291-0/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Parse the requested family before we're looking/saving into the cache, thus hitting the cached EngineData for: * quoted family names (eg. QFont("'Arial'")) * non-simplified family names (eg. QFont(" Arial ")) * substituted family names (\sa QFont::insertSubstitution()) * explicit fallback list, where possible (eg. QFont("Tahoma, Arial")) This also improves the cache hitting for the font engines in some cases. Change-Id: I18cdc3e8d669cccec961f84e9b27329402e2b7ed Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
* | QFontCache: Centralize the engine type safety checkKonstantin Ritt2016-01-281-1/+1
|/ | | | | | | | | We depend on the assumption QFontCache::findEngine(key) for key.multi=1 returns a font engine of type QFontEngine::Multi; guarantee that by checking it in a single place. Change-Id: I287da4fd62deb22fc5520cde5b0505bc44547609 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
* Hide better the private API QTextCursor constructorsThiago Macieira2016-01-222-3/+4
| | | | | | | | | | | | Both constructors were taking a pointer, so they participated in overload resolution along with QTextDocument and QTextFrame pointers. Instead, make them take references and move them to the private section of QTextCursor. That necessitated adding a method to QTextCursorPrivate to access that private constructor from non-friend classes. Change-Id: I7e6338336dd6468ead24ffff1410e3bc534d77dd Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* Merge "Merge remote-tracking branch 'origin/5.5' into 5.6" into refs/staging/5.6Jani Heikkinen2016-01-214-3/+50
|\
| * Merge remote-tracking branch 'origin/5.5' into 5.6Liang Qi2016-01-194-3/+50
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: config.tests/common/atomic64/atomic64.cpp configure src/3rdparty/forkfd/forkfd.c src/corelib/io/forkfd_qt.cpp src/widgets/kernel/qwidgetwindow.cpp tests/auto/corelib/statemachine/qstatemachine/tst_qstatemachine.cpp tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp tools/configure/configureapp.cpp Change-Id: Ic6168d82e51a0ef1862c3a63bee6722e8f138414
| | * Allow socket events processing with a foreign event loop on WindowsAlex Trotsenko2016-01-053-2/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While a native dialog is open, the application message queue is handled by the native event loop which is external to Qt. In this case, QEventDispatcherWin32::processEvents() does not run and socket notifiers will not be activated. So, this patch moves the notifier activation code into the window procedure, which enables socket event processing with native dialogs. Task-number: QTBUG-49782 Task-number: QTBUG-48901 Change-Id: Icbdd96b2e80c50b73505f4fe74957575b83d6cf1 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
| | * Fix a crash when calling QOpenGLTexture::setData with a null QImage.Juha Turunen2015-12-111-1/+14
| | | | | | | | | | | | | | | Change-Id: Idf8ae00cff6929114b38dcb003c259c83a11dbaa Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* | | tst_qtextcocumentlayout::blockVisibility - make the test more robustTimur Pocheptsov2016-01-191-1/+1
|/ / | | | | | | | | | | | | | | | | | | | | | | | | The test inserts strings "0" ... "9" into the text document, takes the half of resulting document's size, makes half of lines invisible and compares sizes. On OS X 10.11 after inserting "4" the width changes, so making "4" invisible also reduces the width and QCOMPARE(currentSize, previosHalfSize) fails. Instead of digits, insert the same string "A" 10 times. Change-Id: Ie88a0442703f98949cea9bcdb694cecee59695f3 Task-number: QTBUG-49848 Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
* | don't rely on transitive dependenciesOswald Buddenhagen2016-01-081-0/+2
| | | | | | | | | | | | Change-Id: Ide872b452e02ebefb3eeb51464c8d59e8bf58bc4 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* | Windows: Restore window geometry after normal->maximized->fullscreen->normal.Friedemann Kleint2015-12-171-0/+67
| | | | | | | | | | | | | | | | | | | | | | - Do not save geometry when going from maximized->fullscreen - Use SW_SHOWNA instead SW_SHOWNOACTIVATE as otherwise the maximized geometry is restored. - Add a test for Windows. Task-number: QTBUG-49709 Change-Id: Ic81e7398ee90d499a50b02192a45cb09276a2105 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* | Fix compilation for WinRTMaurice Kalinowski2015-12-142-2/+2
| | | | | | | | | | | | | | | | TEST_HELPER_INSTALLS cannot be used on platforms with no QProcess support. Change-Id: I2a6a283d94ca4487fc628449c53fc37140dd291d Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
* | QImage pixelColor and setPixelColor must use unpremultiplied QColorAllan Sandfeld Jensen2015-12-041-0/+18
| | | | | | | | | | | | | | | | | | QColor always uses unpremultiplied alpha, but the new QImage methods were based on the QRgb versions which might be either. This patches fixes the two new methods so they treat QColor alpha correctly. Change-Id: I78a5b875ad4e78ad7fde3b811c6187482b4f6d15 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* | Fix possible null pointer dereferences.Jake Petroules2015-12-021-0/+15
| | | | | | | | | | | | | | | | This follows up 130c2baa9376dcf525916620294bd9996bdf41f3. Change-Id: I2f6c9b4f995af427cec9a2162b782039debf8564 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
* | Fix conversion QVariant(QColor) to QString.Jędrzej Nowacki2015-11-301-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | QVariant was using QColor::name() to convert a color to string, which by default loses alpha value. The patch is fixing the problem by always including the alpha value in the string when required. [ChangeLog][Core][Variant] QVariant(QColor)::toString() uses QColor::HexArgb format when the alpha component is different from 1. Task-number: QTBUG-37851 Change-Id: I887460c1ea151180ba99d64dd873ba9d6e2268f2 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | tst_QImageReader: Fix file handling.Friedemann Kleint2015-11-241-8/+23
| | | | | | | | | | | | | | | | | | | | Use a QTemporaryFile in readFromFileAfterJunk() instead writing to the current directory which might not have write permission. Enclose each call to QFile::open() in QVERIFY2() with error message. Change-Id: I3c5da31c6681a2396cee473cafe7d92c5c220de3 Reviewed-by: aavit <eirik.aavitsland@theqtcompany.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
* | tst_QImageWriter: Use QTemporaryDir.Friedemann Kleint2015-11-241-5/+3
| | | | | | | | | | | | | | | | | | | | Create a temporary directory instead of writing to the test data directory or home path (Android). Change-Id: I6af583e5da91eefb603eaae179e7d789487dc626 Reviewed-by: aavit <eirik.aavitsland@theqtcompany.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
* | Make the ppm image handler corrctly handle long comment linesEirik Aavitsland2015-11-192-0/+13
| | | | | | | | | | | | | | | | | | The ppm decoder used a fixed size buffer to discard comment lines, which would fail for comments longer than 100 characters. Task-number: QTBUG-49414 Change-Id: I92e910e025cf7584a6ff1c0e5b0e8a4ab281d479 Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.5' into 5.6Liang Qi2015-11-171-10/+15
|\| | | | | | | Change-Id: I6b1fe0c6c360a0d5285911869f0f4f93d86d822e
| * Fix QImage::setDotsPerMeterX/Y for images with some orientationsJoni Poikelin2015-11-051-10/+15
| | | | | | | | | | | | | | | | | | | | | | Rotation of images with orientation of 90 and 270 degrees dropped DPM values from rotated image. Task-number: QTBUG-49220 Change-Id: I9c23153c49dd63b5f6958fdde72f466873b0a407 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Liang Qi <liang.qi@theqtcompany.com> Reviewed-by: aavit <eirik.aavitsland@theqtcompany.com>
* | Insert leading after each line, not beforeUlf Hermann2015-10-091-0/+12
| | | | | | | | | | | | | | Task-number: QTBUG-45791 Change-Id: I763d9d1ba00989d0c6b1e0b955173dadbef26b10 Reviewed-by: Stephen Chu <stephen@ju-ju.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | Merge "Merge remote-tracking branch 'origin/5.5' into 5.6" into refs/staging/5.6Liang Qi2015-10-025-1/+299
|\ \
| * | Merge remote-tracking branch 'origin/5.5' into 5.6Liang Qi2015-10-025-1/+299
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: qmake/doc/src/qmake-manual.qdoc src/corelib/tools/qstring.h src/gui/image/qimagereader.cpp src/network/access/qnetworkaccessmanager.cpp src/tools/qdoc/doc/examples/examples.qdoc src/widgets/accessible/qaccessiblewidgetfactory_p.h src/widgets/doc/qtwidgets.qdocconf Change-Id: I8fae62283aebefe24e5ca4b4abd97386560c0fcb
| | * Fix tst_QGuiApplication for embedded platforms using eglfs QPAPasi Petäjäjärvi2015-09-101-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | Disable input and cursor for QGuiApplication instances used in autotest to initialize it properly. Change-Id: I78dc9b776269c082c20f244a51f858289129275d Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
| | * Another fix of cosmetic QPainter::drawPolyline()Eirik Aavitsland2015-09-011-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | At the edge of the view, a line segment could end up as not producing any pixels even if not clipped by the floating-point clip routine. Make sure the starting point for the next line is still updated correctly for any significant segment lengths. Change-Id: I381a4efb81ce6006f3da4c67abf279aea79e4663 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
| | * Ensure sendPostedEvents() can be called independentlyJan Arve Saether2015-09-013-0/+281
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If Qt is not running its own event loop (e.g. if Qt is a plugin running in a non-Qt host application with its own event loop, a call to sendPostedEvents() should process all events by default, and not depend on the flags passed to the last call to processEvents() We also modify sendPostedEvents() to call its base implementation instead of directly calling QCoreApplication::sendPostedEvents(). (The behavior of the base implementation is the same, so no behavior change there). This also adds a test for QWindow event handling without Qts event loop is running. This is a black box test, just to ensure that basic functionality is working. It can be extended later. Task-number: QTBUG-45956 Change-Id: I7d688c0c6dec5f133fb495f07526debdde5389af Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
* | | tst_qdesktopservices: Use regular expression to suppress error message.Friedemann Kleint2015-10-021-1/+4
|/ / | | | | | | | | | | | | | | | | | | The error return has been observed to vary. Task-number: QTBUG-48566 Change-Id: Iecfe7819898a6a8a482c1b2251543193ecfa4841 Reviewed-by: Liang Qi <liang.qi@theqtcompany.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com> Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
* | Tests: Always verify whether QTemporaryDir/File creation succeeded.Friedemann Kleint2015-09-283-10/+8
| | | | | | | | | | | | | | | | | | | | | | Use QVERIFY2() with QTemporaryDir/File::errorString() consistently. Attempt to catch issues like the below warning and follow-up issues. QSYSTEM: tst_QFiledialog::clearLineEdit() QFileSystemWatcher: FindNextChangeNotification failed for "C:\Users\qt\_____aaaaaaaaaaaaaaaaaaaaaa" (Access is denied.) Task-number: QTBUG-47370 Change-Id: I58a6e87c502627e976efa62ad73c912f3b2d49fa Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
* | Tests: Harmonize code checking on platform name.Friedemann Kleint2015-09-245-17/+17
| | | | | | | | | | | | | | | | Use case insensitive comparison and static invocation of QGuiApplication::platformName(). Change-Id: I8c197c7b4f0669f71c019fbcee09a0f03dfab399 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
* | Stabilize qguieventloop test.Jędrzej Nowacki2015-09-241-2/+0
| | | | | | | | | | | | | | | | | | The test assumed that an event loop can be tested for emptiness multiple times, which is wrong because an event can be delivered any time. Change-Id: Ic44245321eeed2091b640ada2c83d205b83a1cc2 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Fix QImageReader::size() to return correct size for .ico files.Serge Lysenko2015-09-171-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | According to MSDN, the zero value of ICONDIRENTRY bHeight and bWidth fields mean a maximum icon size 256 pixels. So QtIcoHandler::option() should return 256 instead of 0 pixels for such icons. Also there is fixed wrong seek offset at the second call on this method. http://blogs.msdn.com/b/oldnewthing/archive/2010/10/18/10077133.aspx Task-number: QTBUG-48103 Change-Id: I99f0c9720fd58889045b0c73c51498f2065b0b91 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: aavit <eirik.aavitsland@theqtcompany.com>
* | Serialize the capitalization value of QFontAndy Shaw2015-09-151-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By serializing the capitalization value of QFont, it ensures that it is correctly preserved when QPicture streams it and later plays it back. Subsequently the QDataStream version has been bumped up to account for the change of the data format for serializing QFont. [ChangeLog][QtGui][QFont] QFont now serializes the capitalization setting. [ChangeLog][Important Behavior Changes] QDataStream version bumped up to 17 to account for changes in the serialization of QFont. Task-number: QTBUG-15214 Change-Id: I042680760e5a69d18d41e786b7500a3eebbe562f Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* | Replace direct QPA access in tst_qguiappliction with testlib wrapperTor Arne Vestbø2015-09-151-3/+3
| | | | | | | | | | Change-Id: I698aa9d7633992d257296759f5e04307ff0d8331 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | Move min left/right bearing calculations to QFontEngine baseclassTor Arne Vestbø2015-09-021-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The logic used in the FreeType font engine can be generalized and move to the QFontEngine baseclass. This allows the CoreText font engine to correctly report the minimum left/right bearings, which decreases the chance that an optimization in QTextLayout's line breaking algorithm will produce wrong results. The calculation of left and right bearing has been moved to the glyph_metrics_t type to reduce code duplication. This allows us to use the with and height of the bounding box to determine if the glyph has any contours. Change-Id: I864697d3f31ed56f22f04666199b6c5023c5e585 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
* | Harmonize input context selectionBernd Weimer2015-08-251-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Input context selection works differently across platforms. On some platforms it is not possible to request a specific context at all (e.g. Wayland). This will be unified, depending on the environment variable "QT_IM_MODULE", you will get: - null: default (platform) context, if defined (otherwise no context) - empty: no context - set: set one, if it exists and is valid (otherwise no context) [ChangeLog][Platform Specific Changes] Haromnized input context selection. QT_IM_MODULE environment variable will be taken into account. Change-Id: Ic8f826fbc6ace25941cd19b9b086943e848fbe01 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com> Reviewed-by: Nedim Hadzic <nedim.hadzic@pelagicore.com>
* | Remove type punning from QRgba64.Erik Verbruggen2015-08-111-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | In C++, type punning with a union is not allowed. It will result in compiler defined behavior at best, and undefined behavior at worst. Specifically, if QRgba64 is passed to a function by value, the different members of a struct might be passed in separate registers. This means that any write to the quint64 might not blank out the values of the struct whenever the compiler looses track with TBAA. Change-Id: I991b5492fe4bb13a14bb670fef5bf13dacbe6c0a Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>