A number of QDateTime functions directly use or modify the data stored
in the private, but future changes to store msecs and status make this
maintenance more complicated. Where possible simplify this code to use
the standard msecs functions, standard constructors, or public api
instead. This greatly simplifies the functions and the following msecs
storage code changes.
This is an intermim step towards storing the time in msecs. Some
functions will be slower as a result of this change, optimization
will take place after all the msecs changes are completed.
Note this also removes a test that used valid QDates outside the range
of msecs, this change in behavior will be documented in the final
mscs change.
Change-Id: I6ef710f24babc7024091010064082e9be0b5bbfe
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
WinRT passes the executable and Appx server info to the CRT main, and
supports several additional activation arguments as well. This handles the
arguments passed to main as well as the case where a modern app is
launched from an external application (e.g. Qt Creator).
Task-number: QTBUG-30198
Change-Id: Ia843e98c7843d5705f5f6d1c809de0b6bcdb5d26
Done-with: Kamil Trzcinski
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
Test the Daylight Time transitions. QDateTime does not correctly deal
with many of these scenarios so those tests are marked as QEXPECTFAIL.
These bugs will be progressively addressed in coming commits.
Change-Id: I01eba9d6143a792f081542cb198e221efcf28e98
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
Partial revert of 3c6bb0ed8b and
57aed703d2.
When registering an object that was previously unregistered but not yet
garbage collected, the activeChildren count on the parent node was not
incremented, which could result in other registered objects disappearing
after a later unregisterObject.
Copying objects in the tree is not free, but it's not expensive enough
or used frequently enough to justify that error-prone logic. It's much
safer to simply remove objects immediately.
Change-Id: I3dc59c2ebd07b237518424fcd8ea7371a22d6d15
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The actual warning is:
src/gui/text/qharfbuzzng.cpp:589:67: error: cast from ‘void*’ \
to ‘uint {aka unsigned int}’ loses precision [-fpermissive]
Change-Id: I75cc7bad2147cd5e5e7c17bc22fe613280e86755
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Warnings 654 and 411 appear to have disappeared by ICC 14.
Change-Id: Ic200f239a4a4377015d13b2f4ae85595ce864ace
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
The "base64url" encoding is defined in RFC 4648, which is the newest
version of Base64. There are also a few situations where the ending
'=' is not desired.
Change-Id: I9bb9fa55817b57d125189e4e795d6fde97caea6d
Reviewed-by: Richard J. Moore <rich@kde.org>
The code must have been copied from somewhere, a sample
implementation.
Change-Id: Ieb6ac5d69824fe8a3f38710a22beb79ac986e182
Reviewed-by: Richard J. Moore <rich@kde.org>
- Incomplete: It doesn't talk about how to use a raw QThread, or
QRunnable, or Qt Concurrent.
- Redundant: Its contents are already presented in QThread's class ref,
and the line before this section links to the "Multithreading
Technologies in Qt" overview page which provides a more complete intro
Also remove snippet markers that are no longer used.
Change-Id: I89b7bd72f10c8ffdfd9b7772e2493050aafc9c88
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Multiple issues:
- Incomplete: It doesn't talk about instantiating a raw QThread
- Redundant: Its contents are already presented in QThread's class ref
- Incorrect: It is legal to create a QThread before a QCoreApplication
- Irrelevant: The bit about QCoreApplication::exec() and the etymology
of "GUI thread" is unrelated to the topic of starting threads
Also remove snippets that are no longer used
Change-Id: Ice1819845b5b2cf843719edaa7b0f4bbb1e8bd97
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
It's helpful to see how to choose among different solutions, right
after seeing short descriptions of all the solutions.
- Some minor rewording was done during the move
- The example about polling ports in a new thread was removed because
there are better ways to do that without threads.
Change-Id: I2cb571a4dbf9be93fb0ec88c60fb7406996c345b
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Also bring text closer to the style guide at
http://qt-project.org/wiki/CppDocumentationStyle
Change-Id: I30b1c36ac125a10c002efeb36978ced0d7a8f8bf
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
This patch moves labels indent and contents margins into a
left spacer, and it only puts the iconLabel in the layout
if there is an icon.
Change-Id: I6f3563a08fc15ec6ec267e095adf1734f7828355
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Add new public api to get and set the number of msecs since the start
of the day. Modify QDateTime to use the new msecs api.
[ChangeLog][QtCore][QTime] Added new methods fromMSecsSinceStartOfDay()
to create a new QTime from an msecs value, and msecsSinceStartOfDay()
to return the QTime as the number of msecs since the start of the day.
Change-Id: I285b725b883f1f5524fda87ca81bd64ed99fe6f4
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
The Xcode generator relies on the generic makefile generator for extra
compilers such as qrc and moc, by generating makefiles that are then
executed as separate build steps in the Xcode build.
These makefiles are generated by entering a special mode in the Xcode
generator, in which case we _do_ want to resolve dependencies, so that
e.g. the files referenced inside a qrc file are added as dependencies
to the makefile rule that generates the qrc-cpp file.
Change-Id: I96bdcb165e9774a6328ae1980986fa2c6b00c6d9
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
This avoids dynamic construction of the private class. According to
the benchmark we go from 4,550 to 3,900 instruction reads per iteration.
(without change 32629676 the baseline is 5,600)
Change-Id: I5df925e30dbd49bdde87173e481820574ce5abe1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This reverts commit 59fd36bb914cae248d3c5100dd734d6d90a58dca,
which caused other drawing problems.
Change-Id: I3bb75fd3ca1cd21ffbb9ef5474266f4cd615a64a
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
According to Clang 3.3, this is an extension:
qpalette.h:178:9: error: anonymous types declared in an anonymous union are an extension [-Werror,-Wnested-anon-types]
qsizepolicy.h:148:9: error: anonymous types declared in an anonymous union are an extension [-Werror,-Wnested-anon-types]
If you try to simply give the struct a name, it complains with:
qpalette.h:178:16: error: types cannot be declared in an anonymous union
Change-Id: I61c69b8e42a1f4c4a15a0733f2d7efa0b3e44864
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Ever since 76e0223619, qPopulationCount
was extracted from QBitArray and moved elsewhere. That unfortunately
meant that the 24-bit loads are completely useless, since
qPopulationCount always operates on 32 bits.
Instead, do a full loop on 32-bit and then do 16-bit and finally 8-bit
(for which there are qPopulationCount overloads).
Change-Id: If945609f075095257d12877c39434909ac190e54
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
QWS is gone.
Change-Id: Ic04c4dcfff51522dd538bf2cb198dc2e02fe7572
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
Reviewed-by: Peter Kümmel <syntheticpp@gmx.net>
The QtSensors module defines the coordinate system relative to
QPlatformScreen::nativeOrientation(). However, that is not part
of the public Qt API.
Task-number: QTBUG-32144
Change-Id: I6941c5b8589219064749f18880775b803f23fbbd
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
It handles window movement events, not mouse move events.
Change-Id: Ibc8fd0272756fcf87dfac210addbf2f87cfb39d5
Reviewed-by: aavit <eirik.aavitsland@digia.com>
Make sure we don't modify the lhs. Instead copy it and advance the
copy.
Change-Id: I3440e8e175bfc299f8f83b816faca54fa3f79e43
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Prevent qdoc from reporting duplicate pages for external pages with
the same URL and title.
Task-number: QTBUG-33462
Change-Id: Idabdb241aaa4fe105f7b3ea78229ff1ae8776ecf
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
Our previous event loop integration had two unfortunate flaws:
1. We would call qt_user_main() from a timer, after returning from
didFinishLaunchingWithOptions. This had the effect of showing the
iOS application window long before the Qt application UI had been
set up, resulting in a 1-2 second flash of black/pink between the
launch image disappearing and the actual application showing.
2. We spun a nested event loop, where our implementation of the
different event loop modes did not perfectly match the Apple
implementation. This resulted in scrolling being busted in
some cases such as when showing the virtual keyboard for
Emoji characters.
These two issues have now been solved by calling the user's main()
from didFinishLaunchingWithOptions. Normally this would not work, as
the user's main would call QApplication::exec() at the end of their
main(), which would block and we would never return back from the
didFinishLaunchingWithOptions callback, resulting in no UI on screen.
We work around this by longjmp'ing out of QApplication::exec(), back
into didFinishLaunchingWithOptions, so that it can return. Again,
this would normally not work, as the call stack where QApplication
and friends would live would get smashed as the application
continued executing. We work around this by allocating a block
of stack space at the start of main(), which we then redirect the
stack pointer to before calling the user's main. This results in
the whole stack of the user's main() and below being preserved, even
if we longjmp out of the call stack (which then restores the
stack pointer).
This approach should work fine together with garbage-collection as
well, since the mark-and-sweep phase will walk the stack from the
stack pointer to the stack base, including sections of the stack
that were part of qt_user_main() and live in the reserved area.
One case where GC will fail though is if it happens as part of the
qt_user_main() call, where the GC will not mark anything in the
'real' callstack below UIApplicationMain(), but this is not
expected to happen.
The size of the reserved stack can be controlled through the
Info.plist key 'QtRunLoopIntegrationStackSize', as well as the
'QtRunLoopIntegrationDisableSeparateStack' key to disable the
separate stack approach completely. This will fall back to the
old approach. The amount of stack space used by the user's
main can be determined by enabling a special debugging mode,
using the 'QtRunLoopIntegrationDebugStackUsage' key.
Change-Id: I2af7a6cfe1a006a80fd220ed83d8a66d4c45b523
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
If both n1 and n2 are "Private", the comment says they're equivalent,
but the function is actually stating that n1 < n2 AND n2 < n1.
Change-Id: I8e30b32c1e5240551ab1808baf6fc476841dfde4
Reviewed-by: Martin Smith <martin.smith@digia.com>
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
Make sure enough pixels is sourced by multiplying
the layout rect size with the pixmaps devicePixelRatio.
Task-number: QTBUG-31477
Change-Id: I742603c09a65a520587da3eef9479ef7f0c87022
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
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>