I find the current description of primaryOrientation and orientation
a bit confusing.
Change-Id: I25d77cff2c27c481607903bc1aeb54eacf616718
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
By way of templates. This makes the code a lot cleaner.
Change-Id: Ie369561c7631b0d34d76a6852883716cc0aa89d4
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
... 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>
... 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>
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>
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>
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>
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>
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>
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>
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>
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>
[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>
-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>
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>
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>
Qt::WA_Mapped corresponds to 'exposed' in Qt 5, hence a parent window
fully obscured by its children may not have the attribute set.
In that case, go by the attribute of the child widget.
Task-number: QTBUG-33520
Change-Id: Ia08f283172daaa58f58e5636004461b2c48784f7
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>