summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Implement QVector with QArrayData interface.Jędrzej Nowacki2012-05-304-125/+1422
| | | | | Change-Id: I109f46892aed2f6024459812d24922b12358814d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Marked tst_qprocess as parallel-safeRohan McGovern2012-05-301-0/+1
| | | | | | | | | | This autotest appears to be parallel-safe. It fails our parallel stress test, but only because it writes to its own build directory. This should not interfere with other autotests. Change-Id: Ie99dde24edc0fda0c8ec4352a6e44abb7cbc54f8 Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com> Reviewed-by: Kalle Lehtonen <kalle.ju.lehtonen@nokia.com>
* Fix Qt 5 todo issues for QSizePolicy.Jan-Arve Saether2012-05-303-0/+231
| | | | | | | | | | | | | | * Merge the two public ctors. * Use bitflags instead of shifting bits (more readable). * Add autotest * Use int datatype for the "stretch setters". (values out of bounds are clamped) Streaming to QDataStream will still use the Qt 4 format. Task-number: QTBUG-25100 Change-Id: Iecb1e78cb12717e4d84448484c3ad8ca469d571a Reviewed-by: Paul Olav Tvete <paul.tvete@nokia.com>
* QtPrintSupport - Add QPrinterInfo api for more printer detailsJohn Layt2012-05-291-1/+8
| | | | | | | | | | | | | | | A previous commit changed the Mac behaviour for printerName() from returning the CUPS Description to returning the CUPS Name. In case anyone was relying on this for a human-readable name add new api to return the CUPS Description. Also add the Location and Make and Model which will be used in the Unix print dialog instead of directly calling CUPS. Change-Id: I9901bf8d6368466adf111580f5db5a3f01ca9170 Reviewed-by: Teemu Katajisto <teemu.katajisto@digia.com> Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: John Layt <jlayt@kde.org>
* Set explicit testcase.timeout for slow testsRohan McGovern2012-05-295-0/+5
| | | | | | | | | | | | We'd like to decrease the default timeout for tests in the Qt Project CI so that we waste less time waiting for hanging tests. Tests which genuinely take a long time to run, such as these, should have their timeout explicitly set in their .pro file. Change-Id: I4fe6249e9efa764b230251d73a1115c24411e168 Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com> Reviewed-by: Kalle Lehtonen <kalle.ju.lehtonen@nokia.com>
* Make tst_qfiledialog2 closer to parallel-safe.Rohan McGovern2012-05-291-18/+23
| | | | | | | | | | | Use a QTemporaryDir instead of the system-wide temporary directory. The test is still not entirely parallel-safe (at least on X11) due to requiring the shown dialog to have keyboard focus. Change-Id: I628dc6ab52dda49f6957a301eea8944bb9d81453 Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com> Reviewed-by: Kalle Lehtonen <kalle.ju.lehtonen@nokia.com>
* Make tst_selftests parallel-safe.Rohan McGovern2012-05-292-3/+18
| | | | | | | | | Use a QTemporaryDir for temporary files, instead of the current working directory. Change-Id: Ifeb2944238f785a1f7beb0dc2a7c1e092d121db5 Reviewed-by: Kalle Lehtonen <kalle.ju.lehtonen@nokia.com> Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
* Mark tst_qsharedpointer as parallel-safe.Rohan McGovern2012-05-291-0/+1
| | | | | | | | | This autotest seems to be parallel-safe. It was not marked as such due to an issue which rarely causes the test to hang on exit on Windows, but that appears unrelated to whether or not the test is run in parallel. Change-Id: I30bac75be3ddc14139594605481eb6af3f6795e7 Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
* Marked tst_qmake as parallel-safeRohan McGovern2012-05-291-0/+1
| | | | | | | | | This autotest fails a parallel-stress test because it writes into its own source/build directory. However, by inspection, it appears not likely to cause issues with any tests other than itself. Change-Id: I13789ba14bab240d34c22c5b77d6407995423afc Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
* Make tst_qfilesystemmodel parallel-safe.Rohan McGovern2012-05-292-1/+2
| | | | | | | | Changed one testfunction to use the test's own QTemporaryDir instead of the system-wide temporary directory. Change-Id: I6740a7f4ba7f53174cd0730239d8dc088e5111ba Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
* Make tst_qnetworkreply parallel-safe.Rohan McGovern2012-05-292-2/+3
| | | | | | | | | Ensure we always use a unique filename when writing to test files. The test already contained code for this, but it was not applied in a couple of places. Change-Id: I1e29ee162c390e014688ab46e3658e2a463d203e Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
* Eliminate QTreeWidget drag crashJiewen Wang2012-05-281-0/+42
| | | | | | | | | | | | | In QTreeViewPrivate::adjustViewOptionsForIndex() wrong index had been used when referencing to array of viewItems. Variable row is set to the index of the QModelIndex, however it is not as same as the index in viewItems[] when there was hidden item in treeWidget. Index of viewItems[] should be used here. Unit test is added as well. Change-Id: Idc7eda979e7d09c5a07bd6dffd92b7abbac10e67 Task-Id: QTBUG-25333 Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Add CONFIG+=parallel_test to suspected parallel-safe tests.Rohan McGovern2012-05-28171-0/+171
| | | | | | | | | These tests have passed a parallel stress test on all three of Linux, Mac, Windows. Mark them with CONFIG+=parallel_test to allow CI to run them in parallel, saving time. Change-Id: I19fd333c3c645a67374ca998f6c8530dd236b0f8 Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
* Marked tst_qprocess insignificant on macRohan McGovern2012-05-281-0/+1
| | | | | | | | | tst_qprocess::lockupsInStartDetached sometimes locks up on mac. Mark this as a known issue. Task-number: QTBUG-25895 Change-Id: I08b1bcf39f2bf373e74509a06415d9ba514b8993 Reviewed-by: Kalle Lehtonen <kalle.ju.lehtonen@nokia.com>
* Fixed unused function warning in qtextdocumentfragment test.Mitch Curtis2012-05-281-18/+0
| | | | | Change-Id: I74bb961bf23c4ca1e8e5dc77e870d43fcecc5c09 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* QStatusBar::showMessage will always take new timeoutJiewen Wang2012-05-251-0/+45
| | | | | | | | | | | There is a message check in QStatusBar::showMessage causing the call exits early if the new 'message' is the same as the current message. The check has been removed, and new timeout will always take effect. Unit test is added as well. Change-Id: I3a03c6842835824caba4adc37c3ed834952c4bb2 Task-Id: QTBUG-25492 Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com>
* QTBUG-16850: QLineEdit::setSelection removes blank charactersTarja Sundqvist2012-05-251-0/+11
| | | | | | | | | Changed checking of the start position so that it does not call d->control->text() because this removes blank characters when an input mask is used. Thus the selection fails. Instead d->control->end() is used for checking the start position. Task-number: QTBUG-16850 Change-Id: I62992fb81bd47d432bade9f219782d48eb309956 Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com>
* QtPrinterInfo: Improve QPrinterInfo TestingJohn Layt2012-05-251-163/+88
| | | | | | | | | | | | | | | | | | | Much of the current QPrinterInfo tests fail due to being dependent on specific physical or network printers being attached. This change removes all printer specific tests and replaces them with generic tests that will use whatever printers are installed. Note if no printers are installed then the tests will still pass. A later change will add virtual printers to test returned results are correct. Windows test code is also required and will come later. This does not yet remove the "insignificant" status from the test, further improvements and code fixes are still required. Change-Id: I60802445924edb126aadf78337a8cb6f2f3b3d37 Reviewed-by: John Layt <jlayt@kde.org>
* Write QList unit tests for movable, complex, etc. types.Mitch Curtis2012-05-241-302/+1063
| | | | | Change-Id: I641ada39f7c84cd221ec1e235cdb0c86270d49fc Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* QtPrintSupport - Modify Platform Plugin QPrinterInfo apiJohn Layt2012-05-241-0/+19
| | | | | | | | | | | | | | Change the way the printsupport plugin creates QPrinterInfo objects, provide platform api to return a named printer, and expose this as static public api in QPrinterInfo. Only the Mac plugin used the old api, the other plugins will have direct support added in separate commits, but will use the default implementation for now. Change-Id: I7d6b6556eb39919cfb15bc0e814afbaf13c5712c Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* tst_qmetatype: avoid slow compilation with some MSVC2010Rohan McGovern2012-05-241-1/+7
| | | | | | | | | | | | | MSVC2010 32-bit (with and without service pack 1) takes about 1 hour to compile this file in some builds, since 1c7421ad14f9321422cdfeede3902552a34ccf3b. Avoid the relevant portion of the code just for these compilers. Change-Id: Icbb4fa12a6d563a7cdc882c30cdb5705675bedb0 Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* QtPrintSupport - Fix Mac printerName() useJohn Layt2012-05-231-15/+0
| | | | | | | | | | | | | | | | | | | | Mac in Qt4 and 5 has been using the PMPrinter Name for the QPrinter and QPrinterInfo printerName() value, but this is incorrect. This is in fact the CUPS Description field, is in human readable form and is not guaranteed to be unique. The CUPS Name field is the PMPrinter ID value and should be used as the unique identifier when accessing printers. This has worked up to now due to an undocumented feature in the OSX api that accepted the Name when the ID should be used. Changing all uses of PMPrinterGetName to PMPrinterGetID fixes this and allows the QPrinterInfo test of names to pass without munging the names. Change-Id: I25322aa1a924bed9f67f4ad5e208274c8b700e17 Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com> Reviewed-by: John Layt <jlayt@kde.org>
* Fix wrong local positions in mouse events when no tlw was givenLaszlo Agocs2012-05-231-1/+21
| | | | | | | | | | Calling handleMouseEvent() with w == 0 implies that the local position is bogus and instead it should be calculated from the global position once the target window is known. Change-Id: If173d0570f6dcc8b7bc5d6f21fa1f69d06d9d702 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com> Reviewed-by: Paul Olav Tvete <paul.tvete@nokia.com>
* QAuthenticator - test NTLM SSO and normal paths separatelyShane Kearns2012-05-231-7/+17
| | | | | | | | | Single signon code path gets the NTLM responses from the system, so we can't predict the contents. Task-number: QTBUG-25851 Change-Id: Ia8aa1741ae5af9e48643331bf9a3768550a30166 Reviewed-by: Martin Petersson <Martin.Petersson@nokia.com>
* Fix handling of invalid urls in QDataStream << QUrlDavid Faure2012-05-231-0/+34
| | | | | | | | | | | When given an invalid url, the output shouldn't be a valid url. KDE's kurltest detected this regression compared to Qt4, where all invalid urls were empty in toString() -- but we don't want that, to give as much feedback as possible to the user. Change-Id: Ie53e6e1c0a1d4bb9e12b820220dfb7e2f7753959 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix warning about unused variable in tst_qvariant.Jędrzej Nowacki2012-05-231-0/+1
| | | | | Change-Id: I9e713aa6a2033c5c4cd4b97bbd4ebb461d46962a Reviewed-by: Jonas Rabbe <jonas.rabbe@gmail.com>
* Removed CONFIG+=parallel_test from suspected parallel-unsafe tests [2]Rohan McGovern2012-05-233-3/+3
| | | | | | | | | These tests have failed a parallel stress test and may contribute to instability in test runs. Change-Id: Ibbbe01f7d9550b953fc9fbd6ed52fc99fdb5f5d7 Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com> Reviewed-by: Kalle Lehtonen <kalle.ju.lehtonen@nokia.com>
* Fixed QLineEdit::inputMethodQuery() for Qt::ImHintsTasuku Suzuki2012-05-231-0/+21
| | | | | | | It should return QWidget::inputMethodHints() instead of QVariant() Change-Id: I01f5de8f2087ac67d125f54f08abed523653eb92 Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com>
* Fix auto tests build with gcc 4.7Anselmo L. S. Melo2012-05-231-0/+1
| | | | | | | | | Added #include <unistd.h> to tests/auto/network-settings.h, so qtbase auto tests successfully build. It is needed after the header dependency changes, part of gcc 4.7. Change-Id: I76d1082f8454263f2c22c31a13aa3c1bf6a0c82f Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
* Replace (un)checkAction with toggleAction (3/3)Jan-Arve Saether2012-05-221-12/+12
| | | | | | | | Remove all references to (un)checkAction. This commit finalizes the intended change. Change-Id: I79d3b30b5c3d9fbe276c2c94fed5971bb21d6c02 Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
* replace remaining "const QChar &" with "QChar"Konstantin Ritt2012-05-222-2/+2
| | | | | | | QChar is actually a ushort and passing it via const-ref is suboptimal Change-Id: Ib806b90397de6a816142ed130a22c0fe10a85d79 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Add the QUrl::FullyDecoded flag to the component formattingThiago Macieira2012-05-222-0/+28
| | | | | | | | | | | | | | | | | | This allows the QUrl component getters to return fully decoded data, like they did in Qt 4. This is necessary for some use-cases where the component like the user name, password or path are used outside the context of a URL. In those contexts, the percent-encoded data makes no sense, and the loss of data of what could be represented in a URL is acceptable. Also take the opportunity to expand the documentation of those getter methods, explaining what the options argument does. Discussed-on: http://lists.qt-project.org/pipermail/development/2012-May/003811.html Change-Id: I89f743cde78c02f169c88314bff0768714341419 Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: David Faure <faure@kde.org> Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
* Add QUrl::ParsingMode to the component setters in QUrlThiago Macieira2012-05-221-0/+198
| | | | | | | | | | | | | | This allows one to instruct QUrl to ignore the percent-encodings and interpret the data exactly as provided. This is useful in certain use-cases where the data comes from a non-URL context. The strict-mode checking of the components is not implemented yet. Currently, the behaviour is equal to that of TolerantMode. Discussed-on: http://lists.qt-project.org/pipermail/development/2012-May/003811.html Change-Id: Ia5abe045a8ce7f9b50cbce3b5a7e3735e068d03a Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
* Port away from QUrl::MostDecodedThiago Macieira2012-05-223-22/+26
| | | | | | | | | | | Since we're about to introduce QUrl::FullyDecoded, this QUrl::MostDecoded value would be confusing. Replace its uses with what was intended at the point in question. Change-Id: Iefd87bc33d37bace507c5cb0f206fa902e08e2df Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: David Faure <faure@kde.org> Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
* Fix the idempotent recoding tests in tst_QUrlInternalThiago Macieira2012-05-221-3/+28
| | | | | | | | | | | | This was trying all the possibilities by brute force, but it turns out that some combinations are not valid so they should not be tested. What's more, it was using old values of the flags, so this was actually testing nothing. Change-Id: I6c2f5230d240fc23418df2d3a1ca905dbc47dd10 Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: David Faure <faure@kde.org> Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
* Fixed unused function warning in qsslcertificate test.Mitch Curtis2012-05-221-2/+2
| | | | | Change-Id: I4d402e486a8ceb965d008056f5f1bcb227f6f40c Reviewed-by: Martin Petersson <Martin.Petersson@nokia.com>
* Removed CONFIG+=parallel_test from suspected parallel-unsafe testsRohan McGovern2012-05-229-10/+8
| | | | | | | | These tests have failed a parallel stress test and may contribute to instability in test runs. Change-Id: I2c4456ad7d3846c2262a0ba714ab8f0c9a05c597 Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
* Fixed unused function warning in qsslkey test.Mitch Curtis2012-05-211-2/+2
| | | | | | | Change-Id: I5039e011f3c9b44ed1887424f11e4e146c3eb07f Reviewed-by: Martin Petersson <Martin.Petersson@nokia.com> Reviewed-by: Richard J. Moore <rich@kde.org> Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
* QWindowsBackingStore: Implement scroll.Friedemann Kleint2012-05-212-7/+0
| | | | | | | | | | Similar to XCB. Task-number: QTBUG-24299 Task-number: QTBUG-24296 (partially fixed) Change-Id: I4c9d813d9645f957f2caad0c4e395ce0d3d222cc Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Fallback to IPv4 when IPv6 is not present.Jonas M. Gastal2012-05-216-36/+84
| | | | | | | In tests when IPv6 is not present QSKIP IPv6 tests. Task-number: QTBUG-23660 Change-Id: I02abc7322d765a93cbf661e53c76257f03dca73e Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
* Change QSslCertificate::toText() to return a QString.Richard Moore2012-05-211-2/+2
| | | | | | | | | | A couple of people reviewing the toText() method (which is new in 5.0) have said that since the string returned is human readable it should be a QString not a QByteArray. This change follows their advice. Change-Id: Ibade9a24870805f7fbe2d299abeb9c6e964f0cf4 Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Cocoa implementation of QPA menu interface.James Turner2012-05-192-0/+206
| | | | | | | | | | | Implement the QPA platform menu interface for Cocoa, including native menubar support and merging with the predefined menus created from the bundled .nib. Cleanup code previously used to maintain the menus, and add a manual test of the menus code. Change-Id: Ia99267ddb6485e18e05c540eb32c5aee6cbb85db Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
* QRegExp: fix usage of uninitialized valuesGiuseppe D'Angelo2012-05-191-2/+0
| | | | | | | | | | | | | | | | | | A (probable) typo was causing the code dealing with anchors to use uninitialized values. This used to work by chance, but was indeed detected by Valgrind f.i. when running tst_qregexp -- the indexIn test on anc11 data reported: ==3015== Conditional jump or move depends on uninitialised value(s) ==3015== at 0x514B4EA: PeppeQt::QRegExpMatchState::testAnchor(int, int, int const*) (qregexp.cpp:1813) [...] ==3015== Uninitialised value was created by a stack allocation ==3015== at 0x514B3EB: PeppeQt::QRegExpMatchState::testAnchor(int, int, int const*) (qregexp.cpp:1803) Fixing the code also makes the aforementioned test to succeed. Change-Id: If7b3e518c1bbfcf12573d2637c33ef2eca27c4d5 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Don't use the deprecated translate() method anymoreLars Knoll2012-05-1899-981/+981
| | | | | | | | | | The Encoding argument of QCoreApplication::translate() is deprecated and source code is always assumed to be encoded in Utf8. Simply remove the encoding argument from the generated .ui.h files. Change-Id: If6c40f6df13abd45a0303c863077972c3d1fb685 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Move QIcon metatype handlers back to QtGuiOlivier Goffart2012-05-1824-0/+0
| | | | | | | | | | | QIcon has been moved back from QWidget to QtGui, so the QIcon QVariant and QMetaType handler can now be moved back to QtGui. Also we can give back QIcon its old number, allowing to get rid of some compatibility hack when unstreaming QVariant Change-Id: I439d5c2987c06ecd619f394407850f678164afb8 Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* QIcon: move back to QtGuiOlivier Goffart2012-05-1822-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Move the files and tests git mv src/widgets/kernel/qicon* qrc/gui/image/ git mv tests/auto/widgets/kernel/qicon/ tests/auto/gui/image/ - update the include of QIcon git grep -O"sed -i s,QtWidgets/qicon,QtGui/qicon," "QtWidgets/qicon" git grep -O"sed -i s,QtWidgets/QIcon,QtGui/QIcon," "QtWidgets/QIcon" - Adapt QIcon \ingroup documentation sed -i s/QtWidgets/QtGui/ src/gui/images/qicon* - Adapt export macro sed -i s/Q_WIDGETS_EXPORT/Q_GUI_EXPORT/g src/gui/image/qicon* - Update .pri and .pro files - Remove the use of QStyle::alignedRect by copying its content (and adapt slightly - Use QGuiApplication::palette() instead of QApplication::palette() - Add a hook in QGuiApplicationPrivate to call the QStyle::generatedIconPixmap() from QtWidgets Another commit follows to adjust QMetaType::Icon and move the QVariant and QMetaType icon handler back in QtGui Change-Id: I1b63759f892ebc02dfc30f41bb6e76e0b7451182 Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com>
* Add test of automated container metatype declaration.Stephen Kelly2012-05-181-0/+104
| | | | | Change-Id: Iddaf444ead6d9f0147b9b11452ccea46aa712ba3 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* Remove parallel flag for qsemaphore because of flaky nature.Toby Tomkins2012-05-181-1/+1
| | | | | | | | | The CI system is now using the parallel_test flag to run tests in parallel. This test has become flaky, or at least more flaky than it was previously. Mark it to no longer run in parallel. Change-Id: I47bca3be620a8f648a0eb9c9b9f26d2d925efc01 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix cursorToX for right to left text with trailing whitespace.Andrew den Exter2012-05-171-0/+440
| | | | | | | | | | | | | | | | QTextLine::cursorToX returned the line width for cursor positions outside the width of a wrapped right to left line because the leading space width was always calculated as 0. Returning a non-zero width for the leading space does cause problems for other uses of QTextEngine::alignLine() though as the textAdvance already doesn't include the leading/trailing space so subtracting it there double accounts for it. Task-number: QTBUG-24801 Change-Id: I56cbb139814c32813bebb49de8c045b29154a958 Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
* Fix bug when destruction fields in QWizardCarl Schumann2012-05-163-1/+220
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Maintain the consistency of QWizardPrivate's two members: QVector<QWizardField> fields; QMap<QString, int> fieldIndexMap; during and after calls to QWizardPrivate's void _q_handleFieldObjectDestroyed(QObject *) member function. The failure to maintain this consistency caused an out of bounds access and core dump in QWizard's field(const QString &name) member function. QWizard's field(const QString &name) member function expects the values in the QMap fieldIndexMap to be indexes into the QVector fields. Prior to this change _q_handleFieldObjectDestroyed only removed the appropriate entry from the map and erased it from the vector. It did not decrement by one all the indexes greater than the index that was removed from the map and erased from the vector in the rest of the map. For example ... So if initially have the following mapping ... "field0" -> 0, "field1" -> 1, and "field2" -> 2 with fields of size 3. After destruction of "field1" have ... "field0" -> 0, and "field2" -> 2 with fields of size 2. Now attempts to look up "field2" using QWizard::field will have an out of bounds error and possibly core dump or trigger an internal Qt assert because an attempt to access this->fields[2] will be made. It should be accessing this->fields[1], but does not because the map is no longer consistent with the vector. This change adds a decrement by one for all the indexes greater than the index that was removed from the map and erased from the vector. Task-number: QTBUG-25691 Change-Id: Ia2a41027628a65faec4ecdd5da235ddd19746a57 Reviewed-by: Shane Kearns <shane.kearns@accenture.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>