After the commit 7ff655360f, case 4 in SoftExitProcess class relates
to a channelReadyRead() signal instead of stateChanged(). Accordingly,
terminateSlot() is fixed to handle a special case when process is not
running.
Change-Id: Ie0d3284f5d264037d00e4ad6d927c0766be562b0
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
In VcprojGenerator::collectDependencies(), a temporary QLinkedList
is created, then iterated over. There's no reason to use a node-
based container here: no references are taken, no erases happen,
esp. not in the middle...
Port to QVector instead and reserve it, since the maximum size is
known ahead of time, and the lifetime of the container is very
short.
Since the loop iterating over the linked list needed touching
anyway, port directly to C++11 range-for.
Change-Id: Ic5dfeebcd9da37c214f54abc6025a0a2b8fa3b5d
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Extract a base class QWindowsBaseWindow from QWindowsWindow that provides
_sys() getters for geometry and margin calculation and implements
QPlatformWindow::geometry()/ frameMargins() to be calculated from the
HWND.
Implement a QWindowsDesktopWindow class directly inheriting
QWindowsBaseWindow which does not allow any manipulation.
Add a thin QWindowsForeignWindow class that wraps a foreign window id and
always returns correct geometry/margin information when queried. Simple
reparenting and manipulation of geometry for child windows is also implemented,
allowing for embedding foreign windows into Qt. When calling other setters on
it, the unimplemented warnings of QPlatformWindow will trigger.
Remove the special casing for foreign/desktop window from QWindowsWindow.
The existing mechanism to cache the geometry/margin values in QWindowsWindow
remains as is.
Rename the existing QWindowsWindow::baseWindowOf() and add checks there.
Task-number: QTBUG-50206
Task-number: QTBUG-41186
Change-Id: Ib57cb87e3981312d32920fe3e49f0b1c4ad516a3
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
On OS X ioctl(... FIONREAD) on UDP socket returns more than expected:
"SO_NREAD returns the amount of data in the input buffer that is available to be received
For datagram oriented sockets, SO_NREAD returns the size of the first packet -- this dif-
fers from the ioctl() command FIONREAD that returns the total amount of data available."
(man getsockopt). On OS X bytesAvailable for UDP socket seems to include some headers also:
for a datagram of size 1 - bytesAvailable == 17, 2 - bytesAvailable == 18 etc.
Found in a broken tst_qudpsocket test.
Change-Id: I88be827c66208835ed10b010f13d9dc70576fea4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This reverts commit cd9625fc3c.
The ambiguity in division, with negative operands, goes away in C++11
(where division is defined to truncate, hence round towards zero), so
we no longer need to be robust against it in 5.7. Added suitable
commentary to make clear that we are relying on that.
Change-Id: Id2c0d421bad4bcec87de9cc9519cd00df2456930
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Which is basically same as the Jetson K1 Pro, with SDK and compiler
options adjusted.
Change-Id: Ic0aa8144aad12e832ae440212f6a06f52668415d
Reviewed-by: Louai Al-Khanji <louai.al-khanji@theqtcompany.com>
As a result, this patch eliminates double-buffering in QProcess.
Change-Id: I436faa4a5ffc28ce77f959dd6089bef400ac39f6
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Also, bump the TypeInformationVersion field in qtHookData, to notify
the Qt Creator developers that the offset of QFilePrivate::fileName
was changed and dumpers should be adapted.
Change-Id: I71bc5f509b733c0ab3430cd47ff08961f0388839
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
... instead of using erase in a loop, with quadratic complexity.
Change-Id: I91053ddb58639615e8864e5be20861e7cceb815e
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
... of QLists. The returned list was only ever exactly of
size one or two, and two only if a local QList in the
getGraphParts() function was not empty.
Instead of using a QList to return those QLists, use a
small struct of two QLists. This way, we avoid copying,
memory allocations, and the code becomes a lot clearer,
because we can give the members of the struct meaningful
names, instead of at(0) and at(1).
As a consequence, at the call site, the loop over the
result can now be collapsed into an if.
Saves ~1200b in text size on optimized GCC 5.3 Linux
AMD64 builds.
Change-Id: I5c2a3b3be0edcc418b310551abca51c410aca7c8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Instead of move-assigning a new QIcon to the default-
constructed members, initialize them directly in the
ctor-init-list. Do this for the other data member, too,
for consistency.
Also use QStringLiteral instead of QLatin1String as
the argument to the QIcon ctor. This is correct, since
the string will never be modified, and saves two memory
allocations.
Change-Id: I9398bbe9d0fd63db9b6cf856dd240ab334364518
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
This is mostly straight-forward, but some things are worth noting:
1. Yes, this is necessary. The noexcept operator looks for noexcept tagging,
not at the contents of the function to determine whether to return true.
The more conditionally-noexcept functions are used, the more important it
becomes that low-level classes are correctly marked noexcept. In that, it
is like constexpr.
2. In accordance with the rules governing noexcept specifications for the
standard library itself, the get*() functions, as well as any function
taking (but not returning) channel values as ints or qreals, or taking
QStrings are not marked as noexcept, since they have preconditions and
thus a narrow contract. Narrow-contract functions should not be noexcept.
All other functions have wide contracts (ie. no preconditions).
3. Any function returning QString can throw (bad_alloc).
Consequently, they, too, are not marked nothrow.
Change-Id: I023356ba1b9a4b057e613cd45380a89b222dc09d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Thanks to gunnar.roth@gmx.net for updating the WinCE patch.
Change-Id: I131e0ee9141efdbd377e096aae0959311a601830
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
(or trivially marked const) ... by replacing them
with C++11 range-for loops.
Change-Id: I1522e220a57ecb1c5ee0d4281233b3c3931a2ff8
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
... by replacing them with C++11 range-for loops.
To avoid detaches of these mutable Qt containers,
wrap the container in qAsConst().
Change-Id: If086bea06fe26232a7bb99fad8b09fce4dc74c27
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
... by replacing them with C++11 range-for loops.
This is the simplest of the patch series: Q_FOREACH took a
copy, so we do, too. Except we don't, since we're just
catching the return value that comes out of the function
(RVO). We can't feed the rvalues into range-for, because
they are non-const and would thus detach.
Change-Id: I5834620bf82f3442da7b2838363d351a0fb960a0
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
... by replacing them with C++11 range-for loops.
The functions QMakeProject::values(), QMakeMetaInfo::values()
and QHashIterator::value() all return by const-reference,
so they can be passed to range-for without further changes.
Change-Id: Ic3b39ed8ff8cd7a6f287f1aa9d61a1acd67d7aaa
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
... iterate over the container itself instead. Avoids
temporary QList creation as well as the lookup cost
when actually calling value(key).
Change-Id: Icac867c30e63863cfa44a382eedd4d6df2070a59
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
When we want to use qtTrId function instead QApplication::translate in
generated files it's not possible to use custom function with presented by
the --tr argument due to signature difference between qtTrId and
QApplication::translate function.
With this argument present, uic will generate qtTrId function with second
argument empty. When used together with --tr parameter it will use
presented function instead.
Change-Id: I0d986e4ea25ce58917fd9a2866b1eac0a4671502
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@theqtcompany.com>
Port a QString::fromLatin1() to QStringLiteral.
The string is never modified.
Wrap char in QLatin1Char to construct a QChar with 8-bit character.
Change-Id: I579ca9eae0c2a72ea893254f258b001063e9f64e
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
... instead of using erase in a loop, with quadratic complexity.
Change-Id: I9527923dcfc3201776a59de53dd5c03ca4d80063
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
By default, the read chunk size is QIODEVICE_BUFFERSIZE and the write
chunk size is 0 (which means that we don't use the internal write buffer).
Derived classes may override these values to define the size of
QIODevice's write buffer or to optimize the read buffer use.
Bump the TypeInformationVersion field in qtHookData, to notify the
Qt Creator developers that the offset of QFilePrivate::fileName was
changed and dumpers should be adapted.
Change-Id: Ib732bc94be8da8a5514a6e5dcc04445895f130d8
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Some sequential devices allow data to be partitioned into several
channels that have the property of independently sequenced delivery.
Supporting such devices uniformly requires a unified API which provides
the user with a uniform concept of multistreaming.
This patch is based on QProcess's multiplexing model and introduces
the following features:
- ability to get the number of channels;
- multiple internal read/write buffers;
- channel selection functions;
- notification signals on channel activity.
To keep the source code compatible with single-channel implementations,
introduce a private class that references the current read buffer and
hides multistreaming internals from the user.
Bump the TypeInformationVersion field in qtHookData, to notify the
Qt Creator developers that the offset of QFilePrivate::fileName was
changed and dumpers should be adapted.
[ChangeLog][QtCore] Added multistreaming to QIODevice.
Change-Id: Idcaa6a618927c101c4c7284d2a633913be6a6ee2
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
This allows us to support file descriptors >= FD_SETSIZE.
Change-Id: I7e4a35333446a587cfd13c077fa5e19fa3d1abc4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Instead of building a QMap with dummy values, just to sort the
elements of the QSet, build a QList, and sort that.
Also use QStringList::join() instead of rolling our own loop.
Change-Id: Iebb7faac8e4b72d6f71b3ab3feba7865b1a102f3
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
This fixes the rendering of translucent borders on CSS-styled widgets to
prevent visible overlapping at the corners. This is done by using a
miter joint (45 degree angle) if either of the adjacent edges are
translucent. Previously, adjacent edges would be drawn at full length
and overlap at the corners if both edges are BorderStyle_Solid and have
identical QBrush objects. This works if both QBrush objects are opaque
but causes visible overlap if one or both of them are translucent.
Change-Id: I99d46c8634cb314e642c635439ed2f7819fcba6a
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Qt 5.7 no longer contains lib/fonts. This is a regression for users
relying on Qt's own fonts when running on Embedded Linux systems without
fontconfig. To alleviate the pain, show a friendly message about this.
The old "is Qt installed correctly" note is out-of-date anyhow now.
Change-Id: Idcb732fb65ed9c45529a0bcc3168227e0969bea0
Reviewed-by: Louai Al-Khanji <louai.al-khanji@theqtcompany.com>
Instead, allocate a temporary buffer on the stack. This prevents the
internal read buffer from being allocated if the device is opened only
for writing.
Change-Id: Ib91c58299206e92006589807527e7b71a5555c8f
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
Remove several test from black-list - they do not seem to fail anymore.
Change-Id: Idb7d6925a4fdea9b47d963e33a455af0afb7b432
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
... by replacing them with C++11 range-for loops.
Change-Id: I0561174d9981ee2171c23644b5e7aebeb8c25665
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
... by replacing them with C++11 ramge-for loops.
Change-Id: I95a91ac36c2b2bef17bf12cf7f1676653a2d807d
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
... by replacing them with C++11 range-for, or, for loops
over .values(), with explicit iterator loops over the result
of equal_range().
Some fixes here and there to get to mark containers const for
iteration, without having to resort to qAsConst(). Didn't work
everywhere.
Change-Id: Ibc0e71d3b208d118f06e16741af47261ef4b9e15
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
For QList<QLinkedList<T>::iterator>, mark the iterator Q_PRIMITIVE_TYPE.
This should be done in Qt itself, but would be binary incompatible.
For two other types that are used as values in QMultiMap, replaced
foreach (x, map.values(y))
with
auto range = map.equal_range(y);
for (auto it = range.first; it != ramge.second; ++it)
x = *it;
which doesn't require a temporary QList.
Change-Id: I9ddd15dd9b1d5bb3000833d14ed911451a272328
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
... replacing them with C++11 range-for loops.
Change-Id: I0233bcf874cdadcd7461e11b89f752dabde086c0
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
... replacing them with C++11 range-for loops.
Change-Id: I13825a444dee30b56b08f3ad8a7a0e15bf324678
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
... and QStringBuilder.
Found while fixing Q_FOREACH/foreach use in src/tools,
thus contains port to range-for as a drive-by.
Change-Id: I221bb8cb1f0fc3edeabfdb37d5d5a17551ee8d36
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
... by replacing them with C++11 range-for, or, for loops
over .keys() or .uniqueKeys(), with explicit iterator loops.
Saves 2300b in text size on optimized GCC 5.3 Linux AMD64 builds.
Change-Id: I6e1d4f5e56895dfd74aba21a3d4e913b5825645c
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
The old code searched for any Qt containers by looking at
- each class definition
- each property's type
- each function (signal, slot, method)
- each argument type
and matching each against "Container<", building
the pattern string each time through the loop.
It would then collect hits in a QSet to be converted
to a QList and sorted at the very end.
The new code pulls the iteration over the candidates
out of all other loops. By doing so, it can stop
looking at classes, properties, functions etc when
it finds the first hit, and it inserts every candidate
at most once.
By iterating over the statically-known list of
candidates, the result is not a sorted set of Qt
containers, as before, but it still has s fixed order
across runs, which was the purpose of the sorting in
the original code.
In the implementation, make liberal use of C++11
range-for, which is safe, as we're passing everything
around as const.
Change-Id: If76dd3f57aa1b544a9cf1de2dca94ca7999220f0
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
... and suggest to use C++11 range-for instead.
Change-Id: If4d4dec1a0cbbc2307ee7d2635f0a8fc3a1ec353
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>