From 0e69230d02813f0b7a050645fb7e443bd504ab6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorbj=C3=B8rn=20Martsum?= Date: Mon, 13 Jan 2014 14:29:16 +0100 Subject: Revert "QAIV - Fix scollbars with ScrollPerPixel to scroll 1 pixel." MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 934f06220391eb0e0ebf66a2eb037f48adb4c43c. The patch needs to be modified a bit. Many users considers not having the old feature as a big regression. The feature needs to be improved with a variable that is only set when the user uses setSingleStep. Task-number: QTBUG-33906 Change-Id: I35e5d3e9d3d7a3ebd01807b03a0e7a424185d483 Reviewed-by: Thorbjørn Lindeijer Reviewed-by: Stephen Kelly --- src/widgets/itemviews/qlistview.cpp | 8 ++++---- src/widgets/itemviews/qtableview.cpp | 4 ++-- src/widgets/itemviews/qtreeview.cpp | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/widgets/itemviews/qlistview.cpp b/src/widgets/itemviews/qlistview.cpp index 0cca52daa2..7f7c60b10e 100644 --- a/src/widgets/itemviews/qlistview.cpp +++ b/src/widgets/itemviews/qlistview.cpp @@ -1837,18 +1837,18 @@ void QCommonListViewBase::paintDragDrop(QPainter *painter) } #endif -void QCommonListViewBase::updateHorizontalScrollBar(const QSize & /*step*/) +void QCommonListViewBase::updateHorizontalScrollBar(const QSize &step) { + horizontalScrollBar()->setSingleStep(step.width() + spacing()); horizontalScrollBar()->setPageStep(viewport()->width()); horizontalScrollBar()->setRange(0, contentsSize.width() - viewport()->width()); - // we do not want to overwrite (a possible user set) single step } -void QCommonListViewBase::updateVerticalScrollBar(const QSize & /*step*/) +void QCommonListViewBase::updateVerticalScrollBar(const QSize &step) { + verticalScrollBar()->setSingleStep(step.height() + spacing()); verticalScrollBar()->setPageStep(viewport()->height()); verticalScrollBar()->setRange(0, contentsSize.height() - viewport()->height()); - // we do not want to overwrite (a possible user set) single step } void QCommonListViewBase::scrollContentsBy(int dx, int dy, bool /*scrollElasticBand*/) diff --git a/src/widgets/itemviews/qtableview.cpp b/src/widgets/itemviews/qtableview.cpp index 08600b3ef7..a252428a81 100644 --- a/src/widgets/itemviews/qtableview.cpp +++ b/src/widgets/itemviews/qtableview.cpp @@ -2170,7 +2170,7 @@ void QTableView::updateGeometries() } else { // ScrollPerPixel horizontalScrollBar()->setPageStep(vsize.width()); horizontalScrollBar()->setRange(0, horizontalLength - vsize.width()); - // here we do not want to overwrite (a possible user set) single step + horizontalScrollBar()->setSingleStep(qMax(vsize.width() / (columnsInViewport + 1), 2)); } // vertical scroll bar @@ -2198,7 +2198,7 @@ void QTableView::updateGeometries() } else { // ScrollPerPixel verticalScrollBar()->setPageStep(vsize.height()); verticalScrollBar()->setRange(0, verticalLength - vsize.height()); - // here we do not want to overwrite (a possible user set) single step + verticalScrollBar()->setSingleStep(qMax(vsize.height() / (rowsInViewport + 1), 2)); } d->geometryRecursionBlock = false; diff --git a/src/widgets/itemviews/qtreeview.cpp b/src/widgets/itemviews/qtreeview.cpp index 4d0eb5c3ad..5d0e835b0e 100644 --- a/src/widgets/itemviews/qtreeview.cpp +++ b/src/widgets/itemviews/qtreeview.cpp @@ -3685,7 +3685,7 @@ void QTreeViewPrivate::updateScrollBars() } vbar->setRange(0, contentsHeight - viewportSize.height()); vbar->setPageStep(viewportSize.height()); - // here we do not want to overwrite (a possible user set) single step + vbar->setSingleStep(qMax(viewportSize.height() / (itemsInViewport + 1), 2)); } const int columnCount = header->count(); @@ -3711,7 +3711,7 @@ void QTreeViewPrivate::updateScrollBars() viewportSize = maxSize; hbar->setPageStep(viewportSize.width()); hbar->setRange(0, qMax(horizontalLength - viewportSize.width(), 0)); - // here we do not want to overwrite (a possible user set) single step + hbar->setSingleStep(qMax(viewportSize.width() / (columnsInViewport + 1), 2)); } } -- cgit v1.2.3 From 6eeab0b0e19818815dffb1ff603bc84aac3ffcb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Mon, 16 Dec 2013 23:15:38 +0100 Subject: Remove Mac unified toolbar workarounds. QMainWindow::unifiedTitleAndToolBarOnMac() will again return true, but the new implementation is much more similar to the cross platform one so these workarounds are not needed. Task-number: QTBUG-34411 Change-Id: I8f63067f929c94aab252fc2e88f98fb94c870c44 Reviewed-by: Gabriel de Dietrich --- src/widgets/widgets/qtoolbararealayout.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/widgets/widgets/qtoolbararealayout.cpp b/src/widgets/widgets/qtoolbararealayout.cpp index 04ef6a80be..5ec76569aa 100644 --- a/src/widgets/widgets/qtoolbararealayout.cpp +++ b/src/widgets/widgets/qtoolbararealayout.cpp @@ -655,9 +655,7 @@ QRect QToolBarAreaLayout::fitLayout() docks[QInternal::BottomDock].rect = QRect(rect.left(), center.bottom() + 1, rect.width(), bottom_hint.height()); - if (!mainWindow->unifiedTitleAndToolBarOnMac()) { - docks[QInternal::TopDock].fitLayout(); - } + docks[QInternal::TopDock].fitLayout(); docks[QInternal::LeftDock].fitLayout(); docks[QInternal::RightDock].fitLayout(); docks[QInternal::BottomDock].fitLayout(); @@ -1307,8 +1305,6 @@ bool QToolBarAreaLayout::restoreState(QDataStream &stream, const QList toolBars = _toolBars; int lines; stream >> lines; - if (!testing) - testing = mainWindow->unifiedTitleAndToolBarOnMac(); for (int j = 0; j < lines; ++j) { int pos; @@ -1319,7 +1315,7 @@ bool QToolBarAreaLayout::restoreState(QDataStream &stream, const QList> cnt; QToolBarAreaLayoutInfo &dock = docks[pos]; - const bool applyingLayout = !testing && !(pos == QInternal::TopDock && mainWindow->unifiedTitleAndToolBarOnMac()); + const bool applyingLayout = !testing; QToolBarAreaLayoutLine line(dock.o); for (int k = 0; k < cnt; ++k) { -- cgit v1.2.3 From 7edb5f22bf78cf2691145ab4160998c7b7f9416a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Mon, 16 Dec 2013 23:21:43 +0100 Subject: Implement QMainWindow::setUnifiedTitleAndToolBarOnMac Fix a feature regression from Qt 4. Unlike the Qt 4 implementation this does not move the tool bars out of the QMainWindow while pretending they are still there. Instead, use setContentBorderThickness from the Cocoa platform plugin to draw a background gradient that unifies the title and toolbar area. QToolBar can then draw itself with a transparent background and let the gradient shine throughout. This is a style-only change, toolbar behavior is kept as-is. [ChangeLog][Platform Specific Changes][OS X] Implemented QMainWindow::setUnifiedTitleAndToolBarOnMac. Task-number: QTBUG-34411 Change-Id: Idcaab6399f249b11edb1147856d9aece9923ab36 Reviewed-by: Gabriel de Dietrich --- src/widgets/widgets/qmainwindow.cpp | 43 ++++++++++++++++++++++++++++--------- 1 file changed, 33 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/widgets/widgets/qmainwindow.cpp b/src/widgets/widgets/qmainwindow.cpp index 0638981a9c..07db78c06c 100644 --- a/src/widgets/widgets/qmainwindow.cpp +++ b/src/widgets/widgets/qmainwindow.cpp @@ -60,6 +60,9 @@ #include #include "qtoolbar_p.h" #include "qwidgetanimator_p.h" +#ifdef Q_OS_OSX +#include +#endif #ifdef Q_WS_MAC #include #include @@ -76,6 +79,9 @@ class QMainWindowPrivate : public QWidgetPrivate public: inline QMainWindowPrivate() : layout(0), explicitIconSize(false), toolButtonStyle(Qt::ToolButtonIconOnly) +#ifdef Q_OS_OSX + , useUnifiedToolBar(false) +#endif #ifdef Q_WS_MAC , useHIToolBar(false) , activateUnifiedToolbarAfterFullScreen(false) @@ -88,6 +94,9 @@ public: QSize iconSize; bool explicitIconSize; Qt::ToolButtonStyle toolButtonStyle; +#ifdef Q_OS_OSX + bool useUnifiedToolBar; +#endif #ifdef Q_WS_MAC bool useHIToolBar; bool activateUnifiedToolbarAfterFullScreen; @@ -1492,16 +1501,29 @@ bool QMainWindow::event(QEvent *event) /*! \property QMainWindow::unifiedTitleAndToolBarOnMac \brief whether the window uses the unified title and toolbar look on Mac OS X - \since 4.3 - \obsolete - - This property is not implemented in Qt 5. Setting it has no effect. - - A replacement API (QtMacUnifiedToolBar) is available in QtMacExtras at - http://qt.gitorious.org/qtplayground/qtmacextras + \since 5.2 */ void QMainWindow::setUnifiedTitleAndToolBarOnMac(bool set) { +#ifdef Q_OS_OSX + Q_D(QMainWindow); + if (isWindow()) { + QPlatformNativeInterface *nativeInterface = QGuiApplication::platformNativeInterface(); + QPlatformNativeInterface::NativeResourceForIntegrationFunction function = + nativeInterface->nativeResourceFunctionForIntegration("setContentBorderThickness"); + if (!function) + return; // Not Cocoa platform plugin. + + createWinId(); + + d->useUnifiedToolBar = set; + + const int toolBarHeight = 50; + typedef void (*SetContentBorderThicknessFunction)(QWindow *window, int topThickness, int bottomThickness); + (reinterpret_cast(function))(window()->windowHandle(), toolBarHeight, 0); + } +#endif + #ifdef Q_WS_MAC Q_D(QMainWindow); if (!isWindow() || d->useHIToolBar == set || QSysInfo::MacintoshVersion < QSysInfo::MV_10_3) @@ -1534,6 +1556,9 @@ void QMainWindow::setUnifiedTitleAndToolBarOnMac(bool set) bool QMainWindow::unifiedTitleAndToolBarOnMac() const { +#ifdef Q_OS_OSX + return d_func()->useUnifiedToolBar; +#endif #ifdef Q_WS_MAC return d_func()->useHIToolBar && !testAttribute(Qt::WA_MacBrushedMetal) && !(windowFlags() & Qt::FramelessWindowHint); #endif @@ -1655,9 +1680,7 @@ QMenu *QMainWindow::createPopupMenu() for (int i = 0; i < toolbars.size(); ++i) { QToolBar *toolBar = toolbars.at(i); if (toolBar->parentWidget() == this - && (!d->layout->layoutState.toolBarAreaLayout.indexOf(toolBar).isEmpty() - || (unifiedTitleAndToolBarOnMac() - && toolBarArea(toolBar) == Qt::TopToolBarArea))) { + && (!d->layout->layoutState.toolBarAreaLayout.indexOf(toolBar).isEmpty())) { menu->addAction(toolbars.at(i)->toggleViewAction()); } } -- cgit v1.2.3 From 6cbbd1f93d369059e16c62f4b8ba60ad3407d886 Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Tue, 14 Jan 2014 13:10:09 +0100 Subject: Cocoa: Popups should not become key MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ... at least not like that. We still need to find a way for the popup to receive and process key events on its own, instead of depending on other layers inside Qt. This would make Qt Quick control's PopupWindow implementation much simpler, for example. Revert "Cocoa: Allow popups to grab mouse and keyboard" This reverts commit a25e6528d3806d3b5fd87c5a1cacd6c748215db1. Task-number: QTBUG-35820 Task-number: QTBUG-35904 Change-Id: Ica10529308ab25938397c16b9c1e1ce6cbd8f247 Reviewed-by: Gabriel de Dietrich Reviewed-by: Morten Johan Sørvig --- src/plugins/platforms/cocoa/qcocoawindow.h | 1 - src/plugins/platforms/cocoa/qcocoawindow.mm | 9 +-------- 2 files changed, 1 insertion(+), 9 deletions(-) (limited to 'src') diff --git a/src/plugins/platforms/cocoa/qcocoawindow.h b/src/plugins/platforms/cocoa/qcocoawindow.h index 66c3241b3d..452be90108 100644 --- a/src/plugins/platforms/cocoa/qcocoawindow.h +++ b/src/plugins/platforms/cocoa/qcocoawindow.h @@ -211,7 +211,6 @@ public: // for QNSView QRect m_exposedGeometry; int m_registerTouchCount; bool m_resizableTransientParent; - bool m_overrideBecomeKey; static const int NoAlertRequest; NSInteger m_alertRequest; diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm index 8e977236fa..56665719e8 100644 --- a/src/plugins/platforms/cocoa/qcocoawindow.mm +++ b/src/plugins/platforms/cocoa/qcocoawindow.mm @@ -160,9 +160,7 @@ static bool isMouseEvent(NSEvent *ev) // Only tool or dialog windows should become key: if (m_cocoaPlatformWindow - && (m_cocoaPlatformWindow->m_overrideBecomeKey || - m_cocoaPlatformWindow->window()->type() == Qt::Tool || - m_cocoaPlatformWindow->window()->type() == Qt::Dialog)) + && (m_cocoaPlatformWindow->window()->type() == Qt::Tool || m_cocoaPlatformWindow->window()->type() == Qt::Dialog)) return YES; return NO; } @@ -217,7 +215,6 @@ QCocoaWindow::QCocoaWindow(QWindow *tlw) , m_isExposed(false) , m_registerTouchCount(0) , m_resizableTransientParent(false) - , m_overrideBecomeKey(false) , m_alertRequest(NoAlertRequest) , monitor(nil) , m_drawContentBorderGradient(false) @@ -705,8 +702,6 @@ bool QCocoaWindow::setKeyboardGrabEnabled(bool grab) if (!m_nsWindow) return false; - m_overrideBecomeKey = grab; - if (grab && ![m_nsWindow isKeyWindow]) [m_nsWindow makeKeyWindow]; else if (!grab && [m_nsWindow isKeyWindow]) @@ -719,8 +714,6 @@ bool QCocoaWindow::setMouseGrabEnabled(bool grab) if (!m_nsWindow) return false; - m_overrideBecomeKey = grab; - if (grab && ![m_nsWindow isKeyWindow]) [m_nsWindow makeKeyWindow]; else if (!grab && [m_nsWindow isKeyWindow]) -- cgit v1.2.3 From 2565ef220b9f261fc2d62869b8d38625e41bc6fd Mon Sep 17 00:00:00 2001 From: Liang Qi Date: Tue, 14 Jan 2014 09:34:47 +0100 Subject: Revert "Cocoa: fix single punctuation input via CJK input method" This change makes a regression. This reverts commit a79f8a3a6774875fc16fd63461e04c2791a8d03d. Task-number: QTBUG-36033 Change-Id: Ibcb19cd8631f85c81433c9625bbbf280404db1c4 Reviewed-by: Jens Bache-Wiig --- src/plugins/platforms/cocoa/qnsview.mm | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm index f7b129aea1..ecb6c127aa 100644 --- a/src/plugins/platforms/cocoa/qnsview.mm +++ b/src/plugins/platforms/cocoa/qnsview.mm @@ -1346,6 +1346,11 @@ static QTabletEvent::TabletDevice wacomTabletDevice(NSEvent *theEvent) { Q_UNUSED(replacementRange) + if (m_sendKeyEvent && m_composingText.isEmpty()) { + // don't send input method events for simple text input (let handleKeyEvent send key events instead) + return; + } + QString commitString; if ([aString length]) { if ([aString isKindOfClass:[NSAttributedString class]]) { -- cgit v1.2.3 From 84be1bd4d3ed8d2d9e65301649bc841ea4197fe2 Mon Sep 17 00:00:00 2001 From: Konstantin Ritt Date: Tue, 14 Jan 2014 18:27:33 +0200 Subject: Fix crash due to a stale pointer dereferencing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The HB face caching mechanism introduced in 227e9a40cfeb7e00658cd3 wasn't complete due that fact that HB-NG doesn't parse the entire font table at once but rather references a table on-demand. This incompleteness caused a crash in case the engine doesn't get cached or when it removed from the cache and then re-used. Task-number: QTBUG-36099 Change-Id: I7816836107655ce7cf6eb9683bb5dc7f892f9cd1 Reviewed-by: Lisandro Damián Nicanor Pérez Meyer Reviewed-by: Michael Krasnyk Reviewed-by: Lars Knoll Reviewed-by: Allan Sandfeld Jensen --- src/gui/text/qfontengine.cpp | 13 ++++++++++++- src/gui/text/qfontengine_ft.cpp | 29 +++++++++++++++++++---------- src/gui/text/qfontengine_p.h | 5 +++++ src/gui/text/qharfbuzzng.cpp | 22 +++++++++++++++------- 4 files changed, 51 insertions(+), 18 deletions(-) (limited to 'src') diff --git a/src/gui/text/qfontengine.cpp b/src/gui/text/qfontengine.cpp index 303c85ce75..9eea2e786f 100644 --- a/src/gui/text/qfontengine.cpp +++ b/src/gui/text/qfontengine.cpp @@ -171,7 +171,8 @@ static const HB_FontClass hb_fontClass = { static HB_Error hb_getSFntTable(void *font, HB_Tag tableTag, HB_Byte *buffer, HB_UInt *length) { QFontEngine *fe = (QFontEngine *)font; - if (!fe->getSfntTableData(tableTag, buffer, length)) + Q_ASSERT(fe->faceData.get_font_table); + if (!fe->faceData.get_font_table(fe->faceData.user_data, tableTag, buffer, length)) return HB_Err_Invalid_Argument; return HB_Err_Ok; } @@ -182,6 +183,13 @@ static void hb_freeFace(void *face) } +static bool qt_get_font_table_default(void *user_data, uint tag, uchar *buffer, uint *length) +{ + QFontEngine *fe = (QFontEngine *)user_data; + return fe->getSfntTableData(tag, buffer, length); +} + + #ifdef QT_BUILD_INTERNAL // for testing purpose only, not thread-safe! static QList *enginesCollector = 0; @@ -210,6 +218,9 @@ QFontEngine::QFontEngine() font_(0), font_destroy_func(0), face_(0), face_destroy_func(0) { + faceData.user_data = this; + faceData.get_font_table = qt_get_font_table_default; + cache_cost = 0; fsType = 0; symbol = false; diff --git a/src/gui/text/qfontengine_ft.cpp b/src/gui/text/qfontengine_ft.cpp index 42cf15ee3b..05bd014bd7 100644 --- a/src/gui/text/qfontengine_ft.cpp +++ b/src/gui/text/qfontengine_ft.cpp @@ -116,6 +116,21 @@ QT_BEGIN_NAMESPACE #define TRUNC(x) ((x) >> 6) #define ROUND(x) (((x)+32) & -64) +static bool ft_getSfntTable(void *user_data, uint tag, uchar *buffer, uint *length) +{ + FT_Face face = (FT_Face)user_data; + + bool result = false; + if (FT_IS_SFNT(face)) { + FT_ULong len = *length; + result = FT_Load_Sfnt_Table(face, tag, 0, buffer, &len) == FT_Err_Ok; + *length = len; + } + + return result; +} + + // -------------------------- Freetype support ------------------------------ class QtFreetypeData @@ -408,15 +423,7 @@ QFontEngine::Properties QFreetypeFace::properties() const bool QFreetypeFace::getSfntTable(uint tag, uchar *buffer, uint *length) const { - bool result = false; -#if (FREETYPE_MAJOR*10000 + FREETYPE_MINOR*100 + FREETYPE_PATCH) > 20103 - if (FT_IS_SFNT(face)) { - FT_ULong len = *length; - result = FT_Load_Sfnt_Table(face, tag, 0, buffer, &len) == FT_Err_Ok; - *length = len; - } -#endif - return result; + return ft_getSfntTable(face, tag, buffer, length); } /* Some fonts (such as MingLiu rely on hinting to scale different @@ -761,6 +768,8 @@ bool QFontEngineFT::init(FaceId faceId, bool antialias, GlyphFormat format, fontDef.styleName = QString::fromUtf8(face->style_name); if (!freetype->hbFace) { + faceData.user_data = face; + faceData.get_font_table = ft_getSfntTable; freetype->hbFace = harfbuzzFace(); freetype->hbFace_destroy_func = face_destroy_func; } else { @@ -1179,7 +1188,7 @@ QFixed QFontEngineFT::emSquareSize() const bool QFontEngineFT::getSfntTableData(uint tag, uchar *buffer, uint *length) const { - return freetype->getSfntTable(tag, buffer, length); + return ft_getSfntTable(freetype->face, tag, buffer, length); } int QFontEngineFT::synthesized() const diff --git a/src/gui/text/qfontengine_p.h b/src/gui/text/qfontengine_p.h index c181d61d73..a04f4bd0ac 100644 --- a/src/gui/text/qfontengine_p.h +++ b/src/gui/text/qfontengine_p.h @@ -85,6 +85,7 @@ enum HB_Compat_Error { }; typedef void (*qt_destroy_func_t) (void *user_data); +typedef bool (*qt_get_font_table_func_t) (void *user_data, uint tag, uchar *buffer, uint *length); class Q_GUI_EXPORT QFontEngine { @@ -280,6 +281,10 @@ public: mutable qt_destroy_func_t font_destroy_func; mutable void *face_; mutable qt_destroy_func_t face_destroy_func; + struct FaceData { + void *user_data; + qt_get_font_table_func_t get_font_table; + } faceData; uint cache_cost; // amount of mem used in kb by the font uint fsType : 16; diff --git a/src/gui/text/qharfbuzzng.cpp b/src/gui/text/qharfbuzzng.cpp index b4ab5856df..d2e7df9c10 100644 --- a/src/gui/text/qharfbuzzng.cpp +++ b/src/gui/text/qharfbuzzng.cpp @@ -623,19 +623,22 @@ hb_font_funcs_t *hb_qt_get_font_funcs() static hb_blob_t * -_hb_qt_get_font_table(hb_face_t * /*face*/, hb_tag_t tag, void *user_data) +_hb_qt_reference_table(hb_face_t * /*face*/, hb_tag_t tag, void *user_data) { - QFontEngine *fe = (QFontEngine *)user_data; - Q_ASSERT(fe); + QFontEngine::FaceData *data = (QFontEngine::FaceData *)user_data; + Q_ASSERT(data); + + qt_get_font_table_func_t get_font_table = data->get_font_table; + Q_ASSERT(get_font_table); uint length = 0; - if (Q_UNLIKELY(!fe->getSfntTableData(tag, 0, &length) || length == 0)) + if (Q_UNLIKELY(!get_font_table(data->user_data, tag, 0, &length) || length == 0)) return hb_blob_get_empty(); char *buffer = (char *)malloc(length); Q_CHECK_PTR(buffer); - if (Q_UNLIKELY(!fe->getSfntTableData(tag, reinterpret_cast(buffer), &length))) + if (Q_UNLIKELY(!get_font_table(data->user_data, tag, reinterpret_cast(buffer), &length))) length = 0; return hb_blob_create(const_cast(buffer), length, @@ -646,9 +649,14 @@ _hb_qt_get_font_table(hb_face_t * /*face*/, hb_tag_t tag, void *user_data) static inline hb_face_t * _hb_qt_face_create(QFontEngine *fe) { - hb_face_t *face; + Q_ASSERT(fe); + + QFontEngine::FaceData *data = (QFontEngine::FaceData *)malloc(sizeof(QFontEngine::FaceData)); + Q_CHECK_PTR(data); + data->user_data = fe->faceData.user_data; + data->get_font_table = fe->faceData.get_font_table; - face = hb_face_create_for_tables(_hb_qt_get_font_table, (void *)fe, NULL); + hb_face_t *face = hb_face_create_for_tables(_hb_qt_reference_table, (void *)data, free); if (Q_UNLIKELY(hb_face_is_immutable(face))) { hb_face_destroy(face); return NULL; -- cgit v1.2.3 From 5dee237022e84a378468c3839e4e7af13cb1246d Mon Sep 17 00:00:00 2001 From: Andreas Holzammer Date: Wed, 15 Jan 2014 13:53:00 +0100 Subject: [QNX] Set Window usage Set Window usage prior to use the framebuffer. For OpenGL windows set OpenGL usage and for normal painting set it to native usage. Some QNX libscreen implementations don't set usage automatically, so we must set this explicitly. Task-number: QTBUG-35912 Change-Id: I5154c0bcf9c65ef6d47af6a1cf8f17765ccf51dd Reviewed-by: Fabian Bumberger Reviewed-by: Vladimir Minenko Reviewed-by: Giuseppe D'Angelo Reviewed-by: Rafael Roquetto --- src/plugins/platforms/qnx/qqnxeglwindow.cpp | 7 +++++++ src/plugins/platforms/qnx/qqnxrasterwindow.cpp | 6 ++++++ 2 files changed, 13 insertions(+) (limited to 'src') diff --git a/src/plugins/platforms/qnx/qqnxeglwindow.cpp b/src/plugins/platforms/qnx/qqnxeglwindow.cpp index b57227a60b..984de67d7d 100644 --- a/src/plugins/platforms/qnx/qqnxeglwindow.cpp +++ b/src/plugins/platforms/qnx/qqnxeglwindow.cpp @@ -63,6 +63,13 @@ QQnxEglWindow::QQnxEglWindow(QWindow *window, screen_context_t context, bool nee m_eglSurface(EGL_NO_SURFACE) { initWindow(); + + // Set window usage + const int val = SCREEN_USAGE_OPENGL_ES2; + const int result = screen_set_window_property_iv(nativeHandle(), SCREEN_PROPERTY_USAGE, &val); + if (result != 0) + qFatal("QQnxEglWindow: failed to set window alpha usage, errno=%d", errno); + m_requestedBufferSize = screen()->rootWindow() == this ? screen()->geometry().size() : window->geometry().size(); } diff --git a/src/plugins/platforms/qnx/qqnxrasterwindow.cpp b/src/plugins/platforms/qnx/qqnxrasterwindow.cpp index 1f974b268d..0d8daac0ee 100644 --- a/src/plugins/platforms/qnx/qqnxrasterwindow.cpp +++ b/src/plugins/platforms/qnx/qqnxrasterwindow.cpp @@ -60,6 +60,12 @@ QQnxRasterWindow::QQnxRasterWindow(QWindow *window, screen_context_t context, bo m_previousBufferIndex(-1) { initWindow(); + + // Set window usage + const int val = SCREEN_USAGE_NATIVE | SCREEN_USAGE_READ | SCREEN_USAGE_WRITE; + const int result = screen_set_window_property_iv(nativeHandle(), SCREEN_PROPERTY_USAGE, &val); + if (result != 0) + qFatal("QQnxEglWindow: failed to set window alpha usage, errno=%d", errno); } void QQnxRasterWindow::post(const QRegion &dirty) -- cgit v1.2.3 From 0c09d2ccb9b46138a908950d65a49aa58dd55062 Mon Sep 17 00:00:00 2001 From: Oliver Wolff Date: Mon, 13 Jan 2014 11:12:34 +0100 Subject: Windows: Do not try to update keymap on WM_IME_CHAR messages Task-number: QTBUG-35806 Change-Id: Ie1082353155aa7ee61f49f2fbcbfdb01d57e797c Reviewed-by: Friedemann Kleint --- src/plugins/platforms/windows/qwindowskeymapper.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/plugins/platforms/windows/qwindowskeymapper.cpp b/src/plugins/platforms/windows/qwindowskeymapper.cpp index 1baea6faff..334df17026 100644 --- a/src/plugins/platforms/windows/qwindowskeymapper.cpp +++ b/src/plugins/platforms/windows/qwindowskeymapper.cpp @@ -743,10 +743,10 @@ bool QWindowsKeyMapper::translateKeyEvent(QWindow *widget, HWND hwnd, return true; } - // WM_CHAR messages already contain the character in question so there is + // WM_(IME_)CHAR messages already contain the character in question so there is // no need to fiddle with our key map. In any other case add this key to the // keymap if it is not present yet. - if (msg.message != WM_CHAR) + if (msg.message != WM_CHAR && msg.message != WM_IME_CHAR) updateKeyMap(msg); MSG peekedMsg; -- cgit v1.2.3 From a19817082caa49309ba425e42f22637628f985d1 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Mon, 13 Jan 2014 11:53:43 +0100 Subject: Use non-threaded render loop on Samsung Galaxy Tab 3 We get EGL_BAD_ACCESS from eglMakeCurrent() on this device, and only on this device, so we simply work around it by disabling the threaded render loop. [ChangeLog][Android] Add workarounds for OpenGL bugs on Samsung Galaxy Tab 3. Task-number: QTBUG-34984 Change-Id: I309881f8317473ff87aea2f92d0f6f1b898342d3 Reviewed-by: Gunnar Sletta --- src/plugins/platforms/android/src/androidjnimain.cpp | 10 +++++++++- src/plugins/platforms/android/src/androidjnimain.h | 1 + .../android/src/qandroidplatformintegration.cpp | 18 ++++++++++++++++++ .../android/src/qandroidplatformintegration.h | 1 + 4 files changed, 29 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/plugins/platforms/android/src/androidjnimain.cpp b/src/plugins/platforms/android/src/androidjnimain.cpp index 3064e5d4e2..6461fa4733 100644 --- a/src/plugins/platforms/android/src/androidjnimain.cpp +++ b/src/plugins/platforms/android/src/androidjnimain.cpp @@ -418,7 +418,15 @@ namespace QtAndroid { return m_qtTag; } -} + + QString deviceName() + { + QString manufacturer = QJNIObjectPrivate::getStaticObjectField("android/os/Build", "MANUFACTURER", "Ljava/lang/String;").toString(); + QString model = QJNIObjectPrivate::getStaticObjectField("android/os/Build", "MODEL", "Ljava/lang/String;").toString(); + + return manufacturer + QStringLiteral(" ") + model; + } +} // namespace QtAndroid static jboolean startQtAndroidPlugin(JNIEnv* /*env*/, jobject /*object*//*, jobject applicationAssetManager*/) { diff --git a/src/plugins/platforms/android/src/androidjnimain.h b/src/plugins/platforms/android/src/androidjnimain.h index 11d3573404..a7b7072ba3 100644 --- a/src/plugins/platforms/android/src/androidjnimain.h +++ b/src/plugins/platforms/android/src/androidjnimain.h @@ -120,5 +120,6 @@ namespace QtAndroid const char *methodErrorMsgFmt(); const char *qtTagText(); + QString deviceName(); } #endif // ANDROID_APP_H diff --git a/src/plugins/platforms/android/src/qandroidplatformintegration.cpp b/src/plugins/platforms/android/src/qandroidplatformintegration.cpp index ae3e257d3c..e09cc40e01 100644 --- a/src/plugins/platforms/android/src/qandroidplatformintegration.cpp +++ b/src/plugins/platforms/android/src/qandroidplatformintegration.cpp @@ -89,6 +89,10 @@ void *QAndroidPlatformNativeInterface::nativeResourceForIntegration(const QByteA return &m_palettes; if (resource == "AndroidStyleFonts") return &m_fonts; + if (resource == "AndroidDeviceName") { + static QString deviceName = QtAndroid::deviceName(); + return &deviceName; + } return 0; } @@ -119,12 +123,26 @@ QAndroidPlatformIntegration::QAndroidPlatformIntegration(const QStringList ¶ m_androidSystemLocale = new QAndroidSystemLocale; } +bool QAndroidPlatformIntegration::needsBasicRenderloopWorkaround() +{ + static bool needsWorkaround = + QtAndroid::deviceName().compare(QStringLiteral("samsung SM-T211"), Qt::CaseInsensitive) == 0 + || QtAndroid::deviceName().compare(QStringLiteral("samsung SM-T210"), Qt::CaseInsensitive) == 0 + || QtAndroid::deviceName().compare(QStringLiteral("samsung SM-T215"), Qt::CaseInsensitive) == 0; + return needsWorkaround; +} + bool QAndroidPlatformIntegration::hasCapability(Capability cap) const { switch (cap) { case ThreadedPixmaps: return true; case ApplicationState: return true; case NativeWidgets: return false; + + case ThreadedOpenGL: + if (needsBasicRenderloopWorkaround()) + return false; + // fall through default: #ifndef ANDROID_PLUGIN_OPENGL return QPlatformIntegration::hasCapability(cap); diff --git a/src/plugins/platforms/android/src/qandroidplatformintegration.h b/src/plugins/platforms/android/src/qandroidplatformintegration.h index bd08ad694c..15a8ad33dd 100644 --- a/src/plugins/platforms/android/src/qandroidplatformintegration.h +++ b/src/plugins/platforms/android/src/qandroidplatformintegration.h @@ -146,6 +146,7 @@ public: #endif private: + static bool needsBasicRenderloopWorkaround(); friend class QEglFSAndroidHooks; -- cgit v1.2.3 From e4b94dd19cccd769f8326df20556a8900e7cfb3f Mon Sep 17 00:00:00 2001 From: Jens Bache-Wiig Date: Tue, 7 Jan 2014 18:05:02 +0100 Subject: Fix a possible crash in StyleSheetStyle Task-number: QTBUG-35901 Change-Id: I72e82a166d30cf5e4dac2917c633c7cbd355c817 Reviewed-by: J-P Nurmi Reviewed-by: Jens Bache-Wiig --- src/widgets/styles/qstylesheetstyle.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/widgets/styles/qstylesheetstyle.cpp b/src/widgets/styles/qstylesheetstyle.cpp index 2f36e0e53c..6bd0ba37c8 100644 --- a/src/widgets/styles/qstylesheetstyle.cpp +++ b/src/widgets/styles/qstylesheetstyle.cpp @@ -4710,7 +4710,9 @@ int QStyleSheetStyle::pixelMetric(PixelMetric m, const QStyleOption *opt, const break; case PM_TabBarBaseOverlap: { - const QWidget *tabWidget = qobject_cast(w) ? w : w->parentWidget(); + const QWidget *tabWidget = qobject_cast(w); + if (!tabWidget && w) + tabWidget = w->parentWidget(); if (hasStyleRule(tabWidget, PseudoElement_TabWidgetPane)) { return 0; } -- cgit v1.2.3 From 09f54e99f2e956908f9104181e7d61fa2f6a027d Mon Sep 17 00:00:00 2001 From: Liang Qi Date: Mon, 20 Jan 2014 09:56:24 +0100 Subject: Cocoa: avoid a crash for cursor in QCocoaWindow It need to be copied. Task-number: QTBUG-35887 Change-Id: Ia165e6a8f9dc23733e53e11f9e1e98bf54e7dd20 Reviewed-by: Gabriel de Dietrich --- src/plugins/platforms/cocoa/qcocoawindow.mm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm index 56665719e8..bf5e0cfbc4 100644 --- a/src/plugins/platforms/cocoa/qcocoawindow.mm +++ b/src/plugins/platforms/cocoa/qcocoawindow.mm @@ -264,6 +264,7 @@ QCocoaWindow::~QCocoaWindow() [m_contentView release]; [m_nsWindow release]; [m_nsWindowDelegate release]; + [m_windowCursor release]; } QSurfaceFormat QCocoaWindow::format() const @@ -1059,7 +1060,10 @@ void QCocoaWindow::setWindowCursor(NSCursor *cursor) [cursor set]; // or we can set the cursor on mouse enter/leave using tracking // areas. This is done in QNSView, save the cursor: - m_windowCursor = cursor; + if (m_windowCursor != cursor) { + [m_windowCursor release]; + m_windowCursor = [cursor retain]; + } } void QCocoaWindow::registerTouch(bool enable) -- cgit v1.2.3 From 5f52974860a9fc62ec5e7c56853156fed01b3aed Mon Sep 17 00:00:00 2001 From: Kurt Pattyn Date: Sun, 12 Jan 2014 17:58:56 +0100 Subject: Retain compiler warning state MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added push and pop pragma warning statements. Suppression of warnings should not propagate to user code. Therefore, suppression of warnings is restricted to the file where it is used. Change-Id: Ib7973cbc0205ebbe75e002d035e44fd9b447460f Reviewed-by: Jędrzej Nowacki --- src/corelib/tools/qvector.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/corelib/tools/qvector.h b/src/corelib/tools/qvector.h index 505e1a32e4..075e8e83e8 100644 --- a/src/corelib/tools/qvector.h +++ b/src/corelib/tools/qvector.h @@ -254,7 +254,10 @@ private: }; #ifdef Q_CC_MSVC -# pragma warning ( disable : 4345 ) // behavior change: an object of POD type constructed with an initializer of the form () will be default-initialized +// behavior change: an object of POD type constructed with an initializer of the form () +// will be default-initialized +# pragma warning ( push ) +# pragma warning ( disable : 4345 ) #endif template @@ -270,7 +273,7 @@ void QVector::defaultConstruct(T *from, T *to) } #ifdef Q_CC_MSVC -# pragma warning ( default: 4345 ) +# pragma warning ( pop ) #endif template -- cgit v1.2.3 From c2629632cf82be842a29493f87e6bdbd0b84a974 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Tue, 21 Jan 2014 10:23:38 +0100 Subject: Fix compilation of ANGLE with mingw-tdm64 gcc 4.8.1 Do not rely on sprintf_s being declared/defined. This also fixes deployment to Windows XP. See https://chromium-review.googlesource.com/#/c/182975/ for a similar commit proposed upstream. Task-number: QTBUG-36242 Change-Id: I520e2f61aeab34963e7a57baafd413c7db93f110 Reviewed-by: Friedemann Kleint --- src/3rdparty/angle/src/libEGL/Display.cpp | 2 +- ...ation-of-ANGLE-with-mingw-tdm64-gcc-4.8.1.patch | 33 ++++++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 src/angle/patches/0001-Fix-compilation-of-ANGLE-with-mingw-tdm64-gcc-4.8.1.patch (limited to 'src') diff --git a/src/3rdparty/angle/src/libEGL/Display.cpp b/src/3rdparty/angle/src/libEGL/Display.cpp index a382c3b1eb..82b48cedcf 100644 --- a/src/3rdparty/angle/src/libEGL/Display.cpp +++ b/src/3rdparty/angle/src/libEGL/Display.cpp @@ -523,7 +523,7 @@ void Display::initVendorString() if (mRenderer && mRenderer->getLUID(&adapterLuid)) { char adapterLuidString[64]; - sprintf_s(adapterLuidString, sizeof(adapterLuidString), " (adapter LUID: %08x%08x)", adapterLuid.HighPart, adapterLuid.LowPart); + snprintf(adapterLuidString, sizeof(adapterLuidString), " (adapter LUID: %08l%08l)", adapterLuid.HighPart, adapterLuid.LowPart); mVendorString += adapterLuidString; } diff --git a/src/angle/patches/0001-Fix-compilation-of-ANGLE-with-mingw-tdm64-gcc-4.8.1.patch b/src/angle/patches/0001-Fix-compilation-of-ANGLE-with-mingw-tdm64-gcc-4.8.1.patch new file mode 100644 index 0000000000..498cce1b7c --- /dev/null +++ b/src/angle/patches/0001-Fix-compilation-of-ANGLE-with-mingw-tdm64-gcc-4.8.1.patch @@ -0,0 +1,33 @@ +From 58a797397378aff3aa039a8b2a2d7011fe788737 Mon Sep 17 00:00:00 2001 +From: Kai Koehne +Date: Tue, 21 Jan 2014 10:23:38 +0100 +Subject: [PATCH] Fix compilation of ANGLE with mingw-tdm64 gcc 4.8.1 + +Do not rely on sprintf_s being declared/defined. This also fixes +deployment to Windows XP. + +See https://chromium-review.googlesource.com/#/c/182975/ for a similar +commit proposed upstream. + +Task-number: QTBUG-36242 +Change-Id: I520e2f61aeab34963e7a57baafd413c7db93f110 +--- + src/3rdparty/angle/src/libEGL/Display.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/3rdparty/angle/src/libEGL/Display.cpp b/src/3rdparty/angle/src/libEGL/Display.cpp +index a382c3b..82b48ce 100644 +--- a/src/3rdparty/angle/src/libEGL/Display.cpp ++++ b/src/3rdparty/angle/src/libEGL/Display.cpp +@@ -523,7 +523,7 @@ void Display::initVendorString() + if (mRenderer && mRenderer->getLUID(&adapterLuid)) + { + char adapterLuidString[64]; +- sprintf_s(adapterLuidString, sizeof(adapterLuidString), " (adapter LUID: %08x%08x)", adapterLuid.HighPart, adapterLuid.LowPart); ++ snprintf(adapterLuidString, sizeof(adapterLuidString), " (adapter LUID: %08l%08l)", adapterLuid.HighPart, adapterLuid.LowPart); + + mVendorString += adapterLuidString; + } +-- +1.8.5.2.msysgit.0 + -- cgit v1.2.3 From 909dbb92eb8ae607142e4316c01058090faaf1c7 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Mon, 20 Jan 2014 08:38:27 +0100 Subject: Work around FBO readback bug on Samsung Galaxy Tab 3 Symptom of the error is garbled text in Qt Quick 2, and the fix has been confirmed to be enabling the texture resize workaround. Task-number: QTBUG-34984 Change-Id: If6f621b43120c7913cbd33ab326c52ad6e2599bc Reviewed-by: Gunnar Sletta --- .../platforms/android/src/opengl/qandroidopenglcontext.cpp | 8 +++++--- src/plugins/platforms/android/src/qandroidplatformintegration.cpp | 4 ++-- src/plugins/platforms/android/src/qandroidplatformintegration.h | 4 ++-- 3 files changed, 9 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/plugins/platforms/android/src/opengl/qandroidopenglcontext.cpp b/src/plugins/platforms/android/src/opengl/qandroidopenglcontext.cpp index 6431914812..d94bb241f7 100644 --- a/src/plugins/platforms/android/src/opengl/qandroidopenglcontext.cpp +++ b/src/plugins/platforms/android/src/opengl/qandroidopenglcontext.cpp @@ -82,12 +82,14 @@ void QAndroidOpenGLContext::swapBuffers(QPlatformSurface *surface) bool QAndroidOpenGLContext::makeCurrent(QPlatformSurface *surface) { bool ret = QEglFSContext::makeCurrent(surface); + QOpenGLContextPrivate *ctx_d = QOpenGLContextPrivate::get(context()); const char *rendererString = reinterpret_cast(glGetString(GL_RENDERER)); - if (rendererString != 0 && qstrncmp(rendererString, "Android Emulator", 16) == 0) { - QOpenGLContextPrivate *ctx_d = QOpenGLContextPrivate::get(context()); + if (rendererString != 0 && qstrncmp(rendererString, "Android Emulator", 16) == 0) ctx_d->workaround_missingPrecisionQualifiers = true; - } + + if (!ctx_d->workaround_brokenFBOReadBack && QAndroidPlatformIntegration::needsWorkaround()) + ctx_d->workaround_brokenFBOReadBack = true; return ret; } diff --git a/src/plugins/platforms/android/src/qandroidplatformintegration.cpp b/src/plugins/platforms/android/src/qandroidplatformintegration.cpp index e09cc40e01..e4a2ad582d 100644 --- a/src/plugins/platforms/android/src/qandroidplatformintegration.cpp +++ b/src/plugins/platforms/android/src/qandroidplatformintegration.cpp @@ -123,7 +123,7 @@ QAndroidPlatformIntegration::QAndroidPlatformIntegration(const QStringList ¶ m_androidSystemLocale = new QAndroidSystemLocale; } -bool QAndroidPlatformIntegration::needsBasicRenderloopWorkaround() +bool QAndroidPlatformIntegration::needsWorkaround() { static bool needsWorkaround = QtAndroid::deviceName().compare(QStringLiteral("samsung SM-T211"), Qt::CaseInsensitive) == 0 @@ -140,7 +140,7 @@ bool QAndroidPlatformIntegration::hasCapability(Capability cap) const case NativeWidgets: return false; case ThreadedOpenGL: - if (needsBasicRenderloopWorkaround()) + if (needsWorkaround()) return false; // fall through default: diff --git a/src/plugins/platforms/android/src/qandroidplatformintegration.h b/src/plugins/platforms/android/src/qandroidplatformintegration.h index 15a8ad33dd..474c1e837e 100644 --- a/src/plugins/platforms/android/src/qandroidplatformintegration.h +++ b/src/plugins/platforms/android/src/qandroidplatformintegration.h @@ -145,9 +145,9 @@ public: QEglFSScreen *createScreen() const; #endif -private: - static bool needsBasicRenderloopWorkaround(); + static bool needsWorkaround(); +private: friend class QEglFSAndroidHooks; QTouchDevice *m_touchDevice; -- cgit v1.2.3 From 9eba69d7f914e4823e94699c5653df5ad279eb46 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Tue, 21 Jan 2014 08:42:05 +0100 Subject: Fix a bug in some QString comparison operators MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Some comparison operators comparing to const char * where not implemented correctly. Task-number: QTBUG-34024 Change-Id: Idbdc64c8ed93e88d9f2b2f55213bc785b33cb543 Reviewed-by: Jędrzej Nowacki --- src/corelib/tools/qstring.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/corelib/tools/qstring.h b/src/corelib/tools/qstring.h index 0a0a609728..9778d42c1d 100644 --- a/src/corelib/tools/qstring.h +++ b/src/corelib/tools/qstring.h @@ -1029,13 +1029,13 @@ inline QT_ASCII_CAST_WARN bool operator==(const char *s1, const QString &s2) inline QT_ASCII_CAST_WARN bool operator!=(const char *s1, const QString &s2) { return QString::compare_helper(s2.constData(), s2.size(), s1, -1) != 0; } inline QT_ASCII_CAST_WARN bool operator<(const char *s1, const QString &s2) -{ return QString::compare_helper(s2.constData(), s2.size(), s1, -1) < 0; } -inline QT_ASCII_CAST_WARN bool operator>(const char *s1, const QString &s2) { return QString::compare_helper(s2.constData(), s2.size(), s1, -1) > 0; } +inline QT_ASCII_CAST_WARN bool operator>(const char *s1, const QString &s2) +{ return QString::compare_helper(s2.constData(), s2.size(), s1, -1) < 0; } inline QT_ASCII_CAST_WARN bool operator<=(const char *s1, const QString &s2) -{ return QString::compare_helper(s2.constData(), s2.size(), s1, -1) <= 0; } -inline QT_ASCII_CAST_WARN bool operator>=(const char *s1, const QString &s2) { return QString::compare_helper(s2.constData(), s2.size(), s1, -1) >= 0; } +inline QT_ASCII_CAST_WARN bool operator>=(const char *s1, const QString &s2) +{ return QString::compare_helper(s2.constData(), s2.size(), s1, -1) <= 0; } inline QT_ASCII_CAST_WARN bool operator==(const char *s1, QLatin1String s2) { return QString::fromUtf8(s1) == s2; } -- cgit v1.2.3 From cf2b0b017b5a8d2c27ae0700e8e7fd5818e5d469 Mon Sep 17 00:00:00 2001 From: Martin Klapetek Date: Fri, 13 Dec 2013 16:24:01 +0100 Subject: Don't skip content drawing for QtQuickControls SpinBox If XPThemeData::noContent is set to true, the SpinBox from QtQuickControls renders with transparent background, which is being workarounded by simply adding white rectangle inside the QQC SpinBox, which in turn breaks other themes. This works in normal widget's QStyle because the spinbox there is drawn with a frameless QLineEdit, which fills the background. Setting XPThemeData::noContent to false for QtQuick items only makes the QQC SpinBox render correctly with Windows Vista style. Change-Id: I3229a2582dd1cad95c77e0961aaef502a8c6159a Reviewed-by: J-P Nurmi --- src/widgets/styles/qwindowsvistastyle.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/widgets/styles/qwindowsvistastyle.cpp b/src/widgets/styles/qwindowsvistastyle.cpp index 2f36944b5e..af379b756e 100644 --- a/src/widgets/styles/qwindowsvistastyle.cpp +++ b/src/widgets/styles/qwindowsvistastyle.cpp @@ -1879,7 +1879,11 @@ void QWindowsVistaStyle::drawComplexControl(ComplexControl control, const QStyle XPThemeData ftheme(widget, painter, QWindowsXPStylePrivate::EditTheme, partId, stateId, r); - ftheme.noContent = true; + // The spinbox in Windows QStyle is drawn with frameless QLineEdit inside it + // That however breaks with QtQuickControls where this results in transparent + // spinbox background, so if there's no "widget" passed (QtQuickControls case), + // let ftheme.noContent be false, which fixes the spinbox rendering in QQC + ftheme.noContent = (widget != NULL); d->drawBackground(ftheme); } if (sub & SC_SpinBoxUp) { -- cgit v1.2.3 From f58dff46f59555bbd6a6ae96bb1d1439f8c4feca Mon Sep 17 00:00:00 2001 From: Frederik Gladhorn Date: Mon, 20 Jan 2014 19:21:55 +0100 Subject: Initialize QGuiApplicationPrivate::lastCursorPosition to inf This makes sure that we don't think a mouse area at position 0, 0 contains the mouse on startup. Task-number: QTBUG-36191 Change-Id: I68a8aed195531f506372ef465734661069b60f57 Reviewed-by: Gabriel de Dietrich --- src/gui/kernel/qguiapplication.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index 0711a37edd..10f099a5ca 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -59,6 +59,7 @@ #include #include #include +#include #include #ifndef QT_NO_ACCESSIBILITY #include "qaccessible.h" @@ -110,7 +111,7 @@ Q_GUI_EXPORT bool qt_is_gui_used = true; Qt::MouseButtons QGuiApplicationPrivate::mouse_buttons = Qt::NoButton; Qt::KeyboardModifiers QGuiApplicationPrivate::modifier_buttons = Qt::NoModifier; -QPointF QGuiApplicationPrivate::lastCursorPosition(0.0, 0.0); +QPointF QGuiApplicationPrivate::lastCursorPosition(qInf(), qInf()); bool QGuiApplicationPrivate::tabletState = false; QWindow *QGuiApplicationPrivate::tabletPressTarget = 0; -- cgit v1.2.3 From 5b570c287f0ddd8897a22acc53416b1f89c11da7 Mon Sep 17 00:00:00 2001 From: Kurt Pattyn Date: Sun, 12 Jan 2014 19:10:30 +0100 Subject: Conditionally disable deprecated warnings Warning C4786 has been removed from MSVC2013. Warning C4231 has been removed since MSVC2003 .net. Added #ifdef statements to only suppress these warnings when the compiler versions supports them. Change-Id: I47d6116bc02cdeef6b2172be0b09d105af9d0059 Reviewed-by: Thiago Macieira --- src/corelib/global/qglobal.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index 9bba21210c..30db4e75cf 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -826,9 +826,13 @@ Q_CORE_EXPORT void qFreeAligned(void *ptr); # pragma warning(disable: 4800) /* 'type' : forcing value to bool 'true' or 'false' (performance warning) */ # pragma warning(disable: 4097) /* typedef-name 'identifier1' used as synonym for class-name 'identifier2' */ # pragma warning(disable: 4706) /* assignment within conditional expression */ -# pragma warning(disable: 4786) /* 'identifier' : identifier was truncated to 'number' characters in the debug information */ +# if _MSC_VER <= 1310 // MSVC 2003 +# pragma warning(disable: 4786) /* 'identifier' : identifier was truncated to 'number' characters in the debug information */ +# endif # pragma warning(disable: 4355) /* 'this' : used in base member initializer list */ -# pragma warning(disable: 4231) /* nonstandard extension used : 'identifier' before template explicit instantiation */ +# if _MSC_VER < 1800 // MSVC 2013 +# pragma warning(disable: 4231) /* nonstandard extension used : 'identifier' before template explicit instantiation */ +# endif # pragma warning(disable: 4710) /* function not inlined */ # pragma warning(disable: 4530) /* C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc */ # elif defined(Q_CC_BOR) -- cgit v1.2.3 From debe31e047060d790fb32c06e514d9df476df8bf Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Tue, 21 Jan 2014 15:11:03 +0100 Subject: X11: Qt::ActiveWindowFocusReason in QFocusEvent when appropriate When one window loses focus because another window got it, the reason should not be Qt::OtherFocusReason. If it is ActiveWindowFocusReason or PopupFocusReason, any QtQuick text elements that were in the window which lost focus will not deselect any selected text. Task-number: QTBUG-36292 Change-Id: I4630f74e6aacd928284cedab6ed711c95b24bff7 Reviewed-by: Friedemann Kleint Reviewed-by: Laszlo Agocs --- src/plugins/platforms/xcb/qxcbwindow.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp index f46bed77d6..3d8f91649a 100644 --- a/src/plugins/platforms/xcb/qxcbwindow.cpp +++ b/src/plugins/platforms/xcb/qxcbwindow.cpp @@ -1550,7 +1550,7 @@ void QXcbWindow::handleClientMessageEvent(const xcb_client_message_event_t *even handleXEmbedMessage(event); } else if (event->type == atom(QXcbAtom::_NET_ACTIVE_WINDOW)) { connection()->setFocusWindow(this); - QWindowSystemInterface::handleWindowActivated(window()); + QWindowSystemInterface::handleWindowActivated(window(), Qt::ActiveWindowFocusReason); } else if (event->type == atom(QXcbAtom::MANAGER) || event->type == atom(QXcbAtom::_NET_WM_STATE) || event->type == atom(QXcbAtom::WM_CHANGE_STATE)) { @@ -1855,14 +1855,14 @@ void QXcbWindow::handleFocusInEvent(const xcb_focus_in_event_t *) QWindow *w = window(); w = static_cast(QObjectPrivate::get(w))->eventReceiver(); connection()->setFocusWindow(static_cast(w->handle())); - QWindowSystemInterface::handleWindowActivated(w); + QWindowSystemInterface::handleWindowActivated(w, Qt::ActiveWindowFocusReason); } static bool focusInPeeker(QXcbConnection *connection, xcb_generic_event_t *event) { if (!event) { // FocusIn event is not in the queue, proceed with FocusOut normally. - QWindowSystemInterface::handleWindowActivated(0); + QWindowSystemInterface::handleWindowActivated(0, Qt::ActiveWindowFocusReason); return true; } uint response_type = event->response_type & ~0x80; -- cgit v1.2.3 From b5241296f8600ea3ba962c45ed8038abec5343f1 Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Wed, 4 Dec 2013 14:33:25 +0200 Subject: QDir: Do not assume that root ends with a slash Root can also be "//server" Task-number: QTBUG-35402 Change-Id: I25250b7dcb10cba7b676a0c88b64a402494d7481 Reviewed-by: Friedemann Kleint Reviewed-by: Thiago Macieira --- src/corelib/io/qdir.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/corelib/io/qdir.cpp b/src/corelib/io/qdir.cpp index 015f4cfe14..b704126efa 100644 --- a/src/corelib/io/qdir.cpp +++ b/src/corelib/io/qdir.cpp @@ -716,11 +716,12 @@ QString QDir::absoluteFilePath(const QString &fileName) const return fileName; d->resolveAbsoluteEntry(); + const QString absoluteDirPath = d->absoluteDirEntry.filePath(); if (fileName.isEmpty()) - return d->absoluteDirEntry.filePath(); - if (!d->absoluteDirEntry.isRoot()) - return d->absoluteDirEntry.filePath() % QLatin1Char('/') % fileName; - return d->absoluteDirEntry.filePath() % fileName; + return absoluteDirPath; + if (!absoluteDirPath.endsWith(QLatin1Char('/'))) + return absoluteDirPath % QLatin1Char('/') % fileName; + return absoluteDirPath % fileName; } /*! -- cgit v1.2.3 From 57d36d3f0cbbf641bb67f7f183edcb52aa15180d Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Mon, 20 Jan 2014 22:15:09 -0800 Subject: Fix mix of new[] / malloc in QTest::toHexRepresentation toHexRepresentation is used in QTest::toString(), whose results are deallocated with free(). So we shouldn't allocate with new[]. Change-Id: I3e9d35b3f28a1b9bfe740a13b5daa414b67853c6 Reviewed-by: Olivier Goffart Reviewed-by: Robin Burchell --- src/testlib/qtestcase.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp index e170d2a044..2c8b7b20b7 100644 --- a/src/testlib/qtestcase.cpp +++ b/src/testlib/qtestcase.cpp @@ -1893,7 +1893,7 @@ char *toHexRepresentation(const char *ba, int length) if (length > maxLen) { const int size = len * 3 + 4; - result = new char[size]; + result = static_cast(malloc(size)); char *const forElipsis = result + size - 5; forElipsis[0] = ' '; @@ -1901,10 +1901,9 @@ char *toHexRepresentation(const char *ba, int length) forElipsis[2] = '.'; forElipsis[3] = '.'; result[size - 1] = '\0'; - } - else { + } else { const int size = len * 3; - result = new char[size]; + result = static_cast(malloc(size)); result[size - 1] = '\0'; } -- cgit v1.2.3 From 2d8028d696a86102a7753f9d59fb41f4170181a8 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 16 Jan 2014 20:37:16 -0800 Subject: Fix the alignment for non-ASCII strings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit d040681b6f3d03b349e9b9487fe89a611d03ee3c added support for aligning the test results for easier side-by-side comparison of the actual and expected values. However, it didn't take into account multibyte strings. That is, we would see: FAIL! tst_testcase::testcase: Compared values are not the same Actual (QString("é")): F0O Expected (expected) : FOO We use mbstowcs (multibyte string to wide char string) that calculates the length in wide chars of the output string. That's roughly equivalent to QString::fromLocal8Bit(string).toUcs4().size(). Change-Id: Ic2649951c50e05143da32a7fbef00a01e385c542 Reviewed-by: Jason McDonald --- src/testlib/qtestresult.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/testlib/qtestresult.cpp b/src/testlib/qtestresult.cpp index d94b2bf85c..a9abca0ef8 100644 --- a/src/testlib/qtestresult.cpp +++ b/src/testlib/qtestresult.cpp @@ -46,8 +46,10 @@ #include #include +#include #include #include +#include QT_BEGIN_NAMESPACE @@ -268,8 +270,8 @@ bool QTestResult::compare(bool success, const char *failureMsg, if (success && QTest::expectFailMode) { qsnprintf(msg, 1024, "QCOMPARE(%s, %s) returned TRUE unexpectedly.", actual, expected); } else if (val1 || val2) { - size_t len1 = strlen(actual); - size_t len2 = strlen(expected); + size_t len1 = mbstowcs(NULL, actual, 0); + size_t len2 = mbstowcs(NULL, expected, 0); qsnprintf(msg, 1024, "%s\n Actual (%s)%*s %s\n Expected (%s)%*s %s", failureMsg, actual, qMax(len1, len2) - len1 + 1, ":", val1 ? val1 : "", -- cgit v1.2.3 From 3fadd88f30d7308500b7d6012c45346e9c6f47d0 Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Tue, 21 Jan 2014 12:59:10 +0100 Subject: Mac Style: Fix non-native menubar item spacing Unfortunate consequence from inheriting from Common style instead of Windows style. Also, a font entry missing in QCocoaTheme. Task-number: QTBUG-36224 Change-Id: I560494b1727734671478f70ee1ba800d21c916ca Reviewed-by: Jens Bache-Wiig --- src/plugins/platforms/cocoa/qcocoasystemsettings.mm | 1 + src/widgets/styles/qmacstyle_mac.mm | 8 ++++++++ 2 files changed, 9 insertions(+) (limited to 'src') diff --git a/src/plugins/platforms/cocoa/qcocoasystemsettings.mm b/src/plugins/platforms/cocoa/qcocoasystemsettings.mm index 194394d11a..1c08d4bcb7 100644 --- a/src/plugins/platforms/cocoa/qcocoasystemsettings.mm +++ b/src/plugins/platforms/cocoa/qcocoasystemsettings.mm @@ -254,6 +254,7 @@ QHash qt_mac_createRoleFonts() fonts.insert(QPlatformTheme::ListBoxFont, qt_mac_qfontForThemeFont(kThemeViewsFont)); fonts.insert(QPlatformTheme::TitleBarFont, qt_mac_qfontForThemeFont(kThemeWindowTitleFont)); fonts.insert(QPlatformTheme::MenuFont, qt_mac_qfontForThemeFont(kThemeMenuItemFont)); + fonts.insert(QPlatformTheme::MenuBarFont, qt_mac_qfontForThemeFont(kThemeMenuItemFont)); fonts.insert(QPlatformTheme::ComboMenuItemFont, qt_mac_qfontForThemeFont(kThemeSystemFont)); fonts.insert(QPlatformTheme::HeaderViewFont, qt_mac_qfontForThemeFont(kThemeSmallSystemFont)); fonts.insert(QPlatformTheme::TipLabelFont, qt_mac_qfontForThemeFont(kThemeSmallSystemFont)); diff --git a/src/widgets/styles/qmacstyle_mac.mm b/src/widgets/styles/qmacstyle_mac.mm index d13339b555..fa49bcb884 100644 --- a/src/widgets/styles/qmacstyle_mac.mm +++ b/src/widgets/styles/qmacstyle_mac.mm @@ -2077,6 +2077,10 @@ int QMacStyle::pixelMetric(PixelMetric metric, const QStyleOption *opt, const QW ret = 0; break; + case PM_MenuBarPanelWidth: + ret = 0; + break; + case QStyle::PM_MenuDesktopFrameWidth: ret = 5; break; @@ -6259,6 +6263,10 @@ QSize QMacStyle::sizeFromContents(ContentsType ct, const QStyleOption *opt, sz = QSize(w, h); } break; + case CT_MenuBarItem: + if (!sz.isEmpty()) + sz += QSize(12, 4); // Constants from QWindowsStyle + break; case CT_ToolButton: sz.rwidth() += 10; sz.rheight() += 10; -- cgit v1.2.3 From ef288db325d3c115e0cf5f458c657bdee60a432f Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Wed, 22 Jan 2014 15:14:34 +0100 Subject: qdoc: Fix crash in Generator::generateInnerNode Using an iterator is not a good idea since the generateInnerNode can end up adding new items to the childrenNode list and thus the iterator becomes invalid Without this patch i was getting this trace in valgrind ==19251== Invalid read of size 8 ==19251== at 0x474350: Generator::generateInnerNode(InnerNode*) (generator.cpp:1018) ==19251== by 0x4A422D: HtmlGenerator::generateTree() (htmlgenerator.cpp:276) ==19251== by 0x4AC369: processQdocconfFile(QString const&) (main.cpp:515) ==19251== by 0x40B894: main (main.cpp:669) ==19251== Address 0x943c1c0 is 0 bytes after a block of size 32 free'd ==19251== at 0x4C2C72E: realloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==19251== by 0x51676F2: QListData::realloc(int) (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.2.0) ==19251== by 0x51677EE: QListData::append(int) (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.2.0) ==19251== by 0x439BAB: QList::append(Node* const&) (qlist.h:533) ==19251== by 0x4B46B3: InnerNode::addChild(Node*) (node.cpp:1262) ==19251== by 0x4B48DC: Node::Node(Node::Type, InnerNode*, QString const&) (node.cpp:179) ==19251== by 0x4B539F: InnerNode::InnerNode(Node::Type, InnerNode*, QString const&) (node.cpp:1193) ==19251== by 0x4B54EB: DocNode::DocNode(InnerNode*, QString const&, Node::SubType, Node::PageType) (node.cpp:1608) ==19251== by 0x4C0C5E: QDocDatabase::findQmlModule(QString const&) (node.h:535) ==19251== by 0x497EEA: HtmlGenerator::generateQmlRequisites(QmlClassNode*, CodeMarker*) (htmlgenerator.cpp:2005) ==19251== by 0x4995B9: HtmlGenerator::generateDocNode(DocNode*, CodeMarker*) (htmlgenerator.cpp:1533) ==19251== by 0x474508: Generator::generateInnerNode(InnerNode*) (generator.cpp:1010) ==19251== by 0x474372: Generator::generateInnerNode(InnerNode*) (generator.cpp:1019) ==19251== by 0x4A422D: HtmlGenerator::generateTree() (htmlgenerator.cpp:276) ==19251== by 0x4AC369: processQdocconfFile(QString const&) (main.cpp:515) ==19251== by 0x40B894: main (main.cpp:669) Change-Id: I7a6ae0a689ea5edddacf7f27f9dce95b26a441df Reviewed-by: Martin Smith --- src/tools/qdoc/generator.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/tools/qdoc/generator.cpp b/src/tools/qdoc/generator.cpp index 3cbba788c8..b14a79dfab 100644 --- a/src/tools/qdoc/generator.cpp +++ b/src/tools/qdoc/generator.cpp @@ -1013,12 +1013,13 @@ void Generator::generateInnerNode(InnerNode* node) } } - NodeList::ConstIterator c = node->childNodes().constBegin(); - while (c != node->childNodes().constEnd()) { - if ((*c)->isInnerNode() && (*c)->access() != Node::Private) { - generateInnerNode((InnerNode*)*c); + int i = 0; + while (i < node->childNodes().count()) { + Node *c = node->childNodes().at(i); + if (c->isInnerNode() && c->access() != Node::Private) { + generateInnerNode((InnerNode*)c); } - ++c; + ++i; } } -- cgit v1.2.3 From 8cf9811ec378b9903e3f64d027f625d9ab0ac7db Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Wed, 22 Jan 2014 11:01:14 +0100 Subject: Do not overwrite basePixmap of QIconLoader PixmapEntry Change-Id: I4799af1d9151ba4b0952369e9620d2fab2b002d9 Reviewed-by: David Sansome Reviewed-by: Jens Bache-Wiig --- src/gui/image/qiconloader.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/gui/image/qiconloader.cpp b/src/gui/image/qiconloader.cpp index d202d62957..9e979023cd 100644 --- a/src/gui/image/qiconloader.cpp +++ b/src/gui/image/qiconloader.cpp @@ -519,10 +519,11 @@ QPixmap PixmapEntry::pixmap(const QSize &size, QIcon::Mode mode, QIcon::State st return cachedPixmap; } else { if (basePixmap.size() != actualSize) - basePixmap = basePixmap.scaled(actualSize, Qt::IgnoreAspectRatio, Qt::SmoothTransformation); - cachedPixmap = basePixmap; + cachedPixmap = basePixmap.scaled(actualSize, Qt::IgnoreAspectRatio, Qt::SmoothTransformation); + else + cachedPixmap = basePixmap; if (QGuiApplication *guiApp = qobject_cast(qApp)) - cachedPixmap = static_cast(QObjectPrivate::get(guiApp))->applyQIconStyleHelper(mode, basePixmap); + cachedPixmap = static_cast(QObjectPrivate::get(guiApp))->applyQIconStyleHelper(mode, cachedPixmap); QPixmapCache::insert(key, cachedPixmap); } return cachedPixmap; -- cgit v1.2.3 From 6c017d0a2b3930ef87d4fb5c533c8d9c8f7bb15c Mon Sep 17 00:00:00 2001 From: Robin Burchell Date: Wed, 22 Jan 2014 12:26:10 +0100 Subject: EvdevTouch: Don't remove released touch data for Type B; only ignore slot The Type B protocol states that touch slots with an ID of -1 should be considered unused, but data should be retained if that slot becomes active again later. Instead of removing the contact from the contact list, only "disable" it. This contact can later be reused if the slot becomes active again. Change-Id: I827ae311841dd97f73a2c64d943658cd3f29eaf8 Done-with: Andrew Knight Reviewed-by: Laszlo Agocs --- .../input/evdevtouch/qevdevtouch.cpp | 37 +++++++++++++++++----- 1 file changed, 29 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/platformsupport/input/evdevtouch/qevdevtouch.cpp b/src/platformsupport/input/evdevtouch/qevdevtouch.cpp index d9468ae1b8..81746974c5 100644 --- a/src/platformsupport/input/evdevtouch/qevdevtouch.cpp +++ b/src/platformsupport/input/evdevtouch/qevdevtouch.cpp @@ -412,19 +412,31 @@ void QEvdevTouchScreenData::processInputEvent(input_event *data) if (data->code == ABS_MT_POSITION_X || (m_singleTouch && data->code == ABS_X)) { m_currentData.x = qBound(hw_range_x_min, data->value, hw_range_x_max); - if (m_typeB || m_singleTouch) + if (m_singleTouch) + m_contacts[m_currentSlot].x = m_currentData.x; + if (m_typeB) { m_contacts[m_currentSlot].x = m_currentData.x; + if (m_contacts[m_currentSlot].state == Qt::TouchPointStationary) + m_contacts[m_currentSlot].state = Qt::TouchPointMoved; + } } else if (data->code == ABS_MT_POSITION_Y || (m_singleTouch && data->code == ABS_Y)) { m_currentData.y = qBound(hw_range_y_min, data->value, hw_range_y_max); - if (m_typeB || m_singleTouch) + if (m_singleTouch) m_contacts[m_currentSlot].y = m_currentData.y; + if (m_typeB) { + m_contacts[m_currentSlot].y = m_currentData.y; + if (m_contacts[m_currentSlot].state == Qt::TouchPointStationary) + m_contacts[m_currentSlot].state = Qt::TouchPointMoved; + } } else if (data->code == ABS_MT_TRACKING_ID) { m_currentData.trackingId = data->value; if (m_typeB) { - if (m_currentData.trackingId == -1) + if (m_currentData.trackingId == -1) { m_contacts[m_currentSlot].state = Qt::TouchPointReleased; - else + } else { + m_contacts[m_currentSlot].state = Qt::TouchPointPressed; m_contacts[m_currentSlot].trackingId = m_currentData.trackingId; + } } } else if (data->code == ABS_MT_TOUCH_MAJOR) { m_currentData.maj = data->value; @@ -468,8 +480,11 @@ void QEvdevTouchScreenData::processInputEvent(input_event *data) it.next(); Contact &contact(it.value()); + if (!contact.state) + continue; + int key = m_typeB ? it.key() : contact.trackingId; - if (m_lastContacts.contains(key)) { + if (!m_typeB && m_lastContacts.contains(key)) { const Contact &prev(m_lastContacts.value(key)); if (contact.state == Qt::TouchPointReleased) { // Copy over the previous values for released points, just in case. @@ -483,7 +498,7 @@ void QEvdevTouchScreenData::processInputEvent(input_event *data) } // Avoid reporting a contact in released state more than once. - if (contact.state == Qt::TouchPointReleased + if (!m_typeB && contact.state == Qt::TouchPointReleased && !m_lastContacts.contains(key)) { it.remove(); continue; @@ -509,8 +524,14 @@ void QEvdevTouchScreenData::processInputEvent(input_event *data) while (it.hasNext()) { it.next(); Contact &contact(it.value()); - if (contact.state == Qt::TouchPointReleased) - it.remove(); + if (contact.state == Qt::TouchPointReleased) { + if (m_typeB) + contact.state = static_cast(0); + else + it.remove(); + } else { + contact.state = Qt::TouchPointStationary; + } } m_lastContacts = m_contacts; -- cgit v1.2.3 From 5aee85ec23f5c28fdccd9bd9d6ac90882bda348e Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Mon, 20 Jan 2014 11:53:21 -0800 Subject: Don't allow the QLibraryStore to be recreated during shutdown When QtCore's global destructors are run, they delete the global QLibraryStore qt_library_data and set the pointer to null. If something happened to call QLibraryStore::instance() later, it would be recreated and then weird things might happen. So prevent that from happening. That usually cannot happen, since the only thing that can run after QtCore global destructors are other QtCore global destructors or global destructors from libraries that do not depend on QtCore. So we're reasonably safe. There are two conditions in which something could run after QLibraryStore::cleanup() and still try to access QLibraryStore: 1) indirect dependency, like a global destructor from a library that doesn't depend on QtCore running code from another module that does. 2) static builds of Qt modules. In that case, the order of the global destructors is totally arbitrary and we could get one from a module that depends on QtCore running after QtCore's. That is the case from the bug report. Task-number: QTBUG-36294 Change-Id: Id199671275fd2535acf2d158857ce46b474e579b Reviewed-by: Kai Koehne Reviewed-by: Tim Jenssen --- src/corelib/plugin/qlibrary.cpp | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/corelib/plugin/qlibrary.cpp b/src/corelib/plugin/qlibrary.cpp index 468f759189..9736950c89 100644 --- a/src/corelib/plugin/qlibrary.cpp +++ b/src/corelib/plugin/qlibrary.cpp @@ -374,6 +374,7 @@ private: static QBasicMutex qt_library_mutex; static QLibraryStore *qt_library_data = 0; +static bool qt_library_data_once; QLibraryStore::~QLibraryStore() { @@ -429,8 +430,11 @@ Q_DESTRUCTOR_FUNCTION(qlibraryCleanup) // must be called with a locked mutex QLibraryStore *QLibraryStore::instance() { - if (Q_UNLIKELY(!qt_library_data)) + if (Q_UNLIKELY(!qt_library_data_once && !qt_library_data)) { + // only create once per process lifetime qt_library_data = new QLibraryStore; + qt_library_data_once = true; + } return qt_library_data; } @@ -440,12 +444,15 @@ inline QLibraryPrivate *QLibraryStore::findOrCreate(const QString &fileName, con QLibraryStore *data = instance(); // check if this library is already loaded - QLibraryPrivate *lib = data->libraryMap.value(fileName); + QLibraryPrivate *lib = 0; + if (Q_LIKELY(data)) + lib = data->libraryMap.value(fileName); if (!lib) lib = new QLibraryPrivate(fileName, version); // track this library - data->libraryMap.insert(fileName, lib); + if (Q_LIKELY(data)) + data->libraryMap.insert(fileName, lib); lib->libraryRefCount.ref(); return lib; @@ -464,9 +471,11 @@ inline void QLibraryStore::releaseLibrary(QLibraryPrivate *lib) // no one else is using Q_ASSERT(lib->libraryUnloadCount.load() == 0); - QLibraryPrivate *that = data->libraryMap.take(lib->fileName); - Q_ASSERT(lib == that); - Q_UNUSED(that); + if (Q_LIKELY(data)) { + QLibraryPrivate *that = data->libraryMap.take(lib->fileName); + Q_ASSERT(lib == that); + Q_UNUSED(that); + } delete lib; } -- cgit v1.2.3 From 7c65b1f6463f65931a77d760662deab63fcecb78 Mon Sep 17 00:00:00 2001 From: Jorgen Lind Date: Thu, 23 Jan 2014 12:16:20 +0100 Subject: Don't include when compiling with uClibc Change-Id: I5264280b7ce1e94eaf410a070f9670984f7a655b Reviewed-by: Peter Hartmann --- src/network/kernel/qdnslookup_unix.cpp | 2 +- src/network/kernel/qhostinfo_unix.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/network/kernel/qdnslookup_unix.cpp b/src/network/kernel/qdnslookup_unix.cpp index 052c492f07..9fb488cee6 100644 --- a/src/network/kernel/qdnslookup_unix.cpp +++ b/src/network/kernel/qdnslookup_unix.cpp @@ -52,7 +52,7 @@ #include #include -#ifdef __GNU_LIBRARY__ +#if defined(__GNU_LIBRARY__) && !defined(__UCLIBC__) # include #endif diff --git a/src/network/kernel/qhostinfo_unix.cpp b/src/network/kernel/qhostinfo_unix.cpp index dc2702b552..32b7318335 100644 --- a/src/network/kernel/qhostinfo_unix.cpp +++ b/src/network/kernel/qhostinfo_unix.cpp @@ -63,7 +63,7 @@ # include #endif -#ifdef __GNU_LIBRARY__ +#if defined(__GNU_LIBRARY__) && !defined(__UCLIBC__) # include #endif -- cgit v1.2.3 From d0b1bf3996bb1fb20e9592b7e8f1ce6d7ed0c659 Mon Sep 17 00:00:00 2001 From: Peter Hartmann Date: Thu, 23 Jan 2014 09:45:46 +0100 Subject: QAbstractSocket: make build with debug statements compile Otherwise we would get qabstractsocket.cpp:2224:24: error: unknown escape sequence: '\c' [-Werror] Change-Id: I757ff2aa1c46bbba7f0c0b93f49c2f9d84927b19 Reviewed-by: Richard J. Moore --- src/network/socket/qabstractsocket.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/network/socket/qabstractsocket.cpp b/src/network/socket/qabstractsocket.cpp index e0e13205fd..bebdf728a7 100644 --- a/src/network/socket/qabstractsocket.cpp +++ b/src/network/socket/qabstractsocket.cpp @@ -2192,7 +2192,7 @@ bool QAbstractSocket::waitForBytesWritten(int msecs) if (readyToWrite) { if (d->canWriteNotification()) { #if defined (QABSTRACTSOCKET_DEBUG) - qDebug("QAbstractSocket::waitForBytesWritten returns \c true"); + qDebug("QAbstractSocket::waitForBytesWritten returns true"); #endif return true; } -- cgit v1.2.3 From 4fab72a5eb19d34eb9b96a192fd901ddf7db2c92 Mon Sep 17 00:00:00 2001 From: Nico Vertriest Date: Thu, 12 Dec 2013 10:22:34 +0100 Subject: Doc: corrected broken links Links fixed: Extra Filters Basic Tools blockingfortuneclient Thread Support Drag and drop examples qBinaryFind qmake common project types imagegestures Task-number: QTBUG-34749 Change-Id: Ib93dda00716dc596db327fee5b97e110a9f27fa7 Reviewed-by: Martin Smith --- src/corelib/tools/qalgorithms.qdoc | 3 --- src/testlib/doc/qttestlib.qdocconf | 2 +- src/testlib/doc/src/qttestlib-manual.qdoc | 2 +- 3 files changed, 2 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/corelib/tools/qalgorithms.qdoc b/src/corelib/tools/qalgorithms.qdoc index 40eb2ed41d..8feb180248 100644 --- a/src/corelib/tools/qalgorithms.qdoc +++ b/src/corelib/tools/qalgorithms.qdoc @@ -662,9 +662,6 @@ This function requires the item type (in the example above, QString) to implement \c operator<(). - See the \l{#binaryFind example}{detailed - description} for an example usage. - \sa qLowerBound(), qUpperBound(), {random access iterators} */ diff --git a/src/testlib/doc/qttestlib.qdocconf b/src/testlib/doc/qttestlib.qdocconf index 250d237f12..92e5c97aab 100644 --- a/src/testlib/doc/qttestlib.qdocconf +++ b/src/testlib/doc/qttestlib.qdocconf @@ -27,7 +27,7 @@ qhp.QtTestLib.subprojects.classes.sortPages = true tagfile = ../../../doc/qttestlib/qttestlib.tags -depends += qtcore qtdoc qtwidgets qtgui qtquick +depends += qtcore qtdoc qtwidgets qtgui qmake qtquick headerdirs += .. diff --git a/src/testlib/doc/src/qttestlib-manual.qdoc b/src/testlib/doc/src/qttestlib-manual.qdoc index 613d2c220c..bdd9769175 100644 --- a/src/testlib/doc/src/qttestlib-manual.qdoc +++ b/src/testlib/doc/src/qttestlib-manual.qdoc @@ -120,7 +120,7 @@ \snippet code/doc_src_qtestlib.pro 2 - See \l{qmake Common Projects#building-a-testcase}{the qmake manual} for + See the \l{Building a Testcase}{qmake manual} for more information about \c{make check}. If you are using other build tools, make sure that you add the location -- cgit v1.2.3 From 89bb20b937495fa63741241c8ea9780492fb6e45 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 23 Jan 2014 04:06:10 +0100 Subject: Revert "Fix mix of new[] / malloc in QTest::toHexRepresentation" This reverts commit e8f73d656cf13d440a3a83980e05c6b117489e40. The original was correct: qtestcase.cpp:282 and 283 use delete[]. Change-Id: I668e17f500edcf9f1406553a160f6f5518dee148 Reviewed-by: Olivier Goffart --- src/testlib/qtestcase.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp index 2c8b7b20b7..e170d2a044 100644 --- a/src/testlib/qtestcase.cpp +++ b/src/testlib/qtestcase.cpp @@ -1893,7 +1893,7 @@ char *toHexRepresentation(const char *ba, int length) if (length > maxLen) { const int size = len * 3 + 4; - result = static_cast(malloc(size)); + result = new char[size]; char *const forElipsis = result + size - 5; forElipsis[0] = ' '; @@ -1901,9 +1901,10 @@ char *toHexRepresentation(const char *ba, int length) forElipsis[2] = '.'; forElipsis[3] = '.'; result[size - 1] = '\0'; - } else { + } + else { const int size = len * 3; - result = static_cast(malloc(size)); + result = new char[size]; result[size - 1] = '\0'; } -- cgit v1.2.3 From 73b54f85c543d7e6de4194c1e6c91aa9ce79902d Mon Sep 17 00:00:00 2001 From: Samuel Gaist Date: Wed, 22 Jan 2014 09:17:39 +0100 Subject: Cleanup of the android clipboard handling Currently there's an unguarded class member for the clipboard, allocated but unused and not deleted in the destructor. The getter creates a static clipboard allocated on the heap. This patch aims to add the missing guards as well as use the class member. Task-number: QTBUG-36025 Change-Id: I86969390eebcd67b65707e3ecbd4b3be15c7dadb Reviewed-by: BogDan Vatra --- .../platforms/android/src/qandroidplatformintegration.cpp | 14 +++++++++----- .../platforms/android/src/qandroidplatformintegration.h | 4 ++++ 2 files changed, 13 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/plugins/platforms/android/src/qandroidplatformintegration.cpp b/src/plugins/platforms/android/src/qandroidplatformintegration.cpp index e4a2ad582d..9bfb6e9a70 100644 --- a/src/plugins/platforms/android/src/qandroidplatformintegration.cpp +++ b/src/plugins/platforms/android/src/qandroidplatformintegration.cpp @@ -118,7 +118,10 @@ QAndroidPlatformIntegration::QAndroidPlatformIntegration(const QStringList ¶ m_androidFDB = new QAndroidPlatformFontDatabase(); m_androidPlatformServices = new QAndroidPlatformServices(); + +#ifndef QT_NO_CLIPBOARD m_androidPlatformClipboard = new QAndroidPlatformClipboard(); +#endif m_androidSystemLocale = new QAndroidSystemLocale; } @@ -217,6 +220,11 @@ QAndroidPlatformIntegration::~QAndroidPlatformIntegration() delete m_androidPlatformNativeInterface; delete m_androidFDB; delete m_androidSystemLocale; + +#ifndef QT_NO_CLIPBOARD + delete m_androidPlatformClipboard; +#endif + QtAndroid::setAndroidPlatformIntegration(NULL); } QPlatformFontDatabase *QAndroidPlatformIntegration::fontDatabase() const @@ -227,11 +235,7 @@ QPlatformFontDatabase *QAndroidPlatformIntegration::fontDatabase() const #ifndef QT_NO_CLIPBOARD QPlatformClipboard *QAndroidPlatformIntegration::clipboard() const { -static QAndroidPlatformClipboard *clipboard = 0; - if (!clipboard) - clipboard = new QAndroidPlatformClipboard; - - return clipboard; + return m_androidPlatformClipboard; } #endif diff --git a/src/plugins/platforms/android/src/qandroidplatformintegration.h b/src/plugins/platforms/android/src/qandroidplatformintegration.h index 474c1e837e..c5476128a5 100644 --- a/src/plugins/platforms/android/src/qandroidplatformintegration.h +++ b/src/plugins/platforms/android/src/qandroidplatformintegration.h @@ -171,7 +171,11 @@ private: QPainter *m_compositePainter; QAndroidPlatformNativeInterface *m_androidPlatformNativeInterface; QAndroidPlatformServices *m_androidPlatformServices; + +#ifndef QT_NO_CLIPBOARD QPlatformClipboard *m_androidPlatformClipboard; +#endif + QAndroidSystemLocale *m_androidSystemLocale; #ifndef QT_NO_ACCESSIBILITY mutable QPlatformAccessibility *m_accessibility; -- cgit v1.2.3 From 57c58001eb73a64a3c6b83966c9e70dd2b45f841 Mon Sep 17 00:00:00 2001 From: Alex Blasche Date: Fri, 24 Jan 2014 10:25:50 +0100 Subject: Remove obsolete parts from QNAM documentation Meego/Haramttan is no more and QtMobility only works for Qt 4.x anyway. Change-Id: I3840358011f9d0e14de4d0ce9de15bba546964c5 Reviewed-by: Peter Hartmann Reviewed-by: Alex Blasche --- src/network/access/qnetworkaccessmanager.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'src') diff --git a/src/network/access/qnetworkaccessmanager.cpp b/src/network/access/qnetworkaccessmanager.cpp index 980b19b7e4..c89419091f 100644 --- a/src/network/access/qnetworkaccessmanager.cpp +++ b/src/network/access/qnetworkaccessmanager.cpp @@ -224,12 +224,7 @@ static void ensureInitialized() \note The network and roaming support in QNetworkAccessManager is conditional upon the platform supporting connection management. The \l QNetworkConfigurationManager::NetworkSessionRequired can be used to - detect whether QNetworkAccessManager utilizes this feature. Currently only - Meego/Harmattan platforms provide connection management support. - - \note This feature cannot be used in combination with the Bearer Management - API as provided by QtMobility. Applications have to migrate to the Qt version - of Bearer Management. + detect whether QNetworkAccessManager utilizes this feature. \sa QNetworkRequest, QNetworkReply, QNetworkProxy */ -- cgit v1.2.3 From ac2988477204c4efe5d4b60de89270bade35dde1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C4=99drzej=20Nowacki?= Date: Fri, 24 Jan 2014 09:39:28 +0100 Subject: Remove invalid comment from qabstractanimation_p. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I4087c80061ad2fd9458730e4e3515eb4695c8b14 Reviewed-by: Jan Arve Sæther --- src/corelib/animation/qabstractanimation_p.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/corelib/animation/qabstractanimation_p.h b/src/corelib/animation/qabstractanimation_p.h index 322de22caf..39d9cf0fe6 100644 --- a/src/corelib/animation/qabstractanimation_p.h +++ b/src/corelib/animation/qabstractanimation_p.h @@ -46,8 +46,8 @@ // W A R N I N G // ------------- // -// This file is not part of the Qt API. It exists for the convenience -// of QIODevice. This header file may change from version to +// This file is not part of the Qt API. +// This header file may change from version to // version without notice, or even be removed. // // We mean it. -- cgit v1.2.3 From a4e703764e5f174fc6ca3f919e3acf44203dad91 Mon Sep 17 00:00:00 2001 From: Robin Burchell Date: Wed, 22 Jan 2014 11:49:16 +0100 Subject: evdevtouch: Don't try to keep reading on EAGAIN This stops touching the screen (and not moving) consuming 80-90% CPU. The mtdev and non-mtdev codepaths have been separated for additional clarity. Change-Id: I0559a6bd80dab961fdb4a83ad50860a9aec6445c Reviewed-by: Laszlo Agocs --- .../input/evdevtouch/qevdevtouch.cpp | 73 ++++++++++++++-------- 1 file changed, 47 insertions(+), 26 deletions(-) (limited to 'src') diff --git a/src/platformsupport/input/evdevtouch/qevdevtouch.cpp b/src/platformsupport/input/evdevtouch/qevdevtouch.cpp index 81746974c5..b4ebf8179c 100644 --- a/src/platformsupport/input/evdevtouch/qevdevtouch.cpp +++ b/src/platformsupport/input/evdevtouch/qevdevtouch.cpp @@ -345,40 +345,61 @@ QEvdevTouchScreenHandler::~QEvdevTouchScreenHandler() void QEvdevTouchScreenHandler::readData() { ::input_event buffer[32]; - int n = 0; - for (; ;) { + int events = 0; + #if !defined(QT_NO_MTDEV) - int result = mtdev_get(m_mtdev, m_fd, buffer, sizeof(buffer) / sizeof(::input_event)); - if (result > 0) - result *= sizeof(::input_event); + forever { + do { + events = mtdev_get(m_mtdev, m_fd, buffer, sizeof(buffer) / sizeof(::input_event)); + // keep trying mtdev_get if we get interrupted. note that we do not + // (and should not) handle EAGAIN; EAGAIN means that reading would + // block and we'll get back here later to try again anyway. + } while (events == -1 && errno == EINTR); + + // 0 events is EOF, -1 means error, handle both in the same place + if (events <= 0) + goto err; + + // process our shiny new events + for (int i = 0; i < events; ++i) + d->processInputEvent(&buffer[i]); + + // and try to get more + } #else - int result = QT_READ(m_fd, reinterpret_cast(buffer) + n, sizeof(buffer) - n); -#endif - if (!result) { - qWarning("evdevtouch: Got EOF from input device"); - return; - } else if (result < 0) { - if (errno != EINTR && errno != EAGAIN) { - qErrnoWarning(errno, "evdevtouch: Could not read from input device"); - if (errno == ENODEV) { // device got disconnected -> stop reading - delete m_notify; - m_notify = 0; - QT_CLOSE(m_fd); - m_fd = -1; - } - return; - } - } else { - n += result; - if (n % sizeof(::input_event) == 0) - break; - } + int n = 0; + for (; ;) { + events = QT_READ(m_fd, reinterpret_cast(buffer) + n, sizeof(buffer) - n); + if (events <= 0) + goto err; + n += events; + if (n % sizeof(::input_event) == 0) + break; } n /= sizeof(::input_event); for (int i = 0; i < n; ++i) d->processInputEvent(&buffer[i]); +#endif + return; + +err: + if (!events) { + qWarning("evdevtouch: Got EOF from input device"); + return; + } else if (events < 0) { + if (errno != EINTR && errno != EAGAIN) { + qErrnoWarning(errno, "evdevtouch: Could not read from input device"); + if (errno == ENODEV) { // device got disconnected -> stop reading + delete m_notify; + m_notify = 0; + QT_CLOSE(m_fd); + m_fd = -1; + } + return; + } + } } void QEvdevTouchScreenData::addTouchPoint(const Contact &contact, Qt::TouchPointStates *combinedStates) -- cgit v1.2.3 From 81e69ffdbac1e6f2066c2de3e5cfecbb923f2b15 Mon Sep 17 00:00:00 2001 From: Venu Date: Tue, 7 Jan 2014 15:14:27 +0100 Subject: Doc: Added more information about the WriteOnly mode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Task-number: QTBUG-34336 Change-Id: I4a9995dde400145cb1e33e625715eea8aaed3191 Reviewed-by: Topi Reiniö --- src/corelib/io/qiodevice.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/corelib/io/qiodevice.cpp b/src/corelib/io/qiodevice.cpp index a81b8580c4..53019e1ff4 100644 --- a/src/corelib/io/qiodevice.cpp +++ b/src/corelib/io/qiodevice.cpp @@ -259,9 +259,10 @@ QIODevicePrivate::~QIODevicePrivate() \value NotOpen The device is not open. \value ReadOnly The device is open for reading. - \value WriteOnly The device is open for writing. + \value WriteOnly The device is open for writing. Note that this mode implies + Truncate. \value ReadWrite The device is open for reading and writing. - \value Append The device is opened in append mode, so that all data is + \value Append The device is opened in append mode so that all data is written to the end of the file. \value Truncate If possible, the device is truncated before it is opened. All earlier contents of the device are lost. -- cgit v1.2.3 From c071b165a35e56c1f070813212ef8ff899732da5 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Tue, 21 Jan 2014 15:33:40 +0100 Subject: Doc: Remove section on how build the MySQL driver for MinGW users The section is clearly outdated. It references MinGW from mingw.org, which we don't support anymore. With a more modern MinGW you can just use the recipe to link against the prebuilt binaries the same way we do describe for MSVC. Task-number: QTBUG-17268 Change-Id: I15b96fd328605b60d1494a703b9005e2c16aea39 Reviewed-by: Venugopal Shivashankar Reviewed-by: Jerome Pasion --- src/sql/doc/src/sql-driver.qdoc | 67 ----------------------------------------- 1 file changed, 67 deletions(-) (limited to 'src') diff --git a/src/sql/doc/src/sql-driver.qdoc b/src/sql/doc/src/sql-driver.qdoc index 849cdcd544..f1fd2f6e90 100644 --- a/src/sql/doc/src/sql-driver.qdoc +++ b/src/sql/doc/src/sql-driver.qdoc @@ -175,73 +175,6 @@ built in release mode only. If you are expecting a debug version to be built as well, don't use the \c{"-o Makefile"} option. - \section3 How to build the MySQL driver for MinGW users - - The following steps have been used successfully for WinXP SP3. In - this example, Qt 4.6.2 is shown. - - \list - - \li Download the following components: - \list - \li \c{MinGW-5.1.6.exe} - \li \c{mingw-utils-0.3.tar.gz} - \li Qt sources, e.g. \c{qt-everywhere-opensource-src-4.6.2.zip} - \li \c{mysql-5.1.35-win32.msi} - \endlist - - \li Install \c{MinGW-5.1.6.exe} in, e.g. \c{C:\MinGW}. - - \li Extract \c{mingw-utils-0.3.tar.gz} into, e.g. \c{C:\MinGW}. - - \li Add the path for \c{MinGW-5.1.6.exe} to your \c{PATH} variable, - e.g. \c{C:\MinGW\bin;} - - \li Extract the Qt sources, (\c{qt-everywhere-opensource-src-4.6.2.zip}), - into, e.g. \c{C:\Qt}. - - \li Add the path for the eventual Qt binary to your \c{PATH} variable, - e.g. \c{C:\Qt\4.6.2\bin;}. - - \li Install MySQL (\c{mysql-5.1.35-win32.msi}), customizing the - components. Select only the headers and libraries. Install in, - e.g. \c{C:\MySQL\MySQL51}. - - \li Open the DOS prompt, go to \c{C:\MySQL\MySQL51\lib\opt}, and run - the following commands: - \list - \li \c{reimp -d libmysql.lib} - \li \c{dlltool -k -d libmysql.def -l libmysql.a} - \endlist - - \li Open the DOS prompt, go to \c{C:\Qt\4.6.2} and run the following commands: - \list - \li \c{configure.exe -debug-and-release -platform win32-g++ -qt-sql-mysql - -l mysql -I C:\MySQL\MySQL51\include -L C:\MySQL\MySQL51\lib\opt} - \li \c{mingw32-make sub-src} - \endlist - This step takes a long time. - - \li Open the DOS prompt, go to - \c{C:\Qt\4.6.2\src\plugins\sqldrivers\mysql} and run the - following command: - \list - \li \c{qmake "INCLUDEPATH+=C:/MySQL/MySQL51/include" "LIBS+=-L. mysql" mysql.pro} - \endlist - - \li Now the following libraries are ready in \c{C:\Qt\4.6.2\plugins\sqldrivers}. - \list - \li \c{libqsqlmysql4.a} - \li \c{libqsqlmysqld4.a} - \li \c{qsqlmysql4.dll} - \li \c{qsqlmysqld4.dll} - \endlist - To use the SDK and QtCreator directly, copy these libraries to - your \c{C:\Qt\...\qt\plugins\sqldrivers\}, and copy - \c{C:\MySQL\MySQL51\lib\opt\libmysql.dll} to your \c{C:\Qt\...\qt\bin\}. - - \endlist - \target QOCI \section2 QOCI for the Oracle Call Interface (OCI) -- cgit v1.2.3 From aac064b1c74fc902eb0d3ffd4fa79acf1c85a6df Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Fri, 24 Jan 2014 14:52:48 +0100 Subject: X11: build again on Linux distros that don't have XInput 2.2 fixed1616ToReal is needed by the XI2 tablet event debugging added in ecf11d62fc6f57cccf6f3326e768b1c7cabbd0b3, so it needs to be available if tablet events are supported and XI 2.2 events are not (older Linux distros). Change-Id: Id763d585790a9f037abc408dfba4ab5eec6dd421 Task-number: QTBUG-36437 Reviewed-by: Laszlo Agocs Reviewed-by: Wolfgang Bremer --- src/plugins/platforms/xcb/qxcbconnection_xi2.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp b/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp index a571f16eb6..a2ef8bf20f 100644 --- a/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp +++ b/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp @@ -287,12 +287,14 @@ XInput2DeviceData *QXcbConnection::deviceForId(int id) return dev; } -#ifdef XCB_USE_XINPUT22 +#if defined(XCB_USE_XINPUT22) || !defined(QT_NO_TABLETEVENT) static qreal fixed1616ToReal(FP1616 val) { return (qreal(val >> 16)) + (val & 0xFF) / (qreal)0xFF; } +#endif +#ifdef XCB_USE_XINPUT22 static qreal valuatorNormalized(double value, XIValuatorClassInfo *vci) { if (value > vci->max) -- cgit v1.2.3 From a8f1bd6b659d9ece7b5655f739ad6c1b6d834045 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Sat, 18 Jan 2014 13:56:06 -0800 Subject: Fix typo in the function argument of QRect::moveTo: t -> y Task-number: QTBUG-36259 Change-Id: If6f8da7f36d9a2bc171f2f50d36b37af8f13d8d0 Reviewed-by: Robin Burchell Reviewed-by: Konstantin Ritt --- src/corelib/tools/qrect.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/corelib/tools/qrect.h b/src/corelib/tools/qrect.h index 62ebdd10cd..22696f9edf 100644 --- a/src/corelib/tools/qrect.h +++ b/src/corelib/tools/qrect.h @@ -512,7 +512,7 @@ public: Q_DECL_CONSTEXPR inline QRectF translated(qreal dx, qreal dy) const; Q_DECL_CONSTEXPR inline QRectF translated(const QPointF &p) const; - inline void moveTo(qreal x, qreal t); + inline void moveTo(qreal x, qreal y); inline void moveTo(const QPointF &p); inline void setRect(qreal x, qreal y, qreal w, qreal h); -- cgit v1.2.3 From c58c98a248e104e55a7210b80a9f221bb019cbc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Mon, 20 Jan 2014 13:01:32 +0100 Subject: Cocoa: Silence tablet event warning on 10.6 10.6 sends tablet events for trackpad interaction, but not proximity events. The reason for this is not known. The events are discard. Silence the warning to avoid flooding the console. Change-Id: I6c215e8c15fc5b4b80e68b00f172121fc4d251b7 Reviewed-by: Gabriel de Dietrich --- src/plugins/platforms/cocoa/qnsview.mm | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') diff --git a/src/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm index ecb6c127aa..e75b835d58 100644 --- a/src/plugins/platforms/cocoa/qnsview.mm +++ b/src/plugins/platforms/cocoa/qnsview.mm @@ -830,6 +830,12 @@ Q_GLOBAL_STATIC(QCocoaTabletDeviceDataHash, tabletDeviceDataHash) uint deviceId = [theEvent deviceID]; if (!tabletDeviceDataHash->contains(deviceId)) { + // 10.6 sends tablet events for trackpad interaction, but + // not proximity events. Silence the warning to prevent + // flooding the console. + if (QSysInfo::QSysInfo::MacintoshVersion == QSysInfo::MV_10_6) + return; + qWarning("QNSView handleTabletEvent: This tablet device is unknown" " (received no proximity event for it). Discarding event."); return; -- cgit v1.2.3 From 69bf59ecfd061429e11231cb1fb90178d595baf1 Mon Sep 17 00:00:00 2001 From: Jungo Kim Date: Fri, 10 Jan 2014 11:51:33 +0900 Subject: QNetworkDiskCache - fix leak of file descriptor When the caches is deleted, the open files are deleted without closing action. The file descriptor is remaining until the process is terminated. Change-Id: If85519d173d05548ddf3273c85800441887199e2 Reviewed-by: jungo kim Reviewed-by: Peter Hartmann --- src/network/access/qnetworkdiskcache.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src') diff --git a/src/network/access/qnetworkdiskcache.cpp b/src/network/access/qnetworkdiskcache.cpp index d64d697013..2f2d1ab9a9 100644 --- a/src/network/access/qnetworkdiskcache.cpp +++ b/src/network/access/qnetworkdiskcache.cpp @@ -559,6 +559,20 @@ qint64 QNetworkDiskCache::expire() break; QString name = i.value(); QFile file(name); + + if (name.contains(PREPARED_SLASH)) { + QHashIterator iterator(d->inserting); + while (iterator.hasNext()) { + iterator.next(); + QCacheItem *item = iterator.value(); + if (item && item->file && item->file->fileName() == name) { + delete item->file; + item->file = 0; + break; + } + } + } + qint64 size = file.size(); file.remove(); totalSize -= size; -- cgit v1.2.3 From 62feb088a30045e7fbd2a3074c64d18035b84a97 Mon Sep 17 00:00:00 2001 From: Topi Reinio Date: Mon, 27 Jan 2014 15:08:21 +0100 Subject: qdoc: Never use a collision page as a main QCH landing page When writing the main/landing page for a documentation set to a .qhp file, check that it's not a collision page. If it is, default to 'index.html' instead. Task-number: QTCREATORBUG-11035 Change-Id: I0269834f6e50fcf5ae779c026263e69e4c3cd7b6 Reviewed-by: Martin Smith --- src/tools/qdoc/helpprojectwriter.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/tools/qdoc/helpprojectwriter.cpp b/src/tools/qdoc/helpprojectwriter.cpp index 44292f84bb..d46f887518 100644 --- a/src/tools/qdoc/helpprojectwriter.cpp +++ b/src/tools/qdoc/helpprojectwriter.cpp @@ -657,7 +657,8 @@ void HelpProjectWriter::generateProject(HelpProject &project) if (node == 0) node = qdb_->findNode(QStringList("index.html")); QString indexPath; - if (node) + // Never use a collision node as a landing page + if (node && !node->isCollisionNode()) indexPath = gen_->fullDocumentLocation(node,Generator::useOutputSubdirs()); else indexPath = "index.html"; -- cgit v1.2.3 From 4eea0f11990d1382afd2951eb80f3deb994dbd44 Mon Sep 17 00:00:00 2001 From: Frederik Gladhorn Date: Wed, 29 Jan 2014 12:53:51 +0100 Subject: Remove unused variable This fixes clang a clang warning: src/plugins/platforms/kms/qkmsscreen.h:114:18: error: private field 'm_refreshTime' is not used [-Werror,-Wunused-private-field] unsigned int m_refreshTime; ^ 1 error generated. Change-Id: I850f676abbde595963373afaf630307042dbf5a7 Reviewed-by: Andy Nichols --- src/plugins/platforms/kms/qkmsscreen.cpp | 1 - src/plugins/platforms/kms/qkmsscreen.h | 1 - 2 files changed, 2 deletions(-) (limited to 'src') diff --git a/src/plugins/platforms/kms/qkmsscreen.cpp b/src/plugins/platforms/kms/qkmsscreen.cpp index fcbf6805d7..ad1a45b459 100644 --- a/src/plugins/platforms/kms/qkmsscreen.cpp +++ b/src/plugins/platforms/kms/qkmsscreen.cpp @@ -70,7 +70,6 @@ QKmsScreen::QKmsScreen(QKmsDevice *device, int connectorId) m_connectorId(connectorId), m_depth(32), m_format(QImage::Format_Invalid), - m_refreshTime(16000), m_eglWindowSurface(EGL_NO_SURFACE), m_modeSet(false) { diff --git a/src/plugins/platforms/kms/qkmsscreen.h b/src/plugins/platforms/kms/qkmsscreen.h index f0c49ad11c..5ae5a1062b 100644 --- a/src/plugins/platforms/kms/qkmsscreen.h +++ b/src/plugins/platforms/kms/qkmsscreen.h @@ -111,7 +111,6 @@ private: drmModeCrtcPtr m_oldCrtc; QKmsCursor *m_cursor; - unsigned int m_refreshTime; gbm_surface *m_gbmSurface; EGLSurface m_eglWindowSurface; -- cgit v1.2.3 From 595e24fe2d59e21d71f1eaa8caadf635a5cfbdfb Mon Sep 17 00:00:00 2001 From: Liang Qi Date: Tue, 28 Jan 2014 09:12:51 +0100 Subject: QFileSelector: correct the macro for android platform Task-number: QTBUG-35073 Change-Id: I50d254ae61dac3cedc11291bd5ed35f9f9447622 Reviewed-by: Jake Petroules Reviewed-by: Alan Alpert --- src/corelib/io/qfileselector.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/corelib/io/qfileselector.cpp b/src/corelib/io/qfileselector.cpp index 92d3564a0f..13e5f8e5d1 100644 --- a/src/corelib/io/qfileselector.cpp +++ b/src/corelib/io/qfileselector.cpp @@ -102,7 +102,7 @@ QFileSelectorPrivate::QFileSelectorPrivate() your code might look something like this: \code QString defaultsPath = "data/defaults.conf"; -#if defined(Q_OS_LINUX_ANDROID) +#if defined(Q_OS_ANDROID) defaultsPath = "data/android/defaults.conf"; #elif defined(Q_OS_BLACKBERRY) defaultsPath = "data/blackberry/defaults.conf"; @@ -368,7 +368,7 @@ QStringList QFileSelectorPrivate::platformSelectors() # endif #elif defined(Q_OS_UNIX) ret << QStringLiteral("unix"); -# if defined(Q_OS_LINUX_ANDROID) +# if defined(Q_OS_ANDROID) ret << QStringLiteral("android"); # elif defined(Q_OS_BLACKBERRY) ret << QStringLiteral("blackberry"); -- cgit v1.2.3 From 1090ee664ba14a16036eb4d539006c4f8c7a545a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Mon, 13 Jan 2014 09:24:32 +0100 Subject: Remove duplicate move assignment operator doc Keep the "since 5.2". Change-Id: I8cfaf81e0b10f67c084e923f846ce0c722eac7fe Reviewed-by: Geir Vattekar --- src/corelib/tools/qbitarray.cpp | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'src') diff --git a/src/corelib/tools/qbitarray.cpp b/src/corelib/tools/qbitarray.cpp index f583444d3c..02cc321262 100644 --- a/src/corelib/tools/qbitarray.cpp +++ b/src/corelib/tools/qbitarray.cpp @@ -119,14 +119,6 @@ QT_BEGIN_NAMESPACE \since 5.2 */ -/*! - \fn QBitArray &QBitArray::operator=(QBitArray &&other) - - Move-assigns \a other to this QBitArray instance. - - \since 5.2 -*/ - /*! \fn QBitArray::QBitArray() Constructs an empty bit array. @@ -464,6 +456,7 @@ void QBitArray::fill(bool value, int begin, int end) */ /*! \fn QBitArray &QBitArray::operator=(QBitArray &&other) + \since 5.2 Moves \a other to this bit array and returns a reference to this bit array. -- cgit v1.2.3 From 97fd5399bca4f10393884cfd3bb20c29fb5361b4 Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Thu, 12 Dec 2013 13:47:44 +0100 Subject: QPlainTextEdit: set Qt::ImhMultiLine MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Like QTextEdit, QPlainTextEdit should also set the input method hint Qt::ImhMultiLine. An important reason for this, is that the iOS plugin will inspect the input method hints of the focus object to decide which type of keyboard (and return key) to use. Failing to set this hint will result in the iOS plugin setting the return key to 'done' instead of 'return' for this widget. Change-Id: Idd5aaf21505add608f2621f94655984f42e92a18 Reviewed-by: Tor Arne Vestbø --- src/widgets/widgets/qplaintextedit.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/widgets/widgets/qplaintextedit.cpp b/src/widgets/widgets/qplaintextedit.cpp index 90f2e47cd3..5f055d436a 100644 --- a/src/widgets/widgets/qplaintextedit.cpp +++ b/src/widgets/widgets/qplaintextedit.cpp @@ -801,6 +801,7 @@ void QPlainTextEditPrivate::init(const QString &txt) q->setFocusPolicy(Qt::WheelFocus); q->setAttribute(Qt::WA_KeyCompression); q->setAttribute(Qt::WA_InputMethodEnabled); + q->setInputMethodHints(Qt::ImhMultiLine); #ifndef QT_NO_CURSOR viewport->setCursor(Qt::IBeamCursor); -- cgit v1.2.3 From 6e13f4b3e03a055bafc78037b0bf68d90fbbe98d Mon Sep 17 00:00:00 2001 From: Bastiaan Veelo Date: Sat, 16 Nov 2013 21:42:01 +0100 Subject: Load all available pixmaps in an icon file. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes the problem that only the first icon would be read from an .ico file with muliple icons of various sizes in it. Task-number: QTBUG-28267 Change-Id: I50daa89769054234e9ffc5246f59b46975948871 Reviewed-by: Gunnar Sletta Reviewed-by: Thorbjørn Lund Martsum --- src/gui/image/qicon.cpp | 56 ++++++++++++++++++++++++++----------------------- 1 file changed, 30 insertions(+), 26 deletions(-) (limited to 'src') diff --git a/src/gui/image/qicon.cpp b/src/gui/image/qicon.cpp index c1a8cfaa1e..0a4b50bbea 100644 --- a/src/gui/image/qicon.cpp +++ b/src/gui/image/qicon.cpp @@ -43,6 +43,7 @@ #include "qicon_p.h" #include "qiconengine.h" #include "qiconengineplugin.h" +#include "qimagereader.h" #include "private/qfactoryloader_p.h" #include "private/qiconloader_p.h" #include "qpainter.h" @@ -365,37 +366,40 @@ void QPixmapIconEngine::addPixmap(const QPixmap &pixmap, QIcon::Mode mode, QIcon void QPixmapIconEngine::addFile(const QString &fileName, const QSize &_size, QIcon::Mode mode, QIcon::State state) { if (!fileName.isEmpty()) { - QSize size = _size; - QPixmap pixmap; - QString abs = fileName; if (fileName.at(0) != QLatin1Char(':')) abs = QFileInfo(fileName).absoluteFilePath(); - - for (int i = 0; i < pixmaps.count(); ++i) { - if (pixmaps.at(i).mode == mode && pixmaps.at(i).state == state) { - QPixmapIconEngineEntry *pe = &pixmaps[i]; - if(size == QSize()) { - pixmap = QPixmap(abs); - size = pixmap.size(); - } - if (pe->size == QSize() && pe->pixmap.isNull()) { - pe->pixmap = QPixmap(pe->fileName); - // Reset the devicePixelRatio. The pixmap may be loaded from a @2x file, - // but be used as a 1x pixmap by QIcon. - pe->pixmap.setDevicePixelRatio(1.0); - pe->size = pe->pixmap.size(); - } - if(pe->size == size) { - pe->pixmap = pixmap; - pe->fileName = abs; - return; + QImageReader reader(abs); + + do { + QSize size = _size; + QPixmap pixmap; + + for (int i = 0; i < pixmaps.count(); ++i) { + if (pixmaps.at(i).mode == mode && pixmaps.at(i).state == state) { + QPixmapIconEngineEntry *pe = &pixmaps[i]; + if (size == QSize()) { + pixmap.convertFromImage(reader.read()); + size = pixmap.size(); + } + if (pe->size == QSize() && pe->pixmap.isNull()) { + pe->pixmap = QPixmap(pe->fileName); + // Reset the devicePixelRatio. The pixmap may be loaded from a @2x file, + // but be used as a 1x pixmap by QIcon. + pe->pixmap.setDevicePixelRatio(1.0); + pe->size = pe->pixmap.size(); + } + if (pe->size == size) { + pe->pixmap = pixmap; + pe->fileName = abs; + return; + } } } - } - QPixmapIconEngineEntry e(abs, size, mode, state); - e.pixmap = pixmap; - pixmaps += e; + QPixmapIconEngineEntry e(abs, size, mode, state); + e.pixmap = pixmap; + pixmaps += e; + } while (reader.jumpToNextImage()); } } -- cgit v1.2.3 From cc8e0d85e26f699ffa1e5eec3db9897a8bd417ff Mon Sep 17 00:00:00 2001 From: David Faure Date: Wed, 29 Jan 2014 09:31:18 +0100 Subject: Doc: argument(s) was renamed to value(s), adjust QCommandLineOption docs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Task-number: QTBUG-36264 Change-Id: I132270f35b93b2b1c5230459f48bf9d047f42ab9 Reviewed-by: Topi Reiniö --- src/corelib/tools/qcommandlineoption.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/corelib/tools/qcommandlineoption.cpp b/src/corelib/tools/qcommandlineoption.cpp index 86f087674b..ccf9211b52 100644 --- a/src/corelib/tools/qcommandlineoption.cpp +++ b/src/corelib/tools/qcommandlineoption.cpp @@ -79,7 +79,7 @@ public: This class is used to describe an option on the command line. It allows different ways of defining the same option with multiple aliases possible. It is also used to describe how the option is used - it may be a flag (e.g. \c{-v}) - or take an argument (e.g. \c{-o file}). + or take a value (e.g. \c{-o file}). Examples: \snippet code/src_corelib_tools_qcommandlineoption.cpp 0 @@ -232,8 +232,8 @@ void QCommandLineOptionPrivate::setNames(const QStringList &nameList) for the documentation of the option in the help output. An option with names \c{o} and \c{output}, and a value name of \c{file} will appear as \c{-o, --output }. - Call QCommandLineParser::argument() if you expect the option to be present - only once, and QCommandLineParser::arguments() if you expect that option + Call QCommandLineParser::value() if you expect the option to be present + only once, and QCommandLineParser::values() if you expect that option to be present multiple times. \sa valueName() -- cgit v1.2.3 From 15f8bc1f6ee94b84bebbd06de9db3ceacecad24d Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 29 Jan 2014 12:35:43 -0800 Subject: Also register complex D-Bus types when running under qdbus When running inside qdbus, we generate the meta objects a little differently. Previously, for unknown types we'd simply have a -1 as the type ID in the meta object, but this doesn't work in Qt 5 (has apparently never worked). So simply register a type with the metatype system and let QMetaObject do its thing. [ChangeLog][qdbus]Fixed a bug that caused the qdbus tool to crash when trying to display remote interfaces that had complex types without a matching base Qt type. Task-number: QTBUG-36524 Change-Id: Ifef65b340dc89d3295ed6ef00f2dcc60849ecb02 Reviewed-by: Frederik Gladhorn --- src/dbus/qdbusmetaobject.cpp | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) (limited to 'src') diff --git a/src/dbus/qdbusmetaobject.cpp b/src/dbus/qdbusmetaobject.cpp index 13c538bb59..392eac6081 100644 --- a/src/dbus/qdbusmetaobject.cpp +++ b/src/dbus/qdbusmetaobject.cpp @@ -128,12 +128,7 @@ QDBusMetaObjectGenerator::QDBusMetaObjectGenerator(const QString &interfaceName, } } -Q_DBUS_EXPORT bool qt_dbus_metaobject_skip_annotations = false; - -QDBusMetaObjectGenerator::Type -QDBusMetaObjectGenerator::findType(const QByteArray &signature, - const QDBusIntrospection::Annotations &annotations, - const char *direction, int id) +static int registerComplexDBusType(const char *typeName) { struct QDBusRawTypeHandler { static void destroy(void *) @@ -159,6 +154,22 @@ QDBusMetaObjectGenerator::findType(const QByteArray &signature, } }; + return QMetaType::registerNormalizedType(typeName, QDBusRawTypeHandler::destroy, + QDBusRawTypeHandler::create, + QDBusRawTypeHandler::destruct, + QDBusRawTypeHandler::construct, + sizeof(void *), + QMetaType::MovableType, + 0); +} + +Q_DBUS_EXPORT bool qt_dbus_metaobject_skip_annotations = false; + +QDBusMetaObjectGenerator::Type +QDBusMetaObjectGenerator::findType(const QByteArray &signature, + const QDBusIntrospection::Annotations &annotations, + const char *direction, int id) +{ Type result; result.id = QVariant::Invalid; @@ -195,13 +206,7 @@ QDBusMetaObjectGenerator::findType(const QByteArray &signature, // type is still unknown or doesn't match back to the signature that it // was expected to, so synthesize a fake type typeName = "QDBusRawType<0x" + signature.toHex() + ">*"; - type = QMetaType::registerType(typeName, QDBusRawTypeHandler::destroy, - QDBusRawTypeHandler::create, - QDBusRawTypeHandler::destruct, - QDBusRawTypeHandler::construct, - sizeof(void *), - QMetaType::MovableType, - 0); + type = registerComplexDBusType(typeName); } result.name = typeName; @@ -217,7 +222,7 @@ QDBusMetaObjectGenerator::findType(const QByteArray &signature, type = QVariant::Map; } else { result.name = "QDBusRawType::" + signature; - type = -1; + type = registerComplexDBusType(result.name); } } else { result.name = QMetaType::typeName(type); -- cgit v1.2.3 From fed63d43943d8324a6f7faa6cab006ee8545e116 Mon Sep 17 00:00:00 2001 From: Bastiaan Veelo Date: Fri, 31 Jan 2014 00:36:22 +0100 Subject: Documentation: a singular subject takes a singular verb. Change-Id: I75762cd0f2c25eeeeb1283800c21393637bdff56 Reviewed-by: Giuseppe D'Angelo --- src/widgets/itemviews/qtreeview.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/widgets/itemviews/qtreeview.cpp b/src/widgets/itemviews/qtreeview.cpp index 5d0e835b0e..43c1ea9cae 100644 --- a/src/widgets/itemviews/qtreeview.cpp +++ b/src/widgets/itemviews/qtreeview.cpp @@ -1586,7 +1586,7 @@ int QTreeViewPrivate::widthHintForIndex(const QModelIndex &index, int hint, cons /*! Draws the row in the tree view that contains the model item \a index, - using the \a painter given. The \a option control how the item is + using the \a painter given. The \a option controls how the item is displayed. \sa setAlternatingRowColors() -- cgit v1.2.3 From 8cf666e10cec48146632c93b55b3dc1e6313a410 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Wed, 22 Jan 2014 23:33:32 +0100 Subject: Build on Windows Embedded when -qtlibinfix is used MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The resource file that needs to be included is hardcoded whereas qmake generates one that is based on the target name (which includes the libinfix). So to ensure the right one is available, a copy of the generated rc file is done to the name it expects. [ChangeLog][Platform Specific Changes][Windows Embedded] Fixed building issue when configuring Qt with -qtlibinfix Change-Id: I46ddbc5d22424bf63c54423618385e4268790eeb Reviewed-by: Björn Breitmeyer --- src/widgets/widgets.pro | 1 + src/widgets/widgets/widgets.pri | 9 +++++++++ 2 files changed, 10 insertions(+) (limited to 'src') diff --git a/src/widgets/widgets.pro b/src/widgets/widgets.pro index e3222b49e8..0b289c75ae 100644 --- a/src/widgets/widgets.pro +++ b/src/widgets/widgets.pro @@ -1,4 +1,5 @@ TARGET = QtWidgets +wince*:ORIG_TARGET = $$TARGET QT = core-private gui-private MODULE_CONFIG = uic diff --git a/src/widgets/widgets/widgets.pri b/src/widgets/widgets/widgets.pri index 1bae87ebcc..a924ba9acc 100644 --- a/src/widgets/widgets/widgets.pri +++ b/src/widgets/widgets/widgets.pri @@ -160,4 +160,13 @@ wince*: { HEADERS += widgets/qmenu_wince_resource_p.h RC_FILE = widgets/qmenu_wince.rc !static: QMAKE_WRITE_DEFAULT_RC = 1 + !isEmpty(QT_LIBINFIX) { + ORIG_RCFILE = $${TARGET}_resource.rc + copyrcc.commands = $$QMAKE_COPY ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT} + copyrcc.input = ORIG_RCFILE + CONFIG(debug, debug|release):copyrcc.output = $${ORIG_TARGET}d_resource.rc + else:copyrcc.output = $${ORIG_TARGET}_resource.rc + copyrcc.CONFIG = target_predeps no_link + QMAKE_EXTRA_COMPILERS += copyrcc + } } -- cgit v1.2.3 From 85ff4e8fe473337c687a4ee8afc4b3ca4f96f7b7 Mon Sep 17 00:00:00 2001 From: Samuel Gaist Date: Wed, 29 Jan 2014 23:30:00 +0100 Subject: Upgrade Window Level for stay on top widget on OS X Currently setting the WindowStaysOnTopHint makes the window appear over its children e.g. a QMessageBox. This patch aims to provide a more sensible level for stay on top widget [ChangeLog][QtWidget][OS X] Fixes an issue where stay on top widgets would cover their own children Task-number: QTBUG-36178 Change-Id: Ie86b0e0244d2fdee3638d4ab576445ef190d4bc6 Reviewed-by: Gabriel de Dietrich --- src/plugins/platforms/cocoa/qcocoawindow.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm index bf5e0cfbc4..211ecd60ab 100644 --- a/src/plugins/platforms/cocoa/qcocoawindow.mm +++ b/src/plugins/platforms/cocoa/qcocoawindow.mm @@ -449,7 +449,7 @@ NSInteger QCocoaWindow::windowLevel(Qt::WindowFlags flags) // StayOnTop window should appear above Tool windows. if (flags & Qt::WindowStaysOnTopHint) - windowLevel = NSPopUpMenuWindowLevel; + windowLevel = NSModalPanelWindowLevel; // Tooltips should appear above StayOnTop windows. if (type == Qt::ToolTip) windowLevel = NSScreenSaverWindowLevel; -- cgit v1.2.3 From 0b26ad05bbadeef493317c994cc7ccb53b0a612c Mon Sep 17 00:00:00 2001 From: Nico Vertriest Date: Thu, 23 Jan 2014 16:10:26 +0100 Subject: Doc: corrected link/example errors Update pro files after move gestures folder Update snippet statements Corrected path in imagegestures.pro Task-number: QTBUG-34749 Change-Id: Icc19908914e36507e412ab63bf0cc2809aa48e17 Reviewed-by: Jerome Pasion --- src/opengl/doc/src/qtopengl-examples.qdoc | 2 +- src/testlib/doc/src/qttest-index.qdoc | 2 +- src/widgets/doc/qtwidgets.qdocconf | 2 +- src/widgets/doc/src/gestures.qdoc | 8 ++++---- 4 files changed, 7 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/opengl/doc/src/qtopengl-examples.qdoc b/src/opengl/doc/src/qtopengl-examples.qdoc index 67c6aa3c0d..694b7ab8b8 100644 --- a/src/opengl/doc/src/qtopengl-examples.qdoc +++ b/src/opengl/doc/src/qtopengl-examples.qdoc @@ -34,7 +34,7 @@ \image opengl-examples.png These examples describe how to use the Qt OpenGL Module. For new code, - please use the OpenGL classes in the \l {Qt GUI Module}. + please use the OpenGL classes in the \l QtGui module. Qt provides support for integration with OpenGL implementations on all diff --git a/src/testlib/doc/src/qttest-index.qdoc b/src/testlib/doc/src/qttest-index.qdoc index 4cf0726429..8dc51f8696 100644 --- a/src/testlib/doc/src/qttest-index.qdoc +++ b/src/testlib/doc/src/qttest-index.qdoc @@ -56,7 +56,7 @@ \list \li \l{Qt Test C++ Classes}{C++ Classes} - \li \l{Qt Quick Test}{QML Types} + \li \l{Qt Quick Test QML Types}{QML Types} \endlist */ diff --git a/src/widgets/doc/qtwidgets.qdocconf b/src/widgets/doc/qtwidgets.qdocconf index b742856892..508a257fa5 100644 --- a/src/widgets/doc/qtwidgets.qdocconf +++ b/src/widgets/doc/qtwidgets.qdocconf @@ -27,7 +27,7 @@ qhp.QtWidgets.subprojects.classes.sortPages = true tagfile = ../../../doc/qtwidgets/qtwidgets.tags -depends += qtcore qtgui qtdoc qtsql qtdesigner +depends += qtcore qtgui qtdoc qtsql qtdesigner qtquick headerdirs += .. diff --git a/src/widgets/doc/src/gestures.qdoc b/src/widgets/doc/src/gestures.qdoc index ed7e78ec5a..9126152c42 100644 --- a/src/widgets/doc/src/gestures.qdoc +++ b/src/widgets/doc/src/gestures.qdoc @@ -67,7 +67,7 @@ required gesture type. The standard types are defined by the Qt::GestureType enum and include many commonly used gestures. - \snippet ../../../examples/gestures/imagegestures/imagewidget.cpp enable gestures + \snippet gestures/imagegestures/imagewidget.cpp enable gestures In the above code, the gestures are set up in the constructor of the target object itself. @@ -124,18 +124,18 @@ \l{QWidget::}{event()} handler function and delegates gesture events to a specialized gestureEvent() function: - \snippet ../../../examples/gestures/imagegestures/imagewidget.cpp event handler + \snippet gestures/imagegestures/imagewidget.cpp event handler The gesture events delivered to the target object can be examined individually and dealt with appropriately: - \snippet ../../../examples/gestures/imagegestures/imagewidget.cpp gesture event handler + \snippet gestures/imagegestures/imagewidget.cpp gesture event handler Responding to a gesture is simply a matter of obtaining the QGesture object delivered in the QGestureEvent sent to the target object and examining the information it contains. - \snippet ../../../examples/gestures/imagegestures/imagewidget.cpp swipe function + \snippet gestures/imagegestures/imagewidget.cpp swipe function Here, we examine the direction in which the user swiped the widget and modify its contents accordingly. -- cgit v1.2.3 From 7e5b3e57e30394c9b2fc463adf15445307b19ed6 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 30 Jan 2014 09:16:27 -0800 Subject: Add the default argument for the new connection syntax Task-number: QTBUG-36549 Change-Id: I3addacf4b0698df91960f7b8e9c2ed93e935f848 Reviewed-by: Branislav Katreniak Reviewed-by: Olivier Goffart --- src/corelib/kernel/qobject.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/corelib/kernel/qobject.h b/src/corelib/kernel/qobject.h index e2000afc82..c65d54e85a 100644 --- a/src/corelib/kernel/qobject.h +++ b/src/corelib/kernel/qobject.h @@ -206,9 +206,9 @@ public: const char *member, Qt::ConnectionType type = Qt::AutoConnection) const; #ifdef Q_QDOC - static QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type); + static QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type = Qt::AutoConnection); static QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor); - static QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type); + static QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type = Qt::AutoConnection); #else //Connect a signal to a pointer to qobject member function template -- cgit v1.2.3 From 404a84e4115bb71aafd6a8944481aeb0fe17cc59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20K=C3=BCmmel?= Date: Fri, 31 Jan 2014 22:28:19 +0100 Subject: CMake: don't require GL when build with -no-opengl Task-number: QTBUG-36509 Change-Id: I03451527ab91754d87ff2a43985952c7c7641826 Reviewed-by: Stephen Kelly --- src/gui/gui.pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/gui/gui.pro b/src/gui/gui.pro index 3203b41362..f4c35a36c5 100644 --- a/src/gui/gui.pro +++ b/src/gui/gui.pro @@ -81,7 +81,7 @@ contains(QT_CONFIG, angle) { !isEmpty(QMAKE_LIBDIR_OPENGL_ES2): CMAKE_OPENGL_LIBDIR = $$cmakePortablePaths($$QMAKE_LIBDIR_OPENGL_ES2) CMAKE_GL_HEADER_NAME = GLES2/gl2.h CMAKE_QT_OPENGL_IMPLEMENTATION = GLESv2 - } else { + } else:contains(QT_CONFIG, opengl) { !isEmpty(QMAKE_INCDIR_OPENGL): CMAKE_GL_INCDIRS = $$cmakeTargetPaths($$QMAKE_INCDIR_OPENGL) CMAKE_OPENGL_INCDIRS = $$cmakePortablePaths($$QMAKE_INCDIR_OPENGL) CMAKE_OPENGL_LIBS = $$cmakeProcessLibs($$QMAKE_LIBS_OPENGL) -- cgit v1.2.3 From e5fd2417701c1ecf35a3c771c647d931cef3f375 Mon Sep 17 00:00:00 2001 From: Giuseppe D'Angelo Date: Fri, 31 Jan 2014 10:36:04 +0100 Subject: Fix QByteArray documentation w.r.t. QString-related methods There's no loss of data when converting a Unicode string to UTF-8, so don't state that in the docs. Change-Id: If26914ec674a994d9c59136448e8e4292d0412e8 Reviewed-by: Thiago Macieira --- src/corelib/tools/qbytearray.cpp | 30 ++++++++++++------------------ 1 file changed, 12 insertions(+), 18 deletions(-) (limited to 'src') diff --git a/src/corelib/tools/qbytearray.cpp b/src/corelib/tools/qbytearray.cpp index 03b10903ab..3e3bae9a94 100644 --- a/src/corelib/tools/qbytearray.cpp +++ b/src/corelib/tools/qbytearray.cpp @@ -1303,12 +1303,10 @@ void QByteArray::chop(int n) returns a reference to this byte array. The Unicode data is converted into 8-bit characters using QString::toUtf8(). - If the QString contains non-ASCII Unicode characters, using this - operator can lead to loss of information. You can disable this - operator by defining \c QT_NO_CAST_TO_ASCII when you compile your - applications. You then need to call QString::toUtf8() (or - QString::toLatin1() or QString::toUtf8() or QString::toLocal8Bit()) - explicitly if you want to convert the data to \c{const char *}. + You can disable this function by defining \c QT_NO_CAST_TO_ASCII when you + compile your applications. You then need to call QString::toUtf8() (or + QString::toLatin1() or QString::toLocal8Bit()) explicitly if you want to + convert the data to \c{const char *}. */ /*! \fn QByteArray &QByteArray::operator+=(const char *str) @@ -1667,12 +1665,10 @@ QByteArray &QByteArray::append(const QByteArray &ba) Appends the string \a str to this byte array. The Unicode data is converted into 8-bit characters using QString::toUtf8(). - If the QString contains non-ASCII Unicode characters, using this - function can lead to loss of information. You can disable this - function by defining \c QT_NO_CAST_TO_ASCII when you compile your - applications. You then need to call QString::toUtf8() (or - QString::toLatin1() or QString::toUtf8() or QString::toLocal8Bit()) - explicitly if you want to convert the data to \c{const char *}. + You can disable this function by defining \c QT_NO_CAST_TO_ASCII when you + compile your applications. You then need to call QString::toUtf8() (or + QString::toLatin1() or QString::toLocal8Bit()) explicitly if you want to + convert the data to \c{const char *}. */ /*! @@ -2148,12 +2144,10 @@ QByteArray &QByteArray::replace(char before, const QByteArray &after) string \a after. The Unicode data is converted into 8-bit characters using QString::toUtf8(). - If the QString contains non-ASCII Unicode characters, using this - function can lead to loss of information. You can disable this - function by defining \c QT_NO_CAST_TO_ASCII when you compile your - applications. You then need to call QString::toUtf8() (or - QString::toLatin1() or QString::toUtf8() or QString::toLocal8Bit()) - explicitly if you want to convert the data to \c{const char *}. + You can disable this function by defining \c QT_NO_CAST_TO_ASCII when you + compile your applications. You then need to call QString::toUtf8() (or + QString::toLatin1() or QString::toLocal8Bit()) explicitly if you want to + convert the data to \c{const char *}. */ /*! \fn QByteArray &QByteArray::replace(char before, const char *after) -- cgit v1.2.3 From 61e1bcb4dd4995c9a8385aad6f3da10f53de2265 Mon Sep 17 00:00:00 2001 From: El Mehdi Fekari Date: Thu, 19 Dec 2013 11:15:34 +0100 Subject: QLogging: Avoid infinite loop in error case If the user code installs a message handler that uses any API that prints logs (handled by qt_message_print) then this will lead to an infinite loop. This patch adds a thread local storage to check if the message handler is done before the thread is calling it again. Note: This check is performed only if the compiler supports thread_local (__declspec(thread) for MSVC). Change-Id: I43b0460b8f39b26a18de48a5652a5e55f0b336f8 Reviewed-by: Rafael Roquetto --- src/corelib/global/qlogging.cpp | 43 ++++++++++++++++++++++++++++++++++++----- 1 file changed, 38 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/corelib/global/qlogging.cpp b/src/corelib/global/qlogging.cpp index 5b7a674ddb..cff8846cdc 100644 --- a/src/corelib/global/qlogging.cpp +++ b/src/corelib/global/qlogging.cpp @@ -925,6 +925,32 @@ static void qDefaultMsgHandler(QtMsgType type, const char *buf) qDefaultMessageHandler(type, emptyContext, QString::fromLocal8Bit(buf)); } +#if defined(Q_COMPILER_THREAD_LOCAL) || (defined(Q_CC_MSVC) && !defined(Q_OS_WINCE)) +#if defined(Q_CC_MSVC) +static __declspec(thread) bool msgHandlerGrabbed = false; +#else +static thread_local bool msgHandlerGrabbed = false; +#endif + +static bool grabMessageHandler() +{ + if (msgHandlerGrabbed) + return false; + + msgHandlerGrabbed = true; + return true; +} + +static void ungrabMessageHandler() +{ + msgHandlerGrabbed = false; +} + +#else +static bool grabMessageHandler() { return true; } +static void ungrabMessageHandler() { } +#endif // (Q_COMPILER_THREAD_LOCAL) || ((Q_CC_MSVC) && !(Q_OS_WINCE)) + static void qt_message_print(QtMsgType msgType, const QMessageLogContext &context, const QString &message) { #ifndef QT_BOOTSTRAPPED @@ -942,12 +968,19 @@ static void qt_message_print(QtMsgType msgType, const QMessageLogContext &contex if (!messageHandler) messageHandler = qDefaultMessageHandler; - // prefer new message handler over the old one - if (msgHandler == qDefaultMsgHandler - || messageHandler != qDefaultMessageHandler) { - (*messageHandler)(msgType, context, message); + // prevent recursion in case the message handler generates messages + // itself, e.g. by using Qt API + if (grabMessageHandler()) { + // prefer new message handler over the old one + if (msgHandler == qDefaultMsgHandler + || messageHandler != qDefaultMessageHandler) { + (*messageHandler)(msgType, context, message); + } else { + (*msgHandler)(msgType, message.toLocal8Bit().constData()); + } + ungrabMessageHandler(); } else { - (*msgHandler)(msgType, message.toLocal8Bit().constData()); + fprintf(stderr, "%s", message.toLocal8Bit().constData()); } } -- cgit v1.2.3 From 64d95e3df27c4e859b2b7e88aac0640bc5c2ddd9 Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Fri, 24 Jan 2014 09:14:33 +0100 Subject: OSX: FileDialogHelper uses options to remember the selected filter Task-number: QTBUG-35958 Change-Id: I998cf93232e79f70837cfa8f63592b69ea0dc563 Reviewed-by: Gabriel de Dietrich --- src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm b/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm index 08505d91a2..f401459cc3 100644 --- a/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm +++ b/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm @@ -665,8 +665,10 @@ void QCocoaFileDialogHelper::selectNameFilter(const QString &filter) const int index = options()->nameFilters().indexOf(filter); if (index != -1) { QNSOpenSavePanelDelegate *delegate = static_cast(mDelegate); - if (!delegate) + if (!delegate) { + options()->setInitiallySelectedNameFilter(filter); return; + } [delegate->mPopUpButton selectItemAtIndex:index]; [delegate filterChanged:nil]; } @@ -676,7 +678,7 @@ QString QCocoaFileDialogHelper::selectedNameFilter() const { QNSOpenSavePanelDelegate *delegate = static_cast(mDelegate); if (!delegate) - return QString(); + return options()->initiallySelectedNameFilter(); int index = [delegate->mPopUpButton indexOfSelectedItem]; if (index >= options()->nameFilters().count()) return QString(); -- cgit v1.2.3 From f34e0800630df74c77e9038572691bcf9420df78 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Wed, 29 Jan 2014 16:47:08 +0100 Subject: Fix access after delete with Harfbuzz NG code path. Remove reference to released font-engine so we don't risk returning it later. Change-Id: I741a741567a079818c7f414ac1f9c0b5a9677322 Task-number: QTBUG-36522 Reviewed-by: Konstantin Ritt --- src/gui/text/qtextengine.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp index 06c5e24920..c2e352eff4 100644 --- a/src/gui/text/qtextengine.cpp +++ b/src/gui/text/qtextengine.cpp @@ -1875,8 +1875,10 @@ QFontEngine *QTextEngine::fontEngine(const QScriptItem &si, QFixed *ascent, QFix feCache.prevFontEngine = engine; feCache.prevScript = script; engine->ref.ref(); - if (feCache.prevScaledFontEngine) + if (feCache.prevScaledFontEngine) { releaseCachedFontEngine(feCache.prevScaledFontEngine); + feCache.prevScaledFontEngine = 0; + } } if (si.analysis.flags & QFont::SmallCaps) { if (feCache.prevScaledFontEngine) { -- cgit v1.2.3 From cfa8fcdda0e4b453b8a808946735714cfca2bfef Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Wed, 29 Jan 2014 18:52:19 +0100 Subject: Ensure the text is not cut off when shown under a toolbutton icon Change-Id: I82cfa549b9db9439ab03123ddf73e5f2d001738e Reviewed-by: Jens Bache-Wiig --- src/widgets/styles/qcommonstyle.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/widgets/styles/qcommonstyle.cpp b/src/widgets/styles/qcommonstyle.cpp index 2d7107598f..9c2163ac8f 100644 --- a/src/widgets/styles/qcommonstyle.cpp +++ b/src/widgets/styles/qcommonstyle.cpp @@ -1598,7 +1598,7 @@ void QCommonStyle::drawControl(ControlElement element, const QStyleOption *opt, if (toolbutton->toolButtonStyle == Qt::ToolButtonTextUnderIcon) { pr.setHeight(pmSize.height() + 6); - tr.adjust(0, pr.height() - 1, 0, -2); + tr.adjust(0, pr.height() - 1, 0, -1); pr.translate(shiftX, shiftY); if (!hasArrow) { proxy()->drawItemPixmap(p, pr, Qt::AlignCenter, pm); -- cgit v1.2.3 From 71eb4d493956161b7e4aa48bb7c1d4c6309e5a10 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Sat, 1 Feb 2014 16:07:41 -0800 Subject: Fix compilation: testBit is only used if mtdev isn't qevdevtouch.cpp:160:20: error: unused function 'testBit' Change-Id: Idd9eee9b916c694bdfb963c00eeb0eaaf5618d40 Reviewed-by: Laszlo Agocs --- src/platformsupport/input/evdevtouch/qevdevtouch.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/platformsupport/input/evdevtouch/qevdevtouch.cpp b/src/platformsupport/input/evdevtouch/qevdevtouch.cpp index b4ebf8179c..563edf4fd7 100644 --- a/src/platformsupport/input/evdevtouch/qevdevtouch.cpp +++ b/src/platformsupport/input/evdevtouch/qevdevtouch.cpp @@ -157,10 +157,12 @@ void QEvdevTouchScreenData::registerDevice() #define LONG_BITS (sizeof(long) << 3) #define NUM_LONGS(bits) (((bits) + LONG_BITS - 1) / LONG_BITS) +#if defined(QT_NO_MTDEV) static inline bool testBit(long bit, const long *array) { return (array[bit / LONG_BITS] >> bit % LONG_BITS) & 1; } +#endif QEvdevTouchScreenHandler::QEvdevTouchScreenHandler(const QString &specification, QObject *parent) : QObject(parent), m_notify(0), m_fd(-1), d(0) -- cgit v1.2.3 From 72259baa76a0f1faa1983c720621676e9c15e15f Mon Sep 17 00:00:00 2001 From: Alex Montgomery Date: Tue, 14 Jan 2014 13:53:10 -0800 Subject: Fixed duplicate QMoveEvent generated for each QWidget::move call Removed QMoveEvent generating code from QWidgetPrivate::setGeometry_sys for widgets with native window handles. A move event is already generated for them by QGuiApplicationPrivate::processGeometryChangeEvent. Task-number: QTBUG-32590 Change-Id: I73313a012851516047ac017f1e15a21774d8ffe2 Reviewed-by: Friedemann Kleint --- src/widgets/kernel/qwidget_qpa.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/widgets/kernel/qwidget_qpa.cpp b/src/widgets/kernel/qwidget_qpa.cpp index 0fd794cc02..ea6f27caf9 100644 --- a/src/widgets/kernel/qwidget_qpa.cpp +++ b/src/widgets/kernel/qwidget_qpa.cpp @@ -768,7 +768,10 @@ void QWidgetPrivate::setGeometry_sys(int x, int y, int w, int h, bool isMove) } } - if (isMove) { + // generate a move event for QWidgets without window handles. QWidgets with native + // window handles already receive a move event from + // QGuiApplicationPrivate::processGeometryChangeEvent. + if (isMove && (!q->windowHandle() || q->testAttribute(Qt::WA_DontShowOnScreen))) { QMoveEvent e(q->pos(), oldPos); QApplication::sendEvent(q, &e); } -- cgit v1.2.3 From 6894bc0f3f8a579529dc0a7ab869ce565abd06ad Mon Sep 17 00:00:00 2001 From: Nils Jeisecke Date: Fri, 6 Dec 2013 19:00:59 +0100 Subject: Fix sorted QSortFilterProxyModel filter update When changing a filter so that a previously empty proxy model becomes populated sorting was not applied correctly. This was caused by using mapToSource for getting source_sort_column from proxy_sort_column. For an empty proxy model this won't work because no valid proxy index can be created in this case. We now directly use the root index column mapping instead by doing essentially the same as QSortFilterProxyModelPrivate::proxy_to_source but without the sanity checks needed for external use. The sorting feature of QSortFilterProxyModel has always assumed that the number of columns is specified by columnCount(QModelIndex()) so the behavior doesn't change. [ChangeLog][QtCore][QSortFilterProxyModel] Fixed sorting when a previously empty proxy model becomes populated because of a change in the filter. Task-number: QTBUG-30662 Change-Id: I21322122e127889dfadc02f838f0119ed322dcab Reviewed-by: Stephen Kelly --- src/corelib/itemmodels/qsortfilterproxymodel.cpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/corelib/itemmodels/qsortfilterproxymodel.cpp b/src/corelib/itemmodels/qsortfilterproxymodel.cpp index 63e0374740..930c2871d3 100644 --- a/src/corelib/itemmodels/qsortfilterproxymodel.cpp +++ b/src/corelib/itemmodels/qsortfilterproxymodel.cpp @@ -458,10 +458,21 @@ void QSortFilterProxyModelPrivate::sort() */ bool QSortFilterProxyModelPrivate::update_source_sort_column() { - Q_Q(QSortFilterProxyModel); - QModelIndex proxy_index = q->index(0, proxy_sort_column, QModelIndex()); int old_source_sort_column = source_sort_column; - source_sort_column = q->mapToSource(proxy_index).column(); + + if (proxy_sort_column == -1) { + source_sort_column = -1; + } else { + // We cannot use index mapping here because in case of a still-empty + // proxy model there's no valid proxy index we could map to source. + // So always use the root mapping directly instead. + Mapping *m = create_mapping(QModelIndex()).value(); + if (proxy_sort_column < m->source_columns.size()) + source_sort_column = m->source_columns.at(proxy_sort_column); + else + source_sort_column = -1; + } + return old_source_sort_column != source_sort_column; } -- cgit v1.2.3 From 8bb5dba0cba4d953794124d7f1b33887d1b5bd8d Mon Sep 17 00:00:00 2001 From: Sze Howe Koh Date: Sat, 1 Feb 2014 23:30:08 +0800 Subject: Doc: Fix broken links Change-Id: Ic275dfbf0b332fc34ea0fac1c31c4935ad961527 Reviewed-by: Frederik Gladhorn --- src/corelib/doc/qtcore.qdocconf | 2 +- src/corelib/global/qglobal.cpp | 8 ++++---- src/corelib/io/qloggingcategory.cpp | 2 +- src/corelib/kernel/qvariant.cpp | 6 +++--- src/corelib/tools/qstring.cpp | 2 +- src/gui/accessible/qaccessibleplugin.cpp | 2 -- src/gui/doc/qtgui.qdocconf | 3 +++ src/gui/image/qpictureformatplugin.cpp | 2 -- src/gui/kernel/qgenericplugin.cpp | 2 -- src/gui/kernel/qwindow.cpp | 4 ++-- src/opengl/doc/src/qtopengl-examples.qdoc | 5 ++--- src/opengl/qglframebufferobject.cpp | 2 +- src/opengl/qglpixelbuffer.cpp | 2 +- src/tools/qdoc/doc/qdoc-manual-contextcmds.qdoc | 3 +-- src/tools/qdoc/doc/qdoc-manual-intro.qdoc | 5 ++--- src/widgets/kernel/qaction.cpp | 2 +- src/widgets/kernel/qwidget.cpp | 2 +- src/widgets/widgets/qmenubar.cpp | 4 ++-- 18 files changed, 26 insertions(+), 32 deletions(-) (limited to 'src') diff --git a/src/corelib/doc/qtcore.qdocconf b/src/corelib/doc/qtcore.qdocconf index fa5afb033c..18fdfb18f3 100644 --- a/src/corelib/doc/qtcore.qdocconf +++ b/src/corelib/doc/qtcore.qdocconf @@ -26,7 +26,7 @@ qhp.QtCore.subprojects.classes.sortPages = true tagfile = ../../../doc/qtcore/qtcore.tags -depends += qtgui qtwidgets qtnetwork qtdoc qtquick qtlinguist qtdesigner qtconcurrent qtxml qmake +depends += qtgui qtwidgets qtnetwork qtdoc qtmacextras qtquick qtlinguist qtdesigner qtconcurrent qtxml qmake headerdirs += .. diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp index 6644d6d101..a9f6df6291 100644 --- a/src/corelib/global/qglobal.cpp +++ b/src/corelib/global/qglobal.cpp @@ -1960,7 +1960,7 @@ const QSysInfo::WinVersion QSysInfo::WindowsVersion = QSysInfo::windowsVersion() conditions that it would not otherwise know about. However, there is no guarantee that the compiler will actually use those hints. - This macro could be considered a "lighter" version of \l{Q_ASSERT}. While + This macro could be considered a "lighter" version of \l{Q_ASSERT()}. While Q_ASSERT will abort the program's execution if the condition is false, Q_ASSUME will tell the compiler not to generate code for those conditions. Therefore, it is important that the assumptions always hold, otherwise @@ -3318,7 +3318,7 @@ bool QInternal::activateCallbacks(Callback cb, void **parameters) If you need C++11 noexcept semantics, don't use this macro, use Q_DECL_NOEXCEPT/Q_DECL_NOEXCEPT_EXPR instead. - \sa Q_DECL_NOEXCEPT, Q_DECL_NOEXCEPT_EXPR + \sa Q_DECL_NOEXCEPT, Q_DECL_NOEXCEPT_EXPR() */ /*! @@ -3372,7 +3372,7 @@ bool QInternal::activateCallbacks(Callback cb, void **parameters) function can't possibly throw, don't use this macro, use Q_DECL_NOTHROW instead. - \sa Q_DECL_NOTHROW, Q_DECL_NOEXCEPT_EXPR + \sa Q_DECL_NOTHROW, Q_DECL_NOEXCEPT_EXPR() */ /*! @@ -3394,7 +3394,7 @@ bool QInternal::activateCallbacks(Callback cb, void **parameters) function can't possibly throw, don't use this macro, use Q_DECL_NOTHROW instead. - \sa Q_DECL_NOTHROW, Q_DECL_NOEXCEPT_EXPR + \sa Q_DECL_NOTHROW, Q_DECL_NOEXCEPT */ /*! diff --git a/src/corelib/io/qloggingcategory.cpp b/src/corelib/io/qloggingcategory.cpp index 93a98b1835..4924ac89c6 100644 --- a/src/corelib/io/qloggingcategory.cpp +++ b/src/corelib/io/qloggingcategory.cpp @@ -72,7 +72,7 @@ Q_GLOBAL_STATIC_WITH_ARGS(QLoggingCategory, qtDefaultCategory, \section1 Checking category configuration QLoggingCategory provides \l isDebugEnabled(), \l isWarningEnabled(), - \l isCriticalEnabled(), \l isTraceEnabled(), as well as \l isEnabled() + \l isCriticalEnabled(), as well as \l isEnabled() to check whether messages for the given message type should be logged. \note The qCDebug(), qCWarning(), qCCritical() macros prevent arguments diff --git a/src/corelib/kernel/qvariant.cpp b/src/corelib/kernel/qvariant.cpp index 69cfa7888f..a1b7f398e8 100644 --- a/src/corelib/kernel/qvariant.cpp +++ b/src/corelib/kernel/qvariant.cpp @@ -2833,8 +2833,8 @@ static bool canConvertMetaObject(int fromId, int toId, QObject *fromObject) \snippet code/src_corelib_kernel_qvariant.cpp 10 - \sa convert(), QSequentialIterable, qRegisterSequentialConverter(), QAssociativeIterable, - qRegisterAssociativeConverter() + \sa convert(), QSequentialIterable, Q_DECLARE_SEQUENTIAL_CONTAINER_METATYPE(), QAssociativeIterable, + Q_DECLARE_ASSOCIATIVE_CONTAINER_METATYPE() */ bool QVariant::canConvert(int targetTypeId) const { @@ -3334,7 +3334,7 @@ QDebug operator<<(QDebug dbg, const QVariant::Type p) \snippet code/src_corelib_kernel_qvariant.cpp 9 - \sa setValue(), fromValue(), canConvert(), qRegisterSequentialConverter() + \sa setValue(), fromValue(), canConvert(), Q_DECLARE_SEQUENTIAL_CONTAINER_METATYPE() */ /*! \fn bool QVariant::canConvert() const diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp index d682207314..2c505ef033 100644 --- a/src/corelib/tools/qstring.cpp +++ b/src/corelib/tools/qstring.cpp @@ -7691,7 +7691,7 @@ QString &QString::setRawData(const QChar *unicode, int size) \snippet code/src_corelib_tools_qstring.cpp 6 - \sa QString, QLatin1Char, QStringLiteral + \sa QString, QLatin1Char, {QStringLiteral()}{QStringLiteral} */ /*! \fn QLatin1String::QLatin1String(const char *str) diff --git a/src/gui/accessible/qaccessibleplugin.cpp b/src/gui/accessible/qaccessibleplugin.cpp index 8cdbca6767..17b3f52805 100644 --- a/src/gui/accessible/qaccessibleplugin.cpp +++ b/src/gui/accessible/qaccessibleplugin.cpp @@ -87,8 +87,6 @@ QAccessiblePlugin::~QAccessiblePlugin() Creates and returns a QAccessibleInterface implementation for the class \a key and the object \a object. Keys are case sensitive. - - \sa keys() */ QT_END_NAMESPACE diff --git a/src/gui/doc/qtgui.qdocconf b/src/gui/doc/qtgui.qdocconf index a963f55dc8..e3ec216f9b 100644 --- a/src/gui/doc/qtgui.qdocconf +++ b/src/gui/doc/qtgui.qdocconf @@ -29,6 +29,9 @@ tagfile = ../../../doc/qtgui/qtgui.tags depends += \ qtcore \ + qtimageformats \ + qtmacextras \ + qtmultimedia \ qtnetwork \ qtopengl \ qtsvg \ diff --git a/src/gui/image/qpictureformatplugin.cpp b/src/gui/image/qpictureformatplugin.cpp index c87b9ba6ac..69c3d9ccec 100644 --- a/src/gui/image/qpictureformatplugin.cpp +++ b/src/gui/image/qpictureformatplugin.cpp @@ -79,8 +79,6 @@ QT_BEGIN_NAMESPACE Installs a QPictureIO picture I/O handler for the picture format \a format. Returns \c true on success. - - \sa keys() */ diff --git a/src/gui/kernel/qgenericplugin.cpp b/src/gui/kernel/qgenericplugin.cpp index 98709804de..6939087e59 100644 --- a/src/gui/kernel/qgenericplugin.cpp +++ b/src/gui/kernel/qgenericplugin.cpp @@ -95,8 +95,6 @@ QGenericPlugin::~QGenericPlugin() Implement this function to create a driver matching the type specified by the given \a key and \a specification parameters. Note that keys are case-insensitive. - - \sa keys() */ QT_END_NAMESPACE diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp index 2e1d8f9976..19bd947c2c 100644 --- a/src/gui/kernel/qwindow.cpp +++ b/src/gui/kernel/qwindow.cpp @@ -79,8 +79,8 @@ QT_BEGIN_NAMESPACE QWindow directly. Still, it is possible to render directly to a QWindow with QBackingStore or QOpenGLContext, when wanting to keep dependencies to a minimum or when wanting to use OpenGL directly. The - \l{gui/rasterwindow}{Raster Window} and \l{gui/openglwindow}{OpenGL Window} - examples are useful reference examples for how to render to a QWindow using + \l{Raster Window Example} and \l{OpenGL Window Example} + are useful reference examples for how to render to a QWindow using either approach. \section1 Resource management diff --git a/src/opengl/doc/src/qtopengl-examples.qdoc b/src/opengl/doc/src/qtopengl-examples.qdoc index 694b7ab8b8..68adcda173 100644 --- a/src/opengl/doc/src/qtopengl-examples.qdoc +++ b/src/opengl/doc/src/qtopengl-examples.qdoc @@ -33,9 +33,8 @@ \image opengl-examples.png - These examples describe how to use the Qt OpenGL Module. For new code, - please use the OpenGL classes in the \l QtGui module. - + These examples describe how to use the \l {Qt OpenGL} module. For new code, + please use the OpenGL classes in the \l {Qt GUI} module. Qt provides support for integration with OpenGL implementations on all platforms, giving developers the opportunity to display hardware accelerated diff --git a/src/opengl/qglframebufferobject.cpp b/src/opengl/qglframebufferobject.cpp index fa3f653aee..f42ee40211 100644 --- a/src/opengl/qglframebufferobject.cpp +++ b/src/opengl/qglframebufferobject.cpp @@ -779,7 +779,7 @@ void QGLFramebufferObjectPrivate::init(QGLFramebufferObject *q, const QSize &sz, \note This class has been deprecated in favor of QOpenGLFramebufferObject. - \sa {Framebuffer Object Example} + \sa {Framebuffer Object 2 Example} */ diff --git a/src/opengl/qglpixelbuffer.cpp b/src/opengl/qglpixelbuffer.cpp index bcb2dd53db..ebc9f296eb 100644 --- a/src/opengl/qglpixelbuffer.cpp +++ b/src/opengl/qglpixelbuffer.cpp @@ -90,7 +90,7 @@ Pbuffers are provided by the OpenGL \c pbuffer extension; call hasOpenGLPbuffer() to find out if the system provides pbuffers. - \sa {opengl/pbuffers}{Pbuffers Example} + \sa {Pixel Buffers Example} */ #include diff --git a/src/tools/qdoc/doc/qdoc-manual-contextcmds.qdoc b/src/tools/qdoc/doc/qdoc-manual-contextcmds.qdoc index 1f777ea441..446b441675 100644 --- a/src/tools/qdoc/doc/qdoc-manual-contextcmds.qdoc +++ b/src/tools/qdoc/doc/qdoc-manual-contextcmds.qdoc @@ -314,8 +314,7 @@ \endcode See how QDoc renders this property on the reference page for the - \l {changes-prop} {State} - type. + \l {State::changes}{State} type. \target obsolete-command \section1 \\obsolete diff --git a/src/tools/qdoc/doc/qdoc-manual-intro.qdoc b/src/tools/qdoc/doc/qdoc-manual-intro.qdoc index ad3779048a..f681c0a574 100644 --- a/src/tools/qdoc/doc/qdoc-manual-intro.qdoc +++ b/src/tools/qdoc/doc/qdoc-manual-intro.qdoc @@ -79,9 +79,8 @@ * / \endcode - From the QDoc comment above, QDoc generates the HTML page - \l {details} - {QObject Class Reference}. + From the QDoc comment above, QDoc generates the HTML \l {QObject} + {QObject class reference} page. This manual explains how to use the QDoc commands in QDoc comments to embed good documentation in your source files. It also explains diff --git a/src/widgets/kernel/qaction.cpp b/src/widgets/kernel/qaction.cpp index 3e76699aca..c0e3e98ae1 100644 --- a/src/widgets/kernel/qaction.cpp +++ b/src/widgets/kernel/qaction.cpp @@ -270,7 +270,7 @@ void QActionPrivate::setShortcutEnabled(bool enable, QShortcutMap &map) \value AboutQtRole This action matches handles the "About Qt" menu item. \value AboutRole This action should be placed where the "About" menu item is in the application menu. The text of the menu item will be set to "About ". The application name is fetched from the - \c{Info.plist} file in the application's bundle (See \l{Deploying an Application on Mac OS X}). + \c{Info.plist} file in the application's bundle (See \l{Qt for Mac OS X - Deployment}). \value PreferencesRole This action should be placed where the "Preferences..." menu item is in the application menu. \value QuitRole This action should be placed where the Quit menu item is in the application menu. diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index df523e7e21..ee7f779a3a 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -7004,7 +7004,7 @@ void QWidget::setUpdatesEnabled(bool enable) depending on the platform's default behavior for the window flags. \sa raise(), showEvent(), hide(), setVisible(), showMinimized(), showMaximized(), - showNormal(), isVisible(), windowFlags(), flags() + showNormal(), isVisible(), windowFlags() */ void QWidget::show() { diff --git a/src/widgets/widgets/qmenubar.cpp b/src/widgets/widgets/qmenubar.cpp index 9c1e2f0516..01db2bda7a 100644 --- a/src/widgets/widgets/qmenubar.cpp +++ b/src/widgets/widgets/qmenubar.cpp @@ -666,8 +666,8 @@ void QMenuBar::initStyleOption(QStyleOptionMenuItem *option, const QAction *acti \b{Note:} The text used for the application name in the menu bar is obtained from the value set in the \c{Info.plist} file in - the application's bundle. See \l{Deploying an Application on - Mac OS X} for more information. + the application's bundle. See \l{Qt for Mac OS X - Deployment} + for more information. \section1 QMenuBar on Windows CE -- cgit v1.2.3 From cd820569dc9995ce8c19a45fd87658c046185e63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kimmo=20Lepp=C3=A4l=C3=A4?= Date: Mon, 20 Jan 2014 15:38:17 +0200 Subject: Fix KDE calculated colors being all black MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit KDE calculated colors weren't set correctly rendering all calculated colors "Light", "Midlight", "Mid" and "Dark" as black. Issues fixed: * QFrame with frameStyle Box|Raised didn't look raised but instead just black border. * QMdiArea had black background * QToolBox separators were just black Change-Id: I5e06bafe280f73af12f23960ae68a8b35e8549ac Reviewed-by: Rafael Roquetto Reviewed-by: Jens Bache-Wiig Reviewed-by: J-P Nurmi Reviewed-by: Kimmo Leppälä --- src/platformsupport/themes/genericunix/qgenericunixthemes.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp b/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp index ee295afe6c..f44d53a00e 100644 --- a/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp +++ b/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp @@ -317,19 +317,23 @@ void QKdeThemePrivate::readKdeSystemPalette(const QSettings &kdeSettings, QPalet const QBrush buttonBrushDark = QBrush(button.darker(v > 128 ? 200 : 50)); const QBrush buttonBrushDark150 = QBrush(button.darker(v > 128 ? 150 : 75)); const QBrush buttonBrushLight150 = QBrush(button.lighter(v > 128 ? 150 : 75)); + const QBrush buttonBrushLight = QBrush(button.lighter(v > 128 ? 200 : 50)); pal->setBrush(QPalette::Disabled, QPalette::WindowText, buttonBrushDark); pal->setBrush(QPalette::Disabled, QPalette::ButtonText, buttonBrushDark); pal->setBrush(QPalette::Disabled, QPalette::Button, buttonBrush); - pal->setBrush(QPalette::Disabled, QPalette::Light, buttonBrushLight150); - pal->setBrush(QPalette::Disabled, QPalette::Dark, buttonBrushDark); - pal->setBrush(QPalette::Disabled, QPalette::Mid, buttonBrushDark150); pal->setBrush(QPalette::Disabled, QPalette::Text, buttonBrushDark); pal->setBrush(QPalette::Disabled, QPalette::BrightText, whiteBrush); pal->setBrush(QPalette::Disabled, QPalette::Base, buttonBrush); pal->setBrush(QPalette::Disabled, QPalette::Window, buttonBrush); pal->setBrush(QPalette::Disabled, QPalette::Highlight, buttonBrushDark150); pal->setBrush(QPalette::Disabled, QPalette::HighlightedText, buttonBrushLight150); + + // set calculated colors for all groups + pal->setBrush(QPalette::Light, buttonBrushLight); + pal->setBrush(QPalette::Midlight, buttonBrushLight150); + pal->setBrush(QPalette::Mid, buttonBrushDark150); + pal->setBrush(QPalette::Dark, buttonBrushDark); } /*! -- cgit v1.2.3 From cc88e6e92c806def34bce8cdcab275934ab646bf Mon Sep 17 00:00:00 2001 From: Frantisek Vacek Date: Fri, 31 Jan 2014 14:25:46 +0100 Subject: QDeclarativeTypeLoader doesn't close processed QNetworkReplies This bug causes that Cascades QML application cannot open more than system ulimit defined number of different asset:///*.qml files. The realFile is ordinary closed in the ~QNetworkReplyFileImpl(), the QDeclarativeTypeLoader::::networkReplyFinished() calls reply->deleteLater(). There are tricky situations when event-loop is not entered and too many read already files are waiting for close. This patch close() file when all the data is read. It can be done this way since the QNetworkReplyFileImplnetworkreply is a sequential device. For more info, please, read comments on QTBUG-36032 Task-number: QTBUG-36032 Change-Id: I4002f21b4b0c7350af48b0dc6530d9606fd2794b Reviewed-by: Richard J. Moore Reviewed-by: Peter Hartmann --- src/network/access/qnetworkreplyfileimpl.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') diff --git a/src/network/access/qnetworkreplyfileimpl.cpp b/src/network/access/qnetworkreplyfileimpl.cpp index f7555f8fc3..2724a54309 100644 --- a/src/network/access/qnetworkreplyfileimpl.cpp +++ b/src/network/access/qnetworkreplyfileimpl.cpp @@ -161,6 +161,8 @@ void QNetworkReplyFileImpl::abort() qint64 QNetworkReplyFileImpl::bytesAvailable() const { Q_D(const QNetworkReplyFileImpl); + if (!d->realFile.isOpen()) + return QNetworkReply::bytesAvailable(); return QNetworkReply::bytesAvailable() + d->realFile.bytesAvailable(); } @@ -181,7 +183,11 @@ qint64 QNetworkReplyFileImpl::size() const qint64 QNetworkReplyFileImpl::readData(char *data, qint64 maxlen) { Q_D(QNetworkReplyFileImpl); + if (!d->realFile.isOpen()) + return -1; qint64 ret = d->realFile.read(data, maxlen); + if (bytesAvailable() == 0 && d->realFile.isOpen()) + d->realFile.close(); if (ret == 0 && bytesAvailable() == 0) return -1; else -- cgit v1.2.3 From fdef360bad0f2f1059ff81f1bdd608332541abac Mon Sep 17 00:00:00 2001 From: Jake Petroules Date: Tue, 28 Jan 2014 07:29:53 -0500 Subject: QFileSelector: correct the macros for Apple platforms. This fixes a serious regression from 7d72516b52b20b0782d972224a55a43e74b8ae5a. [ChangeLog] QFileSelector: the identifier for OS X has been changed back to 'osx' from 'mac', and 'mac' and 'darwin' have now been added as selectors for Darwin OS (which is the base of both OS X and iOS). Task-number: QTBUG-35073 Change-Id: I83183e34c5a697338cc1ddcac33a41bd379ded12 Reviewed-by: Alan Alpert --- src/corelib/io/qfileselector.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/corelib/io/qfileselector.cpp b/src/corelib/io/qfileselector.cpp index 13e5f8e5d1..b4021c060f 100644 --- a/src/corelib/io/qfileselector.cpp +++ b/src/corelib/io/qfileselector.cpp @@ -157,7 +157,7 @@ QFileSelectorPrivate::QFileSelectorPrivate() Selectors normally available are \list \li platform, any of the following strings which match the platform the application is running - on: android, blackberry, ios, mac, linux, wince, unix, windows. + on: android, blackberry, ios, osx, darwin, mac, linux, wince, unix, windows. \li locale, same as QLocale::system().name(). \endlist @@ -374,12 +374,16 @@ QStringList QFileSelectorPrivate::platformSelectors() ret << QStringLiteral("blackberry"); # elif defined(Q_OS_QNX) ret << QStringLiteral("qnx"); -# elif defined(Q_OS_IOS) - ret << QStringLiteral("ios"); # elif defined(Q_OS_LINUX) ret << QStringLiteral("linux"); -# elif defined(Q_OS_MAC) - ret << QStringLiteral("mac"); +# elif defined(Q_OS_DARWIN) + ret << QStringLiteral("darwin"); + ret << QStringLiteral("mac"); // compatibility synonym +# if defined(Q_OS_IOS) + ret << QStringLiteral("ios"); +# elif defined(Q_OS_OSX) + ret << QStringLiteral("osx"); +# endif # else struct utsname u; if (uname(&u) != -1) -- cgit v1.2.3 From 96b7ac569c571a38826d5bfb2681889dbf81759d Mon Sep 17 00:00:00 2001 From: Cedric Chedaleux Date: Mon, 3 Feb 2014 12:53:26 +0100 Subject: NPOT texture support in QOpenGLTextureCache Enable non power of two texture support for non compatible NPOT GPU. If the context does not handle NPOTTexture feature, the image to bind is scaled to POT size. It works with OpenGL ES and Desktop version. It is actually almost the same code as the one in QGLContextPrivate::bindTexture. Change-Id: I6f0f511165c9e171a14f4ba6ba0b7a902e590cf6 Reviewed-by: Laszlo Agocs --- src/gui/opengl/qopengltexturecache.cpp | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/gui/opengl/qopengltexturecache.cpp b/src/gui/opengl/qopengltexturecache.cpp index 4238f63cd8..750264935b 100644 --- a/src/gui/opengl/qopengltexturecache.cpp +++ b/src/gui/opengl/qopengltexturecache.cpp @@ -40,6 +40,7 @@ ****************************************************************************/ #include "qopengltexturecache_p.h" +#include #include #include #include @@ -128,6 +129,20 @@ GLuint QOpenGLTextureCache::bindTexture(QOpenGLContext *context, const QPixmap & return id; } +// returns the highest number closest to v, which is a power of 2 +// NB! assumes 32 bit ints +static int qt_next_power_of_two(int v) +{ + v--; + v |= v >> 1; + v |= v >> 2; + v |= v >> 4; + v |= v >> 8; + v |= v >> 16; + ++v; + return v; +} + GLuint QOpenGLTextureCache::bindTexture(QOpenGLContext *context, const QImage &image) { if (image.isNull()) @@ -144,7 +159,19 @@ GLuint QOpenGLTextureCache::bindTexture(QOpenGLContext *context, const QImage &i } } - GLuint id = bindTexture(context, key, image); + QImage img = image; + if (!context->functions()->hasOpenGLFeature(QOpenGLFunctions::NPOTTextures)) { + // Scale the pixmap if needed. GL textures needs to have the + // dimensions 2^n+2(border) x 2^m+2(border), unless we're using GL + // 2.0 or use the GL_TEXTURE_RECTANGLE texture target + int tx_w = qt_next_power_of_two(image.width()); + int tx_h = qt_next_power_of_two(image.height()); + if (tx_w != image.width() || tx_h != image.height()) { + img = img.scaled(tx_w, tx_h); + } + } + + GLuint id = bindTexture(context, key, img); if (id > 0) QImagePixmapCleanupHooks::enableCleanupHooks(image); -- cgit v1.2.3 From 839997adfa6ecf6209dbde94ec831d1c3a203de4 Mon Sep 17 00:00:00 2001 From: Liang Qi Date: Tue, 14 Jan 2014 14:32:39 +0100 Subject: Cocoa: fix single punctuation input via CJK input method 2d05d3bd2815c220474b3c07bf3f2ef7417d3070 was not correct. On OS X, when user uses CJK input method, only types single punctuation, it was converted to CJK ones, and not showed in composing text. Task-number: QTBUG-35700 Change-Id: I2d1063d2f837d075929dc5ebb5722fdefc6ee0f6 Reviewed-by: Eike Ziller Reviewed-by: Gabriel de Dietrich --- src/plugins/platforms/cocoa/qnsview.h | 1 + src/plugins/platforms/cocoa/qnsview.mm | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/plugins/platforms/cocoa/qnsview.h b/src/plugins/platforms/cocoa/qnsview.h index 403f8dc78a..7e146c5f58 100644 --- a/src/plugins/platforms/cocoa/qnsview.h +++ b/src/plugins/platforms/cocoa/qnsview.h @@ -71,6 +71,7 @@ QT_END_NAMESPACE bool m_subscribesForGlobalFrameNotifications; QCocoaGLContext *m_glContext; bool m_shouldSetGLContextinDrawRect; + NSString *m_inputSource; } - (id)init; diff --git a/src/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm index e75b835d58..ed9aad1654 100644 --- a/src/plugins/platforms/cocoa/qnsview.mm +++ b/src/plugins/platforms/cocoa/qnsview.mm @@ -90,6 +90,7 @@ static QTouchDevice *touchDevice = 0; m_shouldSetGLContextinDrawRect = false; currentCustomDragTypes = 0; m_sendUpAsRightButton = false; + m_inputSource = 0; if (!touchDevice) { touchDevice = new QTouchDevice; @@ -108,6 +109,7 @@ static QTouchDevice *touchDevice = 0; m_maskData = 0; m_window = 0; m_subscribesForGlobalFrameNotifications = false; + [m_inputSource release]; [[NSNotificationCenter defaultCenter] removeObserver:self]; delete currentCustomDragTypes; @@ -1222,6 +1224,10 @@ static QTabletEvent::TabletDevice wacomTabletDevice(NSEvent *theEvent) Qt::KeyboardModifiers modifiers = [QNSView convertKeyModifiers: nativeModifiers]; NSString *charactersIgnoringModifiers = [nsevent charactersIgnoringModifiers]; NSString *characters = [nsevent characters]; + if (m_inputSource != characters) { + [m_inputSource release]; + m_inputSource = [characters retain]; + } // There is no way to get the scan code from carbon/cocoa. But we cannot // use the value 0, since it indicates that the event originates from somewhere @@ -1352,7 +1358,7 @@ static QTabletEvent::TabletDevice wacomTabletDevice(NSEvent *theEvent) { Q_UNUSED(replacementRange) - if (m_sendKeyEvent && m_composingText.isEmpty()) { + if (m_sendKeyEvent && m_composingText.isEmpty() && [aString isEqualToString:m_inputSource]) { // don't send input method events for simple text input (let handleKeyEvent send key events instead) return; } -- cgit v1.2.3 From 09e53c8b6ece81efda1c075643cc84320a061f88 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Fri, 29 Nov 2013 12:38:04 +0100 Subject: Plugin minimalegl: Remove superfluous keys() function. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is no longer needed in Qt 5. Change-Id: I10a2b893fdc822a526abc19c3d1f0f2538de0d83 Reviewed-by: Jørgen Lind --- src/plugins/platforms/minimalegl/main.cpp | 8 -------- 1 file changed, 8 deletions(-) (limited to 'src') diff --git a/src/plugins/platforms/minimalegl/main.cpp b/src/plugins/platforms/minimalegl/main.cpp index be85fa082e..ce8838ced0 100644 --- a/src/plugins/platforms/minimalegl/main.cpp +++ b/src/plugins/platforms/minimalegl/main.cpp @@ -49,17 +49,9 @@ class QMinimalEglIntegrationPlugin : public QPlatformIntegrationPlugin Q_OBJECT Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.2" FILE "minimalegl.json") public: - QStringList keys() const; QPlatformIntegration *create(const QString&, const QStringList&); }; -QStringList QMinimalEglIntegrationPlugin::keys() const -{ - QStringList list; - list << "MinimalEgl"; - return list; -} - QPlatformIntegration* QMinimalEglIntegrationPlugin::create(const QString& system, const QStringList& paramList) { Q_UNUSED(paramList); -- cgit v1.2.3 From bb9dd258434c7146843c0c84e625afcb8b0327f2 Mon Sep 17 00:00:00 2001 From: Rafael Roquetto Date: Wed, 5 Feb 2014 09:49:06 -0200 Subject: QNX: fix wrong coding style Change-Id: I84b166ee528b7d586f1901e6bfda999ef698c3fd Reviewed-by: Giuseppe D'Angelo --- src/plugins/platforms/qnx/qqnxscreen.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/plugins/platforms/qnx/qqnxscreen.cpp b/src/plugins/platforms/qnx/qqnxscreen.cpp index a09d6ce1f5..3a0607f214 100644 --- a/src/plugins/platforms/qnx/qqnxscreen.cpp +++ b/src/plugins/platforms/qnx/qqnxscreen.cpp @@ -565,7 +565,7 @@ void QQnxScreen::updateHierarchy() // After a hierarchy update, we need to force a flush on all screens. // Right now, all screens share a context. - screen_flush_context( m_screenContext, 0 ); + screen_flush_context(m_screenContext, 0); } void QQnxScreen::adjustOrientation() -- cgit v1.2.3 From 760ad40700ee5c6db969c376e053f9c4806e90a6 Mon Sep 17 00:00:00 2001 From: Frederik Gladhorn Date: Tue, 4 Feb 2014 15:47:48 +0100 Subject: Make QWindowContainer accessible Change-Id: I93451b8842648db0815c96d64d319daecb45f0de Reviewed-by: Gunnar Sletta --- src/plugins/accessible/widgets/main.cpp | 2 ++ src/plugins/accessible/widgets/simplewidgets.cpp | 35 +++++++++++++++++++++++- src/plugins/accessible/widgets/simplewidgets.h | 13 +++++++++ src/plugins/accessible/widgets/widgets.json | 3 +- src/widgets/kernel/qwindowcontainer.cpp | 6 +++- src/widgets/kernel/qwindowcontainer_p.h | 3 +- 6 files changed, 58 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/plugins/accessible/widgets/main.cpp b/src/plugins/accessible/widgets/main.cpp index 36ee784aac..717c15edd1 100644 --- a/src/plugins/accessible/widgets/main.cpp +++ b/src/plugins/accessible/widgets/main.cpp @@ -247,6 +247,8 @@ QAccessibleInterface *AccessibleFactory::create(const QString &classname, QObjec iface = 0; } else if (classname == QLatin1String("QWidget")) { iface = new QAccessibleWidget(widget); + } else if (classname == QLatin1String("QWindowContainer")) { + iface = new QAccessibleWindowContainer(widget); } return iface; diff --git a/src/plugins/accessible/widgets/simplewidgets.cpp b/src/plugins/accessible/widgets/simplewidgets.cpp index 1dac199a09..c275ec071d 100644 --- a/src/plugins/accessible/widgets/simplewidgets.cpp +++ b/src/plugins/accessible/widgets/simplewidgets.cpp @@ -57,6 +57,8 @@ #include #include #include +#include +#include #include #ifdef Q_OS_MAC @@ -845,7 +847,38 @@ QProgressBar *QAccessibleProgressBar::progressBar() const } #endif + +QAccessibleWindowContainer::QAccessibleWindowContainer(QWidget *w) + : QAccessibleWidget(w) +{ +} + +int QAccessibleWindowContainer::childCount() const +{ + if (container()->containedWindow()) + return 1; + return 0; +} + +int QAccessibleWindowContainer::indexOfChild(const QAccessibleInterface *child) const +{ + if (child->object() == container()->containedWindow()) + return 0; + return -1; +} + +QAccessibleInterface *QAccessibleWindowContainer::child(int i) const +{ + if (i == 0) + return QAccessible::queryAccessibleInterface(container()->containedWindow()); + return 0; +} + +QWindowContainer *QAccessibleWindowContainer::container() const +{ + return static_cast(widget()); +} + #endif // QT_NO_ACCESSIBILITY QT_END_NAMESPACE - diff --git a/src/plugins/accessible/widgets/simplewidgets.h b/src/plugins/accessible/widgets/simplewidgets.h index 6024788048..be19d8324f 100644 --- a/src/plugins/accessible/widgets/simplewidgets.h +++ b/src/plugins/accessible/widgets/simplewidgets.h @@ -195,6 +195,19 @@ protected: }; #endif +class QWindowContainer; +class QAccessibleWindowContainer : public QAccessibleWidget +{ +public: + QAccessibleWindowContainer(QWidget *w); + int childCount() const Q_DECL_OVERRIDE; + int indexOfChild(const QAccessibleInterface *child) const Q_DECL_OVERRIDE; + QAccessibleInterface *child(int i) const Q_DECL_OVERRIDE; + +private: + QWindowContainer *container() const; +}; + #endif // QT_NO_ACCESSIBILITY QT_END_NAMESPACE diff --git a/src/plugins/accessible/widgets/widgets.json b/src/plugins/accessible/widgets/widgets.json index 3969fcd527..9ebcc89d35 100644 --- a/src/plugins/accessible/widgets/widgets.json +++ b/src/plugins/accessible/widgets/widgets.json @@ -48,6 +48,7 @@ "QScrollArea", "QCalendarWidget", "QDockWidget", - "QDesktopScreenWidget" + "QDesktopScreenWidget", + "QWindowContainer" ] } diff --git a/src/widgets/kernel/qwindowcontainer.cpp b/src/widgets/kernel/qwindowcontainer.cpp index 399f089e0f..a4b3caf78d 100644 --- a/src/widgets/kernel/qwindowcontainer.cpp +++ b/src/widgets/kernel/qwindowcontainer.cpp @@ -200,7 +200,11 @@ QWindowContainer::QWindowContainer(QWindow *embeddedWindow, QWidget *parent, Qt: connect(QGuiApplication::instance(), SIGNAL(focusWindowChanged(QWindow *)), this, SLOT(focusWindowChanged(QWindow *))); } - +QWindow *QWindowContainer::containedWindow() const +{ + Q_D(const QWindowContainer); + return d->window; +} /*! \internal diff --git a/src/widgets/kernel/qwindowcontainer_p.h b/src/widgets/kernel/qwindowcontainer_p.h index a21f9bd35a..014b163f97 100644 --- a/src/widgets/kernel/qwindowcontainer_p.h +++ b/src/widgets/kernel/qwindowcontainer_p.h @@ -48,7 +48,7 @@ QT_BEGIN_NAMESPACE class QWindowContainerPrivate; -class QWindowContainer : public QWidget +class Q_WIDGETS_EXPORT QWindowContainer : public QWidget { Q_OBJECT Q_DECLARE_PRIVATE(QWindowContainer) @@ -56,6 +56,7 @@ class QWindowContainer : public QWidget public: explicit QWindowContainer(QWindow *embeddedWindow, QWidget *parent = 0, Qt::WindowFlags f = 0); ~QWindowContainer(); + QWindow *containedWindow() const; static void toplevelAboutToBeDestroyed(QWidget *parent); static void parentWasChanged(QWidget *parent); -- cgit v1.2.3 From 2d67bf07fee5e0ad65b89030a440a3b73cb1d3d3 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Tue, 4 Feb 2014 13:04:38 +0100 Subject: Do not query max samples on gles MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Querying GL_MAX_SAMPLES is not supported in GLES2. Avoiding the call also makes us play nice with Mesa in debug mode since it gets rid of the warnings about the failing glGetIntegerv call. Change-Id: I05e501cc11af41a54fefc34ab919c5191e4f3f0a Reviewed-by: Jørgen Lind Reviewed-by: Gunnar Sletta --- src/gui/opengl/qopenglframebufferobject.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/gui/opengl/qopenglframebufferobject.cpp b/src/gui/opengl/qopenglframebufferobject.cpp index c06ba40b47..14d7fac9f7 100644 --- a/src/gui/opengl/qopenglframebufferobject.cpp +++ b/src/gui/opengl/qopenglframebufferobject.cpp @@ -432,9 +432,11 @@ void QOpenGLFramebufferObjectPrivate::init(QOpenGLFramebufferObject *, const QSi samples = 0; } +#ifndef QT_OPENGL_ES_2 GLint maxSamples; glGetIntegerv(GL_MAX_SAMPLES, &maxSamples); samples = qBound(0, int(samples), int(maxSamples)); +#endif size = sz; target = texture_target; -- cgit v1.2.3 From c6d3fe8873122701b9d223f68f25d8b478bed397 Mon Sep 17 00:00:00 2001 From: Cedric Chedaleux Date: Mon, 3 Feb 2014 11:33:55 +0100 Subject: Checking input mask before scanning evdev devices Adding device mask verification for static device discovery. DRM devices are no longer scanned if mask is set to input devices only Change-Id: Ibd2e77280c2d93c707ba7bdb84c4ae3cb0932178 Reviewed-by: Laszlo Agocs --- .../devicediscovery/qdevicediscovery_static.cpp | 28 ++++++++++++---------- 1 file changed, 16 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/platformsupport/devicediscovery/qdevicediscovery_static.cpp b/src/platformsupport/devicediscovery/qdevicediscovery_static.cpp index a333d2c0c7..cbcc0ff5b1 100644 --- a/src/platformsupport/devicediscovery/qdevicediscovery_static.cpp +++ b/src/platformsupport/devicediscovery/qdevicediscovery_static.cpp @@ -102,23 +102,27 @@ QDeviceDiscovery::~QDeviceDiscovery() QStringList QDeviceDiscovery::scanConnectedDevices() { QStringList devices; - - // check for input devices - QDir dir(QString::fromLatin1(QT_EVDEV_DEVICE_PATH)); + QDir dir; dir.setFilter(QDir::System); - foreach (const QString &deviceFile, dir.entryList()) { - QString absoluteFilePath = dir.absolutePath() + QString::fromLatin1("/") + deviceFile; - if (checkDeviceType(absoluteFilePath)) - devices << absoluteFilePath; + // check for input devices + if (m_types & Device_InputMask) { + dir.setPath(QString::fromLatin1(QT_EVDEV_DEVICE_PATH)); + foreach (const QString &deviceFile, dir.entryList()) { + QString absoluteFilePath = dir.absolutePath() + QString::fromLatin1("/") + deviceFile; + if (checkDeviceType(absoluteFilePath)) + devices << absoluteFilePath; + } } // check for drm devices - dir.setPath(QString::fromLatin1(QT_DRM_DEVICE_PATH)); - foreach (const QString &deviceFile, dir.entryList()) { - QString absoluteFilePath = dir.absolutePath() + QString::fromLatin1("/") + deviceFile; - if (checkDeviceType(absoluteFilePath)) - devices << absoluteFilePath; + if (m_types & Device_VideoMask) { + dir.setPath(QString::fromLatin1(QT_DRM_DEVICE_PATH)); + foreach (const QString &deviceFile, dir.entryList()) { + QString absoluteFilePath = dir.absolutePath() + QString::fromLatin1("/") + deviceFile; + if (checkDeviceType(absoluteFilePath)) + devices << absoluteFilePath; + } } #ifdef QT_QPA_DEVICE_DISCOVERY_DEBUG -- cgit v1.2.3 From 113cfa9aa644872f294b8e11108d269e8be758d0 Mon Sep 17 00:00:00 2001 From: Frederik Gladhorn Date: Fri, 10 Jan 2014 16:42:36 +0100 Subject: Accessibility Linux: Fix all widgets reporting being editable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [ChangeLog][QtGui] Accessibility on Linux reported all objects as being editable instead of just editable text items. Change-Id: I8bca2799a2e5b175b3ca515fee5dd02eae23829e Reviewed-by: Jan Arve Sæther --- .../linuxaccessibility/constant_mappings.cpp | 27 ++++++++-------------- 1 file changed, 10 insertions(+), 17 deletions(-) (limited to 'src') diff --git a/src/platformsupport/linuxaccessibility/constant_mappings.cpp b/src/platformsupport/linuxaccessibility/constant_mappings.cpp index 3524fca052..f8bfaf4753 100644 --- a/src/platformsupport/linuxaccessibility/constant_mappings.cpp +++ b/src/platformsupport/linuxaccessibility/constant_mappings.cpp @@ -61,17 +61,12 @@ quint64 spiStatesFromQState(QAccessible::State state) { quint64 spiState = 0; - setSpiStateBit(&spiState, ATSPI_STATE_EDITABLE); - setSpiStateBit(&spiState, ATSPI_STATE_ENABLED); - setSpiStateBit(&spiState, ATSPI_STATE_SHOWING); - setSpiStateBit(&spiState, ATSPI_STATE_VISIBLE); - setSpiStateBit(&spiState, ATSPI_STATE_SENSITIVE); - - if (state.disabled) { - unsetSpiStateBit(&spiState, ATSPI_STATE_ENABLED); - unsetSpiStateBit(&spiState, ATSPI_STATE_SENSITIVE); + if (state.editable) + setSpiStateBit(&spiState, ATSPI_STATE_EDITABLE); + if (!state.disabled) { + setSpiStateBit(&spiState, ATSPI_STATE_ENABLED); + setSpiStateBit(&spiState, ATSPI_STATE_SENSITIVE); } - if (state.selected) setSpiStateBit(&spiState, ATSPI_STATE_SELECTED); if (state.focused) @@ -95,9 +90,9 @@ quint64 spiStatesFromQState(QAccessible::State state) setSpiStateBit(&spiState, ATSPI_STATE_BUSY); if (state.marqueed || state.animated) setSpiStateBit(&spiState, ATSPI_STATE_ANIMATED); - if (state.invisible || state.offscreen) { - unsetSpiStateBit(&spiState, ATSPI_STATE_SHOWING); - unsetSpiStateBit(&spiState, ATSPI_STATE_VISIBLE); + if (!state.invisible && !state.offscreen) { + setSpiStateBit(&spiState, ATSPI_STATE_SHOWING); + setSpiStateBit(&spiState, ATSPI_STATE_VISIBLE); } if (state.sizeable) setSpiStateBit(&spiState, ATSPI_STATE_RESIZABLE); @@ -118,10 +113,8 @@ quint64 spiStatesFromQState(QAccessible::State state) // if (state.HasPopup) if (state.modal) setSpiStateBit(&spiState, ATSPI_STATE_MODAL); - - // Not implemented in Qt - // if (state.singleLine) - // setSpiStateBit(&spiState, ATSPI_STATE_SINGLE_LINE); + if (state.multiLine) + setSpiStateBit(&spiState, ATSPI_STATE_MULTI_LINE); return spiState; } -- cgit v1.2.3 From f0d135a6bea08bcfa1e56303d0ee9694c5bc1633 Mon Sep 17 00:00:00 2001 From: David Faure Date: Sat, 1 Feb 2014 12:21:37 +0100 Subject: Doc: fix documentation for QWidget::windowHandle. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It's not "preliminary" anymore, and it doesn't return a QPlatformWindow, but a QWindow. Change-Id: Iaa1938728e689d97011dce8cf0d88ff8cb4a83b9 Reviewed-by: Friedemann Kleint Reviewed-by: Topi Reiniö --- src/widgets/kernel/qwidget_qpa.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/widgets/kernel/qwidget_qpa.cpp b/src/widgets/kernel/qwidget_qpa.cpp index ea6f27caf9..0a4bc990e6 100644 --- a/src/widgets/kernel/qwidget_qpa.cpp +++ b/src/widgets/kernel/qwidget_qpa.cpp @@ -879,9 +879,15 @@ int QWidget::metric(PaintDeviceMetric m) const } /*! - \preliminary + If this is a native widget, return the associated QWindow. + Otherwise return null. - Returns the QPlatformWindow this widget will be drawn into. + Native widgets include toplevel widgets, QGLWidget, and child widgets + on which winId() was called. + + \since 5.0 + + \sa winId() */ QWindow *QWidget::windowHandle() const { -- cgit v1.2.3 From 2c1e77506ccd22f9d9be4f79875539a630f4f576 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Wed, 5 Feb 2014 18:01:08 +0100 Subject: Do not check for !IsRenderBuffer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Unlike the newer QOpenGLFramebufferObject, QGLFramebufferObject still contains some unfortunate tests for !IsRenderBuffer when creating renderbuffers. Removing these tests avoids asserting in debug builds on drivers that are not conformant to the GL spec in this respect. This means that the qgl autotest is now passing on such drivers too. The tests do not make much sense in the first place since Qt is not a conformance test suite. Change-Id: I21d6272cd5cef9dd71eab57e46771d3ce7dacbfb Reviewed-by: Jørgen Lind --- src/opengl/qglframebufferobject.cpp | 3 --- 1 file changed, 3 deletions(-) (limited to 'src') diff --git a/src/opengl/qglframebufferobject.cpp b/src/opengl/qglframebufferobject.cpp index f42ee40211..a9871967f2 100644 --- a/src/opengl/qglframebufferobject.cpp +++ b/src/opengl/qglframebufferobject.cpp @@ -554,7 +554,6 @@ void QGLFramebufferObjectPrivate::init(QGLFramebufferObject *q, const QSize &sz, && funcs.hasOpenGLExtension(QOpenGLExtensions::PackedDepthStencil)) { // depth and stencil buffer needs another extension funcs.glGenRenderbuffers(1, &depth_buffer); - Q_ASSERT(!funcs.glIsRenderbuffer(depth_buffer)); funcs.glBindRenderbuffer(GL_RENDERBUFFER, depth_buffer); Q_ASSERT(funcs.glIsRenderbuffer(depth_buffer)); if (samples != 0 && funcs.hasOpenGLExtension(QOpenGLExtensions::FramebufferMultisample)) @@ -581,7 +580,6 @@ void QGLFramebufferObjectPrivate::init(QGLFramebufferObject *q, const QSize &sz, || (attachment == QGLFramebufferObject::Depth))) { funcs.glGenRenderbuffers(1, &depth_buffer); - Q_ASSERT(!funcs.glIsRenderbuffer(depth_buffer)); funcs.glBindRenderbuffer(GL_RENDERBUFFER, depth_buffer); Q_ASSERT(funcs.glIsRenderbuffer(depth_buffer)); if (samples != 0 && funcs.hasOpenGLExtension(QOpenGLExtensions::FramebufferMultisample)) { @@ -621,7 +619,6 @@ void QGLFramebufferObjectPrivate::init(QGLFramebufferObject *q, const QSize &sz, if (stencil_buffer == 0 && (attachment == QGLFramebufferObject::CombinedDepthStencil)) { funcs.glGenRenderbuffers(1, &stencil_buffer); - Q_ASSERT(!funcs.glIsRenderbuffer(stencil_buffer)); funcs.glBindRenderbuffer(GL_RENDERBUFFER, stencil_buffer); Q_ASSERT(funcs.glIsRenderbuffer(stencil_buffer)); if (samples != 0 && funcs.hasOpenGLExtension(QOpenGLExtensions::FramebufferMultisample)) { -- cgit v1.2.3 From 65bd80ebfc1be81a196a861ade40ff874a3554f0 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Tue, 4 Feb 2014 14:47:39 +0100 Subject: QTabWidget: fix moving of the current tab MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Task-number: QTBUG-36455 Change-Id: I38687283d60fe38a4b586b064d5ddd4ed3be06b6 Reviewed-by: Thorbjørn Lund Martsum Reviewed-by: Ivan Komissarov --- src/widgets/widgets/qtabbar.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/widgets/widgets/qtabbar.cpp b/src/widgets/widgets/qtabbar.cpp index dfd1f1022c..b47d65f561 100644 --- a/src/widgets/widgets/qtabbar.cpp +++ b/src/widgets/widgets/qtabbar.cpp @@ -1681,6 +1681,7 @@ void QTabBar::moveTab(int from, int to) d->tabList[i].lastTab = d->calculateNewPosition(from, to, d->tabList[i].lastTab); // update external variables + int previousIndex = d->currentIndex; d->currentIndex = d->calculateNewPosition(from, to, d->currentIndex); // If we are in the middle of a drag update the dragStartPosition @@ -1699,6 +1700,8 @@ void QTabBar::moveTab(int from, int to) d->layoutWidgets(start); update(); emit tabMoved(from, to); + if (previousIndex != d->currentIndex) + emit currentChanged(d->currentIndex); emit tabLayoutChange(); } -- cgit v1.2.3