qgrayraster_p.h, qgrayraster.cpp contain code from Freetype which
unfortunately cannot be excluded by e.g. '-no-freetype'. Document this
code therefore separately.
Change-Id: I20d79e984013b2aec874774ddc765b1dc57ebe0e
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
If qreal is float, then android-clang compilation was breaking here
Change-Id: Ieccc357ecbbea5cbb22a5808dd0791795240a985
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Recontribute QUrl::fromUserInput under the corporate license agreement;
i.e. remove the separate BSD license from the code.
Change-Id: I1e0b4aab921fb20d2fd558fe732cea596ecbc9ca
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
The menu scrollers and the tear off items are painted in the layer
of QMenu. In a case that QMenu contains QWidgetAction items, the items
are painted under QWidgetAction items. They are visually hidden unless
QWidgetAction items' background is transparent. The tear off doesn't work
since QWidgetAction item on top of it grabs mouse events. To fix the issue,
add two child widgets in QMenu, paint the scroll up and the tear off items
in one child widget and the scroll down item in the other one. Both child
widgets are painted on top of overlapping sibling menu item widgets.
Change-Id: I7eaef21b667b388fbb78b60664f4a4bd91215309
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
The QAction items overlap with the menu scrollers. The patch is to
set correct clip regions for QAction items in order not to overlap
with the scroll arrows.
Change-Id: Ie724bd2be522daf5935fb489523b5d5f32bb7f71
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
... and use that variable in qt_configure.prf to find the pkg-config we
detected during qtbase configuration.
This is required for modules outside of qtbase being able to use
pkg-config to configure external libraries.
We do not use the PKG_CONFIG variable any more, as that interferes with
the $$pkgConfigExecutable() function, which some Qt modules still use.
Change-Id: I8886a266207e04301009fe8207c16b02c5455b2f
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
According to the latest XDG spec, FontsLocation should point to
XDG_DATA_DIR/fonts, not ~/.fonts.
Task-number: QTBUG-55507
Change-Id: Ia62ffe172abbb93d5ce7fd58bdf038ff13954f1b
Reviewed-by: David Faure <david.faure@kdab.com>
replace explicit pkg-config uses with the results of configure tests,
for consistency.
Change-Id: I3587db6085798ea7a49f8871fc6838eb687a6391
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
The current implementation of QMacPasteboardMimeUnicodeText
didn't contain any logic to handle unicode text with a byte
order mark (BOM). According to the
docs (*), 'public.utf16-plain-text' can have an optional BOM.
Because of that, Qt would fail encoding UTF-16 text from the
pasteboard if it had a BOM.
Additionally, perhaps because of a bug in iOS 10, UTF-16 text
placed on the pasteboard by Qt ends up being encoded wrong by
native apps, unless the text has a BOM.
Rather than hard-coding UTF-16 encoding/decoding in qmacmime, we
now leave it to QTextCodec. QTextCodec will add a BOM by
default, and can handle decoding of UTF-16 both with, and
without, a BOM.
*: https://developer.apple.com/library/content/documentation/Miscellaneous/Reference/UTIRef/Articles/System-DeclaredUniformTypeIdentifiers.html
Task-number: QTBUG-56229
Change-Id: I3a08deb0262350c67e5622cf23eb3c3a4907ec39
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
In 5e3e34731b, a default implementation
of QPlatformFontDatabase::fallbacksForFamily() was added, but this
implementation included only the fonts with a matching style in
the returned list.
The result of this was that if a font face for a specific language
did not have e.g. an italic font, then we would show missing glyph
boxes instead. On Android, it would be impossible to show any
italic text in Chinese, Japanese, Hebrew, or Arabic.
[ChangeLog][QtGui][Text] Fixed synthesized oblique for non-latin
text on platforms using the basic font database, such as Android.
Task-number: QTBUG-51223
Change-Id: I494d8ad87292b65d4380a2e600c1c0dc7fc8f937
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
If the application's Info.plist contains the key
'NSPhotoLibraryUsageDescription', we know that we can safely link in
qiosnsphotolibrarysupport without violating AppStore requirements.
This is a simple feature that doesn't introduce additional qmake
API for doing app deployment with optional iOS QPA plugins.
[ChangeLog][iOS] Starting from iOS 10, Apple requires all apps
that need access to photos to have the key
'NSPhotoLibraryUsageDescription' in the Info.plist.
Therefore, to get the same support in Qt (when, e.g., using
a file dialog), the Info.plist assigned to QMAKE_INFO_PLIST
will need this key as well.
Change-Id: I7a93afe24b589cad96d5a1d9e2a155ad1671178a
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Starting from iOS 10, apps that tries to access photos on the device
need to specify the reason for this up front by adding the key
'NSPhotoLibraryUsageDescription' into Info.plist. If the key is
missing, the app will be rejected from AppStore.
This causes problems for the iOS plugin as it stands since parts of it
already tries to access photos, e.g to show an image picker dialog
if a file dialog is set to open QStandardPaths::PicturesLocation.
This means that currently, all apps written with Qt will be rejected
from AppStore unless the developer adds this key, whether he tries
to access photos or not.
To solve this, we choose to split the plugin into two parts, one
that contains the core functionality, and one that contains
optional support. The latter will need to be enabled explicit
by the developer in the pro file, or in this case, indirectly
by adding the right key to the Info.plist.
This patch refactors the code in the plugin that gives access
to photos into a separate optional plugin called 'nsphotolibrarysupport'.
Change-Id: Ic4351eb0bbfffdf840fd88cd00bb29a25907798f
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
QT_FOR_PRIVATE should end up in QT_PRIVATE instead of QT after being
recorded in the private module pri. otherwise it's added to LIBS and
becomes part of the library's (and thus also the public module's) link
interface. after the fix, only the (semantically redundant) resolution
of qt module dependencies will add the private deps, and only when the
private module is explicitly requested.
Change-Id: I3378457013cad5fa611a22ccbe184e6aa675a2ef
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
On a discussion in the Development mailing list it became clear that
qFuzzyCompare does not work for NaN or infinity values. That was not
mentioned in the method documentation though. This patch fixes that
hiatus. It also clarifies how to deal with the comparing to 0.0
limitation.
Change-Id: I8b6d54cc0c1136e79b0d7be1a62bc9ed394d2575
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
Reviewed-by: Martin Smith <martin.smith@theqtcompany.com>
The origin of the class predate git history, but it has been apparently
unused in Qt since Qt 4.5 times. Removing this relieves us from
documenting its custom license.
Change-Id: Ie91be5f0b2fbaf10dc212c44ebd37e6b9d781592
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Allows the usage of _BitScanForward, _BitScanReverse, __popcnt and
__popcnt16 functions.
Fixes part of the build with MSVC15.
Change-Id: I5ec37184209196ad19beddb4d6a36f9a9fd3b315
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Apparently, the CI can run something over 1000x slower than on my
machine. We're getting over 100 ms delays in operations that shouldn't
have taken more than half a millisecond. The last report was of 136%
over budget, so I multiplied the resolution by 4.
Change-Id: I9093948278414644a416fffd1474406967b2a6ee
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
syncqt says:
QtGui: WARNING: /Users/tjmaciei/src/qt/qt5/qtbase/src/gui/kernel/qevent.h includes qiodevice.h when it should include QtCore/qiodevice.h
Change-Id: I9093948278414644a416fffd14744fe9c6c9c5f8
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
The file descriptor has been closed and this test is checking if we get
EBADF.
Change-Id: I33dc971f005a4848bb8ffffd1478eaffd99aa2e9
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
Though there should have been no ill-effects, they happen.
Task-number: QTBUG-52605
Change-Id: I9093948278414644a416fffd147444078edc3183
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
this is a bit easier on the backwards compat code in qt creator, which
needs to merge and then de-duplicate the lists itself.
Change-Id: I79f9319c26af541f5efa85700878e7ddbd00e2b7
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
since 9ff1310af, the variable's contents are simply added to SOURCES,
and the variable is not cleared. and qmake does not de-duplicate ...
Task-number: QTBUG-53905
Change-Id: I3e551d21cbbd2d0cbfbf7aa7efaa5babac112f9d
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
QVector was used as just RAII for local array. It's inefficient usage
of CoW type. So use QVarLengthArray instead.
Change-Id: I494ecc49af9049569a65e258581137bad3ce7dc7
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Then we need to check if the current active (or focused)
window has any menubar associated. In case there isn't,
and the menubar has no window associated, then we should
update immediately.
The previous condition is still valid.
Change-Id: I4532ccc87354d91c76b53f5433dc3944b9e29584
Task-number: QTBUG-56275
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
When a QDockWidget was floating on macOS then it would force the size of
various widgets, such as buttons, comboboxes, to be the smallest needed
rather than the size they had when it was docked.
Task-number: QTBUG-7460
Task-number: QTBUG-52354
Change-Id: Id348180934f113f3a9a9ce5622a9af03eed04108
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
When the mouse is clicked on the widget in a window while a popup is
visible then it should raise just the window and not the widget inside it.
If the widget is in a stacked layout then calling raise() on it can cause
it to appear on top so avoid this by calling raise() directly on the
window.
Task-number: QTBUG-52670
Change-Id: Idd287c6cc7038c57e14e92f4a3e1c50985925684
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
This will be done by all POSIX APIs for strings coming in that way, but
because other code (like NSWhateverViews) will most likely return
decomposed form, we make sure that those are in composed form too.
Task-number: QTBUG-55896
Change-Id: I065e11cee6b59706d4346ed20d4b59b9b95163b8
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Since 40ebda3efb, bitmap fonts are detected
as smoothly scalable on Windows. While the fontsAlwaysScalable() does say
whether or not the font engine can rasterize the fonts at any size, it does
not determine whether or not the result is "attractive" as the
documentation for isSmoothlyScalable() says.
Only outline fonts are smoothly scalable, and this fact is used in Qt Quick
to determine whether we can use the distance field renderer for the font or
if we have to fall back to the native renderer. The consequence was that
the fonts were no longer usable in Qt Quick.
We also need to revert the optimization for isBitmapScalable() since there
a font that is smoothly scalable should not be identified as bitmap
scalable (basically this means: Font is not smoothly scalable, but it
can be scaled with bitmap scaling artifacts).
[ChangeLog][QtGui][Text] Fixed a regression where raster fonts on Windows
were detected as smoothly scalable and thus rendering with said fonts
in Qt Quick would break.
Task-number: QTBUG-56659
Change-Id: Ia7db6fee8249aca347233a488388be5c3a00c2df
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
With the current API it is not possible to reset the
index into -1. We have setClean() method, but
we are lacking setDirty(). This is needed
in case when the document has changed outside
of the editor and nothing has changed
in the undo stack history. In this case we
don't know the state of the file modified
externally so we need to mark that editor's
contents is different from the file contents
and undoing or redoing commands can't bring
the editor to the clean state.
This may also be useful to call it when
we created a new document and haven't saved
it yet or when the document was restored
from backup file.
Task-number: QTCREATORBUG-17048
Change-Id: I64e2052b3559299e0b6939831557a07a59a851b6
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Change ddef89b323 broke decorations
set using setExtraSelections(), because these decorations are
drawn with a second drawTextItem() call where numGlyphs is
set to 0. When the drawTextDecoration() call was moved into
the branches for multi/no-multi font engines, the call for
the cut-off when numGlyphs == 0 was unintentionally removed.
Task-number: QTBUG-54626
Change-Id: Ieb9fc23099a9d7daf87cc364d3fc9da128ec516d
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Also explicitly mention the GPL exception for OpenSSL.
Change-Id: I460189ee4d2dd79f8eca320ac82460e186b0f84c
Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
The conditional statement checks/allows only right/left mouse buttons
in handleMouseDraggedEvent and generates a lot of useless/misleading
warnings in case we press (for example) a middle mouse button (when
we're also moving mouse cursor, intentionally or not).
Task-number: QTBUG-54160
Task-number: QTBUG-42846
Change-Id: I5c54b6204cb90036c7d98724537f1c985b40d9cc
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
The property is 'purpose' now. Also elaborate a bit more on the feature.
Change-Id: I66aa4165044f132dff018cfd01d54b939bb64fac
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
error #68: integer conversion resulted in a change of sign
Change-Id: I33dc971f005a4848bb8ffffd1475ee53d394acf6
Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
This completely over-engineered piece of code has a hierarchy of
Operation subclasses encapsulating but three actual operations
on a QWizard.
Because these operations and their containers were all allocated
on the heap, but never deleted, asan went crazy and reported over
50 leaks (not the record so far, but a (distant) second).
Since these collections are passed through addColumn/QFETCH, too,
it's nearly impossible to track their lifetimes. So instead of
trying, delegate that to the runtime, ie. pack the Operation
objects into QSharedPointer and pass around those instead.
Change-Id: I8a0fe7a60cd30aed618667affaa030e80cf2b1ac
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Sérgio Martins <sergio.martins@kdab.com>
GCC 7 warns about implicit fall-throughs now.
Fix by adding the missing comments.
Interestingly, Coverity only found one of them, even though all three
still exist in dev, too.
Change-Id: I9f2c5e2700d5ec5234fee3a532feffe01b7c4ce3
Coverity-Id: 11156
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Sérgio Martins <sergio.martins@kdab.com>
Store QGraphicsItems that are either not added to a scene or
removed from it again and that are also not children of other
items - iow: those that were leaked, even on successful runs
of the tests, in either a QScopedPointer, or, where that'd
cause too much churn due to adding of .data() calls, back the
pointer by a stack-allocated object.
This fixes the remaining leaks reported by GCC 6.2.1's ASan on
successful runs of tests/auto/widgets/graphicsview/qgraphicsitem.
Change-Id: I61c3a1cd39b9e96e83c5d7b8cf392e0b26ecbaf0
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Sérgio Martins <sergio.martins@kdab.com>
The new takeRow() functions return a pair of pointers to
QLayoutItems and, as the name particle 'take' suggests,
releases ownership of these layout items. Which in turn
means that the caller of the function is supposed to deal
with them.
This was not done here.
To fix, write a RAII class that takes ownership of the
returned layout items, deleting them when it goes out of
scope or gets a new value assigned (only move special
member functions are implemented, making the class move
-only).
Deleting the QLayoutItems is not so easy, though:
QFormLayout has a special function for clearing the
QLayoutItems out, so it appears that just calling their
destructors is not going to fly (though I don't know off
the top of the head why that should be a problem).
Solve this, for now, by adding the layout items back into
a temporary QFormLayout for destruction.
Change-Id: If862989207b20f1e3f757c19ec9d498c4491184f
Reviewed-by: Samuel Gaist <samuel.gaist@edeltech.ch>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>