Commit Graph

35285 Commits

Author SHA1 Message Date
J-P Nurmi
fef6b31b99 GTK: fix menu positioning on high-DPI
The target position is passed in physical native pixels, so call
QPlatformWindow::mapToGlobal() instead of QWindow::mapToGlobal().
The latter operates on logical pixels.

Task-number: QTBUG-55251
Change-Id: I789128a0a345d4113fced82ed1b215fe14044634
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-02-07 05:59:52 +00:00
Oliver Wolff
0307bfea31 ANGLE: Remove workaround for files having the same name (Debug.h/.cpp)
With object_parallel_to_source the workaround of making copies of the
files and using these is no longer needed.

Debug2.h and .cpp were added to the repository by mistake and should not
have been there in the first place.

Task-number: QTBUG-66059
Change-Id: Ib9dbd15be1dee1cb5190762fe06bad56dd40dd47
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2018-02-06 06:17:39 +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
J-P Nurmi
1cc15c4b6d QComboBoxPrivate::showNativePopup(): Scale target rectangle
The QPlatform* classes operate in native pixels.

Task-number: QTBUG-55251
Change-Id: I80490fa802fbc77a1e02c176528cc047630f9a7d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-02-05 21:35:21 +00:00
J-P Nurmi
1ffc6ba402 macOS: fix menu positioning on high-DPI
The target position is passed in physical native pixels, so call
QPlatformScreen::availableGeometry() and QPlatformWindow::mapToGlobal()
instead of QScreen::availableSize() and QWindow::mapToGlobal(). The
latter two operate on logical pixels.

Task-number: QTBUG-55251
Change-Id: I281f47baee727bc0f4738fd6d6cdf12c9f462b0f
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-02-05 21:35:15 +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
J-P Nurmi
57f4521c99 Fix QXcbWindow::mapFrom/ToGlobal()
Call the base class implementations to avoid returning an unmapped
values for non-embedded windows.

Task-number: QTBUG-55251
Change-Id: Ib05fd530498dd4d72d3d4ef37caf4e2f0ebcd2e4
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2018-02-05 18:21:21 +00:00
J-P Nurmi
756ebcd93a QGtk3Menu::showPopup(): fix off by one error in the y-coordinate
QRect::bottom() != QRect::y() + QRect::height()

Change-Id: I83ae19ab588fb9651354999679f5d3c9e294a97e
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-02-05 18:21:13 +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
Tor Arne Vestbø
28cf5ae000 macOS: Share view update code between layered and non-layered mode
Change-Id: I8eaf0607c1ede18ed20180fd43cc93744c99962d
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2018-02-05 16:27:59 +00:00
Tor Arne Vestbø
35f6f530bf iOS: Simplify logging of QUIView/QIOSWindow
Automatically printing the relationship between the view, platform
window, and window, makes it easier to track each object across
events.

Change-Id: I9fbfaa5c304849ed99dba3b5cd8e7449105d0307
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-02-05 16:27:57 +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
Andre Hartmann
6197df32ec QString: Add whitespace handling note to number conversion functions
Copied from QLocale::toFloat and companions.

Change-Id: Ic3a13a87cfc1ce34de9dd7d7e7b303ef103c384a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-02-05 08:55:13 +00:00
Andre Hartmann
9a74cbf473 QString: Wrap extra-long comment line
Change-Id: I77c95e99fd23eb914d7e86ee003d7f487c57f0f0
Reviewed-by: Martin Smith <martin.smith@qt.io>
2018-02-05 08:55:07 +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
Liang Qi
599b708f12 Merge "Merge remote-tracking branch 'origin/5.9' into 5.10" into refs/staging/5.10 2018-02-04 14:30:16 +00:00
Thiago Macieira
403343039d Suppress GCC 8 warning about realloc() non-trivially-copyable types
But they are movable.

qxmlstream_p.h:654:32: error: ‘void* realloc(void*, size_t)’ moving an object of non-trivially copyable type ‘struct QXmlStreamPrivateTagStack::Tag’; use ‘new’ and ‘delete’ instead [-Werror=class-memaccess]

Change-Id: I41d006aac5bc48529845fffd150e8115eb852034
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-02-04 08:34:03 +00:00
Thiago Macieira
c26c5b7d0d Silence GCC 8 warning on memcpy of movable types
This is similar to commit 342bb5b03a.

From GCC 8:

qarraydataops.h:84:17: error: ‘void* memcpy(void*, const void*, size_t)’ writing to an object of type ‘class QStringRef’ with no trivial copy-assignment; use copy-assignment or copy-initialization instead [-Werror=class-memaccess]
[etc.]

Change-Id: I41d006aac5bc48529845fffd150e817e64973bec
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-02-04 08:33:59 +00:00
Thiago Macieira
1514b4e853 Silence GCC 8 warning on memcpy of class Value to to class offset
From GCC 8:

error: ‘void* memcpy(void*, const void*, size_t)’ copying an object of type ‘QJsonPrivate::offset’ {aka ‘class QSpecialInteger<QLittleEndianStorageType<unsigned int> >’} with ‘private’ member ‘QSpecialInteger<QLittleEndianStorageType<unsigned int> >::val’
from an array of ‘const value_type’ {aka ‘const class QJsonPrivate::Value’}; use assignment or copy-initialization instead [-Werror=class-memaccess]

Both types are standard layout and have the same initial sequence (one uint
member), so this is a valid copy. The only difference between the two is that
QSpecialInteger has a private member, whereas in the bitfield it's public.

Change-Id: I41d006aac5bc48529845fffd150e80585fd24db7
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-02-04 08:33:56 +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