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>
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>
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>
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>
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>
Add an 'info' message type that can be used for messages that are neither
warnings (QtWarningMsg), nor for debugging only (QtDebugMsg). This is
useful mainly for applications that do not have to adhere to the
'do not print anything by default' paradigm that we have for
the Qt libraries itself.
[ChangeLog][QtCore][Logging] QtInfoMsg got added as a new QtMsgType.
Use the new qInfo(), qCInfo() macros to log to it.
Change-Id: I810995d63de46c41a9a99a34d37c0d417fa87a05
Reviewed-by: Jason McDonald <macadder1@gmail.com>
ConfigLocation was erroneously inconsistent, by adding the org name
and app name on Windows (unintentionally) and not on Unix (while having
subdirs in ~/.config is actually common practice for some XDG desktops)
Therefore this adds AppConfigLocation, which always has the org name
and app name (while GenericConfigLocation never does).
[ChangeLog][QtCore][QStandardPaths] Added QStandardPaths::AppConfigLocation,
for application-specific configuration directory. ConfigLocation was inconsistent.
Task-number: QTBUG-38872
Task-number: QTBUG-38845
Change-Id: I80fb98f296436261f3996c9df87571c29b06ab35
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
qHashRange() takes an (input iterator) range and hashes each element, combining
the hash values using the hash combiner from Boost/N1837 with the magic number
0x9e3779b9, as described here:
http://stackoverflow.com/questions/4948780/magic-number-in-boosthash-combine
qHashRangeCommutative() does the same but with a cummutative combiner (unsigned
addition) to create hash values that are order-independent, e.g. for hashed
containers. The obvious combiner, XOR, is a bad one because it eliminates
duplicate elements. Signed addition cannot be used, since signed overflow
leads to undefined behavior.
[ChangeLog][QtCore] Added qHashRange() and qHashRangeCommutative() functions to aid
implementing qHash() overloads for custom types.
Change-Id: I3c2bbc9ce4bd0455262a70e0cf248486525e534f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This patch is a forward-port from 4.8 branch
(d869e1ad4b0007757e97046609de2097cd9e9c5d).
Change-Id: I6ae36a5417d1176fbecf775668f6033b1cb22a94
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
%{threadid} should have been %{qthreadptr} but we forgot to make the
change for Qt 5.4. So do it now.
[ChangeLog][QtCore][Logging framework] %{threadid} now prints the real
thread ID. On Linux, OS X, iOS, FreeBSD and Windows, the value is unique
system-wide. On other systems, it will print something that may be
process-specific (the value of pthread_self(3)). To print the pointer
to QThread::current(), use %{qthreadptr}.
Change-Id: Ie383ff864a11966cf5d095b966a30ace65d34ee6
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
... which is the module-wide include, bringing in the entire QtCore.
Change-Id: I5cd872efa4562917fc4e3850809cb7595710c43a
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
This has been deprecated since QDBusContext was introduced (Qt 4.3). So
it's time to remove the functionality.
[ChangeLog][Important Behavior Change] QDBusConnection::sender()
(deprecated since Qt 4.3) has changed to always return an invalid
QDBusConnection. To know what connection the incoming call was received
from, use QDBusContext.
Change-Id: I355efb82c14e54ed718c8f892d8267e727b19118
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
QFileSystemWatcher does not signal directoryChanged() when files are
modified in a watched directory. QTBUG-8945 was closed with the
decision that it should not signal. Updating the docs and tests to
reflect this fact.
The test code that is being changed is a partial revert of Qt4 commit
1428cc6d71a65c1ac7123c9c4cc3cfaf225cceed. It appears that Symbian
supported directoryChanged() on modification, hence why the check
was for 0 or 1.
Change-Id: I04320c68f227ca338ce65e525956ee201fd50699
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
This is in preparation of adding more qHash()-related tests.
Change-Id: Iae65bf8b123e1d6ac6d1eb34d74ba4eb9df8173c
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Under DBus it is possible to have methods and signals with the same name
or have methods which are reserved c++ keywords.
For example the logind session interface has a signal and method both
called Lock.
This patch allows generated methods to use a different method name
specified in the annotation that the original DBus name in the DBus
interface in a similar manner to how one can rename accessors.
[ChangeLog][QtDBus] Add annotation org.qtproject.QtDBus.MethodName to allow
autogenerating C++ methods with different names to the original DBus method
Change-Id: I08bbe77554fbdd348e93f82d45bab0d75d360c27
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
We already let enter/return key presses to reach text edits instead
of closing the editor. Do the same for tab/backtabs.
[ChangeLog][QtWidgets][Important behavior changes] QItemDelegate will
now not close a QTextEdit/QPlainTextEdit editor when the tab key
is pressed; instead, the key will reach the editor.
Task-number: QTBUG-3305
Change-Id: Ife9e6fdc5678535c596d1068770b0963134d8d5a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Thorbjørn Lindeijer <bjorn@lindeijer.nl>
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
This covers the only real additions over QVector: push and pop. Really, there
isn't too much specific to benchmark here, but we're interested in one specific
case: that of pushing and popping a single item repeatedly.
With the current QVector behavior, this causes constant deallocation, which
makes it morbidly slow. This behavior will be reviewed in a subsequent commit.
Results (not that anyone really cares) for me:
PASS : tst_QStack::qstack_push()
RESULT : tst_QStack::qstack_push():
1.9 msecs per iteration (total: 61, iterations: 32)
PASS : tst_QStack::qstack_pop()
RESULT : tst_QStack::qstack_pop():
8.2 msecs per iteration (total: 66, iterations: 8)
PASS : tst_QStack::qstack_pushpopone()
RESULT : tst_QStack::qstack_pushpopone():
80 msecs per iteration (total: 80, iterations: 1)
Change-Id: I3530888abbfcfcef39318d6be6d5b07306a4704e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The interface macro needs to be in the Qt namespace, otherwise the
template specialization in Q_DECLARE_INTERFACE fails.
Task-number: QTBUG-41959
Change-Id: I818da5ba8460219d73c0d248ee410ac92f7498f4
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@digia.com>
Reviewed-by: Stephen Kelly <steveire@gmail.com>
We want to use "localhost" if the server's address is "any", as some OS
can't send datagrams to "any" (e.g., OS X and FreeBSD).
Change-Id: I1004bc2282e7f930cdb7ed394aa9f4b5a1cfcf82
Reviewed-by: Richard J. Moore <rich@kde.org>
On my Mac Mini, port 5000 is in use, which means the broadcasting test
fails.
Change-Id: Ifb0883263e277f388342430349ea7315d42f324a
Reviewed-by: Richard J. Moore <rich@kde.org>
It was unconditional. Someone forgot to check for IPv6 support before
skipping IPv6 tests.
Change-Id: I7b11528ad02560f0db9defde3c64f76f48a6c1f8
Reviewed-by: Richard J. Moore <rich@kde.org>
Fix indention, add empty line as separator, undef a local macro.
Change-Id: Ie0d8529322f87ca2bdedb9a7f2f4cf9f463a6e12
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Split off default-value check from getSetCheck().
This is in preparation of extracting getSetCheck_data().
Change-Id: I869c34014a92e29a07dc08584a93a4cbba372518
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
QUdpSocket doesn't support binding to QHostAddress::Any and then joining
an IPv4 multicat group since QHostAddress::Any is really an IPv6 socket
with v6only = false. The test did check this case, but failed to ignore
the warning.
Change-Id: I62d782408319a6e566e0ff1a6081b706ac1f669c
Reviewed-by: Richard J. Moore <rich@kde.org>
With IPv6, you cannot bind to a multicast address. You need to bind to a
local address only. The previous tests either checked this or didn't
check the result of bind().
Change-Id: Ief70887d8988fc1bc4394cf6ff34b5d560e5748e
Reviewed-by: Richard J. Moore <rich@kde.org>
[ChangeLog][QtCore][QThreadPool] Added QThreadPool::cancel() which allows
removing from the job queue a job that hasn't been started yet.
Change-Id: Ib8f1c1f32a34f5eec8338c641d820b928e470164
Reviewed-by: Nick Shaforostoff <shafff@ukr.net>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Sending 100*8 packets of each type of message is WAY overkill. That's a
stress test without limiting. My Linux system starts reporting EAGAIN on
the socket, so reduce the amount of data sent.
Change-Id: I153f44cf3b91d37526dac580b400114cc80b1769
Reviewed-by: Richard J. Moore <rich@kde.org>
IPv6 has no such thing, so don't try to bind to an IPv6 address to send
broadcasts (even though that works) and it's a poor idea to bind to IPv6
to receive broadcasts. Moreover, skip any IPv6 network addresses
(broadcast() is invalid).
Change-Id: I2829b042c000158565adfd92db682f37d67dacae
Reviewed-by: Richard J. Moore <rich@kde.org>
If you don't have /etc/lsb-release, you'd get
sh: line 0: [: =: unary operator expected
Change-Id: Idb5c79f799879e4d32cd640ef74fb388227f831e
Reviewed-by: Richard J. Moore <rich@kde.org>
It doesn't make sense because there is no command to ask the proxy
server to join a multicast group. At best, we could write a datagram via
proxy without joining, but we definitely can't receive.
Change-Id: Icc6b54572a053fb7821dfca1f4111f2046ff8686
Reviewed-by: Richard J. Moore <rich@kde.org>
Behavior will agree with the docs.
[ChangeLog][QtGui][QWindow] lastWindowClosed will be emitted even if
quitOnLastWindowClosed is not set
Task-number: QTBUG-32956
Change-Id: I7bb269d53894859fee27e171eea7ad472ea86af0
Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
This is a temporary measure while the Qt CI system is updated to have
the correct D-Bus configuration. Once it is fixed, this commit should be
reverted, so that we don't run into the situation in which the tests
aren't getting run on some configurations and we never know about it.
Change-Id: I7192d4d95a60dcb63acfa6cc90bfdc58592b0664
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
The /home path doesn't exist on Android, so it doesn't work as
a non-writable current dir. Instead we use /data on Android.
Change-Id: Ib779f60822da1bef421a16a00c1030245a8c5b90
Reviewed-by: BogDan Vatra <bogdan@kde.org>
The qtlogging.ini file needs to be detectable by QFINDTESTDATA,
so we put it in a qrc file on Android.
Change-Id: I5fb0217098c56f2b2e99ab8d1642c4a7904b18d1
Reviewed-by: BogDan Vatra <bogdan@kde.org>
This test requires building a console application first, deploying
this as part of the APK and then being able to execute the
bundled file from the main application. Since IPC is a limited
use case on Android, we just skip this test instead.
Change-Id: Ie68e495ff64b69e7027924291a411b5de0e2da76
Reviewed-by: BogDan Vatra <bogdan@kde.org>
Test requires that tst_qiodevice.cpp is available on file system,
but since we're not able to deploy directly to the file system
on Android and since we want to actually test file system access,
we bundle it in qrc and copy it out during initialization.
Change-Id: Ida2b5bf6f1dcd43bc740a2b9380352bab5eb6c62
Reviewed-by: BogDan Vatra <bogdan@kde.org>
Some of the tests expect QDir::homePath() and QDir::currentPath()
to be different, so we just set the current path to something
other than QDir::homePath().
Change-Id: Ib048d323f4745369821765230b995a73b8a97145
Reviewed-by: BogDan Vatra <bogdan@kde.org>
This test may not be possible on Android, since the file system
can be mounted with noatime or relatime which means read access
will not be registered.
Change-Id: I40f587e1a1f131ee06f0e3700e908ccaa19c83ce
Reviewed-by: BogDan Vatra <bogdan@kde.org>
Since there's no way to deploy files directly to the file file
system on Android, we put them in a qrc file and extract them
on startup.
Change-Id: I6a42aa5e0372bfd9fb2f7ccfea964c9c3c2e45d8
Reviewed-by: BogDan Vatra <bogdan@kde.org>
This test requires that the resources are also available
in the file system. Since it's not possible to deploy directly
to the file system using Android, we extract the files on
startup instead.
Change-Id: I1d1fe7d62c4c618a89713e3a7d1903e42bfb10b8
Reviewed-by: BogDan Vatra <bogdan@kde.org>
There's no way to install files automatically into the file
system on Android, so to test QDir on the file system, we have
to bundle the files in qrc and then copy them into the file system
on startup. This adds some complexity, but at least it will detect
regressions.
We also need to make sure the current directory is the same as
the data path, since the test assumes this, and /usr/ does not
exist on Android, so we have to use a different path to find the
root path.
Change-Id: I18d79b5ed99a0afff573beb30c61745c403f8991
Reviewed-by: BogDan Vatra <bogdan@kde.org>
This will arbitrarily fail at certain points. Adjusting the
timeouts helps, but it's very unpredictable, so it's better
to do what we do on Windows and just expect-fail the results
that we get.
Change-Id: Ie6033c73539c2dd69115b06096919e173f097367
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: BogDan Vatra <bogdan@kde.org>
Add all test data to resources.
Change-Id: Id42a4c033b75409f65cb4d56ebf1161336b93832
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
We must add all test data to resources.
Change-Id: Ic12f8fce9afb965aff32e7141516c8d223e64491
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>