summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* QTimeZone - Add Mac backendJohn Layt2013-09-231-0/+50
| | | | | | | Add Mac backend support Change-Id: Iafa2dbd925e18431f571e3eac62983015f8bc977 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QTimeZone - Add TZ File BackendJohn Layt2013-09-221-0/+138
| | | | | | | | | | Add a backend for TZ Files. If available uses ICU for the display names and translations, otherwise the abbreviation is used. Change-Id: I58c777462810b1a76ea7bd95886836b70b8a3db5 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QTimeZone - Add ICU supportJohn Layt2013-09-221-0/+141
| | | | | | | Add ICU backend for QTimeZone Change-Id: I92e53a848477e366591102064b093e936f0b49d2 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QTimeZone - Define new class and apiJohn Layt2013-09-223-0/+509
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implement the new QTimeZone class based on the Olsen Time Zone ID's. This is the base implementation and does not include the Platform backends which are implemented separately. This change does include a default UTC backed to be used if no Platform backend is available, i.e. if QT_NO_SYSTEMLOCALE is set and ICU is not configured. This backend also provides a default set of time zones in the standard "UTC+00:00" offset format that are guaranteed to always exist regardless of the Platform backend. This change includes conversion functions between the Olsen ID's and Windows ID's using a conversion table based on Unicode CLDR data. This is implemented for all platforms for scenarios such as a Linux program needing to communicate with a Windows Exchange Server using the Windows ID. The CLDR conversion table is included under the UNICODE license, see http://unicode.org/copyright.html for details. [ChangeLog][QtCore][QTimeZone] Added new QTimeZone class to support time tone calculations using the host platform time zone database and the Olsen time zone ID's. Change-Id: Ibb417d08cf2663a0979d2be855d2c6ad6ad01509 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Q_STATIC_ASSERT: use __COUNTER__ instead of __LINE__ if the compiler supports itMarc Mutz2013-09-221-0/+5
| | | | | | | | | | | When using __LINE__ to construct unique names, use of Q_STATIC_ASSERT is limited to one instance per line of code. On compilers that support __COUNTER__ (GCC and MSVC, probably others), we can get around that limitation by using that one to always get a new unique number, so use it. Change-Id: I89bcfaa32376b7a665f03e4275e89b13fa3e650d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Add widget replace function to QLayoutThorbjørn Lund Martsum2013-09-217-2/+276
| | | | | | | Sometimes it is nice to be able to replace a widget in a layout. Change-Id: I23a6a65e417e94d53bc48639503db1a142bc3f10 Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* Merge branch 'stable' into devSergio Ahumada2013-09-213-0/+128
|\ | | | | | | Change-Id: I37d85631ab1165ab91457d8880c4da907a9df73b
| * Fix QFileSystemWatcher inotifyRiccardo Ferrazzo2013-09-191-0/+81
| | | | | | | | | | | | | | | | | | | | | | On linux using QFileSystemWatcher with inotify backend when a watched file is moved and added again to the watched files its path is not replaced with the new one. This behavior prevents the emission of the fileChanged signal with the wrong file path. Task-number: QTBUG-33211 Change-Id: Ib45d8efdf5afbf8b8f6b4b26e43f3d6ee740aca6 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * xcb: QWindow never uses XCB_GRAVITY_CENTERShawn Rutledge2013-09-161-0/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | Center gravity doesn't mean center the window, it only affects the method of converting between internal window bounds and decorated bounds. So wanting to have each dialog centered w.r.t. its transient parent is not a reason for using center gravity. Instead it caused the bug that when you resize a QMessageBox by clicking the Show Details button, it jumps downwards on the screen. Task-number: QTBUG-32473 Change-Id: I3fabf3caa1e4d10fd4f7508e297f73efe5cc51b6 Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
| * tst_QTextLayout: fix unhandled enum value in switch warningMarc Mutz2013-09-161-0/+2
| | | | | | | | | | Change-Id: I006286487a409d492fe398a2fed5dd854f758f9f Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* | Add Mac type conversion functions to QtCoreMorten Johan Sørvig2013-09-216-0/+171
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | New API: static QString QString::fromCFString(CFStringRef string); CFStringRef QString::toCFString() const; static QString QString::fromNSString(const NSString *string); NSString *QString::toNSString() const; static QUrl QUrl::fromCFURL(CFURLRef url); CFURLRef QUrl::toCFURL() const; static QUrl QUrl::fromNSURL(const NSURL *url); NSURL * QUrl::toNSURL() const; Add Q_OS_MAC-protected function declarations to header files, add implementation to _mm files. CF and NS types are forward-declared in the header files to avoid including the CoreFoundation and Foundation headers. This prevents accidental use of native types in application code. Add helper macros for forward- declaration to qglobal.h Add cf_returns_retained/ns_returns_autoreleased attributes to toCFString() and toNSURL(). These attributes assists the clang static analyzer. Add Q_DECL_ helper macros to qcompilerdetection.h. Add test functions (in _mac.mm files) to the QString and QUrl tests. Split out the test class declarations into a separate headers files. Change-Id: I60fd5e93f042316196284c3db0595835fe8c4ad4 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* | Use the correct identifier for the OS X operating system.Jake Petroules2013-09-212-1/+1
| | | | | | | | | | | | | | | | This is consistent with other areas of Qt: qmake, Qt.platform.os (QML), qbs.targetOS (QBS), and #define Q_OS_OSX. Change-Id: Ibf98e6ba3556a14187dadae1b0235e9c907c9001 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* | Merge "Merge remote-tracking branch 'origin/stable' into dev" into ↵Sergio Ahumada2013-09-212-4/+5
|\ \ | | | | | | | | | refs/staging/dev
| * | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-09-162-4/+5
| |\| | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/tools/qstring.cpp Change-Id: Ifc6cd3a0f1cf14cc0fe6cf30afb0c7f40cfdbc3e
| | * tst_qurlinternal: fix a use of memcpy on overlapping memoryMarc Mutz2013-09-141-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The old code smply copied 100 shorts from the pointer passed into the ushortarray ctor, regardless of the actual bounds of the original array. Fix by making the ctor take the array by deference, deducing the size as a template parameter, and only copying that much. Fixes asan trace: ==18660==ERROR: AddressSanitizer: memcpy-param-overlap: memory ranges [0x7fff3c56de00,0x7fff3c56dec8) and [0x7fff3c56dd60, 0x7fff3c56de28) overlap #0 0x457161 in memcpy asan_interceptors.cc:330 #1 0x4c40fe in ushortarray::ushortarray(unsigned short*) qtbase/tests/auto/corelib/io/qurlinternal/tst_qurlinternal.cpp:62 #2 0x4b0437 in ushortarray::ushortarray(unsigned short*) qtbase/tests/auto/corelib/io/qurlinternal/tst_qurlinternal.cpp:63 #3 0x47b643 in tst_QUrlInternal::idna_testsuite_data() qtbase/tests/auto/corelib/io/qurlinternal/tst_qurlinternal.cpp:119 ... Change-Id: Ie497bc8d337bc680a562482ca71ace535797ffb3 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | * tst_QSettings: add missing () around a macro argument useMarc Mutz2013-09-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 'val' was set to QList<...>() << ... << ... further down. Fixes a Clang warning. Change-Id: I5fe80d87dbe2c1d50652dfd7b6c5f4a9198cd467 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | QCompleter::setFilterMode() add property filterMode.Oto Magaldadze2013-09-201-0/+129
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QCompleter::setFilterMode(Qt::MatchContains) will enable filtering out entries that contain typed characters in any place, instead of the default behavior when only those entries that start with typed characters are displayed. Qt::MatchEndsWith is also possible. QCompleter::setFilterMode(Qt::MatchStartsWith) will bring the default behavior back. Task-number: QTBUG-3414 Change-Id: I3845704c59eb8fc401e9a650c54a9c934ed28c2e Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* | | tst_QPainter: fix a Q_DECLARE_METATYPE coming too lateMarc Mutz2013-09-201-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The compiler complained that the specialization was required before it was issued. Fixed by moving it up to the others near the top of the file. Change-Id: I0ae162a5db5ef29f24cd1d32285a1870fdd24b9b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* | | Import qlogger frameworkKai Koehne2013-09-204-0/+831
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Merge most parts of the qlogger framework from git://gitorious.org/qtplayground/qlogger.git The categorized logging feature is a replacement for qDebug, qWarning and friends. With logging statements in an app/library, a developer can turn on the statements they care about and turn off the ones they don't. Most work for this was done by Wolfgang Beck and Lincoln Ramsay. Task-number: QTBUG-25694 Change-Id: Ib0cdfbbf3694f86ad9ec553b2ea36f09a477cded Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | QDateTime - Add api for isDaylightTime()John Layt2013-09-201-0/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add new method to return if the current time is Daylight Time. [ChangeLog][QtCore][QDateTime] Added new method isDaylightTime() to return if the datetime is in Daylight Time or not. Change-Id: Icb93fd5dd0b2f7d83d2d4643eeb12922c1137e3e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | QDateTime - Fix Daylight Transition for "missing" hourJohn Layt2013-09-201-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When Daylight Time transtion goes from Standard Time to Daylight Time there is a "missing" hour, i.e. at 2am CET the clock goes forward to 3am. Currently QDateTime ignores this gap and considers the time to be valid and able to be manipulated. This change respects the transition, so any time set in the missing hour is considered invalid, and any date maths returns valid results. The validity in the current time zone needs to be checked every time isValid() is called in case the system time zone has changed since the last time it was checked. This is done by calling mktime to check the returned result matches the expected result. This could be very inefficient, but the returned offset value is cached each time so mktime is not required to be called again within each method call, effectively meaning mktime is called the same number of times by each method. Note that this means any new methods added must be careful to ensure either isValid() or refreshLocalTime() is called first by any method needing to use the UTC value. [ChangeLog][QtCore][QDateTime] The Standard Time to Daylight Time transition for Qt::LocalTime is now handled correctly. Any date set in the "missing" hour is now considered invalid. All date math results that fall into the missing hour will be automatically adjusted to a valid time in the following hour. Change-Id: Ia652c8511b45df15f4917acf12403ec01a7f08e7 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | QDateTime - Change date/time storage to msecsJohn Layt2013-09-201-34/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change from storing the date and time as QDate and QTime to a serialised msecs format. This format is a direct translation of the QDate and QTime values, it is not the actual msecs since the Unix epoch. This msecs format ensures we are always able to recreate the original QDate and QTime values, but should still simplify the code and improve performance. Because we no longer store the explicit date and time we need to store their isNull()/isValid() status separately. The changes in storage results in the same memory footprint as before. Note that this change does not optimize the code nor set out to fix the known bugs, it only seeks to maintain the current behavior, although some bugs are fixed implicitly. More bug fixes and optimizations will follow. [ChangeLog][Important Behavior Changes] The supported date range in QDateTime has been reduced to about +/- 292 million years, the range supported by the number of msecs since the Unix epoch of 1 Jan 1970 as stored in a qint64, and as able to be used in the setMSecsSinceEpoch() and toMSecsSinceEpoch() methods. Change-Id: I98804d8781909555d3313a3a7080eb8e70cb46ad Reviewed-by: Sérgio Martins <sergio.martins@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | QDateTime - Add Benchmark TestsJohn Layt2013-09-203-0/+612
| | | | | | | | | | | | | | | | | | | | | Add benchmark tests for QDateTime. Change-Id: I839f8bc81e6cae56d93539c7c3f999d9eec10ad7 Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
* | | test: fix tst_QFont::defaultFamily on Mac OS X 10.8Liang Qi2013-09-201-8/+0
| | | | | | | | | | | | | | | | | | Task-number: QTBUG-32834 Change-Id: Iac771eb0a544ae58d203717c39a13d2d21e3c3ed Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
* | | Revert "test: Mark tst_QRawFont::fromFont() as XFAIL"Liang Qi2013-09-201-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The commit 3745b0ca126f46eadfeeb7e3d1d53360dbf800cd resolved this issue. This reverts commit 08d3b0165ae49a9ca019b7074423606492856b70. Task-number: QTBUG-32654 Change-Id: Ie8dba4bd2efb35d44b70c67e59b4fff855edec79 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* | | QMessageBox - make it possible to have a checkbox on the dialogThorbjørn Martsum2013-09-202-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | This (partly) solves Task-number: QTBUG-2450 Change-Id: Ie2280c87b96e72acc76e806a83c4e8cc0d4e4ee4 Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* | | Add missing implementation in QAccessibleTabBar::indexOfChildJan Arve Saether2013-09-201-0/+1
| | | | | | | | | | | | | | | | | | | | | This avoids the assertion in iaccessible2.cpp(510) Change-Id: I1a4c007ffcbcda70f0e37ef3cf55a303683b58c1 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
* | | Set tst_qfilesystemmodel as insiginificantSimo Fält2013-09-201-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The test has been failing on all platforms. Usually it just times out, but it also have behavied flaky, failing with different error codes when executed twice in a row. Task-number: QTBUG-29403 Change-Id: Ic06638f0ffd23131b4c1aa4136f715195727e959 Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* | | Disable tst_QFileSystemWatcherGunnar Sletta2013-09-201-0/+2
| | | | | | | | | | | | | | | | | | | | | Task-number: QTBUG-33574 Change-Id: Ieed6b87f34964a902f339215d74c0184a27eb2a2 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | | Implement QMainWindow::takeCentralWidget()Sune Vuorela2013-09-201-0/+55
| | | | | | | | | | | | | | | | | | | | | | | | This allows the application developer to restructure the application, including moving the central widget some place else. Change-Id: Idca2f74c190500db24404e020b0eb400e41aad10 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* | | Revert 15da0a5af20fe6771bcb94ef8d46edbd5c8fb64c.Mitch Curtis2013-09-193-22/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It apparently breaks users' applications. Task-number: QTBUG-33487 Change-Id: Iaeceb3a02b5c7b9ab839c14693aaffcdf9394bc6 Reviewed-by: John Layt <jlayt@kde.org> Reviewed-by: hjk <hjk121@nokiamail.com>
* | | Make Accessibility publicFrederik Gladhorn2013-09-191-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | There is no point in having QAccessible2, so merge it with the normal QAccessible. The header will be removed in a subsequent commit as it is still needed by declarative at this point in time. Change-Id: I1fc47d484d482f25387eba827bc5a373536b7a8b Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
* | | MetaType: Add assignment operator to the container iterators.Stephen Kelly2013-09-191-16/+5
| | | | | | | | | | | | | | | Change-Id: Ib4f2197a0ab6bd41c91de667cd3087fb40e44097 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* | | Include hidden headers in trees and tables consistentlyJan Arve Saether2013-09-181-6/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There was a disagreement between the a11y plugin and QTreeView whether the horizontal header should have been exposed or not. When the header was hidden, this resulted in that we sent an event with a child id that was wrong, or in worst case higher than QAI::childrenCount(). This was the reason we got the warning output as described in the task. With this commit, we consistently *expose* hidden headers both for QTreeView and QTableView, but ensure that their state().invisible is set to true instead. This makes it consistent with how hidden cells are exposed. This also fixes a bug in QTableViewPrivate::accessibleTable2Index where we always added 1 to the index, which was spotted while writing the test. Task-number: QTBUG-33247 Change-Id: Ifd1f83d56296dd071424fdb81fce7628bc24fe0a Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
* | | MetaType: Fix operator{++,--}(int) with the type-erased const_iterators.Stephen Kelly2013-09-171-0/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Similar to commit 8b062418 (MetaType: Fix operator{+,-}(int) with the type-erased const_iterators., 2013-09-11), explicitly create a copy of the iterator and intialise it. Change-Id: I8b9edef40ca00c826f72768cba4a0992e55371f8 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* | | QObject: allow connecting to functors with a receiver objectDario Freddi2013-09-161-2/+207
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Up to now, it was only possible to connect to functors in a direct way, without being capable of using Qt::ConnectionType. This patch allows for specifying a receiver for Functors and function pointers, hence making it possible to specify effectively the connection type. To do this properly, it was needed to add an enum in FunctionPointer representing whether the considered function is a member function or not, to reduce ambiguity upon overloaded calls. Moreover, now senders are checked for the existence of a slot obj as well. This way, should the context be freed, the slot obj and the functor contained in it will be freed as well. On a side note, connecting to a static slot (like QCoreApplication::quit) specifying the receiver object is now compiling. Change-Id: I46474099413b1dc6ca4db9934191d469baeef070 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* | | Add QFileSelector APIAlan Alpert2013-09-1623-0/+229
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For easy cross-platform and cross-device UIs, automatic asset swapping based on filename is being developed. This API provides the logic for the swapping, so that applications can use it themselves with the same logic as any automatic swapping done in application templates. Selector set is initially minimal, aiming for just platform selection and enabling a common selection mechanism for Qt platforms to use. Change-Id: I219517d740fa7385e923a9e09cb7e241378f857a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Don't send posted events from QWindowSystemInterface::sendWindowSystemEventsTor Arne Vestbø2013-09-161-0/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The responsibility of sendWindowSystemEvents() is to process events from the window system. Historially that logic was part of the QPA/QWS event dispatcher, which naturally also sent posted events. Through refactoring, the code at some point ended up in in the QWindowSystemInterface class, still with the posting of events in place. This resulted in QPA event dispatchers adopting a pattern of just calling sendWindowSystemEvents(), as that would cover both posted and window system events. Other event dispatchers would call sendWindowSystemEvents(), and then use a base-class implementation from QtCore for processing events, resulting in two calls to QCoreApplication::sendPostedEvents() per iteration of processEvents(). This breaks the contract that processEvents will only process posted events that has been queued up until then. We fix this entanglement by removing the sendPostedEvents() call from QWindowSystemInterface::sendWindowSystemEvents() and move it to the respective event dispatchers. For some EDs it means an explicit call to sendPostedEvents, while others were already doing sendPostedEvents though a separate source (GLib), or using a base-class (UNIX/BB), and did not need an extra call. We still keep the ordering of the original sendWindowSystemEvents() function of first sending posted events, and then processing any window system events. Task-number: QTBUG-33485 Change-Id: I8b069e76cea1f37875e72a034c11d09bf3fe166a Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
* | | Simplify QFileSystemModel::remove by using QDir::removeRecursivelyDavid Faure2013-09-161-4/+2
|/ / | | | | | | | | | | | | | | This also fixes it in case of hidden or system files, which were missing from the filter (found by Denis Kovalskiy). Change-Id: Ic12de12ec51c20de52d040514e90be5e783add43 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Use Q_STATIC_ASSERT to report error about missing Q_OBJECTOlivier Goffart2013-09-141-0/+4
| | | | | | | | | | | | | | | | | | | | Q_STATIC_ASSERT gives better error with C++11 enabled. Aslo the qt_check_for_QOBJECT_macro had warning on some compiler since it used null reference Change-Id: Ic6115da800064b00c50a5762f0b79f5f656bf750 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | QDateTime - Switch to using msecs based functionsJohn Layt2013-09-141-14/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A number of QDateTime functions directly use or modify the data stored in the private, but future changes to store msecs and status make this maintenance more complicated. Where possible simplify this code to use the standard msecs functions, standard constructors, or public api instead. This greatly simplifies the functions and the following msecs storage code changes. This is an intermim step towards storing the time in msecs. Some functions will be slower as a result of this change, optimization will take place after all the msecs changes are completed. Note this also removes a test that used valid QDates outside the range of msecs, this change in behavior will be documented in the final mscs change. Change-Id: I6ef710f24babc7024091010064082e9be0b5bbfe Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Mitch Curtis <mitch.curtis@digia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | QDateTime - Add test case for Daylight Time TransitionsJohn Layt2013-09-141-0/+377
| | | | | | | | | | | | | | | | | | | | Test the Daylight Time transitions. QDateTime does not correctly deal with many of these scenarios so those tests are marked as QEXPECTFAIL. These bugs will be progressively addressed in coming commits. Change-Id: I01eba9d6143a792f081542cb198e221efcf28e98 Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
* | Base64: Implement the "base64url" encoding and the stripping of '='Thiago Macieira2013-09-141-0/+35
| | | | | | | | | | | | | | | | | | The "base64url" encoding is defined in RFC 4648, which is the newest version of Base64. There are also a few situations where the ending '=' is not desired. Change-Id: I9bb9fa55817b57d125189e4e795d6fde97caea6d Reviewed-by: Richard J. Moore <rich@kde.org>
* | QStandardPaths: add a test that just dumps the valuesThiago Macieira2013-09-141-0/+36
| | | | | | | | | | Change-Id: I79bcc1974988b3d712a40e89a3ec4aeb7be1fb5e Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com>
* | QTime - Add public api for get/set msecs since start of dayJohn Layt2013-09-131-0/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | Add new public api to get and set the number of msecs since the start of the day. Modify QDateTime to use the new msecs api. [ChangeLog][QtCore][QTime] Added new methods fromMSecsSinceStartOfDay() to create a new QTime from an msecs value, and msecsSinceStartOfDay() to return the QTime as the number of msecs since the start of the day. Change-Id: I285b725b883f1f5524fda87ca81bd64ed99fe6f4 Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
* | Add a static QFileInfo::exists(fileName) functionhjk2013-09-132-0/+15
| | | | | | | | | | | | | | | | | | This avoids dynamic construction of the private class. According to the benchmark we go from 4,550 to 3,900 instruction reads per iteration. (without change 32629676 the baseline is 5,600) Change-Id: I5df925e30dbd49bdde87173e481820574ce5abe1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | MetaType: Fix operator{+,-}(int) with the type-erased const_iterators.Stephen Kelly2013-09-131-0/+30
| | | | | | | | | | | | | | | | Make sure we don't modify the lhs. Instead copy it and advance the copy. Change-Id: I3440e8e175bfc299f8f83b816faca54fa3f79e43 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* | moc: add -M<key=value> to ease static qml plugin linkingRichard Moe Gustavsen2013-09-133-1/+92
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A module plugin in qml belongs to a URI/namespace. This uri is resolved run-time by QtDeclarative by knowing the path of the qmldir that references the plugin. For static plugins this becomes a problem, since we lost the information regarding which plugin belongs to which qmldir, since a static plugin has no file path. To avoid pushing the responsibility of clarifying this onto the application developer, it is better to embed this information into the meta data of the plugins themselves. Since this information can be resolved by the build system, a new option to moc has been added: -M<key=value> that will let you add meta tags to the meta data from the command line to each class that has an IID specified. For the URI case, we can then e.g do: -Muri=QtQuick.Controls -Muri=QtQuick.Controls.Private Change-Id: I81a156660148fc94db6f3cac0473e9e1c8458c58 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* | Remove Q_PACKED from structures that do not need to be packedThiago Macieira2013-09-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These structures do not need to be packed. With some compilers, Q_PACKED was defined to be empty, which means that the code was working fine without packing. Or there were some lingering problems on those platforms (MSVC) and we're now exposing them in all platforms. Actually, it shouldn't be a problem anywhere. QCharAttributes, quint24 and QFontEngineQPA::Glyph have only char/uchar members, so they're packed already (they have alignof == 1). The only platform where that wasn't true was ARM OABI, which we don't support anymore. QFontEngineQPA::Header seems to always come from a QByteArray, so it doesn't neeed to be packed either. However, just to be sure, I'm inserting a check for alignment. And QFontEngineQPA::Block isn't used anywhere. Change-Id: Iacfa25edf336ef2a03aeb6e40ae90937a21661ae Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* | Add a convenient way to get a type-erased smart pointer from a QVariant.Stephen Kelly2013-09-111-0/+53
| | | | | | | | | | | | | | | | | | | | | | | | Any known smart pointer in a QVariant can be handled in this way. The metatype system can be informed of new smart pointer types using an existing macro which is now documented. This is very similar to the existing infrastructure for containers. Change-Id: Iac4f9fabbc5a0626c04e1185d51d720b8b54603d Reviewed-by: Olivier Goffart <ogoffart@woboq.com>