summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* QDebug: Improve QDebug stream operator for QFlagsKai Koehne2014-07-301-0/+23
| | | | | | | | Use the built-in hex, showbase manipulator to format the number in hex. Also, apply nospace() only once. Change-Id: Id4b3d5f082ad13f52c8711408d7ec609bec3a621 Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
* Add qFormatLogMessage()Kai Koehne2014-07-301-1/+61
| | | | | | | | | | | | | | Export the former qMessageFormatString() as qFormatLogMessage(). This allows custom message handlers to format their messages just like the default message handler, taking qSetMessagePattern() / QT_MESSAGE_PATTERN into account. The method should arguably not add the '\n' at the end, which a follow up commit will fix. Change-Id: Ib2a9cfda91473df079daf03bf3197e6ac63e013e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
* add priority sorting to $$resolve_depends()Oswald Buddenhagen2014-07-301-0/+9
| | | | | | | | all else being equal, items with a higher numerical priority will appear first in the result. Change-Id: I4ee37ff404a53c4152a1e4fc2fc3c23ef525234d Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Add initializer list support in QJsonObject.Jędrzej Nowacki2014-07-301-2/+53
| | | | | | | | | | | | | | It allows to create a QJsonObject instance in C++ by using initializer list of pairs QString QJsonValue, for example: QJsonObject o = {{"property1", 1}, {"property2", 2}}; [ChangeLog][QtCore][QtJson] QJsonObject now supports C++11 initializer lists. Task-number: QTBUG-26606 Change-Id: I67af881e175f427e563e685336c48a5f8466b476 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QMdiArea: Store focus widget when new QMdiSubWindow is added.Friedemann Kleint2014-07-301-1/+46
| | | | | | | | | | | Introduce function QMdiSubWindowPrivate::storeFocusWidget() to store focus widget and call this when de-activating a sub window. Change restoreFocus() to return a bool and call it from QMdiSubWindowPrivate::setActive(). Task-number: QTBUG-38378 Change-Id: I18dbe66ce85213ca5b4907b5a09126544415351a Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Export QAbstractState active property.BogDan Vatra2014-07-291-16/+888
| | | | | | | It is needed to check if a State is active. Change-Id: I8aa0230b8cd96fb9b95b86b2ce118fe280f9ce97 Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* tst_QFont: remove unused static functionMarc Mutz2014-07-281-14/+0
| | | | | | | | This function has been inlined in commit 4f50be8d, but wasn't removed. Change-Id: I1a4eb7399ab2dd87a9fb15c4c886004d777487a8 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
* Logging: support %{backtrace} in QT_MESSAGE_PATTERNOlivier Goffart2014-07-283-7/+64
| | | | | | | | | | | On supported platform, allow to show a backtrace by using %{backtrace} or %{backtrace depth=N separator="|"} [ChangeLog][QtCore][Logging] QT_MESSAGE_PATTERN can include a backtrace using %{backtrace} Change-Id: Ib00418c070d3bd6fe846dc04bf69fa91ba64f9cd Reviewed-by: Kai Koehne <kai.koehne@digia.com>
* Fix typo with impact on test outputJoão Abecasis2014-07-281-1/+1
| | | | | | | | If the test fails here, output the values actually used in comparison. Change-Id: Ie4ed5ebdf1951c02b89a9648aee50a99d0bb0628 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Add missing to gui/kernel benchmarks.Jędrzej Nowacki2014-07-281-1/+3
| | | | | | | kernel.pro was not updated. Change-Id: Ibe11aaf5d6e788dacd2a2d33088fb9445334fb4e Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
* Remove useless QMetaType benchmarksJędrzej Nowacki2014-07-282-143/+7
| | | | | | | | | | | | | Cost of a type lookup for core built-in types is really small, just few cpu instructions, but the benchmark was testing create() and destroy() functions (in a different fashion) which by definition allocate and de-allocate memory. These memory operations are significantly more expensive which obfuscate the results. Change-Id: I33c679f57e6c2b57e98328f076dfe249ab7bcde8 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Stephen Kelly <steveire@gmail.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Clean up tst_QPaletteMarc Mutz2014-07-261-37/+2
| | | | | | | Remove ctor, dtor, and empty test functions. Change-Id: I0cf60732258c4470f40ddb258d87f0ac2de64edf Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* QUrl: fromLocalFile(QString()) should lead to an empty URL.David Faure2014-07-261-0/+5
| | | | | | | | | | | | | | This is much more useful than the URL "file:", it allows to use "empty path" and "empty URL" for the same meaning (e.g. not set). QFileDialog actually uses "file:" though, as the URL for the "My Computer" item in the sidebar. This patch preserves that. [ChangeLog][QtCore][QUrl] QUrl::fromLocalFile now returns an empty URL if the input string is empty. Change-Id: Ib5ce1a3cdf5f229368e5bcd83c62c1d1ac9f8a17 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Integrate tst_bench_qringbuffer into the build tree.Alex Trotsenko2014-07-251-0/+1
| | | | | Change-Id: Id1d091889c3ba5e343d1237f016fdc22f7dfe413 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* Fix compilation on ARM without ARMv6T2Thiago Macieira2014-07-251-3/+3
| | | | | | | | | | | | | | | | | | The "rbit" instruction requires ARMv6T2 or higher. This was found in the CI when building the imx6 target: Compiler: arm-poky-linux-gnueabi-g++ Flags: -mfloat-abi=hard -mfpu=neon Errors from the assembler: {standard input}:3078: Error: selected processor does not support ARM mode `rbit r3,r3' {standard input}:7341: Error: selected processor does not support ARM mode `rbit ip,ip' That compiler defaults to ARMv5T. That's obviously wrong for an i.MX 6, which is a Cortex-A9 (ARMv7), but the correction applies for older processors. Change-Id: I56c276fa411977dd7cd867d62adf021e4909302c Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
* tst_qgraphicsproxywidget: Fix widget leaks.Friedemann Kleint2014-07-251-16/+24
| | | | | Change-Id: I953e308e2380c87a69ca1d22e6ac036c57deccda Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
* tst_qmdiarea: Fix widget leaks.Friedemann Kleint2014-07-251-2/+13
| | | | | Change-Id: If2ecf2c080f9eb8416b9a3d4104584681862c266 Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
* Fix QJsonValue comparison.Jędrzej Nowacki2014-07-251-0/+55
| | | | | | | | | QJsonValue, while comparing two QJsonArrays, should consult also length of the arrays, because a different than null base pointer doesn't mean that an array is not empty. Change-Id: If76739355a4e74b842e836289565f98d95c006d5 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Fix QJsonValue comparison.Jędrzej Nowacki2014-07-251-4/+10
| | | | | | | | | QJsonValue, while comparing two QJsonObjects, should consult also length of the objects, because a different than null base pointer doesn't mean that an object is not empty. Change-Id: Ibee1849ef9fed15d32f2c8f2aad9b053846e46b7 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Reading QJsonObject property should not modify the object itself.Jędrzej Nowacki2014-07-251-0/+124
| | | | | | | | | | | | | | | | | | | | | | | | | Before this change such code: QJsonObject o; o["blah"]; would create property "blah" and assign null value to it, while this code: const QJsonObject o; o["blah"]; would not. The change unifies the confusing behavior. Now reading a non-existing property, is not causing a property to be added in any visible way. Internally QJsonObject stores a special hash of undefined, but referenced values. Such reference is supposed to not live long, only to the first compacting or assignment. Change-Id: Ib022acf74ff49bad88d45d65d7093c4281d468f1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Fix QJsonObject const index operatorJędrzej Nowacki2014-07-251-0/+18
| | | | | | | | | The operator should always return an undefined values for an empty object Change-Id: Ic38f7660d77c64b2d001967bc5109df4185db74a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* tst_qwidget: Fix top level widget leaks.Friedemann Kleint2014-07-251-6/+9
| | | | | | | | | Fix tests widgets leaking widgets and ensure it stays that way by adding a check to cleanup(). Task-number: QTBUG-38858 Change-Id: I77a81d823c68cf0b4e51c2da55b1c473d6e4170b Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
* QLineEdit: Emit textEdited() when the clear button is clicked.Friedemann Kleint2014-07-241-2/+8
| | | | | | | | | | [ChangeLog][QtWidgets][QLineEdit] The signal textEdited() is now emitted when the user clicks the clear button created by setClearButtonEnabled() as well. Task-number: QTBUG-40287 Change-Id: Iacd303ffd1533f27cfa68a6120cdd370e3d31ddc Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Merge "Merge remote-tracking branch 'origin/5.3' into dev" into refs/staging/devFrederik Gladhorn2014-07-2415-11/+203
|\
| * Merge remote-tracking branch 'origin/5.3' into devFrederik Gladhorn2014-07-2215-11/+203
| |\ | | | | | | | | | | | | | | | | | | | | | Conflicts: src/widgets/kernel/qwidget_qpa.cpp src/widgets/widgets.pro Change-Id: I697eec936c4e1a6c360edc8f0b472e23c0461ecb
| | * tst_qurl: add tests for mailto parsing and toString. No bug.David Faure2014-07-221-0/+7
| | | | | | | | | | | | | | | | | | | | | This was prompted by https://git.reviewboard.kde.org/r/119221 Change-Id: Ia148f07f6d711df533693918bbedfa5e7dc02cd5 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | * Android: Fix tests in gui/text requiring test dataEskil Abrahamsen Blomfeldt2014-07-2111-10/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Several tests require test data to be deployed with the application. The easiest way to achieve this on Android is to add them to a qrc file and use the QFINDTESTDATA macro to look up the files. This fixes several test failures in the gui/text subdirectory for Android. Change-Id: If944bb1fc93434a1b2d6487da829d21bd6b84e87 Reviewed-by: BogDan Vatra <bogdan@kde.org>
| | * Ensure transient parents are top level widgets.Friedemann Kleint2014-07-181-0/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a dialog was parented on a native child widget, its window handle was used as a transient parent. This confused QPlatformWindow::initialGeometry() among other things. Use top level window as is in Qt 4. Task-number: QTBUG-40195 Change-Id: Ic82adc276175f92adde825fb2551274351e41f30 Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
| | * Added stream version into network cache file formatNikita Krupenko2014-07-171-0/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | At the moment, there is no stream information in the cache file. This can lead to a problem when current stream version differs from version cache file written with. As an example, if file written with Qt 5.1.1, QTimeDate in the metadata stored as 13-bytes value, but Qt 5.2 and later can read additional 4 bytes which breaks following data, leading to network request just hangs forever. Adding stream version fixes this problem. As cache format changed, cache version bumped. Task-number: QTBUG-36219 Change-Id: I467d8c9fda82bcf9302192f51e7a00d2f6a9ff66 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
| | * QSplitter: Exclude top level widgets from child event handling.Friedemann Kleint2014-07-151-1/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | Prevent the splitter from adding them to the layout or showing them. Task-number: QTBUG-40132 Change-Id: Ife2be0bbd7e489570ef41f6f72a034b356c65f18 Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* | | Add checks for widget/window leaks to kernel tests.Friedemann Kleint2014-07-244-1/+20
| | | | | | | | | | | | | | | Change-Id: I52af87279e37e49ce2206c5c823fe8fb4caef338 Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
* | | QSettings: use QSaveFile and QLockFile to write the settingsOlivier Goffart2014-07-241-3/+73
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The old unix locking code is no longer working on unix since it locks on a file descriptor, but QSaveFile creates a new file, and as a result we get the lock on the wrong file. Also there is no need to keep the lock held only for reading as QSaveFile is atomic. It just needs to be held when doing a read before writing. As a result, since we don't hold the same lock, there could be a race with an application running an older version of Qt if they are writing on the same configuration file. [ChangeLog][QtCore][QSettings] Fixed data loss while writing the config to the disk fails. [ChangeLog][Important behavior changes] The locking mechanism inside QSettings has changed and is no longer compatible with the one of previous versions of Qt. There might be corruption if two applications running different versions of Qt are writing to the same config file at the same time. You must also now have write permissions in the directory containing the settings file in order to write settings Task-number: QTBUG-21739 Change-Id: I0844a5e96c8bc1e1222a3dac6cc48170ca77fe1b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Rewrite QRingBufferAlex Trotsenko2014-07-243-0/+211
| | | | | | | | | | | | | | | | | | | | | | | | | | | QRingBuffer is a fully inlined class used in many I/O classes. So, it must be as fast and small as possible. To this end, a lot of unnecessary special cases were replaced by generic structures. Change-Id: Ic189ced3b200924da158ce511d69d324337d01b6 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* | | Make QTextStream respect QLocale with OmitGroupSeparatorsThiago Macieira2014-07-241-86/+114
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The default in QTextStream is to use the C locale, so default QTextStream are not affected. When you set a QLocale on it, the default was to use group separators (which is the QLocale default too). This commit makes QTextStream respect a QLocale in which the OmitGroupSeparators option had been set. Task-number: QTBUG-39956 Change-Id: I00fbe12fca7f0287c7217deb487ded6582a03b52 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | | tst_qfiledialog: use QStandardPaths test modeDavid Faure2014-07-231-11/+8
| | | | | | | | | | | | | | | | | | | | | | | | Otherwise, when interrupting the test half-way (e.g. in gdb), the user's ~/.config/QtProject.conf would be modified. Change-Id: Id582c4a3fbf0acbed460126fccf0d39b3a09758a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* | | Don't store QLibraryPrivate with empty file names in the global storeThiago Macieira2014-07-231-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | They shouldn't exist in the first place. They exist in two cases only: 1) mistake by the user in the QLibrary or QPluginLoader constructors or setFileName 2) as a kludge for setLoadHints before a file name is set (we need to store the user's requested hints somewhere) This is important for the second case, as otherwise all QLibrary and QPluginLoader objects without a file name would share the setting. Task-number: QTBUG-39642 Change-Id: Iebff0252fd4d95a1d54caf338d4e2fff4de3b189 Reviewed-by: David Faure <david.faure@kdab.com>
* | | Fix a few more race conditions with QLibrary::LoadHintsThiago Macieira2014-07-231-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit makes replaces the loadHints member with a setter, a getter and an atomic variable. The setter will not set anything if the library has already been loaded. Task-number: QTBUG-39642 Change-Id: Ibb7692f16d80211b52aaf4dc88db1a989738a24d Reviewed-by: David Faure <david.faure@kdab.com>
* | | Support setting a default severity level for QLoggingCategoryKai Koehne2014-07-231-2/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allow to alter the default configuration for categories by passing a message type: All message types with lower severity are disabled in this category. This is useful for libraries, which shouldn't mess with the category registry itself: Setting rules, a category filter ... might cause conflicts and ordering problems, so this API should be reserved to the specific application. For the Qt categories, we have code in the default category filter that disables the 'debug' category. However, this is hardcoded, and there's no way so far for other libraries to get the same behavior. With this patch one can get the same behavior: Q_LOGGING_CATEGORY(DRIVER_USB_EVENTS, "driver.usb.events", QtWarningMsg); [ChangeLog][QtCore][Logging] Added QtMsgType argument to QLoggingCategory constructor and Q_LOGGING_CATEGORY macro that controls the default category configuration. Change-Id: Ib2902f755f9f7285d79888ec30e8f3cef95ae628 Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
* | | QDebugStateSaver: Fix trailing space issuesKai Koehne2014-07-231-0/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ~QDebug() removes any trailing space if autoInsertSpaces() is true. However, if one uses QDebugStateSaver the global autoInsertSpaces might be false, but a space was added by a custom operator<<. Explicitly check for this in QDebugStateSaverPrivate::restoreState. Remove any trailing space if the local state asks for adding trailing spaces, but the original one doesn't. Add a trailing space if the local state doesn't ask for one, but the global state does. Change-Id: I243b5c76d5ed2c1ec4820da35ab6e254da1551d9 Reviewed-by: David Faure <david.faure@kdab.com>
* | | Make QRingBuffer::append() not leave empty arrays in buffer listAlex Trotsenko2014-07-231-0/+15
| | | | | | | | | | | | | | | Change-Id: I4c5af33488a70996299289ec2b953b7bf3b2c428 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* | | Add QFileDevice::MemoryMapFlags::MapPrivateOption flag.Simon Sasburg2014-07-231-7/+15
|/ / | | | | | | | | | | | | | | | | | | Passing this flag to QFileDevice::map() will allow writes to the mapped memory without modifying the file that was mapped. These writes will be lost when the memory is unmapped. Change-Id: I7d46b044fc370585de8c06fdb4059f1f1be12d7d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* | Android: Add uninstall option.BogDan Vatra2014-07-211-0/+8
| | | | | | | | | | | | | | | | Uninstall option will uninstall the test afer has been executed. It is useful when you are using your own phone to execute the tests. Change-Id: I2a3f6c3a93099d70c98f9ce059da22c409b55843 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* | Android: Use androiddeployqt from qt path.BogDan Vatra2014-07-211-2/+3
| | | | | | | | | | Change-Id: I085f2b20d1f53e3f5caf0b208f64a75c26a89219 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* | Fix up existing high DPI manual test.Friedemann Kleint2014-07-182-53/+125
| | | | | | | | | | | | | | | | | | Compile on Windows, add command line options to activate the various tests. Task-number: QTBUG-38858 Change-Id: I38c6a9a6711831b2bd8b6ea051dd19615cc911a1 Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
* | RCC: Use macros not defined in qglobal.hhjk2014-07-161-14/+14
| | | | | | | | | | | | | | | | | | This prevents conflicts in case of link time optimizations or precompiled headers are used since we don't include qglobal.h in the generated code. Change-Id: I4266c8ae38e6eafefd28b3bde5cb725a24d67ea0 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* | QDebug: Add resetFormat()Kai Koehne2014-07-151-1/+18
| | | | | | | | | | | | | | | | | | | | Similar to QTextStream::reset(), this resets the stream format to the defaults. Its primary use is inside custom operator<< implementations, where you'd want to have a fixed format regardless of the current stream state. Change-Id: I421d76c61f164579bb90cf4195cc5376e2dcf0f3 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* | QGroupBox: Exclude top level widgets from child event handling.Friedemann Kleint2014-07-151-0/+19
| | | | | | | | | | | | | | | | | | Prevent the QGroupBox from changing the enabled state of dialogs parented on it. Task-number: QTBUG-40132 Change-Id: I91cc6ccf5ade0b3a491020ed947d4aceca62d7b6 Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* | Fix current directory setting in manual dialog test.Friedemann Kleint2014-07-152-6/+12
| | | | | | | | | | | | | | | | | | It was always constructing a QUrl from the string causing the warning "Non-native QFileDialog supports only local files" with the new QUrl-based implementations of getOpenFileUrl(), etc. Change-Id: Idd9bb432a48865df137f8f39f53014dda150ffe9 Reviewed-by: David Faure <david.faure@kdab.com>
* | Merge "Merge remote-tracking branch 'origin/5.3' into dev" into refs/staging/devShawn Rutledge2014-07-144-5/+39
|\ \
| * | Merge remote-tracking branch 'origin/5.3' into devFrederik Gladhorn2014-07-144-5/+39
| |\| | | | | | | | | | | | | | | | | | | Conflicts: src/gui/text/qfontengine_qpf2.cpp Change-Id: Ib04f92c41d0edd55d3aef8fb1708d917fba0f2a8