... in QCOMPAREs.
The implementation is hidden in a nested Internal namespace that retrieves
the strings without strdup()ing. That makes it easier to compose these
functions as there is no need to delete character arrays when using them.
The public interface (which qstrdup()s) is implemented on top of these.
[ChangeLog][QtTest] QCOMPARE now pretty-prints QSizePolicy{,::Policy,::ControlType{,s}}.
Change-Id: Ib03d969847e5a12474c71a7921366b400025f680
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This is the error:
src/corelib/kernel/qvariant_p.h: In constructor ‘QVariantPrivateSharedEx<T>::QVariantPrivateSharedEx() [with T = QSizePolicy]’:
src/corelib/kernel/qvariant_p.h:107:61: internal compiler error: in gimplify_init_ctor_eval, at gimplify.c:3560
There are two things fishy in this file:
1. Use of the unnamed namespace in a file that gets included
in different libraries. While not technically undefined
behavior, it may become so when used in the implementation,
which it is.
2. Missing explicit initialization of a member of
QVariantPrivateSharedEx. This is just a wild guess, because
the ICE happens in that line. That class itself is quite
smelly, because the address of an object is taken before
the lifetime of the object begins. A fix would be to store
the object in a wrapper class from which QVPSEx inherits
_first_, but then a cast from QVPSEx to QVariant::PrivateShared
would require pointer adjustments, and I didn't look through
all the code to determine whether that would be an issue.
Having been bitten by this sometime ago:
https://marcmutz.wordpress.com/private-practice/private-practice-taming-templates/#edit-20111128
I opted to do these easy changes first to see whether they
already fix the ICE.
Change-Id: Ic15fd928b3dff2318c425c915b2dab5e54254d71
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
[ChangeLog][QtCore][QTimeZone] Added methods systemTimeZone() and utc()
that return QTimeZone objects for the system time zone and for UTC,
respectively.
Change-Id: Ic5d393bfd36e48a193fcffff13b96821bb8514b9
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
O_CLOEXEC was introduced with the 2008 revision of POSIX.1 and it's the
only way of doing child processes safely with fork(2) in multithreaded
applications.
But we need to support pre-2008 systems, so we can't use that constant.
So let's just choose two arbitrary values for both of our constants --
we need to change both because we need to be sure that FFD_CLOEXEC won't
be the same as FFD_NONBLOCK.
Linux will probably implement them to the O_ constants, like epoll,
signalfd and inotify have done.
Change-Id: I20a5aa6e6264e7a219e19759eeb8747e01df05ff
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
This was introduced in 3b844c16e0
and doesn't seem to be right.
Change-Id: I1c6a9445996650566d44f223651dd0c855619a88
Fixes: Coverity CID 21589
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This reduces a bit of string duplication by relying on the constants
defined in qglobal.cpp and detection via uname(2), in addition to adding
the Linux distribution name as a selector.
Change-Id: I64a46a0fc552c399db787125b1b32aae5c50056f
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
Now that it's a plugin, the restrictions for the compiled-in hooks
do not apply. Make it maintainable and prepare for future development
by splitting up properly.
The actual functions are not touched at all in this patch.
Change-Id: I4c666817afe15b31a63c1f9fc01413e9a2376a3b
Reviewed-by: Louai Al-Khanji <louai.al-khanji@theqtcompany.com>
We have to set a default arrow cursor on startup because non-widget
apps will not request one. This is how we behave with non-kms backends
too.
Change-Id: I11b7bf96e46f570bc49f3e8701616b13c480fda6
Reviewed-by: Louai Al-Khanji <louai.al-khanji@theqtcompany.com>
Add the missing definition for IFF_RUNNING like
documented on http://ports.haiku-files.org/wiki/CommonProblems
Change-Id: Iea3fa224dc8e7e1e36674026efbb28289d2efa2a
Reviewed-by: Augustin Cavalier <waddlesplash@gmail.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
The step logic in scrollByDelta() made scrollbar position to go
temporarily outside its min/max boundaries, and then setValue()
corrected it immediately back within its bounds. The false change
notifications caused by this position vs. value ping pong caused
plenty of unnecessary updates.
Task-number: QTBUG-30316
Change-Id: I32dd5bdb7b0c578dfc5dfa1deecceb19bb98a2b3
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
When changing models it makes no sense to keep the old root model index,
pointing into a possibly deleted model. Reset it to the root
of the new model is the best line of action.
[ChangeLog][QtWidgets][QComboBox] QComboBox will now reset its root
model index when a new model is set on it.
Task-number: QTBUG-43350
Change-Id: I113d558ce19fcaed31f13abfbedc7a24302e28d7
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
In replacement for Q_ENUMS and Q_FLAGS.
Q_ENUM(Foo) has to be put after the declaration of Foo in an object.
It will tell moc to include the enum in the meta object (just like
Q_ENUMS) and will allow templated code to get the metaobject for
that enum.
Will be used by QDebug and QMetaType
Change-Id: Iefaf8ae07dc0359828102bf384809346629b3e23
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
This is analogous to 0a92295ca8
which added QMouseEvent::source.
For now, we say that a wheel event is synthetic when it comes from
a trackpad or other device that provides scrolling by some means
other than an actual wheel.
Change-Id: I0452ca2080b551b18b9c2f6e42db925d14ae339e
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
If the user has some objects selected and holds down the "extend selection"
key (Control on Windows, Command on Mac OS X), clicking and dragging a
rubber band selection deselects the current selection. This is
counter-intuitive and confusing for users.
This commit fixes the behavior so users can extend selections using the
rubber band when the proper key is held down.
Task-number: QTBUG-6523
Change-Id: Ieda4aaa50adb351c0405f5cb8aae23332eec58a9
Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name>
The call was invalid from C99 perspective.
Change-Id: Ie07310735736eddf5eb0e142297e56164fde7fe4
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
Disable compiler warning 4996 about the use of C++ standard
library functions like std::copy:
'std::copy': Function call with parameters that may be unsafe -
this call relies on the caller to check that the passed values are
correct. To disable this warning, use -D_SCL_SECURE_NO_WARNINGS. See
documentation on how to use Visual C++ 'Checked Iterators'
Commit 0a76b6bc already silenced the warning in the
general MSVC mkspecs, the flags set there are however overwritten
for ANGLE.
Change-Id: I8f9a84d19171057715a8f9be1e8338e02a6c5ba0
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
This avoids having to define operator< for types where operator== is
required but operator< doesn't make any sense (e.g. QGeoCoordinate).
Change-Id: I81f6a9d8fc0009a4514c974b5e02b446c50d1e31
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Commit 96995db4af implements the necessary bits for this to work
under QNX.
Change-Id: Ie9e2f421f4f27fcaf40697dd363e9ed047754f0d
Reviewed-by: Tobias Koenig <tobias.koenig@kdab.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
In ancient times, the existence of QMAKE_RUN_CXX_IMP determined the
use of implicit rules. The code path for implicit rules was turned
off in 2006 (0287fe3c), which probably was a refactoring artifact.
Later, implicit rules were enabled again using a different approach.
These days, the non-existence of QMAKE_RUN_CXX determines the use of
implicit rules.
We remove the dead code path now and rely on the latter condition.
One part of the dead code is a feature that turns off inference rules if
the OBJECTS_DIR is set or source file names do not match expectations.
If somebody ever missed this, it has been reimplemented otherwise.
Or not.
Change-Id: If3ce9904d9c1df6e4048c58c2452854cce7fa206
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Naming for different logo sizes on WinRT has been varying in the
past and evolved from using small/medium/large to some being
explicit (71x71).
Add new values introduced by 8.1 (310x150, 310x310,...) and clean up
mixed usage. Detailed pixel versions overrule general specification
and latter ones stay mostly for compatibility reasons. Still the
preferred way is to use explicit pixel values.
Task-number: QTBUG-43644
Change-Id: I9173ec2951a82e5eac9d8c9956bfb0bb4d1a2459
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
Contrarily to Q_OBJECTs, Q_GADGETs are not guaranteed to
descend from a Q_GADGET. Here, we ensure that if the first
superclass is a Q_GADGET, then the derived class will be
treated as one. This allows gaps in the Q_GADGET hierarchy
while preventing from trying to link to the inexistent
staticMetaObject if there's no such ancestor.
Change-Id: If10fb952e23655102a425bb18fe8babaf447a47f
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
qdoc's link command (\l) allows an optional first argument enclosed in
square brackets. This argument is used for narrowing and focusing the
search for the link target. The argument should not be evaluated until
the generate phase, but it was being evaluated in the prepare
phase. This was also a problem when running qdoc in the single-exec
mode. This update prevents qdoc from evaluating the argument until it
is used in the generate phase.
Change-Id: I82785e97077053fb5f5c11f0592155675334aaeb
Task-number: QTBUG-42880
Reviewed-by: Martin Smith <martin.smith@digia.com>
Add marshalling for icon pixmaps to be used in DBus tray icon support
according to the specification
http://www.freedesktop.org/wiki/Specifications/StatusNotifierItem/Icons/
Task-number: QTBUG-31762
Change-Id: I16e66c272eef413a7c94345c273e5fd3a8c0f771
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Albert Astals Cid <albert.astals@canonical.com>
Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
These macros existed for working around an RVCT compiler bug, but since
we stopped trying to work around it, the macros are no longer necessary.
Change-Id: I76cc88d863b41f74f60cd9975dcc1959778c2740
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
By using the special "ar" and "ranlib" tools, the symbol table is made
visible, so we don't need fat LTO binaries. Since we need to store the
new tool names, we may as well clean up ltcg.prf with variable names for
the fat mode too.
Change-Id: I7e53af0c74a3d069313f38500b72538af1d61128
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Instead of trying to load in ltcg.prf and cache the value.
Change-Id: If485ff68fc6ff9d9cf7009cd72d5e702d0199c7f
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
QLatin1String are actually Unicode, so print them with \uXXXX sequences.
QByteArray are binary (arbitrary), so print as hex. Since hex escape
sequences in C are not limited in length (\x00000F is a valid hex
sequence), we need to insert "" if the next character is a valid hex
digit.
[ChangeLog][QtCore][QDebug] Similarly, printing of QByteArrays whenever
"noquote" is not active now prints the arrays in a format consumable in
C++, with all non-printable characters printed in hex escape sequences.
Change-Id: Ibd0c1a97cbac98610c65c1091bfbcf5581c835db
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
[ChangeLog][QtCore][QDebug] Printing of QStrings and QStringRefs
whenever "noquote" is not active now prints the strings in a format that
can be copied back to C++ code. All characters that aren't printable in
US-ASCII are escaped (this includes printable Unicode characters outside
of US-ASCII). Pretty-printing will not respect QTextFormat padding or
field widths.
Change-Id: I169a8a0508e24693f5652f0129defe7f709e5d08
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This just reindents and makes it easier to read what's going on.
Change-Id: Id0afcdfb8f468b4553bba8c5a572a1d0115b0886
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Also make the fragment shader a bit simpler
Change-Id: Ie50940da0a4f896504c9f5962cdb6c455983302f
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Android does not decorate a floating QDockWidget, leaving the user with
no option to close or move such a widget. This changes activates Qt's
own drawing of window decorations for this case (similar to Win CE).
[ChangeLog][Android][QtWidgets] Enable QDockWidget window decorations.
Change-Id: Id46a994a8be9b8f3e7b530af118315cd36b5fb0e
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
This shotgun-surgery approach is motivated by trying to get a
clean(er) build for -Wnoexcept on GCC, so it is expected that
for any class touched here, there will be more operations that
can be marked nothrow. But they don't show up in conditional
noexcept clauses, yet, so they are deferred to some later
commit.
Change-Id: I0eb10d75a26c361fb22cf785399e83b434bdf233
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>