summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* QOpenGLTextureBlitter: Remove Origin location for the Target rectJørgen Lind2014-02-164-20/+15
| | | | | | | | | | | | | | | | | | | | | The Origin for Target rect was deemed a confusing concept. The current implementation would translate the target rect to the coordinate system specified. However, the order and "direction" of the vertices would always be the same. So drawing a texture in for one target rect defined in one coordinate system would paint the texture the same way as it would when a texture was drawn for a target rect drawn in the "opposite" coordinate system. The point with this was that if you wanted to "flip" the texture you would specify that with the source coordinate system. However, this approach breaks on different levels, such as QRect has functions which expects a top left coordinate system (ie. top() and bottom()). In the end Qt uses a top left coordinate system, hence QWindow specifies a top left coordinate system, and hence the api becomes easier if it is not possible to define the coordinate system of the target viewport. Change-Id: I7dd59b3718380876e87a4bff88381d7a1c7d58c1 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Make the printing of complex Unicode in a QString prettierThiago Macieira2014-02-163-11/+72
| | | | | | | | | | | | | | | This also has the advantage of not requiring the use of the locale codec. Quite an advantage if you're debugging the locale codec. But it's mostly so that we don't get question marks that hide the difference we were trying to locate. [ChangeLog][QtTest] QtTest now prints an escaped version of QStrings that failed to compare with QCOMPARE. That is, instead of converting non-printable characters to question marks, QtTest will print the Unicode representation of the character in question. Change-Id: I44c1ef3246b188c913dacd3ca4df02581356ea41 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Add the rest of the non-volatile members of std::atomic to QBasicAtomicThiago Macieira2014-02-164-3/+656
| | | | | | | | | | [ChangeLog][QtCore][Atomic support]Added more operations to the atomic classes, including operator T(), operator=(T), operator++, operator--. For the QAtomicInteger, bit-manipulation operations are also provided, both in operator and in fetchAndXxxYyyyyy modes. Change-Id: I39c07be74e15e0a48f9e931f4342b182004dee1a Reviewed-by: David Faure <david.faure@kdab.com>
* Add a testAndSet overload to the atomics that returns the current valueThiago Macieira2014-02-1610-30/+278
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is extremely useful, since the most common action after a failed compare-and-swap is to loop around, trying again with the current value as found in memory. Code currently written as: do { Type value = atomic.load(); ... } while (!atomic.testAndSetRelaxed(value, desired)); Becomes: Type value = atomic.load(); do { ... } while (!atomic.testAndSetRelaxed(value, desired, value)); In most CPU architectures, the value that was found in memory is known to the compare-and-swap code, so this is more efficient than the previous code. In architectures where the value is not known, the new code is no worse than before. The implementation sometimes modified an existing function, sometimes it added a new one, depending on whether more registers were needed in the assembly (like ARMv6-7), the code became more complex (ARMv5), the optimizer failed (C++11), or it was just plain equivalent (MIPS). Change-Id: I7d6d200ea9746ec8978a0c1e1969dbc3580b9285 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Initial support for the Intel Compiler 14.0 on OS XThiago Macieira2014-02-161-1/+1
| | | | | | | | | | | ICC 8 and 9 are positively ancient. I doubt anyone is using them for Qt, let alone Qt 5. ICC 11 through 13 haven't supported OS X. ICC now masquerades as Clang, so we need to let qmake and qcompilerdetection.h know about it. Change-Id: If0d2bd8b6a4a45250c15c9472c062effc76f17de Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Work around ICC 14 bug: __attribute__((deprecated)) with textThiago Macieira2014-02-161-1/+1
| | | | | | | | Apparently it doesn't like the text. Change-Id: If8e14df84f0d9915018eac94df16bf1b679155e0 Reviewed-by: Keith Gardner <kreios4004@gmail.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Centralize the merging toFloat conversionsThiago Macieira2014-02-164-59/+22
| | | | | | | | The QByteArray version was missing the overflow check that the other versions had. Change-Id: I03cd92e5e5a84c038bee1f1ee217e93e9d9a675a Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Add qHash() overloads for floating-point typesMarc Mutz2014-02-162-0/+37
| | | | | | | | | | | | | | | | | | | | | This implementation is based on GCC's implementation of std::hash<FP>, but only to the extent of checking for zero before hashing the bits. The bit hasher is the Qt one; I didn't even look what GCC uses. The check against 0.0 is mandated by the requirement to have \forall x,y: x == y => qHash(x) == qHash(y) which would be violated for x = 0.0 and y = -0.0 if we only hashed the bits. Implemented out-of-line to avoid potential FP-comparison warnings, as well as to be able to use the file-static hash() functions, which gets inlined unlike qHashBits(), which cannot be. [ChangeLog][QtCore][QHash/QSet] Allowed to use float, double and long double as QHash/QSet keys. Change-Id: I38cec4afb860f17e9f8be7b67544e58b330f8fff Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
* QFont: add missing qHash overloadMarc Mutz2014-02-163-0/+31
| | | | | | | | | | | | | | | | | | | The properties that make up the hash value are chosen to be the same as those that make up QFontDef's op<() and op==(). Indeed, the implementation for QFont simply delegates to the one of QFontDef, which has been added for this purpose, but may prove useful in its own right down the line. The code would greatly benefit from a qHash(qreal) implementation. Lacking this, the patch uses multiplication with 10000 and qRound64() to convert the one floating-point property used in the hash to an integer. This is probably the right thing to do anyway, to avoid epsilon problems. [ChangeLog][QtGui][QFont] Added qHash overload for this class. [ChangeLog][QtCore][QHash] Allowed QFont to be used as a key in QHash/QSet. Change-Id: I2c1cb5d9da53e26cb2c0f1a7c357731e73eea78e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Android: Add enablers for listening to activity resultsEskil Abrahamsen Blomfeldt2014-02-155-1/+75
| | | | | | | | | | | | | | | | | | | When you launch an activity through an intent, data can be provided back from the activity when it has finished using onActivityResult() in the activity which launched it. This is okay for applications, since they can easily create their own activities, but does not work for libraries that need to use intents. There is no listener API for activity results which allow external classes to eavesdrop. In order to support launching intents from third-party or add-on libraries, we provide a low-level way to hook into the activity result event. The corresponding public API will be added to QtAndroidExtras. Change-Id: I89417f485e2c0e69028dcccc7c155788346a7417 Reviewed-by: Christian Stromme <christian.stromme@digia.com>
* Add const overload for QLoggingCategory::operator()()Kai Koehne2014-02-152-0/+9
| | | | | | | | | | | | | | | | | | | | Change 85e57653 caused a compile error for code that does Q_DECLARE_LOGGING_CATEGORY(cat); //.. qCDebug(cat()) << // ... error: C3848: expression having type 'const QLoggingCategory' would lose some const-volatile qualifiers in order to call 'QLoggingCategory &QLoggingCategory::operator ()(void)' This is a regression from Qt 5.2. Fix the error by adding a const version of operator()(). Change-Id: I2fb04f2e155962adee0f98089fc5a159000bef56 Reviewed-by: Alex Blasche <alexander.blasche@digia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Exclude widgets without associated QWindow in QApplication::shouldQuit().Friedemann Kleint2014-02-151-3/+5
| | | | | | | Task-number: QTBUG-35986 Change-Id: Ibeb425fe054af163b86b2142028b3ea744cb9820 Reviewed-by: David Faure <david.faure@kdab.com>
* Revert "Logging: Don't use for loop in qCDebug macros"Kai Koehne2014-02-151-3/+3
| | | | | | | | | | | | | | | | | | The use of if {} else {} in the macro causes compiler warnings about "ambiguous 'else'" if qCDebug is used in an if / else without brackets. Revert to the for loop, but make the variable name less likely to clash. This reverts commit bab5f5873680aa3c5a22d94da112aafd2b0b53d3. Task-number: QTBUG-36605 Change-Id: Ie4b075b63b83b7f8a2ad61437b7bf3e6a6c0177a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com> Reviewed-by: Alex Blasche <alexander.blasche@digia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* WinRT: Added socket engine implementationOliver Wolff2014-02-152-85/+1004
| | | | | | | | | | Added basic functionality to socket for WinRT. Even though not all auto tests pass yet, this patch can be seen as a foundation for upcoming work in this area. Reading from and writing to TCP socket works and one can listen for tcp connections. Change-Id: Id4c25ba1c7187ed92b6368c785c4f62837faded7 Reviewed-by: Andrew Knight <andrew.knight@digia.com>
* WinRT: Exit process event loop if WaitForMoreEvents is not setOliver Wolff2014-02-151-0/+2
| | | | | Change-Id: Ic74a75a56ba3f014b108e96d7a79a8623e6fa1d1 Reviewed-by: Andrew Knight <andrew.knight@digia.com>
* Consolidate StandardButton, ButtonRole and related static functionsShawn Rutledge2014-02-1513-201/+235
| | | | | | | | | | Moving them into QPlatformDialogHelper for the convenience of both widgets and QtQuick.Dialogs. The main reason is to ensure that QtQuick.Dialogs does not need to depend on the widgets module, in order to re-implement the button box concept in a generic dialog. Change-Id: If400d215338d7cb6dade39d9de60e50b5e7515ef Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* Extending the inputMethodQuery APIPaul Olav Tvete2014-02-1510-7/+93
| | | | | | | | | | | | | | Currently, inputMethodQuery() only provides information about the current paragraph. On some platforms, such as Android, the input method needs information about the global cursor position, and more of the surrounding text. Some queries need to pass parameters. The current inputmethodQuery() implementation does not allow parameters to be passed. Changing this would require new or modified virtual functions, which is not possible until Qt 6. Therefore, a completely new mechanism is needed. Change-Id: Ic64fd90198ade70aa0fa6fa5ad3867dfa7ed763c Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Fix logging with dynamic GL on WindowsLaszlo Agocs2014-02-141-4/+3
| | | | | | | | | | category() returns a const QLoggingCategory so our code does not compile anymore. Do it differently. Fix also the Windows error string formatting a bit. Change-Id: Ie0b6b02947d94b7ccf4a4a57da487dfa8a15709d Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* Extend the documentation for orientation in QScreenFabian Bumberger2014-02-141-3/+8
| | | | | | | | I find the current description of primaryOrientation and orientation a bit confusing. Change-Id: I25d77cff2c27c481607903bc1aeb54eacf616718 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Migrate a recent QT_OPENGL_ES ifdef to dynamic GLLaszlo Agocs2014-02-141-2/+4
| | | | | Change-Id: I51581cf174d11db86030da8fe288d640ef81cb58 Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
* iOS: correctly report Landscape or InvertedLandscape screen orientation.Yoann Lopes2014-02-141-4/+4
| | | | | | | | | | | | The Qt documentation says that PortraitOrientation is rotated 90 degrees clockwise relative to LandscapeOrientation. This means that the home button should be on the right when held in LandscapeOrientation, therefore, Qt::LandscapeOrientation == UIDeviceOrientationLandscapeLeft. Without this patch, all QScreen mapping functions are broken. Change-Id: I2c570cd0307b7fbd59c749d6574dcb258790cfbc Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
* OpenGL: Fix QOpenGLTexture for cubemaps with mutable storageSean Harmer2014-02-142-9/+71
| | | | | | | | | | | | The code was not creating all of the storage necessary for cubemaps as well as attempting to bind to the cubemap face targets which is invalid when using mutable storage - typically on OS X where EXT_direct_state_access is not available and immutable storage is only available at all if using an OpenGL 4.1 context. Change-Id: I4cf84f1b88c90e8359366392b3ccda65669ebfa7 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Pasi Keränen <pasi.keranen@digia.com>
* Mac: FSEvents-based QFileSystemWatcherEngine.Erik Verbruggen2014-02-144-2/+659
| | | | | | | | | | | Use FSEvents to monitor changes in the filesystem instead of the kqueue implementation. This removes the limit of wathed files: kqueue uses a file descriptor for each file monitored, for which the ulimit was set by default to 256. Now the OSX implementation on par with the other major desktop platforms. Change-Id: I2d46cca811978621989fd35201138df88a37c0fb Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* Dynamic GL switch on WindowsLaszlo Agocs2014-02-1447-1016/+5949
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The patch introduces a new build configuration on Windows which can be requested by passing -opengl dynamic to configure. Platforms other than Windows (including WinRT) are not affected. The existing Angle and desktop configurations are not affected. These continue to function as before and Angle remains the default. In the future, when all modules have added support for the dynamic path, as described below, the default configuration could be changed to be the dynamic one. This would allow providing a single set of binaries in the official builds instead of the current two. When requesting dynamic GL, Angle is built but QT_OPENGL_ES[_2] are never defined. Instead, the code path that has traditionally been desktop GL only becomes the dynamic path that has to do runtime checks. Qt modules and applications are not linked to opengl32.dll or libegl/glesv2.dll in this case. Instead, QtGui exports all necessary egl/egl/gl functions which will, under the hood, forward all requests to a dynamically loaded EGL/WGL/GL implementation. Porting guide (better said, changes needed to prepare your code to work with dynamic GL builds when the fallback to Angle is utilized): 1. In !QT_OPENGL_ES[_2] code branches use QOpenGLFunctions::isES() to differentiate between desktop and ES where needed. Keep in mind that it is the desktop GL header (plus qopenglext.h) that is included, not the GLES one. QtGui's proxy will handle some differences, for example calling glClearDepth will route to glClearDepthf when needed. The built-in eglGetProcAddress is able to retrieve pointers for standard GLES2 functions too so code resolving OpenGL 2 functions will function in any case. 2. QT_CONFIG will contain "opengl" and "dynamicgl" in dynamic builds, but never "angle" or "opengles2". 3. The preprocessor define QT_OPENGL_DYNAMIC is also available in dynamic builds. The usage of this is strongly discouraged and should not be needed anywhere except for QtGui and the platform plugin. 4. Code in need of the library handle can use QOpenGLFunctions::platformGLHandle(). The decision on which library to load is currently based on a simple test that creates a dummy window/context and tries to resolve an OpenGL 2 function. If this fails, it goes for Angle. This seems to work well on Win7 PCs for example that do not have proper graphics drivers providing OpenGL installed but are D3D9 capable using the default drivers. Setting QT_OPENGL to desktop or angle skips the test and forces usage of the given GL. There are also two new application attributes that could be used for the same purpose. If Angle is requested but the libraries are not present, desktop is tried. If desktop is requested, or if angle is requested but nothing works, the EGL/WGL functions will still be callable but will return 0. This conveniently means that eglInitialize() and such will report a failure. Debug messages can be enabled by setting QT_OPENGLPROXY_DEBUG. This will tell which implementation is chosen. The textures example application is ported to OpenGL 2, the GL 1 code path is removed. [ChangeLog][QtGui] Qt builds on Windows can now be configured for dynamic loading of the OpenGL implementation. This can be requested by passing -opengl dynamic to configure. In this mode no modules will link to opengl32.dll or Angle's libegl/libglesv2. Instead, QtGui will dynamically choose between desktop and Angle during the first GL/EGL/WGL call. This allows deploying applications with a single set of Qt libraries with the ability of transparently falling back to Angle in case the opengl32.dll is not suitable, due to missing graphics drivers for example. Task-number: QTBUG-36483 Change-Id: I716fdebbf60b355b7d9ef57d1e069eef366b4ab9 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
* Don't ignore horizontal alignment for items with baseline alignmentsJan Arve Saether2014-02-141-43/+43
| | | | | | | | | Horizontal alignment were ignored when an item had baseline alignment specified. Change-Id: I2df526dc830952cdc26e1973d4787e9457c94edd Reviewed-by: J-P Nurmi <jpnurmi@digia.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* QNX: Add support for lgmonBernd Weimer2014-02-148-10/+156
| | | | | | | | | | | | | | Added configure test, whether lgmon (liquid graphics performance monitor) is available. The test is supposed to be positive only for internal BlackBerry NDKs currently. Added calls to initialize lgmon and to indicate when an app is ready for user input. Change-Id: I5cbc29fb38a86585dcebd14d462436deaa1998aa Reviewed-by: Wolfgang Bremer <wbremer@blackberry.com> Reviewed-by: Fabian Bumberger <fbumberger@rim.com> Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com> Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com>
* Let Q_DECLARE_LOGGING_CATEGORY and Q_LOGGING_CATEGORY return a const referenceKai Koehne2014-02-143-5/+5
| | | | | | | | | | | | | In general QLoggingCategory should be treated as a const object that's configured by the backend. The only legitimate place where user code should call setEnabled is in a CategoryFilter ... [ChangeLog][QtCore][Logging] Make Q_LOGGING_CATEGORY and Q_DECLARE_LOGGING_CATEGORY return a const object. Change-Id: I6140442ab48286e05cd3b55064a502bbe6dfb16a Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QSimplex: API cleanup [1/3]: Rename an enumMarc Mutz2014-02-142-4/+4
| | | | | | | | | Enums should be named LikeThis, not likeThis, even in private API. Change-Id: I197f9f888204a7c495364bd09357bfca24146560 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QDBus: replace arg-chain with multi-argMarc Mutz2014-02-141-3/+3
| | | | | | | | | | The arguments are all strings, so multi-arg is available without other changes to the code. Even though insertion of a format placeholder can be ruled out in the present case, multi-arg should be faster than a 3-chain of arg() calls. Change-Id: I8d030227e1bd30c56f1062a0c9dbbaae0143885f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QDBus: avoid relocationsMarc Mutz2014-02-141-8/+9
| | | | | | | | Instead of using Q_STRINGTABLE, use a switch/if construct to be able to share the string data for "write" and "readwrite". Change-Id: Ia1c7b8a0f13a809372de2e5a956978dc2d569e92 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Add function to get the actual PID from QProcessChristian Strømme2014-02-142-2/+27
| | | | | | | | | | | | | | | | | | | | It was not possible to get the actual process ID (in a cross-platform manner) from QProcess, as the user would need to handle the returned typedef (Q_PID) differently on Unix and Windows. On Unix Q_PID is the actual process ID, but on Windows it's a pointer to a PROCESS_INFORMATION structure, which among other fields contains the process ID. Instead of returning a pointer on Windows, QProcess::processId() will return the actual process ID on both Windows and Unix. [ChangeLog][QtCore][QProcess] Added processId() to QProcess. This function will, unlike pid(), return the actual process identifier on both Window and Unix. Task-number: QTBUG-26136 Change-Id: I853ab721297e2dd9cda006666144179a9e25b73d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove "thread_local" support from the Intel CompilerThiago Macieira2014-02-141-1/+0
| | | | | | | | | | | | | | | The docs said it supports the feature, but now that we've tried to use it, we can't. It might have been referring to the non-C++11 extension from GCC (__thread). qlogging.cpp(1253): error #303: explicit type is missing ("int" assumed) static thread_local bool msgHandlerGrabbed = false; ^ Change-Id: I9343cf61bd3b2eacac686e602cc0ffea2d4a7a22 Reviewed-by: Kai Koehne <kai.koehne@digia.com> Reviewed-by: Mehdi Fekari <mfekari@blackberry.com> Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
* Centralize the handling of all the toXxx (integral) functionsThiago Macieira2014-02-145-242/+140
| | | | | | | By way of templates. This makes the code a lot cleaner. Change-Id: Ie369561c7631b0d34d76a6852883716cc0aa89d4 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* QLocalePrivate: merge removeGroupSeparators into numberToCLocaleThiago Macieira2014-02-143-84/+52
| | | | | | | | This version will parse the string only once and will not do any memmove. This is more efficient. Change-Id: I59026ad0fa61cc3f16146bdcd622fc54cbd8a321 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* QLocalePrivate: move the stringToXxx to QLocaleDataThiago Macieira2014-02-147-97/+93
| | | | | | | | | Along with some more helper functions. There are two more functions used in QIntValidator Change-Id: I469ef40426cbb73ab515454bd5ecb12d944f5c0a Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* QLocalePrivate: move the xxxToString functions to QLocaleDataThiago Macieira2014-02-147-189/+176
| | | | | | | | | | | Those functions do not need any of extra QLocale settings in QLocalePrivate, so we can move them easily, along with their flags. It's also very convenient that we can now bypass completely QLocale when formatting numbers to strings. Change-Id: I8cae64e8e2056a6b2d716758e4be79f746644732 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Merge the pairs of stringTo{Double,LongLong,UnsLongLong}Thiago Macieira2014-02-143-70/+21
| | | | | | | | | | The difference between them was simply whether they operated on QString or QStringRef. So drop down to what's common between them: a pointer and a length (or two pointers, but numberToCLocale already operates on a pointer and a length). Change-Id: Ie7c8955ac13d6023761e6d3bafe7ab04bd6984e1 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Remove duplicated trimming of a stringThiago Macieira2014-02-141-49/+13
| | | | | | | | | No need to do it in QLocalePrivate::xxxToDouble() because numberToCLocale() already does it for us. Centralized code = better code. Change-Id: Ifecf9119556d4465582212b5be773c18edd13563 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* iOS: only activate top-level windowsRichard Moe Gustavsen2014-02-141-9/+12
| | | | | | | | | | | | | | | From before we would activate all QWindows that the user tapped on, or setVisible were called on. This is wrong since a QWindow does not have to be a top-level window. For a non-alien widget application this would mean that we would send activation events for all widgets that the user tapped on all the time. With this patch we do some extra checking before we tell a QWindow to activate. Change-Id: I1afe97e5384c36c67fee0bbd070d880bba7528a1 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
* iOS: activate window on touchesBeganRichard Moe Gustavsen2014-02-141-8/+3
| | | | | | | | | | | | | | We need to activate a window on touchesBegan instead of touchesEnded. The reason we used to do this on touchesEnded was to delay activating a window in case the user started e.g a flick. But delaying the activation can cause problems if the app activates a different window on press. We will then cancel this out on release since we then raise the pressed window instead. This is e.g typical when opening popups, and will cause focus to not be restored properly when later closing the popup again. Change-Id: I709b2f2e2633c9dc85c2761b0b176cd23c2f6b36 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
* iOS: don't store reference to focus objectRichard Moe Gustavsen2014-02-142-5/+1
| | | | | | | | | | | Sometimes focus object is updated after we get a callback that the cursor rectangle has changed. And there is no reason to keep a local reference to it. Since we also send events to the qApp->focusObject from UIView_textInput, we now end up more consistent. Change-Id: I3976175aae4e3f346be9bc5b771ac0fdefc03ae6 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
* Add a CSV logging feature to the benchlibThiago Macieira2014-02-147-3/+202
| | | | | | | | | | | | | | | This is only useful for logging benchmarks, since it won't print test passes, failures, etc. It's useful for importing to spreadsheets to do number-crunching. [ChangeLog][QtTest]Added a CSV logging mode that is suitable for importing benchmark results into spreadsheets. This can be enabled by the -csv option on the command-line. The CSV logging mode will not print test failures, debug messages, warnings, etc. Change-Id: I245d6f86bb380645c9bc0d748cf474b3ed42cab8 Reviewed-by: Sergio Ahumada <sahumada@blackberry.com> Reviewed-by: Jason McDonald <macadder1@gmail.com>
* Android: Add Foreign Window supportChristian Strømme2014-02-148-8/+213
| | | | | Change-Id: Ie41edd3f17214805673311a375191cd93d2378f6 Reviewed-by: BogDan Vatra <bogdan@kde.org>
* Android: Fix return value in createSurface()Christian Strømme2014-02-141-1/+1
| | | | | | | When the function fails it should return -1 Change-Id: I132a1521897295e6e232126ca51e30d2e32656c8 Reviewed-by: BogDan Vatra <bogdan@kde.org>
* Close widgets properly from session management.Friedemann Kleint2014-02-144-35/+64
| | | | | | | | | | | | | | | | Introduce new virtual QGuiApplicationPrivate::tryCloseAllWindows() which allows overriding the behavior in QApplication to properly close the widgets first. Without this, QGuiApplication closes the widget windows leaving a stale window handle behind in the associated QWidget which then causes the application not to terminate since QApplication::shouldQuit() stills finds the affected widgets to be visible. Task-number: QTBUG-35986 Change-Id: I19ac4b5a19250ee68d09e461c03dbace458c98e4 Reviewed-by: David Faure <david.faure@kdab.com>
* QOpenGLWidget and new-style compositing on eglfsLaszlo Agocs2014-02-1318-173/+275
| | | | | | | | | Integrate with QOpenGLTextureBlitter, QOpenGLWidget and friends. Change-Id: Ic2867b713a21a3d2820d546174fc9164b3dd220c Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com> Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
* Expose QPlatformWindow::invalidateSurface as a virtual function.Gunnar Sletta2014-02-132-0/+16
| | | | | | | | | This can be quite useful on some embedded systems to free up graphics memory when windows are not used. QEglFSWindow already implements the function. Change-Id: I79b08efbd3c67d7be34df6a0e12dd184a92d48c5 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Windows: Destroy tablet support before unregistering window classes.Friedemann Kleint2014-02-131-2/+7
| | | | | | | | | | | Silences warnings in tests that instantiate QGuiApplication multiple times. QSYSTEM: tst_QGuiApplication::removePostedEvents() QApplication::regClass: Registering window class 'TabletDummyWindow' failed. (Class already exists.) QSYSTEM: tst_QGuiApplication::removePostedEvents() UnregisterClass failed for 'TabletDummyWindow' (Class still has open windows.) Change-Id: I6af2d38a2debd35f4dc0d48c09244dff022bd6b8 Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
* Update HarfBuzz-NG path on MacKonstantin Ritt2014-02-132-1/+5
| | | | | | | | | | 84be1bd4d3ed8d2d9e65301649bc841ea4197fe2 has changed the stored data type from QFontEngine to QFontEngine::FaceData. Update the implementation and revert changing the y_scale sign on non-Mac (aka fix-up 2d576f79f748ca4c9bb54634f0fd44fa207a2248). Change-Id: I4180257bc8f610fb014fd2a2ad6f8fdceece2f13 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Force alignment for SSE2 to not crash with mingwKonstantin Ritt2014-02-133-6/+6
| | | | | | | | | | Make sure that stacks are properly aligned by replacing CALLBACK with QT_WIN_CALLBACK so that we don't crash in SSE2 code. Task-number: QTBUG-36807 Change-Id: I6952d0f252c7b8e481c48521ed1377b7d7510e15 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>