This allows creating or extending QPA plugins to provide access to QFont
and related types.
It concerns both GDI and DirectWrite engines, as well as the regular and
the freetype based font databases. The qt.qpa.fonts logging category has
been moved together into the QWindowsFontDatabase related files to avoid
depending on the qwindowscontext.h header file. Finally, QwindowsNativeImage
is following pending a future refactor with similar code in qpixmap_win.cpp
and the Windows XP style.
Change-Id: Iddff2f3d715e3ab7695e6c2052b7596a01fd6fa8
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
inputAssistantItem is not available on tvOS.
Change-Id: Icff684d6299688fbeaf40ffcb32ff9c46371b305
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
QPlatformIntegration::clipboard() is not allowed to return
null. This will lead to a crash as soon as someone tries
to access QClipboard.
Change-Id: I3c1e7cdc5103fe4424f9739a09f599d6c0af40b2
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
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>
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>
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>
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>
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>
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 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>
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>
HTTP/2 allows a server to pre-emptively send (or "push") responses (along
with corresponding "promised" requests) to a client in association with a
previous client-initiated request. This can be useful when the server
knows the client will need to have those responses available in order
to fully process the response to the original request.
Server push is semantically equivalent to a server responding to a request;
however, in this case, that request is also sent by the server, as a
PUSH_PROMISE frame.
The PUSH_PROMISE frame includes a header block that contains a complete set
of request header fields that the server attributes to the request.
After sending the PUSH_PROMISE frame, the server can begin delivering the
pushed response as a response on a server-initiated stream that uses the
promised stream identifier.
This patch:
- fixes the HPACK decompression of PUSH_PROMISE frames;
- allows a user to enable PUSH_PROMISE;
- processes and caches pushed data for promised streams;
- updates auto-test - emulates a simple PUSH_PROMISE
scenario.
Change-Id: Ic4850863a5e3895320baac3871a723fc091b4aca
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
The Qt::ISODate format strips milliseconds, so a new format is introduced
that keeps the milliseconds. A new format was chosen over fixing the
existing format due to the behavioral change of suddenly having ms
as part of Qt::ISODate.
Change-Id: If8b852daed068cce8eee9b61a7cd4576bc763443
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
QBenchmarkTimeMeasurer uses the 3rd party header cycle_p.h which may
include windows.h on Windows (32bit). This can cause clashes in qmltest,
which uses QBenchmarkMeasurerBase. Move the derived classes to a separate
header to prevent this.
Change-Id: I943a11c32a575594e6e79e722e8809b42de35092
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Prefer QStringRef methods to avoid allocations.
Use startsWith/endsWith rather than comparing substrings;
and avoid substrings where references suffice.
Use new QStringList::join(QL1S).
Change-Id: I46c44aca96578633370006d613eb0ac13f7cfc03
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Use QStringBuilder more.
Avoid quadratic behavior when prepending zeros
in a loop, prepend whole string intead.
Use const API more for CoW types.
Change-Id: If114107dc3d9876b9a7c77bc0071878cb6e00892
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
By templating on the <chrono> types and unconditionally using
duration_cast to coerce the duration into a milliseconds, we
violate a principal design rule of <chrono>, namely that non-
narrowing conversions are implicit, but narrowing conversions
need duration_cast. By accepting any duration, we allow non-
sensical code such as
QTimer::singleShot(10us, ...)
to compile, which is misleading, since it's actually a zero-
timeout timer.
Overloading a non-template with a template also has adverse
effects: it breaks qOverload().
Fix by replacing the function templates with functions that
just take std::chrono::milliseconds. This way, benign code
such as
QTimer::singleShot(10s, ...)
QTimer::singleShot(10min, ...)
QTimer::singleShot(1h, ...)
work as expected, but attempts to use sub-millisecond
resolution fails to compile / needs an explicit user-
provided duration_cast.
To allow future extension to more precise timers, forcibly
inline the functions, so they don't partake in the ABI of the
class and we can later support sub-millisecond resolution by
simply taking micro- or nano- instead of milliseconds.
Change-Id: I12c9a98bdabefcd8ec18a9eb09f87ad908d889de
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
all users of this functionality have been removed, and not emitting the
version info saves quite some noise from the generated files.
the reason why the users have been removed is that it was unreliable in
the first place: if a dependency is found without pkg-config, no version
information would be available.
the extraction of the version via pkg-config itself is kept in place, as
configure tests could be potentially optimized by utilizing it.
this reverts much of commit 48b4e0bf6f.
Change-Id: I01917f3b2a56b747d7cc54955141d20d23d0990a
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Otherwise, those tools do not compile in configurations which exclude
features that these tools require (e.g., -no-feature-textcodec).
Change-Id: I9f27257221755a35a48ae2efa9df63f1a319118e
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
At certain sizes and scales, GDI will clip away the bottom line
of pixels when rendering the MingLiU fonts. Since DirectWrite
renders it correctly, we force the use of DirectWrite in this case.
This also requires supporting classic GDI rendering in the DirectWrite
engine, to make sure the rendering still looks correct.
Note that this does not cover the corner case where the font is loaded
directly from data with QRawFont.
[ChangeLog][QtGui][Windows] Fixed rendering error when using the
MingLiU fonts at certain combinations of pixel size and scale.
Task-number: QTBUG-49346
Change-Id: Ie026c0d5932717858c4536dae077013eb6a1eafc
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Do not set WindowsContextHelpButtonHint directly in Windows QPA plugin,
but instead rely on logic in QWidgetPrivate::adjustFlags for widgets.
If WindowsContextHelpButtonHint is set, a '?' button is shown in the
windows decoration. If pressed, an EnterWhatsThisMode event is generated
that is consumed in QApplication that then calls into the QWhatsThis
singleton, which changes the mouse cursor, and informs the top-level
QWidgets about the state change etc.
For QGuiApplications though the event is not generated, which makes the
button useless by default. In addition, QWhatsThis only works with top
level QWidgets, not e.g. QQuickWindows. So for apps using QApplication
and QtQuick.Controls this means that the "What's this mode" is never
exited.
Given that the paradigm is somewhat outdated on the desktop it is unlikely
that Qt Quick Controls will implement support for What's this. Anyhow,
QWidgetPrivate::adjustFlags sets the hint for Qt::Dialogs, too,
so there's no need to set it the Windows QPA plugin.
[ChangeLog][Windows] 'What's this' button is now shown by default
only for QWidget dialogs.
Task-number: QTBUG-56239
Change-Id: I1ea3e92ade723b5865c8f2e19674413433658942
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
There's a conflict between QGtk3Menu and QDbusPlatformMenuBar. The
problem is that on Unity the type of the platform menu instance must
be different depending on whether the menu is in the global menubar or
a standalone context menu.
Since QMenu creates a platform menu instance at construction time, it
does not yet know whether it will be added into a menubar. QMenuBar
checks that the QMenu already has a platform menu instance, and passes
it to the platform menubar. As a result, a QGtk3Menu instance is passed
to QDbusPlatformMenuBar.
Currently, a standalone QMenu does not use the native platform menu
instance. Only menus that are added to a QMenuBar do. Therefore we
don't need to create the platform instance when QMenu is constructed,
but only after it is added to QMenuBar. The platform menu instance
creation is implemented in QMenuBarPrivate::getPlatformMenu(), and
QMenu::setPlatformMenu() calls syncPlatformMenu() to take care of
syncing the QMenu properties and actions to the new platform menu
instance.
The macOS-specific methods QMenu::toNSMenu() and QMenu::setAsDockMenu()
rely on the platform menu instance, and must therefore create it on
demand.
This is a hot fix for the release blocker, not a long term solution.
In the future, if standalone QMenus are made to use native platform
menu instances, the instance must be created lazily when the menu is
about to be made visible.
Task-number: QTBUG-56526
Change-Id: I044933cabb1639406fe47908dfc4b1903af214d1
Reviewed-by: Dmitry Shachnev <mitya57@gmail.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
xcode variable expansion should be done exactly when xcode is used.
Change-Id: Icea8cb7bf9a51811052789bd66354b1b165127d6
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
this is a vestige from an earlier version of the watchos introduction.
amends 57378a108.
Change-Id: I7d15149b94d12d84e041079b563175bd4e385d50
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
the code got factored out to an own toolchain.prf file, which is
load()ed from default_pre.prf, so no change at first.
however, on mac, we shadow toolchain.prf, and make it load() sdk.prf
first.
a side effect, it has become harder to disable the use of an sdk
altogether: putting CONFIG-=sdk into a project file or the qmake
command line has no effect now. instead, it's possible to put it into
.qmake.{conf,cache}.
to make it simpler again, it's conceivable to finally add qmake -pre,
which would allow setting variables before default_pre.prf is executed.
take 2: there was nothing wrong with the original patch, but in 5.8,
CONFIG+=simulator_and_device moved from qconfig.pri to various prf files
that would do it according to the simulator_and_device configure
feature, which would be way too late for the "pulled ahead" sdk.prf
loading. as simulator_and_device is now gone entirely, it is safe to
re-apply this patch (mostly) as-is.
Task-number: QTBUG-56144
Change-Id: I6cf484982eaed8af39f7a539c60f5a087a299914
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
A separate flag is no longer needed now that simulator and device builds
are not exclusive any more (*) - both 'simulator' and 'device' being set
at the same time is a sufficient indication (uikit/default_pre.prf sets
this up according to the simulator_and_device feature and the
QMAKE_MAC_SDK variable).
(*) xcodebuild mode actually still uses exclusive builds, but this is
activated locally in uikit/default_post.prf, and uikit/xcodebuild.prf
implements the actual build passes manually anyway, so this change does
not affect it.
Change-Id: Idf173a7bfeb984498d3a49ed6b8d1a16da6c2089
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
project files may not override QMAKE_MAC_SDK any more, which seems to be
no big loss. it is still possible to override the sdk on the configure
command line (but note that this only ever worked for the target sdk).
this simplification is preparation for subsequent changes.
Change-Id: I3201629af132fa3938b13577854f3b19857a1b5a
Reviewed-by: Jake Petroules <jake.petroules@qt.io>