Merge remote-tracking branch 'origin/release' into stable
Manually fixed up: isES -> isOpenGLES src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp Change-Id: I57d2ef26c3d4a7b40ace09f4e8560b7686650ea5
This commit is contained in:
commit
e6286ca289
9
dist/changes-5.3.0
vendored
9
dist/changes-5.3.0
vendored
@ -446,6 +446,15 @@ Android
|
||||
- Fonts:
|
||||
* [QTBUG-36789] Fixed support for Arabic text.
|
||||
|
||||
iOS
|
||||
---
|
||||
|
||||
- Support for input methods added.
|
||||
- Support for word completion and spell checking added.
|
||||
- Support for QClipboard added.
|
||||
- "Hide keyboard" gesture added.
|
||||
- Keyboard input is now sendt as input method events instead of key events.
|
||||
|
||||
Linux
|
||||
-----
|
||||
|
||||
|
27
mkspecs/features/qt_helper_lib.prf
Normal file
27
mkspecs/features/qt_helper_lib.prf
Normal file
@ -0,0 +1,27 @@
|
||||
#
|
||||
# W A R N I N G
|
||||
# -------------
|
||||
#
|
||||
# This file is not part of the Qt API. It exists purely as an
|
||||
# implementation detail. It may change from version to version
|
||||
# without notice, or even be removed.
|
||||
#
|
||||
# We mean it.
|
||||
#
|
||||
|
||||
load(qt_build_paths)
|
||||
|
||||
TEMPLATE = lib
|
||||
CONFIG -= qt
|
||||
|
||||
contains(QT_CONFIG, debug_and_release): CONFIG += debug_and_release
|
||||
contains(QT_CONFIG, build_all): CONFIG += build_all
|
||||
|
||||
DESTDIR = $$MODULE_BASE_OUTDIR/lib
|
||||
DLLDESTDIR = $$MODULE_BASE_OUTDIR/bin
|
||||
|
||||
# Static builds always need to be installed, as the convenience libraries
|
||||
# are not linked to the final library in this case.
|
||||
installed|static: load(qt_installs)
|
||||
|
||||
TARGET = $$qtLibraryTarget($$TARGET)
|
@ -15,7 +15,7 @@ equals(TEMPLATE, app):contains(QT, gui(-private)?) {
|
||||
# We do link and dependency resolution for the platform plugin
|
||||
# manually, since we know we always need the plugin, so we don't
|
||||
# need to generate an import for it.
|
||||
CONFIG -= import_qpa_plugin
|
||||
QTPLUGIN.platforms = -
|
||||
|
||||
!no_main_wrapper {
|
||||
# We use ld to rename the _main symbol to _qt_main, so that we don't get a symbol clash
|
||||
|
9
src/3rdparty/harfbuzz-ng/harfbuzz-ng.pro
vendored
9
src/3rdparty/harfbuzz-ng/harfbuzz-ng.pro
vendored
@ -1,16 +1,11 @@
|
||||
TARGET = qtharfbuzzng
|
||||
TEMPLATE = lib
|
||||
|
||||
CONFIG += \
|
||||
static \
|
||||
hide_symbols \
|
||||
exceptions_off rtti_off
|
||||
CONFIG -= qt
|
||||
|
||||
contains(QT_CONFIG, debug_and_release):CONFIG += debug_and_release
|
||||
contains(QT_CONFIG, build_all):CONFIG += build_all
|
||||
|
||||
DESTDIR = $$QT_BUILD_TREE/lib
|
||||
load(qt_helper_lib)
|
||||
|
||||
DEFINES += HAVE_CONFIG_H
|
||||
HEADERS += $$PWD/src/config.h
|
||||
@ -133,5 +128,3 @@ mac {
|
||||
# even in 10.8 where they were also made available stand-alone.
|
||||
LIBS_PRIVATE += -framework ApplicationServices
|
||||
}
|
||||
|
||||
TARGET = $$TARGET$$qtPlatformTargetSuffix()
|
||||
|
6
src/3rdparty/harfbuzz-ng/src/hb-coretext.cc
vendored
6
src/3rdparty/harfbuzz-ng/src/hb-coretext.cc
vendored
@ -690,13 +690,10 @@ _hb_coretext_shape (hb_shape_plan_t *shape_plan,
|
||||
*/
|
||||
CFDictionaryRef attributes = CTRunGetAttributes (run);
|
||||
CTFontRef run_ct_font = static_cast<CTFontRef>(CFDictionaryGetValue (attributes, kCTFontAttributeName));
|
||||
CGFontRef run_cg_font = CTFontCopyGraphicsFont (run_ct_font, 0);
|
||||
|
||||
CFRange range = CTRunGetStringRange (run);
|
||||
if (!CFEqual (run_cg_font, face_data->cg_font))
|
||||
if (!CFEqual (run_ct_font, font_data->ct_font))
|
||||
{
|
||||
CFRelease (run_cg_font);
|
||||
|
||||
buffer->ensure (buffer->len + range.length);
|
||||
if (buffer->in_error)
|
||||
FAIL ("Buffer resize failed");
|
||||
@ -731,7 +728,6 @@ _hb_coretext_shape (hb_shape_plan_t *shape_plan,
|
||||
}
|
||||
continue;
|
||||
}
|
||||
CFRelease (run_cg_font);
|
||||
|
||||
/* CoreText throws away the PDF token, while the OpenType backend will add a zero-advance
|
||||
* glyph for this. We need to make sure the two produce the same output. */
|
||||
|
@ -1,3 +1,4 @@
|
||||
CONFIG += installed
|
||||
include (../config.pri)
|
||||
|
||||
INCLUDEPATH += \
|
||||
|
@ -1,7 +1,4 @@
|
||||
TEMPLATE = lib
|
||||
CONFIG += static
|
||||
TARGET = $$qtLibraryTarget(preprocessor)
|
||||
|
||||
include(../../config.pri)
|
||||
|
||||
INCLUDEPATH = $$ANGLE_DIR/src/compiler/preprocessor
|
||||
|
@ -1,7 +1,4 @@
|
||||
TEMPLATE = lib
|
||||
CONFIG += static
|
||||
TARGET = $$qtLibraryTarget(translator)
|
||||
|
||||
include(../config.pri)
|
||||
|
||||
# Mingw 4.7 chokes on implicit move semantics, so disable C++11 here
|
||||
|
@ -59,17 +59,10 @@ CONFIG(debug, debug|release) {
|
||||
}
|
||||
|
||||
# c++11 is needed by MinGW to get support for unordered_map.
|
||||
CONFIG -= qt
|
||||
CONFIG += stl exceptions c++11
|
||||
|
||||
contains(QT_CONFIG, debug_and_release):CONFIG += debug_and_release
|
||||
contains(QT_CONFIG, build_all):CONFIG += build_all
|
||||
|
||||
INCLUDEPATH += . .. $$PWD/../include
|
||||
|
||||
DESTDIR = $$QT_BUILD_TREE/lib
|
||||
DLLDESTDIR = $$QT_BUILD_TREE/bin
|
||||
|
||||
msvc {
|
||||
# Disabled Warnings:
|
||||
# 4100: 'identifier' : unreferenced formal parameter
|
||||
@ -107,3 +100,5 @@ gcc {
|
||||
|
||||
QMAKE_CXXFLAGS_DEBUG = $$QMAKE_CFLAGS_DEBUG
|
||||
QMAKE_CXXFLAGS_RELEASE = $$QMAKE_CFLAGS_RELEASE
|
||||
|
||||
load(qt_helper_lib)
|
||||
|
@ -1,9 +1,8 @@
|
||||
TEMPLATE = lib
|
||||
TARGET = $$qtLibraryTarget(d3dcompiler_qt)
|
||||
|
||||
TARGET = d3dcompiler_qt
|
||||
CONFIG += installed
|
||||
include(../config.pri)
|
||||
CONFIG += qt
|
||||
|
||||
CONFIG += qt
|
||||
QT = core
|
||||
DEFINES += QT_NO_CAST_FROM_ASCII QT_NO_CAST_TO_ASCII
|
||||
SOURCES += main.cpp
|
||||
@ -16,5 +15,3 @@ winrt:equals(WINSDK_VER, 8.1) {
|
||||
|
||||
# __stdcall exports get mangled, so use a def file
|
||||
DEF_FILE += $${TARGET}.def
|
||||
|
||||
load(qt_installs)
|
||||
|
@ -1,6 +1,4 @@
|
||||
TEMPLATE = lib
|
||||
TARGET = $$qtLibraryTarget(libEGL)
|
||||
|
||||
CONFIG += installed
|
||||
include(../common/common.pri)
|
||||
|
||||
angle_d3d11: \
|
||||
@ -30,8 +28,6 @@ SOURCES += \
|
||||
mingw:equals(QT_ARCH, i386): DEF_FILE = $$ANGLE_DIR/src/libEGL/$${TARGET}_mingw32.def
|
||||
}
|
||||
|
||||
load(qt_installs)
|
||||
|
||||
egl_headers.files = \
|
||||
$$ANGLE_DIR/include/EGL/egl.h \
|
||||
$$ANGLE_DIR/include/EGL/eglext.h \
|
||||
|
@ -1,7 +1,4 @@
|
||||
TEMPLATE = lib
|
||||
TARGET = $$qtLibraryTarget(libGLESv2)
|
||||
CONFIG += simd
|
||||
|
||||
CONFIG += simd installed
|
||||
include(../common/common.pri)
|
||||
|
||||
INCLUDEPATH += $$OUT_PWD/.. $$ANGLE_DIR/src/libGLESv2
|
||||
@ -13,8 +10,8 @@ angle_d3d11: \
|
||||
LIBS_PRIVATE += -ld3d9
|
||||
|
||||
LIBS_PRIVATE += -ldxguid
|
||||
STATICLIBS = translator preprocessor
|
||||
|
||||
STATICLIBS = translator preprocessor
|
||||
for(libname, STATICLIBS) {
|
||||
# Appends 'd' to the library for debug builds and builds up the fully
|
||||
# qualified path to pass to the linker.
|
||||
@ -238,8 +235,6 @@ for (vs, VERTEX_SHADERS_CLEAR) {
|
||||
angle_d3d11: QMAKE_EXTRA_COMPILERS += fxc_vs_$${vs}
|
||||
}
|
||||
|
||||
load(qt_installs)
|
||||
|
||||
khr_headers.files = $$ANGLE_DIR/include/KHR/khrplatform.h
|
||||
khr_headers.path = $$[QT_INSTALL_HEADERS]/QtANGLE/KHR
|
||||
gles2_headers.files = \
|
||||
@ -248,5 +243,3 @@ gles2_headers.files = \
|
||||
$$ANGLE_DIR/include/GLES2/gl2platform.h
|
||||
gles2_headers.path = $$[QT_INSTALL_HEADERS]/QtANGLE/GLES2
|
||||
INSTALLS += khr_headers gles2_headers
|
||||
|
||||
|
||||
|
@ -26,7 +26,8 @@ qhp.QtCore.subprojects.classes.sortPages = true
|
||||
|
||||
tagfile = ../../../doc/qtcore/qtcore.tags
|
||||
|
||||
depends += activeqt qtdbus qtgui qtwidgets qtnetwork qtdoc qtmacextras qtqml qtquick qtlinguist qtdesigner qtconcurrent qtxml qmake
|
||||
depends += activeqt qtdbus qtgui qtwidgets qtnetwork qtdoc qtmacextras qtquick qtlinguist qtdesigner qtconcurrent qtxml qmake
|
||||
# depends += qtqml # Qt namespace collides with QtQml::Qt, see QTBUG-38630
|
||||
|
||||
headerdirs += ..
|
||||
|
||||
|
@ -62,6 +62,12 @@ Q_GLOBAL_STATIC_WITH_ARGS(QLoggingCategory, qtDefaultCategory,
|
||||
by a string - at runtime. Whether a category should be actually logged or
|
||||
not can be checked with the \l isEnabled() methods.
|
||||
|
||||
All objects are meant to be configured by a common registry (see also
|
||||
\l{Configuring Categories}). Different objects can also represent the same
|
||||
category. It's therefore not recommended to export objects across module
|
||||
boundaries, nor to manipulate the objects directly, nor to inherit from
|
||||
QLoggingCategory.
|
||||
|
||||
\section1 Creating category objects
|
||||
|
||||
The Q_LOGGING_CATEGORY() and the Q_DECLARE_LOGGING_CATEGORY() macros
|
||||
|
@ -777,6 +777,7 @@ struct VariantData
|
||||
const void *data;
|
||||
const uint flags;
|
||||
private:
|
||||
// copy constructor allowed to be implicit to silence level 4 warning from MSVC
|
||||
VariantData &operator=(const VariantData &) Q_DECL_EQ_DELETE;
|
||||
};
|
||||
|
||||
|
@ -89,7 +89,7 @@ QTimeZonePrivate *QMacTimeZonePrivate::clone()
|
||||
void QMacTimeZonePrivate::init(const QByteArray &ianaId)
|
||||
{
|
||||
if (availableTimeZoneIds().contains(ianaId)) {
|
||||
m_nstz = [NSTimeZone timeZoneWithName:QCFString::toNSString(QString::fromUtf8(ianaId))];
|
||||
m_nstz = [[NSTimeZone timeZoneWithName:QCFString::toNSString(QString::fromUtf8(ianaId))] retain];
|
||||
if (m_nstz)
|
||||
m_id = ianaId;
|
||||
}
|
||||
@ -142,7 +142,6 @@ QString QMacTimeZonePrivate::displayName(QTimeZone::TimeType timeType,
|
||||
NSString *macLocaleCode = QCFString::toNSString(locale.name());
|
||||
NSLocale *macLocale = [[NSLocale alloc] initWithLocaleIdentifier:macLocaleCode];
|
||||
const QString result = QCFString::toQString([m_nstz localizedName:style locale:macLocale]);
|
||||
[macLocaleCode release];
|
||||
[macLocale release];
|
||||
return result;
|
||||
}
|
||||
@ -192,7 +191,6 @@ QTimeZonePrivate::Data QMacTimeZonePrivate::data(qint64 forMSecsSinceEpoch) cons
|
||||
data.daylightTimeOffset = [m_nstz daylightSavingTimeOffsetForDate:date];
|
||||
data.standardTimeOffset = data.offsetFromUtc - data.daylightTimeOffset;
|
||||
data.abbreviation = QCFString::toQString([m_nstz abbreviationForDate:date]);
|
||||
[date release];
|
||||
return data;
|
||||
}
|
||||
|
||||
@ -203,8 +201,6 @@ bool QMacTimeZonePrivate::hasTransitions() const
|
||||
NSDate *epoch = [NSDate dateWithTimeIntervalSince1970:0];
|
||||
const NSDate *date = [m_nstz nextDaylightSavingTimeTransitionAfterDate:epoch];
|
||||
const bool result = ([date timeIntervalSince1970] > [epoch timeIntervalSince1970]);
|
||||
[epoch release];
|
||||
[date release];
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -224,7 +220,6 @@ QTimeZonePrivate::Data QMacTimeZonePrivate::nextTransition(qint64 afterMSecsSinc
|
||||
tran.daylightTimeOffset = [m_nstz daylightSavingTimeOffsetForDate:nextDate];
|
||||
tran.standardTimeOffset = tran.offsetFromUtc - tran.daylightTimeOffset;
|
||||
tran.abbreviation = QCFString::toQString([m_nstz abbreviationForDate:nextDate]);
|
||||
[nextDate release];
|
||||
return tran;
|
||||
}
|
||||
|
||||
@ -246,7 +241,6 @@ QTimeZonePrivate::Data QMacTimeZonePrivate::previousTransition(qint64 beforeMSec
|
||||
nextDate = [m_nstz nextDaylightSavingTimeTransitionAfterDate:nextDate];
|
||||
nextSecs = [nextDate timeIntervalSince1970];
|
||||
}
|
||||
[nextDate release];
|
||||
}
|
||||
if (secsList.size() >= 1)
|
||||
return data(qint64(secsList.last()) * 1000);
|
||||
|
@ -196,19 +196,13 @@ public:
|
||||
|
||||
enum OpenGLModuleType {
|
||||
LibGL,
|
||||
LibGLES,
|
||||
|
||||
// ###
|
||||
DesktopGL = LibGL,
|
||||
GLES2 = LibGLES
|
||||
LibGLES
|
||||
};
|
||||
|
||||
static OpenGLModuleType openGLModuleType();
|
||||
|
||||
bool isOpenGLES() const;
|
||||
|
||||
bool isES() const { return isOpenGLES(); } // ###
|
||||
|
||||
Q_SIGNALS:
|
||||
void aboutToBeDestroyed();
|
||||
|
||||
|
@ -297,7 +297,7 @@ Q_SIGNALS:
|
||||
void screenChanged(QScreen *screen);
|
||||
void modalityChanged(Qt::WindowModality modality);
|
||||
void windowStateChanged(Qt::WindowState windowState);
|
||||
void windowTitleChanged(const QString &title);
|
||||
Q_REVISION(2) void windowTitleChanged(const QString &title);
|
||||
|
||||
void xChanged(int arg);
|
||||
void yChanged(int arg);
|
||||
|
@ -132,7 +132,7 @@ QTextCursorPrivate::AdjustResult QTextCursorPrivate::adjustPosition(int position
|
||||
|
||||
void QTextCursorPrivate::setX()
|
||||
{
|
||||
if (priv->isInEditBlock()) {
|
||||
if (priv->isInEditBlock() || priv->inContentsChange) {
|
||||
x = -1; // mark dirty
|
||||
return;
|
||||
}
|
||||
|
@ -2057,7 +2057,7 @@ void QTextEngine::justify(const QScriptLine &line)
|
||||
// subtract one char more, as we can't justfy after the last character
|
||||
--line_length;
|
||||
|
||||
if (!line_length)
|
||||
if (line_length <= 0)
|
||||
return;
|
||||
|
||||
int firstItem = findItem(line.from);
|
||||
|
@ -224,7 +224,7 @@ void QGL2PaintEngineExPrivate::updateBrushTexture()
|
||||
currentBrushPixmap = currentBrushPixmap.scaled(max_texture_size, max_texture_size, Qt::KeepAspectRatio);
|
||||
|
||||
GLuint wrapMode = GL_REPEAT;
|
||||
if (ctx->contextHandle()->isES()) {
|
||||
if (ctx->contextHandle()->isOpenGLES()) {
|
||||
// OpenGL ES does not support GL_REPEAT wrap modes for NPOT textures. So instead,
|
||||
// we emulate GL_REPEAT by only taking the fractional part of the texture coords
|
||||
// in the qopenglslTextureBrushSrcFragmentShader program.
|
||||
|
@ -69,7 +69,8 @@ QEGLPlatformCursor::QEGLPlatformCursor(QPlatformScreen *screen)
|
||||
m_vertexCoordEntry(0),
|
||||
m_textureCoordEntry(0),
|
||||
m_textureEntry(0),
|
||||
m_deviceListener(0)
|
||||
m_deviceListener(0),
|
||||
m_updater(screen)
|
||||
{
|
||||
QByteArray hideCursorVal = qgetenv("QT_QPA_EGLFS_HIDECURSOR");
|
||||
if (!hideCursorVal.isEmpty())
|
||||
@ -270,10 +271,30 @@ bool QEGLPlatformCursor::setCurrentCursor(QCursor *cursor)
|
||||
}
|
||||
#endif
|
||||
|
||||
void QEGLPlatformCursorUpdater::update(const QPoint &pos, const QRegion &rgn)
|
||||
{
|
||||
m_active = false;
|
||||
QWindowSystemInterface::handleExposeEvent(m_screen->topLevelAt(pos), rgn);
|
||||
QWindowSystemInterface::flushWindowSystemEvents();
|
||||
}
|
||||
|
||||
void QEGLPlatformCursorUpdater::scheduleUpdate(const QPoint &pos, const QRegion &rgn)
|
||||
{
|
||||
if (m_active)
|
||||
return;
|
||||
|
||||
m_active = true;
|
||||
|
||||
// Must not flush the window system events directly from here since we are likely to
|
||||
// be a called directly from QGuiApplication's processMouseEvents. Flushing events
|
||||
// could cause reentering by dispatching more queued mouse events.
|
||||
QMetaObject::invokeMethod(this, "update", Qt::QueuedConnection,
|
||||
Q_ARG(QPoint, pos), Q_ARG(QRegion, rgn));
|
||||
}
|
||||
|
||||
void QEGLPlatformCursor::update(const QRegion &rgn)
|
||||
{
|
||||
QWindowSystemInterface::handleExposeEvent(m_screen->topLevelAt(m_cursor.pos), rgn);
|
||||
QWindowSystemInterface::flushWindowSystemEvents();
|
||||
m_updater.scheduleUpdate(m_cursor.pos, rgn);
|
||||
}
|
||||
|
||||
QRect QEGLPlatformCursor::cursorRect() const
|
||||
|
@ -68,6 +68,24 @@ private:
|
||||
int m_mouseCount;
|
||||
};
|
||||
|
||||
class QEGLPlatformCursorUpdater : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
QEGLPlatformCursorUpdater(QPlatformScreen *screen)
|
||||
: m_screen(screen), m_active(false) { }
|
||||
|
||||
void scheduleUpdate(const QPoint &pos, const QRegion &rgn);
|
||||
|
||||
private slots:
|
||||
void update(const QPoint &pos, const QRegion &rgn);
|
||||
|
||||
private:
|
||||
QPlatformScreen *m_screen;
|
||||
bool m_active;
|
||||
};
|
||||
|
||||
class QEGLPlatformCursor : public QPlatformCursor
|
||||
{
|
||||
public:
|
||||
@ -130,6 +148,7 @@ private:
|
||||
int m_textureCoordEntry;
|
||||
int m_textureEntry;
|
||||
QEGLPlatformCursorDeviceListener *m_deviceListener;
|
||||
QEGLPlatformCursorUpdater m_updater;
|
||||
};
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
@ -92,16 +92,20 @@ static QFont qfontForCocoaFont(NSFont *cocoaFont, const QFont &resolveFont)
|
||||
QFont newFont;
|
||||
if (cocoaFont) {
|
||||
int pSize = qRound([cocoaFont pointSize]);
|
||||
CTFontDescriptorRef font = CTFontCopyFontDescriptor((CTFontRef)cocoaFont);
|
||||
// QCoreTextFontDatabase::populateFontDatabase() is using localized names
|
||||
QString family = QCFString::toQString((CFStringRef) CTFontDescriptorCopyLocalizedAttribute(font, kCTFontFamilyNameAttribute, NULL));
|
||||
QString style = QCFString::toQString((CFStringRef) CTFontDescriptorCopyLocalizedAttribute(font, kCTFontStyleNameAttribute, NULL));
|
||||
QString family(QCFString::toQString([cocoaFont familyName]));
|
||||
QString typeface(QCFString::toQString([cocoaFont fontName]));
|
||||
|
||||
newFont = QFontDatabase().font(family, style, pSize);
|
||||
int hyphenPos = typeface.indexOf(QLatin1Char('-'));
|
||||
if (hyphenPos != -1) {
|
||||
typeface.remove(0, hyphenPos + 1);
|
||||
} else {
|
||||
typeface = QLatin1String("Normal");
|
||||
}
|
||||
|
||||
newFont = QFontDatabase().font(family, typeface, pSize);
|
||||
newFont.setUnderline(resolveFont.underline());
|
||||
newFont.setStrikeOut(resolveFont.strikeOut());
|
||||
|
||||
CFRelease(font);
|
||||
}
|
||||
return newFont;
|
||||
}
|
||||
|
@ -234,6 +234,10 @@ QCocoaMenu::QCocoaMenu() :
|
||||
|
||||
QCocoaMenu::~QCocoaMenu()
|
||||
{
|
||||
foreach (QCocoaMenuItem *item, m_menuItems) {
|
||||
if (COCOA_MENU_ANCESTOR(item) == this)
|
||||
SET_COCOA_MENU_ANCESTOR(item, 0);
|
||||
}
|
||||
QCocoaAutoReleasePool pool;
|
||||
[m_nativeItem setSubmenu:nil];
|
||||
[m_nativeMenu release];
|
||||
|
@ -106,6 +106,8 @@ QCocoaMenuItem::QCocoaMenuItem() :
|
||||
|
||||
QCocoaMenuItem::~QCocoaMenuItem()
|
||||
{
|
||||
if (m_menu && COCOA_MENU_ANCESTOR(m_menu) == this)
|
||||
SET_COCOA_MENU_ANCESTOR(m_menu, 0);
|
||||
if (m_merged) {
|
||||
[m_native setHidden:YES];
|
||||
} else {
|
||||
|
@ -463,7 +463,11 @@ bool QCocoaPrintDevice::openPpdFile()
|
||||
ppdClose(m_ppd);
|
||||
m_ppd = 0;
|
||||
CFURLRef ppdURL = NULL;
|
||||
#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7
|
||||
char ppdPath[PATH_MAX];
|
||||
#else
|
||||
char ppdPath[MAXPATHLEN];
|
||||
#endif
|
||||
if (PMPrinterCopyDescriptionURL(m_printer, kPMPPDDescriptionType, &ppdURL) == noErr
|
||||
&& ppdURL != NULL
|
||||
&& CFURLGetFileSystemRepresentation(ppdURL, true, (UInt8*)ppdPath, sizeof(ppdPath))) {
|
||||
|
@ -150,6 +150,7 @@
|
||||
break;
|
||||
}
|
||||
QWindowSystemInterface::handleApplicationStateChanged(state);
|
||||
QWindowSystemInterface::flushWindowSystemEvents();
|
||||
}
|
||||
|
||||
@end
|
||||
|
@ -88,6 +88,7 @@ public:
|
||||
WId winId() const { return WId(m_view); };
|
||||
|
||||
private:
|
||||
void applicationStateChanged(Qt::ApplicationState state);
|
||||
void applyGeometry(const QRect &rect);
|
||||
|
||||
QUIView *m_view;
|
||||
|
@ -192,12 +192,25 @@
|
||||
|
||||
- (void)displayLayer:(CALayer *)layer
|
||||
{
|
||||
QSize bounds = fromCGRect(layer.bounds).toRect().size();
|
||||
Q_UNUSED(layer);
|
||||
Q_ASSERT(layer == self.layer);
|
||||
|
||||
Q_ASSERT(m_qioswindow->geometry().size() == bounds);
|
||||
Q_ASSERT(self.hidden == !m_qioswindow->window()->isVisible());
|
||||
[self sendUpdatedExposeEvent];
|
||||
}
|
||||
|
||||
- (void)sendUpdatedExposeEvent
|
||||
{
|
||||
QRegion region;
|
||||
|
||||
if (m_qioswindow->isExposed()) {
|
||||
QSize bounds = fromCGRect(self.layer.bounds).toRect().size();
|
||||
|
||||
Q_ASSERT(m_qioswindow->geometry().size() == bounds);
|
||||
Q_ASSERT(self.hidden == !m_qioswindow->window()->isVisible());
|
||||
|
||||
region = QRect(QPoint(), bounds);
|
||||
}
|
||||
|
||||
QRegion region = self.hidden ? QRegion() : QRect(QPoint(), bounds);
|
||||
QWindowSystemInterface::handleExposeEvent(m_qioswindow->window(), region);
|
||||
QWindowSystemInterface::flushWindowSystemEvents();
|
||||
}
|
||||
@ -334,6 +347,8 @@ QIOSWindow::QIOSWindow(QWindow *window)
|
||||
, m_view([[QUIView alloc] initWithQIOSWindow:this])
|
||||
, m_windowLevel(0)
|
||||
{
|
||||
connect(qGuiApp, &QGuiApplication::applicationStateChanged, this, &QIOSWindow::applicationStateChanged);
|
||||
|
||||
setParent(QPlatformWindow::parent());
|
||||
|
||||
// Resolve default window geometry in case it was not set before creating the
|
||||
@ -471,7 +486,8 @@ void QIOSWindow::applyGeometry(const QRect &rect)
|
||||
|
||||
bool QIOSWindow::isExposed() const
|
||||
{
|
||||
return window()->isVisible() && !window()->geometry().isEmpty();
|
||||
return qApp->applicationState() > Qt::ApplicationHidden
|
||||
&& window()->isVisible() && !window()->geometry().isEmpty();
|
||||
}
|
||||
|
||||
void QIOSWindow::setWindowState(Qt::WindowState state)
|
||||
@ -593,6 +609,12 @@ void QIOSWindow::handleContentOrientationChange(Qt::ScreenOrientation orientatio
|
||||
[[UIApplication sharedApplication] setStatusBarOrientation:uiOrientation animated:NO];
|
||||
}
|
||||
|
||||
void QIOSWindow::applicationStateChanged(Qt::ApplicationState)
|
||||
{
|
||||
if (window()->isExposed() != isExposed())
|
||||
[m_view sendUpdatedExposeEvent];
|
||||
}
|
||||
|
||||
qreal QIOSWindow::devicePixelRatio() const
|
||||
{
|
||||
return m_view.contentScaleFactor;
|
||||
|
@ -3,9 +3,8 @@
|
||||
# libxcb-fixes, libxcb-randr, libxcb-shm, libxcb-sync, libxcb-image,
|
||||
# libxcb-keysyms, libxcb-icccm, libxcb-renderutil, libxcb-xkb
|
||||
#
|
||||
TEMPLATE = lib
|
||||
TARGET = xcb-static
|
||||
CONFIG += staticlib
|
||||
CONFIG += static
|
||||
load(qt_helper_lib)
|
||||
|
||||
XCB_DIR = ../../../../3rdparty/xcb
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
TEMPLATE = subdirs
|
||||
|
||||
mac: SUBDIRS += cocoa
|
||||
osx: SUBDIRS += cocoa
|
||||
win32: SUBDIRS += windows
|
||||
unix:!mac:contains(QT_CONFIG, cups): SUBDIRS += cups
|
||||
|
@ -448,9 +448,10 @@ bool QSqlTableModel::selectRow(int row)
|
||||
// Look for changed values. Primary key fields are customarily first
|
||||
// and probably change less often than other fields, so start at the end.
|
||||
for (int f = curValues.count() - 1; f >= 0; --f) {
|
||||
if (curValues.value(f) != newValues.value(f))
|
||||
if (curValues.value(f) != newValues.value(f)) {
|
||||
needsAddingToCache = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -192,6 +192,8 @@ private slots:
|
||||
|
||||
void QTBUG28998_linkColor();
|
||||
|
||||
void textCursorUsageWithinContentsChange();
|
||||
|
||||
private:
|
||||
void backgroundImage_checkExpectedHtml(const QTextDocument &doc);
|
||||
|
||||
@ -3021,5 +3023,50 @@ void tst_QTextDocument::QTBUG28998_linkColor()
|
||||
QCOMPARE(format.foreground(), pal.link());
|
||||
}
|
||||
|
||||
class ContentsChangeHandler : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
ContentsChangeHandler(QTextDocument *doc)
|
||||
: verticalMovementX(-1)
|
||||
, doc(doc)
|
||||
{
|
||||
connect(doc, SIGNAL(contentsChange(int,int,int)),
|
||||
this, SLOT(saveModifiedText(int, int, int)));
|
||||
}
|
||||
|
||||
private slots:
|
||||
void saveModifiedText(int from, int /*charsRemoved*/, int charsAdded)
|
||||
{
|
||||
QTextCursor tmp(doc);
|
||||
tmp.setPosition(from);
|
||||
tmp.setPosition(from + charsAdded, QTextCursor::KeepAnchor);
|
||||
text = tmp.selectedText();
|
||||
verticalMovementX = tmp.verticalMovementX();
|
||||
}
|
||||
|
||||
public:
|
||||
QString text;
|
||||
int verticalMovementX;
|
||||
private:
|
||||
QTextDocument *doc;
|
||||
};
|
||||
|
||||
void tst_QTextDocument::textCursorUsageWithinContentsChange()
|
||||
{
|
||||
// force creation of layout
|
||||
doc->documentLayout();
|
||||
|
||||
QTextCursor cursor(doc);
|
||||
cursor.insertText("initial text");
|
||||
|
||||
ContentsChangeHandler handler(doc);
|
||||
|
||||
cursor.insertText("new text");
|
||||
|
||||
QCOMPARE(handler.text, QString("new text"));
|
||||
QCOMPARE(handler.verticalMovementX, -1);
|
||||
}
|
||||
|
||||
QTEST_MAIN(tst_QTextDocument)
|
||||
#include "tst_qtextdocument.moc"
|
||||
|
@ -122,6 +122,7 @@ private slots:
|
||||
void boundingRectForUnsetLineWidth();
|
||||
void boundingRectForSetLineWidth();
|
||||
void glyphLessItems();
|
||||
void justifyTrailingSpaces();
|
||||
|
||||
// QTextLine stuff
|
||||
void setNumColumnsWrapAtWordBoundaryOrAnywhere();
|
||||
@ -1996,5 +1997,19 @@ void tst_QTextLayout::cursorInNonStopChars()
|
||||
QVERIFY(line.cursorToX(2) == line.cursorToX(3));
|
||||
}
|
||||
|
||||
void tst_QTextLayout::justifyTrailingSpaces()
|
||||
{
|
||||
QTextLayout layout(QStringLiteral(" t"), testFont);
|
||||
layout.setTextOption(QTextOption(Qt::AlignJustify));
|
||||
layout.beginLayout();
|
||||
|
||||
QTextLine line = layout.createLine();
|
||||
line.setLineWidth(5);
|
||||
|
||||
layout.endLayout();
|
||||
|
||||
QVERIFY(qFuzzyIsNull(layout.lineAt(0).cursorToX(0)));
|
||||
}
|
||||
|
||||
QTEST_MAIN(tst_QTextLayout)
|
||||
#include "tst_qtextlayout.moc"
|
||||
|
Loading…
Reference in New Issue
Block a user