summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Speed up QTimeZone::isTimeZoneIdAvailable by a factor 43David Faure2018-04-233-0/+57
| | | | | | | | | | | | | | | | | Creating and sorting a list of bytearrays just to check if one entry is present, is really overkill. By adding a new virtual method isTimeZoneIdAvailable() in the backend classes, we can do this much more efficiently. Implemented for Utc and Tz backends, the others fall back to the slow way. The new benchmark shows, in release mode: Before: 43 msecs per iteration (total: 86, iterations: 2) After: 1.1 msecs per iteration (total: 73, iterations: 64) Change-Id: Ic0d79a41d74e2ce6aa088fa7986c41d33902c36b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Merge "Merge remote-tracking branch 'origin/5.11' into dev" into ↵Qt Forward Merge Bot2018-04-203-190/+154
|\ | | | | | | refs/staging/dev
| * Merge remote-tracking branch 'origin/5.11' into devQt Forward Merge Bot2018-04-203-190/+154
| |\ | | | | | | | | | Change-Id: I0bea38585382b5d9c8d7a013bf6bcb3a6008d159
| | * Send ShortcutOverride event when receiving a non-spontaneous key pressAndy Shaw2018-04-201-0/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a key press is received which is not spontaneous then it needs to be manually sent as a shortcut override event to ensure that any matching shortcut is triggered first. This enables emulation/playback of recorded events to still have the same effect. [ChangeLog][QtWidgets] Sending a key press event with sendEvent() now sends a ShortCutOverride event first to the widget to trigger any shortcuts set first. Task-number: QTBUG-48325 Change-Id: Iafcc2cdb1773bffe89edaeb0abc44cd5a51088e6 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
| | * Manual shortcut test: Arrange in QGridLayoutFriedemann Kleint2018-04-181-190/+114
| | | | | | | | | | | | | | | Change-Id: I93264bec8810f4dd1e2c010cc4dd35df93f31102 Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
| | * Blacklist tst_QWindow::isActive on UbuntuKari Oikarinen2018-04-181-0/+3
| | | | | | | | | | | | | | | | | | Task-number: QTBUG-67768 Change-Id: Ie1e0b406c152c854ef3629fa4d469dd73452f128 Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* | | tst_qimagereader: Make sure to include all image resources in testTor Arne Vestbø2018-04-202-70/+2
|/ / | | | | | | | | | | | | | | The manually maintained qrc file was missing corrupt_clut.bmp among others. Change-Id: I8916ba76a63950de03f25814d893306d046d273d Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Add HTTP caching headers to KnownHeadersJan Murawski2018-04-191-0/+96
| | | | | | | | | | | | | | | | | | | | | | | | | | QNetworkRequest is already aware of the Last-Modified header but has been lacking support for the If-Modified-Since, ETag, If-Match and If-None-Match headers. These headers are used with HTTP to signal conditional download requests. See RFC 7232 for more information. Change-Id: I248577b28e875fafd3e4c44fb31e8d712b6c14f1 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | QObject: Extend debug output of connectLars Schmertmann2018-04-181-0/+21
| | | | | | | | | | | | | | | | | | | | Sometimes it is hard to find the line, when the warning "QObject::connect: invalid null parameter" appears in the log. This change adds the class names of the sender and receiver to give a hint where to search for the wrong call to connect. Change-Id: I00cead7d943f96d60f198cb3f0bed34ba10285c5 Reviewed-by: André Hartmann <aha_1980@gmx.de>
* | Auto-tests: remove unneeded 'gui' from QT variableTimur Pocheptsov2018-04-182-3/+3
| | | | | | | | | | | | | | | | none of these tests needs anything GUI-related. Change-Id: I6b3c02bf13da60ab460f0cc4d804f1d03bc68f50 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* | h2 auto test - replace QEventLoop (and QTimer) with QTestEventLoopTimur Pocheptsov2018-04-182-13/+4
| | | | | | | | | | | | | | | | | | QTestEventLoop (conveniently so) takes care of timeouts thus no external QTimer/handling logic needed at all. Change-Id: Id65ea928daec1e7d9380107e63916896f19d3d14 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | Don't send a mouse move when we just need to do a synthetic enter/leaveAndy Shaw2018-04-181-5/+15
| | | | | | | | | | | | | | | | | | [ChangeLog][QtWidgets] QApplication no longer sends a mouse move event to the entered widget if it sends synthetic enter and leave events. Task-number: QTBUG-67736 Change-Id: I75daaffd53f1ddc2bc4d7df67382cbc22d3eb6fc Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* | Merge remote-tracking branch 'origin/5.11' into devQt Forward Merge Bot2018-04-181-0/+3
|\| | | | | | | Change-Id: I86f04fc3b2e4291f161a4985adddd6fd6c789d33
| * tst_qdir: Fix absoluteFilePath for winrtOliver Wolff2018-04-161-0/+3
| | | | | | | | | | | | | | | | The drive has to be defined for every Windows configuration (also including winrt). Change-Id: I94a3131b8aec20cda97dc78f55b1d87aa10240e4 Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* | Make generated selftest output match for in-source buildsEdward Welbourne2018-04-171-5/+17
| | | | | | | | | | | | | | | | | | | | | | When generate_expected_output.py is run for an in-source build, the raw output contains no paths to the sources for the script to whittle down, as it does for shadow builds, to just the path from qtbase down. So kludge together some extra regexes that can fix that up and tweak some relevant code to provide them with the data they need. Change-Id: I656d7126087bd9ad20b2af6835fba314d90a171d Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | QDoubleValidator: Allow intermediate values as close as possible to one ↵Andy Shaw2018-04-171-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | considered invalid The documentation states that if you have a range of 0.00-2.00 with the number of decimals set to 2 then any number up to 9.99 would be considered intermediate. This is because the number of digits still matches both before and after the decimal point. If it is 10.0 or 9.999 then it is still considered invalid. In the case of 9.999 being invalid in this case, the documentation is corrected as this was incorrectly indicated as Intermediate, as the code indicates it as Invalid. Change-Id: I07b433e856f355916a1240deafdf4ef58e680639 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Merge remote-tracking branch 'origin/5.11' into devQt Forward Merge Bot2018-04-155-102/+42
|\| | | | | | | Change-Id: I8c353b4c53e90434453c76691eac39a894d23b49
| * tests/auto/widgets/util: Avoid unconditional qWait()sKari Oikarinen2018-04-132-17/+9
| | | | | | | | | | | | | | Task-number: QTBUG-63992 Change-Id: I795e564b051bbabd1fc2d2fca8171da6072f99eb Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
| * tst_QWidget: Avoid unconditional qWait()sKari Oikarinen2018-04-131-85/+19
| | | | | | | | | | | | Task-number: QTBUG-63992 Change-Id: I1696ccbdf0523ece694f2dac52c015443c8b19fb Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
| * Fix crash if QPixmap::defaultDepth() is called when no QGuiApplicationEirik Aavitsland2018-04-121-0/+2
| | | | | | | | | | | | | | | | | | | | This static method can be called before QGuiApplication is created. At that point there is yet no primary screen, so the implementation needs to guard against dereferencing a nullptr. Task-number: QTBUG-67309 Change-Id: I6b7b9e97b1c3c79bf2f9c6d6247c3b10f39f7a55 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| * QWindowsPipeReader: fix waiting on inactive pipeAlex Trotsenko2018-04-121-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To read data from a named pipe, QWindowsPipeReader uses the ReadFileEx() function which runs asynchronously. When reading is completed and the thread is in an alertable wait state, the notified() callback is called by the system, reporting a completion status of that operation. Then the callback queues a readyRead signal and starts a new sequence. The latter is skipped if the pipe is broken or the read buffer is full. Thus, if an application does not run the event loop, the next call to QWindowsPipeReader::waitForReadyRead() should emit the queued signal and report true to the caller even if no new read operation was started. Change-Id: I37102dbb1c00191d93365bfc2e94e743d9f3962a Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* | Merge remote-tracking branch 'origin/5.11' into devLars Knoll2018-04-1216-76/+113
|\| | | | | | | Change-Id: I9f802cb9b4d9ccba77ca39428a5cb1afd2d01642
| * HTTP/2 - reset uploadByteDevice if necessaryTimur Pocheptsov2018-04-123-2/+78
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. If a request was redirected or some error was encountered, we try to reset the uploading byte-device. 2. Disconnecting from the byte-device is not enough, since we have a queued connection, _q_uploadDataReadyRead() gets called even if byte-device was deleted and thus sender() can return null - we have to check this condition. 3. Update auto-test with a case where our server immediately replies with a redirect status code. Task-number: QTBUG-67469 Task-number: QTBUG-66913 Change-Id: I9b364cf3dee1717940ddbe50cba37c3398cc9c95 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
| * Cut down on drawPixmap and drawImage combinationsAllan Sandfeld Jensen2018-04-121-8/+2
| | | | | | | | | | | | | | | | | | | | | | There are too many combinations and the data is not very useful when it is impossible to get an overview. This cuts a few rare formats out and reduces the sizes tested to one small for overhead benchmarking and one large for bandwidth benchmarking. Change-Id: If0fe33e0e02b8cba771094a79072036f2cd4cf48 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io> Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
| * Blacklist tst_QItemDelegate::comboBox on openSUSEKari Oikarinen2018-04-122-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This failed (occasionally) in finding the editor widget, so wait for the window to be shown properly. Also enter the event loop with QTRY_VERIFY and not for a fixed time of 1 s. This however just moved the point of failure. Now the test fails since the clearing and setting of focus does not dismiss the editor widget sometimes, so still blacklist it. Task-number: QTBUG-67282 Task-number: QTBUG-66216 Change-Id: Iec598609fce23a25d7b955082d0973685d612715 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
| * Don't mark tst_QFiledialog as insignificant_testKari Oikarinen2018-04-121-2/+0
| | | | | | | | | | | | | | Change-Id: Id3fef4e66bd8f96c8f87dd94bbca216cc65f8489 Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
| * tests/auto/dbus: Avoid unconditional qWait()sKari Oikarinen2018-04-123-32/+15
| | | | | | | | | | | | | | | | | | | | Use QTRY_COMPARE instead of a wait followed by QCOMPARE. Unless the condition doesn't change and the wait provides the opportunity for things to go wrong. Task-number: QTBUG-63992 Change-Id: I13474a45f1f4df9d77a418729a5748235ae0dd1a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
| * QMacStyle: CC_ComboBox is now HITheme-freeGabriel de Dietrich2018-04-121-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For the time being, no more stretched QComboBox. They were already looking bad before and nobody complained, so it's a non-issue. In the future, we might use square combo boxes in the same way as we do for push buttons but for non-editable QComboBox only. Removes what is now dead code, including some leftovers. tst_QMacStyle updated to reflect size changes to accom- modate the focus ring. Change-Id: I60fac86b9acb52cc96373bca0b3cad598ec4f1e7 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
| * QSslSocket (OpenSSL 1.1) - respect requested protocol versionTimur Pocheptsov2018-04-111-10/+4
| | | | | | | | | | | | | | | | | | | | | | | | Properly handle single protocol TLS configurations. Previously, due to the use of generic (non version-specific) client/server method they worked as ranges of protocols instead. This also fixes a couple of previously broken tests. Task-number: QTBUG-67584 Change-Id: Ied23113a4fab6b407a34c953e3bd33eab153bb67 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
| * tests/auto/gui/kernel: Use QTRY_VERIFY instead of manual wait loopsKari Oikarinen2018-04-112-12/+3
| | | | | | | | | | | | | | | | This reduces the timeout from 10 seconds to the default 5, but the tested events (resize events, painting) seem like something that should happen in 5 seconds. Change-Id: I1d12372f37264bf7be64096e43813cd03f567102 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
| * Stabilize tst_QWidget_window::setWindowStateKari Oikarinen2018-04-111-1/+1
| | | | | | | | | | | | | | | | | | | | Bumping the timeout removed flaky failures in an RHEL debug VM. Task-number: QTBUG-67151 Task-number: QTBUG-66216 Change-Id: I2fde636149f5104a41b757df956d84edc420e7c7 Reviewed-by: Sami Nurmenniemi <sami.nurmenniemi@qt.io> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| * tst_QGL: Use qWaitForWindowExposed()Kari Oikarinen2018-04-111-2/+1
| | | | | | | | | | | | | | Instead of an unconditional wait. Change-Id: I360cd665c10c3fd4f936c95ef04957ae1c49c0de Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* | Clean up some trivia in tst_QTimeZoneEdward Welbourne2018-04-121-2/+3
| | | | | | | | | | | | | | | | | | Fix a mistaken #ifdef that should have been #if; and only call QTimeZone::availableTimeZoneIds() once in transitionEachZone_data(), while switching to use of a ranged-for. Change-Id: Id27aae9ef450f21350283099c892ca7173884b94 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Add more formatting to QTextDocumentWriter when writing ODF filesDaniel Savi2018-04-111-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QTextDocumentWriter only supports a small subset of table formatting when exporting to ODF-format. This patch adds more formatting capabilities to the ODF exporter: - table border support - table alignment - table width - respect column constraints (column widths) - add a tab before soft line breaks. This will avoid causing the last line to stretch all over the cell in justified paragraphs. With this patch, line height settings are now exported, too. [ChangeLog][QtGui][QDocumentWriter] QDocumentWriter now supports table borders, table alignment, table width, column widths, line height and image resolution when exporting QTextDocuments to ODF files. Task-number: QTBUG-63581 Change-Id: I2d269ef0f842e73af64d48bfef531d5fa3078088 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Fix loading pkcs#8 encrypted DER-encoded keys in opensslMårten Nordheim2018-04-11116-8/+579
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When we load DER-encoded keys in the openssl-backend we always turn it into PEM-encoded keys (essentially we prepend and append a header and footer and use 'toBase64' on the DER data). The problem comes from the header and footer which is simply chosen based on which key algorithm was chosen by the user. Which would be wrong when the key is a PKCS#8 key. This caused OpenSSL to fail when trying to read it. Surprisingly it still loads correctly for unencrypted keys with the wrong header, but not for encrypted keys. This patch adds a small function which checks if a key is an encrypted PKCS#8 key and then uses this function to figure out if a PKCS#8 header and footer should be used (note that I only do this for encrypted PKCS#8 keys since, as previously mentioned, unencrypted keys are read correctly by openssl). The passphrase is now also passed to the QSslKeyPrivate::decodeDer function so DER-encoded files can actually be decrypted. [ChangeLog][QtNetwork][QSslKey] The openssl backend can now load encrypted PKCS#8 DER-encoded keys. Task-number: QTBUG-17718 Change-Id: I52eedf19bde297c9aa7fb050e835b3fc0db724e2 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | Merge remote-tracking branch 'origin/5.11' into devLiang Qi2018-04-113-1/+7
|\| | | | | | | | | | | | | Conflicts: src/plugins/platforms/ios/quiview.mm Change-Id: I0fd0adeca1590fffddd577873172f6d987a60412
| * Enable BuiltIn input in the shader graph builderJuan Jose Casafranca2018-04-101-0/+4
| | | | | | | | | | | | | | | | BuiltIn inputs shouldnt be translated into a code input. We comment the input line for this variables Change-Id: I3b7d2fd06afc6a122d90a999fc5a5246fc93234e Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
| * Fix tst_QFiledialog::completerKari Oikarinen2018-04-101-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The test was failing because the files it expected to create were not actually visible on the disk. This was because 189e9c93d7ed42202ad51507c8944d64e9a7888d made QTemporaryFile use unnamed files if the file name is not actually requested. Fix by forcing the temporary file to be made with the requested name. CI has not caught this because the test executable is marked insignificant_test on Linux. Change-Id: Ibe0244fdfcc66acf3be4314da51b4c0b3b520b71 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * tst_QEventLoop: Remove unconditional qWait()Kari Oikarinen2018-04-101-1/+0
| | | | | | | | | | | | Task-number: QTBUG-63992 Change-Id: I9d9e3966252f01cded489313561641e1c0292b91 Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* | QPixmapCache: make sure to not overflow cache limitChristian Ehrlicher2018-04-101-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The cost for the pixmap cache was calculated in bytes but setCacheLimit() takes the size in kilobytes. This lead to the situation that all values above 2097152 overflowed and disabled the caching completely. Fix it by calculating the cost in kilobytes as it is done in QGLContext. Task-number: QTBUG-45293 Change-Id: Ib8dc2360c8f3201ce0b615a04c38b5ccaa8fc6cf Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* | Revert "tst_QSslSocket::signatureAlgorithm - fix for OpenSSL 1.1"Timur Pocheptsov2018-04-101-7/+1
| | | | | | | | | | | | | | | | | | | | | | This reverts commit e2694fa602e95a9043561e7dfb9f5956c08a5f14. I'm reverting this patch - I'll fix QSslSocket instead to respect the requested protocol version. Change-Id: Ia4bb09a8801c58bc76837518934ac7a3eedd3c07 Reviewed-by: Lars Schmertmann <lars.schmertmann@governikus.de> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | QtGui: Add qt_imageToWinHBITMAP(), qt_imageFromWinHBITMAP()Friedemann Kleint2018-04-102-0/+114
| | | | | | | | | | | | | | | | | | | | | | Add functions for converting QImage to HBITMAP and back supporting additional formats of QImage (RGB888, RGB555, Indexed8 and Mono). Add test with roundtrip to tst_qimage similar to tst_QPixmap::toWinHBITMAP(). Task-number: QTBUG-51124 Change-Id: Ib568898e7162686bfa527d828785628eb0b78e21 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* | QCryptographicHash: Add a static method to retrieve hash lengthMårten Nordheim2018-04-101-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | It's useful when you need to check how long a hash will be without first generating one. [ChangeLog][QtCore][QCryptographicHash] Add a static method, hashLength, which returns the length of the output of a hash function in bytes. Change-Id: Id6a454016523de83d157fd95c50105c6db4bb1d9 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | Merge remote-tracking branch 'origin/5.11' into devQt Forward Merge Bot2018-04-105-31/+30
|\| | | | | | | Change-Id: I0120f804522c0c652e9537b6e9fe08189f071ed2
| * Unblacklist qsslkey for LinuxMårten Nordheim2018-04-091-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Except RHEL-6.6 and 7.4 It was blacklisted in f3939d943ed132eaf3daead797d961c3ffbc31a5, along with a lot of other entries. No specifics are known about why it was blacklisted originally, but now it only fails on RHEL because they use OpenSSL 1.0.1. Change-Id: I6d1d1b7b7bf5386b2115b8780163550cf03bbad7 Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
| * tst_QClipboard: Skip on Wayland, as it requires real input eventsJohan Klokkhammer Helsing2018-04-091-12/+7
| | | | | | | | | | | | | | | | On Wayland, manipulating the clipboard requires an input event serial, which is not possible to get unless the compositor sends us input events. Change-Id: If5231a5db85f8d6ad988ea93f240cee0c3466f9f Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| * tst_QTouchEvent: Wait for window exposed instead of activeJohan Klokkhammer Helsing2018-04-091-4/+4
| | | | | | | | | | | | | | | | | | | | | | This makes the tests pass on Wayland compositors that don't automatically give focus to newly created windows. Such as a headless Weston, which is very useful for testing. Task-number: QTBUG-66846 Change-Id: I502504b333499c89be193a3ebc19d41264a13580 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
| * Fix license header for tst_toolingsupport.cppKai Koehne2018-04-091-13/+12
| | | | | | | | | | | | Change-Id: Id355afc8eb57a40a0f8d06fa2920f03d94ef9337 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: hjk <hjk@qt.io>
| * tst_QPrinter: Use qWaitForWindowActive() to wait for dialogKari Oikarinen2018-04-091-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of an unconditional wait. The QSKIP is necessary because the PDF format is non-native and the Windows implementation of QPrintDialog doesn't work then. The macOS implementation has the same warning, so add the check for that OS as well. The test has previously passed, since it hasn't seen not actually opening the dialog as an issue. Change-Id: Ib53e378b232580358f13e0c5206404412f9e6ee2 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | Declare the operator| in the Qt namespace for QFlags in that namespacesOlivier Goffart2018-04-081-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a long overdue change so we don't break ADL of operator|. I think will not break source or binary compatibility. The problem is code like this: namespace Foo { struct MyStruct; MyStruct operator|(MyStruct, MyStruct); void someFunction() { fooLabel->setAlignement(Qt::AlignLeft | Qt::AlignTop) } } This would be an error before as ADL would find only the Foo::operator| and not the global one since the arguments are not in the global namespace. After this change, ADL works fine and this code compiles This bites people with misterious error, see questions on https://stackoverflow.com/questions/10755058/qflags-enum-type-conversion-fails-all-of-a-sudden https://stackoverflow.com/questions/39919142/broken-bitwise-or-operator-in-a-qt-project [ChangeLog][QtCore] QFlags's operator| for enum types in the Qt namespace are now declared in the Qt namespace itself. Change-Id: I021bce11ec1521b4d8795a2cf3084a0be1960804 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>