summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Do not call QWidget::show/hideEvent twiceOliver Wolff2012-11-083-11/+1
| | | | | | | | | | | | | | | | | | | | | While handling events for Widgets and Windows in QWidgetWindow::event makes sense for other events, it causes QWidget::show/hideEvent to be called twice when handled like "the rest". Having that as one case here seems to be the cleanest solution. Removing the call to showEvent from QWidgetPrivate::show_helper (as proposed in the bug report) causes autotests to fail and thus is not a viable option. Additionally the expected result for the task221221 test for QDoubleSpinBox was reverted to the Qt4 value as Qt4 behaviour was restored. Task-number: QTBUG-27199 Task-number: QTBUG-26424 Task-number: QTBUG-22565 Change-Id: I0ac42b09b1a7618de042d27aa5dd1b3d9f30f552 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Andy Shaw <andy.shaw@digia.com>
* Remove QWindow pos, geometry and size as properties; pos->positionShawn Rutledge2012-11-081-6/+6
| | | | | | | | | | | Abbreviated properties are to be avoided. But all 3 of these properties are redundant from the QML perspective; and because QRect, QPoint and QSize are (wisely) not QObjects, it's not possible to bind to _their_ properties, which make these QWindow properties less useful than users might assume that they are. Change-Id: I19c00b54b1d2712f9418e8bcf56e35a8008b89ef Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* Enabled QSystemSemaphore autotestv5.0.0-beta2Oliver Wolff2012-11-081-0/+1
| | | | | | Change-Id: Id7133c46bbde554b2df69edacf9bfe808498a541 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* test: Remove CONFIG += testcase from tst_bench_qnetworkreply_from_cacheSergio Ahumada2012-11-071-1/+0
| | | | | | | Benchmark tests are not supposed to be run by "make check" Change-Id: I718565a8b4e71c136c7aa8f9bd95f95c5fdafab8 Reviewed-by: Rohan McGovern <rohan@mcgovern.id.au>
* Rename all QWindow properties that have "window" in themShawn Rutledge2012-11-074-33/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | windowTitle, windowModality, windowIcon and so on are named that way to be similar to the ones in QWidget. However QQuickWindow inherits all of the declared properties, and we would like to have shorter property names in QML. If you are working with a Window then it's obvious the title property is the window title. Unfortunately, there must be patches in many other modules which depend on this one. In order to avoid the need to merge them all at the same time, there is also patch https://codereview.qt-project.org/#change,39001 which temporarily adds backwards-compatible accessors, which can be removed after the other modules are able to build without them. We should not rename windowState to state, because in QML, state usually drives the state machine for animation transitions etc. (although QWindow is not an Item, a user might get confused about it). Related patches are https://codereview.qt-project.org/#change,39001 https://codereview.qt-project.org/#change,37764 https://codereview.qt-project.org/#change,37765 https://codereview.qt-project.org/#change,37766 https://codereview.qt-project.org/#change,37762 Change-Id: Ie4424ec15fbdef6b29b137f90a2ae33f173edd21 Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* move QSharedMemory autotest from qtscript to qtbaseOliver Wolff2012-11-076-1/+1058
| | | | | | | | | | | As the script dependency for that autotest is not really needed it should be moved to qtbase. Task-number: QTBUG-27706 Change-Id: Ieda8b2182a20a77f53a0be9878e82e3236c79c2b Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Remove out-of-memory test in QVarLengthArray.Christian Strømme2012-11-071-50/+0
| | | | | | | | | | | No reason to keep this test. If an application is trying to allocate too much memory it will fail, and its the users responsibility to provide sane values and catch exceptions to recover. Task-number: QTBUG-27361 Change-Id: I29d71745ab791b6e8a76f7b1f866ff4bd7024749 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* qpa: Fix rendering issue in blitter engine (negative scaling factors)Julien Brianceau2012-11-071-0/+35
| | | | | | | | | | | | A 180° rotation results in a TxScale QTransform with negative scaling factors (x=-1.0 y=-1.0). This is not properly handled by blitter paint engine yet, so use software rendering fallback in this case. This rendering issue can be seen when using "-webkit-transform" CSS property in WebKit with DirectFB QPA platform. Change-Id: Iee496b6bf0c90ffe36c4235ceaa2c80f296b2ca4 Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* Fixed QSystemSemaphore autotest for "check" targetOliver Wolff2012-11-073-5/+21
| | | | | | | | | | As CI runs autotests using the "check" target the approach using DESTDIR = ../ does not work for the test. Instead the binaries are just moved one directory up and QFINDTESTDATA is used to find the path of the helper binary. Change-Id: If1ed2b60821f1de4ac62f238c8af5e09cf0f444a Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* Re-enable some skipped tests in tst_qwidgetMiikka Heikkinen2012-11-071-8/+0
| | | | | | | Seems that these tests are now passing on Windows, so remove the skips. Change-Id: Id30ef544502f97f8bc84f35f635e39912da3afe8 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* Extend widget grab test.Friedemann Kleint2012-11-071-4/+47
| | | | | | | | | | | - Add enter/leave logging. - Add button to enforce native widgets. - Make mouse event logging more verbose. Task-number: QTBUG-27800 Change-Id: I23160244bef6cb0b8d505cbf118cf12d91621fe7 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com>
* Fix excess enter events when showing modal dialog on button pressMiikka Heikkinen2012-11-071-0/+94
| | | | | | | | | | | | | | | | QApplicationPrivate::leaveAfterRelease was not properly cleared when mouse event handling was interrupted by a modal dialog, which caused every mouse move over the modal dialog to trigger enter event to the widget under cursor. Fixed by clearing QApplicationPrivate::leaveAfterRelease if mouse event without any buttons pressed is handled. Task-number: QTBUG-27643 Change-Id: I4f31daa656bc643c88e5338282a671ae2077e255 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Oliver Wolff <oliver.wolff@digia.com> Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* Fix inconsistent leave/enter events for main window when popup is openMiikka Heikkinen2012-11-061-9/+185
| | | | | | | | | | | | | Changed the platform leave event handling logic in QWidgetWindow to match platform leave event handling logic in Qt4, where last mouse receiver is used as leave target only if last mouse receiver wasn't a native window itself. In that case it is assumed to get leave event of its own when relevant. Task-number: QTBUG-27639 Change-Id: Id6edcd29754a15c959f18ab38b20d66e5d446510 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
* Allow connect to functors with less parameters than the signalOlivier Goffart2012-11-061-0/+36
| | | | | | | | | | | | | | | | | | | | Before, the functor slot (or lambda expression) had to have the same amount of arguments as the signal. This shown to be a big problem to be able to connect to signals that had a QPrivateSlot. This implementation use the type of the operator() of the functor to know how many arguments we have. As a bonus, we also can check the arguments in a static assert. The test comes from https://codereview.qt-project.org/#change,38703 But this patch also works without variadic template If the compiler does not support decltype, we workaround the lack of it by using another level of indirection. Change-Id: I9850b43e8caf77356a2ec3f4c0b0ed532d96029e Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Make test class name consistent with file name.Frederik Gladhorn2012-11-061-15/+15
| | | | | | Change-Id: I2b0e7068d7476673981c7c7f03012db8eabc8ee2 Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com> Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
* Fix connection to const slots (or from const signals)Olivier Goffart2012-11-061-0/+13
| | | | | | | | Pointer to const member function have a different signature, and hence need their own traits code. Change-Id: Ie4b2434a412f412444fb07ef1388a37cab105ecd Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Add OOM unit test for QVarLengthArrayPeter Kümmel2012-11-061-0/+52
| | | | | | Change-Id: Idf22ee6747aca8f0322e68b71f2c32e9ea562d4c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Jason McDonald <macadder1@gmail.com>
* Accessibility: clean up and simplify testFrederik Gladhorn2012-11-051-36/+23
| | | | | | | | | We don't need to define pi. Use some clearer names in navigateHierarchy. Use smart pointers. Change-Id: I482efe9235a3419f048baede6886d29d46e3057c Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
* Accessibility: clean up testFrederik Gladhorn2012-11-051-42/+22
| | | | | | | | Use smart pointers. Navigation to siblings is long gone. Change-Id: I81a10633960eefb9738990682734dcfbdd65330c Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
* test: Remove some QSKIP's from tst_QStyleSergio Ahumada2012-11-031-20/+23
| | | | | Change-Id: Ic277889a75871a8bf72ab2eb2b97e6deeed498e9 Reviewed-by: Caroline Chao <caroline.chao@digia.com>
* Improve QByteDataBuffer::read() performance with partial readsAntti Harju2012-11-038-0/+416
| | | | | | | | | | | | | Add a read position variable to eliminate excessive memcpy'ing when reading a partial buffer. Specifically, fix performance issue of reading large files from QNetworkDiskCache in QtWebKit2. Task-number: QTBUG-27522 Change-Id: I21edc909bf9223971b2c3db5f1fa6b89c5b61c5f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Antti Harju <antti.harju@ixonos.com>
* Qt 5.0 QTreeView. Prevent manual moving of the first sectionThorbjørn Lund Martsum2012-11-023-2/+61
| | | | | | | | | | | | | | | | | | This prevents the user of moving the leftmost column. There will be no API to allow move of the tree-structure. It is very weird to do that, so it shouldn't be a problem. In case it is a big problem somewhere it can be hacked with: QTableView unused; unused.setVerticalHeader(tree->header()); tree->header()->setParent(tree); unused.setVerticalHeader(new QHeaderView(Qt::Horizontal)); Task-number: QTBUG-332 Change-Id: I3a251c8d0fd472ec0ad7edb20a7f3e00af7e0da8 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Mac: refactor scrollbar animationsJ-P Nurmi2012-11-023-16/+19
| | | | | | | | | Get rid of QWidget-centric QMacStyle::eventFilter() and implement the fade out animations for scrollbars using QNumberStyleAnimation-based QFadeOutAnimation. Change-Id: I2000fa50d46b153e981ceafc12a53932a196382e Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
* Make it obvious that adding a QLayout to QSplitter is not supported.Mitch Curtis2012-11-021-1/+11
| | | | | | | | | | | | | | | It does not make sense to add a QLayout to a QSplitter, since the splitter manages its child widgets in the same manner as a QLayout. The result of doing so is that the child widgets inside that layout will lead to the splitter and the layout fighting to position the child widgets. QSplitter::addWidget should be used to add widgets directly to the splitter instead. Change-Id: I640b463cae8673f87354d28636bff4dd3cfb9679 Reviewed-by: Samu Voutilainen <samu.voutilainen@gmail.com> Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* Fix progressbar animation on macstyleJens Bache-Wiig2012-11-021-0/+7
| | | | | | | | The animation is not just supposed to run when indeterminate, but also while it is progressing. Change-Id: If176bd230c2f6f83781e01ea77526c24d54c8477 Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* Add implementations of QAIM::sibling in public APIs.Stephen Kelly2012-11-022-0/+22
| | | | | | Change-Id: I2248641f2ed8735c28bd9572470520995a4a5b62 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* speed up tst_QLocalSocket::readBufferOverflowJoerg Bornemann2012-11-021-0/+9
| | | | | | | | Ifdef out waitForBytesWritten on Windows. See comment in source. Change-Id: I7a2268d2634c2524cd8291c72dd9708e430e314e Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* fix error handling bug in QWindowsPipeReaderJoerg Bornemann2012-11-021-1/+0
| | | | | | | | | | | | If ReadFile returns with an error then we must set our internal state accordingly. QWindowsPipeReader::readSequenceStarted must be set to false. If ReadFile fails, we're not within a read sequence. Also, we must handle the ERROR_BROKEN_PIPE error. Task-number: QTBUG-25342 Change-Id: Ic9247f170fa9cc47fa7e45d0f47ccfedac06a593 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* fix tst_QProcess::batFiles for shadow buildsJoerg Bornemann2012-11-021-2/+2
| | | | | Change-Id: If7a9c9aa6ba16b7744d8ef8a66b43e40f375b5e7 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* Fix the gregorian date <-> julian day calculations in QDateJon Severinsson2012-11-021-11/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The old code is just plain wrong for negative julian days. Replaced with plain math from The Calendar FAQ [1], which is correct for all julian days, provided you use mathematical integer division (round to negative infinity) rather than c++11 integer division (round to zero). [1] http://www.tondering.dk/claus/cal/julperiod.php While the conversion code works for up to around JD +/- (2^63/4), we only use an int for the year in the API, so this patch limits minJd() and maxJd() to 1 Jan (2^31) BC and 31 Dec (2^31-1) AD, respectively. Note that while the new conversion code looks like it would be more expensive than the old, gcc will in fact be able to optimize it to be slightly faster (probably because x86 hardware implements round to negative infinity, and so GCC manages to optimize floordiv to a single instruction, compared to the three instuctions needed for operator/). In the following test application, run with a release mode Qt and redirecting stderr to /dev/null, I measured an improvement from 6.81s +/- 0.08s to 6.26s +/- 0.16s user time over five runs on an otherwise idle x86_64 system. int main(int, char *[]) { int year, month, day; qint64 jd; for (qint64 i = Q_INT64_C(-1048576) ; i < Q_INT64_C(1048576); ++i) { QDate::fromJulianDay(i).getDate(&year, &month, &day); jd = QDate(year, month, day).toJulianDay(); qDebug() << jd << year << month << day; } } Change-Id: Ifd0dd01f0027f260401f7f9b4f1201d2b7a3b087 Reviewed-by: David Faure (KDE) <faure@kde.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Introduced QWindow properties {min/max}imum{Width/Height}Samuel Rødal2012-11-021-0/+53
| | | | | | | These are useful when QWindow is exposed to QML. Change-Id: I7ec49ef365183e2c784605889e8ea22c2ef34781 Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
* Improve QDateTime test coverage.Mitch Curtis2012-11-021-129/+262
| | | | | Change-Id: Ic521d9d2ffb1b8e3b14d9cebdeb3dc7a5e08580e Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
* Expose IAccessibleTable2 to non-conformant screen readersJan Arve Saether2012-11-021-1/+81
| | | | | | | This seems to be the established practice. Change-Id: I75a65d722a026ab0eb1805688743f46aba406e6c Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
* SSL certificate printing: Fix auto test for OpenSSL 1.0.1 version.Janne Anttila2012-11-022-8/+59
| | | | | | | | Different OpenSSL versions produce slightly different output when dumping a certificate. Change-Id: Ida98b24422302e287641be074d6740ca292cf203 Reviewed-by: Richard J. Moore <rich@kde.org>
* Compile fix for tst_qstylesheetstyle.cpphjk2012-11-011-1/+1
| | | | | | | There was a semicolon missing. Change-Id: Id2eb843604907acf952d7d238f80ba8a7010ccd1 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* Strip trailing whitespace in itemviews.Stephen Kelly2012-11-014-33/+33
| | | | | | | | | | | Using git ls-files -z | xargs -0 sed -i 's/ \+$//' in the relevant directories. Change-Id: I861ef9952fb32ed2db9ec8b67864ec7d0d61f0f2 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Fix for leak in QFutureChristian Strømme2012-11-012-8/+65
| | | | | | | | | | | To avoid leaking when converting a QFuture<T> to a QFuture<void> we need to have a separate ref. counter for QFuture<T>. When the last QFuture<T> goes out of scope, we need to clean out the result data. Task-number: QTBUG-27224 Change-Id: I965a64a11fffbb191ab979cdd030a9aafd4436c2 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
* move QSystemSemaphore autotest from qtscript to qtbaseOliver Wolff2012-11-015-0/+411
| | | | | | | | | | As the script dependency for that autotest is not really needed it should be moved to qtbase. Task-number: QTBUG-27705 Change-Id: I4ce0d34aca97cadd79b157b0f7c90c406bed4295 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Add manual test for dialogs.Friedemann Kleint2012-10-315-1/+559
| | | | | | | | | Implemented for QFileDialog, currently. Task-number: QTBUG-27621 Change-Id: I0c9b7628aa92e3fbca6f737448a7c469893764f1 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* test: Remove QSKIP from tst_QSettings::dontReorderIniKeysNeedlessly()Sergio Ahumada2012-10-311-5/+3
| | | | | Change-Id: I7b804592398869278e9a0fec982c235c41f2c3d7 Reviewed-by: Caroline Chao <caroline.chao@digia.com>
* test: Moving tst_QMimeDatabase::inheritsPerformance() testSergio Ahumada2012-10-316-33/+97
| | | | | | | | | | tst_QMimeDatabase::inheritsPerformance() is not an unit test but a performance test, so moving it from 'tests/auto/corelib/mimetypes/qmimedatabase' to 'tests/benchmarks/corelib/mimetypes/qmimedatabase' Change-Id: I59e84f61559023659f101666683870f2ca1d2034 Reviewed-by: David Faure (KDE) <faure@kde.org> Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Use qt-project.org in tst_hostinfo - qt.nokia.com changed IP address.Janne Anttila2012-10-311-7/+7
| | | | | | | | | qt.nokia.com is also going to disapper in future, so I think it is better to use qt-project.org. Change-Id: Ice550fe657a33609472b8e4b8630d7649f9c9fb5 Reviewed-by: Shane Kearns <shane.kearns@accenture.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Generate instances of types in the CMake tests.Stephen Kelly2012-10-314-84/+32
| | | | | | | | | | | | | | | | All modules currently have a test_modules CMake test. The new module_includes test has very similar requirements, and can obsolete the hand-maintained test_modules tests in all modules. After all test_modules have been removed in other repos, the module_includes test can be renamed to that name. The types chosen need to have a constructor which can be invoked with no arguments. QtConcurrent has no public classes which fit that description so it is still tested separately Change-Id: Id7929cd32b3112c293cbf5e6964cc894a697f9b1 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* QNX: Use inotify on QNX systems that support itThomas McGuire2012-10-301-0/+5
| | | | | | | Change-Id: Ia9bf8d3c202b17746036e203268ef6229aaa900d Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com> Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Send leave to most recently entered window when modal dialog is shown.Miikka Heikkinen2012-10-301-4/+65
| | | | | | | | | | | | | | | If a modal dialog was shown as a response to button click, the button retained its hover highlight, because it didn't get leave event. Fixed by tracking the most recently entered window and sending a leave to it when modal dialog is shown that blocks it. Also modified tst_QGuiApplication::modalWindow() autotest to check for enters and leaves. Task-number: QTBUG-27644 Change-Id: I387647e18a762a39d523e3df31221b9583a39f9d Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* Only use the user set page margins for custom paperAndy Shaw2012-10-301-0/+59
| | | | | | | | | | | | | | When the QPrinter is initalized then it will set up page margins based on the default paper size. If the paper size is changed to be a custom one then it should disregard the margins for the default paper size. If the page margins are set explicitly beforehand then it will use these page margins. Change-Id: Ic535c3a80b8b217dbd5eb5f4fb2cbc0ab1354563 Reviewed-by: Titta Heikkala <titta.heikkala@digia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* test: Remove QSKIP from tst_QByteArray::literals()Sergio Ahumada2012-10-301-4/+5
| | | | | Change-Id: I07b53cd12790d2161964dd09c5a69fe8aff7c90d Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
* test: Remove QSKIP from ↵Sergio Ahumada2012-10-301-3/+5
| | | | | | | tst_QPainter::drawText_subPixelPositionsInRaster_qtbug5053() Change-Id: I1aa329323767a3e849beca8fe41e39dbe98de4ee Reviewed-by: Caroline Chao <caroline.chao@digia.com>
* test: Remove QSKIP from tst_QListView::setCurrentIndexAfterAppendRowCrashSergio Ahumada2012-10-301-4/+5
| | | | | Change-Id: I8d48722b412895e43aa8a522354c5d67d83c19dd Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
* Check for both A and P when converting QDateTime to string.Mitch Curtis2012-10-301-2/+4
| | | | | | | | | | hasUnquotedAP currently only checks for an a or A, which is wrong according to both the toString documentation and the comments for hasUnquotedAP. Change-Id: I03015734b846fe761085cf8f8fca2b29210cff97 Reviewed-by: Jon Severinsson <jon@severinsson.net> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>