Commit Graph

26835 Commits

Author SHA1 Message Date
Thiago Macieira
b94aa943f5 Disable DirectFB automatic detection and mark it deprecated
[ChangeLog][Important Behavior Changes] Support for DirectFB is no
longer enabled by default, due to lack of development in upstream. To
re-enable the platform plugin, pass the -directfb option to configure. If
there is no interest in this platform, the support will be deprecated in
Qt 5.7 and will be removed in Qt 5.8.

See: http://lists.qt-project.org/pipermail/development/2016-March/025273.html
Change-Id: Icaa7fb2a490246bda156ffff143c62515a5f575b
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-04-28 02:45:46 +00:00
Sérgio Martins
9e52234da1 Fix clang developer build due to -Winconsistent-missing-override
The existing code keeps the overrides from each base class together,
so also move them to the correct group after adding Q_DECL_OVERRIDE.

Change-Id: I5d89fb4e7f9454ab0c9c6383f8245e64b95e84e9
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-04-28 02:45:42 +00:00
Thiago Macieira
3430552881 Use C++11 alignas() for Q_DECL_ALIGN, if possible
Change-Id: Ifea6e497f11a461db432ffff144863d4ed69a212
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2016-04-28 02:45:40 +00:00
Thiago Macieira
ef7b0df419 Fix QArrayData::allocate() to guard against integer overflows
The proper solution with qCalculateBlockSize will come for Qt 5.7.

Change-Id: Ifea6e497f11a461db432ffff14490788fc522eb7
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-04-28 02:45:37 +00:00
Oswald Buddenhagen
f1958dbbea make use of COPIES
Change-Id: I34965cada901fce3cf300a99fa65d4d3f9bd4578
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2016-04-27 21:08:47 +00:00
Oswald Buddenhagen
a060d25ef2 add support for copying arbitrary files
this adds file_copies.prf, which understands the variable COPIES, which
works analogously to INSTALLS.

i've been holding this off for a long time, as it is not without
caveats. however, similar hacks are proliferating all over the code
base, so it's time we formalized it.

in fact, it's the easiest way to fix some nasty shadow build problems,
which is why i'm adding this on the stable branch.

Task-number: QTBUG-52256
Change-Id: Icbe3b9fbb79c952546aad2d467a438d3a69d749f
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2016-04-27 21:08:40 +00:00
Allan Sandfeld Jensen
ab06266e15 Fix clipping of wave underline decoration on certain fonts
Limit the height of the the wave-pixmap so that fillRect doesn't clip
it.

At the same time the precision of the generated wave-pixmap is improved
so it better fits the requested radius.

Task-number: QTCREATORBUG-15851
Change-Id: If754387b20ab7b015857ecb0a0e8fe16de1d728a
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2016-04-27 20:20:32 +00:00
Konstantin Ritt
4c6324b5a7 Micro optimization to QFontconfigDatabase
Do not set WritingSystem supported just to unset it afterwards;
test in-place and fallback gracefully.

Change-Id: I6910019c08fcf3909b924c27271547aae2ea0ff1
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2016-04-27 20:20:21 +00:00
Konstantin Ritt
db2764db34 Get rid of requiresOpenType() helper
There is already an array of writing systems for which
GSUB|GPOS table is required
(also rename it from "openType" to "capabilityForWritingSystem",
to reflect its meaning).

Change-Id: I7cfd4a80d5ca13f9312b3644b2bd738d6015c71c
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2016-04-27 20:20:18 +00:00
Konstantin Ritt
75bd795c9f Query FC_CAPABILITY once per pattern
Change-Id: I5f1219d5a476f1bd09e8c01847fe886f342b28a0
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2016-04-27 20:20:14 +00:00
Konstantin Ritt
6493bcaf3c Check for required capability only when FC_CAPABILITY is available
If, by some reason, querying FC_CAPABILITY has failed,
believe FC_LANG unconditionally.

Change-Id: Idf94150359dff555f2a50ccaf146722407f43477
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2016-04-27 20:20:10 +00:00
Lars Knoll
fa93c7c7b0 Fix a small logic error in qmake bootstrap compiler flags
There was a small logic error in the code selecting the debug/release
C(XX)_FLAGS used when compiling qmake, that could lead to us not
specifying any flags at all.

Change-Id: I5d3c44367d535a17570e3602029b84a02706d624
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-04-27 20:12:46 +00:00
Palo Kisa
5795c86e8b QFileDialog: Fix single-click activation
In QFileDialogPrivate::_q_enterDirectory() the QStyle::styleHint() for
QStyle::SH_ItemView_ActivateItemOnSingleClick was called w/o the
widget. By such usage the possible StyleSheet setting was ignored, e.g.
"QAbstractItemView { activate-on-singleclick: 1; }".

Task-number: QTBUG-50871
Change-Id: I7a32c4841db7113f32c3823581c2becc1677e3cc
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2016-04-27 07:15:39 +00:00
Gabriel de Dietrich
6844f60dae QCocoaMenu: Have the menu delegate return the right amount of items
In some cases we move menu items around, therefore we should
not rely on QCocoaMenu::items() being the actual items inside
the menu. But, since the NSMenu is updated before hand, we can
rely on NSMenu.numberOfItems instead.

Change-Id: Icd4497beca4f52a6d38408eeaa2e6ec71b579685
Task-number: QTBUG-52931
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2016-04-27 06:07:59 +00:00
Liang Qi
2e9fc0d3f0 testlib: added env QTEST_FUNCTION_TIMEOUT for single test function timeout
This is a regression with 5.5, it causes some customer test functions
crash. d3d10cf2 introduced the 5 minutes timeout. The timeout could be
changed after this.

Task-number: QTBUG-52402
Change-Id: I8940bbde5004b4d888732b551274f079ddf20563
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2016-04-27 06:07:16 +00:00
Marc Mutz
7565b4ec95 QSslSocket: remove unused variable in q_X509Callback()
It's been unused ever since it was added in
bba86a01c9.

Change-Id: I6d5bc27a0744d37f873245c92a4e6ba8fc90c062
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-04-26 16:48:10 +00:00
Marc Mutz
a1e3a0daed QString: Fix UBs (signed overflow) in hashed string search
Similar change to 390ea21873, but more
extensive because the hash variables were not, yet, of unsigned type.

This brings the three hashed string search algorithms in QtBase (in
QString, QByteArray and QByteArrayMatcher) in line again.

Found by UBSan, fixing the following bunch of errors:

  tools/qstring.cpp:3080:38: runtime error: left shift of negative value -1291179264
  tools/qstring.cpp:3081:42: runtime error: left shift of negative value -1291179264
  tools/qstring.cpp:3091:13: runtime error: left shift of 73 by 26 places cannot be represented in type 'int'
  tools/qstring.cpp:3091:13: runtime error: left shift of negative value -1255957171
  tools/qstring.cpp:3091:13: runtime error: signed integer overflow: 1783052986 - -1207959552 cannot be represented in type 'int'
  tools/qstring.cpp:3097:37: runtime error: left shift of negative value -1298753576
  tools/qstring.cpp:3098:41: runtime error: left shift of negative value -1298753576
  tools/qstring.cpp:3107:13: runtime error: left shift of negative value -1508912760
  tools/qstring.cpp:3158:38: runtime error: left shift of negative value -677037574
  tools/qstring.cpp:3159:42: runtime error: left shift of negative value -677037574
  tools/qstring.cpp:3169:13: runtime error: left shift of negative value -1657715810
  tools/qstring.cpp:3173:38: runtime error: left shift of negative value -677037574
  tools/qstring.cpp:3174:42: runtime error: left shift of negative value -677037574
  tools/qstring.cpp:3183:13: runtime error: left shift of negative value -1657715810

Change-Id: I1436eb61369919df9fe34251f863dd54fb58af98
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-04-26 16:37:10 +00:00
Marc Mutz
31c7b24aa5 Silence MSVC warnings when using certain std algorithms
The MSVC STL warns when passing naked pointers as non-bounded
iterators to algorithms such as std::equal and std::copy, in
an attempt to inform users that the range specified by that
iterator has an implicit minimum size that the caller of the
algorithm must ensure is met:

  warning C4996: 'std::_Equal1': 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'

When building Qt, as well as when building user projects with
qmake (cf. 0a76b6bc7f), we
globally disable this warning (with -D_SCL_SECURE_NO_WARNINGS),
but since we started using STL algorithms in public headers (e.g.
in qvector.h), users get this warning in their own projects now,
unless they, too, define said macro. But such a requirement is
against the Qt policy to have headers that are warning-free as
much as possible.

The suggested way of fixing this warning is to wrap the naked
pointer in a stdext::unchecked_array_iterator before passing it
to the algorithm, cf. examples in

  https://msdn.microsoft.com/en-us/library/ttcz0bys%28v=vs.120%29.aspx

or, together with the capacity-made-explicit, in a
stdext::checked_array_iterator.

To avoid ifdefs for platforms that don't have these extensions
(which, incidentally, for the unchecked case, includes MSVC 2012),
wrap the calls in macros.

The end game here is to drop -D_SCL_SECURE_NO_WARNINGS, at least
for public headers, even though this commit also adds the wrapper
to implementation and private header files.

An alternative to the wrapper would have been the version of
std::equal that takes four iterators. However, that is a C++14
library feature, while this version of Qt still needs to compile
with a C++98 compiler, and, more importantly, there isn't, and
never will be, a corresponding 4-iterator version of std::copy.

Task-number: QTBUG-47948
Done-with: Stephen Kelly <steveire@gmail.com>
Change-Id: I1bbab257fb5f1c5042939c382a412b596112ff26
Reviewed-by: Stephen Kelly <ske@ableton.com>
2016-04-26 16:36:40 +00:00
Friedemann Kleint
3a8f895d35 tst_QWidget/XCB: Use bottom/right corner of screen as safe cursor position.
Pushing the mouse rapidly to the top left corner causes KDE / KWin to
switch to "Present all Windows" (Ctrl+F9) mode, showing all windows.
This has been observed to be triggered programmatically by
QCursor::setPos(0, 0) if there is no other window beneath and apparently
depending on the perceived mouse "speed".
Suppress this by using the bottom right corner for XCB.

Change-Id: Id18d2f45a095ed4d4f365f010cf45a20b0d9435e
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
2016-04-26 13:12:16 +00:00
Friedemann Kleint
d7a3b61459 Windows QPA/High DPI: Scale accessibility coordinates.
Use High DPI when interfacing with the Accessibility API.

Task-number: QTBUG-52943
Task-number: QTBUG-50991
Change-Id: Ica4489222dca5d58864172470e634f709deb69f8
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2016-04-26 13:12:07 +00:00
Shawn Rutledge
3d5e9a0ba1 Tablet device_information manual test: show wheel events received
We have a bug that proximity events are generating them spuriously;
this is a way of testing it.

Task-number: QTBUG-52921
Change-Id: I490dfcf8d5b325f612b733e29fd49de9418bb19e
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2016-04-26 13:10:52 +00:00
Shawn Rutledge
685dcd8527 OSX: mark mouse events from tablet devices as synthesized
This is equivalent to d7db6c6c19 on the
xcb platform.

Task-number: QTBUG-51617
Change-Id: I837a764c8382244307ba6aa02bd8bde12bd08bff
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2016-04-26 13:10:29 +00:00
Timur Pocheptsov
0b35167c20 QZipReader - test that QFile::open was, indeed, successful.
Coverity, CIDs 10917, 10918. This fix looks like purely cosmetic
and unneeded: we check f->error() after f->open(). Unfortunately,
f->open() can fail without setting an error (if you provided an invalid mode).

Change-Id: Idbfcb9305b3f004e5e425cb6076b41e193b8d473
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2016-04-26 09:36:30 +00:00
Marko Kangas
90631dcbf5 Change scroll and text areas to respect native wheel focus rule
[ChangeLog][QtWidgets][QAbstractScrollArea,QTextEdit,QPlainTextEdit]
Changed focus to Qt::StrongFocus. That respects platforms' native
guidelines.

Task-number: QTBUG-52559
Change-Id: I2aa25d25bbc15facce85ceb7d4a4c1d0ac7df962
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2016-04-26 09:34:41 +00:00
Timur Pocheptsov
e2f7d04a61 Add missing initializers
Coverity, CIDs: 10724, 10725. Data member _iterator is not initialized.

Change-Id: I0c94f5cef031e208aab1687209282fae0317f0ab
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
2016-04-25 09:28:09 +00:00
Urs Fleisch
269fdbdd2b xcb: Fix drag and drop to applications like Emacs and Chromium.
Drops without matching time stamp do not work. I have fixed the issue by
reanimating the findXdndAwareParent() function (adapted to XCB) and
using it to find a matching transaction if all else fails.

Task-number: QTBUG-45812
Change-Id: Ibca15bbab02ccf2f25280418e9edf36972ebf9a0
Reviewed-by: Błażej Szczygieł <spaz16@wp.pl>
Reviewed-by: Dmitry Shachnev <mitya57@gmail.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
2016-04-25 05:47:46 +00:00
Volker Krause
072f5b513e Also update filter rules if there is a custom filter installed.
This is relevant if the custom filter passes through some categories to
the previous one (which might be the default one). In this case changes
to the filter rules never took effect.

Change-Id: I1a3ab569857d43621ce5df4e690c6e64e6bc7a66
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2016-04-24 15:09:50 +00:00
Friedemann Kleint
2fe10c8dd0 QWindowsVistaStyle: Fix CE_MenuBarItem with QStyleSheetStyle.
Do not paint over CE_MenuBarItem when the palette is set
to transparent by QStyleSheetStyle.

Task-number: QTBUG-49115
Change-Id: Ib364017179d0852490daad094361eae0ead4fd5f
Reviewed-by: Andy Shaw <andy.shaw@theqtcompany.com>
2016-04-23 17:44:10 +00:00
Thiago Macieira
721d7d383d QMessagePattern: Fix indentation and use QVector for a large struct
struct BacktraceParams is too big (more than one pointer), so using it
with QList is inefficient. Let's use QVector instead.

Change-Id: Id75834dab9ed466e94c7ffff144572c1eb3fb0e5
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-04-23 12:33:22 +00:00
David Faure
16fa29352b QMimeDatabase: fix mimeTypeForUrl for mailto URLs
The "path" of a mailto URL isn't a file, so we shouldn't try to do
glob-based matching. I was getting application/x-ms-dos-executable
for a .com domain and application/x-perl for a .pl domain...

Change-Id: Ifc346c3bba83ba1a8476db3202492f4c2e4d52bb
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-04-23 08:44:45 +00:00
Maurice Kalinowski
d9c187b390 winrt: emit application activation
Previously the user only got informed about the application getting
inactive or hidden, but not when the application was reactivated again.
This can cause problems with applications using for instance a camera as
that gets disabled when not being active and never return to a active
state again.

Change-Id: I5c1d8750db8e75043ecf261616a0bc98434a3863
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2016-04-23 06:26:54 +00:00
Friedemann Kleint
ab83912c79 Windows/QProcess::startDetached(): Fall back to ShellExecuteEx() for UAC prompt.
When running a process that requires elevated privileges (such as
regedt32 or an installer), the Win32 API CreateProcess fails
with error ERROR_ELEVATION_REQUIRED.
Fall back to ShellExecuteEx() using the verb "runas" in that case,
bringing up the UAC prompt.

Task-number: QTBUG-7645
Change-Id: Iee82a86a30f78c5a49246d2c0d4566306f3afc71
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2016-04-23 06:12:24 +00:00
Friedemann Kleint
759b3f49c5 OpenGL/contextinfo-Example: Add command line options and status label.
Add command line options to be able to set the QCoreApplication attributes
that influence Open GL context creation and add a status label at the
bottom that displays it besides the QT_OPENGL environment variable.

Task-number: QTBUG-52693
Change-Id: Id9793292596e0feb3da5220fde2e5b2e495f87ff
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2016-04-23 06:10:45 +00:00
Friedemann Kleint
84a49594d0 Windows/tst_QTcpServer: Suppress crash notification of crashingServer.
Suppress message dialog of the test helper as does QTestlib.

Task-number: QTBUG-52714
Change-Id: I5efd7d72f77c7689500ecaccf46f1f9dfb312140
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
2016-04-23 06:09:44 +00:00
Alex Trotsenko
21b3e2265a QAbstractSocket:waitForReadyRead(): fix handling UDP
Allow sockets in bound state to wait for notifications.

Task-number: QTBUG-52449
Change-Id: I5c02bd61db68abca652312d4d59023963b05b3c5
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
2016-04-23 06:03:09 +00:00
Błażej Szczygieł
c511466d74 xcb: Properly process enter/leave events
Ignore enter/leave events when there is a window under mouse button.
Unset window under mouse button if other window is grabbed.
Smarter ignoring (un)grab ancestor enter/leave event.
Ignore ungrab inferior leave event.

Amends: b9f76db30d

Task-number: QTBUG-46576
Task-number: QTBUG-51573
Task-number: QTBUG-52332
Task-number: QTBUG-52488
Change-Id: I8d926309aa60bb8929728691c31ecf93d1e299ad
Reviewed-by: Dmitry Shachnev <mitya57@gmail.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
2016-04-22 13:58:03 +00:00
Peter Wu
1b9d082bb8 dbus: make QDBusArgumentPrivate destructor virtual
Make the destructor of QDBusArgumentPrivate virtual as it may store
other types (QDBusDemarshaller). Suggested by Thiago.

Fixes a "new-delete-type-mismatch" error reported by AddressSanitizer.

Task-number: QTBUG-52176
Change-Id: I9ac19050840530ca9cae893b10093185d31e0448
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: David Faure <david.faure@kdab.com>
2016-04-22 13:46:15 +00:00
Timur Pocheptsov
a9e7bf9ffd _q_networkSessionStateChanged - fix weird logic
a != A || a != B looks suspiciously wrong.
Found, unfortunately, only by Coverity (CIDs 152247, 152249).

Change-Id: Ia7ec810dde2a3a33ae6fc5644a4eebf279dcffe8
Reviewed-by: Edward Welbourne <edward.welbourne@theqtcompany.com>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
2016-04-22 10:05:45 +00:00
Alexander Volkov
e27fae353c QFileSystemModel: fix updating QFileInfo for a node after a file rename
Use the correct parent path for the renamed file when creating
QFileInfo. It must be a path to the parent directory, not to the
root directory of the model.

Modify tst_QFileSystemModel::setData() to test renames in subdirs
of the root directory of the model.

Change-Id: I69d9e3a937616857a81617791ed118af3f6eea05
Task-number: QTBUG-52561
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-04-22 09:49:53 +00:00
Timur Pocheptsov
ea64dc9a11 qlockfile_unix - code cleanup
Coverity's CID 157687: QCache::insert, indeed, can delete (immediately)
the object we're trying to insert. While this never happens actually in
qlockfile_unix since we have max cost 10 and insert with cost 1, the
code does not look good and Coverity is not happy.

Change-Id: I16a428017bf86e151afe5256906e4cab1ef4044a
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2016-04-22 08:45:48 +00:00
Friedemann Kleint
eb786d600c Fusion style: Observe text alignment of QGroupBox.
Take alignment into account in QFusionStyle::subControlRect().

Task-number: QTBUG-49068
Change-Id: Ia8f2d06c46b24761bff537247bbadd3323e41fa9
Reviewed-by: Alessandro Portale <alessandro.portale@theqtcompany.com>
2016-04-22 06:32:27 +00:00
Friedemann Kleint
9442b3a1c3 Windows QPA/GL: Avoid crash in GL driver.
QWindowsStaticOpenGLContext::doCreate(): Invoke
QWindowsOpenGLTester::supportedRenderers() only when needed; specifically,
do not unnecessarily call it when GLES/SW renderer is specified.
Amends change b4c8e15174.

Task-number: QTBUG-49541
Task-number: QTBUG-52693
Change-Id: I58d1c584d194f8e7fee35ee16b77575f86d3c22e
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2016-04-22 06:32:09 +00:00
Friedemann Kleint
ccfe33dc67 QWidget::grab(): Use device pixel ratio.
Return pixmaps with device pixel ratio similar to QScreen::grabWindow(),
cf c0963486ce.
Adapt kernel tests accordingly.

Task-number: QTBUG-52137
Change-Id: I9ce276d5e2d87ae0d39c8639267d1ac283fed854
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2016-04-22 06:31:10 +00:00
Timur Pocheptsov
5b54c352ed Cocoa integration - add a protection against dangling pointers
Backport watcher-sentinel trick (QPointer->QObject) from dev.

Task-number: QTBUG-42059
Change-Id: I9b2c7cde635c2ed9a3f667f216da62870d0b5ccb
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2016-04-22 01:20:44 +00:00
Vyacheslav Grigoryev
072485048f QHeaderView: fixing selection of reordered rows and columns
The old code incorrectly calculated visual region for a selection (specified by
QItemSelection object) in case of reordered / swapped rows or columns. It used
the leftmost and rightmost (upmost and downmost for vertical mode) logical
indexes directly. However some middle logical index (in case of reorder) may be
the leftmost or rightmost visual index. In such cases the repainting didn't
work properly. This fix first checks whether reordering / swapping is in use.
If it isn't (ie visual=logical) we use code similar to the old code. Otherwise
the new code scans all selected logical indexes, translates them into visual
ones and gets the correct leftmost and rightmost indexes.

[ChangeLog][QtWidgets][QHeaderView] Fixed a repainting issue when items had been reordered.

Task-number: QTBUG-50171
Change-Id: If6afabebf445cf32a8e0afe262b6ee149e7c4b2b
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
2016-04-21 21:13:38 +00:00
Stephen Kelly
9def501433 QString: Avoid searching for a needle which is longer than the hay
Avoid incurring the cost of converting the latin1 data in that case.

Several existing QString unit tests excercise the new code path.

Task-number: QTBUG-52617
Change-Id: I27256d9e7db34f09543e244a79d754ff7932f0d0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-04-21 21:13:08 +00:00
Jake Petroules
bbd1228b17 Fix Group-relative specification of files in generated Xcode projects.
Xcode does not recognize "<Group>" with a capital G, only "<group>" with
a lowercase g. As a result, paths of files within these groups are
calculated incorrectly. For example, dragging any external file into the
Xcode project would result in its leading slash being removed (while
still treated as an absolute path - broken reference). Furthermore, the
dropdown in Xcode displayed the Group location as an invalid string
instead of the correct "Relative to Group". This patch restores correct
behavior.

This fixes a regression introduced in
f09ec09c208c75a16abe05b6bb505a1fc58775a6.

Task-number: QTBUG-52701
Change-Id: I9af5360049a79e7958301e4090a9a542bab0af8c
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
2016-04-20 18:18:33 +00:00
Joerg Bornemann
64b54819d8 Doc: Fix links to QProcess::start(const QString &, OpenMode)
The startDetached(const QString &, OpenMode) overload and the
QT_NO_PROCESS_COMBINED_ARGUMENT_START macro must point to the
start(const QString &, OpenMode) overload.

Change-Id: I7607fcb92b9f1ef3547a4a1aadc950532024225a
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2016-04-20 13:43:53 +00:00
Timur Pocheptsov
6d9a3c0119 QMacPinchGestureRecognizer - fix totalScaleFactor
Set totalScaleFactor on a pinch gesture (OS X) so that it works the same way
as in 'standard' gesture recognizer and corresponds to what we document.

[ChangeLog][QtWidgets] : QPinchGesture on OS X now behaves like on other
platforms: totalScaleFactor is the magnitude of the pinch and scaleFactor
is the delta for the current event.

Task-number: QTBUG-48138
Change-Id: I66b9a1df05cbe106b76aed8f15d900bcdd41fdb7
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
2016-04-20 12:22:59 +00:00
Friedemann Kleint
e75bd17e3d QWindowsTheme::standardPixmap(): Do not create pixmaps with DPR.
The given size is mostly ignored and the resulting pixmaps typically end up
in a QIcon, which will clobber the DPR anyways when returning a pixmap
for a given size.
Moreover, returning a message box icon with a DPR > 1 when
high DPI scaling is active and Qt::AA_UseHighDpiPixmaps is not set
causes the pixmap to become too small due to some scaling error.

Task-number: QTBUG-52622
Change-Id: I8aaaa97667d6c168040e19b7edad9dfb7517f70f
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
2016-04-20 11:59:25 +00:00