QJsonValue, while comparing two QJsonArrays, should consult also length
of the arrays, because a different than null base pointer doesn't mean
that an array is not empty.
Change-Id: If76739355a4e74b842e836289565f98d95c006d5
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
QJsonValue, while comparing two QJsonObjects, should consult also length
of the objects, because a different than null base pointer doesn't mean
that an object is not empty.
Change-Id: Ibee1849ef9fed15d32f2c8f2aad9b053846e46b7
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Before this change such code:
QJsonObject o;
o["blah"];
would create property "blah" and assign null value to it, while
this code:
const QJsonObject o;
o["blah"];
would not. The change unifies the confusing behavior. Now reading
a non-existing property, is not causing a property to be added
in any visible way.
Internally QJsonObject stores a special hash of undefined, but
referenced values. Such reference is supposed to not live long,
only to the first compacting or assignment.
Change-Id: Ib022acf74ff49bad88d45d65d7093c4281d468f1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
The operator should always return an undefined values for an empty
object
Change-Id: Ic38f7660d77c64b2d001967bc5109df4185db74a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
It is a minor reduction, in release build it is ~200 bytes
Change-Id: I4f7972c95769f2e0ca1ddc935ff7a0a6b4379e2a
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
There is no need for a custom algorithm as we can use
std::count
Change-Id: Id1ab514c7cd8f52efe49b27712121415d7ca4455
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Fix tests widgets leaking widgets and ensure it stays
that way by adding a check to cleanup().
Task-number: QTBUG-38858
Change-Id: I77a81d823c68cf0b4e51c2da55b1c473d6e4170b
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
Although it may seem strange that such a method is const,
optimizing doesn't affect the user-visible part of the object.
Moreover, *not* having it const makes it asymmetrical with other
methods (such as match()) which are const, and under certain
conditions optimize as well.
Change-Id: I0cd8d4a6909d00629fcc65c1c3a1f011f31db782
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Blocking DBus calls have the potential to totally wreck user interactivity at
best (actions taking too long) and make things appear completely broken at worst
(the default timeout is 30 seconds, which is a huge amount of time, especially
if you get unfortunate and have a repeated blocking call).
Provide a warning when a call is found that takes too long, based on some preset
durations (200ms for the main thread, 500ms for other threads on the basis that
the main thread is generally more important).
Also provide configuration knobs for these environment variables, in miliseconds:
setting them to 0 will warn on all blocking DBus calls. Setting them to -1 (the
default, on release builds) will disable the warning.
[ChangeLog][QtDBus] Blocking calls that take a long time will now generate a
warning. The time taken may be tuned using the environment variables
Q_DBUS_BLOCKING_CALL_MAIN_THREAD_WARNING_MS and
Q_DBUS_BLOCKING_CALL_OTHER_THREAD_WARNING_MS. The value represents (in
milliseconds) how long before a blocking call is warned on. A value below zero
disables the warning, a value of zero will warn on all blocking calls.
Change-Id: I0ab4c34aa01670a154d794d9f2694b3235e789db
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
[ChangeLog][QtWidgets][QLineEdit] The signal textEdited() is now
emitted when the user clicks the clear button created by
setClearButtonEnabled() as well.
Task-number: QTBUG-40287
Change-Id: Iacd303ffd1533f27cfa68a6120cdd370e3d31ddc
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
The old unix locking code is no longer working on unix since it locks on
a file descriptor, but QSaveFile creates a new file, and as a result we
get the lock on the wrong file. Also there is no need to keep the lock
held only for reading as QSaveFile is atomic. It just needs to be held
when doing a read before writing.
As a result, since we don't hold the same lock, there could be a race
with an application running an older version of Qt if they are writing
on the same configuration file.
[ChangeLog][QtCore][QSettings] Fixed data loss while writing the config
to the disk fails.
[ChangeLog][Important behavior changes] The locking mechanism inside
QSettings has changed and is no longer compatible with the one of
previous versions of Qt. There might be corruption if two applications
running different versions of Qt are writing to the same config file
at the same time. You must also now have write permissions in the
directory containing the settings file in order to write settings
Task-number: QTBUG-21739
Change-Id: I0844a5e96c8bc1e1222a3dac6cc48170ca77fe1b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This file is already listed in QTOBJS.
Change-Id: I5c77620dc5e441435bd31a87a08178e0c82e9c05
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
QRingBuffer is a fully inlined class used in many I/O classes.
So, it must be as fast and small as possible. To this end, a lot of
unnecessary special cases were replaced by generic structures.
Change-Id: Ic189ced3b200924da158ce511d69d324337d01b6
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
This reverts the extractTextAppearanceInformations() changes done in
f7ac2b4 and introduces another method extractTextAppearance() for
extracting a specific TextAppearance.
The problem was that extractTextAppearanceInformations() was overriding
the TextAppearance attributes with TextView attributes. This resulted
in wrong text colors for Switch & CalendarView:
- Switch_switchTextAppearance
- CalendarView_dateTextAppearance
- CalendarView_weekDayTextAppearance
Change-Id: Ib300b6eb14649319b2f07012803a4d031a717b50
Reviewed-by: BogDan Vatra <bogdan@kde.org>
Not just filesSelected+fileSelected (which only happens for local files).
Change-Id: Ife592c3c921231356f96cbc2871b6d724a15d2c8
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Use the placeholder top level geometry to determine the
screen.
Task-number: QTBUG-40155
Change-Id: If56b239200e9daf754b0963574367cf7891c5f40
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
This also coincidentally fixes logging of prepared queries, which previously
weren't logged.
Change-Id: I41b3559080662284699ac3dfa4fa4236342c61d2
Done-by: John Brooks <john.brooks@jollamobile.com>
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
The default in QTextStream is to use the C locale, so default
QTextStream are not affected. When you set a QLocale on it, the default
was to use group separators (which is the QLocale default too). This
commit makes QTextStream respect a QLocale in which the
OmitGroupSeparators option had been set.
Task-number: QTBUG-39956
Change-Id: I00fbe12fca7f0287c7217deb487ded6582a03b52
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Instead of playing clever tricks with the index variable, simply
scan through the list of argument-carrying signals and, if nothing
fits there, fall explicitly back to accepted().
Change-Id: I1be49ce601edb854cc1bab5be994b2c09fe31b3c
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Otherwise, when interrupting the test half-way (e.g. in gdb),
the user's ~/.config/QtProject.conf would be modified.
Change-Id: Id582c4a3fbf0acbed460126fccf0d39b3a09758a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
This allows to use the "test mode" of QStandardPaths in unittests,
to stay away from the user's real settings.
Change-Id: I1cb1f63a4bff35dfe236924c4dcd7cf761ee50c1
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Due to C++'s rule of Argument-Dependent Lookup, a call to an unqualified
qHash(t) will look up qHash in T's namespace. So edit the docs saying
that it must be "global qHash" to say that it should be in the type's
namespace.
Task-number: QTBUG-34912
Change-Id: I7a72800008ccb710b4bb814e42db7a95f385f53e
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
They shouldn't exist in the first place. They exist in two cases only:
1) mistake by the user in the QLibrary or QPluginLoader constructors or
setFileName
2) as a kludge for setLoadHints before a file name is set (we need to
store the user's requested hints somewhere)
This is important for the second case, as otherwise all QLibrary and
QPluginLoader objects without a file name would share the setting.
Task-number: QTBUG-39642
Change-Id: Iebff0252fd4d95a1d54caf338d4e2fff4de3b189
Reviewed-by: David Faure <david.faure@kdab.com>
This commit makes replaces the loadHints member with a setter, a getter
and an atomic variable. The setter will not set anything if the library
has already been loaded.
Task-number: QTBUG-39642
Change-Id: Ibb7692f16d80211b52aaf4dc88db1a989738a24d
Reviewed-by: David Faure <david.faure@kdab.com>
These roles seem wide-spread enough that it makes sense to add them.
QtWebEngine will use them.
Change-Id: I9c2d6ab23ada0607078bcd407a72ecae9f87eeea
Reviewed-by: Andras Becsi <andras.becsi@digia.com>
The previous code assumed that all events would have an object sent
along with them. QtWebEngine breaks this assumption and the rest of the
code is ready for the change, but using QTestAccesssible was not
possible due to this.
Change-Id: Idee21caf3076fbffd02d5e728f0c9cabf8712408
Reviewed-by: Andras Becsi <andras.becsi@digia.com>
The badly named ObjectReorder actually stands for any of this object's
children may have changed. This event is used in webengine and should
trigger the ATs to drop their caches (eg when loading a new website).
Change-Id: I44080f8d43c1161285d9ace4891fe18531f16e09
Reviewed-by: Andras Becsi <andras.becsi@digia.com>
This patch adds the feature use_gold_linker to use the gold linker that
has been part of of GNU binutils since 2008. Gold links C++ libraries
much faster and use less memory.
The feature is autodetected when building Qt on Linux, but can be disabled
in configure. On MingW builds it is default off but can be enabled for
cross builds.
Change-Id: Icdd6ba2e706b2c791bcf44b6e718c2b7a5eb2218
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Allow to alter the default configuration for categories by passing a
message type: All message types with lower severity are disabled in this
category.
This is useful for libraries, which shouldn't mess with the category
registry itself: Setting rules, a category filter ... might cause
conflicts and ordering problems, so this API should be reserved to the
specific application.
For the Qt categories, we have code in the default category filter that
disables the 'debug' category. However, this is hardcoded, and there's no
way so far for other libraries to get the same behavior. With this patch
one can get the same behavior:
Q_LOGGING_CATEGORY(DRIVER_USB_EVENTS, "driver.usb.events", QtWarningMsg);
[ChangeLog][QtCore][Logging] Added QtMsgType argument to QLoggingCategory
constructor and Q_LOGGING_CATEGORY macro that controls the default
category configuration.
Change-Id: Ib2902f755f9f7285d79888ec30e8f3cef95ae628
Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
We don't have a way to rename main() inside a LLVM bit-code file yet, so we
error out if we detect that LTO is enabled (which causes object files to be
written as LLVM bit-code), and inform the user about a workaround.
Task-number: QTBUG-40184
Change-Id: I89c927a3a7f075c65e54442c4f7e6bb25175b6f7
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
Depending on *.o in the Xcode output dir did not actually result in a
proper dependency. In Xcode5 this didn't matter much, as the effect was
that the build phase was run every time, but in Xcode6 the phase was
skipped. We now depend on the object directory itself, which will get
its modification time updated to match any rebuilt object files.
Change-Id: I8fa6f06c9008c4ce8f7fde7706057ce101bb5727
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
~QDebug() removes any trailing space if autoInsertSpaces() is true.
However, if one uses QDebugStateSaver the global autoInsertSpaces might
be false, but a space was added by a custom operator<<.
Explicitly check for this in QDebugStateSaverPrivate::restoreState. Remove
any trailing space if the local state asks for adding trailing spaces, but
the original one doesn't. Add a trailing space if the local state doesn't
ask for one, but the global state does.
Change-Id: I243b5c76d5ed2c1ec4820da35ab6e254da1551d9
Reviewed-by: David Faure <david.faure@kdab.com>
Instead of having the application delegate set up a UIWindow and root
view-controller, we move the responsibility to QScreen, since in a multi
screen scenario we will need one UIWindow per screen, as well as one
root viewcontroller per window.
Change-Id: If5b0d44b8f8a697d830b33b4fe420bff56a7629b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
Useful when using shared directories.
Task-number: QTBUG-39967
Change-Id: I2c082e33133b00306378b6ff58478e94119e6a0e
Reviewed-by: David Faure <david.faure@kdab.com>
Make sure that the stream's formatting settings are preserved.
Change-Id: Ib13b5e0b36b2ef801da2d2d5c240d28dc1b04653
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
-QML basic type page layout is now separate from the other
doc page layouts, but the section offset was incorrect.
-the offset is the same as the QML type pages.
Change-Id: I422e97eebe58a87c11607f2c8c5aedb10abbda7e
Task-number: QTBUG-40335
Reviewed-by: Martin Smith <martin.smith@digia.com>
-QDoc in 5.4 processed QML basic types as separate pages
but the ToC wasn't added.
Change-Id: I5a887158bacef923e765accac7ee5ca7c2c7a12b
Task-number: QTBUG-40335
Reviewed-by: Martin Smith <martin.smith@digia.com>
GCC currently requires fat object files for static libraries, since the
linker would otherwise not load the .o file from the archive at all and
the linking would fail with a lot of undefined references. Clang on
Linux also needs this, but it has no equivalent flag, so enabling LTCG
for Clang on static libraries will result in linker error.
This commit does not add support for enabling it in configure. It can be
enabled on a per-project basis by doing CONFIG += ltcg or by passing
-config ltcg to qmake's command-line.
Change-Id: I52cf99f1ed9f1701e23a3b457ba3502fd28126ce
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Since version 3.2, clang warns about unused member variables
(-Wunused-private-field). Marking such members with
Q_DECL_UNUSED_MEMBER will silence this warning.
This is a cleaner way than using Q_UNUSED() somewhere in the class
methods (like we did previously in qloggingcategory.cpp). It
mirrors Q_DECL_UNUSED for unused variables, which however can't be
used unconditionally for member variables because e.g. gcc will
complain.
Change-Id: I2afff683a7c3bae3bdcd684e5085a643887bb2a0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: hjk <hjk121@nokiamail.com>
Replace QString::fromUtf8 with QString::fromLatin1 for ascii strings.
Also optimize use of QT_VERSION_STR.
Change-Id: I13c683499c56cb4ac4d2bbd9b6b53c337917e347
Reviewed-by: hjk <hjk121@nokiamail.com>