This reverts commit 618e2cc081. The
original commit has a section of code that I failed to review properly
and is of questionable functionality.
Change-Id: I61c53d7b8b2aa7c3312292b017a18aba7da11bc5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This is needed as of commit v5.6.0-beta1~483 (Add an automatic use of
the ELF-versioned QtCore symbol, 2015-10-20). Even if a translation
unit only contains
#include <QtCore/QString>
int main(int,char**)
{
return 0;
}
it must link to QtCore which provides the qt_version_tag symbol.
Change-Id: I827c0a7403320e7e5b384d8608face20fcecdaea
Reviewed-by: Stephen Kelly <ske@ableton.com>
The extra length has been used for a sentinel null value.
By checking the index before indexing into the array, that
extra element can be dropped.
Change-Id: I0b309420d8d89f75e2381a8065c8e68a1a33427c
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Off-by-one error: we should have calculated whether the current year is
leap, not the next year. This affected any 53-week leap years.
Task-number: QTBUG-50273
Change-Id: I134ce5db2f82468585ffffff14264cb9f12998fd
Reviewed-by: Martin Klapetek <mklapetek@kde.org>
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
... instead of using erase in a loop, with quadratic complexity.
Change-Id: Ia5201e0bedca7abec6d485505f61f3f76a028bd1
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
We forgot to setQuery() after the query was modified.
Task-number: QTBUG-49963
Change-Id: I11f559ef75544c50b3f8ffff1420148ba3092200
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: David Faure <david.faure@kdab.com>
Fix the signature of QWindowsShcoreDLL::GetProcessDpiAwareness and output the
value in the warning about failures of SetProcessDpiAwareness and in debug
output. Failures occur when Qt is embedded into another application, for
example Active Qt servers.
Task-number: QTBUG-41186
Task-number: QTBUG-50206
Change-Id: I3fd6cba26826ee8bbfa0a34f129deb64797c947f
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
It is equal to m_geometry since c173a50719
(Remove QT_DEVICE_PIXEL_RATIO support from xcb).
Also remove the declaration for QXcbWindow::screenForNativeGeometry(),
which was forgotten to be removed in that commit.
Change-Id: I8ec425a3bc111ec579e2e25c4fda8a02f1c8d09c
Reviewed-by: Błażej Szczygieł <spaz16@wp.pl>
Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
We depend on being able to punch holes in the backing store when
integrating with FBO elements. To do that we need a format with an alpha
channel. This was only working previously because RGB32 didn't mask when
filling or when converting to ARGB32_PM, but other formats didn't.
Also unifies the logic for getting alpha versions of QImage formats.
Task-number: QTBUG-50281
Change-Id: Ied1325f60e2b67d9ea2dfa9701b06fc2231ebfca
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
qtAddToolEnv() (via qtPrepareTool()) does not write the tool wrapper
scripts during build passes, while qt_docs.prf (which calls it for qdoc
and qhelpgenerator) was loaded only during build passes. the consequence
was that the makefiles tried calling non-existent scripts.
amends 5418d77a1, sort of.
Change-Id: I64ab573495ca339be4c7b5e8c6848b298b6cb605
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
The wrapper batch files were called wrapper.bat for both, flex and
bison. Resolve this conflict by providing proper tool names.
Change-Id: I7987f94976abc29302c9f6a696faa5c7d1fb030d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
now that we don't create .pc files for private modules any more, the
conditionals cannot be nested.
amends 6c5d227da, partially reverting aa20e7f9d.
Task-number: QTBUG-49763
Change-Id: I2578c83e0c767b6533abdb26bf4e8bcc8c416ef1
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
judging by the history, this was only ever a workaround for poor rpath
handling. we're supposed to be over that.
Change-Id: I85601493a05a76ead999e707a2d2e9a430610981
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
std::stack, based on std::vector, tends to be more efficient that
QStack, based on QVector, but, crucially, it is an actual stack,
so doesn't allow, say, iteration or insertion in the middle, which
QStack does allow.
Since a lot of places where QStack is used use at least some of
those non-stack features, protect this instance which doesn't, yet,
from becoming another such site.
Since the use of std::stack with the default std::deque increases
text size by almost 1K, and a vector makes a perfectly good stack,
use std::vector as the backing container (which std::stack, being
a container adapter, allows easily).
Saves ~0.5KiB in text size on optimized GCC 5.3 Linux AMD64 builds.
Change-Id: I51c8fb1dc4e9907ae00ed1cee8f320304321b322
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
This is a false positive because the only offset that can be outside the
bounds was the last one (-1), which could not be reached in this line
because of the qBound on the line before limiting the maximum value.
The -1 wasn't generated by the Perl script embedded in the file anyway.
qdbuserror.cpp:142:64: error: offset outside bounds of constant string [-Werror]
Change-Id: I24a735698d3c4a719fc9ffff1425f8aad5e5978e
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
proper prefix builds don't have the redundant .dlls in bin (the copy
step is simply omitted), so this is broken. the change would have to be
done atomically with making DLLDESTDIR sane.
This reverts commit 9b2e98245a.
Task-number: QTBUG-50065
Change-Id: I9ce0a2d1147a1a2d4bd2f22e619d5c737864a637
Reviewed-by: Romain Pokrzywka <romain.pokrzywka@gmail.com>
Reviewed-by: Tim Blechmann <tim@klingt.org>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
this is just an optimization/clarification: variables which are known to
be never empty (like PATH) can be extended with less convoluted code.
Change-Id: Ib365bbec8301673ed1c874979b4de19bc983dab1
Reviewed-by: Romain Pokrzywka <romain.pokrzywka@gmail.com>
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
the primary purpose is making env var prepend mode work for unset
variables on windows. this is achieved by using a conditional and delayed
variable expansion. however, the latter is disabled by default and can
be locally enabled only in batch files. therefore, write wrapper scripts
and substitute them for the actual commands. we do this also on unix,
both for consistency and simply because the commands look much less
confusing.
this change is slightly backwards-incompatible, as invoking
qtAddToolEnv() multiple times on the same command will now make a total
mess. also, invoking it on a command that contains 'make' macro
expansions isn't a good idea, so testcase.prf needed an adjustment. the
function is an undocumented internal, so Nobody Should Care (TM).
this also reverts 80ebedecf9, as it's obsolete now.
Change-Id: I8394b77868b495abcf27b688996ca74c40b80994
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Don't try to run test_interface when Qt is configured without QtWidgets.
Change-Id: If6c376c250215c1d639b06881d16c0141091f288
Reviewed-by: Stephen Kelly <ske@ableton.com>
Render-to-texture widgets that are native children may have a non-zero
offset telling the position within the top-level widget. The size is
usually different (smaller) than the tlw's size as well.
An unfortunate optimization attempt led to ignoring the size for native
children with offset (0, 0). This resulted in interesting rendering
artifacts whenever such widgets were placed in the top-left corner of
the toplevel. This is now corrected.
Task-number: QTBUG-48130
Change-Id: If449610c3f3333cb73ae149efaefd7ef42953951
Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
Setting a screen to a child window causes a warning message. This patch
prevents the debug message by catching incorrect behavior made by QPA
earlier.
Change-Id: Idf3ac02290a18afc134f19c2b91348dc009ca4ca
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
Find the top level window on the primary virtual desktop first to avoid
obtaining a window which doesn't belong to the primary virtual desktop
when screen geometry is similar.
Change-Id: I78fdfa0b5146d0ba9b912338adeb612c102c4ac3
Reviewed-by: Adam Majer <adamm@zombino.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
Qt3D is making heavy use of this, causing the QList node allocations
to be among the top 10 per frame allocation sources. Switching to
QVector fixes that.
Change-Id: I3b4df329710f82bf8d6797ea1f0c79b288a08063
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
The reply serial is displayed for method call returns and errors,
while the serial is displayed for all message types.
To see a message serial it is required to dump messages after
sending, not before.
Task-number: QTBUG-44490
Change-Id: I859f50d739ed059d5b2dfe1a2efdf04b906891a7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This patch includes setup of class member 'msg' in
QDBusMessagePrivate::toDBusMessage() to be able to get the
serial after message sending.
Testcases for comparing the 'reply serial to' with the 'serial'
are included.
Task-number: QTBUG-44490
Change-Id: Iae7c48f5b0c70a6c5ae500904072b38b46dfd876
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Change the QWindowsInputContext::composition if it is called
with lParam has flags GCS_RESULTSTR and GCS_DELTASTART,
it doesn't call endContextComposition.
Task-number: QTBUG-49955
Change-Id: I49de3f239bf8a77414e433b255db08f227141158
Reviewed-by: Tasuku Suzuki <stasuku@gmail.com>
Reviewed-by: Takumi ASAKI <takumi.asaki@gmail.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Andy Shaw <andy.shaw@theqtcompany.com>
Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
(cherry picked from qtbase/786984e7e47a63094ad64ec86a4892cc5c0ad6d4)
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
On Android, back button will send a CloseEvent to the focused window.
This change will activate (focus) the Popup windows when they'll become
visible.
Task-number: QTBUG-46419
Change-Id: I6787435b24502bbf9a78662a0c6fd159d4ee2e8d
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
Implicitly add the minimum required `-std=...` to Qt5 module targets.
Use the newly introduced INTERFACE_COMPILE_FEATURES property for this,
which is available starting from CMake version 3.1.
This also fixes the Qt5 CMake tests, which previously try-compiled projects
using Qt 5.7 headers in non-C++11 mode, thus failed.
Change-Id: I54fc0e07403b646b5d6ac3ab6b8b47119b4feef6
Reviewed-by: Stephen Kelly <steveire@gmail.com>
On X11, QXcbVirtualDesktop represents an X11 screen while QScreen
represents an X11 output. In the case that there are multiple screens
(possibly with multiple outputs), calculate the screen number correctly:
Find the screen index on the primary virtual desktop first to avoid
obtaining a screen index which doesn't belong to the primary virtual
desktop when screen geometry is similar.
Change-Id: I4cbb29b7aa7cd2125759ffbbbe3db4e934feaeae
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
Find the root widget only when more than one virtual desktop exists
and find the screen index using virtual siblings from this root
widget.
Use intersecting rects instead of middle point to obtain the screen.
This can help to get the screen index when the middle point is outside
the screen geometry, but part of the window is still on the screen.
If the widget is completely outside the screen geometry, -1 is
returned.
This commit amends: a6b2a4642f
Change-Id: I80247fc1956a82c487ee6f728d1576bf48b28748
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
This is a partial revert of eaa3a9d010
Task-number: QTBUG-50081
Change-Id: Ic3dc4daa90d7a968a4ebf45d3029c99a12985686
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
Use QSharedPointer::create(), to fuse control block and
payload into a single memory allocation.
Change-Id: I8d87c73566c3be960e957ec0b5419a77da2fc8c9
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
GCC 5.3's undefined-behavior sanitizer checks that the
declared type of the object is a base class of the
dynamic type of the object on each access to a member
of a class type.
It therefore requires the typeinfo for these types,
which for polymorphic types is emitted in the TU where
the vtable is emitted, too.
QFileDialogPrivate is a polymorphic non-exported class,
so this failed at link-time. Ditto for the other cases.
Fix by autotest-exporting the classs.
Also, where applicable, de-inline the dtors, so the
vtable (and typeinfo) are pinned to one TU, and the
ctor, just because it's the correct thing to do.
Change-Id: I2b7dba776282a2809c80eb2bc36440d7d698f926
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Remove a superfluous loop and thus the usage of QIncrementalSleepTimer
from QProcess::waitForFinished. We just wait for the process handle.
There's no need for a loop that checks multiple wait conditions.
This enables us to remove QWindowsPipeWriter from the Windows CE port in
a subsequent commit.
Change-Id: If6a82405227cf145263dba3726bae959e6871d0e
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
...even if reserve() hasn't been called before.
[ChangeLog][QtCore][QString] resize() will no longer shrink the
capacity. That means resize(0) now reliably preserves capacity().
Change-Id: If499a20990bbf3a20553da14e50a42918d310c9f
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Added check for traiCollection selector.
Task-number: QTBUG-50159
Change-Id: Ie3efafe9e22e59aef862a681ad733f2bb0a5ba49
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
Instead of converting a QVector to a QList to a QSet just to
be able to look up some indexes, take the original QVector,
sort it, and use std::binary_search().
Change-Id: If56e9371972b9aaebb033a8a499be306163266e2
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
There's no variant with bool first argument.
Change-Id: Ib18b50ed6271d21253d075dc72b6e2b8744cf131
Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
The function is not available on Windows XP.
Task-number: QTBUG-50188
Change-Id: I4ded1a4eb37af84979c3ce1a9af0d95da60b56ac
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
This code seems to be hit three times per frame in a hybrid QQ2/Qt3D app,
quickly generating thousands of allocations here via the detach in begin().
Heaptrack confirms they are all gone now.
Change-Id: I7d09f3f5c2b24a2590b701216715055751306e82
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>