A module plugin in qml belongs to a URI/namespace. This
uri is resolved run-time by QtDeclarative by knowing the
path of the qmldir that references the plugin.
For static plugins this becomes a problem, since we lost
the information regarding which plugin belongs to which
qmldir, since a static plugin has no file path.
To avoid pushing the responsibility of clarifying this
onto the application developer, it is better to embed this
information into the meta data of the plugins themselves.
Since this information can be resolved by the
build system, a new option to moc has been added:
-M<key=value>
that will let you add meta tags to the meta data from
the command line to each class that has an IID specified.
For the URI case, we can then e.g do:
-Muri=QtQuick.Controls -Muri=QtQuick.Controls.Private
Change-Id: I81a156660148fc94db6f3cac0473e9e1c8458c58
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
We plan to add support for native message/alert dialogs on Android
and iOS because it's otherwise impossible to have a true popup window.
Then we might as well have native message/alert dialogs on other
platforms too. It will become an alternative implementation behind
QMessageBox and perhaps QErrorMessage.
Task-number: QTBUG-30883
Task-number: QTBUG-29462
Change-Id: I73dcfc6438e696189b6d37091874c7ad69b4ec68
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
Added QXcbSessionManager to the Xcb plugin.
QXcbSessionManager inherits from QPlatformSessionManager, it's a port of
QSessionManager as it is in Qt 4.8.
Minor changes also in QPlatformSessionManager and QGuiApplication to
hook it up.
Task-number: QTBUG-28228
Task-number: QTBUG-30011
Task-number: QTBUG-33033
Change-Id: I50b33d05a1e32c5278dea339f693713acc870a70
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: David Faure <david.faure@kdab.com>
These structures do not need to be packed. With some compilers, Q_PACKED
was defined to be empty, which means that the code was working fine
without packing. Or there were some lingering problems on those
platforms (MSVC) and we're now exposing them in all platforms.
Actually, it shouldn't be a problem anywhere. QCharAttributes, quint24
and QFontEngineQPA::Glyph have only char/uchar members, so they're
packed already (they have alignof == 1). The only platform where that
wasn't true was ARM OABI, which we don't support anymore.
QFontEngineQPA::Header seems to always come from a QByteArray, so it
doesn't neeed to be packed either. However, just to be sure, I'm
inserting a check for alignment.
And QFontEngineQPA::Block isn't used anywhere.
Change-Id: Iacfa25edf336ef2a03aeb6e40ae90937a21661ae
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
Structs defined with Q_PACKED *need* to be packed in all
platforms. Having an empty define means errors might go unnoticed for
a long time.
Change-Id: I9c388358fed27a8e018465f05375e4bbbee3484c
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Leftover. It's not used anywhere.
Change-Id: I023a390d84c9ed5dacd2699145f183e8a2317153
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Sorting is O(NlogN) complexity, while nth_element is linear.
Change-Id: Ic6596affe183494e87abe7bdaa7c9985f5b7cd58
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
In case this code is ever instantiated with a type that actually benefits from moving.
'value' is save to move since it was passed to the function by value.
'*mid' is save to move since it originates in a container that will be
discarded on the next line anyway.
Change-Id: I13587be10974ba6cf95d56e0f8912ff88167b60b
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Call QPlatformCursor::pointerEvent() even when the mouse event is
stopped due to being blocked by a modal window. This is necessary for
relatively dumb platforms, like eglfs, because the mouse cursor is
expected to be functional across the entire screen regardless of
having a modal dialog shown.
Platforms where the cursor is handled by the system (xcb, windows,
etc.) are not affected as they don't implement pointerEvent() anyway.
Change-Id: I4996ca0db23eb7f6ca3e2432d8d7abb1a5113dca
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
Mesa does not like eglSwapInterval calls without a current context.
Change-Id: I7ec2d4311586cf74da0461bc951a0e5d9399c35b
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
This is a simple optimisation allowed to us by the fact that all platforms
we run on use two's complement for the signed integers. The trick works as
long as one of the two signed integers is known beforehand to be
non-negative:
- by definition, for any signed integer i, i <= INT_MAX
- by definition, for any unsigned integer u, u >= 0
- given a signed integer x >= 0, 0U <= uint(x) <= uint(INT_MAX)
- therefore, given another signed integer y of whatever
value, uint(x) < uint(y) ←→ x < y && y >= 0
The trick is an optimisation because the compiler doesn't know that one of
the two sides is always non-negative. Otherwise, it would do the
same optimisation.
Change-Id: If256ec0df4e06335805af8010bb67ce5fd3e065a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
When trying to create more than one window, stop with a helpful error
message since this is not yet supported. Also, return a fake WId for
desktop windows.
Change-Id: I9859b62b1d4f6b6142982d2e5a90afc1fc3c6a28
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
Q_GLOBAL_STATIC accessor is documented to return dangling pointer if
called after destruction.
Change-Id: Ieafd5619b20ad256d9d5ad007d939f1430ef681f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
It is not really fatal but fixing it gets rid of a Mesa warning.
Change-Id: I3045b2691e7457541d6524c3e3ff8a1882ca460b
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
Probably added by a1898f4466.
qmetatype.h:70:29: error: inline function 'qMetaTypeId<QtMetaTypePrivate::QSequentialIterableImpl>' is not defined [-Werror,-Wundefined-inline]
qmetatype.h:1363:30: note: used here
const int toId = qMetaTypeId<QtMetaTypePrivate::QSequentialIterableImpl>();
qmetatype.h:70:29: error: inline function 'qMetaTypeId<QtMetaTypePrivate::QAssociativeIterableImpl>' is not defined [-Werror,-Wundefined-inline]
qmetatype.h:1386:30: note: used here
const int toId = qMetaTypeId<QtMetaTypePrivate::QAssociativeIterableImpl>();
Change-Id: I9afe1a3d50ab23eb701797e28b259966dc95a147
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
So far we've known that we want QCollator as public API. It hasn't
been possible yet due to the strong dependency that QCollator used
to have on ICU.
This patch adds collation support for the platforms where ICU is not
the best option by using native collation API. Namely Windows and
Mac OS X.
Additionally a fallback POSIX back-end is added, so that we can make
sure it will work on any posix-compliant platform.
Change-Id: Ia1734acbf5f596698a81f2af927cc15636e4c908
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Propose the API to be changed so that we can implement QCollator in the
different platforms where Qt is available.
Change-Id: I7b3e933d7e3d1aa26c1b78d21ef75b71c692827f
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The class missed the feature freeze for Qt 5.0, but has been ready
for quite a while. So make it public in time for Qt 5.2.
Change-Id: I9ac3f579ff5e371925fad40684762fff7ee4abd8
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Move scriptRequiresOpenType() body right into QFontEngine::supportsScript(),
thus centralizing use of this performance cheat.
Change-Id: I5f494b086f8f900b631c491f41e9cb800002c0f6
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Get rid of duplicated includes, useless defines, and private enums
that just duplicate a public ones; avoid variable names collisions.
Change-Id: I540e812b6cd510eb1ed441d97e9af377611d804a
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
As we're using CFRunLoopIsWaiting() to check for the possible presence
of system events hasPendingEvents() will never return false if called
on the main thread. We assume clients will not use this function to
determine whether or not to call processEvents(), but instead use the
return value from processEvents.
Change-Id: Ifd63892c6d35bb7da204072616bfe3ee69ca1d85
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
UIKit changes the run-loop mode during scrolling to UITrackingMode, which
presumably prioritizes touch events and other sources related to a
smooth scrolling experience. It signals this change by interrupting the
current run-loop pass, and the outer loop is responsible for re-entering
the run-loop in the new mode. Failing to enter the run-loop with this
new mode results in UIScrollViews losing their kinetic feel when
flicking. This can be observed by e.g. bringing up the Emoji keyboard
and scrolling it horizontally.
We keep track of the current run-loop mode by listening for push and pop
notifications on the UIApplication object. The current mode is then used
in our Q_FOREVER-loop when re-entering CFRunLoopRunInMode.
For now we don't add our posted event source or timer source to the
new modes, under the assumption that the system prefers to limit the
number of sources that will fire during scrolling. If this turns out
to give a bad user-experience for Qt applications we should consider
changing it.
Change-Id: I3a612b3cfc77c74b658963057732dc4d61684df8
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
Sorting is O(NlogN) complexity, while nth_element is linear.
Also remove the errornous +1 when calculating the median position.
Change-Id: Ib39085b59a6c5d15a3a940b1ce3377080340bc09
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Instead of having separate code-paths for QEventLoop::EventLoopExec
and the non-blocking processEvent() we now have a single Q_FOREVER
loop where the logic can be shared. We make multiple loop-passes,
each time calling CFRunLoopRunInMode with potentially different
arguments, depending on the result of the previous run.
For the EventLoopExec case we'll continue making loop-passes until
the event-loop has been interrupted. For the non-EventLoopExec case,
we respect interruption, but will continue making loop-passes only
until we've processed all events in the queue, optionally waiting
for the initial event if WaitForMoreEvents is set. Limitations in
the CoreFoundation APIs unfortunately force us to keep some state
on whether or not we've processed events and timers for a given
processEvents() pass (with corresponding deferred scheduling of
timers and event source signaling).
The way we handle timers has also been rewritten to no longer defer
the timer activation to a special timer source. The constraint of
CoreFoundation timers is that they can not recurse (re-fire) in a
callback, but that only applies per timer, so using multiple CF
timers allows us to recurse. We still only use a single CF timer
for all the Qt timers though, and only spawn a new CF timer if
the user calls processEvents() inside a timer callback.
This commit removes the logic related to dealing with UITrackingMode,
as that logic was slighly problematic, but the feature will be
added back in a follow-up commit, in line with the new approach.
The result of this commit is that we're passing all event-loop,
event-dispatcher, and timer auto-tests, both for the QtCore dispatcher
and the GUI event-dispatcher.
Change-Id: I3c56fbc7857a25110064681257abb47075b5bd2d
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
Apple only provides simulators for 5.0+, and we now rely on 5.0+ APIs.
Change-Id: I9ec047767b5f5e1b33aeef186ec6aff2b9c70a05
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
It's a supported platform from 5.2, and we want build-scripts/CI/etc to
adapt to the change as soon as possible.
Change-Id: I8c78351191f59a6ecab33acc0829d2535379c787
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
Reviewed-by: Simo Fält <simo.falt@digia.com>
Fixes qxcbsystemtraytracker.cpp:125:134:
error: 'connection' was not declared in this scope
Change-Id: If881aa9466ea94d5392da9f177e4b79e044710b7
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Windows will only be exposed and hence rendered when they are not
minimized. This will save useless computations and hence battery.
Change-Id: I83166cc6c3d89e878106c998a35890dd7788ed8a
Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
Demonstrate the new side widgets feature of QLineEdit.
Change-Id: I1c4289c652abf2209e50601871249008fdec4f6b
Reviewed-by: Kevin Ottens <kevin.ottens@kdab.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
In a while loop, when the first QML type encountered was
abstract, qdoc didn't create a class map on the heap, but
later in the loop, the class map was used anyway. This
caused a crash because of a null pointer to the class map.
Now qdoc creates a class map if one hasn't been created
yet, even if the QML type is abstract. This might not be
correct, but the real problem is probably the order in
which qdoc processes the QML types. It should probably
always start with a non-abstract type. But this fix will
at least avoid the crash.
Task-number: QTBUG-33387
Change-Id: Icecb165261469856820f81e3866218b15416ae3b
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
We recommend using pixel sizes for predictable results. For those who
use point sizes in their UIs, we will now give them results that look
similar to what we do on iOS. The default font is changed to give
the same size as before this change.
Task-number: QTBUG-32096
Change-Id: Ia25506ba721a39d31340f3df8bc14129e507af14
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
Reviewed-by: BogDan Vatra <bogdan@kde.org>
IFileDialog::close() only works from callbacks. Try to find
the dialog window and send it a WM_CLOSE in addition.
Change-Id: Id0f89f8781564e19e4763d43a71df55d5299fb35
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Adds a way to set standard CUPS Banner Pages. This widget is part of the
Job Options widget/tab in Properties dialog.
[ChangeLog][QtPrintSupport][QPrintDialog] Added support for setting CUPS
Banner pages in the print dialog.
Change-Id: Ia7a22b7a0f51c12d170986caee61af7109e781e9
Reviewed-by: John Layt <jlayt@kde.org>
Instead of using a define to rename the user's main() function during
compilation, we leave the user code alone, and inject our wrapper one
step earlier in the process, at the application entry point 'start'.
This entry point is provided by crt1.o, which is normally linked into
the application automatically. The start() function sets up some state
and then calls main(), but we change the start() function to instead
call our main wrapper.
Instead of shipping our own crt1 binary/sources, we make a copy of
the appropriate crt1.o at build time, and modify its symbol table in
place. This is unproblematic as long as we keep the same length for
the wrapper function name, as the symbol names are just entries in
the global string table of the object file.
The result is that for the regular Qt use-case the user won't see
any changes to their main function, and we have more control over
the startup sequence. For the hybrid use-case, we no longer rely
on the fragile solution of having our back-up 'main' symbol in
a single translation unit, which would break eg with --load_all,
and we don't need to provide a dummy 'qt_user_main' symbol.
OSX 10.8 and iOS 6.0 introduced a new load command called LC_MAIN,
which places the state setup in the shared dyld, and then just
calls main() directly. Once we bump the minimum deployment target
to iOS 6.0 we can start using this loader instead of LC_UNIXTHREAD,
but for now we force the classic loader using the -no_new_main flag.
There's also a bug in the ld64 linker provided by the current Xcode
toolchains that results in the -e linker flag (to set the entry
point) having no effect, but hopefully this bug has been fixed
(or Apple has switched to the LLVM lld linker) by the time we
bump our deployment target.
Change-Id: Ie0ba869c13ddc5277dc95c539aebaeb60e949dc2
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
When the QIOSApplicationState object owned by the platform integration
was deleted we would deallocate QIOSApplicationStateListener, but would
then get a callback on the main queue later on where we would reference
the now invalid 'this' variable.
By moving the dispatch_async call to QIOSApplicationStateListener and
using 'self' we ensure that the listener is retained for as long as the
block is valid. This opens us up for receiving application state callbacks
after QCoreApplication has been deleted, so we need to guard against
that.
Change-Id: I2ac14d28d72fd79764e12b6657234b54d846cb79
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
Any known smart pointer in a QVariant can be handled in this way. The
metatype system can be informed of new smart pointer types using an
existing macro which is now documented.
This is very similar to the existing infrastructure
for containers.
Change-Id: Iac4f9fabbc5a0626c04e1185d51d720b8b54603d
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
qmake manual needs to be able to link to pages in qtdoc module,
for example, to information about Third Party Libraries.
Change-Id: I6ccaa0c3aecc54bd5d76c6b1573c797423048207
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com>
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
New functions left, right, mid were missing in the api.
Change-Id: I3590a84431555d009d5012b204c111385bdceed3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
which would interpret 'path' as a hostname.
The check is in the public setPath so that the internal one can still
support parsing URLs such as ftp://ftp.example.com//path.
[ChangeLog][Important Behavior Changes][QUrl and QUrlQuery]QUrl now
normalizes the path given in setPath, removing ./ and ../ and duplicate
slashes.
Change-Id: I05ccd8a1d813de45e460384239c059418a8e6a08
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>