Commit Graph

35031 Commits

Author SHA1 Message Date
Friedemann Kleint
8692f12e89 QTestlib/selftests: Add expected_crashes_4.txt for boot2qt
It has been observed that sometimes the output is not captured by QEMU.

Task-number: QTBUG-65845
Change-Id: Iddf888fb3aa019209dbe71f424d87884471784e0
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-02-11 09:41:24 +00:00
Sergio Martins
7a342372bb Introduce QLayout::indexOf(QLayoutItem *)
This was the missing counter-part to indexOf(QWidget *), which is
sometimes implemented in user code.

Not sure why the original code doesn't use a for-loop and instead accesses
an out-of-bounds element, but I'll preserve the behavior of very old working code.

Change-Id: I7d7fa56b56a4626789774c15c23fdfef41d723e7
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2018-02-10 21:14:55 +00:00
Christian Ehrlicher
dc9ce275be QStyledItemDelegate: fix drawing elided multi-line texts
QCommonStylePrivate::viewItemDrawText did not handle multi-line text
correct when one of the lines must be elided. All text after the first
elided line was not drawn at all.

Task-number: QTBUG-14949
Task-number: QTBUG-57891
Change-Id: I2b7137f8f09001c1e0cdbdb10f784c4be433d0d2
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-02-10 13:19:06 +00:00
Christian Ehrlicher
7ab7f97881 QList/Table/TreeWidget: remove vc6 workaround
There was a typedef used for comparisons of the items which was for
VC6 according to the comment. Replaced the typedef with auto and did
a testcompile with MSVC2015 - worked fine.

Change-Id: Ibdbc2332d49d2dd533ab35180f49c9dcd143c627
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-02-10 13:19:03 +00:00
Christian Ehrlicher
85f6dd8325 QTreeWidgetItem: pass role to dataChanged() signal
QAbstractItemModel::dataChanged() gained an optional role parameter
with Qt5 which was not filled within QTreeWidgetItem setData() function

Change-Id: Ife87e9e046621b464ad340bd9eb451355730e93c
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-02-10 13:18:57 +00:00
Anton Kudryavtsev
f9fa3e2553 QImage: use rvalue overloads more
Change-Id: I4e5e1199d1bf460c58a75fbc06b91ec5a71c49f9
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-02-10 10:45:20 +00:00
Tor Arne Vestbø
4962b0bee9 macOS: Don't log missing forwarding target during notification forwarding
The missing targets are coming from NSViews that we haven't created, such
as the _NSThemeCloseWidget, and are just noise in the debug output.

Change-Id: I71ae1267460739969511bf4de946bcc7ca897e7b
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-02-09 13:30:17 +00:00
Alexander Volkov
5a868fe0bb xcb: Drop _QT_SETTINGS_TIMESTAMP_ atom
It was used in Qt 4 to make applications reload Trolltech.conf,
which is not supported by Qt 5.

Change-Id: Ic75c117f22a23a8f26b3f19ce57322878613f5b0
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2018-02-08 21:35:39 +00:00
Anton Kudryavtsev
a36031ace3 QPixmap: use rvalue overloads more
Change-Id: Icf19d20bf46f575ba020e308e0822164ed9924cf
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2018-02-08 17:40:38 +00:00
Jake Petroules
ae273bcf42 libjpeg: silence warnings with clang as well as gcc
The check was broken anyways since the compiler filename is not
guaranteed to be "gcc" in all cases when using GCC.

Change-Id: I9f242ef26c6fea6d2fedda0391f8c7bef264f1ef
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
2018-02-07 20:00:34 +00:00
Jake Petroules
2af3cb4436 Add missing override keywords
Change-Id: Id4fe5ffb27dbd3e96add0e87c1679b5b1ff76545
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
2018-02-07 20:00:28 +00:00
Jake Petroules
3343295d80 Fix a bunch of compiler warnings in the qtbase examples
Change-Id: Id0c615aa72d4f4c5941cfa5ca258c3114694ef67
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
2018-02-07 20:00:22 +00:00
Frederik Gladhorn
5f058a73c8 Remove extra semicolon
Change-Id: I3156da059116f4a9edeeec1d5450e23587ba03fd
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2018-02-07 14:01:07 +00:00
Morten Johan Sørvig
f5c3d48c99 Cocoa: Support DnD to the Trash
Map Qt:MoveAction to NSDragOperationDelete, in addition
to the existing NSDragOperationMove mapping.

From the point of view of the source there is no difference
between Move and Delete; the source copy should be
deleted.

Task-number: QTBUG-63794
Change-Id: Iea5abe31efe0320dad150d243544f25167b3d18c
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-02-07 13:49:11 +00:00
Morten Johan Sørvig
c223fdd917 Cocoa: move setting of drag accepted state
performDragOperation:sender is called when an application
window receives a drop, either from an application
sourced drag or from a foreign drag.

draggingSession:endedAtPoint:operation is called when
an application sourced drag ends, either on an application
window or on a foreign window.

Update the drag accepted state when the session ends
in order to handle DnD from the application to a
non-application window.

Task-number: QTBUG-63794
Change-Id: If3e16ed6a086c5d051e7390e3ecf16ea210221ad
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2018-02-07 13:48:35 +00:00
Friedemann Kleint
9bd702a634 tst_QMenu: Add define QTEST_QPA_MOUSE_HANDLING
Use the clean implementation that does not use QCursor::setPos()
with the exception of macOS, where this causes
submenuTearOffDontClose() to fail.

Change-Id: I95a615c37bcf419ce1ede65b5ed79a5ec0568391
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2018-02-07 12:29:06 +00:00
Edward Welbourne
6d3e5ac6d2 Prefer ICU over system info on MS-Win
The ICU data is more complete; and its APIs allow it to tell the whole
story, which MS-Win's APIs can't (e.g. Morocco's otherwise-normal DST
has a hole in it for Ramadan; when this makes four transitions in a
year, the MS-APIs can't report more than two, so ignore the Ramadan
gap); and their design obliges us to use heuristics to kludge round
mis-description of simple changes to standard time in non-DST zones,
which can't be distinguished from certain (more) obscure cases of
changes to DST coinciding with a change to standard offset (causing a
DST transition to hide, leaving its other end *looking like* a non-DST
change to standard offset).  Using ICU, when available, reduces how
many end users shall be mislead by such kludges.

[ChangeLog][Windows][QTimeZone] Changed MS-Win to use ICU for
time-zone data, when available, in preference to MS's TZ APIs.  The
choice is made when building Qt.  This will give reliable results when
non-DST transitions arise, or when a zone's DST is not simple
(e.g. interrupted by Ramadan).

Task-number: QTBUG-42021
Change-Id: I9cdd65713ecdaf8cce52dd924fbc7371630977c8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-02-07 12:21:00 +00:00
Anton Kudryavtsev
aec6fae60b Add overloaded QBitmap::fromImage that takes QImage rvalue
... and use it.

[ChangeLog][QtGui][QBitmap] Add overloaded QBitmap::fromImage that takes QImage rvalue

Change-Id: Idb6e6bb1645371996700349714041cc54bb3d005
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2018-02-07 12:10:32 +00:00
Frederik Gladhorn
806c6abadd Mention Qt Creator is compatible with testlib
Change-Id: Iea32858a7ae5d7450682a18247a76830b42a4ae4
Reviewed-by: Nico Vertriest <nico.vertriest@qt.io>
2018-02-07 12:01:52 +00:00
Allan Sandfeld Jensen
c0948d508e Add drawTexture benchmark
Change-Id: I086106adb49eca511d52c6b6b5cff5d72309f77c
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2018-02-06 01:28:26 +00:00
Allan Sandfeld Jensen
fd80b8aaeb Unalias some core drawhelper loops
Some compilers will assume src and buffer are different and only
vectorize the unaliased case and take a slow path when they are equal.
In our case they are as often equal, so we need to manually unalias the
variables to make sure both cases are fully optimized.

Change-Id: I6ec86171dd179844facdf45376253c55980d9e36
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-02-06 01:28:16 +00:00
Christian Ehrlicher
076087717e Documentation: Update CommonTableModel/StringListModel snippets
Update CommonTableModel/StringListModel snippets:
  - 0 -> nullptr
  - use 'override'
  - replace "" with QString()
  - use QStringLiteral instead QString
  - pass role to dataChanged() signal

Change-Id: I5949d1bd6fee3186f12191f1f6235ae18908096e
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-02-05 17:06:43 +00:00
José Millán Soto
a0717c60b3 Handle coordinates related to component window
AtSpiAdaptor::componentInterface was not checking the coordinate type in
GetAccessibleAtPoint.

Now, if the coordinate type is ATSPI_COORD_TYPE_WINDOW the coordinates of the
window will be added to the specified coordinates.

Change-Id: Iba571109a8da300f4141d616a94ef4ac87918f98
Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2018-02-05 16:13:01 +00:00
Sergio Martins
cf1b732e21 Introduce QT6_VIRTUAL and QT6_NOT_VIRTUAL macros
To avoid QT_VERSION_CHECK ifdefs

Change-Id: I364903964c72f4df19b8b7c10c19b82d24f63600
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-02-05 15:54:34 +00:00
José Millán Soto
2e0849e79c Use placeholder text for accessible description of QLineEdit
If the accessible description of a QLineEdit is requested and none has been
set, the placeholder text will be provided if one is available.

Change-Id: I4c0dad1d06fd3d8a6e00c963402d380c59bd7f05
Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2018-02-05 15:41:29 +00:00
Albert Astals Cid
10b9ff0a4d Remove QCupsPrintEnginePrivate::setupDefaultPrinter
it was declared but never used

Change-Id: Iededb2943759cd2d66de95bcc1758dbcc4283ee3
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2018-02-05 13:53:33 +00:00
Albert Astals Cid
fadaf7053d Remove QPlatformPrinterSupport::createDefaultPrintDevice
no one uses it

Change-Id: I03d0350a44a19545d57b47d1b21d85f1a2059f4d
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2018-02-05 13:53:24 +00:00
Tor Arne Vestbø
f4765ff5f6 Modernize logging in CoreFoundation and iOS event dispatchers
Instead of manually handling logging enablement, we use Qt's categorized
logging system.

Change-Id: I8d942601f76876030084c9fb130b7215ff6cc404
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-02-05 13:31:06 +00:00
Tor Arne Vestbø
b1fe198d87 Simplify how we set thread name for UNIX threads
Passing on the thread ID is confusing, as it's not really what the
function does. The QNX code path can resolve the thread ID by itself.

Change-Id: I5f0d54621058576cdcf3707d36a11762fe2383c8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-02-05 13:30:53 +00:00
Anton Kudryavtsev
74045f8b9a Use new QString::remove(QLatin1String)
Change-Id: I5b3560709a8fb230a177511c701fd0bf25938f0f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-02-05 08:21:22 +00:00
Oliver Wolff
8bc4c3ae8f Benchmarks: tst_tcpserver: Remove unnecessary qprocess include
The include is not needed and breaks build that do not have process
support.

Change-Id: I3951c24c950dd556a3b26744d8994709e294d397
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-02-05 07:16:01 +00:00
Friedemann Kleint
bdd2697ce8 tests: cleanup tst_QMenu::click_while_dismissing_submenu()
- Use Qt 5 connection syntax
- Use QTest::mouseMove(QWindow *)

Change-Id: Ia2ea8595355801db3f4569a96dead60a7af51109
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2018-02-03 18:55:02 +00:00
Elvis Angelaccio
4772ac90fa QLineEdit: implement quick text selection by mouse
This is a standard feature in GtkEntry widgets or HTML
<input type="text"> elements. During a normal text selection by mouse
(LeftButton press + mouse move event), it's now possible to quickly
select all the text from the start of the selection to the end
of the line edit by moving the mouse cursor down.
By moving it up instead, all the text up to the start of the line edit
gets selected. If the layout direction is right-to-left, the semantic of
the mouse movement is inverted.

This feature is only enabled if the y() of the mouse move event is
bigger than a fixed threshold, to avoid unexpected selections in the
normal case. This threshold is set by the QPlatformTheme and a value
smaller than zero disables this feature.

The threshold is updated whenever the style or the screen changes.

[ChangeLog][QtWidgets][QLineEdit] Implemented quick text selection by
mouse in QLineEdit.

Change-Id: I4de33c2d11c033ec295de2b2ea81adf786324f4b
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2018-02-03 16:34:05 +00:00
Christian Ehrlicher
8db29d92df QCommonStyle::drawControl: use PM_HeaderMargin instead magic number
Replace '2' with the correct margin retrieved from PM_HeaderMargin during
paniting of CE_HeaderLabel within QCommonStyle::drawControl().

Change-Id: I5a50e02f107a00f382a38e14c4d3fa8dcb97ad12
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
2018-02-02 14:49:57 +00:00
Christian Ehrlicher
2950de715e QHeaderView: consider Qt::DecorationRole size within paintSection()
When an icon was given through Qt::DecorationRole, the available space
for the text was not adjusted which created a graphical glitch.

Task-number: QTBUG-62091
Change-Id: I0f20b6de95deed14fb882efde5c81b83ab3e9a7e
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
2018-02-02 14:49:51 +00:00
Allan Sandfeld Jensen
fd3f732489 Add documentation entries for new qvector/qvarlength methods
Change-Id: I4be1605ed8c9022795d5132203ad947e78481e67
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-02-02 14:49:46 +00:00
Anton Kudryavtsev
0c0ee82bff QString:: add remove() overload taking QLatin1String
[ChangeLog][QtCore][QString] Added remove() overload taking QLatin1String

Change-Id: I11ddb8b8603144effe44f89d0d02e131a255122c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-02-02 14:49:15 +00:00
Andre de la Rocha
5c60e4b8f9 Fix HiDPI rendering issues in the WindowsVista style
Fixing miscellaneous rendering issues to make the WindowsVista
style look good on High DPI displays:
- Fixed size/resolution of combo box arrows, and changed to native look.
- Fixed vanishing horizontal line in the frame of line edit widgets.
- Fixed gaps in combo box popup.
- Fixed size/resolution of arrow in push button menu.

Task-number: QTBUG-49374
Task-number: QTBUG-65237
Task-number: QTBUG-65238
Change-Id: If68c2fae7472def3c19636483af741ca8ed2c490
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2018-02-02 14:46:11 +00:00
Andre de la Rocha
0b2ebfd414 Fix HiDPI rendering issues in the Windows style
Fixing miscellaneous rendering issues to make the Windows
style look good on High DPI displays:
- Fixed size/resolution of combo box arrows.
- Fixed size/resolution of scroll bar arrows.
- Fixed size/resolution of check boxes.
- Fixed size/resolution of radio buttons.
- Fixed the frame of default buttons.

Task-number: QTBUG-49374
Task-number: QTBUG-65237
Change-Id: Ib7e2ef2ed027c50dbac23b16a73f7033000552f1
Reviewed-by: Andre de la Rocha <andre.rocha@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2018-02-02 14:45:51 +00:00
Andre de la Rocha
8f582a4cc5 Fix HiDPI rendering issues in QCommonStyle
Fixed size/resolution of combo box and scroll bar arrows.

Task-number: QTBUG-49374
Change-Id: I3016b082b5eb7149fbe0c0e740525ab8506ce391
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2018-02-02 14:45:41 +00:00
Anton Kudryavtsev
cdebc1a138 QString: optimize remove()
In remove(const QString &str, Qt::CaseSensitivity cs)
call remove(QChar c, Qt::CaseSensitivity cs)
if str.size() is equal 1. It prevents quadratic behavior
for that case.

Change-Id: I9a7ab3019c580343533c8c6c6a04b6b0c8c1fb55
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-02-02 11:08:11 +00:00
Jan Grulich
e8bf3a2ce7 Fix opening of flatpak FileChooser portal
My assumption before was that show() method calls exec(), but it seems
to be vice-versa and so QML applications using QFileDialog were not able
to open dialogs as they use visible property, which in turn calls show()
method. I made the show() method to call new openPortal() method where
I moved the actuall DBus call from exec() method. The exec() method now
internally calls show(), at least this is my assumption and it seems to
behave like that from my testing.

Change-Id: I27a5b0198e9ff1a9ea031f9ae45b57ceae99c6ae
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-02-02 05:54:43 +00:00
Gatis Paeglis
ac0ad5c69c tests: cleanup tst_QMenu::QTBUG47515_widgetActionEnterLeave
- Allocate widgets on stack. The previous version was inconsistent (some
  widets were managed by QScopedPointer and some were simply leaking).

- Use QTest::mouseMove(QWindow *)

- "This test fails on OS X on CI" was a clear indication that test is
flaky, the new implementation can reliably reproduce issue which is
now tracked in QTBUG-63031.

Task-number: QTBUG-63031
Change-Id: I59965ef8fa8edca17c8a73901d81e9efc7da3c5b
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2018-01-29 21:19:58 +00:00
Thiago Macieira
678aae2c43 QBitArray: add manipulate a dense bit array directly
[ChangeLog][QtCore][QBitArray] Added fromBits(), which creates a
QBitArray from a dense bit array, and bits(), which returns that.

Change-Id: Ia9c88b83534240a5872dfffd150b1c8b1c36ced5
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-01-28 22:15:05 +00:00
Rafael Roquetto
48bce2e8f0 Support for LTTNG and ETW tracing
This commit introduces minimal support for instrumentation within Qt.
Currently, only LTTNG/Linux and ETW/Windows are supported.

Change-Id: I59b48cf83acf5532a998bb493e6379e9177e14c8
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-01-28 19:17:02 +00:00
David Faure
2b7de16fbe QMimeType: remove unwanted *.bin as preferredSuffix for octet-stream
This leads to an automatically appended .bin when saving a file.

https://bugs.freedesktop.org/show_bug.cgi?id=101667
https://bugs.kde.org/382437

Fixed upstream in shared-mime-info 1.10

Change-Id: I125a0bc72c91a082706bf2bf149adcf63ff1ec6b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-01-28 19:13:28 +00:00
Thiago Macieira
08559d2b77 JSON: use the new isLatin1 function
It's vectorized, so it should be faster than this version.

Change-Id: I56b444f9d6274221a3b7fffd150c1519eb999cdc
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-01-27 17:51:32 +00:00
Thiago Macieira
c375503fa0 Add a few methods to check if a string is US-ASCII or Latin1
isLatin1(QLatin1String) is provided for completeness sake, in case some
generic code operates on both QLatin1String and QString/QStringView.

Change-Id: I5e421e32396d44e4b39efffd150b99a18eedf648
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-01-27 17:51:24 +00:00
Allan Sandfeld Jensen
39f76b4325 Fix broken rendering of RGB30 and ARGB32 on machines with AVX2
Two small changes late in the review process were flawed.

Change-Id: I4b1f6e3fdb8e17000a2e11bc30aae1b29d9f43a9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-01-27 00:34:15 +00:00
Friedemann Kleint
cb612491b3 tests/manual/widgets/styles: Extend the style icon display
Refactor the page displaying the standard pixmaps of a style:
- Use a QGroupBox
- Sort items by enumeration name

Add a page displaying the standard icons along with the list of
sizes.

This allows for conveniently checking which resolutions are available.

Change-Id: I2d7f655456fc3e7013c2582ad520b6ac582951e6
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-01-26 22:57:08 +00:00