summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* QHeaderView - length returns wrong value fixThorbjørn Lund Martsum2012-01-301-0/+21
| | | | | | | | | | | | | | | | | | | | setSectionHidden called with (logindex, true) will sometimes prevent a (correct) call to resizeSection(logicalIndex, 0). This seems a bit odd - however it does execute d->doDelayedResizeSections(). Therefore the section is going to be hidden later. However it is a problem that the length meanwhile is wrong. (That is a value that is not the sum of the sections) This is fixed by execute updates before returning the length. Task-number: QTBUG-14242 Change-Id: Ia1d2f6db3213792b250a6a37942b56554261cd3a Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
* Remove "All rights reserved" line from license headers.Jason McDonald2012-01-301062-1061/+1062
| | | | | | | | | | As in the past, to avoid rewriting various autotests that contain line-number information, an extra blank line has been inserted at the end of the license text to ensure that this commit does not change the total number of lines in the license header. Change-Id: I311e001373776812699d6efc045b5f742890c689 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Fix BC break with QAbstractFileEngine "mount points"Shane Kearns2012-01-291-1/+92
| | | | | | | | | | | | | | | | | | File system cached metadata can't be trusted when custom file engines are in use, because the custom file engine may want to override the metadata. (e.g. present an archive file as a directory) Therefore, check if a file engine should be instantiated for each result in QDirIterator. This is a fast check if no custom file engines are registered. When pushing a directory (using QDirIterator::SubDirectories) the file engine needs to be instantiated also. Task-number: QTBUG-23688 Task-number: ou1cimx1#965023 Change-Id: I0114c8df6258535553783a2486131c4194926649 Reviewed-by: João Abecasis <joao.abecasis@nokia.com> (cherry picked from 3864ad09d578210b52e5f58fca2ee8a1144f5be2)
* Introduce QTypeInfo::sizeOf.Jędrzej Nowacki2012-01-291-4/+1
| | | | | | | | In QMetaType "void" is a regular type, lack of c++ sizeof operator force us to write a template specialization for the type. Change-Id: I9a56e135223b416b8031836d29ef33ef3fb750e4 Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
* Get rid of checks for Qt3 typesKent Hansen2012-01-291-1/+6
| | | | | | | | | | | | | | These types don't exist anymore, so it's pointless to check for them. Also remove the dead types from uic's type-to-header map. Change-Id: I7f0af5c337859f3da1c103157a802bbe5372df9f Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com> Reviewed-by: Jonas Gastal <jgastal@profusion.mobi> Reviewed-by: João Abecasis <joao.abecasis@nokia.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Call connectNotify when connecting with function pointerOlivier Goffart2012-01-291-0/+14
| | | | | | | | Some objects expect connectNotify to be called in order the signal to be emitted. Change-Id: Id0460d9c2aef8f9c3618a2b62b2119a790e06f30 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QUrl: deprecate setEncodedUrl() and fromEncoded(), add url().David Faure2012-01-281-8/+4
| | | | | | | | | setEncodedUrl() isn't necessary anymore now that setUrl can handle encoded (and partially encoded) urls. url() is added for symmetry with setUrl(). Change-Id: I4e671482a5635a86797421ca50882db9cd60d852 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QUrl: use partially-decoded data in toString and QUrl(QString)David Faure2012-01-281-44/+65
| | | | | | | | | | | | | This fixes round-trip bugs. People expect to be able to do QUrl u(...); QString s = u.toString(); QUrl u2(s); and have u==u2. This was not true for paths containing a '#', for instance, which would be parsed back as a fragment. The solution is to make toString output partially decoded data (more readable than toEncoded, but not decoded to the point of changing the meaning, if parsing it back later as a QUrl), and to make the QUrl constructor work with partially decoded data. Change-Id: I013c01e8947d538435f3c20fc4ec57cd9ccbba6c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QHash benchmark: improve Java's hashGiuseppe D'Angelo2012-01-271-0/+11
| | | | | | | | Added a bit of documentation to the Java-like hashing function. Change-Id: I3f44eee305d91b76f0f89cd1acf21f6430b9482b Reviewed-by: João Abecasis <joao.abecasis@nokia.com> Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
* QHash benchmark: remove unused variablesGiuseppe D'Angelo2012-01-271-3/+0
| | | | | | Change-Id: Ib5abc171fb8fb70e2f73ac92ca22dc09146d8a55 Reviewed-by: João Abecasis <joao.abecasis@nokia.com> Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
* QWidgets to use QGuiApplication focus object change notificationsPekka Vuorela2012-01-271-8/+4
| | | | | | | | | | | | | Moving away from deprecated QInputPanel inputItem. Small behavioral changes: - On focus proxy widgets, disabling WA_InputMethodEnabled on proxy will no longer disable input method for proxy target. - setEnabled(false) on proxy widget will no longer disable input method for target as a special case. Change-Id: Ifb5b7144d29bd3aefdde7cf4a0bd396db06e67e2 Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com>
* QGuiApplication::focusObject() to replace QInputPanel::inputItem()Pekka Vuorela2012-01-273-0/+125
| | | | | | | | | | | * Deprecated QInputPanel::inputWindow() which is already just returning QGuiApplication::activeWindow() * Deprecated QInputPanel::inputItem() and introduced QGuiApplication::focusObject(). Input methods can check input method support by Qt::ImEnabled query. Change-Id: I70a9c1c3f79aadb75c839d0489a9428f7a221df5 Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com>
* Implement QWindow::close()Anselmo L. S. Melo2012-01-271-0/+16
| | | | | | | Implement the public slot QWindow::close() and add the correspondent test. Change-Id: If3f07cce3b26640f06fc52d0e4dca875d9894b3d Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Fix a typo in tst_qtreewidget autotest.Jędrzej Nowacki2012-01-261-1/+1
| | | | | Change-Id: I573467c3fdfc4b3d059b216258d39944ac546061 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Made it possible to run tst_qtjson test from shadow build directory.Denis Dzyubenko2012-01-262-8/+13
| | | | | Change-Id: I167737c91e01f055a2ce14db54dfcc6b74ad8c28 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Convert tst_qurl.cpp to UTF-8 (to make it editable in QtCreator)David Faure2012-01-261-18/+18
| | | | | Change-Id: I9baa445b11f65b28596e5b88746b72c5cf04fe77 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fixed QString::operator<(QLatin1String)Denis Dzyubenko2012-01-262-0/+29
| | | | | | | | | | | | | | QLatin1String now has a constructor that takes explicit length, which makes it possible to create QLatin1String that do not have null-termination character. Fixed QString::operator> and < to be safe in that case. In the same patch fixed qtjson which had operator< implemented in the same way. QString::compare(QLatin1String) is still broken and will be fixed separately. Change-Id: I48ec1183a6f44034129cc17312af854795085408 Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Mark the single argument containers as movable.Stephen Kelly2012-01-261-0/+28
| | | | | | Change-Id: I1557b9f3c2d3ad805e1ab7bf4d49973f08664a79 Reviewed-by: João Abecasis <joao.abecasis@nokia.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* Automated metatype definition for template types.Stephen Kelly2012-01-261-0/+46
| | | | | | | | | | | | | | | | If T is defined as a metatype, then QList<T> is too automatically. So for example, no need to use Q_DECLARE_METATYPE(QList<int>) anymore. This is a source compatible change. Change-Id: I2ee8a7b9e28fe6d4775f6a05cce39aca8563e0c5 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com> Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
* Made QWindow::currentOrientation() a property.Samuel Rødal2012-01-261-2/+6
| | | | | | | | | | | | | | To match the previous QWindow::orientation() property which can be useful to access from QML. Also, removed the automatic translation of Qt::PrimaryOrientation to QScreen::primaryOrientation() on the QWindow level, as it leads to a lot of complexity regarding the QWindow::contentOrientationChanged() signal, and makes it hard to distinguish between the case where the window's orientation follows that of the screen, and the case where the orientation just happens to be set to that of the screen. Change-Id: I6950d1337b7f929815eff1328181855090d8066b Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Fix a couple of edge cases for WildcardUnix matchingAndy Shaw2012-01-261-1/+3
| | | | | | | | | | | | | | Fix a couple of cases where WildcardUnix was not matching when the string was just [] or ended with a \. The testWildcardEscaping() test has been extended to account for these two cases too. Integrate 7ce3726aea4be2dfdb57966a4482f66fec6f8f57 from 4.8 Task-number: QTBUG-20897 Change-Id: I7a07ac008473fa7a080db752e189f6404842603f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove QTextControl and QLineControl.Andrew den Exter2012-01-252-67/+4
| | | | | | | | QtWidgets and QtDeclarative now both have their own versions of these so there's no need to keep them around any longer. Change-Id: I9c2201c8495a0a0816e2af16c8f647fcad991479 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Cleanup mess in public type ids.Jędrzej Nowacki2012-01-25130-13/+139
| | | | | | | | | | | | | | | | | | There is no reason to keep two separated core types sets. It couldn't be fixed before Qt5 because of binary compatibility promise. This patch merges QMetaType core types with ext core types. This "simple" operation consists of: - QDataStream version was incremented, because type ids are saved in QVariant's data stream. - QMetaType LastExtCoreType and FirstExtCoreType were replaced by LastCoreType, FirstCoreType and new QMetaType::HighestInternalId. - New tests checking QVariant data stream for Qt4 and for Qt5 versions were added. Change-Id: I02dd74d29317365c297a789a4eb7c9c5edc3b231 Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
* QAbstractSocket / QSslSocket: add API to pause and resumePeter Hartmann2012-01-251-17/+93
| | | | | | | | | | | | | | | pause and resume is currently only supported upon emitting the QSslSocket::sslErrors() signal. The API was added in QAbstractSocket to also support QAbstractSocket::proxyAuthenticationRequired() in the future. This is the first patch to support that feature on the socket level, another patch will follow to support sslErrors() and authenticationRequired() in QNetworkAccessManager / QNetworkReply. Task-number: QTBUG-19032 Change-Id: Ide2918268590ab9a01454ab26cb7fdca3dc840ab Reviewed-by: Shane Kearns <ext-shane.2.kearns@nokia.com>
* Remove use of QT_MODULE from libraryGunnar Sletta2012-01-253-3/+0
| | | | | | | | | | These defines were there to aid in the commercial licensing scheme we used long ago, and are no longer needed. Keep a QT_MODULE(x) define so other modules continue compiling. Change-Id: I8fd76cd5270df8f14aee746b6cf32ebf7c23fec7 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* moc: Use QMetaType::QVariant as the type for QVariantKent Hansen2012-01-252-1/+16
| | | | | | | | | | | | | | | | | | | QMetaType::QVariant has existed as a proper type for almost two years, but the qvariant_nameToType function was written in 2006. Using QMetaType::QVariant means QVariant can be treated just like any other type. We can get rid of those hacky checks for LastType, and the remaining checks become more readable. The fact that QMetaProperty::{type,userType}() returned LastType (0xffffffff) for QVariants was never documented (LastType itself is internal). But there are other Qt modules that assume so. I'll fix the ones I know about (qtdeclarative, qtscript, activeqt). Change-Id: I799b9079bb8bbb1fe76c132525440b30415cbac5 Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* tst_qobject: Run as console application.Friedemann Kleint2012-01-252-3/+3
| | | | | Change-Id: If3049249cf8ceeb0985d158209e217455bfc3c47 Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
* Remove support for the MNG file format and the bundled libmngaavit2012-01-2514-56/+1
| | | | | | | | | | | | | The MNG file format is generally abandoned, and libmng has been unmaintained for several years. The MNG plugin and bundled libmng has been moved to the qtimageformats project on Gerrit. Task-number: QTBUG-21869 Change-Id: I946432347014ffde2b72307a5f8b166ca5553602 Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Add a changed() signal to QValidator.Andrew den Exter2012-01-253-0/+49
| | | | | | | | | This provides a general notification of changes that may change the validity of previously validated input. Change-Id: I5ec6f127af60fdca68605fee903a08758bc01360 Reviewed-by: Jonas Gastal <jgastal@profusion.mobi> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* QKeySequence: fix copy/paste error in autotestDavid Faure2012-01-251-1/+1
| | | | | Change-Id: If03a99c9aa7210d3f166c2674831c645f67b1794 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Add autotest for failing signal connection.Friedemann Kleint2012-01-241-0/+6
| | | | | Change-Id: Iaae93253fa6d1ca0798d05d69a7ab6d6ff8b60bc Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Re-enable 'make check' for tests/auto/widgetsBradley T. Hughes2012-01-241-1/+0
| | | | | | | | We want the autotests for the QtWidgets library to be run on Mac OS X as well. Change-Id: Ie731b802b64222c84116e2df82f536acf4971565 Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* add missing move* methods to QAbstractItemModelMark Brand2012-01-241-0/+94
| | | | | | | | | | | | | | The existence of QAbstractItemModel virtual methods moveRow, moveColumn, moveRows, and moveColumns is implied by the existence of beginMoveRows, endMoveRows, beginMoveColumns and endMoveColumns. However, these were not actually provided by QAbstractItemModel. With this change, subclasses can implement support for moving rows and columns following the same pattern as for insert* and remove*. Change-Id: Iad8b2223d4b9303abb6459c174a82ffed71a0fdf Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Make mid() and midRef() properly return empty, non-null objectsGiuseppe D'Angelo2012-01-242-4/+12
| | | | | | | | | | | If we request a substring starting at the very end of the string, QString::mid should return an empty string, not a null string. For instance, QString("abc").mid(3, 0) used to return a null one, while this patch makes it return an empty one. The same thing applies to QString::midRef() and QByteArray::mid(). Change-Id: Ie9efd7a0622d429efd0fb682c19856c19e9469af Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Made window orientation API more flexible.Samuel Rødal2012-01-242-5/+34
| | | | | | | | | | | | | | | Previously we only had QWindow::setOrientation() which was a hint about the orientation the window's contents were rendered in. However, it's necessary to separate between the orientation corresponding to the window buffer layout and orientation of the contents. A game for example might typically want to use a landscape buffer even on a portrait device. Thus, we replace QWindow::orientation() with QWindow::reportContentOrientationChange() and QWindow::requestWindowOrientation(). Change-Id: I1f07362192daf36c45519cb05b43ac352f1945b5 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Import json support from playground/qtbinaryjsonLars Knoll2012-01-2410-1/+1762
| | | | | | | | | | | | | This imports the JSON support for Qt 5 from playground/qtbinaryjson. It adds a fast, fully compliant json parser, a convenient C++ API, conversion to and from QVariants and a binary format for JSON that is extremely fast to use together with the C++ API. Change-Id: If9e3a21a4241d388d0abaa446b6824f9cc6edb1c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Store the is-a QObject fact with the metatype declaration.Stephen Kelly2012-01-244-4/+60
| | | | | | | | | | | | | | This is a source incompatible change for Q_DECLARE_METATYPE(T*), which now requires T to be fully defined. The consequences of this are: * Forward declared types can no longer be declared as a metatype. (though this is a very uncommon thing to do). There is a trivial workaround where necessary. Change-Id: Id74c40088b8c0b466fcd7c55abd616f69acc82c8 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* QKeySequence: add tests, fix handling of '+' as key or separator.David Faure2012-01-241-2/+31
| | | | | | Change-Id: I3c471dff9b46025aab762d36bb3a3adc64ced561 Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Make QUrl always lowercase the scheme().David Faure2012-01-241-2/+2
| | | | | | | | | | | | URL schemes can only contain alphanumeric characters and all protocols specify that they are case-insensitive. So instead of doing case-insensitive comparison everywhere and then get it wrong sometimes, better to lower-case it here. Change-Id: I61f51a3f4c85b90af1586ebcf69608987fbe2ec3 Reviewed-by: Jonas Gastal <jgastal@profusion.mobi> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QWinOverlappedIoNotifier introducedJoerg Bornemann2012-01-243-0/+222
| | | | | | | | | | | For asynchronous (overlapped) I/O notification on Windows one can now use the convenience class QWinOverlappedIoNotifier. It's using one global I/O completion port and a watching thread to get notified when a read or write operation completes. Change-Id: If6f904b364be0405580c7e50355529ab136ae3cb Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com> Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
* Changed qnetworkdiskcache unittest to cleanup test directory.Kurt Korbatits2012-01-241-0/+3
| | | | | | | | | - Remove foo directory tree after run. Change-Id: I2d554b4c64fc7162c7717c840534cf77f5e744d0 Reviewed-by: Kurt Korbatits <kurt.korbatits@nokia.com> Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com> Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Changed qtextdocument, qtextdocumentlayout unittests to cleanup tmp files.Kurt Korbatits2012-01-242-1/+15
| | | | | | | | | | - qtextdocument unittest to remove foo.png after test. - qtextdocumentlayout unittest to remove expected.png and img.png after test. Change-Id: I42971e9128d399cadc87b9fd345c868065f180a9 Reviewed-by: Kurt Korbatits <kurt.korbatits@nokia.com> Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com> Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* Changed painting unittests to remove created files after run.Kurt Korbatits2012-01-243-1/+41
| | | | | | | | | | | - qpainter cleans up temp files dest.png, expected.png and foo.png - qpainterpath clean up temp file data - qprinter cleans up silly, out1.ps, out2.ps, test.pdf and file.pdf Change-Id: Id434bea0bae5b970355206a250456e4beeca8060 Reviewed-by: Kurt Korbatits <kurt.korbatits@nokia.com> Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com> Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* Changed qpixmap unittest to remove created file after run.Kurt Korbatits2012-01-241-0/+6
| | | | | | | | | - Removes temp_image.png after test run. Change-Id: I0b233609c2bbf57151cf173181a40738d934f0ec Reviewed-by: Kurt Korbatits <kurt.korbatits@nokia.com> Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com> Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Changed qxmlstream unittest to remove its created file after run.Kurt Korbatits2012-01-241-0/+6
| | | | | | | | | - Removes test.xml after test completed. Change-Id: I548e2d644cca8ae0d30c3002df45cf57433170af Reviewed-by: Kurt Korbatits <kurt.korbatits@nokia.com> Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com> Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Changed qdatastream unittest to remove the test file it creates.Kurt Korbatits2012-01-241-0/+1
| | | | | | | | | - Remove datastream.tmp file after test completed. Change-Id: I844600f0a477397d129fd01ac755183c2d874da4 Reviewed-by: Kurt Korbatits <kurt.korbatits@nokia.com> Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com> Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Test connecting to virtual function pointerOlivier Goffart2012-01-241-0/+47
| | | | | | | | | | | | | | | | The C++ standard says that the comparison between pointer to virtual function is unspecified (C++11 $5.10.2) But we still may rely on it for the Qt::UniqueConnection and the disconnection So test if it works while using the same function. Using function from different classes works for me, but we should probably not assume it works. I left it commented in the test for reference. Change-Id: I1d9b91d4cc1a424d4f43ef2ee4981b8573f1e86f Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Add the capability to use multiple data sources for qhash benchmark.Robin Burchell2012-01-242-20/+31
| | | | | | | More data sources to be added in followup commits. Change-Id: I0393119b36ac5d88fc2c5c8d46b000d13d5ca996 Reviewed-by: Richard J. Moore <rich@kde.org>
* Remove executive summary.Robin Burchell2012-01-241-27/+0
| | | | | | | | | | | | It isn't necessarily that hashing the whole string is the main problem, as the recently added java string benchmark appears to show, which means the original purpose of this benchmark is rather voided. This removal allows gradually repurposing the test towards providing general benchmarks of QHash performance. Change-Id: Iaab0a3b493387dcce99240632342235ed9c44d88 Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
* Move test files around.Robin Burchell2012-01-244-4/+4
| | | | | | | | | main.cpp is easier for my muscle memory to remember than qhash_string as it is used by a number of other tests. Change-Id: I044f995d55a4ff1328dde0ae27b6e36a80114c38 Reviewed-by: Richard J. Moore <rich@kde.org> Reviewed-by: João Abecasis <joao.abecasis@nokia.com>