Commit Graph

38727 Commits

Author SHA1 Message Date
Topi Reinio
35ebb614bd Doc: Fix typos in QDateTime docs
Change-Id: Ibff4555cbd1e980333acd88c697021b4a74998a8
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-06-07 20:36:55 +02:00
Eirik Aavitsland
a4f79313f0 Fix: QTextDocument::find backward search crossing paragraphs
If the start position of a backward string search was the at the start
of a paragraph, the code would start searching at an illegal position
(at the eol character) in the preceding paragraph. That caused
that whole paragraph to be skipped, so any matches there
would not be found. Fix by making sure the search starts at legal
position.

Fixes: QTBUG-48035
Change-Id: Id6c0159b6613ec75ec617a0a57096ceef2b4cbd0
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2019-06-04 07:14:03 +00:00
Shawn Rutledge
7fc67e09f3 doc: Correct several QEnterEvent accessors
It's cursor position not widget position, pos() is relative
to the widget, and 3 of these accessors return QPointF.
Amends e6ddae07e1.

Task-number: QTBUG-36985
Change-Id: Ide437f7496824f8cdd0d03fa38ad7b573e30feaa
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2019-06-06 14:49:51 +02:00
Friedemann Kleint
7ff7d73f6a moc: Fix indentation of generated code
Clang warns about misleading indentation when parsing moc-generated
files. Amends 4ed39bed4e.

Change-Id: Ie8c5b38a28316cb2541304eb712ad2ca60be0e42
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2019-06-07 11:43:28 +02:00
Friedemann Kleint
464b5278fa Brush up tst_QCompleter
- Use nullptr
- Fix warning about inconsistent parameter naming in CsvCompleter::pathFromIndex()
- Fix C-style casts
- Use range-based for
- Use correct static invocation
- Set a title on shown windows to make it possible to identify
  slow tests
- Use initializer lists
- Fix the class declarations, use override, member initializations
- Remove goto, streamline code
- Use auto to avoid repeating the type
- Introduce std::unique_ptr

Task-number: QTBUG-38014
Change-Id: Ia8ecd799064d630648b385b606848d7474c51363
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2019-06-07 12:34:47 +02:00
Tor Arne Vestbø
2dfe0f8f68 macOS: Introduce QMacKeyValueObserver and use in theme and style
Change-Id: I2d21c883628933543ae5a66b694ff7503119bc4a
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-06-07 11:44:57 +02:00
Joerg Bornemann
99636127d1 Fix prefix_build check for top-level builds
The checks whether we have a Qt prefix build were broken for
top-level builds. Non-prefix top-level builds were incorrectly
detected as prefix builds.

For top-level non-prefix builds QT_HOST_DATA/QT_INSTALL_PREFIX becomes
something like "~/my/build/dir/qtbase" but .qmake.cache (and
.qmake.super) is/are created in "~/my/build/dir".

This patch extends the prefix_build check by probing for the existence
of .qmake.super, which only exists for top-level builds. Also, we add
qt_prefix_build_check.prf as central place for determining whether we
have a prefix build to make sure that qt_configure.prf and
qt_build_config.prf use the same logic.

Fixes: QTBUG-76185
Change-Id: I2b76fe26013496aaf2dac96ea711b06a69550a29
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2019-06-05 13:02:22 +02:00
Allan Sandfeld Jensen
d212c179db Change default of optimize-debug to off for developer-builds
Backtraces with optimize-debug are less useful due to scoped variables
no longer alive, and some gcc bugs with inlining.

Fixes: QTBUG-75514
Change-Id: I6d62441047daee8f7079d1538dfc92015dd7ea63
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2019-05-23 12:44:07 +02:00
Volker Hilsheimer
804a18ef0e Document that QHeaderView rendered with themed style might ignore roles
While this is generally true for widgets, QHeaderView's documentation
about how appearance related data roles are respected can be misleading.

Fixes: QTBUG-31804
Change-Id: I93c6562e59ecf771d938d282723169202ac15bc2
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2019-06-05 15:31:42 +02:00
Damien Caliste
4ebac33644 Detect system time zone from linked symlinks
[ChangeLog][QtCore][QTimeZone] The IANA timezone database backend
now properly follows symlinks even when they point to variable
locations like /run or /var (useful when /etc is mounted read-only).

Fixes: QTBUG-75936
Fixes: QTBUG-75527
Change-Id: If0dc2bfa20659e76c3bd062c75597a9ad01ad954
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-06-04 13:27:02 +02:00
Kai Koehne
5f30fd6426 qmake: Cleanup
Fix clang warnings that are disabled in the default build.

Change-Id: I4e773a24884db94acdc6c295d3f66da07cd8a5bd
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
2019-06-05 10:59:43 +02:00
Friedemann Kleint
761f88f8ba Diaglib: Improve formatting of DebugProxyStyle
The class used the default debug operator for QObject, which outputs
the object's address. This makes it hard to compare the log output.

Make the existing QObject formatting helper from the EventFilter
publicly usable by providing a helper with a stream operator.

Change-Id: Ifab83e23cc792a5efe231fd9ae84e0439ab0d609
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2019-06-04 08:02:12 +02:00
Joerg Bornemann
224a60989e Fix determination of source and build roots
QMake searches a .qmake.conf file to determine the source root of the
project, and a .qmake.cache to determine the build root.

If a .qmake.conf exists but no .qmake.cache in the build directory is
found, a build root would be set that is only valid if the build
directory is at the same depth as the source directory.

The invalid build root resulted in the creation of .qmake.cache files
at "interesting" locations (e.g. high up in the directory tree), a
potential cause for even more interesting build failures in the
future.

Fix this by splitting up the loop that determined build and source
root. Both are now determined independently of each other.

Fixes: QTBUG-76140
Change-Id: Ib5c922b87879fcf2f076298a69abcdbc4e8587b3
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-06-04 21:19:37 +02:00
Edward Welbourne
ff4ef79e0d Overhaul Q(Date|Time)+ documentation
Various things were out of date, misdescribed or just plain wrong.

Change-Id: I11b7bd419604067fce2577a42882ebf126629016
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2019-05-29 15:54:01 +02:00
Jan Arve Sæther
8c7589d992 Do not strip off the fragment and query in the qfileselector
This is needed for cases where we use e.g. "file:///test.html?query#Fragment".
The fragment and query were already preserved for the qrc scheme. This
fixes it for the file scheme.

Change-Id: I5713e4a25372fdd55ac255b1c6228b4dea419244
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2019-06-03 12:29:49 +00:00
Mikhail Svetkin
6f40331058 macOS: Fix QMouseEvent::button
cocoaButton2QtButton(NSEvent *event) did not handle NSEventTypeLeftMouseDragged,
NSEventTypeRightMouseDragged, NSEventTypeOtherMouseDragged.


Task-number: QTBUG-74763
Change-Id: I9f48230599f16400b49edbff392f712eb1fff782
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-05-28 07:57:22 +00:00
Tasuku Suzuki
9d9b944b44 Fix configure comment in/for -device linux-rasp-pi3-vc4-g++
The name was renamed in 8e445f8434

Change-Id: I5a74b65309cf5dc64621db281fad3a62a2f026b1
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2019-06-04 17:22:35 +09:00
Tor Arne Vestbø
b53994de5f macOS: Use QMacNotificationObserver over manual notification handling
This also fixes a bug where we were implicitly capturing this inside
the block, which meant that we would crash if the theme was recreated.
The capture is now tied to the lifetime of QCocoaTheme.

Change-Id: I37df8e6c0b33bf41e76d66be3cf29576041a7546
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2019-05-29 17:11:40 +02:00
Friedemann Kleint
15d73a9f47 Qt Widgets: Make tests pass on High DPI screens and scaling
Use the comparison helpers to do fuzzy checking of geometries.

Change-Id: I00f4403f3bca2e8a3996e938a85ba799e083058c
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2019-05-29 12:52:51 +02:00
Mikhail Svetkin
9a47768b46 macOS: Fix reported mouse event buttons
Use m_buttons instead of currentlyPressedMouseButtons. The latter returns
the state of devices combined with synthesized events at the moment,
independent of which events have been delivered via the event stream,
so this method is not suitable for tracking.

Task-number: QTBUG-74057
Task-number: QTBUG-74121
Change-Id: Iabf99ada6c3d25a995c9ddf895059b70833a9051
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2019-06-03 05:08:44 +00:00
Joerg Bornemann
4da47d0fba Make sure .pc, .prl and .la files are created for header_only modules
Those modules are TEMPLATE=aux, so they weren't triggering the file creation
here.

To make this work properly we have to:
  - check for TEMPLATE aux in the right places
  - add a dummy target to INSTALLS to actually trigger the creation
  - initialize PRL_TARGET for aux templates

Fixes: QTBUG-75901
Started-by: Thiago Macieira <thiago.macieira@intel.com>
Change-Id: Idce141629dd34287808bfffd159f92ac28c6c8b1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-06-03 15:06:29 +02:00
Joerg Bornemann
c64f8ca232 Do not write 'Libs:' into .pc files if TEMPLATE is not 'lib'
Especially for header modules we don't want a 'Libs:' entry in their
.pc file.

Task-number: QTBUG-75901
Change-Id: I39037d3132e39dd360532e1425f794ebec28e0bd
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-06-03 14:58:39 +02:00
Joerg Bornemann
60136b1a84 Fix meta file replacements if matches are empty
QMake code like
    rplc.match =
    QMAKE_PRL_INSTALL_REPLACE += rplc
led to the generation of invalid sed calls in the Makefile.

It is already actively checked for empty matches, but if *all* matches
are empty, the sed call looks like
    sed foo > bar
which is invalid.

Task-number: QTBUG-75901
Change-Id: I173ed99826414dcf06253a15a247f7d067ee3977
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-06-03 14:58:39 +02:00
Liang Qi
7029ecade9 cmake: correct version dependency for qt5_add_big_resources
qt5_add_big_resources is only available if using CMake 3.9 and later.

This amends cdccd0222b.

Task-number: QTBUG-55680
Task-number: QTBUG-75806
Change-Id: Ibba7af6ee7edfb226368937d543b7ec5cc93eb16
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2019-05-20 12:49:37 +02:00
Joerg Bornemann
68866b1a7b Fix QMAKE_EXTRA_COMPILER names in VS projects
Use the whole value of 'name', not just the first element, and also
replace variables like ${QMAKE_FILE_IN}.

This fixes the file_copies feature (COPIES) for Visual Studio
projects, because for every entry in COPIES an extra compiler is
created with a name 'COPY ${QMAKE_FILE_IN}'. Before this patch the
name and the generated file filter would be just 'COPY'. However,
duplicate filters are being skipped by the VS project generator. All
but the first COPIES entry was ignored.

Fixes: QTBUG-76010
Change-Id: Icaa5d2cb8d88ae3ef8ce86220198bca1b9e673f5
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2019-05-31 10:48:35 +02:00
Friedemann Kleint
67c569add0 Make tst_qwidget pass on High-DPI screens (Windows)
- Move the fuzz check introduced by
  6309062722 to a shared header for
  reuse. Use it in in more places to account for rounding errors
  introduced by odd window frame sizes when scaling is active.

- Use the test widget size to ensure windows do not violate the
  minimum decorated window size on Windows when scaling is inactive
  on large monitors.

Task-number: QTBUG-46615
Change-Id: Icf803a4bc2c275eadb8f98e60b08e39b2ebebedd
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2019-06-03 10:41:08 +02:00
Joerg Bornemann
085d1335d1 Warn about invalid SUBDIRS content
Invalid SUBDIRS values like

SUBDIRS += foo \
           bar \ \
           baz

would produce a Makefile with a sub-- target that will call the make
on the same Makefile again recursively, letting make run forever.

Ignore values like this and print a warning message.

Fixes: QTBUG-76068
Change-Id: I6ca0f8c8238249f1be02d8c311b4c148fd80e707
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2019-05-28 13:40:42 +02:00
Friedemann Kleint
90c683e41c Q(Plain)TextEdit: Observe color hints from style sheet depending on focus state
Ask the style sheet style to adapt the palette in
WidgetTextControl::getPaintContext() as is done for QLineEdit.
Use the palette color in QPlainTextEdit.

Change-Id: I67758716b66feaeac8c2433c2a4d3744cd0d5327
Fixes: QTBUG-72100
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2019-05-24 13:06:20 +02:00
Andy Shaw
81b33a8252 Fusion: Fill the rect with base brush when drawing the combobox frame
Instead of doing this directly inside the PE_FrameLineEdit as this can
be used directly when a stylesheet is set the rect of the lineedit used
in the combobox in fusion style is filled directly with the base brush.
This ensures it still renders the background correctly when using fusion
style, but enables stylesheets to work as it will not override that if
the background is set in a stylesheet for a combobox.

Fixes: QTBUG-75816
Change-Id: I50a0600b500088ebcf1d70a02f9c74c6040d34d9
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2019-05-27 14:35:18 +02:00
Laszlo Agocs
364240ed11 macOS: Enable VK_MVK_macos_surface on the instance
Reports say some systems get "Failed to find vkCreateMacOSSurfaceMVK"
even though MoltenVK and the corresponding extensionare there. While not
reproducable on single GPU Intel systems, it could be that not enabling
the extension on the Vulkan instance is causing this. Not opting in to
the extension is incorrect in theory anyway. So fix it in cocoa as well,
similarly to how other platform plugins do this already.

Task-number: QTBUG-76117
Change-Id: I75220f3582a700ce0037003086123d3d38524648
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Mike Krus <mike.krus@kdab.com>
2019-05-30 19:11:01 +02:00
Morten Johan Sørvig
1eac947ce2 Work around crash where a destroyed window becomes focus_window
Clear QGuiApplication::focus_window (again) in the
QWindow destructor.

Task-number: QTBUG-75326
Change-Id: Ief00b6adfb267fcc7e3881fd728e12df07fc1094
Reviewed-by: Christian Andersen <csandersen3@gmail.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-05-22 12:08:55 +00:00
Tor Arne Vestbø
a67b25067e Rename QMacScopedObserver to the more fittingly QMacNotificationObserver
Change-Id: I1d8280fe88871572a3a27e612de49717b3b9ef77
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-05-29 17:11:40 +02:00
Edward Welbourne
c3571d2922 Correct qfloat16's 1/inf == 0 test
It should have been qfloat16(1)/qfloat16(infinity) in any case.
Sadly, that behaves no better than qfloat16(1.f/qfloat16(infinity)),
which was promoting the infinity back to float.  So retain the check
for over-optimization (but make the comment more accurate).

This is a follow-up to d441f6bba7.

Change-Id: Iec4afe4b04081b0ebfbf98058da606dc3ade07f4
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-05-27 11:52:22 +02:00
Friedemann Kleint
4df554c652 Windows QPA: Fix clang warnings about narrowing conversions
Change-Id: Iba173b45fb77918694fc2c7506885fdeef9f6064
Reviewed-by: André de la Rocha <andre.rocha@qt.io>
2019-05-29 12:55:21 +02:00
Andre de la Rocha
c150c7a566 Windows QPA: Optimize code that gets window under pointer
It's not necessary to call QWindowsScreen::windowAt() for every mouse
message received, but only when the mouse is captured, like it's done
in the legacy mouse handler.

Change-Id: Ib1035921291d22a32dfa3a619815a3f4ff9b3622
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2019-05-28 18:26:51 +02:00
Friedemann Kleint
0f417efe0f Windows QPA: Fix QGuiApplication::topLevelAt() with screen recorder applications
Special applications like screen recorders can create special, invisible
windows which are detected by the ChildWindowFromPointEx() as used in
QWindowsContext::findPlatformWindowAt(). Fall back to WindowFromPoint()
which skips those in case nothing is found.

Fixes: QTBUG-40815
Change-Id: Idb5253c412fb4522c844edf5eadedc6e0fad3979
Reviewed-by: André de la Rocha <andre.rocha@qt.io>
2019-05-28 14:32:01 +02:00
Joerg Bornemann
978987981a Automatically sysrootify $$[FOO/get] properties
If automatic sysrootification is in effect (SysrootifyPrefix=true in
qt.conf) then the qmake property variants $$[FOO] and $$[FOO/get] must
be sysrootified. The latter was never sysrootified.

All other variants (src, dev, raw) are supposed to be without sysroot.

Flesh out a sysrootify function and readabilitify the code a bit while
we're at it.

Fixes: QTBUG-71673
Change-Id: Ifcbce8c035b9da447da9d6937edd5a4aa84573ba
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2019-05-28 12:33:22 +02:00
Giuseppe D'Angelo
b9f96cacc9 QRegExp: remove an out of bounds access into QString
... spotted with the brand-new checks for that in QCharRef.

The rx[i] == ~~~ check is clearly wrong, as rx is the regexp
we're building and `i` was not supposed to index into it.

The intended meaning was wc[i] == ~~~, testing if we were seeing
the closing bracket of a character set. We need to check for
that immediately for dealing with the special syntax of []...] where
the ] belongs to the character set (it can't be the closing one
as character sets cannot be empty).

Fix and add a regression test. Bonus: this code was almost
unchanged since 2009.

Change-Id: I958cd87fc25558e9d202d18b3dd4a35d0db16d8d
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: hjk <hjk@qt.io>
2019-05-27 17:33:30 +00:00
Eirik Aavitsland
c04bd30de0 Guard against numerical overflow when processing QPainterPaths
Many operations on and with QPainterPaths do calculations on the path
coordinates, e.g. computing the distance between points, which may cause
numerical overflow for extreme coordinate values. This patch
introduces a limit on the coordinate values and extends the previous
check against nan/inf coordinates to also check against out of range
coordinates.

Fixes: QTBUG-75574
Change-Id: I3a2fa88bfc6a9f19934c43d3dbbfb41855c78107
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2019-05-15 13:50:55 +02:00
Timur Pocheptsov
ebddd02896 QMacStyle - fix the separator's color in the Dark theme
It's too dark as it is now. Since there is no similar UI element
in AppKit, we take the same color as the toolbar's handle has (looks
OK-eysh with 'Dark' and there is no reason to have the separator with
a color different from the bar handle, both elements essentialy are
lines of dots).

Fixes: QTBUG-72759
Change-Id: I28277f80174a1c4c0af17961aba8ed6135aa3189
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2019-05-24 14:42:17 +02:00
Ryan Chu
cc4c0b43a5 QDataStream: Fix inconsistent results of iostream with QPalette objects
The value of NColorRoles got changed since 5.11. It introduced one more
role called "PlaceholderText" in the ColorRole enumeration.

When using QDataStream (5.12) to read QPalette objects from a file
written by 5.9 (<5.11), the processing results are inconsistent.

Fixes: QTBUG-74885
Change-Id: I14d57f9603a26e5890b4fd57c7e464c5b38eb3f2
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2019-05-20 22:33:33 +02:00
Edward Welbourne
14aa1f7d6f Use appropriate encoding rather than UTF-8 when reading from a pipe
The qmake code to read output from dependency-generation was adding
QByteArray values to a QString, thereby tacitly converting from UTF-8;
this is misguided. Hopefully, the command emits its output in the same
local 8-bit encoding that QString knows to convert from.

Simplified needlessly verbose loops (that violated Qt coding style) in
the process.

Fixes: QTBUG-75904
Change-Id: I27cf81ffcb63ebc999b8e4fc57abdb9a68c4d2b3
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2019-05-24 16:58:04 +02:00
Kai Koehne
0c9b449aa4 Doc: Clarify state of Qt Xml
The state of the module is done, not deprecated, so we shouldn't
recommend users to move away from it in all cases. There's also
no direct replacement for the DOM API.

Fixes: QTBUG-70629
Change-Id: Ifaff9757234bd68a411a3da1403c57bbbcb94693
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
2019-05-24 11:54:55 +02:00
Thorbjørn Lund Martsum
48f7f65dc3 QMenu size fix - Mark items dirty on screen change
It seems like an optimization on the itemsDirty flag
caused a bug to be re-introduced. When a popup is shown
on a new screen, the itemsDirty must however be set to
ensure that new correct sizes are calculated.

Task-number: QTBUG-59794
Change-Id: Ifb5c233b1f9d4d38bd0cd7a9a71cc32ad3212f8c
Reviewed-by: Morten Kristensen <msk@nullpointer.dk>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
2019-05-22 11:22:26 +02:00
Andrew den Exter
d661a22ae2 Write an anchor-type attribute when embedding images in an ODF document
Without this some readers will fail to display the image or position
the image at the start of a paragraph rather than inline.

Change-Id: I2b9257e3193e5e68eb20112017a0c23be1d06cb0
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-05-13 13:03:07 +10:00
Andrew den Exter
345f86a2d8 Avoid re-encoding embedded images when writing an ODF file
If an embedded image is already encodeded as an png or jpg write the
data as is instead of decoding to a QImage and re-encoding as a new
image.

Change-Id: I479ae1fddbf59900a500497dd1bdf7449c21f273
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-05-13 13:03:01 +10:00
Alexander Volkov
795af729d3 Avoid rounding of the size in QGraphicsPixmapItem::boundingRect()
Fixes: QTBUG-75458
Change-Id: Ib240ddc0b490ae3c0348b6bfa290ad1f51b1e071
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2019-05-09 23:51:39 +03:00
Morten Johan Sørvig
3386b875dd QHighDpi: Remove fromNativePixels()/toNativePixels() overloads
Replace QWindow / QScreen / QPlatformScreen overloads with template
functions that take a generic context argument.

The API now no longer supports implicit conversions from
QPointer<QWindow> to QWindow *, add explicit data()
call to usage in qxcbdrag.cpp.

Change-Id: I63d7f16f6356873280df58f4e7c924bf0b0eca5b
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2019-05-22 13:37:39 +02:00
Friedemann Kleint
ea9469f2b6 QCompleter: Fix completion on QFileSystemModel
Fix the condition introduced by that determines whether
a completion is started on signal QFileSystemModel::directoryLoaded()
(introduced by  416ec00e7c859a844a5bcb24c7a31147aed974c / Qt 4).
Observe case sensitivity and the native separator and return true for
root directories.

Task-number: QTBUG-38014
Task-number: QTBUG-14292
Change-Id: Ie425c04d2df256248e84250ba777793a8106a738
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2019-05-21 11:26:22 +02:00
Sergio Martins
837c388dd3 dockwidgets: Unbreak moving floating dock widgets with custom titlebar
f1033567aa improved resize of windows with custom titlebar by adding
more margin, but the check was too tight.

d2d6c6f781 tried to fix the regression, but not totally

The mode is only set *after* the mouse press. It will always
be NoWhere the first time, so that check will always discard
the mouse press, making moving the window always fail the first time.

Also, if the rect+range contains the press, then surely the mode
won't be nowhere once set.

There's still room for optimization, like bailing out early it was
the right button instead of the left button, but that's out of scope
for this bug fix, and also not worth for 5.12 branch.

To reproduce the bug, simply:
- Run examples/widgets/mainwindows/mainwindow
- Click the red button of the blue dock widget, to make it float
- Drag the title bar (not too slow).

Fixes: QTBUG-66454
Change-Id: I0eebfb932dab95267ebadccd757de11a8bfe419d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Reviewed-by: Nathan Collins <nathan.collins@kdab.com>
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
2019-05-21 22:49:33 +01:00