Merge remote-tracking branch 'origin/5.12' into 5.13

Change-Id: I1bdc28a3ae825ea35e83f20fe16d2409515e5a3d
Qt Forward Merge Bot 2019-05-16 01:00:11 +02:00
commit 264e66afb2
16 changed files with 127 additions and 24 deletions

View File

@ -50,10 +50,7 @@ builtin_resources {
# Install rules
qmldir.base = $$qmldir_path
# Tools need qmldir and plugins.qmltypes always installed on the file system
qmldir.files = $$qmldir_file
install_qml_files: qmldir.files += $$fq_qml_files
qmldir.path = $$[QT_INSTALL_QML]/$$TARGETPATH
INSTALLS += qmldir
@ -65,12 +62,12 @@ INSTALLS += qmlfiles
!debug_and_release|!build_all|CONFIG(release, debug|release) {
!prefix_build {
COPIES += qmldir
COPIES += qmldir qmlfiles
} else {
# For non-installed static builds, tools need qmldir and plugins.qmltypes
# files in the build dir
qmldir2build.files = $$qmldir_file $$fq_aux_qml_files
qmldir2build.path = $$DESTDIR
COPIES += qmldir2build
qml2build.files = $$qmldir_file $$fq_aux_qml_files
qml2build.path = $$DESTDIR
COPIES += qml2build
}
}

View File

@ -46,6 +46,7 @@
#include "qcoreevent.h"
#include "qeventloop.h"
#endif
#include "qmetaobject.h"
#include "qcorecmdlineargs_p.h"
#include <qdatastream.h>
#include <qdebug.h>
@ -966,6 +967,10 @@ bool QCoreApplication::isSetuidAllowed()
Sets the attribute \a attribute if \a on is true;
otherwise clears the attribute.
\note Some application attributes must be set \b before creating a
QCoreApplication instance. Refer to the Qt::ApplicationAttribute
documentation for more information.
\sa testAttribute()
*/
void QCoreApplication::setAttribute(Qt::ApplicationAttribute attribute, bool on)
@ -974,6 +979,27 @@ void QCoreApplication::setAttribute(Qt::ApplicationAttribute attribute, bool on)
QCoreApplicationPrivate::attribs |= 1 << attribute;
else
QCoreApplicationPrivate::attribs &= ~(1 << attribute);
if (Q_UNLIKELY(qApp)) {
switch (attribute) {
case Qt::AA_EnableHighDpiScaling:
case Qt::AA_DisableHighDpiScaling:
case Qt::AA_PluginApplication:
case Qt::AA_UseDesktopOpenGL:
case Qt::AA_UseOpenGLES:
case Qt::AA_UseSoftwareOpenGL:
case Qt::AA_ShareOpenGLContexts:
#ifdef QT_BOOTSTRAPPED
qWarning("Attribute %d must be set before QCoreApplication is created.",
attribute);
#else
qWarning("Attribute Qt::%s must be set before QCoreApplication is created.",
QMetaEnum::fromType<Qt::ApplicationAttribute>().valueToKey(attribute));
#endif
break;
default:
break;
}
}
}
/*!

View File

@ -471,6 +471,8 @@ QVariant QPlatformTheme::themeHint(ThemeHint hint) const
return QGuiApplicationPrivate::platformIntegration()->styleHint(QPlatformIntegration::ItemViewActivateItemOnSingleClick);
case QPlatformTheme::UiEffects:
return QGuiApplicationPrivate::platformIntegration()->styleHint(QPlatformIntegration::UiEffects);
case QPlatformTheme::ShowShortcutsInContextMenus:
return QGuiApplicationPrivate::platformIntegration()->styleHint(QPlatformIntegration::ShowShortcutsInContextMenus);
default:
return QPlatformTheme::defaultThemeHint(hint);
}
@ -521,7 +523,7 @@ QVariant QPlatformTheme::defaultThemeHint(ThemeHint hint)
case QPlatformTheme::StyleNames:
return QVariant(QStringList());
case QPlatformTheme::ShowShortcutsInContextMenus:
return QVariant(false);
return QVariant(true);
case TextCursorWidth:
return QVariant(1);
case DropShadow:

View File

@ -448,7 +448,7 @@ public:
void resetBuffer(int val=0);
uchar *scanLine(int y) { Q_ASSERT(y>=0); Q_ASSERT(y<m_height); return m_buffer + y * bytes_per_line; }
uchar *scanLine(int y) { Q_ASSERT(y>=0); Q_ASSERT(y<m_height); return m_buffer + y * qsizetype(bytes_per_line); }
#ifndef QT_NO_DEBUG
QImage bufferImage() const;

View File

@ -66,10 +66,10 @@
#include <QtGui/qopengl.h>
class QOpenGLContext;
QT_BEGIN_NAMESPACE
class QOpenGLContext;
#if 0
// silence syncqt warnings
#pragma qt_class(QOpenGLExtensions)

View File

@ -1061,7 +1061,7 @@ QFontEngineFT::Glyph *QFontEngineFT::loadGlyph(QGlyphSet *set, uint glyph,
|| matrix.xy != 0
|| matrix.yx != 0;
if (transform || (format != Format_Mono && !isScalableBitmap()))
if (transform || obliquen || (format != Format_Mono && !isScalableBitmap()))
load_flags |= FT_LOAD_NO_BITMAP;
FT_Error err = FT_Load_Glyph(face, glyph, load_flags);

View File

@ -581,10 +581,16 @@ void QKmsDevice::createScreens()
#if QT_CONFIG(drm_atomic)
// check atomic support
m_has_atomic_support = !drmSetClientCap(m_dri_fd, DRM_CLIENT_CAP_ATOMIC, 1)
&& qEnvironmentVariableIntValue("QT_QPA_EGLFS_KMS_ATOMIC");
if (m_has_atomic_support)
qCDebug(qLcKmsDebug) << "Atomic Support found";
m_has_atomic_support = !drmSetClientCap(m_dri_fd, DRM_CLIENT_CAP_ATOMIC, 1);
if (m_has_atomic_support) {
qCDebug(qLcKmsDebug, "Atomic reported as supported");
if (qEnvironmentVariableIntValue("QT_QPA_EGLFS_KMS_ATOMIC")) {
qCDebug(qLcKmsDebug, "Atomic enabled");
} else {
qCDebug(qLcKmsDebug, "Atomic disabled");
m_has_atomic_support = false;
}
}
#endif
drmModeResPtr resources = drmModeGetResources(m_dri_fd);

View File

@ -71,6 +71,10 @@ DBusConnection::DBusConnection(QObject *parent)
{
// Start monitoring if "org.a11y.Bus" is registered as DBus service.
QDBusConnection c = QDBusConnection::sessionBus();
if (!c.isConnected()) {
return;
}
dbusWatcher = new QDBusServiceWatcher(A11Y_SERVICE, c, QDBusServiceWatcher::WatchForRegistration, this);
connect(dbusWatcher, SIGNAL(serviceRegistered(QString)), this, SLOT(serviceRegistered()));

View File

@ -403,8 +403,13 @@ QCocoaServices *QCocoaIntegration::services() const
QVariant QCocoaIntegration::styleHint(StyleHint hint) const
{
if (hint == QPlatformIntegration::FontSmoothingGamma)
switch (hint) {
case FontSmoothingGamma:
return QCoreTextFontEngine::fontSmoothingGamma();
case ShowShortcutsInContextMenus:
return QVariant(false);
default: break;
}
return QPlatformIntegration::styleHint(hint);
}

View File

@ -834,9 +834,14 @@ static void executeBlockWithoutAnimation(Block block)
- (void)updateSelection
{
if (!hasSelection()) {
_cursorLayer.visible = NO;
_anchorLayer.visible = NO;
QIOSTextInputOverlay::s_editMenu.visible = NO;
if (_cursorLayer.visible) {
_cursorLayer.visible = NO;
_anchorLayer.visible = NO;
// Only hide the edit menu if we had a selection from before, since
// the edit menu can also be used for other purposes by others (in
// which case we try our best not to interfere).
QIOSTextInputOverlay::s_editMenu.visible = NO;
}
return;
}

View File

@ -44,6 +44,8 @@
#include <QtCore/qfunctions_winrt.h>
#include <QtGui/QPalette>
#include <QtFontDatabaseSupport/private/qwinrtfontdatabase_p.h>
#include <wrl.h>
#include <windows.ui.h>
#include <windows.ui.viewmanagement.h>
@ -96,7 +98,13 @@ static IUISettings *uiSettings()
class QWinRTThemePrivate
{
public:
QWinRTThemePrivate()
: monospaceFont(QWinRTFontDatabase::familyForStyleHint(QFont::Monospace))
{
}
QPalette palette;
QFont monospaceFont;
};
static inline QColor fromColor(const Color &color)
@ -321,4 +329,14 @@ const QPalette *QWinRTTheme::palette(Palette type) const
return QPlatformTheme::palette(type);
}
const QFont *QWinRTTheme::font(QPlatformTheme::Font type) const
{
Q_D(const QWinRTTheme);
qCDebug(lcQpaTheme) << __FUNCTION__ << type;
if (type == QPlatformTheme::FixedFont)
return &d->monospaceFont;
return QPlatformTheme::font(type);
}
QT_END_NAMESPACE

View File

@ -58,6 +58,7 @@ public:
QPlatformDialogHelper *createPlatformDialogHelper(DialogType type) const override;
const QPalette *palette(Palette type = SystemPalette) const override;
const QFont *font(Font type = SystemFont) const override;
static QVariant styleHint(QPlatformIntegration::StyleHint hint);
QVariant themeHint(ThemeHint hint) const override;

View File

@ -150,6 +150,16 @@ static QWindow *qt_getWindow(const QWidget *widget)
QT_NAMESPACE_ALIAS_OBJC_CLASS(NotificationReceiver);
@implementation NotificationReceiver
{
QMacStylePrivate *privateStyle;
}
- (instancetype)initWithPrivateStyle:(QMacStylePrivate *)style
{
if (self = [super init])
privateStyle = style;
return self;
}
- (void)scrollBarStyleDidChange:(NSNotification *)notification
{
@ -162,6 +172,23 @@ QT_NAMESPACE_ALIAS_OBJC_CLASS(NotificationReceiver);
for (const auto &o : QMacStylePrivate::scrollBars)
QCoreApplication::sendEvent(o, &event);
}
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object
change:(NSDictionary<NSKeyValueChangeKey, id> *)change context:(void *)context
{
Q_UNUSED(keyPath);
Q_UNUSED(object);
Q_UNUSED(change);
Q_UNUSED(context);
Q_ASSERT([keyPath isEqualToString:@"effectiveAppearance"]);
Q_ASSERT(object == NSApp);
for (NSView *b : privateStyle->cocoaControls)
[b release];
privateStyle->cocoaControls.clear();
}
@end
@interface QT_MANGLE_NAMESPACE(QIndeterminateProgressIndicator) : NSProgressIndicator
@ -2068,11 +2095,17 @@ QMacStyle::QMacStyle()
Q_D(QMacStyle);
QMacAutoReleasePool pool;
d->receiver = [[NotificationReceiver alloc] init];
d->receiver = [[NotificationReceiver alloc] initWithPrivateStyle:d];
[[NSNotificationCenter defaultCenter] addObserver:d->receiver
selector:@selector(scrollBarStyleDidChange:)
name:NSPreferredScrollerStyleDidChangeNotification
object:nil];
#if QT_MACOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_14)
if (QOperatingSystemVersion::current() >= QOperatingSystemVersion::MacOSMojave) {
[NSApplication.sharedApplication addObserver:d->receiver forKeyPath:@"effectiveAppearance"
options:NSKeyValueObservingOptionNew context:nullptr];
}
#endif
}
QMacStyle::~QMacStyle()
@ -2081,6 +2114,10 @@ QMacStyle::~QMacStyle()
QMacAutoReleasePool pool;
[[NSNotificationCenter defaultCenter] removeObserver:d->receiver];
#if QT_MACOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_14)
if (QOperatingSystemVersion::current() >= QOperatingSystemVersion::MacOSMojave)
[NSApplication.sharedApplication removeObserver:d->receiver forKeyPath:@"effectiveAppearance"];
#endif
[d->receiver release];
}

View File

@ -1734,7 +1734,8 @@ void QTreeView::drawRow(QPainter *painter, const QStyleOptionViewItem &option,
}
// draw background for the branch (selection + alternate row)
opt.rect = branches;
style()->drawPrimitive(QStyle::PE_PanelItemViewRow, &opt, painter, this);
if (style()->styleHint(QStyle::SH_ItemView_ShowDecorationSelected, &opt, this))
style()->drawPrimitive(QStyle::PE_PanelItemViewRow, &opt, painter, this);
// draw background of the item (only alternate row). rest of the background
// is provided by the delegate

View File

@ -172,7 +172,9 @@ void tst_qfloat16::qNan()
QVERIFY(qIsInf(-inf));
QVERIFY(qIsInf(2.f*inf));
QVERIFY(qIsInf(inf*2.f));
QCOMPARE(qfloat16(1.f/inf), qfloat16(0.f));
// QTBUG-75812: QEMU's over-optimized arm64 flakily fails 1/inf == 0 :-(
if (qfloat16(9.785e-4f) == qfloat16(9.794e-4f))
QCOMPARE(qfloat16(1.f/inf), qfloat16(0.f));
#ifdef Q_CC_INTEL
QEXPECT_FAIL("", "ICC optimizes zero * anything to zero", Continue);
#endif

View File

@ -1,3 +1,2 @@
[systemFixedFont] # QTBUG-54623
winrt
b2qt