summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel
Commit message (Collapse)AuthorAgeFilesLines
* Clear QCoreApplication::applicationFilePath cache if argv[0] changes.Robin Burchell2013-11-201-0/+8
| | | | | | | This allows boosters to precreate Q*Application instances. Change-Id: Ie2c1399b216d9cc996210e077fa6d42d24bf9b0e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Merge "Merge remote-tracking branch 'origin/release' into stable" into ↵Frederik Gladhorn2013-11-201-1/+1
|\ | | | | | | refs/staging/stable
| * Fix QCoreApplication documentation.Mitch Curtis2013-11-151-1/+1
| | | | | | | | | | | | | | Task-number: QTBUG-33360 Change-Id: Ifdc0bcc580d0a2dacc6a0bdce10aa278e0bdfe9c Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* | Doc: Q_REVISION/Q_INVOKABLE are added to declaration not definition.Sérgio Martins2013-11-191-2/+2
|/ | | | | Change-Id: Ia06d33df1b5d38783e22b0c45956a5154338ed33 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* QVariant: Convert automatically from enum types to integral types.Olivier Goffart2013-11-081-12/+45
| | | | | | | | | [ChangeLog][QtCore][QVariant] Variant containing enum types can now be converted to integer Change-Id: Ibbbc9ae29ab45d67c582fa2d406afc19c5dc41ce Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
* Fix QVariant::canConvert with longlongOlivier Goffart2013-11-081-0/+2
| | | | | | | | | | | Add few cases where conversion to or from LongLong was missing We need to make it work if we want to use variant.canConvert<qint64> [ChangeLog][QtCore][QVariant] Fixed QVariant::canConvert with longlong Change-Id: I0f65073802b62d99250601dd90a8cd2e4d934b60 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
* QMetaType: Fix conversion between module types.Stephen Kelly2013-11-061-1/+2
| | | | | Change-Id: I7215b4599c3f0459139b32b6571f0a9e60182ee9 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
* BlackBerry: Prevent superfluous removal of socket notifiersBernd Weimer2013-11-051-12/+11
| | | | | | | | | | | | File descriptors have always been removed from bps before adding them, which lead to an annoying warning. "QEventDispatcherUNIX::registerSocketNotifier()" needs to be called after "ioEvents()" to prevent this. Task-number: QTBUG-34536 Change-Id: If074ff7a6638fe234abc100c81d094e182de7537 Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com> Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com>
* Doc: Fix broken linksSze Howe Koh2013-11-052-4/+2
| | | | | | | | Task-number: QTBUG-33360 Change-Id: Ic944cb2f575c35ebad64852ef5fc44a50ac03571 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com> Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* Don't cache QCoreApplication::appName.Robin Burchell2013-10-312-10/+5
| | | | | | | | | | | This isn't a hot codepath, there is no gain to doing this. It introduces unnecessary bloat (see e.g. https://www.webkit.org/blog/2826/unusual-speed-boost-size-matters/) and complicates boosting Qt application startup in cases where argv[0] is overwritten. Change-Id: I55b2b98b0de6b06fe7a049de262f3e19936b73db Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Android: Fix problem with leaking local refs.Christian Strømme2013-10-303-8/+27
| | | | | | | | | In some cases we where not releasing the local references and since we no longer disconnect from the VM on each call, the number of local refs. would accumulating until it hit the hard-limit of 512. Change-Id: I6826620e4cb61a37af26d276667489e876080076 Reviewed-by: Yoann Lopes <yoann.lopes@digia.com>
* Issue correct warnings with QObject::startTimer()Sze Howe Koh2013-10-301-2/+2
| | | | | | | These are not specific to QTimer Change-Id: Idcffab51a3277413889a727afa1cf7ce15171ec9 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* remove qt_windows.h include from qwineventnotifier.hJoerg Bornemann2013-10-291-1/+1
| | | | | | | | | | | We must not include qt_windows.h in public headers, otherwise we're cluttering the environment with a colorful bouquet of Windows API preprocessor macros and typedefs. Task-number: QTBUG-34058 Change-Id: I415717ea2a47f39e7f4b7ce1c1df9d49afc99278 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* QJNI: Don't detach from the thread as long as the thread is alive.Christian Strømme2013-10-251-16/+13
| | | | | | | | | | | | Attaching and detaching the current thread to/from the VM on each jni call, causes a new thread object to be created and triggers GC when detaching (GC alone takes anything between 10-30 ms to finish on the test device). Instead of detaching when the environment object goes out of scope, we now detach when the thread exits. Task-number: QTBUG-34279 Change-Id: Ia613934e61f914d4be63bfa1be8fdecf849928b0 Reviewed-by: Yoann Lopes <yoann.lopes@digia.com>
* Fix virtual key mapping on MS WindowsJuan Luis Boya García2013-10-251-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | In order to map MS Windows virtual keys to Qt keys without messing with dead keys now I use the built-in keyMap structure of QWindowsKeyMapper and assert every cell in the keymap is properly updated. In order to guarantee this even when the user changes the keyboard layout, WndProc now manages the WM_INPUTLANGCHANGE message, which is handled by QWindowsKeyMapper, resetting the layout structure. I don't fully understand yet some things about QWindowsKeyMapper, i.e. how QWindowsKeyMapper::updatePossibleKeyCodes workarounds the dead key issue with ToAscii; but it seems to work fine in all the tests I've done. Any further testing is highly appreciated, though. [ChangeLog][[QtGui][Platform Specific Changes][Windows] Fixed virtual key mapping on Windows. Task-number: QTBUG-33409 Task-number: QTBUG-8764 Task-number: QTBUG-10032 Change-Id: I4f7709a90906b03f4504deea1ff5c361e9f94b3f Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* BlackBerry: improve BPS event lifetime managementJonathan Hoffmann2013-10-232-4/+90
| | | | | | | | | | | | | | | | | | | | | | | | | | | | In QEventDispatcherBlackberry::select(), if an event handler called through filterEvent() starts a nested event loop by creating a new QEventLoop, we will recursively enter the select() method again. However, each time bps_get_event() is called, it destroys the last event it handed out before returning the next event. We don't want it to destroy the event that triggered the nested event loop, since there may still be more handlers that need to get that event, once the nested event loop is done and control returns to the outer event loop. So we move an event to a holding channel, which takes ownership of the event. Putting the event on our own channel allows us to manage when it is destroyed, keeping it alive until we know we are done with it. Each recursive call of this function needs to have it's own holding channel, since a channel is a queue, not a stack. However, a recursive call into the select() method happens very rarely compared to the many times this method is called. We don't want to create a holding channel for each time this method is called, only when it is called recursively. Thus we have the instance variable d->holding_channel to use in the common case. We keep track of recursive calls with d->loop_level. If we are in a recursive call, then we create a new holding channel for this run. Change-Id: Ib3584676d2db5a9a3754a1535d5fb6c9e14f5dbb Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com>
* Implement native gestures on OS X.Morten Johan Sørvig2013-10-171-1/+1
| | | | | | | | | | | | | | | Add QWindowSystemInterface::GestureEvent and QNativeGestureEvent to QtGui. These events are copies of Qt4's QNativeGestureEvent, where it was an implementation detail of QGestureManager. Add gesture message handlers to QNSView and bring back the Mac gesture recognizers for QGestureManager. Task-number: QTBUG-28126 Change-Id: I1304e09e776fa7c44d133d54ca8b895ca2f544c5 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* Account for QPolygonF type when loading/saving the QVariantAndy Shaw2013-10-151-1/+6
| | | | | | | | | | | When the QPolygonF type was added to QMetaType it did not bump up the values in load() and save() for QVariant. Task-number: QTBUG-33981 Change-Id: I7ad99cda70620c5449c15527c3daf920972d047f Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Android: Add QAndroidJniXxx as friend classes in qjni.Christian Strømme2013-10-091-2/+2
| | | | | | | | | The JNI classes in Qt Android Extras are changing name from QJNIXxx to QAndroidJniXxx and they need to be friends of the private JNI classes in core. Change-Id: Ib5e1729f4bbba876b7d3eba5742fe750f95c48f7 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Doc: Adding mark-up to boolean default values.Jerome Pasion2013-10-0822-233/+233
| | | | | | | | | | | | | | | | | Default values should have mark-up to denote that they are code. This commit changes: -"property is true" to "property is \c true". -"Returns true" to "Returns \c true". -"property is false" to "property is \c false". -"returns true" to "returns \c true". -"returns false" to "returns \c false". src/3rdparty and non-documentation instances were ignored. Task-number: QTBUG-33360 Change-Id: Ie87eaa57af947caa1230602b61c5c46292a4cf4e Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* QPA: Fix event dispatcher dependent operations in platform integrationLaszlo Agocs2013-10-072-0/+6
| | | | | | | | | | | | | | | | | | 999e5162ec3e86c9cb84c3ec95dfd0ba4b21277f breaks QPlatformIntegration implementations that perform tasks in their constructor that rely on the event dispatcher. For example creating a QSocketNotifier is not possible anymore since the event dispatcher is created later on. This is fixed by introducing an additional virtual in QPlatformIntegration that gets called after createEventDispatcher(). Two broken platform plugins have been identified so far: eglfs is creating socket notifiers to read events from input devices and xcb's input context plugins may use dbus. Both are updated accordingly. Task-number: QTBUG-33768 Change-Id: I5badb623958a52ab5314ff93dd7d60061f5df70a Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
* Doc: Discuss the concept of thread affinity in more detailSze Howe Koh2013-10-061-7/+35
| | | | | | | | | | | | | | | - Create a section dedicated to this concept, which is fundamental to signal/event handling - Move relevant content from the very broad "Thread Basics" page to the QObject class ref - Flesh out existing content, including distinguishing signals from events - Address the common misconception that "member" = "child"; this has been encountered several times in the Qt Project forums Change-Id: I5e7e6c848596e72c0bb623f8442c8389b81ad9ef Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* QObject: use per-thread storage for qFlagLocation()Marc Mutz2013-10-051-14/+6
| | | | | | | | | | | | | | | | | | | qFlagLocation() uses a global char* array to transport source location information from the connect() side to the metaobject side. The size of the array is 2 (two), which just about suffices for a single connect() statement. Obviously, if more than one thread makes a (_any_) connection at the same time, the data is useless and, worse, there's a data race. The non-reentrancy of qFlagLocations() cannot and need not be fixed, but use a per-thread flagged_locations array in QThreadData so threads don't disturb each other. Task-number: QTBUG-3680 Change-Id: If1797c60751f551694def69afee6fbe295bbe2d2 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Android: Add private ctors in QJNIObjectPrivate that takes va_list.Christian Strømme2013-10-042-0/+40
| | | | | | | | NewObjectV() was failing because QJNIObject was calling the variadic constructors with a va_list, which in turn created a new va_list. Change-Id: I1cf4c8133f237596964177271a20ca651174e695 Reviewed-by: Yoann Lopes <yoann.lopes@digia.com>
* Doc: correct QTimer accuracy information - it depends on the timer typeThiago Macieira2013-10-021-7/+12
| | | | | | | | This doc was probably older than the feature of timer types. Task-number: QTBUG-33760 Change-Id: Iff4c9f9bb7287498f1ee80578b500bbde777bc78 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Fix bootstrapped build of QCoreApplicationThiago Macieira2013-09-301-0/+1
| | | | | | | | | 696060134d10d44175970ffd38618544ecdd9387 introduced the use of QBasicMutex and QMutexLocker (qmutex.h) but that wasn't #included. I don't know in what way my build is different, though. Change-Id: Ie3df3c746fdf1c4735f298c3578cd93a9a14327e Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
* Doc: Add docs for rvalue references and move constructorsGeir Vattekar2013-09-271-0/+17
| | | | | | | | | These members were introduced in 4.8, but left undocumented. Because we consider undocumented API to be internal, the members are \since 5.2. Change-Id: I52e2840a8cfaa7f59f410b3e2a06c0942ea06539 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Make QCoreApplicationPrivate::appName() thread-safeTor Arne Vestbø2013-09-261-0/+3
| | | | | Change-Id: Iea0d208e3e4721fff8a6667e0df1203a887c29d3 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Don't assume QCoreApplication::applicationName() will never changev5.2.0-alpha1Tor Arne Vestbø2013-09-252-6/+9
| | | | | | | | | Tests will typically create multiple QCoreApplications, some of them with different argv[0] than others, so we can't use a static variable to keep the cached application name. Change-Id: Icd97527730558944473a71373326b4a82f1b7cf7 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Android: Use the application's class loader when loading Java classes.Christian Strømme2013-09-253-4/+33
| | | | | | | | | Previously the system class loader was used, which meant only system Java classes where available. With this change it's no longer necessary to add a JNI_OnLoad() to get a handle to application specific classes. Change-Id: Ic8fe35b4e525bfeb1d317d5ba6b496e39bf9bb30 Reviewed-by: Yoann Lopes <yoann.lopes@digia.com>
* Fixed QJNIEnvironment reference counting.Yoann Lopes2013-09-251-3/+5
| | | | | Change-Id: I02369e0c6472375efeffed577d39b764c591e025 Reviewed-by: Christian Stromme <christian.stromme@digia.com>
* Fix some doc errors.Frederik Gladhorn2013-09-212-5/+5
| | | | | | | Change-Id: Ib874d7e9671d9cee75fe41f4dac5d0de7b09245e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Topi Reiniö <topi.reinio@digia.com> Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Remove qFind usage from QCoreApplicationGiuseppe D'Angelo2013-09-211-1/+1
| | | | | | | | This is done per the mailing list discussion at http://www.mail-archive.com/development@qt-project.org/msg01603.html Change-Id: I1a067a4262d5442fb118089b859cad4dc1748c40 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Port of Qt 4's Windows session managementSamuel Gaist2013-09-211-0/+19
| | | | | | | | | | This patch aims to implement the session management for Windows. Based on the Qt 4 QApplication windows specific code Task-number: QTBUG-28228 Task-number: QTBUG-33032 Change-Id: I7059298ad9661aebd51e77a03f55a7a04f461479 Reviewed-by: Kai Koehne <kai.koehne@digia.com>
* QDateTime - Change date/time storage to msecsJohn Layt2013-09-201-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* WinRT: Shared memory supportAndrew Knight2013-09-201-3/+27
| | | | | | | | | | WinRT supports in-memory file mapping via CreateFileMappingFromApp. This is unimplemented on Windows Phone. Change-Id: Ic5692e501cd2fe9e1337829bdeb933fccc804abe Done-with: Andrew Knight Reviewed-by: Maurice Kalinowski <maurice.kalinowski@digia.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Fixed compilation of QSystemsemaphore for WinRTKamil Trzcinski2013-09-201-0/+8
| | | | | | | | | | | As CreateSemaphore and WaitForSingleObject are not supported on WinRT their supported alternatives are used. Change-Id: I1aa20076e286ed8ae28ba332bbed41ff8ce0feff Reviewed-by: Andrew Knight <andrew.knight@digia.com> Reviewed-by: Maurice Kalinowski <maurice.kalinowski@digia.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* WinRT: Basic global supportAndrew Knight2013-09-203-5/+21
| | | | | | | | Various global changes, primarily preprocessor flow, to support the WinRT platform. Change-Id: I3fa9cf91d5fb24019362e88fcf205e31b4f810b5 Reviewed-by: Andrew Knight <andrew.knight@digia.com>
* MetaType: de-inline the container iterables.Stephen Kelly2013-09-202-225/+400
| | | | | | | | This means the *Iterables and corresponding const_iterators need to be exported. Change-Id: Ic93283616bda96e0d7752b0e881bf0230a5c2146 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Android: Add private API for jni in QtCoreChristian Strømme2013-09-203-3/+2374
| | | | | | | | | | | | | | | | | When interfacing with Java API's on Android we need to write code using the Java Native Interface (JNI). Writing JNI code requires a lot of boilerplate code to be written. This patch contains API's to minimize the amount of work needed to write JNI code. QJNIEnvironmentPrivate: On creation QJNIEnvironmentPrivate will attach the current running thread to the Java VM, and expose the java environment. QJNIObjectPrivate: Wrapps around a Java class enabling the user to access the class from C++. Change-Id: Ib633437ae36ff513d934292e9eeefcdd5b757d29 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* Android: Added JNI_OnLoad to QtCoreChristian Strømme2013-09-204-0/+242
| | | | | | | | | | JNI_OnLoad is called for each library during the start-up of a Qt application on Android. When the JNI_OnLoad is called we can get a handle to the Java VM and necessary classes which enables us to access Java API's in QtCore. Change-Id: I64c1f1106cc0d5ab5a7bc9b22c752c09162fe813 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* MetaType: Add assignment operator to the container iterators.Stephen Kelly2013-09-192-0/+28
| | | | | Change-Id: Ib4f2197a0ab6bd41c91de667cd3087fb40e44097 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* MetaType: Fix memory leak of QAtomicInt.Stephen Kelly2013-09-171-0/+2
| | | | | Change-Id: I04c87c4caeb96c820c4d332a803cb2824fea5891 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* MetaType: Fix operator{++,--}(int) with the type-erased const_iterators.Stephen Kelly2013-09-171-4/+4
| | | | | | | | | | 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-163-32/+112
| | | | | | | | | | | | | | | | | | | | | | | 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>
* Fix spelling in Q_STATIC_ASSERT in qobject_castOlivier Goffart2013-09-161-2/+2
| | | | | Change-Id: Ibc2b1296bf7eb20e41c1af044797a9a026bed369 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Implement windowsErrorString for WinRTOliver Wolff2013-09-161-0/+12
| | | | | | | | | FORMAT_MESSAGE_ALLOCATE_BUFFER isn't available for WinRT Change-Id: Ib9cf2a11a4e84f3ff010665bd53b4ffb0d0bfcce Reviewed-by: Andrew Knight <andrew.knight@digia.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* Use Q_STATIC_ASSERT to report error about missing Q_OBJECTOlivier Goffart2013-09-145-13/+34
| | | | | | | | | | 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>
* MetaType: Fix operator{+,-}(int) with the type-erased const_iterators.Stephen Kelly2013-09-132-4/+32
| | | | | | | | 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>
* Remove some unneeded constructors.Stephen Kelly2013-09-131-11/+3
| | | | | Change-Id: I34f86960dc0cfaada509957bca5466b2765e8239 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>