Commit Graph

17272 Commits

Author SHA1 Message Date
Konstantin Ritt
71de22b03f Force alignment for SSE2 to not crash with mingw
Task-number: QTBUG-36807

Change-Id: I946f96f663a63e7102c86a8bbc728ad5bf48d839
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2014-02-14 15:19:58 +01:00
Jędrzej Nowacki
f96f2fe367 Enable QByteArrayList tests
Change-Id: Id7e0550e857bf4221f49d08539a0b5c70d8386d3
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-02-14 15:16:09 +01:00
Fabian Bumberger
d72630c2ec Extend the documentation for orientation in QScreen
I find the current description of primaryOrientation and orientation
a bit confusing.

Change-Id: I25d77cff2c27c481607903bc1aeb54eacf616718
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-02-14 15:10:08 +01:00
Laszlo Agocs
3dc1ccc183 Migrate a recent QT_OPENGL_ES ifdef to dynamic GL
Change-Id: I51581cf174d11db86030da8fe288d640ef81cb58
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
2014-02-14 15:10:00 +01:00
Yoann Lopes
d12e670a6f iOS: correctly report Landscape or InvertedLandscape screen orientation.
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>
2014-02-14 15:02:09 +01:00
Sean Harmer
3232682d3b OpenGL: Fix QOpenGLTexture for cubemaps with mutable storage
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>
2014-02-14 14:36:10 +01:00
Erik Verbruggen
4273c14e57 Mac: FSEvents-based QFileSystemWatcherEngine.
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>
2014-02-14 10:51:50 +01:00
Laszlo Agocs
97c187da3c Dynamic GL switch on Windows
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>
2014-02-14 10:51:44 +01:00
Jan Arve Saether
f25aca5c65 Don't ignore horizontal alignment for items with baseline alignments
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>
2014-02-14 10:51:44 +01:00
Bernd Weimer
3cdd0358b3 Fix QDateTime auto test
Conversion from UTC to local time will result in same datetime value,
if local time is in UTC.

Change-Id: Icd4ea57cb46cc97bcc8fce4f4e579bf64a4d4b10
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
2014-02-14 10:51:44 +01:00
Bernd Weimer
fa8e6d5083 QNX: Add support for lgmon
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>
2014-02-14 10:51:44 +01:00
Kai Koehne
85e576535c Let Q_DECLARE_LOGGING_CATEGORY and Q_LOGGING_CATEGORY return a const reference
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>
2014-02-14 08:45:00 +01:00
Marc Mutz
b648f11227 QSimplex: API cleanup [1/3]: Rename an enum
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>
2014-02-14 00:34:25 +01:00
Marc Mutz
391a6627cd QDBus: replace arg-chain with multi-arg
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>
2014-02-14 00:34:25 +01:00
Marc Mutz
f530942fe4 QDBus: avoid relocations
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>
2014-02-14 00:34:25 +01:00
Christian Strømme
2223cc8a2d Add function to get the actual PID from QProcess
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>
2014-02-14 00:34:25 +01:00
Thiago Macieira
9dc7c92dcb Remove "thread_local" support from the Intel Compiler
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>
2014-02-14 00:34:25 +01:00
Thiago Macieira
d9440df5e9 Centralize the handling of all the toXxx (integral) functions
By way of templates. This makes the code a lot cleaner.

Change-Id: Ie369561c7631b0d34d76a6852883716cc0aa89d4
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-02-14 00:34:25 +01:00
Thiago Macieira
3c15118fa3 QLocalePrivate: merge removeGroupSeparators into numberToCLocale
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>
2014-02-14 00:34:25 +01:00
Thiago Macieira
ed7458a8a6 QLocalePrivate: move the stringToXxx to QLocaleData
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>
2014-02-14 00:34:25 +01:00
Thiago Macieira
1b26ef0c0c QLocalePrivate: move the xxxToString functions to QLocaleData
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>
2014-02-14 00:34:25 +01:00
Thiago Macieira
27ad3894e6 Merge the pairs of stringTo{Double,LongLong,UnsLongLong}
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>
2014-02-14 00:34:25 +01:00
Thiago Macieira
5d6c42a253 Remove duplicated trimming of a string
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>
2014-02-14 00:34:25 +01:00
Richard Moe Gustavsen
1f3891d0fb iOS: only activate top-level windows
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>
2014-02-14 00:34:25 +01:00
Richard Moe Gustavsen
3475dba53c iOS: activate window on touchesBegan
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>
2014-02-14 00:34:25 +01:00
Richard Moe Gustavsen
e33eb15811 iOS: don't store reference to focus object
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>
2014-02-14 00:34:25 +01:00
Thiago Macieira
8dcb72fd1e Add a CSV logging feature to the benchlib
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>
2014-02-14 00:34:25 +01:00
Christian Strømme
539196689e Android: Add Foreign Window support
Change-Id: Ie41edd3f17214805673311a375191cd93d2378f6
Reviewed-by: BogDan Vatra <bogdan@kde.org>
2014-02-14 00:34:25 +01:00
Christian Strømme
4ce43b565f Android: Fix return value in createSurface()
When the function fails it should return -1

Change-Id: I132a1521897295e6e232126ca51e30d2e32656c8
Reviewed-by: BogDan Vatra <bogdan@kde.org>
2014-02-14 00:34:25 +01:00
Friedemann Kleint
9835a63dde Close widgets properly from session management.
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>
2014-02-14 00:34:25 +01:00
Laszlo Agocs
ff11af4fbc QOpenGLWidget and new-style compositing on eglfs
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>
2014-02-13 20:54:01 +01:00
Gunnar Sletta
5b422304a9 Expose QPlatformWindow::invalidateSurface as a virtual function.
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>
2014-02-13 20:40:42 +01:00
Friedemann Kleint
e8ba6922c3 Windows: Destroy tablet support before unregistering window classes.
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>
2014-02-13 14:04:46 +01:00
Konstantin Ritt
03aabe6c6e Update HarfBuzz-NG path on Mac
84be1bd4d3 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 2d576f79f7).

Change-Id: I4180257bc8f610fb014fd2a2ad6f8fdceece2f13
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-02-13 09:35:29 +01:00
Konstantin Ritt
235d5dde5c Force alignment for SSE2 to not crash with mingw
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>
2014-02-13 09:35:17 +01:00
Konstantin Ritt
7ac97d7efb Merge "Merge remote-tracking branch 'origin/stable' into dev" into refs/staging/dev 2014-02-13 09:35:08 +01:00
Peter Hartmann
5b14bf342f HTTP internals: introduce protocol handlers
... to defer the decision which protocol will be used on a specific
channel. This is to allow using the SPDY protocol instead of HTTP (to
be implemented in a later commit); which protocol will be used can
only be decided after the SSL handshake.

Change-Id: I6b538320668fe4994438f0095ecdc445677cf0a6
Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
2014-02-13 03:27:43 +01:00
Peter Hartmann
57f209497c HTTP internals: move some methods inside HTTP request class
... from the private to the public class, because we need to access
these methods from other classes.

Change-Id: I2c5ea84e0f5d3641c1dc02342348f1022d886249
Reviewed-by: Richard J. Moore <rich@kde.org>
2014-02-13 03:26:48 +01:00
Glen Mabey
4f23f0530a new QByteArrayList class
Initial submission of a new class QByteArrayList with the
purpose of aggregating and then joining QByteArray instances.

[ChangeLog][QtCore] Added new QByteArrayList class.

Change-Id: I2a9dc71ff7aadb19ebc129a0d47ac8cd33895924
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-02-12 20:12:17 +01:00
Andrew Knight
2eda13c965 WinRT: move most of GUI event dispatcher logic into core
The native event dispatcher is responsible for delivering callbacks
to non-GUI handlers, such as network socket listeners. So, the non-GUI
logic is moved into the core dispatcher so that the event loop works
better for apps (and test cases) which use QCoreApplication.

Change-Id: Ic5f7d939cf164198fd39aa5880e265ae560b39b4
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
2014-02-12 20:12:17 +01:00
Kai Koehne
2b66a37a3e Fix crash in MinGW when initializing font database
Make sure that stacks are properly aligned so that we don't crash in
SSE2 code (as used in QString).

Task-number: QTBUG-36807
Change-Id: I765c1972fbb0a4b0c2dc5e4465e1d19e00b3322b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-02-12 20:12:17 +01:00
Thiago Macieira
0b700fb6f9 Use QtPrivate::is_integral instead of listing each integer type
This changes the code added by 0e4d94edd0
by removing the Q_INTEGRAL_TYPE enum value and instead relying on our
private copy of typetraits.

Change-Id: Icb6c814a36125de0d712421b97e11e8abc0f7416
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2014-02-12 20:12:17 +01:00
Shawn Rutledge
2e965ca8b7 Android: default palette taken from the Holo Light theme
Currently QAndroidPlatformTheme::palette has been returning null so
the default colors came from elsewhere.  Now they will default to
colors taken from the Holo Light theme to the extent possible.

Change-Id: I022c5ef679d9d0dcb76721a4d520492bc8a6f4cf
Reviewed-by: BogDan Vatra <bogdan@kde.org>
2014-02-12 20:12:17 +01:00
Thiago Macieira
ab1ec81f58 Optimize qt_memfill32 a little
Benchmarking shows it took up to 3.5% of Qt Creator's initialization
cost. Optimize by modifying only one variable per loop: instead of
updating n and dst128, we only update one variable at a time.

Removing the Duff's Device also improves the code, since the compiler
won't try to update dst128 four times per loop, only once.

The moving of the epilogue close to the prologue was just to make the
code a little cleaner.

Change-Id: I5b74e27d520ca821f380aef0533c244805f003b7
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
2014-02-12 20:12:17 +01:00
Thiago Macieira
af8c35bda4 Deprecate {QCoreApp,QAbstractEventDispatcher}::hasPendingEvents()
This function has a flawed design. It was flawed when it was added in
Qt 3.0.

A "false" return value is racy: any other thread running may post events
to the current thread, thus making the result stale. That includes Qt
starts for its own purposes when it comes to the main thread, like the
Scene Graph thread, the QProcessManager thread, the Windows
QAdoptedThread watcher thread, the Windows pipe writer thread, etc.

A "true" return is stable only if the selected thread is stopped, which
includes selecting the current thread (the case of QCoreApplication).
For that reason, this method should not be public, but a protected one
so that a public static could call it. But even that would not solve the
race condition from the previous paragraph (hence why
QCoreApplication::hasPendingEvents being deprecated too).

And, to top all of that off, all but one of the implementations access
the GUI thread's event loop counter in a non-thread-safe manner. I've
changed the documentation to restrict to the only currently-working use-
application.

[ChangeLog][QtCore][Event loop] QCoreApplication::hasPendingEvents and
QAbstractEventDispatcher::hasPendingEvents are now deprecated. Please
refer to the documentation for more information.

Task-number: QTBUG-36611
Change-Id: Iac61f307e9672839944ae2f75abb1aea30c419f6
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2014-02-12 20:12:17 +01:00
Andy Shaw
1bf9f725d1 Respect the DontUseNativeDialog option for QColorDialog
By reimplementing canBeNativeDialog() we ensure it is only shown
natively if the circumstances are correct. The change was modelled on
how QFileDialog implements the same checks.

Change-Id: If58e33d6d0547e95975d7c0453901fa592eb96a0
[ChangeLog][QtWidgets][QColorDialog] Ensured
QColorDialog::DontUseNativeDialog is respected when showing the dialog.
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-02-12 20:12:17 +01:00
David Faure
f42bd772f8 Move setWindowIcon() up to QGuiApplication.
[ChangeLog][QtGui][QWindow]QWindow::icon() now defaults to the application
icon, which can be set with QGuiApplication::setWindowIcon().

Change-Id: Id1974e5cda81775e515c14b294f67fb99351c6c9
Reviewed-by: Albert Astals Cid <albert.astals@canonical.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2014-02-12 20:12:17 +01:00
David Faure
bf82245baf Restore support for -title command line argument on X11, add -qwindowtitle.
-title disappeared between Qt4 and Qt5, due to all the refactorings around QPA.
Making the caption of the mainwindow configurable allows custom setups
for specific users or use cases.

[ChangeLog][QtGui][QGuiApplication] Restore support for -title command line
argument on X11, add -qwindowtitle on all platforms.

Change-Id: I73e6bf21248f3419178eba583b257172a175e74e
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Albert Astals Cid <albert.astals@canonical.com>
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2014-02-12 20:12:17 +01:00
Paul Olav Tvete
eacd58d4e7 Enabling QQuickWidget and QOpenGLWidget
Enable child widgets (without a native window) that render to an FBO
and are composed with the raster backingstore by the platform plugin.
A preliminary version of QOpenGLWidget is included as private API.

Change-Id: I8f984a4d7db285069ce3d6564707942c823d890d
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
2014-02-12 20:12:17 +01:00
Friedemann Kleint
5ae5bebb93 Added function returning build information to QLibraryInfo.
Useful for bug reports and test logs.

[ChangeLog][QtCore] QLibraryInfo provides information on how
Qt was built.

Change-Id: I867197fd7d2e10bcdf01a8eb47c9c1e03647e2c1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-02-12 17:24:33 +01:00