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>
This is additional fix for bug 23569.
Previous fix (SHA1 7fcf1cf674) is not enough.
QGtkStyle was still crashing with old gtk (< 2.14)
in drawComplexControl () function.
Bug was reproducible on CentOS 5.x and Red Hat 5.x.
Current patch makes the same check as in commit mentioned but in another
line of code.
Task-number: QTBUG-23569
Change-Id: I261b61bc93ccaada879ed02ad4d0bef62935335b
Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
Reviewed-by: Harri Porten <porten@froglogic.com>
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>
When the Cocoa menubar is updated then it ensures that the merged native
menu items are visible if appropriate. However when the old menubar is
deleted then it causes the merged native items to be hidden. Therefore
we ensure the children are deleted first which causes the native items
to be hidden and then update the menubar so that they can be correctly
visible if they should be.
Change-Id: I426864a5d2ec1f34c03290ac66371b12bf77cc00
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
/FS forces the compiler to synchronize pdb file writes.
This option is not needed when building with Visual Studio itself.
Still, qmake needs to know it when parsing the compiler flags.
Task-number: QTBUG-36535
Change-Id: Id5b68c4028844e0b95904e08b5121310a4ff13d6
Reviewed-by: Andy Shaw <andy.shaw@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>
While inheriting from NSPanel proved to be robust enough, it is
not really future proof as we're at the mercy of Apple changing
NSPanel's behavior. On the other hand, we can't inherit exclu-
sively from NSWindow as the tool window case, where the QWindow
should look like an NSPanel, can't be emulated perfectly without
using private APIs.
This reverts commits 79fb39a87c and df86721bb4.
Change-Id: I9021193e3614633a943578df9e2794b00094a1f7
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
Added a basic theme class, which creates accessors for the
QPlatformMessageDialogHelper. This handles creation of the
native dialog, but also spawning an event loop around it.
There are some limitations shared with the Android implementation.
First you cannot create custom labelled buttons and also selecting
the default button is not possible. This will be added at a later
point.
Note that Windows Phone is not supported.
Change-Id: I2dec83dcded7919835a6dcdf8dc2a56282024a7e
Reviewed-by: Andrew Knight <andrew.knight@digia.com>
There's a bug found in ICC 14.0 that causes the compiler to assert when
compiling QtDeclarative. Let's leave this here until at least one year
after the fix is released.
Intel task: DPD200253124
Task-number: QTBUG-36577
Change-Id: I76d4b41da7e60397dac65862a3a6ec024b840744
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
These functions now return a QStringList to reflect the possibility of
there being more than one entry of a given type, but the documentation
did not reflect this.
Task-Number: QTBUG-36304
Change-Id: Iba2eda5e2c3174c8dcea640b5aed9cdc9a432392
Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
Avoid dereferencing the q-pointer if the button has been
destructed meanwhile popup was open.
Task-number: QTBUG-26956
Change-Id: I68190e9fe84c669229ae0ce4d573ee7a02a8a141
Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
Partially revert 54865d47cfd859a0e84ba8e1bbff3b56c93d4e0d and
bring back parts from abba37cd0eff959edf2d011842cbf2b36cce8467 which
failed some tests on other platforms and never made it in.
Avoid setting a geometry on maximized windows since that leaves
them in a broken state. Instead, if there is a need to restore
maximized windows to a different screen, clear the maximized flag
before applying the geometry.
[ChangeLog][QWidget][Windows] QWidget::restoreGeometry() now restores
maximized/full screen widgets to the correct screen.
Task-number: QTBUG-21371
Task-number: QTBUG-4397
Change-Id: Ibd5b736e921f20d4b7365c06c6f9c5dd4469c781
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
Use the same logic as in the Unix configure script, and disable
"widgets" if "gui" is disabled.
Change-Id: Ica338ad10b965eea297dddaaedeea61a3ae3ebe9
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Allow configuration of logging rules from outside of the application,
either through a configuration file (.config/QtProject/qtlogging.ini),
or through a file specified by a QT_LOGGING_CONF environment
variable.
The logging rules from the different sources are concatenated: First
the rules from QtProject/qtlogging.ini are applied, then
QLoggingCategory::setLoggingRules(), finally from the environment.
This allows an application to overwrite/augment the system wide rules,
and in turn that can be tailored for a specific run by setting a
configuration in the environment variable.
[ChangeLog][QtCore][Logging] The logging framework can now be configured
with an .ini file.
Change-Id: I442efde1b7e0a2ebe135c6f6e0a4b656483fe4b1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
QWidgetPrivate::updateWidgetTransform will only update the
transform if the widget is the current focus object.
But if someone calls QApplication::setActiveWindow, Qt will
call QWindow::requestActivate and then send focus
in/out events, all in the same event loop recursion.
The problem now is that requestActivate is not guaranteed to be
synchronous (it's not on iOS). So the window activation
(together with updating the focus object) will still be pending
when the widget receives the focus-in event. As such, the
transform update will also fail.
This patch will give the event as input to the function, so
that we don't depend on window activation being synchronous.
This will fix IM spell checking popups on iOS to show at the
correct place, also after closing font popups etc.
Change-Id: If0ee70f55692bbd613821b126923364e39ed1199
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
This was broken for shadow builds. Adding the output directory to the
manifest file name fixes the problem.
Change-Id: I9e5b47a08f80f7afcfd76e13784fbaec912e50ad
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Makes it possible for QFusionStyle to utilize the same animation.
Change-Id: Ifac9eaa3138cf1068439d5b0271a2acce54a3c16
Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
This patch cleans up the coding style and includes
Change-Id: I710d4a60795e9975d4f8ee79599018e05d85debe
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
The fixme comment is invalid since QAccessibleWidget actually checks for
isWindow and sets the active state.
This is messed up because in Qt 4 there was a work-around to set active
for windows in a different code path.
[ChangeLog][QtGui] Accessibility on Linux now reports the active state
correctly.
Change-Id: I9e2cf436b3ffa7ef28286ee49d6e582f179930c6
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>