Path normalization should happen only when NormalizePathSegments is set.
Use a less intrusive fix for the setPath("//path") issue that
commit aba336c2b4 was about.
This allows fromLocalFile("/tmp/.") to keep the "/." at the end,
which is useful for appending to the path later on (e.g. to get "/tmp/.hidden")
Change-Id: Ibc3d4d3276c1d3aaee1774e21e24d01af38fa880
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
If the environment variable is set, but points to a non-existing directory,
the user would get a warning about chmod failing. Better be clear and
warn about the fact that the directory itself doesn't exist.
Also warn if $XDG_RUNTIME_DIR points to a file rather than a directory.
Task-number: QTBUG-48771
Change-Id: If84e72d768528ea4b80260afbbc18709b7b738a8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
In Qt3 this would indeed be equivalent to QHostAddress("0.0.0.0").
But since Qt4, it creates an address of type Null, and
QHostAddress()==QHostAddress("0.0.0.0") is no longer true.
Change-Id: I28025421e77c861783c612c2225be345dad5615a
Reviewed-by: Martin Smith <martin.smith@theqtcompany.com>
Iterate over the original list instead.
Change-Id: I7be154c0e19074033df6f6e01f68d21a8904d2ee
Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name>
QTouchEvent::touchPoints() returns a const-&, but the old
code took a copy, over which it then iterated, modifying
the touch points, causing (necessary) detaches of both the
list and the touch points.
Befriend QTouchEvent and modify the list in-place, avoiding
all detaches in the likely case that QTouchPoint contains the
only copy of the touch point list.
This is all the more important as the function is called once
for every item-under-mouse in sendTouchBeginEvent().
Port to C++11 range-for as a drive-by.
Change-Id: I2f74d19845711d97e3566886123b5d18d55db74c
Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name>
Helps pinning the vtable to a single TU, which can
prevent false negative RTTI (incl. dynamic_cast and
catch()).
But mostly because it's rather pointless to have dtors
of polymophic function inline. Most of the time, the
code will be called through the vtable indirection,
anyway (which also means that an out-of-line copy of
the code needs to exist in any case). The inline
method will only be used when the compiler can prove
the dynamic type of an object.
Saves ~1.5KiB in text size on optimized GCC 4.9 Linux
AMD64 builds.
Change-Id: Ic4ce96da559252c8abc29d880530c84035db2306
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
It should the the actual class name, without any suffix.
This also allows us to use the painter font when rendering
CE_HeaderLabel and, as a consequence, change QHeaderView's
font through the usual methods.
Change-Id: I0b13ee349f5fa505be66a9c884c26885f5fc468f
Task-number: QTBUG-33855
Task-number: QTBUG-37153
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
while we evaluate the features themselves in precise mode (which is the
reason why they can error out), we do not want them to terminate
cumulative project evaluation.
Change-Id: I70f3e1bcb2ca04a70c74ff484749ca92c1cf6372
Reviewed-by: hjk <hjk121@nokiamail.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
(cherry picked from qttools/90ee4094161b427c32581bca2f5286edb4fffdb1)
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
After 90e7cc172a, QStringList no longer
includes QDataStream.
This also reverts commit c1be0fbe7d, which
did the same in a worse way.
Change-Id: Ib10622b0da3b3450d29fc65dc5356fde75444a8f
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
(cherry picked from qttools/376501ae5a86859821c0e89b2e8fbc9906d11e07)
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Recent versions of Qt have apparently added sufficient numbers of
headers that the command lines used to spawn a custom header-
parsing tool, started overflowing Windows' maximum command-line
length.
This change restructures the mechanism to use a GCC-style command-
line arguments file rather than passing filenames all directly
in the argv[] vector.
Although QNX is the usual ELF target whose cross-build is supported
on Windows, the mechanics introduced in this patch happen to affect
all other ELF Unix systems' builds too.
Change-Id: I5a7383cf9f2ebf9dffde8dbfdcdeca888265e085
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Currently the moc rule does not support dependency scanning, so after
successful moc file generation it will ignore implicit dependencies
in the header file.
Although this works in most typical scenarios, at least in one case
incremental builds become broken: when using Q_PLUGIN_METADATA() with
the FILE argument.
If FILE refers to a JSON file and latter was updated, then the expected
behavior is to regenerate the moc file. Since CMake add_custom_command()
does not support late dependency setup, all dependencies should be
explicitly listed in a DEPENDS section.
This patch adds the DEPENDS multiarg option to qt5_wrap_cpp(),
allowing to specify additional dependencies to the moc rule.
Task-number: QTBUG-44009
Change-Id: I2052ce23d3cb0c87c6bd99fcb7e8a71a7be9a330
Reviewed-by: Kevin Funk <kevin.funk@kdab.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Daniel Levin <dendy.ua@gmail.com>
This is more future-proof. It fixes the detection of 32-bit on ARMv8-A
processors since it uses the __ARM_ARCH macro that GCC and Clang
define. For MSVC, we use _M_ARM, which also contains the architecture
version. MSVC does not currently support ARMv8 code, but when it does,
this commit should make the support automatic.
I don't know which compiler defines __TARGET_ARM_ARCH, but support it
too.
Change-Id: I8de47ed6c7be4847b99bffff141c8ede54a849eb
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
When QT_VISIBILITY_AVAILABLE is defined, the zlib header would use
visibility("default") instead of Q_DECL_EXPORT, but Windows needs
dllexport for these symbols to be available to QtGui/QtNetwork.
In practice, Q_CORE_EXPORT always has the correct behavior for the
zlib symbols.
Change-Id: I7ab8080528e437260f822ac33e9e4334e2a0fdc8
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
The QMap<QByteArray, QString> was only used to hold key/value pairs
until they were serialized into a QString at the end of the function.
Serialize into QString directly instead, dropping the temporary QMap.
The problem is that we'd like to keep the line formatting central
while at the same time harnessing the power of QStringBuilder.
This is possible with a templated function with an input/output
parameter:
format_attr(QString &result, const char *key, T &&value)
format_attr(result, text-foo, str + str2 + str3);
Or with return type deduction:
formatted(const char *key, T &&value) -> decltype((expr)) { return expr; }
result += formatted(text-foo, str + str2 + str3);
I don't like out parameters, and we can't rely on auto return
type deduction, yet, so I opted for a miniature expression
template solution that can only match the expression
attr[key] = value;
where 'key' is a const char* and 'value' can be anything that
QStringBuilder supports. This allows to keep the syntax of a map
while at the same time serializing to QString immediately.
The only behavioral difference to the old code is that the
attributes are no longer sorted, but order doesn't matter.
Saves more than 10KiB in text size on optimized GCC 4.9 Linux
AMD64 builds.
Change-Id: I7b3bec0466ef24156c693adaa95f0316007e0bfe
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
This is private implementation, so there's no BC issue here.
The collections ported here also do not benefit from CoW,
because they are never copied.
Adapt to STL API and replace foreach with C++11 range-for
loops, because the former deep-copies STL containers.
Also replace index-based for loops with C++11 range-for,
to evade the int/size_t problem on MSVC.
Saves a bit more than 1KiB in text size on optimized GCC 4.9
Linux AMD64 builds, not all of which can be attributed to the
ports to range-for.
Change-Id: I240030180bd1b2ca40c002b03ab72319a99a87c3
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Factor out the dispatching of IO results into a separate function.
Do not increment the semaphore count in waitForAnyNotified just to
decrement it again in _q_notified.
Change-Id: I7d4a04b679bb152ab3a5025513f885aee276d086
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
The test was improved by:
- Use QCOMPARE instead of QVERIFY
- Use QTRY_ macro instead arbitrary qWait
- Use longer time line
The test executes faster and it should be less vulnerable to
an unreliable timer.
Change-Id: I92675015a6251b47eaf20b0fc916f3a36b52d783
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
The test run faster and it less vulnerable to an inaccurate time.
Change-Id: I19475095395dcf1e6d47fdbba5eeffabab1fc7b9
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Now the test is less fragile to time and it executes 4s faster
Change-Id: Id3eb8ed2c03317e7d2f2c3cd17f889a8d8e7e5b4
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
The test still can fail because 1s is quite a short time.
Change-Id: I6f42c182f2932d5a053f6a69667210529c9a7697
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Drive-by changes:
- use auto for iterators
- add Q_UNLIKELY for conditions leading to a qWarning etc
Change-Id: Iff8f36d67c96674d354a501b26640f73c15ce58d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Sérgio Martins <iamsergio@gmail.com>
This is the signature the functions have in C++11. For the std
containers, this is just convenience, but for Qt containers
with their implicit sharing problem, the combination of erase()
with constFind() can delay a detach until absolutely necessary.
[ChangeLog][QtCore][QHash/QSet] Added erase(const_iterator).
Change-Id: I2fc841c664cd7515b0f56fd7210fcd17c37f9014
Reviewed-by: David Faure <david.faure@kdab.com>
Clang's integrated assembler does not accept this assembler syntax, so
tell it to only run the preprocessor, and pipe everything through the
system assembler.
Change-Id: I6bd884473e634837b47480546a1d1d8d62e7a2b6
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
By making the destructor (usually the first non-inline, non-pure,
virtual function, and therefore the trigger for most compilers to
emit the vtable and type_info structures for the class in that TU)
out-of-line, vtables and, more importantly, type_info structures for
the class are pinned to a single TU. This prevents false negative
dynamic_cast and catch evaluation.
Since QGraphicsItemPrivate is already exported, users of this class
are unaffected by the change, and since it's private API, we don't
need to avoid adding code to the out-of-line destructor until Qt 6.
Also saves ~2.5KiB in text size on optimized GCC 4.9 Linux AMD64
builds.
Task-number: QTBUG-45582
Change-Id: Ibb404a43d5464e8e280ccebd5f95719852f5a986
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
It's a virtual function call, followed by another out-of-line
function, so the compiler cannot hoist the expression out of
the loop itself.
But we can, so do it.
Change-Id: Icffa6fa9a667d566b0829a18fea7128625e85920
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Vibrates the device or plays an alert sound on devices
that do not support vibration.
The other implementations of beep() have been moved to
QPlatformIntegration as a proper API instead of having
them as invokables in QPlatformNativeInterface.
Change-Id: Ic597dbef04b46d49862b070e78ddfc0d763829a2
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Reviewed-by: Kai Uwe Broulik <kde@privat.broulik.de>
Use the new reverse_iterator support in QList to
avoid building a QList with prepend()ing, using
append() instead.
Change-Id: Ia1f6d0ecc08a824f11d93a6fd4077b11b1b0f786
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Use the new reverse_iterator support in QList to
avoid building a QList with prepend()ing, using
append() instead.
Change-Id: I6b9d9b1a9941cf2e6cc39ad2d9097fdc629c24bc
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
There's no point in checking isEmpty() to prevent a for loop from
executing, esp. if the checking involves copying the container
and calling an out-of-line function to get said copy.
Just fall through the for loop.
Change-Id: If6c689ff4bcd685bc645b4fb3f2c15ce5d5945af
Reviewed-by: Sérgio Martins <iamsergio@gmail.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
- Do not save geometry when going from maximized->fullscreen
- Use SW_SHOWNA instead SW_SHOWNOACTIVATE as otherwise the
maximized geometry is restored.
- Add a test for Windows.
Task-number: QTBUG-49709
Change-Id: Ic81e7398ee90d499a50b02192a45cb09276a2105
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
When keys are pressed and the application becomes inactive before
they are released, the stored state becomes inconsistent.
Task-number: QTBUG-49930
Change-Id: Ide86b1d9052df060f30f7c02b81a4f2ae15d28e7
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>