diff options
author | Lars Knoll <lars.knoll@qt.io> | 2020-02-27 14:22:01 +0100 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2020-02-27 14:22:01 +0100 |
commit | 5c6c0289f09d9bf18aaa35eed792e40840af5dce (patch) | |
tree | be49cdea36de09b01b570af3bdc7f0a95f5dd02e /src | |
parent | 469c3338407a5cf74c5e35c43ebb48c14e21ecac (diff) | |
parent | e30aa59a897ca3849fb99c6393cfb426ed22d33b (diff) |
Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: I4212d070d5752275085e754b96f0392113604dba
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/kernel/qobjectdefs_impl.h | 4 | ||||
-rw-r--r-- | src/gui/text/qfontengine.cpp | 3 | ||||
-rw-r--r-- | src/gui/text/qtextengine.cpp | 3 | ||||
-rw-r--r-- | src/platformsupport/fontdatabases/freetype/qfontengine_ft.cpp | 3 | ||||
-rw-r--r-- | src/plugins/platforms/wasm/qwasmbackingstore.cpp | 27 | ||||
-rw-r--r-- | src/plugins/platforms/wasm/qwasmcompositor.cpp | 7 | ||||
-rw-r--r-- | src/plugins/platforms/wasm/qwasmcompositor.h | 5 | ||||
-rw-r--r-- | src/plugins/platforms/wasm/qwasmintegration.cpp | 5 | ||||
-rw-r--r-- | src/plugins/platforms/wasm/qwasmintegration.h | 1 | ||||
-rw-r--r-- | src/sql/doc/src/sql-driver.qdoc | 14 | ||||
-rw-r--r-- | src/widgets/widgets/qdatetimeedit.cpp | 9 | ||||
-rw-r--r-- | src/widgets/widgets/qlineedit.cpp | 28 |
12 files changed, 77 insertions, 32 deletions
diff --git a/src/corelib/kernel/qobjectdefs_impl.h b/src/corelib/kernel/qobjectdefs_impl.h index 31ecc8b20d..aed50d6c5a 100644 --- a/src/corelib/kernel/qobjectdefs_impl.h +++ b/src/corelib/kernel/qobjectdefs_impl.h @@ -285,11 +285,15 @@ namespace QtPrivate { { }; + template <typename T> + using is_bool = std::is_same<bool, typename std::decay<T>::type>; + template<typename From, typename To> struct AreArgumentsNarrowedBase<From, To, typename std::enable_if<sizeof(From) && sizeof(To)>::type> : std::integral_constant<bool, (std::is_floating_point<From>::value && std::is_integral<To>::value) || (std::is_floating_point<From>::value && std::is_floating_point<To>::value && sizeof(From) > sizeof(To)) || + ((std::is_pointer<From>::value || std::is_member_pointer<From>::value) && QtPrivate::is_bool<To>::value) || ((std::is_integral<From>::value || std::is_enum<From>::value) && std::is_floating_point<To>::value) || (std::is_integral<From>::value && std::is_integral<To>::value && (sizeof(From) > sizeof(To) diff --git a/src/gui/text/qfontengine.cpp b/src/gui/text/qfontengine.cpp index 3ca9e9bbde..bffe1a10e0 100644 --- a/src/gui/text/qfontengine.cpp +++ b/src/gui/text/qfontengine.cpp @@ -663,6 +663,9 @@ glyph_metrics_t QFontEngine::tightBoundingBox(const QGlyphLayout &glyphs) QFixed ymax = 0; QFixed xmax = 0; for (int i = 0; i < glyphs.numGlyphs; i++) { + // If shaping has found this should be ignored, ignore it. + if (!glyphs.advances[i] || glyphs.attributes[i].dontPrint) + continue; glyph_metrics_t bb = boundingBox(glyphs.glyphs[i]); QFixed x = overall.xoff + glyphs.offsets[i].x + bb.x; QFixed y = overall.yoff + glyphs.offsets[i].y + bb.y; diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp index ac39a8cf69..81ed8fa97a 100644 --- a/src/gui/text/qtextengine.cpp +++ b/src/gui/text/qtextengine.cpp @@ -712,9 +712,8 @@ struct QBidiAlgorithm { analysis[pos].bidiDirection = QChar::DirEN; ++it; } - } else { - lastETPosition.clear(); } + lastETPosition.clear(); } last = current; lastPos = pos; diff --git a/src/platformsupport/fontdatabases/freetype/qfontengine_ft.cpp b/src/platformsupport/fontdatabases/freetype/qfontengine_ft.cpp index 8273041549..e65f67d4f1 100644 --- a/src/platformsupport/fontdatabases/freetype/qfontengine_ft.cpp +++ b/src/platformsupport/fontdatabases/freetype/qfontengine_ft.cpp @@ -1678,6 +1678,9 @@ glyph_metrics_t QFontEngineFT::boundingBox(const QGlyphLayout &glyphs) QFixed ymax = 0; QFixed xmax = 0; for (int i = 0; i < glyphs.numGlyphs; i++) { + // If shaping has found this should be ignored, ignore it. + if (!glyphs.advances[i] || glyphs.attributes[i].dontPrint) + continue; Glyph *g = cacheEnabled ? defaultGlyphSet.getGlyph(glyphs.glyphs[i]) : nullptr; if (!g) { if (!face) diff --git a/src/plugins/platforms/wasm/qwasmbackingstore.cpp b/src/plugins/platforms/wasm/qwasmbackingstore.cpp index 7e8a382512..6ac685083d 100644 --- a/src/plugins/platforms/wasm/qwasmbackingstore.cpp +++ b/src/plugins/platforms/wasm/qwasmbackingstore.cpp @@ -36,7 +36,7 @@ #include <QtGui/qpainter.h> #include <private/qguiapplication_p.h> #include <qpa/qplatformscreen.h> - +#include <QtGui/qoffscreensurface.h> #include <QtGui/qbackingstore.h> QT_BEGIN_NAMESPACE @@ -53,12 +53,29 @@ QWasmBackingStore::QWasmBackingStore(QWasmCompositor *compositor, QWindow *windo QWasmBackingStore::~QWasmBackingStore() { + auto window = this->window(); + QWasmIntegration::get()->removeBackingStore(window); + destroy(); + QWasmWindow *wasmWindow = static_cast<QWasmWindow *>(window->handle()); + if (wasmWindow) + wasmWindow->setBackingStore(nullptr); } void QWasmBackingStore::destroy() { - if (m_texture->isCreated()) - m_texture->destroy(); + if (m_texture->isCreated()) { + auto context = m_compositor->context(); + auto currentContext = QOpenGLContext::currentContext(); + if (!currentContext || !QOpenGLContext::areSharing(context, currentContext)) { + QOffscreenSurface offScreenSurface(m_compositor->screen()->screen()); + offScreenSurface.setFormat(context->format()); + offScreenSurface.create(); + context->makeCurrent(&offScreenSurface); + m_texture->destroy(); + } else { + m_texture->destroy(); + } + } } QPaintDevice *QWasmBackingStore::paintDevice() @@ -81,9 +98,9 @@ void QWasmBackingStore::updateTexture() if (m_dirty.isNull()) return; - if (m_recreateTexture && m_texture->isCreated()) { + if (m_recreateTexture) { m_recreateTexture = false; - m_texture->destroy(); + destroy(); } if (!m_texture->isCreated()) { diff --git a/src/plugins/platforms/wasm/qwasmcompositor.cpp b/src/plugins/platforms/wasm/qwasmcompositor.cpp index e9c4559971..2f0b0414d9 100644 --- a/src/plugins/platforms/wasm/qwasmcompositor.cpp +++ b/src/plugins/platforms/wasm/qwasmcompositor.cpp @@ -59,7 +59,6 @@ QWasmCompositedWindow::QWasmCompositedWindow() QWasmCompositor::QWasmCompositor(QWasmScreen *screen) :QObject(screen) - , m_frameBuffer(nullptr) , m_blitter(new QOpenGLTextureBlitter) , m_needComposit(false) , m_inFlush(false) @@ -71,7 +70,6 @@ QWasmCompositor::QWasmCompositor(QWasmScreen *screen) QWasmCompositor::~QWasmCompositor() { - delete m_frameBuffer; destroy(); } @@ -748,3 +746,8 @@ QWasmScreen *QWasmCompositor::screen() { return static_cast<QWasmScreen *>(parent()); } + +QOpenGLContext *QWasmCompositor::context() +{ + return m_context.data(); +} diff --git a/src/plugins/platforms/wasm/qwasmcompositor.h b/src/plugins/platforms/wasm/qwasmcompositor.h index 98f4a79b27..422f990175 100644 --- a/src/plugins/platforms/wasm/qwasmcompositor.h +++ b/src/plugins/platforms/wasm/qwasmcompositor.h @@ -125,11 +125,13 @@ public: static QWasmTitleBarOptions makeTitleBarOptions(const QWasmWindow *window); static QRect titlebarRect(QWasmTitleBarOptions tb, QWasmCompositor::SubControls subcontrol); + QWasmScreen *screen(); + QOpenGLContext *context(); + private slots: void frame(); private: - QWasmScreen *screen(); void notifyTopWindowChanged(QWasmWindow *window); void drawWindow(QOpenGLTextureBlitter *blitter, QWasmScreen *screen, QWasmWindow *window); void drawWindowContent(QOpenGLTextureBlitter *blitter, QWasmScreen *screen, QWasmWindow *window); @@ -138,7 +140,6 @@ private: void drawWindowDecorations(QOpenGLTextureBlitter *blitter, QWasmScreen *screen, QWasmWindow *window); void drwPanelButton(); - QImage *m_frameBuffer; QScopedPointer<QOpenGLContext> m_context; QScopedPointer<QOpenGLTextureBlitter> m_blitter; diff --git a/src/plugins/platforms/wasm/qwasmintegration.cpp b/src/plugins/platforms/wasm/qwasmintegration.cpp index 45bc49e382..4b42b5788f 100644 --- a/src/plugins/platforms/wasm/qwasmintegration.cpp +++ b/src/plugins/platforms/wasm/qwasmintegration.cpp @@ -187,6 +187,11 @@ QPlatformBackingStore *QWasmIntegration::createPlatformBackingStore(QWindow *win #endif } +void QWasmIntegration::removeBackingStore(QWindow* window) +{ + m_backingStores.remove(window); +} + #ifndef QT_NO_OPENGL QPlatformOpenGLContext *QWasmIntegration::createPlatformOpenGLContext(QOpenGLContext *context) const { diff --git a/src/plugins/platforms/wasm/qwasmintegration.h b/src/plugins/platforms/wasm/qwasmintegration.h index 08b68cb5f7..cb8639086a 100644 --- a/src/plugins/platforms/wasm/qwasmintegration.h +++ b/src/plugins/platforms/wasm/qwasmintegration.h @@ -89,6 +89,7 @@ public: void resizeScreen(const emscripten::val &canvas); void resizeAllScreens(); void updateDpi(); + void removeBackingStore(QWindow* window); private: mutable QWasmFontDatabase *m_fontDb; diff --git a/src/sql/doc/src/sql-driver.qdoc b/src/sql/doc/src/sql-driver.qdoc index e77cc772e6..7736591ae9 100644 --- a/src/sql/doc/src/sql-driver.qdoc +++ b/src/sql/doc/src/sql-driver.qdoc @@ -183,7 +183,7 @@ Run the installer, select custom installation and install the MySQL C Connector which matches your Qt installation (x86 or x64). - After installation make sure that the needed files are there: + After installation check that the needed files are there: \list \li \c {<MySQL dir>/lib/libmysql.lib} \li \c {<MySQL dir>/lib/libmysql.dll} @@ -196,16 +196,20 @@ \li \c {<MariaDB dir>/include/mysql.h} \endlist - Build the plugin as follows (here it is assumed that the MySQL - C Connector is installed in + \note As of MySQL 8.0.19, the C Connector is no longer offered as a standalone + installable component. Instead, you can get \c{mysql.h} and \c{libmysql.*} by + installing the full MySQL Server (x64 only) or the + \l{https://downloads.mariadb.org/connector-c/}{MariaDB C Connector}. + + Build the plugin as follows (here it is assumed that \c{<MySQL dir>} is \c{C:/Program Files/MySQL/MySQL Connector C 6.1}): \snippet code/doc_src_sql-driver.qdoc 5 If you are not using a Microsoft compiler, replace \c nmake with \c - mingw32-make in the line above. + mingw32-make above. - When you distribute your application, remember to include libmysql.dll / libmariadb.dll + When you distribute your application, remember to include \e libmysql.dll / \e libmariadb.dll in your installation package. It must be placed in the same folder as the application executable. \e libmysql.dll additionally needs the MSVC runtime libraries which can be installed with diff --git a/src/widgets/widgets/qdatetimeedit.cpp b/src/widgets/widgets/qdatetimeedit.cpp index 63d5ae268e..2057794820 100644 --- a/src/widgets/widgets/qdatetimeedit.cpp +++ b/src/widgets/widgets/qdatetimeedit.cpp @@ -677,7 +677,8 @@ void QDateTimeEdit::setTimeRange(const QTime &min, const QTime &max) \brief The currently displayed fields of the date time edit. Returns a bit set of the displayed sections for this format. - \a setDisplayFormat(), displayFormat() + + \sa setDisplayFormat(), displayFormat() */ QDateTimeEdit::Sections QDateTimeEdit::displayedSections() const @@ -690,7 +691,8 @@ QDateTimeEdit::Sections QDateTimeEdit::displayedSections() const \property QDateTimeEdit::currentSection \brief The current section of the spinbox. - \a setCurrentSection() + + \sa setCurrentSection() */ QDateTimeEdit::Section QDateTimeEdit::currentSection() const @@ -770,8 +772,7 @@ int QDateTimeEdit::sectionCount() const the cursorPosition is 5, currentSectionIndex returns 1. If the cursorPosition is 3, currentSectionIndex is 0, and so on. - \a setCurrentSection() - \sa currentSection() + \sa setCurrentSection(), currentSection() */ int QDateTimeEdit::currentSectionIndex() const diff --git a/src/widgets/widgets/qlineedit.cpp b/src/widgets/widgets/qlineedit.cpp index 675f09d283..06b40f9644 100644 --- a/src/widgets/widgets/qlineedit.cpp +++ b/src/widgets/widgets/qlineedit.cpp @@ -1200,8 +1200,8 @@ QMargins QLineEdit::textMargins() const The input mask is an input template string. It can contain the following elements: \table - \row \li Mask Characters \li Defines the class of input characters that are - considered valid in this position + \row \li Mask Characters \li Defines the \l {QChar::} {Category} of input characters + that are considered valid in this position \row \li Meta Characters \li Various special meanings \row \li Separators \li All other characters are regarded as immutable separators \endtable @@ -1210,17 +1210,21 @@ QMargins QLineEdit::textMargins() const \table \header \li Mask Character \li Meaning - \row \li \c A \li ASCII alphabetic character required. A-Z, a-z. - \row \li \c a \li ASCII alphabetic character permitted but not required. - \row \li \c N \li ASCII alphanumeric character required. A-Z, a-z, 0-9. - \row \li \c n \li ASCII alphanumeric character permitted but not required. + \row \li \c A \li character of the Letter category required, such as A-Z, a-z. + \row \li \c a \li character of the Letter category permitted but not required. + \row \li \c N \li character of the Letter or Number category required, such as + A-Z, a-z, 0-9. + \row \li \c n \li character of the Letter or Number category permitted but not required. \row \li \c X \li Any non-blank character required. \row \li \c x \li Any non-blank character permitted but not required. - \row \li \c 9 \li ASCII digit required. 0-9. - \row \li \c 0 \li ASCII digit permitted but not required. - \row \li \c D \li ASCII digit required. 1-9. - \row \li \c d \li ASCII digit permitted but not required (1-9). - \row \li \c # \li ASCII digit or plus/minus sign permitted but not required. + \row \li \c 9 \li character of the Number category required, e.g 0-9. + \row \li \c 0 \li character of the Number category permitted but not required. + \row \li \c D \li character of the Number category and larger than zero required, + such as 1-9 + \row \li \c d \li character of the Number category and larger than zero permitted but not + required, such as 1-9. + \row \li \c # \li character of the Number category, or plus/minus sign permitted but not + required. \row \li \c H \li Hexadecimal character required. A-F, a-f, 0-9. \row \li \c h \li Hexadecimal character permitted but not required. \row \li \c B \li Binary character required. 0-1. @@ -1262,7 +1266,7 @@ QMargins QLineEdit::textMargins() const To get range control (e.g., for an IP address) use masks together with \l{setValidator()}{validators}. - \sa maxLength + \sa maxLength, QChar::isLetter(), QChar::isNumber(), QChar::digitValue() */ QString QLineEdit::inputMask() const { |