Commit Graph

35039 Commits

Author SHA1 Message Date
Liang Qi
32b506d1db Merge remote-tracking branch 'origin/dev' into 5.11
Conflicts:
	src/corelib/tools/qvarlengtharray.qdoc
	src/corelib/tools/qvector.qdoc

Resolved documentation changes in favor of 017569f702,
which keeps the move overloads along with its const-ref sibling.

Change-Id: I0835b0b3211a418e5e50defc4cf315f0964fab79
2018-02-10 15:55:52 +01: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
Gabriel de Dietrich
2cb1db6437 Document several WA_Mac attributes as obsolete
All of these had already no effect.

Cleaned up a bit of code around old Qt 4 #ifdefs and
documentation mentioning Carbon.

Change-Id: Id2858c56a5785f82c47e20e1e760743fb4d08189
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2018-02-05 19:45:24 +00:00
Gabriel de Dietrich
4a55eb0e3a QMacStyle: Remove call to HIThemeDrawSeparator
It looked inverted for some reason. A single line looks
better than before.

Change-Id: Icb214b44ddcc6e9e57fe12e7b4c3f512a5f66452
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2018-02-05 19:45:15 +00:00
Gabriel de Dietrich
14c4fe8037 QMacStyle: CE_DockWidgetTitle is now HITheme-free
Change-Id: Id2e23d37e9b87f89fc40e0d774c628eec91a986e
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2018-02-05 19:45:08 +00:00
Gabriel de Dietrich
3de8e74d77 QDockWidget: Use theme font for title
While the QPA theme provides support for dock widgets
title font we never use it.

This is a very similar solution to what we do in
QMdiSubWindow, setting the platform theme font at
few specific points.

This patch also fixes the dock window title font on
macOS, as queried in QCoreTextFontDatabase.

Change-Id: Ie264e4e83e0d3d1e8f78bd378359f3063cc1d525
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2018-02-05 19:45:03 +00:00
Gabriel de Dietrich
347cfa00a2 QMdiSubWindow: Hide "system" menu icons on macOS
Not only they should not appear (icons in menus is a special
thing on macOS), they don't match the look on the window frame
buttons. So, it's better to hide them completely.

Change-Id: I8814ed3e128480abff4f53fdd40a0bb13f1796ef
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2018-02-05 19:44:57 +00:00
Gabriel de Dietrich
8633e1a7b4 QMacStyle: QMdiSubWindow is now HITheme-free
There are a couple issues. Because the actual class for
the buttons returned by +[NSWindow standardWindowButton:
forStyleMask:] is private, we can't fully configure them
as we could with HITheme. Therefore, we don't get the
mouse hovered state and the zoom button will show the
fullscreen arrow instead of the '+' icon.

Hopefully, QMdiArea will go the way of the dodo soon
enough. It is not a thing on macOS and it has been
replaced by tabbed windows UI on most desktop apps.

Change-Id: Ia581f72611ad0224f42657afbc4d9f94bf5e5a3a
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2018-02-05 19:44:50 +00:00
Gabriel de Dietrich
80515c811a Introducing SH_SpinBox_ButtonsInsideFrame
This is currently only used in QMacStyle since,
on macOS, the spin-box buttons are always beside
the line-edit. Hence, there is no need to tamper
with the line-edit frame.

Change-Id: I8ccfbab547fccae89a8ddeaeb7005cb17d5951e6
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2018-02-05 19:44:35 +00:00
Gabriel de Dietrich
3d29a0dd74 QMacStyle: CC_SpinBox is now HITheme-free
Bonus changes in this edition:

    * The focus frame shows only around the spin-box's
      line-edit, as it should. This requires getting
      access to the spin-box's line-edit, which we do
      by setting a property on the former. Notice that
      the stepper doesn't get focus. On this point,
      macOS is inconsistent (partly because there's no
      such thing as an NSSpinBox, and partly because
      spin-box buttons are a separate control), so we
      copy the same focus behavior as NSDatePicker.

    * We clean some QFocusFrame related dead code in
      QMacStyle::event().

Change-Id: I204ca2093d9db343c78f0420811dda35c463bbcd
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2018-02-05 19:43:49 +00:00
Tor Arne Vestbø
3d02e75c07 Unconditionally log to stderr, regardless of qt_logging_to_console()
Regression after 114f795221, which incorrectly assumed that checking
qt_logging_to_console() was a safe behavior change to include.

Unfortunately that broke debug output in Qt Creator, as Creator doesn't
seem to run applications with a controlling TTY unless it itself was
started with one, and doesn't set QT_LOGGING_TO_CONSOLE to force log
console output either.

Task-number: QTBUG-66153
Change-Id: I775cb06953122a3f20c16bfe21e19de2d1aa5b52
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-02-05 19:30:09 +00:00
Thiago Macieira
64a3bba7b8 QVariant: convert QDateTime and QTime to string with milliseconds
This way, it's lossless.

This commit is a cherry-pick of ab1e507574,
which was reverted.

[ChangeLog][QtCore][QVariant] Conversions of QDateTime to strings now
contain the millisecond components.

Change-Id: I5e421e32396d44e4b39efffd150b744e40fff3a1
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
2018-02-05 18:48:59 +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
Johan Klokkhammer Helsing
3058e21af0 eglfs_kms_vsp2: Add support for setting layer alpha
Exposed through QEglFSFunctions::vsp2SetLayerAlpha.

Change-Id: I2a600971d5a2aa56d4bf7cde03df3323f17249cd
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2018-02-05 13:12:01 +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
BogDan Vatra
38c6d10bc8 Say hello to ImhNoEditMenu & ImhNoTextHandles
The actual implementation for Android will come later.

Change-Id: Ia68fcb03ea5d769d302ec6f77e5666292b567ffa
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
2018-02-05 06:59:40 +00:00
Alexander Volkov
6f03740a19 QPlatformWindow: add startSystemMove()
It can be used by custom widgets or for example by
the Breeze style from KDE, which allows to drag windows
by some widgets.

It's important on X11 because _NET_WM_MOVERESIZE requests
induced by touch sequences require support from Qt.

Task-number: QTBUG-58044
Change-Id: I31c37534555a9050cf361cad85bdef13c2808572
Reviewed-by: Johan Helsing <johan.helsing@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2018-02-04 08:25:19 +00:00
Thiago Macieira
a16d0074b9 QUtf8: Add some UTF-8 text operation functions
The first, isValidUtf8(), as the name says, returns true if the string
is valid UTF-8. As a bonus, it also returns whether it's valid US-ASCII.

The other two are meant to compare an UTF-8 string to either a Latin1
one or an UTF-8 one, without memory allocation.

Change-Id: Ic38ec929fc3f4bb795dafffd150ad0d63e28cd32
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-02-03 21:31:57 +00:00
Thiago Macieira
687dc7fac7 QUuid: add a way to get the string form without the braces
While we're at it, add a way to get it without the dashes too. I'm
calling it "id128", as in "128-bit ID", as seen in journald's sd_id128_t
type and the sd_id128_xxx() API.

[ChangeLog][QtCore][QUuid] Added a parameter to both toString() and
toByteArray() to allow controlling the use or not of the braces and
dashes in the string form.

Change-Id: I56b444f9d6274221a3b7fffd150cde706cfc5098
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2018-02-03 21:30:37 +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
Martin Smith
017569f702 doc: Add missing \fn commands for new members
New members were added to QVarLengthArray and QVector,
but the engineer didn't document them. Since they are
only slightly different versions of existing functions,
their \fn commands were added to the eisting qdoc comments.

Some defined(Q_CLANG_QDOC) uses were also added.

Change-Id: I8a5505ca27efc9205b1387ed0be310e4b74ec490
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-02-03 17:26:07 +00:00
Martin Smith
f1eb4c4463 doc: Add tests of Q_CLANG_QDOC
Some defined(Q_CLANG_QDOC) uses were added.

Change-Id: I5688fee0d0d8f00bb97e3e63bd02a68ddbfdda11
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-02-03 17:25:52 +00:00
Martin Smith
edc6d4f914 doc: Add qtlinguist to depends for QtWidgets
QtWidgets has one link to the linguist manual, so it needs
to see the3 index file for qtlinguist.

Change-Id: I2bbbc4cc9e6d43fed1b6cdee556bc9c4d5f01299
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-02-03 17:25:38 +00:00
Martin Smith
e177fc4d39 doc: Change \l StyleSheetEditor to \c StyleSheetEditor
A \l was changed to \c to be consistent with all the other references
to the class name..

Change-Id: Ic7449a06e0a1f1d6d7087e11cc85258e81a0dfab
Reviewed-by: Martin Smith <martin.smith@qt.io>
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-02-03 17:25:27 +00:00
Martin Smith
fc1ff9badf doc: Add 2 missing return types to \fn commands
Return types were missing from two \fn commands, but clang-qdoc
did not detect they were missing on macOS. clang-qdoc on linux
did detect them. This could mean there is a problem with the
function that matches a \fn signature with its declaration in
the database. It might be too forgiving.

Change-Id: I01f107a6162e2f36b594b5d3dd4029b8ef2db678
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-02-03 17:25:12 +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
Martin Smith
a374e164ef qdoc: Remove __cplusplus from the defines list
__cplusplus was removed from the list of defines passed to
qdoc because it should not be there for clang-qdoc.

Change-Id: I32802e68d915f7a5b717f16ba26a1cd57d7ff645
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-02-03 12:46:34 +00:00
Christian Ehrlicher
1aa3edf3f8 QListView: Honor css :first/:middle/:last Pseudo-States
Properly set QStyleOptionViewItem::viewItemPosition to honor the css
Pseudo-States.

Task-number: QTBUG-27110
Change-Id: I9b9bb4913210feb665fd9d00a71dc4a953a93606
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
2018-02-03 10:01:41 +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
Friedemann Kleint
daabb8f63d QtEdidSupport: Fix private headers
Fix warnings:
QtEdidSupport: WARNING: qtbase/src/platformsupport/edid/qedidparser_p.h does not have the "We mean it." warning
QtEdidSupport: WARNING: qtbase/src/platformsupport/edid/qedidvendortable_p.h does not have the "We mean it." warning

Amends 5f7ab88055.

Change-Id: I3868096344480d509d7b7c1833389adaa67623a0
Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io>
2018-02-02 07:21:49 +00:00
Friedemann Kleint
120abd19a9 Skip QWSIF::WindowScreenChanged events if the screen is unchanged
WindowScreenChanged events might be reported repeatedly from the QPA backends
until the event has reached GuiApplicationPrivate::processWindowScreenChangedEvent()
which sets the screen. Ignore events in case the screen is already correct.

Task-number: QTBUG-65580
Task-number: QTBUG-62971
Change-Id: Ie5fc9830771e816db942355efbe5a48e829914cb
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
2018-02-02 07:21:24 +00:00
Friedemann Kleint
2bf4dd1302 Diaglib: Make mouse event logging more verbose
Add information about mouse tracking/grabbing for widgets
and window where applicable.

Change-Id: Idfe8bef6d146ff06dfe95c0bad5e29e7a4ea7adc
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2018-02-02 07:20:55 +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