summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/Qt5GuiConfigExtras.cmake.in40
-rw-r--r--src/gui/accessible/accessible.pri1
-rw-r--r--src/gui/accessible/qaccessible.cpp41
-rw-r--r--src/gui/accessible/qaccessible.h72
-rw-r--r--src/gui/accessible/qaccessible2_p.h45
-rw-r--r--src/gui/doc/qtgui.qdocconf2
-rw-r--r--src/gui/image/qimage.cpp7
-rw-r--r--src/gui/image/qimageiohandler.cpp40
-rw-r--r--src/gui/image/qimagewriter.cpp2
-rw-r--r--src/gui/image/qpixmap.cpp2
-rw-r--r--src/gui/kernel/qevent.cpp15
-rw-r--r--src/gui/kernel/qguiapplication.cpp80
-rw-r--r--src/gui/kernel/qguiapplication.h1
-rw-r--r--src/gui/kernel/qkeysequence_p.h1
-rw-r--r--src/gui/kernel/qopenglcontext.cpp12
-rw-r--r--src/gui/kernel/qopenglcontext.h2
-rw-r--r--src/gui/kernel/qplatformdialoghelper.cpp42
-rw-r--r--src/gui/kernel/qplatformdialoghelper.h19
-rw-r--r--src/gui/kernel/qplatformintegration.cpp31
-rw-r--r--src/gui/kernel/qplatformintegration.h9
-rw-r--r--src/gui/kernel/qplatformsystemtrayicon_qpa.cpp2
-rw-r--r--src/gui/kernel/qplatformtheme.cpp28
-rw-r--r--src/gui/kernel/qplatformwindow.cpp25
-rw-r--r--src/gui/kernel/qstylehints.cpp3
-rw-r--r--src/gui/kernel/qsurfaceformat.cpp4
-rw-r--r--src/gui/kernel/qwindow.cpp24
-rw-r--r--src/gui/kernel/qwindow_p.h2
-rw-r--r--src/gui/kernel/qwindowsysteminterface.cpp7
-rw-r--r--src/gui/kernel/qwindowsysteminterface.h2
-rw-r--r--src/gui/kernel/qwindowsysteminterface_p.h5
-rw-r--r--src/gui/opengl/opengl.pri22
-rw-r--r--src/gui/opengl/qopenglfunctions.cpp8
-rw-r--r--src/gui/opengl/qopenglgradientcache.cpp24
-rw-r--r--src/gui/opengl/qopenglpixeltransferoptions.h10
-rw-r--r--src/gui/opengl/qopengltexture.cpp144
-rw-r--r--src/gui/opengl/qopengltexture.h21
-rw-r--r--src/gui/opengl/qopengltexturecache.cpp30
-rw-r--r--src/gui/opengl/qopengltexturecache_p.h3
-rw-r--r--src/gui/opengl/qopengltextureglyphcache.cpp39
-rw-r--r--src/gui/opengl/qopengltexturehelper.cpp19
-rw-r--r--src/gui/opengl/qopengltexturehelper_p.h8
-rw-r--r--src/gui/painting/qbrush.cpp4
-rw-r--r--src/gui/painting/qdrawhelper_neon.cpp1
-rw-r--r--src/gui/painting/qpaintengine.h6
-rw-r--r--src/gui/painting/qpaintengine_raster.cpp16
-rw-r--r--src/gui/painting/qpainter.cpp7
-rw-r--r--src/gui/painting/qpdf.cpp2
-rw-r--r--src/gui/painting/qtextureglyphcache.cpp12
-rw-r--r--src/gui/text/qfont.cpp9
-rw-r--r--src/gui/text/qfont_p.h5
-rw-r--r--src/gui/text/qfontdatabase_qpa.cpp1
-rw-r--r--src/gui/text/qfontengine.cpp3
-rw-r--r--src/gui/text/qfontengine_ft.cpp52
-rw-r--r--src/gui/text/qfontengine_ft_p.h2
-rw-r--r--src/gui/text/qfontengine_p.h2
-rw-r--r--src/gui/text/qfontmetrics.cpp2
-rw-r--r--src/gui/text/qpfutil.cpp66
-rw-r--r--src/gui/text/qtextdocument.cpp2
-rw-r--r--src/gui/text/qtextdocument_p.cpp76
-rw-r--r--src/gui/text/qtextdocument_p.h2
-rw-r--r--src/gui/text/qtextengine.cpp6
-rw-r--r--src/gui/text/qtexthtmlparser.cpp6
-rw-r--r--src/gui/text/qtextlist.cpp4
-rw-r--r--src/gui/text/qtexttable.cpp14
-rw-r--r--src/gui/text/text.pri144
65 files changed, 860 insertions, 478 deletions
diff --git a/src/gui/Qt5GuiConfigExtras.cmake.in b/src/gui/Qt5GuiConfigExtras.cmake.in
index 77e456df53..75a2385d57 100644
--- a/src/gui/Qt5GuiConfigExtras.cmake.in
+++ b/src/gui/Qt5GuiConfigExtras.cmake.in
@@ -54,12 +54,17 @@ set(Qt5Gui_OPENGL_LIBRARIES Qt5::Gui_GLESv2)
!!IF !isEmpty(CMAKE_GL_INCDIRS)
+set(_GL_INCDIRS $$CMAKE_GL_INCDIRS)
find_path(_qt5gui_OPENGL_INCLUDE_DIR $$CMAKE_GL_HEADER_NAME
- PATHS $$CMAKE_GL_INCDIRS
- NO_DEFAULT_PATH)
+ PATHS ${_GL_INCDIRS}
+!!IF !mac
+ NO_DEFAULT_PATH
+!!ENDIF
+)
if (NOT _qt5gui_OPENGL_INCLUDE_DIR)
- message(FATAL_ERROR \"Failed to find \\\"$$CMAKE_GL_HEADER_NAME\\\" in \\\"$$CMAKE_GL_INCDIRS\\\".\")
+ message(FATAL_ERROR \"Failed to find \\\"$$CMAKE_GL_HEADER_NAME\\\" in \\\"${_GL_INCDIRS}\\\".\")
endif()
+unset(_GL_INCDIRS)
_qt5_Gui_check_file_exists(${_qt5gui_OPENGL_INCLUDE_DIR})
@@ -72,13 +77,30 @@ unset(_qt5gui_OPENGL_INCLUDE_DIR CACHE)
macro(_qt5gui_find_extra_libs Name Libs LibDir IncDirs)
set(Qt5Gui_${Name}_LIBRARIES)
+!!IF !mac
set(Qt5Gui_${Name}_INCLUDE_DIRS ${IncDirs})
+!!ELSE
+ foreach(_dir ${IncDirs})
+ if (EXISTS ${_dir})
+ list(APPEND Qt5Gui_${Name}_INCLUDE_DIRS ${_dir})
+ else()
+ find_path(_actual_dir ${_dir}) # Look in sdk directories
+ if (_actual_dir)
+ list(APPEND Qt5Gui_${Name}_INCLUDE_DIRS ${_actual_dir})
+ endif()
+ unset(_actual_dir CACHE)
+ endif()
+ endforeach()
+!!ENDIF
foreach(_lib ${Libs})
string(REGEX REPLACE "[^_A-Za-z0-9]" "_" _cmake_lib_name ${_lib})
if (NOT TARGET Qt5::Gui_${_cmake_lib_name})
find_library(Qt5Gui_${_cmake_lib_name}_LIBRARY ${_lib}
!!IF !isEmpty(CROSS_COMPILE)
- PATHS \"${LibDir}\" NO_DEFAULT_PATH
+ PATHS \"${LibDir}\"
+!!IF !mac
+ NO_DEFAULT_PATH
+!!ENDIF
!!ENDIF
)
!!IF mac
@@ -92,7 +114,7 @@ macro(_qt5gui_find_extra_libs Name Libs LibDir IncDirs)
endif()
endif()
add_library(Qt5::Gui_${_cmake_lib_name} SHARED IMPORTED)
- set_property(TARGET Qt5::Gui_${_cmake_lib_name} APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${IncDirs})
+ set_property(TARGET Qt5::Gui_${_cmake_lib_name} APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${Qt5Gui_${Name}_INCLUDE_DIRS})
set_property(TARGET Qt5::Gui_${_cmake_lib_name} APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
_qt5_Gui_check_file_exists(\"${Qt5Gui_${_cmake_lib_name}_LIBRARY}\")
@@ -104,7 +126,11 @@ macro(_qt5gui_find_extra_libs Name Libs LibDir IncDirs)
unset(Qt5Gui_${_cmake_lib_name}_LIBRARY CACHE)
find_library(Qt5Gui_${_cmake_lib_name}_LIBRARY_DEBUG ${_lib}d
- PATHS \"${LibDir}\" NO_DEFAULT_PATH)
+ PATHS \"${LibDir}\"
+!!IF !mac
+ NO_DEFAULT_PATH
+!!ENDIF
+ )
if (Qt5Gui_${_cmake_lib_name}_LIBRARY_DEBUG)
set_property(TARGET Qt5::Gui_${_cmake_lib_name} APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG)
_qt5_Gui_check_file_exists(\"${Qt5Gui_${_cmake_lib_name}_LIBRARY_DEBUG}\")
@@ -118,7 +144,7 @@ macro(_qt5gui_find_extra_libs Name Libs LibDir IncDirs)
list(APPEND Qt5Gui_${Name}_LIBRARIES Qt5::Gui_${_cmake_lib_name})
endforeach()
if (NOT CMAKE_CROSSCOMPILING)
- foreach(_dir ${IncDirs})
+ foreach(_dir ${Qt5Gui_${Name}_INCLUDE_DIRS})
_qt5_Gui_check_file_exists(${_dir})
endforeach()
endif()
diff --git a/src/gui/accessible/accessible.pri b/src/gui/accessible/accessible.pri
index 9453ac20d0..615323dbec 100644
--- a/src/gui/accessible/accessible.pri
+++ b/src/gui/accessible/accessible.pri
@@ -4,7 +4,6 @@ contains(QT_CONFIG, accessibility) {
HEADERS += \
accessible/qaccessible.h \
accessible/qaccessiblecache_p.h \
- accessible/qaccessible2_p.h \
accessible/qaccessibleobject.h \
accessible/qaccessibleplugin.h \
accessible/qplatformaccessibility.h
diff --git a/src/gui/accessible/qaccessible.cpp b/src/gui/accessible/qaccessible.cpp
index b8771ec583..5d28512697 100644
--- a/src/gui/accessible/qaccessible.cpp
+++ b/src/gui/accessible/qaccessible.cpp
@@ -1270,8 +1270,16 @@ QAccessibleInterface::~QAccessibleInterface()
/*! \fn QAccessibleEvent::QAccessibleEvent(QObject *object, QAccessible::Event type)
Constructs a QAccessibleEvent to notify that \a object has changed.
- The event \a type explains what changed.
- */
+ The event \a type describes what changed.
+*/
+
+/*! \fn QAccessibleEvent::QAccessibleEvent(QAccessibleInterface *interface, QAccessible::Event type)
+
+ Constructs a QAccessibleEvent to notify that \a interface has changed.
+ The event \a type describes what changed.
+ Use this function if you already have a QAccessibleInterface or no QObject, otherwise consider
+ the overload taking a \l QObject parameter as it might be cheaper.
+*/
/*! \fn QAccessibleEvent::~QAccessibleEvent()
Destroys the event.
@@ -1293,6 +1301,22 @@ QAccessibleInterface::~QAccessibleInterface()
Returns the child index.
*/
+/*!
+ \internal
+ Returns the uniqueId of the QAccessibleInterface represented by this event.
+
+ In case the object() function returns 0 this is the only way to access the
+ interface.
+*/
+QAccessible::Id QAccessibleEvent::uniqueId() const
+{
+ if (!m_object)
+ return m_uniqueId;
+ QAccessibleInterface *iface = QAccessible::queryAccessibleInterface(m_object);
+ if (m_child != -1)
+ iface = iface->child(m_child);
+ return QAccessible::uniqueId(iface);
+}
/*!
\class QAccessibleValueChangeEvent
@@ -1530,6 +1554,9 @@ QAccessibleInterface::~QAccessibleInterface()
*/
QAccessibleInterface *QAccessibleEvent::accessibleInterface() const
{
+ if (m_object == 0)
+ return QAccessible::accessibleInterface(m_uniqueId);
+
QAccessibleInterface *iface = QAccessible::queryAccessibleInterface(m_object);
if (!iface || !iface->isValid()) {
static bool hasWarned = false;
@@ -1681,9 +1708,13 @@ QDebug operator<<(QDebug d, const QAccessibleEvent &ev)
d << "QAccessibleEvent(null)";
return d;
}
- d.nospace() << "QAccessibleEvent(object=" << hex << ev.object();
- d.nospace() << dec;
- d.nospace() << "child=" << ev.child();
+ d.nospace() << "QAccessibleEvent(";
+ if (ev.object()) {
+ d.nospace() << "object=" << hex << ev.object() << dec;
+ d.nospace() << "child=" << ev.child();
+ } else {
+ d.nospace() << "no object, uniqueId=" << ev.uniqueId();
+ }
d << " event=" << qAccessibleEventString(ev.type());
if (ev.type() == QAccessible::StateChanged) {
QAccessible::State changed = static_cast<const QAccessibleStateChangeEvent*>(&ev)->changedStates();
diff --git a/src/gui/accessible/qaccessible.h b/src/gui/accessible/qaccessible.h
index d5b0af550e..25ce161940 100644
--- a/src/gui/accessible/qaccessible.h
+++ b/src/gui/accessible/qaccessible.h
@@ -597,6 +597,7 @@ class Q_GUI_EXPORT QAccessibleEvent
{
Q_DISABLE_COPY(QAccessibleEvent)
public:
+
inline QAccessibleEvent(QObject *obj, QAccessible::Event typ)
: m_type(typ), m_object(obj), m_child(-1)
{
@@ -613,11 +614,27 @@ public:
Q_ASSERT(m_type != QAccessible::TableModelChanged);
}
+ inline QAccessibleEvent(QAccessibleInterface *iface, QAccessible::Event typ)
+ : m_type(typ), m_object(0)
+ {
+ Q_ASSERT(iface);
+ Q_ASSERT(m_type != QAccessible::ValueChanged);
+ Q_ASSERT(m_type != QAccessible::StateChanged);
+ Q_ASSERT(m_type != QAccessible::TextCaretMoved);
+ Q_ASSERT(m_type != QAccessible::TextSelectionChanged);
+ Q_ASSERT(m_type != QAccessible::TextInserted);
+ Q_ASSERT(m_type != QAccessible::TextRemoved);
+ Q_ASSERT(m_type != QAccessible::TextUpdated);
+ Q_ASSERT(m_type != QAccessible::TableModelChanged);
+ m_uniqueId = QAccessible::uniqueId(iface);
+ }
+
virtual ~QAccessibleEvent()
{}
QAccessible::Event type() const { return m_type; }
QObject *object() const { return m_object; }
+ QAccessible::Id uniqueId() const;
void setChild(int chld) { m_child = chld; }
int child() const { return m_child; }
@@ -627,7 +644,11 @@ public:
protected:
QAccessible::Event m_type;
QObject *m_object;
- int m_child;
+ union {
+ int m_child;
+ QAccessible::Id m_uniqueId;
+ };
+
};
class Q_GUI_EXPORT QAccessibleStateChangeEvent :public QAccessibleEvent
@@ -638,6 +659,11 @@ public:
{
m_type = QAccessible::StateChanged;
}
+ inline QAccessibleStateChangeEvent(QAccessibleInterface *iface, QAccessible::State state)
+ : QAccessibleEvent(iface, QAccessible::InvalidEvent), m_changedStates(state)
+ {
+ m_type = QAccessible::StateChanged;
+ }
QAccessible::State changedStates() const {
return m_changedStates;
@@ -657,6 +683,12 @@ public:
{
m_type = QAccessible::TextCaretMoved;
}
+ inline QAccessibleTextCursorEvent(QAccessibleInterface *iface, int cursorPos)
+ : QAccessibleEvent(iface, QAccessible::InvalidEvent)
+ , m_cursorPosition(cursorPos)
+ {
+ m_type = QAccessible::TextCaretMoved;
+ }
void setCursorPosition(int position) { m_cursorPosition = position; }
int cursorPosition() const { return m_cursorPosition; }
@@ -675,6 +707,12 @@ public:
{
m_type = QAccessible::TextSelectionChanged;
}
+ inline QAccessibleTextSelectionEvent(QAccessibleInterface *iface, int start, int end)
+ : QAccessibleTextCursorEvent(iface, (start == -1) ? 0 : end)
+ , m_selectionStart(start), m_selectionEnd(end)
+ {
+ m_type = QAccessible::TextSelectionChanged;
+ }
void setSelection(int start, int end) {
m_selectionStart = start;
@@ -698,6 +736,12 @@ public:
{
m_type = QAccessible::TextInserted;
}
+ inline QAccessibleTextInsertEvent(QAccessibleInterface *iface, int position, const QString &text)
+ : QAccessibleTextCursorEvent(iface, position + text.length())
+ , m_position(position), m_text(text)
+ {
+ m_type = QAccessible::TextInserted;
+ }
QString textInserted() const {
return m_text;
@@ -720,6 +764,12 @@ public:
{
m_type = QAccessible::TextRemoved;
}
+ inline QAccessibleTextRemoveEvent(QAccessibleInterface *iface, int position, const QString &text)
+ : QAccessibleTextCursorEvent(iface, position)
+ , m_position(position), m_text(text)
+ {
+ m_type = QAccessible::TextRemoved;
+ }
QString textRemoved() const {
return m_text;
@@ -742,6 +792,12 @@ public:
{
m_type = QAccessible::TextUpdated;
}
+ inline QAccessibleTextUpdateEvent(QAccessibleInterface *iface, int position, const QString &oldText, const QString &text)
+ : QAccessibleTextCursorEvent(iface, position + text.length())
+ , m_position(position), m_oldText(oldText), m_text(text)
+ {
+ m_type = QAccessible::TextUpdated;
+ }
QString textRemoved() const {
return m_oldText;
}
@@ -767,6 +823,12 @@ public:
{
m_type = QAccessible::ValueChanged;
}
+ inline QAccessibleValueChangeEvent(QAccessibleInterface *iface, const QVariant &val)
+ : QAccessibleEvent(iface, QAccessible::InvalidEvent)
+ , m_value(val)
+ {
+ m_type = QAccessible::ValueChanged;
+ }
void setValue(const QVariant & val) { m_value= val; }
QVariant value() const { return m_value; }
@@ -794,6 +856,14 @@ public:
{
m_type = QAccessible::TableModelChanged;
}
+ inline QAccessibleTableModelChangeEvent(QAccessibleInterface *iface, ModelChangeType changeType)
+ : QAccessibleEvent(iface, QAccessible::InvalidEvent)
+ , m_modelChangeType(changeType)
+ , m_firstRow(-1), m_firstColumn(-1), m_lastRow(-1), m_lastColumn(-1)
+ {
+ m_type = QAccessible::TableModelChanged;
+ }
+
void setModelChangeType(ModelChangeType changeType) { m_modelChangeType = changeType; }
ModelChangeType modelChangeType() const { return m_modelChangeType; }
diff --git a/src/gui/accessible/qaccessible2_p.h b/src/gui/accessible/qaccessible2_p.h
deleted file mode 100644
index bb5ddf6edf..0000000000
--- a/src/gui/accessible/qaccessible2_p.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the QtGui module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QACCESSIBLE2_H
-#define QACCESSIBLE2_H
-
-#endif
diff --git a/src/gui/doc/qtgui.qdocconf b/src/gui/doc/qtgui.qdocconf
index ed30172376..a963f55dc8 100644
--- a/src/gui/doc/qtgui.qdocconf
+++ b/src/gui/doc/qtgui.qdocconf
@@ -2,7 +2,7 @@ include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf)
project = QtGui
description = Qt GUI Reference Documentation
-url = http://qt-project.org/doc/qt-$QT_VER/qtgui
+url = http://qt-project.org/doc/qt-$QT_VER
version = $QT_VERSION
examplesinstallpath = gui
diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp
index 234742e6b9..0916826529 100644
--- a/src/gui/image/qimage.cpp
+++ b/src/gui/image/qimage.cpp
@@ -2324,7 +2324,7 @@ static bool convert_RGB_to_RGB16_inplace(QImageData *data, Qt::ImageConversionFl
static void convert_ARGB_PM_to_ARGB(QImageData *dest, const QImageData *src, Qt::ImageConversionFlags)
{
Q_ASSERT(src->format == QImage::Format_ARGB32_Premultiplied || src->format == QImage::Format_RGBA8888_Premultiplied);
- Q_ASSERT(dest->format == QImage::Format_ARGB32 || src->format == QImage::Format_RGBA8888);
+ Q_ASSERT(dest->format == QImage::Format_ARGB32 || dest->format == QImage::Format_RGBA8888);
Q_ASSERT(src->width == dest->width);
Q_ASSERT(src->height == dest->height);
@@ -3853,6 +3853,9 @@ static InPlace_Image_Converter inplace_converter_map[QImage::NImageFormats][QIma
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
}, // Format_RGB444
{
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+ }, // Format_ARGB4444_Premultiplied
+ {
0,
0,
0,
@@ -3989,7 +3992,7 @@ void qGamma_correct_back_to_linear_cs(QImage *image)
The specified image conversion \a flags control how the image data
is handled during the conversion process.
- \sa {QImage#Image Format}{Image Format}
+ \sa {Image Formats}
*/
QImage QImage::convertToFormat(Format format, Qt::ImageConversionFlags flags) const
{
diff --git a/src/gui/image/qimageiohandler.cpp b/src/gui/image/qimageiohandler.cpp
index 04e3213c53..d67b22c31e 100644
--- a/src/gui/image/qimageiohandler.cpp
+++ b/src/gui/image/qimageiohandler.cpp
@@ -187,11 +187,15 @@
return this handler.
The json metadata file for the plugin needs to contain information
- about the image formats the plugins supports. For a jpeg plugin, this
- could e.g. look as follows:
+ about the image formats the plugins supports, together with the
+ corresponding MIME types (one for each format). For a jpeg plugin, this
+ could, for example, look as follows:
\code
- { "Keys": [ "jpg", "jpeg" ] }
+ {
+ "Keys": [ "jpg", "jpeg" ],
+ "MimeTypes": [ "image/jpeg", "image/jpeg" ]
+ }
\endcode
Different plugins can support different capabilities. For example,
@@ -537,23 +541,33 @@ QImageIOPlugin::~QImageIOPlugin()
/*! \fn QImageIOPlugin::capabilities(QIODevice *device, const QByteArray &format) const
- Returns the capabilities on the plugin, based on the data in \a
- device and the format \a format. For example, if the
- QImageIOHandler supports the BMP format, and the data in the
- device starts with the characters "BM", this function should
- return \l CanRead. If \a format is "bmp" and the handler supports
- both reading and writing, this function should return \l CanRead |
- \l CanWrite.
+ Returns the capabilities of the plugin, based on the data in \a
+ device and the format \a format. If \a device is \c 0, it should
+ simply report whether the format can be read or written. Otherwise,
+ it should attempt to determine whether the given format (or any
+ format supported by the plugin if \a format is empty) can be read
+ from or written to \a device. It should do this without changing
+ the state of \a device (typically by using QIODevice::peek()).
+
+ For example, if the QImageIOPlugin supports the BMP format, \a format
+ is either empty or \c "bmp", and the data in the device starts with the
+ characters \c "BM", this function should return \l CanRead. If \a format
+ is \c "bmp", \a device is \c 0 and the handler supports both reading and
+ writing, this function should return \l CanRead | \l CanWrite.
+
+ Format names are always given in lower case.
*/
/*!
\fn QImageIOHandler *QImageIOPlugin::create(QIODevice *device, const QByteArray &format) const
Creates and returns a QImageIOHandler subclass, with \a device
- and \a format set. The \a format must come from the list returned by keys().
- Format names are case sensitive.
+ and \a format set. The \a format must come from the values listed
+ in the \c "Keys" entry in the plugin metadata, or be empty. If it is
+ empty, the data in \a device must have been recognized by the
+ capabilities() method (with a likewise empty format).
- \sa keys()
+ Format names are always given in lower case.
*/
#endif // QT_NO_IMAGEFORMATPLUGIN
diff --git a/src/gui/image/qimagewriter.cpp b/src/gui/image/qimagewriter.cpp
index e4065724be..900093b51b 100644
--- a/src/gui/image/qimagewriter.cpp
+++ b/src/gui/image/qimagewriter.cpp
@@ -772,7 +772,9 @@ QList<QByteArray> QImageWriter::supportedImageFormats()
QList<QByteArray> QImageWriter::supportedMimeTypes()
{
QSet<QByteArray> mimeTypes;
+#ifndef QT_NO_IMAGEFORMAT_BMP
mimeTypes << "image/bmp";
+#endif
#ifndef QT_NO_IMAGEFORMAT_PPM
mimeTypes << "image/x-portable-bitmap";
mimeTypes << "image/x-portable-graymap";
diff --git a/src/gui/image/qpixmap.cpp b/src/gui/image/qpixmap.cpp
index 5f51358eb2..a620d34553 100644
--- a/src/gui/image/qpixmap.cpp
+++ b/src/gui/image/qpixmap.cpp
@@ -73,7 +73,7 @@ QT_BEGIN_NAMESPACE
static bool qt_pixmap_thread_test()
{
if (!QCoreApplication::instance()) {
- qFatal("QPixmap: Must construct a QApplication before a QPaintDevice");
+ qFatal("QPixmap: Must construct a QGuiApplication before a QPixmap");
return false;
}
diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp
index 816419d155..ae63b8bc32 100644
--- a/src/gui/kernel/qevent.cpp
+++ b/src/gui/kernel/qevent.cpp
@@ -118,7 +118,7 @@ QInputEvent::~QInputEvent()
Returns the keyboard modifier flags that existed immediately
before the event occurred.
- \sa QApplication::keyboardModifiers()
+ \sa QGuiApplication::keyboardModifiers()
*/
/*! \fn void QInputEvent::setModifiers(Qt::KeyboardModifiers modifiers)
@@ -331,7 +331,7 @@ Qt::MouseEventSource QMouseEvent::source() const
Returns the position of the mouse cursor as a QPointF, relative to the
screen that received the event.
- \sa x(), y(), pos(), localPos(), screenPos()
+ \sa x(), y(), pos(), localPos(), windowPos()
*/
/*!
@@ -1023,7 +1023,7 @@ QKeyEvent::~QKeyEvent()
confuse it by pressing both \uicontrol{Shift} keys simultaneously and
releasing one of them, for example.
- \sa QApplication::keyboardModifiers()
+ \sa QGuiApplication::keyboardModifiers()
*/
Qt::KeyboardModifiers QKeyEvent::modifiers() const
@@ -1375,7 +1375,7 @@ QResizeEvent::~QResizeEvent()
signal when they are deleted.
If the last top-level window is closed, the
- QApplication::lastWindowClosed() signal is emitted.
+ QGuiApplication::lastWindowClosed() signal is emitted.
The isAccepted() function returns \c true if the event's receiver has
agreed to close the widget; call accept() to agree to close the
@@ -1384,7 +1384,7 @@ QResizeEvent::~QResizeEvent()
\sa QWidget::close(), QWidget::hide(), QObject::destroyed(),
QCoreApplication::exec(), QCoreApplication::quit(),
- QApplication::lastWindowClosed()
+ QGuiApplication::lastWindowClosed()
*/
/*!
@@ -2694,9 +2694,8 @@ QDragEnterEvent::~QDragEnterEvent()
is within its boundaries, if it accepts
\l{QWidget::setAcceptDrops()}{drop events} and \l
{QWidget::dragEnterEvent()}{enter events}. The widget should
- examine the event to see what kind of data it
- \l{QDragMoveEvent::provides()}{provides}, and call the accept()
- function to accept the drop if appropriate.
+ examine the event to see what kind of \l{mimeData()}{data} it
+ provides, and call the accept() function to accept the drop if appropriate.
The rectangle supplied by the answerRect() function can be used to restrict
drops to certain parts of the widget. For example, we can check whether the
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp
index db655bd2ad..9f95f2c234 100644
--- a/src/gui/kernel/qguiapplication.cpp
+++ b/src/gui/kernel/qguiapplication.cpp
@@ -1672,41 +1672,36 @@ void QGuiApplicationPrivate::processKeyEvent(QWindowSystemInterfacePrivate::KeyE
QWindow *window = e->window.data();
modifier_buttons = e->modifiers;
if (e->nullWindow
-#ifdef Q_OS_ANDROID
- || (e->keyType == QEvent::KeyRelease && e->key == Qt::Key_Back) || e->key == Qt::Key_Menu
+#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_NO_SDK)
+ || e->key == Qt::Key_Back || e->key == Qt::Key_Menu
#endif
) {
window = QGuiApplication::focusWindow();
}
- if (!window
-#ifdef Q_OS_ANDROID
- && e->keyType != QEvent::KeyRelease && e->key != Qt::Key_Back
-#endif
- ) {
- return;
- }
- if (window && window->d_func()->blockedByModalWindow) {
- // a modal window is blocking this window, don't allow key events through
- return;
- }
QKeyEvent ev(e->keyType, e->key, e->modifiers,
e->nativeScanCode, e->nativeVirtualKey, e->nativeModifiers,
e->unicode, e->repeat, e->repeatCount);
ev.setTimestamp(e->timestamp);
-#ifdef Q_OS_ANDROID
- if (e->keyType == QEvent::KeyRelease && e->key == Qt::Key_Back) {
- if (!window) {
+ // only deliver key events when we have a window, and no modal window is blocking this window
+
+ if (window && !window->d_func()->blockedByModalWindow)
+ QGuiApplication::sendSpontaneousEvent(window, &ev);
+#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_NO_SDK)
+ else
+ ev.setAccepted(false);
+
+ static bool backKeyPressAccepted = false;
+ if (e->keyType == QEvent::KeyPress) {
+ backKeyPressAccepted = e->key == Qt::Key_Back && ev.isAccepted();
+ } else if (e->keyType == QEvent::KeyRelease && e->key == Qt::Key_Back && !backKeyPressAccepted && !ev.isAccepted()) {
+ if (!window)
qApp->quit();
- } else {
- QGuiApplication::sendEvent(window, &ev);
- if (!ev.isAccepted() && e->key == Qt::Key_Back)
- QWindowSystemInterface::handleCloseEvent(window);
- }
- } else
+ else
+ QWindowSystemInterface::handleCloseEvent(window);
+ }
#endif
- QGuiApplication::sendSpontaneousEvent(window, &ev);
}
void QGuiApplicationPrivate::processEnterEvent(QWindowSystemInterfacePrivate::EnterEvent *e)
@@ -1834,33 +1829,33 @@ void QGuiApplicationPrivate::processGeometryChangeEvent(QWindowSystemInterfacePr
return;
QRect newRect = e->newGeometry;
- QRect cr = window->d_func()->geometry;
+ QRect oldRect = e->oldGeometry.isNull() ? window->d_func()->geometry : e->oldGeometry;
- bool isResize = cr.size() != newRect.size();
- bool isMove = cr.topLeft() != newRect.topLeft();
+ bool isResize = oldRect.size() != newRect.size();
+ bool isMove = oldRect.topLeft() != newRect.topLeft();
window->d_func()->geometry = newRect;
if (isResize || window->d_func()->resizeEventPending) {
- QResizeEvent e(newRect.size(), cr.size());
+ QResizeEvent e(newRect.size(), oldRect.size());
QGuiApplication::sendSpontaneousEvent(window, &e);
window->d_func()->resizeEventPending = false;
- if (cr.width() != newRect.width())
+ if (oldRect.width() != newRect.width())
window->widthChanged(newRect.width());
- if (cr.height() != newRect.height())
+ if (oldRect.height() != newRect.height())
window->heightChanged(newRect.height());
}
if (isMove) {
//### frame geometry
- QMoveEvent e(newRect.topLeft(), cr.topLeft());
+ QMoveEvent e(newRect.topLeft(), oldRect.topLeft());
QGuiApplication::sendSpontaneousEvent(window, &e);
- if (cr.x() != newRect.x())
+ if (oldRect.x() != newRect.x())
window->xChanged(newRect.x());
- if (cr.y() != newRect.y())
+ if (oldRect.y() != newRect.y())
window->yChanged(newRect.y());
}
}
@@ -2813,6 +2808,27 @@ bool QGuiApplication::isSavingSession() const
return d->is_saving_session;
}
+/*!
+ \since 5.2
+
+ Function that can be used to sync Qt state with the Window Systems state.
+
+ This function will first empty Qts events by calling QCoreApplication::processEvents(),
+ then the platform plugin will sync up with the windowsystem, and finally Qts events
+ will be delived by another call to QCoreApplication::processEvents();
+
+ This function is timeconsuming and its use is discouraged.
+*/
+void QGuiApplication::sync()
+{
+ QCoreApplication::processEvents();
+ if (QGuiApplicationPrivate::platform_integration
+ && QGuiApplicationPrivate::platform_integration->hasCapability(QPlatformIntegration::SyncState)) {
+ QGuiApplicationPrivate::platform_integration->sync();
+ QCoreApplication::processEvents();
+ }
+}
+
void QGuiApplicationPrivate::commitData()
{
Q_Q(QGuiApplication);
diff --git a/src/gui/kernel/qguiapplication.h b/src/gui/kernel/qguiapplication.h
index bd42f18418..0089d48fa6 100644
--- a/src/gui/kernel/qguiapplication.h
+++ b/src/gui/kernel/qguiapplication.h
@@ -155,6 +155,7 @@ public:
bool isSavingSession() const;
#endif
+ static void sync();
Q_SIGNALS:
void fontDatabaseChanged();
void screenAdded(QScreen *screen);
diff --git a/src/gui/kernel/qkeysequence_p.h b/src/gui/kernel/qkeysequence_p.h
index eac0d4b0a6..3751660500 100644
--- a/src/gui/kernel/qkeysequence_p.h
+++ b/src/gui/kernel/qkeysequence_p.h
@@ -69,6 +69,7 @@ struct Q_AUTOTEST_EXPORT QKeyBinding
class Q_AUTOTEST_EXPORT QKeySequencePrivate
{
public:
+ enum { MaxKeyCount = 4 }; // used in QKeySequenceEdit
inline QKeySequencePrivate() : ref(1)
{
key[0] = key[1] = key[2] = key[3] = 0;
diff --git a/src/gui/kernel/qopenglcontext.cpp b/src/gui/kernel/qopenglcontext.cpp
index ab782fac34..39dd2a2dfa 100644
--- a/src/gui/kernel/qopenglcontext.cpp
+++ b/src/gui/kernel/qopenglcontext.cpp
@@ -56,9 +56,7 @@
#include <private/qopenglextensions_p.h>
#include <private/qopenglversionfunctionsfactory_p.h>
-#if !defined(QT_OPENGL_ES_2)
#include <private/qopengltexturehelper_p.h>
-#endif
#include <QDebug>
@@ -274,7 +272,7 @@ QMutex QOpenGLContextPrivate::makeCurrentTrackerMutex;
or OpenGL ES 1.x.
For more information about the OpenGL API, refer to the official
- \l{OpenGL documentation}.
+ \l{http://www.opengl.org}{OpenGL documentation}.
For an example of how to use QOpenGLContext see the
\l{OpenGL Window Example}{OpenGL Window} example.
@@ -527,10 +525,8 @@ void QOpenGLContext::destroy()
d->versionFunctions.clear();
qDeleteAll(d->versionFunctionsBackend);
d->versionFunctionsBackend.clear();
-#if !defined(QT_OPENGL_ES_2)
delete d->textureFunctions;
d->textureFunctions = 0;
-#endif
}
/*!
@@ -591,6 +587,8 @@ QOpenGLFunctions *QOpenGLContext::functions() const
/*!
\fn T *QOpenGLContext::versionFunctions() const
+ \overload versionFunctions()
+
Returns a pointer to an object that provides access to all functions for
the version and profile of this context. Before using any of the functions
they must be initialized by calling QAbstractOpenGLFunctions::initializeOpenGLFunctions().
@@ -640,8 +638,6 @@ QOpenGLFunctions *QOpenGLContext::functions() const
Usually one would use the template version of this function to automatically
have the result cast to the correct type.
-
- \sa T *QOpenGLContext::versionFunctions()
*/
QAbstractOpenGLFunctions *QOpenGLContext::versionFunctions(const QOpenGLVersionProfile &versionProfile) const
{
@@ -984,7 +980,6 @@ void QOpenGLContext::removeFunctionsBackend(const QOpenGLVersionStatus &v)
d->versionFunctionsBackend.remove(v);
}
-#if !defined(QT_OPENGL_ES_2)
/*!
\internal
*/
@@ -1002,7 +997,6 @@ void QOpenGLContext::setTextureFunctions(QOpenGLTextureHelper* textureFuncs)
Q_D(QOpenGLContext);
d->textureFunctions = textureFuncs;
}
-#endif
/*!
\class QOpenGLContextGroup
diff --git a/src/gui/kernel/qopenglcontext.h b/src/gui/kernel/qopenglcontext.h
index 9756be30df..ce34a2d5a5 100644
--- a/src/gui/kernel/qopenglcontext.h
+++ b/src/gui/kernel/qopenglcontext.h
@@ -221,10 +221,8 @@ private:
QOpenGLVersionFunctionsBackend *backend);
void removeFunctionsBackend(const QOpenGLVersionStatus &v);
-#if !defined(QT_OPENGL_ES_2)
QOpenGLTextureHelper* textureFunctions() const;
void setTextureFunctions(QOpenGLTextureHelper* textureFuncs);
-#endif
void destroy();
};
diff --git a/src/gui/kernel/qplatformdialoghelper.cpp b/src/gui/kernel/qplatformdialoghelper.cpp
index fe5db27117..5ddd718e69 100644
--- a/src/gui/kernel/qplatformdialoghelper.cpp
+++ b/src/gui/kernel/qplatformdialoghelper.cpp
@@ -693,6 +693,48 @@ QMessageDialogOptions::StandardButtons QMessageDialogOptions::standardButtons()
return d->buttons;
}
+QMessageDialogOptions::ButtonRole QMessageDialogOptions::buttonRole(QMessageDialogOptions::StandardButton button)
+{
+ switch (button) {
+ case Ok:
+ case Save:
+ case Open:
+ case SaveAll:
+ case Retry:
+ case Ignore:
+ return AcceptRole;
+
+ case Cancel:
+ case Close:
+ case Abort:
+ return RejectRole;
+
+ case Discard:
+ return DestructiveRole;
+
+ case Help:
+ return HelpRole;
+
+ case Apply:
+ return ApplyRole;
+
+ case Yes:
+ case YesToAll:
+ return YesRole;
+
+ case No:
+ case NoToAll:
+ return NoRole;
+
+ case RestoreDefaults:
+ case Reset:
+ return ResetRole;
+
+ default:
+ break;
+ }
+ return InvalidRole;
+}
/*!
\class QPlatformMessageDialogHelper
diff --git a/src/gui/kernel/qplatformdialoghelper.h b/src/gui/kernel/qplatformdialoghelper.h
index ad818c8644..9eeb0a6da4 100644
--- a/src/gui/kernel/qplatformdialoghelper.h
+++ b/src/gui/kernel/qplatformdialoghelper.h
@@ -361,6 +361,21 @@ public:
Q_DECLARE_FLAGS(StandardButtons, StandardButton)
+ enum ButtonRole {
+ InvalidRole = -1,
+ AcceptRole,
+ RejectRole,
+ DestructiveRole,
+ ActionRole,
+ HelpRole,
+ YesRole,
+ NoRole,
+ ResetRole,
+ ApplyRole,
+
+ NRoles
+ };
+
QMessageDialogOptions();
QMessageDialogOptions(const QMessageDialogOptions &rhs);
QMessageDialogOptions &operator=(const QMessageDialogOptions &rhs);
@@ -386,6 +401,8 @@ public:
void setStandardButtons(StandardButtons buttons);
StandardButtons standardButtons() const;
+ static ButtonRole buttonRole(StandardButton button);
+
private:
QSharedDataPointer<QMessageDialogOptionsPrivate> d;
};
@@ -400,7 +417,7 @@ public:
void setOptions(const QSharedPointer<QMessageDialogOptions> &options);
Q_SIGNALS:
- void clicked(QMessageDialogOptions::StandardButton button);
+ void clicked(QMessageDialogOptions::StandardButton button, QMessageDialogOptions::ButtonRole role);
private:
QSharedPointer<QMessageDialogOptions> m_options;
diff --git a/src/gui/kernel/qplatformintegration.cpp b/src/gui/kernel/qplatformintegration.cpp
index 49ac7836cb..26aaf931b3 100644
--- a/src/gui/kernel/qplatformintegration.cpp
+++ b/src/gui/kernel/qplatformintegration.cpp
@@ -343,6 +343,8 @@ QVariant QPlatformIntegration::styleHint(StyleHint hint) const
return QPlatformTheme::defaultThemeHint(QPlatformTheme::StartDragTime);
case ShowIsFullScreen:
return false;
+ case ShowIsMaximized:
+ return false;
case PasswordMaskDelay:
return QPlatformTheme::defaultThemeHint(QPlatformTheme::PasswordMaskDelay);
case PasswordMaskCharacter:
@@ -362,6 +364,20 @@ QVariant QPlatformIntegration::styleHint(StyleHint hint) const
return 0;
}
+Qt::WindowState QPlatformIntegration::defaultWindowState(Qt::WindowFlags flags) const
+{
+ // Leave popup-windows as is
+ if (flags & Qt::Popup & ~Qt::Window)
+ return Qt::WindowNoState;
+
+ if (styleHint(QPlatformIntegration::ShowIsFullScreen).toBool())
+ return Qt::WindowFullScreen;
+ else if (styleHint(QPlatformIntegration::ShowIsMaximized).toBool())
+ return Qt::WindowMaximized;
+
+ return Qt::WindowNoState;
+}
+
Qt::KeyboardModifiers QPlatformIntegration::queryKeyboardModifiers() const
{
return QGuiApplication::keyboardModifiers();
@@ -435,4 +451,19 @@ QPlatformSessionManager *QPlatformIntegration::createPlatformSessionManager(cons
}
#endif
+/*!
+ \since 5.2
+
+ Function to sync the platform integrations state with the window system.
+
+ This is often implemented as a roundtrip from the platformintegration to the window system.
+
+ This function should not call QWindowSystemInterface::flushWindowSystemEvents() or
+ QCoreApplication::processEvents()
+*/
+void QPlatformIntegration::sync()
+{
+
+}
+
QT_END_NAMESPACE
diff --git a/src/gui/kernel/qplatformintegration.h b/src/gui/kernel/qplatformintegration.h
index d3189f8641..580fc15233 100644
--- a/src/gui/kernel/qplatformintegration.h
+++ b/src/gui/kernel/qplatformintegration.h
@@ -94,7 +94,8 @@ public:
ForeignWindows,
NonFullScreenWindows,
NativeWidgets,
- WindowManagement
+ WindowManagement,
+ SyncState
};
virtual ~QPlatformIntegration() { }
@@ -146,10 +147,12 @@ public:
UseRtlExtensions,
SynthesizeMouseFromTouchEvents,
PasswordMaskCharacter,
- SetFocusOnTouchRelease
+ SetFocusOnTouchRelease,
+ ShowIsMaximized
};
virtual QVariant styleHint(StyleHint hint) const;
+ virtual Qt::WindowState defaultWindowState(Qt::WindowFlags) const;
virtual Qt::KeyboardModifiers queryKeyboardModifiers() const;
virtual QList<int> possibleKeys(const QKeyEvent *) const;
@@ -162,6 +165,8 @@ public:
#ifndef QT_NO_SESSIONMANAGER
virtual QPlatformSessionManager *createPlatformSessionManager(const QString &id, const QString &key) const;
#endif
+
+ virtual void sync();
protected:
void screenAdded(QPlatformScreen *screen);
};
diff --git a/src/gui/kernel/qplatformsystemtrayicon_qpa.cpp b/src/gui/kernel/qplatformsystemtrayicon_qpa.cpp
index 5d7ff7864d..c4cec40a10 100644
--- a/src/gui/kernel/qplatformsystemtrayicon_qpa.cpp
+++ b/src/gui/kernel/qplatformsystemtrayicon_qpa.cpp
@@ -130,7 +130,7 @@ QPlatformSystemTrayIcon::~QPlatformSystemTrayIcon()
const QIcon &icon, MessageIcon iconType, int secs)
Shows a balloon message for the entry with the given \a title, message \a msg and \a icon for
the time specified in \a secs. \a iconType is used as a hint for the implementing platform.
- \sa QSystemTrayIcon::showMessage
+ \sa QSystemTrayIcon::showMessage()
*/
/*!
diff --git a/src/gui/kernel/qplatformtheme.cpp b/src/gui/kernel/qplatformtheme.cpp
index 562df1c913..1844232efe 100644
--- a/src/gui/kernel/qplatformtheme.cpp
+++ b/src/gui/kernel/qplatformtheme.cpp
@@ -50,6 +50,7 @@
#include <qtextformat.h>
#include <private/qiconloader_p.h>
#include <private/qguiapplication_p.h>
+#include <qpa/qplatformintegration.h>
QT_BEGIN_NAMESPACE
@@ -399,7 +400,32 @@ QPixmap QPlatformTheme::fileIconPixmap(const QFileInfo &fileInfo, const QSizeF &
QVariant QPlatformTheme::themeHint(ThemeHint hint) const
{
- return QPlatformTheme::defaultThemeHint(hint);
+ // For theme hints which mirror platform integration style hints, query
+ // the platform integration. The base QPlatformIntegration::styleHint()
+ // function will in turn query QPlatformTheme::defaultThemeHint() if there
+ // is no custom value.
+ switch (hint) {
+ case QPlatformTheme::CursorFlashTime:
+ return QGuiApplicationPrivate::platformIntegration()->styleHint(QPlatformIntegration::CursorFlashTime);
+ case QPlatformTheme::KeyboardInputInterval:
+ return QGuiApplicationPrivate::platformIntegration()->styleHint(QPlatformIntegration::KeyboardInputInterval);
+ case QPlatformTheme::KeyboardAutoRepeatRate:
+ return QGuiApplicationPrivate::platformIntegration()->styleHint(QPlatformIntegration::KeyboardAutoRepeatRate);
+ case QPlatformTheme::MouseDoubleClickInterval:
+ return QGuiApplicationPrivate::platformIntegration()->styleHint(QPlatformIntegration::MouseDoubleClickInterval);
+ case QPlatformTheme::StartDragDistance:
+ return QGuiApplicationPrivate::platformIntegration()->styleHint(QPlatformIntegration::StartDragDistance);
+ case QPlatformTheme::StartDragTime:
+ return QGuiApplicationPrivate::platformIntegration()->styleHint(QPlatformIntegration::StartDragTime);
+ case QPlatformTheme::StartDragVelocity:
+ return QGuiApplicationPrivate::platformIntegration()->styleHint(QPlatformIntegration::StartDragVelocity);
+ case QPlatformTheme::PasswordMaskDelay:
+ return QGuiApplicationPrivate::platformIntegration()->styleHint(QPlatformIntegration::PasswordMaskDelay);
+ case QPlatformTheme::PasswordMaskCharacter:
+ return QGuiApplicationPrivate::platformIntegration()->styleHint(QPlatformIntegration::PasswordMaskCharacter);
+ default:
+ return QPlatformTheme::defaultThemeHint(hint);
+ }
}
QVariant QPlatformTheme::defaultThemeHint(ThemeHint hint)
diff --git a/src/gui/kernel/qplatformwindow.cpp b/src/gui/kernel/qplatformwindow.cpp
index 1f9183db44..954d47f18c 100644
--- a/src/gui/kernel/qplatformwindow.cpp
+++ b/src/gui/kernel/qplatformwindow.cpp
@@ -487,6 +487,27 @@ bool QPlatformWindow::isAlertState() const
return false;
}
+// Return the effective screen for the initial geometry of a window. In a
+// multimonitor-setup, try to find the right screen by checking the transient
+// parent or the mouse cursor for parentless windows (cf QTBUG-34204,
+// QDialog::adjustPosition()).
+static inline const QScreen *effectiveScreen(const QWindow *window)
+{
+ if (!window)
+ return QGuiApplication::primaryScreen();
+ const QScreen *screen = window->screen();
+ if (!screen)
+ return QGuiApplication::primaryScreen();
+ const QList<QScreen *> siblings = screen->virtualSiblings();
+ if (siblings.size() > 1) {
+ const QPoint referencePoint = window->transientParent() ? window->transientParent()->geometry().center() : QCursor::pos();
+ foreach (const QScreen *sibling, siblings)
+ if (sibling->geometry().contains(referencePoint))
+ return sibling;
+ }
+ return screen;
+}
+
/*!
Helper function to get initial geometry on windowing systems which do not
do smart positioning and also do not provide a means of centering a
@@ -511,8 +532,8 @@ QRect QPlatformWindow::initialGeometry(const QWindow *w,
}
if (w->isTopLevel() && qt_window_private(const_cast<QWindow*>(w))->positionAutomatic
&& w->type() != Qt::Popup) {
- if (const QPlatformScreen *platformScreen = QPlatformScreen::platformScreenForWindow(w)) {
- const QRect availableGeometry = platformScreen->availableGeometry();
+ if (const QScreen *screen = effectiveScreen(w)) {
+ const QRect availableGeometry = screen->availableGeometry();
// Center unless the geometry ( + unknown window frame) is too large for the screen).
if (rect.height() < (availableGeometry.height() * 8) / 9
&& rect.width() < (availableGeometry.width() * 8) / 9) {
diff --git a/src/gui/kernel/qstylehints.cpp b/src/gui/kernel/qstylehints.cpp
index 7899e2540b..8d751d8615 100644
--- a/src/gui/kernel/qstylehints.cpp
+++ b/src/gui/kernel/qstylehints.cpp
@@ -270,6 +270,9 @@ int QStyleHints::cursorFlashTime() const
Returns \c true if the platform defaults to windows being fullscreen,
otherwise \c false.
+ \note The platform may still choose to show certain windows non-fullscreen,
+ such as popups or dialogs. This method only returns the default behavior.
+
\sa QWindow::show()
*/
bool QStyleHints::showIsFullScreen() const
diff --git a/src/gui/kernel/qsurfaceformat.cpp b/src/gui/kernel/qsurfaceformat.cpp
index b8fe55adc0..2b6cb2d949 100644
--- a/src/gui/kernel/qsurfaceformat.cpp
+++ b/src/gui/kernel/qsurfaceformat.cpp
@@ -468,7 +468,7 @@ bool QSurfaceFormat::hasAlpha() const
/*!
Set the preferred stencil buffer size to \a size bits.
- \sa stencilBufferSize(), setStencil(), stencil()
+ \sa stencilBufferSize()
*/
void QSurfaceFormat::setStencilBufferSize(int size)
{
@@ -481,7 +481,7 @@ void QSurfaceFormat::setStencilBufferSize(int size)
/*!
Returns the stencil buffer size in bits.
- \sa stencil(), setStencil(), setStencilBufferSize()
+ \sa setStencilBufferSize()
*/
int QSurfaceFormat::stencilBufferSize() const
{
diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp
index 13218fa178..2e1d8f9976 100644
--- a/src/gui/kernel/qwindow.cpp
+++ b/src/gui/kernel/qwindow.cpp
@@ -367,6 +367,10 @@ void QWindowPrivate::setScreen(QScreen *newScreen, bool recreate)
}
}
+void QWindowPrivate::clearFocusObject()
+{
+}
+
/*!
Sets the \a surfaceType of the window.
@@ -982,8 +986,13 @@ Qt::ScreenOrientation QWindow::contentOrientation() const
qreal QWindow::devicePixelRatio() const
{
Q_D(const QWindow);
+
+ // If there is no platform window, do the second best thing and
+ // return the app global devicePixelRatio. This is the highest
+ // devicePixelRatio found on the system screens, and will be
+ // correct for single-display systems (a very common case).
if (!d->platformWindow)
- return 1.0;
+ return qApp->devicePixelRatio();
return d->platformWindow->devicePixelRatio();
}
@@ -1642,17 +1651,18 @@ QObject *QWindow::focusObject() const
/*!
Shows the window.
- This equivalent to calling showFullScreen() or showNormal(), depending
- on whether the platform defaults to windows being fullscreen or not, and
- whether the window is a popup.
+ This is equivalent to calling showFullScreen(), showMaximized(), or showNormal(),
+ depending on the platform's default behavior for the window type and flags.
- \sa showFullScreen(), showNormal(), hide(), QStyleHints::showIsFullScreen(), flags()
+ \sa showFullScreen(), showMaximized(), showNormal(), hide(), QStyleHints::showIsFullScreen(), flags()
*/
void QWindow::show()
{
- bool isPopup = d_func()->windowFlags & Qt::Popup & ~Qt::Window;
- if (!isPopup && qApp->styleHints()->showIsFullScreen())
+ Qt::WindowState defaultState = QGuiApplicationPrivate::platformIntegration()->defaultWindowState(d_func()->windowFlags);
+ if (defaultState == Qt::WindowFullScreen)
showFullScreen();
+ else if (defaultState == Qt::WindowMaximized)
+ showMaximized();
else
showNormal();
}
diff --git a/src/gui/kernel/qwindow_p.h b/src/gui/kernel/qwindow_p.h
index f43c1ea8ec..8d8fca3ce6 100644
--- a/src/gui/kernel/qwindow_p.h
+++ b/src/gui/kernel/qwindow_p.h
@@ -129,6 +129,8 @@ public:
void setScreen(QScreen *newScreen, bool recreate);
+ virtual void clearFocusObject();
+
QWindow::SurfaceType surfaceType;
Qt::WindowFlags windowFlags;
QWindow *parentWindow;
diff --git a/src/gui/kernel/qwindowsysteminterface.cpp b/src/gui/kernel/qwindowsysteminterface.cpp
index 07717bb63d..49ff8bcb0d 100644
--- a/src/gui/kernel/qwindowsysteminterface.cpp
+++ b/src/gui/kernel/qwindowsysteminterface.cpp
@@ -141,9 +141,12 @@ void QWindowSystemInterface::handleApplicationStateChanged(Qt::ApplicationState
QWindowSystemInterfacePrivate::handleWindowSystemEvent(e);
}
-void QWindowSystemInterface::handleGeometryChange(QWindow *tlw, const QRect &newRect)
+/*!
+ If \a oldRect is null, Qt will use the previously reported geometry instead.
+ */
+void QWindowSystemInterface::handleGeometryChange(QWindow *tlw, const QRect &newRect, const QRect &oldRect)
{
- QWindowSystemInterfacePrivate::GeometryChangeEvent *e = new QWindowSystemInterfacePrivate::GeometryChangeEvent(tlw,newRect);
+ QWindowSystemInterfacePrivate::GeometryChangeEvent *e = new QWindowSystemInterfacePrivate::GeometryChangeEvent(tlw,newRect, oldRect);
QWindowSystemInterfacePrivate::handleWindowSystemEvent(e);
}
diff --git a/src/gui/kernel/qwindowsysteminterface.h b/src/gui/kernel/qwindowsysteminterface.h
index 0c3494a46d..71feb1bcb7 100644
--- a/src/gui/kernel/qwindowsysteminterface.h
+++ b/src/gui/kernel/qwindowsysteminterface.h
@@ -138,7 +138,7 @@ public:
static void handleTouchCancelEvent(QWindow *w, QTouchDevice *device, Qt::KeyboardModifiers mods = Qt::NoModifier);
static void handleTouchCancelEvent(QWindow *w, ulong timestamp, QTouchDevice *device, Qt::KeyboardModifiers mods = Qt::NoModifier);
- static void handleGeometryChange(QWindow *w, const QRect &newRect);
+ static void handleGeometryChange(QWindow *w, const QRect &newRect, const QRect &oldRect = QRect());
static void handleCloseEvent(QWindow *w, bool *accepted = 0);
static void handleEnterEvent(QWindow *w, const QPointF &local = QPointF(), const QPointF& global = QPointF());
static void handleLeaveEvent(QWindow *w);
diff --git a/src/gui/kernel/qwindowsysteminterface_p.h b/src/gui/kernel/qwindowsysteminterface_p.h
index f0398ffc51..367b0ac11d 100644
--- a/src/gui/kernel/qwindowsysteminterface_p.h
+++ b/src/gui/kernel/qwindowsysteminterface_p.h
@@ -117,11 +117,12 @@ public:
class GeometryChangeEvent : public WindowSystemEvent {
public:
- GeometryChangeEvent(QWindow *tlw, const QRect &newGeometry)
- : WindowSystemEvent(GeometryChange), tlw(tlw), newGeometry(newGeometry)
+ GeometryChangeEvent(QWindow *tlw, const QRect &newGeometry, const QRect &oldGeometry)
+ : WindowSystemEvent(GeometryChange), tlw(tlw), newGeometry(newGeometry), oldGeometry(oldGeometry)
{ }
QPointer<QWindow> tlw;
QRect newGeometry;
+ QRect oldGeometry;
};
class EnterEvent : public WindowSystemEvent {
diff --git a/src/gui/opengl/opengl.pri b/src/gui/opengl/opengl.pri
index 8212c0981f..d249b855f5 100644
--- a/src/gui/opengl/opengl.pri
+++ b/src/gui/opengl/opengl.pri
@@ -53,6 +53,17 @@ contains(QT_CONFIG, opengl)|contains(QT_CONFIG, opengles2) {
opengl/qopenglvertexarrayobject.cpp \
opengl/qopengldebug.cpp
+ !wince* {
+ HEADERS += opengl/qopengltexture.h \
+ opengl/qopengltexture_p.h \
+ opengl/qopengltexturehelper_p.h \
+ opengl/qopenglpixeltransferoptions.h
+
+ SOURCES += opengl/qopengltexture.cpp \
+ opengl/qopengltexturehelper.cpp \
+ opengl/qopenglpixeltransferoptions.cpp
+ }
+
!contains(QT_CONFIG, opengles2) {
HEADERS += opengl/qopenglfunctions_1_0.h \
opengl/qopenglfunctions_1_1.h \
@@ -77,11 +88,7 @@ contains(QT_CONFIG, opengl)|contains(QT_CONFIG, opengles2) {
opengl/qopenglfunctions_4_2_compatibility.h \
opengl/qopenglfunctions_4_3_compatibility.h \
opengl/qopenglqueryhelper_p.h \
- opengl/qopengltimerquery.h \
- opengl/qopengltexture.h \
- opengl/qopengltexture_p.h \
- opengl/qopengltexturehelper_p.h \
- opengl/qopenglpixeltransferoptions.h
+ opengl/qopengltimerquery.h
SOURCES += opengl/qopenglfunctions_1_0.cpp \
opengl/qopenglfunctions_1_1.cpp \
@@ -105,10 +112,7 @@ contains(QT_CONFIG, opengl)|contains(QT_CONFIG, opengles2) {
opengl/qopenglfunctions_4_1_compatibility.cpp \
opengl/qopenglfunctions_4_2_compatibility.cpp \
opengl/qopenglfunctions_4_3_compatibility.cpp \
- opengl/qopengltimerquery.cpp \
- opengl/qopengltexture.cpp \
- opengl/qopengltexturehelper.cpp \
- opengl/qopenglpixeltransferoptions.cpp
+ opengl/qopengltimerquery.cpp
}
contains(QT_CONFIG, opengles2) {
diff --git a/src/gui/opengl/qopenglfunctions.cpp b/src/gui/opengl/qopenglfunctions.cpp
index a4ed74637c..0e5a1327b0 100644
--- a/src/gui/opengl/qopenglfunctions.cpp
+++ b/src/gui/opengl/qopenglfunctions.cpp
@@ -347,6 +347,9 @@ static int qt_gl_resolve_extensions()
{
int extensions = 0;
QOpenGLExtensionMatcher extensionMatcher;
+ if (extensionMatcher.match("GL_EXT_bgra"))
+ extensions |= QOpenGLExtensions::BGRATextureFormat;
+
#if defined(QT_OPENGL_ES)
if (extensionMatcher.match("GL_OES_mapbuffer"))
extensions |= QOpenGLExtensions::MapBuffer;
@@ -356,10 +359,9 @@ static int qt_gl_resolve_extensions()
extensions |= QOpenGLExtensions::ElementIndexUint;
if (extensionMatcher.match("GL_OES_depth24"))
extensions |= QOpenGLExtensions::Depth24;
-
- if (extensionMatcher.match("GL_EXT_bgra"))
+ // TODO: Consider matching GL_APPLE_texture_format_BGRA8888 as well, but it needs testing.
+ if (extensionMatcher.match("GL_IMG_texture_format_BGRA8888") || extensionMatcher.match("GL_EXT_texture_format_BGRA8888"))
extensions |= QOpenGLExtensions::BGRATextureFormat;
-
#else
QSurfaceFormat format = QOpenGLContext::currentContext()->format();
extensions |= QOpenGLExtensions::ElementIndexUint | QOpenGLExtensions::MapBuffer;
diff --git a/src/gui/opengl/qopenglgradientcache.cpp b/src/gui/opengl/qopenglgradientcache.cpp
index b48e96cd98..9c4fbbe013 100644
--- a/src/gui/opengl/qopenglgradientcache.cpp
+++ b/src/gui/opengl/qopenglgradientcache.cpp
@@ -152,22 +152,6 @@ GLuint QOpenGL2GradientCache::addCacheElement(quint64 hash_val, const QGradient
}
-// GL's expects pixels in RGBA (when using GL_RGBA), bin-endian (ABGR on x86).
-// Qt always stores in ARGB reguardless of the byte-order the mancine uses.
-static inline uint qtToGlColor(uint c)
-{
- uint o;
-#if Q_BYTE_ORDER == Q_LITTLE_ENDIAN
- o = (c & 0xff00ff00) // alpha & green already in the right place
- | ((c >> 16) & 0x000000ff) // red
- | ((c << 16) & 0x00ff0000); // blue
-#else //Q_BIG_ENDIAN
- o = (c << 8)
- | ((c >> 24) & 0x000000ff);
-#endif // Q_BYTE_ORDER
- return o;
-}
-
//TODO: Let GL generate the texture using an FBO
void QOpenGL2GradientCache::generateGradientColorTable(const QGradient& gradient, uint *colorTable, int size, qreal opacity) const
{
@@ -184,7 +168,7 @@ void QOpenGL2GradientCache::generateGradientColorTable(const QGradient& gradient
uint current_color = ARGB_COMBINE_ALPHA(colors[0], alpha);
qreal incr = 1.0 / qreal(size);
qreal fpos = 1.5 * incr;
- colorTable[pos++] = qtToGlColor(PREMUL(current_color));
+ colorTable[pos++] = ARGB2RGBA(PREMUL(current_color));
while (fpos <= s.first().first) {
colorTable[pos] = colorTable[pos - 1];
@@ -205,9 +189,9 @@ void QOpenGL2GradientCache::generateGradientColorTable(const QGradient& gradient
int dist = int(256 * ((fpos - s[i].first) * delta));
int idist = 256 - dist;
if (colorInterpolation)
- colorTable[pos] = qtToGlColor(INTERPOLATE_PIXEL_256(current_color, idist, next_color, dist));
+ colorTable[pos] = ARGB2RGBA(INTERPOLATE_PIXEL_256(current_color, idist, next_color, dist));
else
- colorTable[pos] = qtToGlColor(PREMUL(INTERPOLATE_PIXEL_256(current_color, idist, next_color, dist)));
+ colorTable[pos] = ARGB2RGBA(PREMUL(INTERPOLATE_PIXEL_256(current_color, idist, next_color, dist)));
++pos;
fpos += incr;
}
@@ -216,7 +200,7 @@ void QOpenGL2GradientCache::generateGradientColorTable(const QGradient& gradient
Q_ASSERT(s.size() > 0);
- uint last_color = qtToGlColor(PREMUL(ARGB_COMBINE_ALPHA(colors[s.size() - 1], alpha)));
+ uint last_color = ARGB2RGBA(PREMUL(ARGB_COMBINE_ALPHA(colors[s.size() - 1], alpha)));
for (;pos < size; ++pos)
colorTable[pos] = last_color;
diff --git a/src/gui/opengl/qopenglpixeltransferoptions.h b/src/gui/opengl/qopenglpixeltransferoptions.h
index 1a5d3f00e2..c150e8aff4 100644
--- a/src/gui/opengl/qopenglpixeltransferoptions.h
+++ b/src/gui/opengl/qopenglpixeltransferoptions.h
@@ -60,6 +60,14 @@ public:
QOpenGLPixelTransferOptions &operator=(const QOpenGLPixelTransferOptions &);
~QOpenGLPixelTransferOptions();
+#ifdef Q_COMPILER_RVALUE_REFS
+ QOpenGLPixelTransferOptions &operator=(QOpenGLPixelTransferOptions &&other)
+ { swap(other); return *this; }
+#endif
+
+ void swap(QOpenGLPixelTransferOptions &other)
+ { data.swap(other.data); }
+
void setAlignment(int alignment);
int alignment() const;
@@ -88,6 +96,8 @@ private:
QSharedDataPointer<QOpenGLPixelTransferOptionsData> data;
};
+Q_DECLARE_SHARED(QOpenGLPixelTransferOptions)
+
QT_END_NAMESPACE
#endif // QT_NO_OPENGL
diff --git a/src/gui/opengl/qopengltexture.cpp b/src/gui/opengl/qopengltexture.cpp
index d5a7399c18..e3fffe5a1c 100644
--- a/src/gui/opengl/qopengltexture.cpp
+++ b/src/gui/opengl/qopengltexture.cpp
@@ -50,6 +50,11 @@
QT_BEGIN_NAMESPACE
+//this is to work around GL_TEXTURE_WRAP_R_OES which also has 0x8072 as value
+#if !defined(GL_TEXTURE_WRAP_R)
+ #define GL_TEXTURE_WRAP_R 0x8072
+#endif
+
QOpenGLTexturePrivate::QOpenGLTexturePrivate(QOpenGLTexture::Target textureTarget,
QOpenGLTexture *qq)
: q_ptr(qq),
@@ -1255,6 +1260,13 @@ QOpenGLTexture *QOpenGLTexturePrivate::createTextureView(QOpenGLTexture::Target
\value SRGB_Alpha_DXT3 Equivalent to GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT
\value SRGB_Alpha_DXT5 Equivalent to GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT
\value SRGB_BP_UNorm Equivalent to GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB
+
+ \value DepthFormat Equivalent to GL_DEPTH_COMPONENT (OpenGL ES 2 only and when OES_depth_texture is present)
+ \value AlphaFormat Equivalent to GL_ALPHA (OpenGL ES 2 only)
+ \value RGBFormat Equivalent to GL_RGB (OpenGL ES 2 only)
+ \value RGBAFormat Equivalent to GL_RGBA (OpenGL ES 2 only)
+ \value LuminanceFormat Equivalent to GL_LUMINANCE (OpenGL ES 2 only)
+ \value LuminanceAlphaFormat Equivalent to GL_LUMINANCE_ALPHA (OpenGL ES 2 only)
*/
/*!
@@ -1289,6 +1301,10 @@ QOpenGLTexture *QOpenGLTexturePrivate::createTextureView(QOpenGLTexture::Target
\value BGRA_Integer Equivalent to GL_BGRA_INTEGER
\value Depth Equivalent to GL_DEPTH_COMPONENT
\value DepthStencil Equivalent to GL_DEPTH_STENCIL
+ \value Alpha Equivalent to GL_ALPHA (OpenGL ES 2 only)
+ \value Luminance Equivalent to GL_LUMINANCE (OpenGL ES 2 only)
+ \value LuminanceAlpha Equivalent to GL_LUMINANCE_ALPHA (OpenGL ES 2 only)
+
*/
/*!
@@ -1303,6 +1319,7 @@ QOpenGLTexture *QOpenGLTexturePrivate::createTextureView(QOpenGLTexture::Target
\value Int32 Equivalent to GL_INT
\value UInt32 Equivalent to GL_UNSIGNED_INT
\value Float16 Equivalent to GL_HALF_FLOAT
+ \value Float16OES Equivalent to GL_HALF_FLOAT_OES
\value Float32 Equivalent to GL_FLOAT
\value UInt32_RGB9_E5 Equivalent to GL_UNSIGNED_INT_5_9_9_9_REV
\value UInt32_RG11B10F Equivalent to GL_UNSIGNED_INT_10F_11F_11F_REV
@@ -1752,6 +1769,12 @@ void QOpenGLTexture::setFormat(TextureFormat format)
case D32:
case D32F:
case D32FS8X24:
+ case DepthFormat:
+ case AlphaFormat:
+ case RGBFormat:
+ case RGBAFormat:
+ case LuminanceFormat:
+ case LuminanceAlphaFormat:
d->formatClass = FormatClass_Unique;
break;
}
@@ -1825,7 +1848,7 @@ void QOpenGLTexture::setSize(int width, int height, int depth)
/*!
Returns the width of a 1D, 2D or 3D texture.
- \sa height(), depth(), setDimensions()
+ \sa height(), depth(), setSize()
*/
int QOpenGLTexture::width() const
{
@@ -1836,7 +1859,7 @@ int QOpenGLTexture::width() const
/*!
Returns the height of a 2D or 3D texture.
- \sa width(), depth(), setDimensions()
+ \sa width(), depth(), setSize()
*/
int QOpenGLTexture::height() const
{
@@ -1847,7 +1870,7 @@ int QOpenGLTexture::height() const
/*!
Returns the depth of a 3D texture.
- \sa width(), height(), setDimensions()
+ \sa width(), height(), setSize()
*/
int QOpenGLTexture::depth() const
{
@@ -1913,7 +1936,7 @@ int QOpenGLTexture::mipLevels() const
Returns the maximum number of mipmap levels that this texture
can have given the current dimensions.
- \sa setMipLevels(), mipLevels(), setDimensions()
+ \sa setMipLevels(), mipLevels(), setSize()
*/
int QOpenGLTexture::maximumMipLevels() const
{
@@ -2018,7 +2041,7 @@ void QOpenGLTexture::allocateStorage()
The texture format, dimensions, mipmap levels and array layers
cannot be altered once storage ihas been allocated.
- \sa allocateStorage(), setDimensions(), setMipLevels(), setLayers(), setFormat()
+ \sa allocateStorage(), setSize(), setMipLevels(), setLayers(), setFormat()
*/
bool QOpenGLTexture::isStorageAllocated() const
{
@@ -2242,6 +2265,7 @@ bool QOpenGLTexture::hasFeature(Feature feature)
bool supported = false;
switch (feature) {
+#if !defined(QT_OPENGL_ES_2)
case ImmutableMultisampleStorage:
case TextureBuffer:
case StencilTexturing:
@@ -2289,16 +2313,38 @@ bool QOpenGLTexture::hasFeature(Feature feature)
break;
}
+#else
+ case Texture3D:
+ supported = ctx->hasExtension(QByteArrayLiteral("GL_OES_texture_3D"));
+ break;
+ case AnisotropicFiltering:
+ supported = ctx->hasExtension(QByteArrayLiteral("GL_EXT_texture_filter_anisotropic"));
+ break;
+ case NPOTTextures:
+ case NPOTTextureRepeat:
+ supported = f.version() >= qMakePair(3,0);
+ if (!supported) {
+ supported = ctx->hasExtension(QByteArrayLiteral("GL_OES_texture_npot"));
+ if (!supported)
+ supported = ctx->hasExtension(QByteArrayLiteral("GL_ARB_texture_non_power_of_two"));
+ }
+ default:
+ break;
+ }
+#endif
+
return supported;
}
/*!
Sets the base mipmap level used for all texture lookups with this texture to \a baseLevel.
+ \note This function has no effect on Qt built for OpenGL ES 2.
\sa mipBaseLevel(), setMipMaxLevel(), setMipLevelRange()
*/
void QOpenGLTexture::setMipBaseLevel(int baseLevel)
{
+#if !defined(QT_OPENGL_ES_2)
Q_D(QOpenGLTexture);
d->create();
Q_ASSERT(d->textureId);
@@ -2306,6 +2352,10 @@ void QOpenGLTexture::setMipBaseLevel(int baseLevel)
Q_ASSERT(baseLevel <= d->maxLevel);
d->baseLevel = baseLevel;
d->texFuncs->glTextureParameteri(d->textureId, d->target, GL_TEXTURE_BASE_LEVEL, baseLevel);
+#else
+ Q_UNUSED(baseLevel);
+ qWarning("QOpenGLTexture: Mipmap base level is not supported");
+#endif
}
/*!
@@ -2323,10 +2373,12 @@ int QOpenGLTexture::mipBaseLevel() const
/*!
Sets the maximum mipmap level used for all texture lookups with this texture to \a maxLevel.
+ \note This function has no effect on Qt built for OpenGL ES 2.
\sa mipMaxLevel(), setMipBaseLevel(), setMipLevelRange()
*/
void QOpenGLTexture::setMipMaxLevel(int maxLevel)
{
+#if !defined(QT_OPENGL_ES_2)
Q_D(QOpenGLTexture);
d->create();
Q_ASSERT(d->textureId);
@@ -2334,6 +2386,10 @@ void QOpenGLTexture::setMipMaxLevel(int maxLevel)
Q_ASSERT(d->baseLevel <= maxLevel);
d->maxLevel = maxLevel;
d->texFuncs->glTextureParameteri(d->textureId, d->target, GL_TEXTURE_MAX_LEVEL, maxLevel);
+#else
+ Q_UNUSED(maxLevel);
+ qWarning("QOpenGLTexture: Mipmap max level is not supported");
+#endif
}
/*!
@@ -2351,10 +2407,12 @@ int QOpenGLTexture::mipMaxLevel() const
Sets the range of mipmap levels that can be used for texture lookups with this texture
to range from \a baseLevel to \a maxLevel.
+ \note This function has no effect on Qt built for OpenGL ES 2.
\sa setMipBaseLevel(), setMipMaxLevel(), mipLevelRange()
*/
void QOpenGLTexture::setMipLevelRange(int baseLevel, int maxLevel)
{
+#if !defined(QT_OPENGL_ES_2)
Q_D(QOpenGLTexture);
d->create();
Q_ASSERT(d->textureId);
@@ -2362,12 +2420,17 @@ void QOpenGLTexture::setMipLevelRange(int baseLevel, int maxLevel)
Q_ASSERT(baseLevel <= maxLevel);
d->texFuncs->glTextureParameteri(d->textureId, d->target, GL_TEXTURE_BASE_LEVEL, baseLevel);
d->texFuncs->glTextureParameteri(d->textureId, d->target, GL_TEXTURE_MAX_LEVEL, maxLevel);
+#else
+ Q_UNUSED(baseLevel);
+ Q_UNUSED(maxLevel);
+ qWarning("QOpenGLTexture: Mipmap level range is not supported");
+#endif
}
/*!
Returns the range of mipmap levels that can be used for texture lookups with this texture.
- \sa mipBaseLevel(), mipMaxLevel(), mipLevelRange()
+ \sa mipBaseLevel(), mipMaxLevel()
*/
QPair<int, int> QOpenGLTexture::mipLevelRange() const
{
@@ -2451,11 +2514,12 @@ void QOpenGLTexture::generateMipMaps(int baseLevel, bool resetBaseLevel)
This function maps \a component to the output \a value.
+ \note This function has no effect on Mac and Qt built for OpenGL ES 2.
\sa swizzleMask()
*/
void QOpenGLTexture::setSwizzleMask(SwizzleComponent component, SwizzleValue value)
{
-#if !defined(Q_OS_MAC)
+#if !defined(Q_OS_MAC) && !defined(QT_OPENGL_ES_2)
Q_D(QOpenGLTexture);
d->create();
Q_ASSERT(d->texFuncs);
@@ -2467,9 +2531,9 @@ void QOpenGLTexture::setSwizzleMask(SwizzleComponent component, SwizzleValue val
d->swizzleMask[component - SwizzleRed] = value;
d->texFuncs->glTextureParameteri(d->textureId, d->target, component, value);
#else
- qWarning("Texture swizzling is not supported");
Q_UNUSED(component);
Q_UNUSED(value);
+ qWarning("QOpenGLTexture: Texture swizzling is not supported");
#endif
}
@@ -2479,7 +2543,7 @@ void QOpenGLTexture::setSwizzleMask(SwizzleComponent component, SwizzleValue val
void QOpenGLTexture::setSwizzleMask(SwizzleValue r, SwizzleValue g,
SwizzleValue b, SwizzleValue a)
{
-#if !defined(Q_OS_MAC)
+#if !defined(Q_OS_MAC) && !defined(QT_OPENGL_ES_2)
Q_D(QOpenGLTexture);
d->create();
Q_ASSERT(d->texFuncs);
@@ -2495,11 +2559,11 @@ void QOpenGLTexture::setSwizzleMask(SwizzleValue r, SwizzleValue g,
d->swizzleMask[3] = a;
d->texFuncs->glTextureParameteriv(d->textureId, d->target, GL_TEXTURE_SWIZZLE_RGBA, swizzleMask);
#else
- qWarning("Texture swizzling is not supported");
Q_UNUSED(r);
Q_UNUSED(g);
Q_UNUSED(b);
Q_UNUSED(a);
+ qWarning("QOpenGLTexture: Texture swizzling is not supported");
#endif
}
@@ -2520,11 +2584,12 @@ QOpenGLTexture::SwizzleValue QOpenGLTexture::swizzleMask(SwizzleComponent compon
shader will access the depth component as a single float, as normal. But when
the parameter is set to StencilMode?, the shader will access the stencil component.
+ \note This function has no effect on Mac and Qt built for OpenGL ES 2.
\sa depthStencilMode()
*/
void QOpenGLTexture::setDepthStencilMode(QOpenGLTexture::DepthStencilMode mode)
{
-#if !defined(Q_OS_MAC)
+#if !defined(Q_OS_MAC) && !defined(QT_OPENGL_ES_2)
Q_D(QOpenGLTexture);
d->create();
Q_ASSERT(d->texFuncs);
@@ -2537,7 +2602,7 @@ void QOpenGLTexture::setDepthStencilMode(QOpenGLTexture::DepthStencilMode mode)
d->texFuncs->glTextureParameteri(d->textureId, d->target, GL_DEPTH_STENCIL_TEXTURE_MODE, mode);
#else
Q_UNUSED(mode);
- qWarning("DepthStencil Mode is not supported");
+ qWarning("QOpenGLTexture: DepthStencil Mode is not supported");
#endif
}
@@ -2706,10 +2771,12 @@ QOpenGLTexture::WrapMode QOpenGLTexture::wrapMode(QOpenGLTexture::CoordinateDire
/*!
Sets the border color of the texture to \a color.
+ \note This function has no effect on Mac and Qt built for OpenGL ES 2.
\sa borderColor()
*/
void QOpenGLTexture::setBorderColor(QColor color)
{
+#if !defined(QT_OPENGL_ES_2)
Q_D(QOpenGLTexture);
d->create();
Q_ASSERT(d->texFuncs);
@@ -2723,6 +2790,10 @@ void QOpenGLTexture::setBorderColor(QColor color)
for (int i = 0; i < 4; ++i)
d->borderColor.append(QVariant(values[i]));
d->texFuncs->glTextureParameterfv(d->textureId, d->target, GL_TEXTURE_BORDER_COLOR, values);
+#else
+ Q_UNUSED(color);
+ qWarning("QOpenGLTexture: Border color is not supported");
+#endif
}
/*!
@@ -2730,6 +2801,7 @@ void QOpenGLTexture::setBorderColor(QColor color)
*/
void QOpenGLTexture::setBorderColor(float r, float g, float b, float a)
{
+#if !defined(QT_OPENGL_ES_2)
Q_D(QOpenGLTexture);
d->create();
Q_ASSERT(d->texFuncs);
@@ -2743,6 +2815,13 @@ void QOpenGLTexture::setBorderColor(float r, float g, float b, float a)
for (int i = 0; i < 4; ++i)
d->borderColor.append(QVariant(values[i]));
d->texFuncs->glTextureParameterfv(d->textureId, d->target, GL_TEXTURE_BORDER_COLOR, values);
+#else
+ Q_UNUSED(r);
+ Q_UNUSED(g);
+ Q_UNUSED(b);
+ Q_UNUSED(a);
+ qWarning("QOpenGLTexture: Border color is not supported");
+#endif
}
/*!
@@ -2750,6 +2829,7 @@ void QOpenGLTexture::setBorderColor(float r, float g, float b, float a)
*/
void QOpenGLTexture::setBorderColor(int r, int g, int b, int a)
{
+#if !defined(QT_OPENGL_ES_2)
Q_D(QOpenGLTexture);
d->create();
Q_ASSERT(d->texFuncs);
@@ -2763,6 +2843,13 @@ void QOpenGLTexture::setBorderColor(int r, int g, int b, int a)
for (int i = 0; i < 4; ++i)
d->borderColor.append(QVariant(values[i]));
d->texFuncs->glTextureParameteriv(d->textureId, d->target, GL_TEXTURE_BORDER_COLOR, values);
+#else
+ Q_UNUSED(r);
+ Q_UNUSED(g);
+ Q_UNUSED(b);
+ Q_UNUSED(a);
+ qWarning("QOpenGLTexture: Border color is not supported");
+#endif
// TODO Handle case of using glTextureParameterIiv() based on format
}
@@ -2772,6 +2859,7 @@ void QOpenGLTexture::setBorderColor(int r, int g, int b, int a)
*/
void QOpenGLTexture::setBorderColor(uint r, uint g, uint b, uint a)
{
+#if !defined(QT_OPENGL_ES_2)
Q_D(QOpenGLTexture);
d->create();
Q_ASSERT(d->texFuncs);
@@ -2785,6 +2873,13 @@ void QOpenGLTexture::setBorderColor(uint r, uint g, uint b, uint a)
for (int i = 0; i < 4; ++i)
d->borderColor.append(QVariant(values[i]));
d->texFuncs->glTextureParameteriv(d->textureId, d->target, GL_TEXTURE_BORDER_COLOR, values);
+#else
+ Q_UNUSED(r);
+ Q_UNUSED(g);
+ Q_UNUSED(b);
+ Q_UNUSED(a);
+ qWarning("QOpenGLTexture: Border color is not supported");
+#endif
// TODO Handle case of using glTextureParameterIuiv() based on format
}
@@ -2862,10 +2957,12 @@ void QOpenGLTexture::borderColor(unsigned int *border) const
Sets the minimum level of detail to \a value. This limits the selection of highest
resolution mipmap (lowest mipmap level). The default value is -1000.
+ \note This function has no effect on Qt built for OpenGL ES 2.
\sa minimumLevelOfDetail(), setMaximumLevelOfDetail(), setLevelOfDetailRange()
*/
void QOpenGLTexture::setMinimumLevelOfDetail(float value)
{
+#if !defined(QT_OPENGL_ES_2)
Q_D(QOpenGLTexture);
d->create();
Q_ASSERT(d->texFuncs);
@@ -2873,6 +2970,10 @@ void QOpenGLTexture::setMinimumLevelOfDetail(float value)
Q_ASSERT(value < d->maxLevelOfDetail);
d->minLevelOfDetail = value;
d->texFuncs->glTextureParameterf(d->textureId, d->target, GL_TEXTURE_MIN_LOD, value);
+#else
+ Q_UNUSED(value);
+ qWarning("QOpenGLTexture: Detail level is not supported");
+#endif
}
/*!
@@ -2890,10 +2991,12 @@ float QOpenGLTexture::minimumLevelOfDetail() const
Sets the maximum level of detail to \a value. This limits the selection of lowest
resolution mipmap (highest mipmap level). The default value is 1000.
+ \note This function has no effect on Qt built for OpenGL ES 2.
\sa maximumLevelOfDetail(), setMinimumLevelOfDetail(), setLevelOfDetailRange()
*/
void QOpenGLTexture::setMaximumLevelOfDetail(float value)
{
+#if !defined(QT_OPENGL_ES_2)
Q_D(QOpenGLTexture);
d->create();
Q_ASSERT(d->texFuncs);
@@ -2901,6 +3004,10 @@ void QOpenGLTexture::setMaximumLevelOfDetail(float value)
Q_ASSERT(value > d->minLevelOfDetail);
d->maxLevelOfDetail = value;
d->texFuncs->glTextureParameterf(d->textureId, d->target, GL_TEXTURE_MAX_LOD, value);
+#else
+ Q_UNUSED(value);
+ qWarning("QOpenGLTexture: Detail level is not supported");
+#endif
}
/*!
@@ -2917,10 +3024,12 @@ float QOpenGLTexture::maximumLevelOfDetail() const
/*!
Sets the minimum and maximum level of detail parameters.
+ \note This function has no effect on Qt built for OpenGL ES 2.
\sa levelOfDetailRange(), setMinimumLevelOfDetail(), setMaximumLevelOfDetail()
*/
void QOpenGLTexture::setLevelOfDetailRange(float min, float max)
{
+#if !defined(QT_OPENGL_ES_2)
Q_D(QOpenGLTexture);
d->create();
Q_ASSERT(d->texFuncs);
@@ -2930,6 +3039,11 @@ void QOpenGLTexture::setLevelOfDetailRange(float min, float max)
d->maxLevelOfDetail = max;
d->texFuncs->glTextureParameterf(d->textureId, d->target, GL_TEXTURE_MIN_LOD, min);
d->texFuncs->glTextureParameterf(d->textureId, d->target, GL_TEXTURE_MAX_LOD, max);
+#else
+ Q_UNUSED(min);
+ Q_UNUSED(max);
+ qWarning("QOpenGLTexture: Detail level is not supported");
+#endif
}
/*!
@@ -2946,16 +3060,22 @@ QPair<float, float> QOpenGLTexture::levelOfDetailRange() const
/*!
Sets the level of detail bias parameter.
+ \note This function has no effect on Qt built for OpenGL ES 2.
\sa levelofDetailBias()
*/
void QOpenGLTexture::setLevelofDetailBias(float bias)
{
+#if !defined(QT_OPENGL_ES_2)
Q_D(QOpenGLTexture);
d->create();
Q_ASSERT(d->texFuncs);
Q_ASSERT(d->textureId);
d->levelOfDetailBias = bias;
d->texFuncs->glTextureParameterf(d->textureId, d->target, GL_TEXTURE_LOD_BIAS, bias);
+#else
+ Q_UNUSED(bias);
+ qWarning("QOpenGLTexture: Detail level is not supported");
+#endif
}
/*!
diff --git a/src/gui/opengl/qopengltexture.h b/src/gui/opengl/qopengltexture.h
index e06cf26f60..5c0f8101a6 100644
--- a/src/gui/opengl/qopengltexture.h
+++ b/src/gui/opengl/qopengltexture.h
@@ -96,8 +96,8 @@ public:
DontResetTextureUnit
};
- QOpenGLTexture(Target target);
- QOpenGLTexture(const QImage& image, MipMapGeneration genMipMaps = GenerateMipMaps);
+ explicit QOpenGLTexture(Target target);
+ explicit QOpenGLTexture(const QImage& image, MipMapGeneration genMipMaps = GenerateMipMaps);
~QOpenGLTexture();
// Creation and destruction
@@ -222,7 +222,16 @@ public:
SRGB_Alpha_DXT1 = 0x8C4D, // GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT
SRGB_Alpha_DXT3 = 0x8C4E, // GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT
SRGB_Alpha_DXT5 = 0x8C4F, // GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT
- SRGB_BP_UNorm = 0x8E8D // GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB
+ SRGB_BP_UNorm = 0x8E8D, // GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB
+
+ // ES 2 formats
+ DepthFormat = 0x1902, // GL_DEPTH_COMPONENT
+ AlphaFormat = 0x1906, // GL_ALPHA
+ RGBFormat = 0x1907, // GL_RGB
+ RGBAFormat = 0x1908, // GL_RGBA
+ LuminanceFormat = 0x1909, // GL_LUMINANCE
+ LuminanceAlphaFormat = 0x190A
+
};
// This is not used externally yet but is reserved to allow checking of
@@ -296,7 +305,10 @@ public:
RGBA_Integer = 0x8D99, // GL_RGBA_INTEGER
BGRA_Integer = 0x8D9B, // GL_BGRA_INTEGER
Depth = 0x1902, // GL_DEPTH_COMPONENT
- DepthStencil = 0x84F9 // GL_DEPTH_STENCIL
+ DepthStencil = 0x84F9, // GL_DEPTH_STENCIL
+ Alpha = 0x1906, // GL_ALPHA
+ Luminance = 0x1909, // GL_LUMINANCE
+ LuminanceAlpha = 0x190A // GL_LUMINANCE_ALPHA
};
enum PixelType {
@@ -308,6 +320,7 @@ public:
Int32 = 0x1404, // GL_INT
UInt32 = 0x1405, // GL_UNSIGNED_INT
Float16 = 0x140B, // GL_HALF_FLOAT
+ Float16OES = 0x8D61, // GL_HALF_FLOAT_OES
Float32 = 0x1406, // GL_FLOAT
UInt32_RGB9_E5 = 0x8C3E, // GL_UNSIGNED_INT_5_9_9_9_REV
UInt32_RG11B10F = 0x8C3B, // GL_UNSIGNED_INT_10F_11F_11F_REV
diff --git a/src/gui/opengl/qopengltexturecache.cpp b/src/gui/opengl/qopengltexturecache.cpp
index 94b82885ff..4238f63cd8 100644
--- a/src/gui/opengl/qopengltexturecache.cpp
+++ b/src/gui/opengl/qopengltexturecache.cpp
@@ -95,10 +95,9 @@ void QOpenGLTextureCacheWrapper::cleanupTexturesForPixmapData(QPlatformPixmap *p
cleanupTexturesForCacheKey(pmd->cacheKey());
}
-QOpenGLTextureCache::QOpenGLTextureCache(QOpenGLContext *ctx, bool useByteSwapImage)
+QOpenGLTextureCache::QOpenGLTextureCache(QOpenGLContext *ctx)
: QOpenGLSharedResource(ctx->shareGroup())
, m_cache(64 * 1024) // 64 MB cache
- , m_useByteSwapImage(useByteSwapImage)
{
}
@@ -152,38 +151,13 @@ GLuint QOpenGLTextureCache::bindTexture(QOpenGLContext *context, const QImage &i
return id;
}
-static inline void qgl_byteSwapImage(QImage &img)
-{
- const int width = img.width();
- const int height = img.height();
-
- if (QSysInfo::ByteOrder == QSysInfo::LittleEndian)
- {
- for (int i = 0; i < height; ++i) {
- uint *p = (uint *) img.scanLine(i);
- for (int x = 0; x < width; ++x)
- p[x] = ((p[x] << 16) & 0xff0000) | ((p[x] >> 16) & 0xff) | (p[x] & 0xff00ff00);
- }
- } else {
- for (int i = 0; i < height; ++i) {
- uint *p = (uint *) img.scanLine(i);
- for (int x = 0; x < width; ++x)
- p[x] = (p[x] << 8) | (p[x] >> 24);
- }
- }
-}
-
GLuint QOpenGLTextureCache::bindTexture(QOpenGLContext *context, qint64 key, const QImage &image)
{
GLuint id;
glGenTextures(1, &id);
glBindTexture(GL_TEXTURE_2D, id);
- QImage tx = image.convertToFormat(QImage::Format_ARGB32_Premultiplied);
-
- // Performance could be improved by skipping qgl_byteSwapImage().
- if (m_useByteSwapImage)
- qgl_byteSwapImage(tx);
+ QImage tx = image.convertToFormat(QImage::Format_RGBA8888_Premultiplied);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, tx.width(), tx.height(), 0, GL_RGBA, GL_UNSIGNED_BYTE, const_cast<const QImage &>(tx).bits());
diff --git a/src/gui/opengl/qopengltexturecache_p.h b/src/gui/opengl/qopengltexturecache_p.h
index d4d3f00069..2e82d5f373 100644
--- a/src/gui/opengl/qopengltexturecache_p.h
+++ b/src/gui/opengl/qopengltexturecache_p.h
@@ -78,7 +78,7 @@ class Q_GUI_EXPORT QOpenGLTextureCache : public QOpenGLSharedResource
public:
static QOpenGLTextureCache *cacheForContext(QOpenGLContext *context);
- QOpenGLTextureCache(QOpenGLContext *, bool useByteSwapImage = true);
+ QOpenGLTextureCache(QOpenGLContext *);
~QOpenGLTextureCache();
GLuint bindTexture(QOpenGLContext *context, const QPixmap &pixmap);
@@ -94,7 +94,6 @@ private:
QMutex m_mutex;
QCache<quint64, QOpenGLCachedTexture> m_cache;
- bool m_useByteSwapImage;
};
QT_END_NAMESPACE
diff --git a/src/gui/opengl/qopengltextureglyphcache.cpp b/src/gui/opengl/qopengltextureglyphcache.cpp
index 506aec0f43..3b62d1d63a 100644
--- a/src/gui/opengl/qopengltextureglyphcache.cpp
+++ b/src/gui/opengl/qopengltextureglyphcache.cpp
@@ -43,6 +43,8 @@
#include "qopenglpaintengine_p.h"
#include "private/qopenglengineshadersource_p.h"
#include "qopenglextensions_p.h"
+#include <qrgb.h>
+#include <private/qdrawhelper_p.h>
QT_BEGIN_NAMESPACE
@@ -301,7 +303,17 @@ void QOpenGLTextureGlyphCache::fillTexture(const Coord &c, glyph_t glyph, QFixed
return;
}
- QImage mask = textureMapForGlyph(glyph, subPixelPosition);
+ QImage mask;
+
+ if (m_current_fontengine->hasInternalCaching()) {
+ QImage *alphaMap = m_current_fontengine->lockedAlphaMapForGlyph(glyph, subPixelPosition, QFontEngine::Format_None);
+ if (!alphaMap || alphaMap->isNull())
+ return;
+ mask = alphaMap->copy();
+ m_current_fontengine->unlockAlphaMapForGlyph();
+ } else {
+ mask = textureMapForGlyph(glyph, subPixelPosition);
+ }
const int maskWidth = mask.width();
const int maskHeight = mask.height();
@@ -316,24 +328,27 @@ void QOpenGLTextureGlyphCache::fillTexture(const Coord &c, glyph_t glyph, QFixed
if (mask.format() == QImage::Format_RGB32
// We need to make the alpha component equal to the average of the RGB values.
// This is needed when drawing sub-pixel antialiased text on translucent targets.
+#if defined(QT_OPENGL_ES_2) || Q_BYTE_ORDER == Q_BIG_ENDIAN
+ || mask.format() == QImage::Format_ARGB32_Premultiplied
+#endif
) {
for (int y = 0; y < maskHeight; ++y) {
- quint32 *src = (quint32 *) mask.scanLine(y);
+ QRgb *src = (QRgb *) mask.scanLine(y);
for (int x = 0; x < maskWidth; ++x) {
- uchar r = src[x] >> 16;
- uchar g = src[x] >> 8;
- uchar b = src[x];
- quint32 avg;
+ int r = qRed(src[x]);
+ int g = qGreen(src[x]);
+ int b = qBlue(src[x]);
+ int avg;
if (mask.format() == QImage::Format_RGB32)
- avg = (quint32(r) + quint32(g) + quint32(b) + 1) / 3; // "+1" for rounding.
+ avg = (r + g + b + 1) / 3; // "+1" for rounding.
else // Format_ARGB_Premultiplied
- avg = src[x] >> 24;
+ avg = qAlpha(src[x]);
-#if defined(QT_OPENGL_ES_2)
+ src[x] = qRgba(r, g, b, avg);
+#if defined(QT_OPENGL_ES_2) || Q_BYTE_ORDER == Q_BIG_ENDIAN
// swizzle the bits to accommodate for the GL_RGBA upload.
- src[x] = (avg << 24) | (quint32(r) << 0) | (quint32(g) << 8) | (quint32(b) << 16);
+ src[x] = ARGB2RGBA(src[x]);
#endif
- src[x] = (src[x] & 0x00ffffff) | (avg << 24);
}
}
}
@@ -341,7 +356,7 @@ void QOpenGLTextureGlyphCache::fillTexture(const Coord &c, glyph_t glyph, QFixed
glBindTexture(GL_TEXTURE_2D, m_textureResource->m_texture);
if (mask.depth() == 32) {
-#if defined(QT_OPENGL_ES_2)
+#if defined(QT_OPENGL_ES_2) || Q_BYTE_ORDER == Q_BIG_ENDIAN
glTexSubImage2D(GL_TEXTURE_2D, 0, c.x, c.y, maskWidth, maskHeight, GL_RGBA, GL_UNSIGNED_BYTE, mask.bits());
#else
glTexSubImage2D(GL_TEXTURE_2D, 0, c.x, c.y, maskWidth, maskHeight, GL_BGRA, GL_UNSIGNED_BYTE, mask.bits());
diff --git a/src/gui/opengl/qopengltexturehelper.cpp b/src/gui/opengl/qopengltexturehelper.cpp
index e09b84cce6..676c0802de 100644
--- a/src/gui/opengl/qopengltexturehelper.cpp
+++ b/src/gui/opengl/qopengltexturehelper.cpp
@@ -48,6 +48,7 @@ QT_BEGIN_NAMESPACE
QOpenGLTextureHelper::QOpenGLTextureHelper(QOpenGLContext *context)
{
// Resolve EXT_direct_state_access entry points if present
+#if !defined(QT_OPENGL_ES_2)
if (context->hasExtension(QByteArrayLiteral("GL_EXT_direct_state_access"))) {
TextureParameteriEXT = reinterpret_cast<void (QOPENGLF_APIENTRYP)(GLuint , GLenum , GLenum , GLint )>(context->getProcAddress(QByteArrayLiteral("glTextureParameteriEXT")));
TextureParameterivEXT = reinterpret_cast<void (QOPENGLF_APIENTRYP)(GLuint , GLenum , GLenum , const GLint *)>(context->getProcAddress(QByteArrayLiteral("glTextureParameterivEXT")));
@@ -96,6 +97,7 @@ QOpenGLTextureHelper::QOpenGLTextureHelper(QOpenGLContext *context)
CompressedTextureImage2D = &QOpenGLTextureHelper::dsa_CompressedTextureImage2D;
CompressedTextureImage3D = &QOpenGLTextureHelper::dsa_CompressedTextureImage3D;
} else {
+#endif
// Use our own DSA emulation
TextureParameteri = &QOpenGLTextureHelper::qt_TextureParameteri;
TextureParameteriv = &QOpenGLTextureHelper::qt_TextureParameteriv;
@@ -117,9 +119,21 @@ QOpenGLTextureHelper::QOpenGLTextureHelper(QOpenGLContext *context)
CompressedTextureImage1D = &QOpenGLTextureHelper::qt_CompressedTextureImage1D;
CompressedTextureImage2D = &QOpenGLTextureHelper::qt_CompressedTextureImage2D;
CompressedTextureImage3D = &QOpenGLTextureHelper::qt_CompressedTextureImage3D;
+#if defined(QT_OPENGL_ES_2)
+ if (context->hasExtension(QByteArrayLiteral("GL_OES_texture_3D"))) {
+ TexImage3D = reinterpret_cast<void (QOPENGLF_APIENTRYP)(GLenum, GLint, GLint, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid*)>(context->getProcAddress(QByteArrayLiteral("glTexImage3DOES")));
+ TexSubImage3D = reinterpret_cast<void (QOPENGLF_APIENTRYP)(GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid*)>(context->getProcAddress(QByteArrayLiteral("glTexSubImage3DOES")));
+ CompressedTexImage3D = reinterpret_cast<void (QOPENGLF_APIENTRYP)(GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, const GLvoid*)>(context->getProcAddress(QByteArrayLiteral("glCompressedTexImage3DOES")));
+ CompressedTexSubImage3D = reinterpret_cast<void (QOPENGLF_APIENTRYP)(GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid*)>(context->getProcAddress(QByteArrayLiteral("glCompressedTexSubImage3DOES")));
+ }
+#endif
+
+#if !defined(QT_OPENGL_ES_2)
}
+#endif
// Some DSA functions are part of NV_texture_multisample instead
+#if !defined(QT_OPENGL_ES_2)
if (context->hasExtension(QByteArrayLiteral("GL_NV_texture_multisample"))) {
TextureImage3DMultisampleNV = reinterpret_cast<void (QOPENGLF_APIENTRYP)(GLuint , GLenum , GLsizei , GLint , GLsizei , GLsizei , GLsizei , GLboolean )>(context->getProcAddress(QByteArrayLiteral("glTextureImage3DMultisampleNV")));
TextureImage2DMultisampleNV = reinterpret_cast<void (QOPENGLF_APIENTRYP)(GLuint , GLenum , GLsizei , GLint , GLsizei , GLsizei , GLboolean )>(context->getProcAddress(QByteArrayLiteral("glTextureImage2DMultisampleNV")));
@@ -127,11 +141,14 @@ QOpenGLTextureHelper::QOpenGLTextureHelper(QOpenGLContext *context)
TextureImage3DMultisample = &QOpenGLTextureHelper::dsa_TextureImage3DMultisample;
TextureImage2DMultisample = &QOpenGLTextureHelper::dsa_TextureImage2DMultisample;
} else {
+#endif
TextureImage3DMultisample = &QOpenGLTextureHelper::qt_TextureImage3DMultisample;
TextureImage2DMultisample = &QOpenGLTextureHelper::qt_TextureImage2DMultisample;
+#if !defined(QT_OPENGL_ES_2)
}
+#endif
-#if defined(Q_OS_WIN)
+#if defined(Q_OS_WIN) && !defined(QT_OPENGL_ES_2)
HMODULE handle = GetModuleHandleA("opengl32.dll");
// OpenGL 1.0
diff --git a/src/gui/opengl/qopengltexturehelper_p.h b/src/gui/opengl/qopengltexturehelper_p.h
index e3abaa80af..fa4bd8120a 100644
--- a/src/gui/opengl/qopengltexturehelper_p.h
+++ b/src/gui/opengl/qopengltexturehelper_p.h
@@ -256,6 +256,7 @@ public:
}
private:
+#if !defined(QT_OPENGL_ES_2)
// DSA wrapper (so we can use pointer to member function as switch)
inline void dsa_TextureParameteri(GLuint texture, GLenum target, GLenum pname, GLint param)
{
@@ -403,6 +404,7 @@ private:
{
CompressedTextureImage3DEXT(texture, target, level, internalFormat, width, height, depth, border, imageSize, bits);
}
+#endif
// DSA-like API
@@ -899,6 +901,7 @@ public:
int val = 0;
glGetIntegerv(GL_UNPACK_ALIGNMENT, &val);
options.setAlignment(val);
+#if !defined(QT_OPENGL_ES_2)
glGetIntegerv(GL_UNPACK_SKIP_IMAGES, &val);
options.setSkipImages(val);
glGetIntegerv(GL_UNPACK_SKIP_ROWS, &val);
@@ -914,12 +917,14 @@ public:
options.setLeastSignificantByteFirst(b);
glGetBooleanv(GL_UNPACK_SWAP_BYTES, &b);
options.setSwapBytesEnabled(b);
+#endif
return options;
}
inline void setPixelUploadOptions(const QOpenGLPixelTransferOptions &options)
{
glPixelStorei(GL_UNPACK_ALIGNMENT, options.alignment());
+#if !defined(QT_OPENGL_ES_2)
glPixelStorei(GL_UNPACK_SKIP_IMAGES, options.skipImages());
glPixelStorei(GL_UNPACK_SKIP_ROWS, options.skipRows());
glPixelStorei(GL_UNPACK_SKIP_PIXELS, options.skipPixels());
@@ -927,6 +932,7 @@ public:
glPixelStorei(GL_UNPACK_ROW_LENGTH, options.rowLength());
glPixelStorei(GL_UNPACK_LSB_FIRST, options.isLeastSignificantBitFirst());
glPixelStorei(GL_UNPACK_SWAP_BYTES, options.isSwapBytesEnabled());
+#endif
}
private:
@@ -982,6 +988,7 @@ private:
CompressedTextureImage2DMemberFunc CompressedTextureImage2D;
CompressedTextureImage3DMemberFunc CompressedTextureImage3D;
+#if !defined(QT_OPENGL_ES_2)
// Raw function pointers for core and DSA functions
// EXT_direct_state_access used when DSA is available
@@ -1012,6 +1019,7 @@ private:
// Plus some missing ones that are in the NV_texture_multisample extension instead
void (QOPENGLF_APIENTRYP TextureImage3DMultisampleNV)(GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations);
void (QOPENGLF_APIENTRYP TextureImage2DMultisampleNV)(GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations);
+#endif
// OpenGL 1.0
void (QOPENGLF_APIENTRYP GetIntegerv)(GLenum pname, GLint *params);
diff --git a/src/gui/painting/qbrush.cpp b/src/gui/painting/qbrush.cpp
index 38c2dd6498..b35fa38ce0 100644
--- a/src/gui/painting/qbrush.cpp
+++ b/src/gui/painting/qbrush.cpp
@@ -508,7 +508,7 @@ QBrush::QBrush(Qt::GlobalColor color, Qt::BrushStyle style)
The style is set to Qt::TexturePattern. The color will only have
an effect for QBitmaps.
- \sa setColor(), setPixmap()
+ \sa setColor(), setTexture()
*/
QBrush::QBrush(const QColor &color, const QPixmap &pixmap)
@@ -525,7 +525,7 @@ QBrush::QBrush(const QColor &color, const QPixmap &pixmap)
The style is set to Qt::TexturePattern. The color will only have
an effect for QBitmaps.
- \sa setColor(), setPixmap()
+ \sa setColor(), setTexture()
*/
QBrush::QBrush(Qt::GlobalColor color, const QPixmap &pixmap)
{
diff --git a/src/gui/painting/qdrawhelper_neon.cpp b/src/gui/painting/qdrawhelper_neon.cpp
index b12fd71563..541b3ef619 100644
--- a/src/gui/painting/qdrawhelper_neon.cpp
+++ b/src/gui/painting/qdrawhelper_neon.cpp
@@ -964,6 +964,7 @@ public:
union Vect_buffer_i { Int32x4 v; int i[4]; };
union Vect_buffer_f { Float32x4 v; float f[4]; };
+ static inline Float32x4 v_dup(double x) { return vdupq_n_f32(float(x)); }
static inline Float32x4 v_dup(float x) { return vdupq_n_f32(x); }
static inline Int32x4 v_dup(int x) { return vdupq_n_s32(x); }
static inline Int32x4 v_dup(uint x) { return vdupq_n_s32(x); }
diff --git a/src/gui/painting/qpaintengine.h b/src/gui/painting/qpaintengine.h
index b4dec2929d..18b6d84146 100644
--- a/src/gui/painting/qpaintengine.h
+++ b/src/gui/painting/qpaintengine.h
@@ -247,12 +247,6 @@ private:
friend class QFontEngineBox;
friend class QFontEngineMac;
friend class QFontEngineWin;
-#ifndef QT_NO_QWS_QPF
- friend class QFontEngineQPF1;
-#endif
-#ifndef QT_NO_QWS_QPF2
- friend class QFontEngineQPF;
-#endif
friend class QMacPrintEngine;
friend class QMacPrintEnginePrivate;
friend class QFontEngineQPA;
diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp
index 4a26da104d..bdd0d9cd4c 100644
--- a/src/gui/painting/qpaintengine_raster.cpp
+++ b/src/gui/painting/qpaintengine_raster.cpp
@@ -308,9 +308,9 @@ QRasterPaintEnginePrivate::QRasterPaintEnginePrivate() :
of painting operations in Qt for Embedded Linux.
Note that this functionality is only available in
- \l{Qt for Embedded Linux}.
+ Qt for Embedded Linux.
- In \l{Qt for Embedded Linux}, painting is a pure software
+ In Qt for Embedded Linux, painting is a pure software
implementation. But starting with Qt 4.2, it is
possible to add an accelerated graphics driver to take advantage
of available hardware resources.
@@ -318,19 +318,15 @@ QRasterPaintEnginePrivate::QRasterPaintEnginePrivate() :
Hardware acceleration is accomplished by creating a custom screen
driver, accelerating the copying from memory to the screen, and
implementing a custom paint engine accelerating the various
- painting operations. Then a custom paint device (derived from the
- QCustomRasterPaintDevice class) and a custom window surface
- (derived from QWSWindowSurface) must be implemented to make
- \l{Qt for Embedded Linux} aware of the accelerated driver.
+ painting operations. Then a custom paint device and a custom
+ window surface must be implemented to make
+ Qt for Embedded Linux aware of the accelerated driver.
\note The QRasterPaintEngine class does not support 8-bit images.
Instead, they need to be converted to a supported format, such as
QImage::Format_ARGB32_Premultiplied.
- See the \l {Adding an Accelerated Graphics Driver to Qt for Embedded Linux}
- documentation for details.
-
- \sa QCustomRasterPaintDevice, QPaintEngine
+ \sa QPaintEngine
*/
/*!
diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp
index 4c02abdfd5..424ed554a2 100644
--- a/src/gui/painting/qpainter.cpp
+++ b/src/gui/painting/qpainter.cpp
@@ -146,17 +146,16 @@ static inline uint line_emulation(uint emulation)
}
#ifndef QT_NO_DEBUG
-static bool qt_painter_thread_test(int devType, const char *what, bool extraCondition = false)
+static bool qt_painter_thread_test(int devType, const char *what)
{
switch (devType) {
case QInternal::Image:
case QInternal::Printer:
case QInternal::Picture:
// can be drawn onto these devices safely from any thread
- if (extraCondition)
- break;
+ break;
default:
- if (!extraCondition && QThread::currentThread() != qApp->thread()) {
+ if (QThread::currentThread() != qApp->thread()) {
qWarning("QPainter: It is not safe to use %s outside the GUI thread", what);
return false;
}
diff --git a/src/gui/painting/qpdf.cpp b/src/gui/painting/qpdf.cpp
index 9105e8b396..c05f47c59d 100644
--- a/src/gui/painting/qpdf.cpp
+++ b/src/gui/painting/qpdf.cpp
@@ -1651,7 +1651,7 @@ void QPdfEnginePrivate::writeInfo()
xprintf("\n/Creator ");
printString(creator);
xprintf("\n/Producer ");
- printString(QString::fromLatin1("Qt " QT_VERSION_STR " (C) 2012 Digia Plc and/or its subsidiary(-ies)"));
+ printString(QString::fromLatin1("Qt " QT_VERSION_STR));
QDateTime now = QDateTime::currentDateTime().toUTC();
QTime t = now.time();
QDate d = now.date();
diff --git a/src/gui/painting/qtextureglyphcache.cpp b/src/gui/painting/qtextureglyphcache.cpp
index 2166ae7975..b953f8d81f 100644
--- a/src/gui/painting/qtextureglyphcache.cpp
+++ b/src/gui/painting/qtextureglyphcache.cpp
@@ -152,6 +152,18 @@ bool QTextureGlyphCache::populate(QFontEngine *fontEngine, int numGlyphs, const
continue;
if (listItemCoordinates.contains(GlyphAndSubPixelPosition(glyph, subPixelPosition)))
continue;
+
+ // This is a rather crude hack, but it works.
+ // The FreeType font engine is not capable of getting precise metrics for the alphamap
+ // without first rasterizing the glyph. If we force the glyph to be rasterized before
+ // we ask for the alphaMapBoundingBox(), the glyph will be loaded, rasterized and its
+ // proper metrics will be cached and used later.
+ if (fontEngine->hasInternalCaching()) {
+ QImage *locked = fontEngine->lockedAlphaMapForGlyph(glyph, subPixelPosition, format);
+ if (locked)
+ fontEngine->unlockAlphaMapForGlyph();
+ }
+
glyph_metrics_t metrics = fontEngine->alphaMapBoundingBox(glyph, subPixelPosition, m_transform, format);
#ifdef CACHE_DEBUG
diff --git a/src/gui/text/qfont.cpp b/src/gui/text/qfont.cpp
index a410004c06..49b5a9ba46 100644
--- a/src/gui/text/qfont.cpp
+++ b/src/gui/text/qfont.cpp
@@ -208,7 +208,7 @@ QFontEngine *QFontPrivate::engineForScript(int script) const
QMutexLocker locker(qt_fontdatabase_mutex());
if (script <= QChar::Script_Latin)
script = QChar::Script_Common;
- if (engineData && engineData->fontCache != QFontCache::instance()) {
+ if (engineData && engineData->fontCacheId != QFontCache::instance()->id()) {
// throw out engineData that came from a different thread
if (!engineData->ref.deref())
delete engineData;
@@ -317,7 +317,7 @@ void QFontPrivate::resolve(uint mask, const QFontPrivate *other)
QFontEngineData::QFontEngineData()
- : ref(0), fontCache(QFontCache::instance())
+ : ref(0), fontCacheId(QFontCache::instance()->id())
{
memset(engines, 0, QChar::ScriptCount * sizeof(QFontEngine *));
}
@@ -2638,9 +2638,12 @@ void QFontCache::cleanup()
}
#endif // QT_NO_THREAD
+QBasicAtomicInt font_cache_id = Q_BASIC_ATOMIC_INITIALIZER(1);
+
QFontCache::QFontCache()
: QObject(), total_cost(0), max_cost(min_cost),
- current_timestamp(0), fast(false), timer_id(-1)
+ current_timestamp(0), fast(false), timer_id(-1),
+ m_id(font_cache_id.fetchAndAddRelaxed(1))
{
}
diff --git a/src/gui/text/qfont_p.h b/src/gui/text/qfont_p.h
index 115e866f24..5b7f918e21 100644
--- a/src/gui/text/qfont_p.h
+++ b/src/gui/text/qfont_p.h
@@ -140,7 +140,7 @@ public:
~QFontEngineData();
QAtomicInt ref;
- QFontCache *fontCache;
+ const int fontCacheId;
QFontEngine *engines[QChar::ScriptCount];
@@ -206,6 +206,8 @@ public:
QFontCache();
~QFontCache();
+ int id() const { return m_id; }
+
void clear();
struct Key {
@@ -263,6 +265,7 @@ private:
uint current_timestamp;
bool fast;
int timer_id;
+ const int m_id;
};
Q_GUI_EXPORT int qt_defaultDpiX();
diff --git a/src/gui/text/qfontdatabase_qpa.cpp b/src/gui/text/qfontdatabase_qpa.cpp
index 6c0be950dc..fddbb11122 100644
--- a/src/gui/text/qfontdatabase_qpa.cpp
+++ b/src/gui/text/qfontdatabase_qpa.cpp
@@ -184,6 +184,7 @@ QFontEngine *loadSingleEngine(int script,
if (!engine) {
engine = pfdb->fontEngine(def, QChar::Script(script), size->handle);
if (engine) {
+ engine->smoothScalable = style->smoothScalable;
QFontCache::Key key(def,script);
QFontCache::instance()->instance()->insertEngine(key,engine);
}
diff --git a/src/gui/text/qfontengine.cpp b/src/gui/text/qfontengine.cpp
index 303c85ce75..7d1afbbfb6 100644
--- a/src/gui/text/qfontengine.cpp
+++ b/src/gui/text/qfontengine.cpp
@@ -208,7 +208,8 @@ Q_AUTOTEST_EXPORT QList<QFontEngine *> QFontEngine_stopCollectingEngines()
QFontEngine::QFontEngine()
: ref(0),
font_(0), font_destroy_func(0),
- face_(0), face_destroy_func(0)
+ face_(0), face_destroy_func(0),
+ smoothScalable(false)
{
cache_cost = 0;
fsType = 0;
diff --git a/src/gui/text/qfontengine_ft.cpp b/src/gui/text/qfontengine_ft.cpp
index 6e14fc23c6..22d2585898 100644
--- a/src/gui/text/qfontengine_ft.cpp
+++ b/src/gui/text/qfontengine_ft.cpp
@@ -112,7 +112,7 @@ QT_BEGIN_NAMESPACE
#endif
#define FLOOR(x) ((x) & -64)
-#define CEIL(x) (((x)+63) & -64)
+#define CEIL(x) (((x)+63) & -64)
#define TRUNC(x) ((x) >> 6)
#define ROUND(x) (((x)+32) & -64)
@@ -124,11 +124,21 @@ public:
QtFreetypeData()
: library(0)
{ }
+ ~QtFreetypeData();
FT_Library library;
QHash<QFontEngine::FaceId, QFreetypeFace *> faces;
};
+QtFreetypeData::~QtFreetypeData()
+{
+ for (QHash<QFontEngine::FaceId, QFreetypeFace *>::ConstIterator iter = faces.begin(); iter != faces.end(); ++iter)
+ iter.value()->cleanup();
+ faces.clear();
+ FT_Done_FreeType(library);
+ library = 0;
+}
+
#ifdef QT_NO_THREAD
Q_GLOBAL_STATIC(QtFreetypeData, theFreetypeData)
@@ -292,23 +302,35 @@ QFreetypeFace *QFreetypeFace::getFace(const QFontEngine::FaceId &face_id,
return freetype;
}
+void QFreetypeFace::cleanup()
+{
+ if (hbFace && hbFace_destroy_func) {
+ hbFace_destroy_func(hbFace);
+ hbFace = 0;
+ }
+ FT_Done_Face(face);
+ face = 0;
+}
+
void QFreetypeFace::release(const QFontEngine::FaceId &face_id)
{
- QtFreetypeData *freetypeData = qt_getFreetypeData();
if (!ref.deref()) {
- if (hbFace && hbFace_destroy_func) {
- hbFace_destroy_func(hbFace);
- hbFace = 0;
+ if (face) {
+ QtFreetypeData *freetypeData = qt_getFreetypeData();
+
+ cleanup();
+
+ if (freetypeData->faces.contains(face_id))
+ freetypeData->faces.take(face_id);
+
+ if (freetypeData->faces.isEmpty()) {
+ FT_Done_FreeType(freetypeData->library);
+ freetypeData->library = 0;
+ }
}
- FT_Done_Face(face);
- if(freetypeData->faces.contains(face_id))
- freetypeData->faces.take(face_id);
+
delete this;
}
- if (freetypeData->faces.isEmpty()) {
- FT_Done_FreeType(freetypeData->library);
- freetypeData->library = 0;
- }
}
@@ -631,7 +653,8 @@ QFontEngineFT::QFontEngineFT(const QFontDef &fd)
#endif
defaultFormat = Format_None;
embeddedbitmap = false;
- cacheEnabled = qEnvironmentVariableIsSet("QT_USE_FT_CACHE");
+ const QByteArray env = qgetenv("QT_NO_FT_CACHE");
+ cacheEnabled = env.isEmpty() || env.toInt() == 0;
m_subPixelPositionCount = 4;
}
@@ -699,7 +722,6 @@ bool QFontEngineFT::init(FaceId faceId, bool antialias, GlyphFormat format,
line_thickness = QFixed::fromFixed(FT_MulFix(face->underline_thickness, face->size->metrics.y_scale));
underline_position = QFixed::fromFixed(-FT_MulFix(face->underline_position, face->size->metrics.y_scale));
} else {
- // copied from QFontEngineQPF
// ad hoc algorithm
int score = fontDef.weight * fontDef.pixelSize;
line_thickness = score / 700;
@@ -1742,7 +1764,7 @@ glyph_metrics_t QFontEngineFT::alphaMapBoundingBox(glyph_t glyph, QFixed subPixe
glyphSet = &defaultGlyphSet;
}
}
- Glyph * g = glyphSet ? glyphSet->getGlyph(glyph) : 0;
+ Glyph * g = glyphSet ? glyphSet->getGlyph(glyph, subPixelPosition) : 0;
if (!g || g->format != format) {
face = lockFace();
FT_Matrix m = this->matrix;
diff --git a/src/gui/text/qfontengine_ft_p.h b/src/gui/text/qfontengine_ft_p.h
index e64fec2f27..7df66b9678 100644
--- a/src/gui/text/qfontengine_ft_p.h
+++ b/src/gui/text/qfontengine_ft_p.h
@@ -114,9 +114,11 @@ public:
private:
friend class QFontEngineFT;
+ friend class QtFreetypeData;
friend struct QScopedPointerDeleter<QFreetypeFace>;
QFreetypeFace() : _lock(QMutex::Recursive) {}
~QFreetypeFace() {}
+ void cleanup();
QAtomicInt ref;
QMutex _lock;
QByteArray fontData;
diff --git a/src/gui/text/qfontengine_p.h b/src/gui/text/qfontengine_p.h
index c181d61d73..07be498764 100644
--- a/src/gui/text/qfontengine_p.h
+++ b/src/gui/text/qfontengine_p.h
@@ -302,6 +302,8 @@ public:
inline QVariant userData() const { return m_userData; }
+ bool smoothScalable;
+
protected:
QFixed lastRightBearing(const QGlyphLayout &glyphs, bool round = false);
diff --git a/src/gui/text/qfontmetrics.cpp b/src/gui/text/qfontmetrics.cpp
index 58c9addec1..1a66657cbd 100644
--- a/src/gui/text/qfontmetrics.cpp
+++ b/src/gui/text/qfontmetrics.cpp
@@ -1587,7 +1587,7 @@ QRectF QFontMetricsF::boundingRect(const QRectF &rect, int flags, const QString&
\li Qt::TextWordBreak breaks the text to fit the rectangle.
\endlist
- These flags are defined in \l{Qt::TextFlags}.
+ These flags are defined in the \l{Qt::TextFlag} enum.
If Qt::TextExpandTabs is set in \a flags, the following behavior is
used to interpret tab characters in the text:
diff --git a/src/gui/text/qpfutil.cpp b/src/gui/text/qpfutil.cpp
deleted file mode 100644
index cf955e91e5..0000000000
--- a/src/gui/text/qpfutil.cpp
+++ /dev/null
@@ -1,66 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the QtGui module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-static const QFontEngineQPF::TagType tagTypes[QFontEngineQPF::NumTags] = {
- QFontEngineQPF::StringType, // FontName
- QFontEngineQPF::StringType, // FileName
- QFontEngineQPF::UInt32Type, // FileIndex
- QFontEngineQPF::UInt32Type, // FontRevision
- QFontEngineQPF::StringType, // FreeText
- QFontEngineQPF::FixedType, // Ascent
- QFontEngineQPF::FixedType, // Descent
- QFontEngineQPF::FixedType, // Leading
- QFontEngineQPF::FixedType, // XHeight
- QFontEngineQPF::FixedType, // AverageCharWidth
- QFontEngineQPF::FixedType, // MaxCharWidth
- QFontEngineQPF::FixedType, // LineThickness
- QFontEngineQPF::FixedType, // MinLeftBearing
- QFontEngineQPF::FixedType, // MinRightBearing
- QFontEngineQPF::FixedType, // UnderlinePosition
- QFontEngineQPF::UInt8Type, // GlyphFormat
- QFontEngineQPF::UInt8Type, // PixelSize
- QFontEngineQPF::UInt8Type, // Weight
- QFontEngineQPF::UInt8Type, // Style
- QFontEngineQPF::StringType, // EndOfHeader
- QFontEngineQPF::BitFieldType// WritingSystems
-};
-
-
diff --git a/src/gui/text/qtextdocument.cpp b/src/gui/text/qtextdocument.cpp
index 180b09be33..82d63237e7 100644
--- a/src/gui/text/qtextdocument.cpp
+++ b/src/gui/text/qtextdocument.cpp
@@ -2527,7 +2527,7 @@ static bool isOrderedList(int style)
|| style == QTextListFormat::ListUpperAlpha
|| style == QTextListFormat::ListUpperRoman
|| style == QTextListFormat::ListLowerRoman
- ;
+ ;
}
void QTextHtmlExporter::emitBlockAttributes(const QTextBlock &block)
diff --git a/src/gui/text/qtextdocument_p.cpp b/src/gui/text/qtextdocument_p.cpp
index f0910dd52d..4b6ce667fa 100644
--- a/src/gui/text/qtextdocument_p.cpp
+++ b/src/gui/text/qtextdocument_p.cpp
@@ -632,7 +632,7 @@ void QTextDocumentPrivate::move(int pos, int to, int length, QTextUndoCommand::O
blockRevision);
if (key+1 != blocks.position(b)) {
-// qDebug("remove_string from %d length %d", key, X->size_array[0]);
+// qDebug("remove_string from %d length %d", key, X->size_array[0]);
Q_ASSERT(noBlockInString(text.mid(X->stringPosition, X->size_array[0])));
w = remove_string(key, X->size_array[0], op);
@@ -641,7 +641,7 @@ void QTextDocumentPrivate::move(int pos, int to, int length, QTextUndoCommand::O
dstKey += X->size_array[0];
}
} else {
-// qDebug("remove_block at %d", key);
+// qDebug("remove_block at %d", key);
Q_ASSERT(X->size_array[0] == 1 && isValidBlockSeparator(text.at(X->stringPosition)));
b = blocks.previous(b);
B = 0;
@@ -779,7 +779,7 @@ void QTextDocumentPrivate::setCharFormat(int pos, int length, const QTextCharFor
}
void QTextDocumentPrivate::setBlockFormat(const QTextBlock &from, const QTextBlock &to,
- const QTextBlockFormat &newFormat, FormatChangeMode mode)
+ const QTextBlockFormat &newFormat, FormatChangeMode mode)
{
beginEditBlock();
@@ -795,7 +795,7 @@ void QTextDocumentPrivate::setBlockFormat(const QTextBlock &from, const QTextBlo
QTextBlock it = from;
QTextBlock end = to;
if (end.isValid())
- end = end.next();
+ end = end.next();
for (; it != end; it = it.next()) {
int oldFormat = block(it)->format;
@@ -820,8 +820,8 @@ void QTextDocumentPrivate::setBlockFormat(const QTextBlock &from, const QTextBlo
if (group)
group->blockInserted(it);
} else if (group) {
- group->blockFormatChanged(it);
- }
+ group->blockFormatChanged(it);
+ }
}
documentChange(from.position(), to.position() + to.length() - from.position());
@@ -892,14 +892,14 @@ int QTextDocumentPrivate::undoRedo(bool undo)
QTextUndoCommand &c = undoStack[undoState];
int resetBlockRevision = c.pos;
- switch(c.command) {
+ switch (c.command) {
case QTextUndoCommand::Inserted:
remove(c.pos, c.length, (QTextUndoCommand::Operation)c.operation);
PMDEBUG(" erase: from %d, length %d", c.pos, c.length);
c.command = QTextUndoCommand::Removed;
editPos = c.pos;
editLength = 0;
- break;
+ break;
case QTextUndoCommand::Removed:
PMDEBUG(" insert: format %d (from %d, length %d, strpos=%d)", c.format, c.pos, c.length, c.strPos);
insert_string(c.pos, c.strPos, c.length, c.format, (QTextUndoCommand::Operation)c.operation);
@@ -908,33 +908,33 @@ int QTextDocumentPrivate::undoRedo(bool undo)
editLength = 0;
editPos = c.pos;
editLength += c.length;
- break;
- case QTextUndoCommand::BlockInserted:
- case QTextUndoCommand::BlockAdded:
+ break;
+ case QTextUndoCommand::BlockInserted:
+ case QTextUndoCommand::BlockAdded:
remove_block(c.pos, &c.blockFormat, c.command, (QTextUndoCommand::Operation)c.operation);
PMDEBUG(" blockremove: from %d", c.pos);
- if (c.command == QTextUndoCommand::BlockInserted)
- c.command = QTextUndoCommand::BlockRemoved;
- else
- c.command = QTextUndoCommand::BlockDeleted;
+ if (c.command == QTextUndoCommand::BlockInserted)
+ c.command = QTextUndoCommand::BlockRemoved;
+ else
+ c.command = QTextUndoCommand::BlockDeleted;
editPos = c.pos;
editLength = 0;
- break;
- case QTextUndoCommand::BlockRemoved:
- case QTextUndoCommand::BlockDeleted:
+ break;
+ case QTextUndoCommand::BlockRemoved:
+ case QTextUndoCommand::BlockDeleted:
PMDEBUG(" blockinsert: charformat %d blockformat %d (pos %d, strpos=%d)", c.format, c.blockFormat, c.pos, c.strPos);
insert_block(c.pos, c.strPos, c.format, c.blockFormat, (QTextUndoCommand::Operation)c.operation, c.command);
resetBlockRevision += 1;
- if (c.command == QTextUndoCommand::BlockRemoved)
- c.command = QTextUndoCommand::BlockInserted;
- else
- c.command = QTextUndoCommand::BlockAdded;
+ if (c.command == QTextUndoCommand::BlockRemoved)
+ c.command = QTextUndoCommand::BlockInserted;
+ else
+ c.command = QTextUndoCommand::BlockAdded;
if (editPos != (int)c.pos)
editLength = 0;
editPos = c.pos;
editLength += 1;
- break;
- case QTextUndoCommand::CharFormatChanged: {
+ break;
+ case QTextUndoCommand::CharFormatChanged: {
resetBlockRevision = -1; // ## TODO
PMDEBUG(" charFormat: format %d (from %d, length %d)", c.format, c.pos, c.length);
FragmentIterator it = find(c.pos);
@@ -947,9 +947,9 @@ int QTextDocumentPrivate::undoRedo(bool undo)
editLength = 0;
editPos = c.pos;
editLength += c.length;
- break;
- }
- case QTextUndoCommand::BlockFormatChanged: {
+ break;
+ }
+ case QTextUndoCommand::BlockFormatChanged: {
resetBlockRevision = -1; // ## TODO
PMDEBUG(" blockformat: format %d pos %d", c.format, c.pos);
QTextBlock it = blocksFind(c.pos);
@@ -970,9 +970,9 @@ int QTextDocumentPrivate::undoRedo(bool undo)
}
documentChange(it.position(), it.length());
editPos = -1;
- break;
- }
- case QTextUndoCommand::GroupFormatChange: {
+ break;
+ }
+ case QTextUndoCommand::GroupFormatChange: {
resetBlockRevision = -1; // ## TODO
PMDEBUG(" group format change");
QTextObject *object = objectForIndex(c.objectIndex);
@@ -980,22 +980,22 @@ int QTextDocumentPrivate::undoRedo(bool undo)
changeObjectFormat(object, c.format);
c.format = oldFormat;
editPos = -1;
- break;
- }
+ break;
+ }
case QTextUndoCommand::CursorMoved:
editPos = c.pos;
editLength = 0;
break;
- case QTextUndoCommand::Custom:
+ case QTextUndoCommand::Custom:
resetBlockRevision = -1; // ## TODO
if (undo)
c.custom->undo();
else
c.custom->redo();
editPos = -1;
- break;
- default:
- Q_ASSERT(false);
+ break;
+ default:
+ Q_ASSERT(false);
}
if (resetBlockRevision >= 0) {
@@ -1315,9 +1315,9 @@ void QTextDocumentPrivate::adjustDocumentChangesAndCursors(int from, int addedOr
int removed = qMax(0, -addedOrRemoved);
int diff = 0;
- if(from + removed < docChangeFrom)
+ if (from + removed < docChangeFrom)
diff = docChangeFrom - from - removed;
- else if(from > docChangeFrom + docChangeLength)
+ else if (from > docChangeFrom + docChangeLength)
diff = from - (docChangeFrom + docChangeLength);
int overlap_start = qMax(from, docChangeFrom);
diff --git a/src/gui/text/qtextdocument_p.h b/src/gui/text/qtextdocument_p.h
index b3358161c5..fa22131c9e 100644
--- a/src/gui/text/qtextdocument_p.h
+++ b/src/gui/text/qtextdocument_p.h
@@ -194,7 +194,7 @@ public:
void setCharFormat(int pos, int length, const QTextCharFormat &newFormat, FormatChangeMode mode = SetFormat);
void setBlockFormat(const QTextBlock &from, const QTextBlock &to,
- const QTextBlockFormat &newFormat, FormatChangeMode mode = SetFormat);
+ const QTextBlockFormat &newFormat, FormatChangeMode mode = SetFormat);
void emitUndoAvailable(bool available);
void emitRedoAvailable(bool available);
diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp
index 2b0f9ffeb6..6345ed7682 100644
--- a/src/gui/text/qtextengine.cpp
+++ b/src/gui/text/qtextengine.cpp
@@ -3100,7 +3100,7 @@ int QTextEngine::positionInLigature(const QScriptItem *si, int end,
glyph_pos--;
}
- const QCharAttributes *attrs = attributes();
+ const QCharAttributes *attrs = attributes() + si->position;
logClusters = this->logClusters(si);
clusterLength = getClusterLength(logClusters, attrs, 0, end, glyph_pos, &clusterStart);
@@ -3117,11 +3117,11 @@ int QTextEngine::positionInLigature(const QScriptItem *si, int end,
int closestItem = dist > (perItemWidth / 2) ? n + 1 : n;
if (cursorOnCharacter && closestItem > 0)
closestItem--;
- int pos = si->position + clusterStart + closestItem;
+ int pos = clusterStart + closestItem;
// Jump to the next grapheme boundary
while (pos < end && !attrs[pos].graphemeBoundary)
pos++;
- return pos;
+ return si->position + pos;
}
return si->position + end;
}
diff --git a/src/gui/text/qtexthtmlparser.cpp b/src/gui/text/qtexthtmlparser.cpp
index a131503b85..3cb61b9eae 100644
--- a/src/gui/text/qtexthtmlparser.cpp
+++ b/src/gui/text/qtexthtmlparser.cpp
@@ -1896,11 +1896,7 @@ QVector<QCss::Declaration> QTextHtmlParser::declarationsForNode(int node) const
if (nodes.at(node).id == Html_a && nodes.at(node).hasHref)
extraPseudo = "link";
decls = selector.declarationsForNode(n, extraPseudo);
- n = selector.parentNode(n);
- while (!selector.isNullNode(n)) {
- decls = selector.declarationsForNode(n, extraPseudo) + decls;
- n = selector.parentNode(n);
- }
+
return decls;
}
diff --git a/src/gui/text/qtextlist.cpp b/src/gui/text/qtextlist.cpp
index f969f66006..15c16f1ec0 100644
--- a/src/gui/text/qtextlist.cpp
+++ b/src/gui/text/qtextlist.cpp
@@ -265,8 +265,8 @@ QString QTextList::itemText(const QTextBlock &blockIt) const
result = QLatin1String("?");
}
- }
- break;
+ }
+ break;
default:
Q_ASSERT(false);
}
diff --git a/src/gui/text/qtexttable.cpp b/src/gui/text/qtexttable.cpp
index d77cbf9671..045fe7f957 100644
--- a/src/gui/text/qtexttable.cpp
+++ b/src/gui/text/qtexttable.cpp
@@ -355,12 +355,12 @@ QTextTable *QTextTablePrivate::createTable(QTextDocumentPrivate *pieceTable, int
for (int i = 1; i < rows*cols; ++i) {
d->cells.append(pieceTable->insertBlock(QTextBeginningOfFrame, pos, cellIdx, charIdx));
-// qDebug(" addCell at %d", pos);
+// qDebug(" addCell at %d", pos);
++pos;
}
d->fragment_end = pieceTable->insertBlock(QTextEndOfFrame, pos, cellIdx, charIdx);
-// qDebug(" addEOR at %d", pos);
+// qDebug(" addEOR at %d", pos);
++pos;
d->blockFragmentUpdates = false;
@@ -482,7 +482,7 @@ void QTextTablePrivate::update() const
for (int jj = 0; jj < colspan; ++jj) {
Q_ASSERT(grid[(r+ii)*nCols + c+jj] == 0);
grid[(r+ii)*nCols + c+jj] = fragment;
-// qDebug(" setting cell %d span=%d/%d at %d/%d", fragment, rowspan, colspan, r+ii, c+jj);
+// qDebug(" setting cell %d span=%d/%d at %d/%d", fragment, rowspan, colspan, r+ii, c+jj);
}
}
}
@@ -654,7 +654,7 @@ void QTextTable::resize(int rows, int cols)
int nCols = this->columns();
if (rows == nRows && cols == nCols)
- return;
+ return;
d->pieceTable->beginEditBlock();
@@ -682,7 +682,7 @@ void QTextTable::insertRows(int pos, int num)
{
Q_D(QTextTable);
if (num <= 0)
- return;
+ return;
if (d->dirty)
d->update();
@@ -744,7 +744,7 @@ void QTextTable::insertColumns(int pos, int num)
{
Q_D(QTextTable);
if (num <= 0)
- return;
+ return;
if (d->dirty)
d->update();
@@ -932,7 +932,7 @@ void QTextTable::removeColumns(int pos, int num)
// qDebug() << "-------- removeCols" << pos << num;
if (num <= 0 || pos < 0)
- return;
+ return;
if (d->dirty)
d->update();
if (pos >= d->nCols)
diff --git a/src/gui/text/text.pri b/src/gui/text/text.pri
index 59a6f346e2..2a0e4eff32 100644
--- a/src/gui/text/text.pri
+++ b/src/gui/text/text.pri
@@ -1,89 +1,89 @@
# Qt kernel module
HEADERS += \
- text/qfont.h \
- text/qfontdatabase.h \
- text/qfontengine_p.h \
- text/qfontengineglyphcache_p.h \
- text/qfontinfo.h \
- text/qfontmetrics.h \
- text/qfont_p.h \
- text/qfontsubset_p.h \
- text/qtextengine_p.h \
- text/qtextlayout.h \
- text/qtextformat.h \
- text/qtextformat_p.h \
- text/qtextobject.h \
- text/qtextobject_p.h \
- text/qtextoption.h \
- text/qfragmentmap_p.h \
- text/qtextdocument.h \
- text/qtextdocument_p.h \
- text/qtexthtmlparser_p.h \
- text/qabstracttextdocumentlayout.h \
- text/qtextdocumentlayout_p.h \
- text/qtextcursor.h \
- text/qtextcursor_p.h \
- text/qtextdocumentfragment.h \
- text/qtextdocumentfragment_p.h \
- text/qtextimagehandler_p.h \
- text/qtexttable.h \
- text/qtextlist.h \
- text/qsyntaxhighlighter.h \
- text/qtextdocumentwriter.h \
- text/qcssparser_p.h \
- text/qtexttable_p.h \
- text/qzipreader_p.h \
- text/qzipwriter_p.h \
- text/qtextodfwriter_p.h \
- text/qstatictext_p.h \
- text/qstatictext.h \
- text/qrawfont.h \
- text/qrawfont_p.h \
+ text/qfont.h \
+ text/qfontdatabase.h \
+ text/qfontengine_p.h \
+ text/qfontengineglyphcache_p.h \
+ text/qfontinfo.h \
+ text/qfontmetrics.h \
+ text/qfont_p.h \
+ text/qfontsubset_p.h \
+ text/qtextengine_p.h \
+ text/qtextlayout.h \
+ text/qtextformat.h \
+ text/qtextformat_p.h \
+ text/qtextobject.h \
+ text/qtextobject_p.h \
+ text/qtextoption.h \
+ text/qfragmentmap_p.h \
+ text/qtextdocument.h \
+ text/qtextdocument_p.h \
+ text/qtexthtmlparser_p.h \
+ text/qabstracttextdocumentlayout.h \
+ text/qtextdocumentlayout_p.h \
+ text/qtextcursor.h \
+ text/qtextcursor_p.h \
+ text/qtextdocumentfragment.h \
+ text/qtextdocumentfragment_p.h \
+ text/qtextimagehandler_p.h \
+ text/qtexttable.h \
+ text/qtextlist.h \
+ text/qsyntaxhighlighter.h \
+ text/qtextdocumentwriter.h \
+ text/qcssparser_p.h \
+ text/qtexttable_p.h \
+ text/qzipreader_p.h \
+ text/qzipwriter_p.h \
+ text/qtextodfwriter_p.h \
+ text/qstatictext_p.h \
+ text/qstatictext.h \
+ text/qrawfont.h \
+ text/qrawfont_p.h \
text/qglyphrun.h \
text/qglyphrun_p.h \
text/qdistancefield_p.h
SOURCES += \
- text/qfont.cpp \
- text/qfontengine.cpp \
- text/qfontsubset.cpp \
- text/qfontmetrics.cpp \
- text/qfontdatabase.cpp \
- text/qtextengine.cpp \
- text/qtextlayout.cpp \
- text/qtextformat.cpp \
- text/qtextobject.cpp \
- text/qtextoption.cpp \
- text/qfragmentmap.cpp \
- text/qtextdocument.cpp \
- text/qtextdocument_p.cpp \
- text/qtexthtmlparser.cpp \
- text/qabstracttextdocumentlayout.cpp \
- text/qtextdocumentlayout.cpp \
- text/qtextcursor.cpp \
- text/qtextdocumentfragment.cpp \
- text/qtextimagehandler.cpp \
- text/qtexttable.cpp \
- text/qtextlist.cpp \
- text/qtextdocumentwriter.cpp \
- text/qsyntaxhighlighter.cpp \
- text/qcssparser.cpp \
- text/qzip.cpp \
- text/qtextodfwriter.cpp \
- text/qstatictext.cpp \
- text/qrawfont.cpp \
+ text/qfont.cpp \
+ text/qfontengine.cpp \
+ text/qfontsubset.cpp \
+ text/qfontmetrics.cpp \
+ text/qfontdatabase.cpp \
+ text/qtextengine.cpp \
+ text/qtextlayout.cpp \
+ text/qtextformat.cpp \
+ text/qtextobject.cpp \
+ text/qtextoption.cpp \
+ text/qfragmentmap.cpp \
+ text/qtextdocument.cpp \
+ text/qtextdocument_p.cpp \
+ text/qtexthtmlparser.cpp \
+ text/qabstracttextdocumentlayout.cpp \
+ text/qtextdocumentlayout.cpp \
+ text/qtextcursor.cpp \
+ text/qtextdocumentfragment.cpp \
+ text/qtextimagehandler.cpp \
+ text/qtexttable.cpp \
+ text/qtextlist.cpp \
+ text/qtextdocumentwriter.cpp \
+ text/qsyntaxhighlighter.cpp \
+ text/qcssparser.cpp \
+ text/qzip.cpp \
+ text/qtextodfwriter.cpp \
+ text/qstatictext.cpp \
+ text/qrawfont.cpp \
text/qglyphrun.cpp \
text/qdistancefield.cpp
SOURCES += \
- text/qfont_qpa.cpp \
- text/qfontengine_qpa.cpp \
- text/qplatformfontdatabase.cpp \
- text/qrawfont_qpa.cpp
+ text/qfont_qpa.cpp \
+ text/qfontengine_qpa.cpp \
+ text/qplatformfontdatabase.cpp \
+ text/qrawfont_qpa.cpp
HEADERS += \
- text/qplatformfontdatabase.h
+ text/qplatformfontdatabase.h
contains(QT_CONFIG, harfbuzz)|contains(QT_CONFIG, system-harfbuzz) {
DEFINES += QT_ENABLE_HARFBUZZ_NG