Commit Graph

35001 Commits

Author SHA1 Message Date
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
Thiago Macieira
67030038f3 Doc: explain how QXmlStream{Reader,Writer} deal with encoding in QString
QXmlStreamWriter does not: it just writes the QString inputs to the
output.

QXmlStreamReader does: it first converts the QString to UTF-8 and stores
locally. Then it tries to decode using the XML encoding header.

Change-Id: I39332e0a867442d58082fffd1503d7652cb9fbff
Reviewed-by: Martin Smith <martin.smith@qt.io>
2018-01-26 20:59:56 +00:00
Thiago Macieira
a6b697ca13 Create corelib/serialization and move existing file formats into it
This is in preparation to adding CBOR support. We don't need yet another
dir for CBOR and placing it in src/corelib/json is just wrong.

Change-Id: I9741f017961b410c910dfffd14ffb9d870340fa6
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-01-26 20:59:50 +00:00
Christian Ehrlicher
6578946245 QListWidgetItem/QStandardItem: pass role to dataChanged() signal
QAbstractItemModel::dataChanged() gained an optional role parameter
with Qt5 which was not filled within QListWidgetItem/QStandardItem
setData() functions

Task-number: QTBUG-55903
Task-number: QTBUG-63766
Change-Id: I4da9346ef8401cc8633dc4b2ea7d00451d1e3942
Reviewed-by: Luca Beldi <v.ronin@yahoo.it>
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
2018-01-26 19:58:26 +00:00
Christian Ehrlicher
52f1692b84 tst_QSplitter::replaceWidget: explicit wait for events
Wait a little bit longer for the visibility and resize events. By
directly waiting for the incoming events with QTRY_COMPARE we give
the test some more time to deliver the expected events.
Also move the check for the expectedResizeCount/expectedPaintCount
before the geometry check for better debugging.

Task-number: QTBUG-64639
Change-Id: I712e432aa8f8d35dd199adf88af3653009528b57
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-01-26 19:58:17 +00:00
Friedemann Kleint
0901d4290f QFileSystemModel/Win: Fix file system operations failing due to watchers
File system operations like renaming/removing may fail on Windows when
file system watchers are present. Add functions to
QFileSystemModelPrivate to temporarily remove the watchers prior to such
operations and to restore them in case of failure. Use them for
rename/remove (within a feature check for QFileSystemWatcher
and Q_OS_WIN).

Task-number: QTBUG-65683
Change-Id: I90142901892fbf9b1e1206a3397a95ffd3c8f010
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2018-01-26 11:36:30 +00:00
Lars Schmertmann
f55c73ede2 Introduce QSslConfiguration::backendConfig
With this change it is possible to use all supported
configurations in different backends without any new interfaces.

Change-Id: Ib233539a970681d30ae3907258730e491f8d3531
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2018-01-26 11:34:02 +00:00
Oliver Wolff
dcfb6f9d18 tst_qvarlengtharray: Add missing include
The include is needed for std::unique_ptr on winrt.

Change-Id: I72a28bd0951cc947ac65877ccc35f464c757c444
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2018-01-26 06:55:15 +00:00
Thiago Macieira
9061b7bde0 qsimd_p.h: Reorganize and simplify the x86 intrinsics #includes
All of our compilers support #include <immintrin.h>, so we don't need
the legacy code that includes the earlier versions.

Change-Id: I938b024e38bf4aac9154fffd14f80214d1d744c8
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2018-01-25 21:19:25 +00:00
Allan Sandfeld Jensen
5927acaf65 Add support for converting from std::variant
Adds inline handling of the C++17 type std::variant, so the type will
be resolved if converted into a QVariant.

Change-Id: I31809d70d7f347277389d42a3695836ec7a32d02
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-01-25 11:21:32 +00:00
Thiago Macieira
43c44d05ca Update the overflow functions to include qsizetype
Commit 29bc68cf16 added support for
unsigned and commit 5ff7a3d96e later added
support for int. This commit adds support for qsizetype, which isn't int
on 64-bit platforms.

We do this by reorganizing the code and using the generic version of
__builtin_{add,sub,mul}_overflow from GCC 5 and Clang 3.8, which ICC 18
seems to support now too on Linux. That leaves older versions of GCC and
Clang, as well as MSVC, ICC on Windows, and the GHS compiler, to use the
generic implementations, as I've removed the assembly code those
versions of GCC and Clang on x86 are now uncommon.

Note: any older version of ICC probably breaks. We only support the
latest.

Change-Id: I9e2892cb6c374e93bcb7fffd14fc11bcd5f067a7
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2018-01-24 21:13:20 +00:00
Allan Sandfeld Jensen
34e8cafa29 Document the new qfloat16 functions with the other qfloat16 functions
Change-Id: I82d3fcda44a9a49d9027d865f8ed200134d0f79e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-01-24 21:13:08 +00:00
Allan Sandfeld Jensen
933eac9645 Correct since value of QNetworkRequest::Http2DirectAttribute
It did not make it into 5.10 as far as I can tell.

Change-Id: I01f950c476f2c98f4ed40d2cafd15ecc112a3427
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-01-24 21:12:59 +00:00
Gabriel de Dietrich
1e905927f0 QMacStyle: CE_Splitter is HITheme-free
Change-Id: I96a5ba5d685d1b8f95fd11489e4e95096d0fa9a4
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2018-01-24 21:12:25 +00:00
Gabriel de Dietrich
86821094a9 QMacStyle: declare block in drawNSViewInRect() as noescape
Change-Id: Ida67a963ab62c6b974eceeaf9d386b941f357798
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2018-01-24 21:12:17 +00:00
Gabriel de Dietrich
0c974c0169 QMacStyle: PE_FrameLineEdit is HITheme-free
CT_LineEdit is as well, so that makes QLineEdit free
of HITheme APIs.

Change-Id: Ia02ce9f1003e5ae9c8bf47dab9ada030feca98ba
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2018-01-24 21:12:11 +00:00
Gabriel de Dietrich
ce60d9965e QFusionStyle: Properly draw frameless editable combo boxes
Change-Id: If0b6f15dc0a1de38edec5b360b1b8b698d6ad5b8
Task-number: QTBUG-65728
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2018-01-24 21:11:51 +00:00
Albert Astals Cid
ae3a65122f cups: Clear cups options at the start of QPrintPropertiesDialog::setupPrinter
For some reason the cups options are kept globally instead of per printer at QCupsPrintEnginePrivate
so when setting the printer options on accepting the print dialog, we first need to clear them
and then call the other functions that set them, otherwise, we will "reuse" cups option set on
the previous print.

How to reproduce:
 * Open print dialog, set some advanced option to a non default value, easiest one is print in grayscale
 * Print
 * Check it prints in grayscale
 * Open print dialog, check the advanced options are all on default values
 * Print
 * Check it incorrectly prints in grayscale

Change-Id: I59aacaf30db844ad40887d6b771f9354557852b6
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2018-01-24 21:10:09 +00:00
Friedemann Kleint
cb142954c5 XCB: Implement native window dump for diaglib
Extract a helper function to determine the window title from QXcbConnection
and add an invokable function to the native interface that dumps the window
tree similar to existing functionality on Windows.

Change-Id: I5544d69ea2b801eb16d3b5b8d64021b3e567b0d8
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2018-01-24 14:39:16 +00:00
Friedemann Kleint
b68dfa0348 QTestlib/selftests: Refactor the code printing output differences
Use qInfo() instead of qDebug() in case QDebug is turned off.

If the 'diff' tool is available, write the output to temporary files and
run diff on it. Otherwise, print the lines as was before, but onto one
stream to avoid indentation by the testlib handler.

Change-Id: Ib5a5dfb66ce481b493b85b915aa8c785ecb6b387
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-01-24 14:38:58 +00:00
Friedemann Kleint
8e3c6f165b Improve debug formatting of QInputMethodQueryEvent
Add more queries, output the query enumeration value
and output the hints as flags.

Change-Id: Icfc648a8d6e144074455ecebae1b25c3c3e1063e
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2018-01-24 14:38:56 +00:00
Yulong Bai
2a3f226e32 QMenuBar::mouseReleaseEvent: fix triggering hidden actions
While menubar actions are hidden, as menubar was too narrow
to contain them, by clicking the blank area, where the action
was supposed to place, can still trigger the action.

Task-number: QTBUG-65488
Change-Id: I6b137e0717f634ebd3371dbcc2c1ce2089688374
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-01-24 14:24:41 +00:00
Martin Smith
4ca0d76454 doc: clang-qdoc must not see certain function declarations
The macro Q_DECLARE_INTERFACE declared some qobject_cast() functions
that clang-qdoc must not see in the contexts where the macro is used.
This update prevents that from happening by ensuring that Q_CLANG_QDOC
is not defined when the macro is defined.

This update also adds a \fn command for a declaration of qobject_cast()
that was missing in the documentation. There are two versions of the
function, one with a const parameter and one with a non-const parameter,
and they both share one qdoc comment.

Change-Id: Ic74d0aaae62767cd0391474ee95ae3f4f820b06e
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-01-24 10:02:08 +00:00
Martin Smith
f28d0d8ae8 doc: Add documentation for swap() functions
The functions had been added without documentation.
This update adds the documentation.

Change-Id: Ib29e9356b26c248b5fcc9f13ecf77371fbae054a
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-01-24 10:01:58 +00:00
Martin Smith
f30d733d1c doc: Add more missing return types to \fn commands
Added missing return types to \fn commands and removed
some unnecessary \internal comments.

Change-Id: Ie6691f83a1c510134d1e83c3d98758360a67217e
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-01-24 10:01:50 +00:00
Martin Smith
f53cbd2688 doc: Fix a property declaration for clang-qdoc
The * must be adjacent to the type for clang-qdoc.

Change-Id: Icc3dedcb2f4cd426993901b8f3003c942e753c68
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-01-24 10:01:42 +00:00
Martin Smith
43fbf30efa doc: Fix many qdoc warnings, mostly missing return types
Fixed many cases of missing return types in \fn commands.
Added a fake GLxxx typedef for a GL type that wasn't there
because the GL includes weren't accessible. Also added some
fake declarations for a few functions declared in namespace
Qt in QtWidgets that must be seen by qdoc in QtCore.

Change-Id: Id82476042d0563d32fa85c4ae81a58c1298a468a
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-01-24 10:01:26 +00:00
Anton Kudryavtsev
d5aaa5635c QOffscreenIntegration: add missing override
Change-Id: I8165b44e28bd8da637e75e5b11bc429cdf2deb02
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-01-24 08:48:33 +00:00
Friedemann Kleint
43b9c9b993 QDockWidgetTitleButton: Limit icon size to dpiScaled(10) on Windows
Adding larger pixmaps to the icon caused the icon to grow.

Task-number: QTBUG-38776
Change-Id: I29148d70afa55e287f2ad254e449a98c4aa631fb
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
2018-01-24 07:04:46 +00:00
Friedemann Kleint
d58162127a QCommonStyle: Add dock title bar icons
Add larger pixmaps for the dock title bar icons; override
them by the XPM in fusion style to maintain the behavior.

Task-number: QTBUG-38776
Change-Id: I7d0e022bbf620d2aad2b6ee011b8bb9a745d7c3b
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
2018-01-24 07:04:35 +00:00
Friedemann Kleint
f61304fc77 Rename existing dock title icons to contain "macstyle"
Make way for adding dock title icons to QCommonStyle.

Task-number: QTBUG-38776
Change-Id: If1729478f55f0bce5e04399d0cca98afd2facb31
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
2018-01-24 07:04:32 +00:00