From dcfb814498be938421b56020d7c9946cce7296dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Thu, 25 Aug 2016 15:07:33 +0200 Subject: Cocoa: Add support for triple-buffered GL contexts As usual, the requested format may not be available, so clients should check the actual format to confirm triple-buffering. Change-Id: Icf073cc9ddf2c912eb5c3ce0ac80d1694d1c56d7 Reviewed-by: Jake Petroules Reviewed-by: Laszlo Agocs --- src/platformsupport/cglconvenience/cglconvenience.mm | 5 ++++- src/plugins/platforms/cocoa/qcocoaglcontext.mm | 10 +++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/platformsupport/cglconvenience/cglconvenience.mm b/src/platformsupport/cglconvenience/cglconvenience.mm index 6b0a91e13f..fb609ae485 100644 --- a/src/platformsupport/cglconvenience/cglconvenience.mm +++ b/src/platformsupport/cglconvenience/cglconvenience.mm @@ -81,8 +81,11 @@ void *qcgl_createNSOpenGLPixelFormat(const QSurfaceFormat &format) QVector attrs; - if (format.swapBehavior() != QSurfaceFormat::SingleBuffer) + if (format.swapBehavior() == QSurfaceFormat::DoubleBuffer + || format.swapBehavior() == QSurfaceFormat::DefaultSwapBehavior) attrs.append(NSOpenGLPFADoubleBuffer); + else if (format.swapBehavior() == QSurfaceFormat::TripleBuffer) + attrs.append(NSOpenGLPFATripleBuffer); #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7 if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_7) { diff --git a/src/plugins/platforms/cocoa/qcocoaglcontext.mm b/src/plugins/platforms/cocoa/qcocoaglcontext.mm index 0f9b8b900d..b77ca07141 100644 --- a/src/plugins/platforms/cocoa/qcocoaglcontext.mm +++ b/src/plugins/platforms/cocoa/qcocoaglcontext.mm @@ -305,8 +305,16 @@ void QCocoaGLContext::updateSurfaceFormat() m_format.setSamples(samples); int doubleBuffered = -1; + int tripleBuffered = -1; [pixelFormat getValues:&doubleBuffered forAttribute:NSOpenGLPFADoubleBuffer forVirtualScreen:0]; - m_format.setSwapBehavior(doubleBuffered == 1 ? QSurfaceFormat::DoubleBuffer : QSurfaceFormat::SingleBuffer); + [pixelFormat getValues:&tripleBuffered forAttribute:NSOpenGLPFATripleBuffer forVirtualScreen:0]; + + if (tripleBuffered == 1) + m_format.setSwapBehavior(QSurfaceFormat::TripleBuffer); + else if (doubleBuffered == 1) + m_format.setSwapBehavior(QSurfaceFormat::DoubleBuffer); + else + m_format.setSwapBehavior(QSurfaceFormat::SingleBuffer); int steroBuffers = -1; [pixelFormat getValues:&steroBuffers forAttribute:NSOpenGLPFAStereo forVirtualScreen:0]; -- cgit v1.2.3 From 710ff392d95fb2888c14ea273f4d65ced908fe49 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Fri, 26 Aug 2016 11:57:21 +0200 Subject: QIcon::addFile(): Invoke QMimeDatabase when matching by suffix fails This will detect image files correctly even if case resource aliases without suffixed are used. Task-number: QTBUG-55388 Change-Id: I337ca1f6be7126fe731e5e278b23aaef6cdfd9ef Reviewed-by: Eirik Aavitsland --- src/gui/image/qicon.cpp | 40 ++++++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 18 deletions(-) (limited to 'src') diff --git a/src/gui/image/qicon.cpp b/src/gui/image/qicon.cpp index 62ec8e93b2..716a7c52c2 100644 --- a/src/gui/image/qicon.cpp +++ b/src/gui/image/qicon.cpp @@ -47,6 +47,8 @@ #include "private/qiconloader_p.h" #include "qpainter.h" #include "qfileinfo.h" +#include +#include #include "qpixmapcache.h" #include "qvariant.h" #include "qcache.h" @@ -976,6 +978,18 @@ void QIcon::addPixmap(const QPixmap &pixmap, Mode mode, State state) d->engine->addPixmap(pixmap, mode, state); } +static QIconEngine *iconEngineFromSuffix(const QString &fileName, const QString &suffix) +{ + if (!suffix.isEmpty()) { + const int index = loader()->indexOf(suffix); + if (index != -1) { + if (QIconEnginePlugin *factory = qobject_cast(loader()->instance(index))) { + return factory->create(fileName); + } + } + } + return nullptr; +} /*! Adds an image from the file with the given \a fileName to the icon, as a specialization for \a size, \a mode and \a state. The @@ -1013,25 +1027,15 @@ void QIcon::addFile(const QString &fileName, const QSize &size, Mode mode, State return; detach(); if (!d) { + QFileInfo info(fileName); - QString suffix = info.suffix(); - if (!suffix.isEmpty()) { - // first try version 2 engines.. - const int index = loader()->indexOf(suffix); - if (index != -1) { - if (QIconEnginePlugin *factory = qobject_cast(loader()->instance(index))) { - if (QIconEngine *engine = factory->create(fileName)) { - d = new QIconPrivate; - d->engine = engine; - } - } - } - } - // ...then fall back to the default engine - if (!d) { - d = new QIconPrivate; - d->engine = new QPixmapIconEngine; - } + QIconEngine *engine = iconEngineFromSuffix(fileName, info.suffix()); +#ifndef QT_NO_MIMETYPE + if (!engine) + engine = iconEngineFromSuffix(fileName, QMimeDatabase().mimeTypeForFile(info).preferredSuffix()); +#endif // !QT_NO_MIMETYPE + d = new QIconPrivate; + d->engine = engine ? engine : new QPixmapIconEngine; } d->engine->addFile(fileName, size, mode, state); -- cgit v1.2.3 From 17e5d9d7cadb4fceb39cfc875162add57e962db8 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Fri, 24 Jun 2016 10:57:10 +0200 Subject: Fix QMainWindow::restoreDockWidget() with GroupedDragging MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We need to account for the fact that the placeholder might be in a floating tab. Task-number: QTBUG-50491 Change-Id: I03d8e49cc40f58691154f5c3984f3b0670a974d5 Reviewed-by: Friedemann Kleint Reviewed-by: Sérgio Martins --- src/widgets/widgets/qdockarealayout.cpp | 53 ++++++++++++++++------- src/widgets/widgets/qdockarealayout_p.h | 1 + src/widgets/widgets/qmainwindowlayout.cpp | 70 ++++++++++++++++++------------- src/widgets/widgets/qmainwindowlayout_p.h | 2 +- 4 files changed, 80 insertions(+), 46 deletions(-) (limited to 'src') diff --git a/src/widgets/widgets/qdockarealayout.cpp b/src/widgets/widgets/qdockarealayout.cpp index d22e89c6e1..1d10de904d 100644 --- a/src/widgets/widgets/qdockarealayout.cpp +++ b/src/widgets/widgets/qdockarealayout.cpp @@ -2604,6 +2604,21 @@ void QDockAreaLayout::remove(const QList &path) docks[index].remove(path.mid(1)); } +void QDockAreaLayout::removePlaceHolder(const QString &name) +{ + QList index = indexOfPlaceHolder(name); + if (!index.isEmpty()) + remove(index); + foreach (QDockWidgetGroupWindow *dwgw, mainWindow->findChildren( + QString(), Qt::FindDirectChildrenOnly)) { + index = dwgw->layoutInfo()->indexOfPlaceHolder(name); + if (!index.isEmpty()) { + dwgw->layoutInfo()->remove(index); + dwgw->destroyOrHideIfEmpty(); + } + } +} + static inline int qMax(int i1, int i2, int i3) { return qMax(i1, qMax(i2, i3)); } void QDockAreaLayout::getGrid(QVector *_ver_struct_list, @@ -3030,15 +3045,27 @@ QRect QDockAreaLayout::constrainedRect(QRect rect, QWidget* widget) bool QDockAreaLayout::restoreDockWidget(QDockWidget *dockWidget) { - QList index = indexOfPlaceHolder(dockWidget->objectName()); - if (index.isEmpty()) - return false; + QDockAreaLayoutItem *item = 0; + foreach (QDockWidgetGroupWindow *dwgw, mainWindow->findChildren( + QString(), Qt::FindDirectChildrenOnly)) { + QList index = dwgw->layoutInfo()->indexOfPlaceHolder(dockWidget->objectName()); + if (!index.isEmpty()) { + dockWidget->setParent(dwgw); + item = const_cast(&dwgw->layoutInfo()->item(index)); + break; + } + } + if (!item) { + QList index = indexOfPlaceHolder(dockWidget->objectName()); + if (index.isEmpty()) + return false; + item = const_cast(&this->item(index)); + } - QDockAreaLayoutItem &item = this->item(index); - QPlaceHolderItem *placeHolder = item.placeHolderItem; + QPlaceHolderItem *placeHolder = item->placeHolderItem; Q_ASSERT(placeHolder != 0); - item.widgetItem = new QDockWidgetItem(dockWidget); + item->widgetItem = new QDockWidgetItem(dockWidget); if (placeHolder->window) { const QRect r = constrainedRect(placeHolder->topLevelRect, dockWidget); @@ -3050,7 +3077,7 @@ bool QDockAreaLayout::restoreDockWidget(QDockWidget *dockWidget) dockWidget->d_func()->setWindowState(true); #endif - item.placeHolderItem = 0; + item->placeHolderItem = 0; delete placeHolder; return true; @@ -3086,9 +3113,7 @@ void QDockAreaLayout::addDockWidget(QInternal::DockPosition pos, QDockWidget *do info = new_info; } - QList index = indexOfPlaceHolder(dockWidget->objectName()); - if (!index.isEmpty()) - remove(index); + removePlaceHolder(dockWidget->objectName()); } void QDockAreaLayout::tabifyDockWidget(QDockWidget *first, QDockWidget *second) @@ -3101,9 +3126,7 @@ void QDockAreaLayout::tabifyDockWidget(QDockWidget *first, QDockWidget *second) Q_ASSERT(info != 0); info->tab(path.last(), new QDockWidgetItem(second)); - QList index = indexOfPlaceHolder(second->objectName()); - if (!index.isEmpty()) - remove(index); + removePlaceHolder(second->objectName()); } void QDockAreaLayout::resizeDocks(const QList &docks, @@ -3165,9 +3188,7 @@ void QDockAreaLayout::splitDockWidget(QDockWidget *after, Q_ASSERT(info != 0); info->split(path.last(), orientation, new QDockWidgetItem(dockWidget)); - QList index = indexOfPlaceHolder(dockWidget->objectName()); - if (!index.isEmpty()) - remove(index); + removePlaceHolder(dockWidget->objectName()); } void QDockAreaLayout::apply(bool animate) diff --git a/src/widgets/widgets/qdockarealayout_p.h b/src/widgets/widgets/qdockarealayout_p.h index 5d352f0124..8a35d8b035 100644 --- a/src/widgets/widgets/qdockarealayout_p.h +++ b/src/widgets/widgets/qdockarealayout_p.h @@ -255,6 +255,7 @@ public: QLayoutItem *plug(const QList &path); QLayoutItem *unplug(const QList &path); void remove(const QList &path); + void removePlaceHolder(const QString &name); void fitLayout(); diff --git a/src/widgets/widgets/qmainwindowlayout.cpp b/src/widgets/widgets/qmainwindowlayout.cpp index 6b247d8d11..f581fe4d88 100644 --- a/src/widgets/widgets/qmainwindowlayout.cpp +++ b/src/widgets/widgets/qmainwindowlayout.cpp @@ -215,11 +215,10 @@ public: } void setGeometry(const QRect&r) Q_DECL_OVERRIDE { + static_cast(parent())->destroyOrHideIfEmpty(); QDockAreaLayoutInfo *li = layoutInfo(); - if (li->isEmpty()) { - static_cast(parent())->destroyIfEmpty(); + if (li->isEmpty()) return; - } int fw = frameWidth(); li->reparentWidgets(parentWidget()); li->rect = r.adjusted(fw, fw, -fw, -fw); @@ -272,6 +271,10 @@ bool QDockWidgetGroupWindow::event(QEvent *e) if (qobject_cast(static_cast(e)->child())) adjustFlags(); break; + case QEvent::LayoutRequest: + // We might need to show the widget again + destroyOrHideIfEmpty(); + break; default: break; } @@ -325,34 +328,43 @@ QDockWidget *QDockWidgetGroupWindow::topDockWidget() const } /*! \internal - Destroy this window if there is no more QDockWidget in it. + Destroy or hide this window if there is no more QDockWidget in it. + Otherwise make sure it is shown. */ -void QDockWidgetGroupWindow::destroyIfEmpty() -{ - if (layoutInfo()->isEmpty()) { - // Make sure to reparent the possibly floating or hidden QDockWidgets to the parent - foreach (QDockWidget *dw, - findChildren(QString(), Qt::FindDirectChildrenOnly)) { - bool wasFloating = dw->isFloating(); - bool wasHidden = dw->isHidden(); - dw->setParent(parentWidget()); - if (wasFloating) { - dw->setFloating(true); - } else { - // maybe it was hidden, we still have to put it back in the main layout. - QMainWindowLayout *ml = qt_mainwindow_layout(static_cast(parentWidget())); - Qt::DockWidgetArea area = ml->dockWidgetArea(this); - if (area == Qt::NoDockWidgetArea) - area = Qt::LeftDockWidgetArea; - static_cast(parentWidget())->addDockWidget(area, dw); - } - if (!wasHidden) - dw->show(); +void QDockWidgetGroupWindow::destroyOrHideIfEmpty() +{ + if (!layoutInfo()->isEmpty()) { + show(); // It might have been hidden, + return; + } + // There might still be placeholders + if (!layoutInfo()->item_list.isEmpty()) { + hide(); + return; + } + + // Make sure to reparent the possibly floating or hidden QDockWidgets to the parent + foreach (QDockWidget *dw, findChildren(QString(), Qt::FindDirectChildrenOnly)) { + bool wasFloating = dw->isFloating(); + bool wasHidden = dw->isHidden(); + dw->setParent(parentWidget()); + if (wasFloating) { + dw->setFloating(true); + } else { + // maybe it was hidden, we still have to put it back in the main layout. + QMainWindowLayout *ml = + qt_mainwindow_layout(static_cast(parentWidget())); + Qt::DockWidgetArea area = ml->dockWidgetArea(this); + if (area == Qt::NoDockWidgetArea) + area = Qt::LeftDockWidgetArea; + static_cast(parentWidget())->addDockWidget(area, dw); } - foreach (QTabBar *tb, findChildren(QString(), Qt::FindDirectChildrenOnly)) - tb->setParent(parentWidget()); - deleteLater(); + if (!wasHidden) + dw->show(); } + foreach (QTabBar *tb, findChildren(QString(), Qt::FindDirectChildrenOnly)) + tb->setParent(parentWidget()); + deleteLater(); } /*! \internal @@ -2075,7 +2087,7 @@ void QMainWindowLayout::animationFinished(QWidget *widget) item.subinfo->reparentWidgets(parentWidget()); item.subinfo->setTabBarShape(parentInfo->tabBarShape); } - dwgw->destroyIfEmpty(); + dwgw->destroyOrHideIfEmpty(); } if (QDockWidget *dw = qobject_cast(widget)) { diff --git a/src/widgets/widgets/qmainwindowlayout_p.h b/src/widgets/widgets/qmainwindowlayout_p.h index 9a13e5f5ce..7475da8bdc 100644 --- a/src/widgets/widgets/qmainwindowlayout_p.h +++ b/src/widgets/widgets/qmainwindowlayout_p.h @@ -86,7 +86,7 @@ public: : QWidget(parent, f) {} QDockAreaLayoutInfo *layoutInfo() const; QDockWidget *topDockWidget() const; - void destroyIfEmpty(); + void destroyOrHideIfEmpty(); void adjustFlags(); protected: bool event(QEvent *) Q_DECL_OVERRIDE; -- cgit v1.2.3 From ce2815b43c3f10c474c35d30197e14c58c9106ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Fri, 19 Aug 2016 14:44:21 +0200 Subject: Guard against calling QWindow::requestUpdate() on non-GUI threads Change-Id: I851ff672bc234146deb61615fc7c56df87d62065 Reviewed-by: Laszlo Agocs Reviewed-by: Timur Pocheptsov --- src/gui/kernel/qwindow.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp index 2e212e5fdb..bcd29b6fe1 100644 --- a/src/gui/kernel/qwindow.cpp +++ b/src/gui/kernel/qwindow.cpp @@ -2160,6 +2160,9 @@ void QWindowPrivate::deliverUpdateRequest() */ void QWindow::requestUpdate() { + Q_ASSERT_X(QThread::currentThread() == QCoreApplication::instance()->thread(), + "QWindow", "Updates can only be scheduled from the GUI (main) thread"); + Q_D(QWindow); if (d->updateRequestPending || !d->platformWindow) return; -- cgit v1.2.3 From 579283507c392fc5bc0976c054304ecb8938cb06 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 30 Aug 2016 13:42:43 +0200 Subject: QWin32PrintEngine: Fix uninitialized memory read of dpi_x, dpi_y Discovered by purify: QWin32PrintEnginePrivate::initialize() called updateMetrics() via updatePageLayout() after initHDC(), so dpi_x, dpi_y were accessed before initialized from the display resolution. Fix by moving the call initHDC() up and giving default values. Change-Id: Ia360c06d156e569ca6b1472ec5b5cdc52948f913 Reviewed-by: Andy Shaw --- src/printsupport/kernel/qprintengine_win.cpp | 4 ++-- src/printsupport/kernel/qprintengine_win_p.h | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/printsupport/kernel/qprintengine_win.cpp b/src/printsupport/kernel/qprintengine_win.cpp index a9d316095c..1c02d389fe 100644 --- a/src/printsupport/kernel/qprintengine_win.cpp +++ b/src/printsupport/kernel/qprintengine_win.cpp @@ -918,14 +918,14 @@ void QWin32PrintEnginePrivate::initialize() Q_ASSERT(hPrinter); Q_ASSERT(pInfo); + initHDC(); + if (devMode) { num_copies = devMode->dmCopies; devMode->dmCollate = DMCOLLATE_TRUE; updatePageLayout(); } - initHDC(); - #if defined QT_DEBUG_DRAW || defined QT_DEBUG_METRICS qDebug() << "QWin32PrintEngine::initialize()"; debugMetrics(); diff --git a/src/printsupport/kernel/qprintengine_win_p.h b/src/printsupport/kernel/qprintengine_win_p.h index c1d7b452f9..74b78ae2b1 100644 --- a/src/printsupport/kernel/qprintengine_win_p.h +++ b/src/printsupport/kernel/qprintengine_win_p.h @@ -124,10 +124,14 @@ public: state(QPrinter::Idle), resolution(0), m_pageLayout(QPageLayout(QPageSize(QPageSize::A4), QPageLayout::Portrait, QMarginsF(0, 0, 0, 0))), + stretch_x(1), stretch_y(1), origin_x(0), origin_y(0), + dpi_x(96), dpi_y(96), dpi_display(96), num_copies(1), printToFile(false), reinit(false), - embed_fonts(true) + complex_xform(false), has_pen(false), has_brush(false), has_custom_paper_size(false), + embed_fonts(true), + txop(0 /* QTransform::TxNone */) { } -- cgit v1.2.3 From 2ca4fd401b90831857a0dcd643e5d382feb75cb0 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Fri, 5 Aug 2016 14:43:15 +0200 Subject: QIcon: Set the pixmap's dpr to 1.0 if the window is also set to 1.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When the pixmap is initially from a higher device pixel ratio and it is being used on a window that does not have a device pixel ratio other than 1.0 set then the pixmap should also have it set to 1.0. This ensures that the size of the pixmap is preserved and it is not scaled down as a result on the normal display. Change-Id: Ie5d96b3e1508867b723000bea182c8157640af02 Reviewed-by: Morten Johan Sørvig --- src/gui/image/qicon.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/gui/image/qicon.cpp b/src/gui/image/qicon.cpp index e1e5367766..3531be412e 100644 --- a/src/gui/image/qicon.cpp +++ b/src/gui/image/qicon.cpp @@ -835,8 +835,11 @@ QPixmap QIcon::pixmap(QWindow *window, const QSize &size, Mode mode, State state qreal devicePixelRatio = qt_effective_device_pixel_ratio(window); // Handle the simple normal-dpi case: - if (!(devicePixelRatio > 1.0)) - return d->engine->pixmap(size, mode, state); + if (!(devicePixelRatio > 1.0)) { + QPixmap pixmap = d->engine->pixmap(size, mode, state); + pixmap.setDevicePixelRatio(1.0); + return pixmap; + } // Try get a pixmap that is big enough to be displayed at device pixel resolution. QPixmap pixmap = d->engine->pixmap(size * devicePixelRatio, mode, state); -- cgit v1.2.3 From 531a2b1b1c26127f75bfe1230051db615e5874c5 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 30 Aug 2016 12:25:00 +0200 Subject: Windows QPA: Fix leaks in native file dialogs Release the IShellItem instances according to the documentation of IFile[Open]Dialog. Task-number: QTBUG-55509 Task-number: QTBUG-55459 Change-Id: Ib79622cde21982b1bda0be7d0483c6e652a1d5fe Reviewed-by: Andreas Holzammer Reviewed-by: Simon Hausmann Reviewed-by: Maurice Kalinowski --- src/plugins/platforms/windows/qwindowsdialoghelpers.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp b/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp index 6e8df340df..94bb71e429 100644 --- a/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp +++ b/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp @@ -1044,12 +1044,15 @@ void QWindowsNativeFileDialogBase::setDirectory(const QUrl &directory) QString QWindowsNativeFileDialogBase::directory() const { + QString result; #ifndef Q_OS_WINCE IShellItem *item = 0; - if (m_fileDialog && SUCCEEDED(m_fileDialog->GetFolder(&item)) && item) - return QWindowsNativeFileDialogBase::itemPath(item); + if (m_fileDialog && SUCCEEDED(m_fileDialog->GetFolder(&item)) && item) { + result = QWindowsNativeFileDialogBase::itemPath(item); + item->Release(); + } #endif - return QString(); + return result; } void QWindowsNativeFileDialogBase::doExec(HWND owner) @@ -1514,8 +1517,10 @@ QList QWindowsNativeSaveFileDialog::selectedFiles() const QList result; IShellItem *item = 0; const HRESULT hr = fileDialog()->GetCurrentSelection(&item); - if (SUCCEEDED(hr) && item) + if (SUCCEEDED(hr) && item) { result.push_back(QUrl::fromLocalFile(QWindowsNativeSaveFileDialog::itemPath(item))); + item->Release(); + } return result; } -- cgit v1.2.3 From fa2aef5eb8f1a28a79e253a006f348e62afef58a Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 30 Jun 2016 14:56:34 +0200 Subject: Fix QWindowPrivate::globalPosition() for foreign windows MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use mapToGlobal(QPoint(0, 0)) when encountering a foreign window in the parent hierarchy as it is not clear whether it is a native top level or child. In the latter case, using the position is not sufficient. Task-number: QTBUG-43252 Change-Id: I5eebb1f0dbc6a0abbd968c5d383d3eded75c11a5 Reviewed-by: Jan Arve Sæther --- src/gui/kernel/qwindow_p.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/gui/kernel/qwindow_p.h b/src/gui/kernel/qwindow_p.h index ccd14f66ae..4020376feb 100644 --- a/src/gui/kernel/qwindow_p.h +++ b/src/gui/kernel/qwindow_p.h @@ -125,8 +125,14 @@ public: QPoint globalPosition() const { Q_Q(const QWindow); QPoint offset = q->position(); - for (const QWindow *p = q->parent(); p; p = p->parent()) - offset += p->position(); + for (const QWindow *p = q->parent(); p; p = p->parent()) { + if (p->type() != Qt::ForeignWindow) { + offset += p->position(); + } else { // QTBUG-43252, mapToGlobal() for foreign children. + offset += p->mapToGlobal(QPoint(0, 0)); + break; + } + } return offset; } -- cgit v1.2.3 From b09e0636f8c781f5643d7582706bfcfc47106e7c Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Wed, 29 Jun 2016 16:23:40 -0700 Subject: QNetworkProxy: Remove calls to deprecated API on macOS CFURLCreateDataAndPropertiesFromResource has been deprecated since 10.9. Instead of loading the PAC file contents, we call CFNetworkExecuteProxyAutoConfigurationURL. This function being asynchronous, we make sure we block until the CFProxyAutoConfigurationResultCallback has been invoked. Change-Id: I97e32d7f9b349e8e15fe1fdcb35b10e7aab39b3a Reviewed-by: Jake Petroules --- src/network/kernel/qnetworkproxy_mac.cpp | 80 ++++++++++++++------------------ 1 file changed, 34 insertions(+), 46 deletions(-) (limited to 'src') diff --git a/src/network/kernel/qnetworkproxy_mac.cpp b/src/network/kernel/qnetworkproxy_mac.cpp index 37126298c6..76a2d2df9f 100644 --- a/src/network/kernel/qnetworkproxy_mac.cpp +++ b/src/network/kernel/qnetworkproxy_mac.cpp @@ -180,31 +180,23 @@ static QNetworkProxy proxyFromDictionary(CFDictionaryRef dict) return QNetworkProxy(proxyType, hostName, port, user, password); } -const char * cfurlErrorDescription(SInt32 errorCode) +namespace { +struct PACInfo { + QCFType proxies; + QCFType error; + bool done = false; +}; + +void proxyAutoConfigCallback(void *client, CFArrayRef proxylist, CFErrorRef error) { - switch (errorCode) { - case kCFURLUnknownError: - return "Unknown Error"; - case kCFURLUnknownSchemeError: - return "Unknown Scheme"; - case kCFURLResourceNotFoundError: - return "Resource Not Found"; - case kCFURLResourceAccessViolationError: - return "Resource Access Violation"; - case kCFURLRemoteHostUnavailableError: - return "Remote Host Unavailable"; - case kCFURLImproperArgumentsError: - return "Improper Arguments"; - case kCFURLUnknownPropertyKeyError: - return "Unknown Property Key"; - case kCFURLPropertyKeyUnavailableError: - return "Property Key Unavailable"; - case kCFURLTimeoutError: - return "Timeout"; - default: - return "Really Unknown Error"; - } + PACInfo *info = reinterpret_cast(reinterpret_cast(client)->info); + info->done = true; + if (proxylist) + CFRetain(proxylist); + info->proxies = proxylist; + info->error = error; } +} // anon namespace QList macQueryInternal(const QNetworkProxyQuery &query) { @@ -240,23 +232,6 @@ QList macQueryInternal(const QNetworkProxyQuery &query) qWarning("Invalid PAC URL \"%s\"", qPrintable(QCFString::toQString(cfPacLocation))); return result; } - SInt32 errorCode; - if (!CFURLCreateDataAndPropertiesFromResource(kCFAllocatorDefault, pacUrl, &pacData, NULL, NULL, &errorCode)) { - QString pacLocation = QCFString::toQString(cfPacLocation); - qWarning("Unable to get the PAC script at \"%s\" (%s)", qPrintable(pacLocation), cfurlErrorDescription(errorCode)); - return result; - } - if (!pacData) { - qWarning("\"%s\" returned an empty PAC script", qPrintable(QCFString::toQString(cfPacLocation))); - return result; - } - QCFType pacScript = CFStringCreateFromExternalRepresentation(kCFAllocatorDefault, pacData, kCFStringEncodingISOLatin1); - if (!pacScript) { - // This should never happen, but the documentation says it may return NULL if there was a problem creating the object. - QString pacLocation = QCFString::toQString(cfPacLocation); - qWarning("Unable to read the PAC script at \"%s\"", qPrintable(pacLocation)); - return result; - } QByteArray encodedURL = query.url().toEncoded(); // converted to UTF-8 if (encodedURL.isEmpty()) { @@ -268,18 +243,31 @@ QList macQueryInternal(const QNetworkProxyQuery &query) return result; // URL creation problem, abort } - QCFType pacError; - QCFType proxies = CFNetworkCopyProxiesForAutoConfigurationScript(pacScript, targetURL, &pacError); - if (!proxies) { + CFStreamClientContext pacCtx; + pacCtx.version = 0; + PACInfo pacInfo; + pacCtx.info = &pacInfo; + pacCtx.retain = NULL; + pacCtx.release = NULL; + pacCtx.copyDescription = NULL; + + static CFStringRef pacRunLoopMode = CFSTR("qtPACRunLoopMode"); + + QCFType pacRunLoopSource = CFNetworkExecuteProxyAutoConfigurationURL(pacUrl, targetURL, &proxyAutoConfigCallback, &pacCtx); + CFRunLoopAddSource(CFRunLoopGetCurrent(), pacRunLoopSource, pacRunLoopMode); + while (!pacInfo.done) + CFRunLoopRunInMode(pacRunLoopMode, 1000, /*returnAfterSourceHandled*/ true); + + if (!pacInfo.proxies) { QString pacLocation = QCFString::toQString(cfPacLocation); - QCFType pacErrorDescription = CFErrorCopyDescription(pacError); + QCFType pacErrorDescription = CFErrorCopyDescription(pacInfo.error); qWarning("Execution of PAC script at \"%s\" failed: %s", qPrintable(pacLocation), qPrintable(QCFString::toQString(pacErrorDescription))); return result; } - CFIndex size = CFArrayGetCount(proxies); + CFIndex size = CFArrayGetCount(pacInfo.proxies); for (CFIndex i = 0; i < size; ++i) { - CFDictionaryRef proxy = (CFDictionaryRef)CFArrayGetValueAtIndex(proxies, i); + CFDictionaryRef proxy = (CFDictionaryRef)CFArrayGetValueAtIndex(pacInfo.proxies, i); result << proxyFromDictionary(proxy); } return result; -- cgit v1.2.3 From 013210e9dae24288f4e408b4a574433da435ab8a Mon Sep 17 00:00:00 2001 From: Jake Petroules Date: Tue, 30 Aug 2016 19:29:37 -0700 Subject: Fix unused variable warning on iOS Change-Id: Ieae5d7833b45a49a743a52a437d5383bd8a962c5 Reviewed-by: Thiago Macieira --- src/gui/opengl/qopenglframebufferobject.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/gui/opengl/qopenglframebufferobject.cpp b/src/gui/opengl/qopenglframebufferobject.cpp index 1ee90a0827..56e04c09d8 100644 --- a/src/gui/opengl/qopenglframebufferobject.cpp +++ b/src/gui/opengl/qopenglframebufferobject.cpp @@ -1281,11 +1281,11 @@ static inline QImage qt_gl_read_framebuffer_rgba8(const QSize &size, bool includ ? context->hasExtension(QByteArrayLiteral("GL_EXT_read_format_bgra")) : context->hasExtension(QByteArrayLiteral("GL_EXT_bgra")); +#ifndef Q_OS_IOS const char *renderer = reinterpret_cast(funcs->glGetString(GL_RENDERER)); const char *ver = reinterpret_cast(funcs->glGetString(GL_VERSION)); // Blacklist GPU chipsets that have problems with their BGRA support. -#ifndef Q_OS_IOS const bool blackListed = (qstrcmp(renderer, "PowerVR Rogue G6200") == 0 && ::strstr(ver, "1.3") != 0) || (qstrcmp(renderer, "Mali-T760") == 0 -- cgit v1.2.3 From 6e64008e69d2b8f0303808402f36f69514344627 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Fri, 19 Aug 2016 08:49:46 +0200 Subject: QColor: move contents of qcolor_p.cpp into qcolor.cpp The functions defined there are used almost exclusively in qcolor.cpp, so give the compiler the whole picture. Also fixes the non-standard naming of the files: qcolor_p.h should have been qcolor_p_p.h, since it declared functions defined in qcolor_p.cpp. Change-Id: I06e61232a906fd0d98d5adcfe4af5881985367d8 Reviewed-by: Edward Welbourne Reviewed-by: Thiago Macieira --- src/gui/painting/painting.pri | 1 - src/gui/painting/qcolor.cpp | 323 ++++++++++++++++++++++++++++++++++++ src/gui/painting/qcolor_p.cpp | 369 ------------------------------------------ 3 files changed, 323 insertions(+), 370 deletions(-) delete mode 100644 src/gui/painting/qcolor_p.cpp (limited to 'src') diff --git a/src/gui/painting/painting.pri b/src/gui/painting/painting.pri index 00f2375923..c47060a2ad 100644 --- a/src/gui/painting/painting.pri +++ b/src/gui/painting/painting.pri @@ -63,7 +63,6 @@ SOURCES += \ painting/qblittable.cpp \ painting/qbrush.cpp \ painting/qcolor.cpp \ - painting/qcolor_p.cpp \ painting/qcompositionfunctions.cpp \ painting/qcosmeticstroker.cpp \ painting/qcssutil.cpp \ diff --git a/src/gui/painting/qcolor.cpp b/src/gui/painting/qcolor.cpp index 56180af693..650ba0187e 100644 --- a/src/gui/painting/qcolor.cpp +++ b/src/gui/painting/qcolor.cpp @@ -43,12 +43,335 @@ #include "qdatastream.h" #include "qvariant.h" #include "qdebug.h" +#include "private/qtools_p.h" + +#include #include #include QT_BEGIN_NAMESPACE +/*! + \internal + If s[0..1] is a valid hex number, returns its integer value, + otherwise returns -1. + */ +static inline int hex2int(const char *s) +{ + const int hi = QtMiscUtils::fromHex(s[0]); + if (hi < 0) + return -1; + const int lo = QtMiscUtils::fromHex(s[1]); + if (lo < 0) + return -1; + return (hi << 4) | lo; +} + +/*! + \internal + If s is a valid hex digit, returns its integer value, + multiplied by 0x11, otherwise returns -1. + */ +static inline int hex2int(char s) +{ + const int h = QtMiscUtils::fromHex(s); + return h < 0 ? h : (h << 4) | h; +} + +bool qt_get_hex_rgb(const char *name, QRgb *rgb) +{ + if (name[0] != '#') + return false; + name++; + int len = qstrlen(name); + int a, r, g, b; + a = 255; + if (len == 12) { + r = hex2int(name); + g = hex2int(name + 4); + b = hex2int(name + 8); + } else if (len == 9) { + r = hex2int(name); + g = hex2int(name + 3); + b = hex2int(name + 6); + } else if (len == 8) { + a = hex2int(name); + r = hex2int(name + 2); + g = hex2int(name + 4); + b = hex2int(name + 6); + } else if (len == 6) { + r = hex2int(name); + g = hex2int(name + 2); + b = hex2int(name + 4); + } else if (len == 3) { + r = hex2int(name[0]); + g = hex2int(name[1]); + b = hex2int(name[2]); + } else { + r = g = b = -1; + } + if ((uint)r > 255 || (uint)g > 255 || (uint)b > 255 || (uint)a > 255) { + *rgb = 0; + return false; + } + *rgb = qRgba(r, g ,b, a); + return true; +} + +bool qt_get_hex_rgb(const QChar *str, int len, QRgb *rgb) +{ + if (len > 13) + return false; + char tmp[16]; + for (int i = 0; i < len; ++i) + tmp[i] = str[i].toLatin1(); + tmp[len] = 0; + return qt_get_hex_rgb(tmp, rgb); +} + +#ifndef QT_NO_COLORNAMES + +/* + CSS color names = SVG 1.0 color names + transparent (rgba(0,0,0,0)) +*/ + +#ifdef rgb +# undef rgb +#endif +#define rgb(r,g,b) (0xff000000 | (r << 16) | (g << 8) | b) + +static const struct RGBData { + const char name[21]; + uint value; +} rgbTbl[] = { + { "aliceblue", rgb(240, 248, 255) }, + { "antiquewhite", rgb(250, 235, 215) }, + { "aqua", rgb( 0, 255, 255) }, + { "aquamarine", rgb(127, 255, 212) }, + { "azure", rgb(240, 255, 255) }, + { "beige", rgb(245, 245, 220) }, + { "bisque", rgb(255, 228, 196) }, + { "black", rgb( 0, 0, 0) }, + { "blanchedalmond", rgb(255, 235, 205) }, + { "blue", rgb( 0, 0, 255) }, + { "blueviolet", rgb(138, 43, 226) }, + { "brown", rgb(165, 42, 42) }, + { "burlywood", rgb(222, 184, 135) }, + { "cadetblue", rgb( 95, 158, 160) }, + { "chartreuse", rgb(127, 255, 0) }, + { "chocolate", rgb(210, 105, 30) }, + { "coral", rgb(255, 127, 80) }, + { "cornflowerblue", rgb(100, 149, 237) }, + { "cornsilk", rgb(255, 248, 220) }, + { "crimson", rgb(220, 20, 60) }, + { "cyan", rgb( 0, 255, 255) }, + { "darkblue", rgb( 0, 0, 139) }, + { "darkcyan", rgb( 0, 139, 139) }, + { "darkgoldenrod", rgb(184, 134, 11) }, + { "darkgray", rgb(169, 169, 169) }, + { "darkgreen", rgb( 0, 100, 0) }, + { "darkgrey", rgb(169, 169, 169) }, + { "darkkhaki", rgb(189, 183, 107) }, + { "darkmagenta", rgb(139, 0, 139) }, + { "darkolivegreen", rgb( 85, 107, 47) }, + { "darkorange", rgb(255, 140, 0) }, + { "darkorchid", rgb(153, 50, 204) }, + { "darkred", rgb(139, 0, 0) }, + { "darksalmon", rgb(233, 150, 122) }, + { "darkseagreen", rgb(143, 188, 143) }, + { "darkslateblue", rgb( 72, 61, 139) }, + { "darkslategray", rgb( 47, 79, 79) }, + { "darkslategrey", rgb( 47, 79, 79) }, + { "darkturquoise", rgb( 0, 206, 209) }, + { "darkviolet", rgb(148, 0, 211) }, + { "deeppink", rgb(255, 20, 147) }, + { "deepskyblue", rgb( 0, 191, 255) }, + { "dimgray", rgb(105, 105, 105) }, + { "dimgrey", rgb(105, 105, 105) }, + { "dodgerblue", rgb( 30, 144, 255) }, + { "firebrick", rgb(178, 34, 34) }, + { "floralwhite", rgb(255, 250, 240) }, + { "forestgreen", rgb( 34, 139, 34) }, + { "fuchsia", rgb(255, 0, 255) }, + { "gainsboro", rgb(220, 220, 220) }, + { "ghostwhite", rgb(248, 248, 255) }, + { "gold", rgb(255, 215, 0) }, + { "goldenrod", rgb(218, 165, 32) }, + { "gray", rgb(128, 128, 128) }, + { "green", rgb( 0, 128, 0) }, + { "greenyellow", rgb(173, 255, 47) }, + { "grey", rgb(128, 128, 128) }, + { "honeydew", rgb(240, 255, 240) }, + { "hotpink", rgb(255, 105, 180) }, + { "indianred", rgb(205, 92, 92) }, + { "indigo", rgb( 75, 0, 130) }, + { "ivory", rgb(255, 255, 240) }, + { "khaki", rgb(240, 230, 140) }, + { "lavender", rgb(230, 230, 250) }, + { "lavenderblush", rgb(255, 240, 245) }, + { "lawngreen", rgb(124, 252, 0) }, + { "lemonchiffon", rgb(255, 250, 205) }, + { "lightblue", rgb(173, 216, 230) }, + { "lightcoral", rgb(240, 128, 128) }, + { "lightcyan", rgb(224, 255, 255) }, + { "lightgoldenrodyellow", rgb(250, 250, 210) }, + { "lightgray", rgb(211, 211, 211) }, + { "lightgreen", rgb(144, 238, 144) }, + { "lightgrey", rgb(211, 211, 211) }, + { "lightpink", rgb(255, 182, 193) }, + { "lightsalmon", rgb(255, 160, 122) }, + { "lightseagreen", rgb( 32, 178, 170) }, + { "lightskyblue", rgb(135, 206, 250) }, + { "lightslategray", rgb(119, 136, 153) }, + { "lightslategrey", rgb(119, 136, 153) }, + { "lightsteelblue", rgb(176, 196, 222) }, + { "lightyellow", rgb(255, 255, 224) }, + { "lime", rgb( 0, 255, 0) }, + { "limegreen", rgb( 50, 205, 50) }, + { "linen", rgb(250, 240, 230) }, + { "magenta", rgb(255, 0, 255) }, + { "maroon", rgb(128, 0, 0) }, + { "mediumaquamarine", rgb(102, 205, 170) }, + { "mediumblue", rgb( 0, 0, 205) }, + { "mediumorchid", rgb(186, 85, 211) }, + { "mediumpurple", rgb(147, 112, 219) }, + { "mediumseagreen", rgb( 60, 179, 113) }, + { "mediumslateblue", rgb(123, 104, 238) }, + { "mediumspringgreen", rgb( 0, 250, 154) }, + { "mediumturquoise", rgb( 72, 209, 204) }, + { "mediumvioletred", rgb(199, 21, 133) }, + { "midnightblue", rgb( 25, 25, 112) }, + { "mintcream", rgb(245, 255, 250) }, + { "mistyrose", rgb(255, 228, 225) }, + { "moccasin", rgb(255, 228, 181) }, + { "navajowhite", rgb(255, 222, 173) }, + { "navy", rgb( 0, 0, 128) }, + { "oldlace", rgb(253, 245, 230) }, + { "olive", rgb(128, 128, 0) }, + { "olivedrab", rgb(107, 142, 35) }, + { "orange", rgb(255, 165, 0) }, + { "orangered", rgb(255, 69, 0) }, + { "orchid", rgb(218, 112, 214) }, + { "palegoldenrod", rgb(238, 232, 170) }, + { "palegreen", rgb(152, 251, 152) }, + { "paleturquoise", rgb(175, 238, 238) }, + { "palevioletred", rgb(219, 112, 147) }, + { "papayawhip", rgb(255, 239, 213) }, + { "peachpuff", rgb(255, 218, 185) }, + { "peru", rgb(205, 133, 63) }, + { "pink", rgb(255, 192, 203) }, + { "plum", rgb(221, 160, 221) }, + { "powderblue", rgb(176, 224, 230) }, + { "purple", rgb(128, 0, 128) }, + { "red", rgb(255, 0, 0) }, + { "rosybrown", rgb(188, 143, 143) }, + { "royalblue", rgb( 65, 105, 225) }, + { "saddlebrown", rgb(139, 69, 19) }, + { "salmon", rgb(250, 128, 114) }, + { "sandybrown", rgb(244, 164, 96) }, + { "seagreen", rgb( 46, 139, 87) }, + { "seashell", rgb(255, 245, 238) }, + { "sienna", rgb(160, 82, 45) }, + { "silver", rgb(192, 192, 192) }, + { "skyblue", rgb(135, 206, 235) }, + { "slateblue", rgb(106, 90, 205) }, + { "slategray", rgb(112, 128, 144) }, + { "slategrey", rgb(112, 128, 144) }, + { "snow", rgb(255, 250, 250) }, + { "springgreen", rgb( 0, 255, 127) }, + { "steelblue", rgb( 70, 130, 180) }, + { "tan", rgb(210, 180, 140) }, + { "teal", rgb( 0, 128, 128) }, + { "thistle", rgb(216, 191, 216) }, + { "tomato", rgb(255, 99, 71) }, + { "transparent", 0 }, + { "turquoise", rgb( 64, 224, 208) }, + { "violet", rgb(238, 130, 238) }, + { "wheat", rgb(245, 222, 179) }, + { "white", rgb(255, 255, 255) }, + { "whitesmoke", rgb(245, 245, 245) }, + { "yellow", rgb(255, 255, 0) }, + { "yellowgreen", rgb(154, 205, 50) } +}; + +static const int rgbTblSize = sizeof(rgbTbl) / sizeof(RGBData); + +#undef rgb + +#if defined(Q_CC_MSVC) && _MSC_VER < 1600 +inline bool operator<(const RGBData &data1, const RGBData &data2) +{ return qstrcmp(data1.name, data2.name) < 0; } +#endif + +inline bool operator<(const char *name, const RGBData &data) +{ return qstrcmp(name, data.name) < 0; } +inline bool operator<(const RGBData &data, const char *name) +{ return qstrcmp(data.name, name) < 0; } + +static bool get_named_rgb(const char *name_no_space, QRgb *rgb) +{ + const RGBData *r = std::lower_bound(rgbTbl, rgbTbl + rgbTblSize, name_no_space); + if ((r != rgbTbl + rgbTblSize) && !(name_no_space < *r)) { + *rgb = r->value; + return true; + } + return false; +} + +bool qt_get_named_rgb(const char *name, QRgb* rgb) +{ + int len = int(strlen(name)); + if (len > 255) + return false; + char name_no_space[256]; + int pos = 0; + for (int i = 0; i < len; i++) { + if (name[i] != '\t' && name[i] != ' ') + name_no_space[pos++] = QChar::toLower(name[i]); + } + name_no_space[pos] = 0; + + return get_named_rgb(name_no_space, rgb); +} + +bool qt_get_named_rgb(const QChar *name, int len, QRgb *rgb) +{ + if (len > 255) + return false; + char name_no_space[256]; + int pos = 0; + for (int i = 0; i < len; i++) { + if (name[i] != QLatin1Char('\t') && name[i] != QLatin1Char(' ')) + name_no_space[pos++] = name[i].toLower().toLatin1(); + } + name_no_space[pos] = 0; + return get_named_rgb(name_no_space, rgb); +} + +QStringList qt_get_colornames() +{ + int i = 0; + QStringList lst; + lst.reserve(rgbTblSize); + for (i = 0; i < rgbTblSize; i++) + lst << QLatin1String(rgbTbl[i].name); + return lst; +} + +#else + +bool qt_get_named_rgb(const char *, QRgb*) +{ + return false; +} + +QStringList qt_get_colornames() +{ + return QStringList(); +} +#endif // QT_NO_COLORNAMES + /*! \class QColor \brief The QColor class provides colors based on RGB, HSV or CMYK values. diff --git a/src/gui/painting/qcolor_p.cpp b/src/gui/painting/qcolor_p.cpp deleted file mode 100644 index b4ade9dc58..0000000000 --- a/src/gui/painting/qcolor_p.cpp +++ /dev/null @@ -1,369 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the QtGui module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qglobal.h" -#include "qrgb.h" -#include "qstringlist.h" -#include "private/qtools_p.h" - -#include - -QT_BEGIN_NAMESPACE - -/*! - \internal - If s[0..1] is a valid hex number, returns its integer value, - otherwise returns -1. - */ -static inline int hex2int(const char *s) -{ - const int hi = QtMiscUtils::fromHex(s[0]); - if (hi < 0) - return -1; - const int lo = QtMiscUtils::fromHex(s[1]); - if (lo < 0) - return -1; - return (hi << 4) | lo; -} - -/*! - \internal - If s is a valid hex digit, returns its integer value, - multiplied by 0x11, otherwise returns -1. - */ -static inline int hex2int(char s) -{ - const int h = QtMiscUtils::fromHex(s); - return h < 0 ? h : (h << 4) | h; -} - -bool qt_get_hex_rgb(const char *name, QRgb *rgb) -{ - if(name[0] != '#') - return false; - name++; - int len = qstrlen(name); - int a, r, g, b; - a = 255; - if (len == 12) { - r = hex2int(name); - g = hex2int(name + 4); - b = hex2int(name + 8); - } else if (len == 9) { - r = hex2int(name); - g = hex2int(name + 3); - b = hex2int(name + 6); - } else if (len == 8) { - a = hex2int(name); - r = hex2int(name + 2); - g = hex2int(name + 4); - b = hex2int(name + 6); - } else if (len == 6) { - r = hex2int(name); - g = hex2int(name + 2); - b = hex2int(name + 4); - } else if (len == 3) { - r = hex2int(name[0]); - g = hex2int(name[1]); - b = hex2int(name[2]); - } else { - r = g = b = -1; - } - if ((uint)r > 255 || (uint)g > 255 || (uint)b > 255 || (uint)a > 255) { - *rgb = 0; - return false; - } - *rgb = qRgba(r, g ,b, a); - return true; -} - -bool qt_get_hex_rgb(const QChar *str, int len, QRgb *rgb) -{ - if (len > 13) - return false; - char tmp[16]; - for(int i = 0; i < len; ++i) - tmp[i] = str[i].toLatin1(); - tmp[len] = 0; - return qt_get_hex_rgb(tmp, rgb); -} - -#ifndef QT_NO_COLORNAMES - -/* - CSS color names = SVG 1.0 color names + transparent (rgba(0,0,0,0)) -*/ - -#ifdef rgb -# undef rgb -#endif -#define rgb(r,g,b) (0xff000000 | (r << 16) | (g << 8) | b) - -static const struct RGBData { - const char name[21]; - uint value; -} rgbTbl[] = { - { "aliceblue", rgb(240, 248, 255) }, - { "antiquewhite", rgb(250, 235, 215) }, - { "aqua", rgb( 0, 255, 255) }, - { "aquamarine", rgb(127, 255, 212) }, - { "azure", rgb(240, 255, 255) }, - { "beige", rgb(245, 245, 220) }, - { "bisque", rgb(255, 228, 196) }, - { "black", rgb( 0, 0, 0) }, - { "blanchedalmond", rgb(255, 235, 205) }, - { "blue", rgb( 0, 0, 255) }, - { "blueviolet", rgb(138, 43, 226) }, - { "brown", rgb(165, 42, 42) }, - { "burlywood", rgb(222, 184, 135) }, - { "cadetblue", rgb( 95, 158, 160) }, - { "chartreuse", rgb(127, 255, 0) }, - { "chocolate", rgb(210, 105, 30) }, - { "coral", rgb(255, 127, 80) }, - { "cornflowerblue", rgb(100, 149, 237) }, - { "cornsilk", rgb(255, 248, 220) }, - { "crimson", rgb(220, 20, 60) }, - { "cyan", rgb( 0, 255, 255) }, - { "darkblue", rgb( 0, 0, 139) }, - { "darkcyan", rgb( 0, 139, 139) }, - { "darkgoldenrod", rgb(184, 134, 11) }, - { "darkgray", rgb(169, 169, 169) }, - { "darkgreen", rgb( 0, 100, 0) }, - { "darkgrey", rgb(169, 169, 169) }, - { "darkkhaki", rgb(189, 183, 107) }, - { "darkmagenta", rgb(139, 0, 139) }, - { "darkolivegreen", rgb( 85, 107, 47) }, - { "darkorange", rgb(255, 140, 0) }, - { "darkorchid", rgb(153, 50, 204) }, - { "darkred", rgb(139, 0, 0) }, - { "darksalmon", rgb(233, 150, 122) }, - { "darkseagreen", rgb(143, 188, 143) }, - { "darkslateblue", rgb( 72, 61, 139) }, - { "darkslategray", rgb( 47, 79, 79) }, - { "darkslategrey", rgb( 47, 79, 79) }, - { "darkturquoise", rgb( 0, 206, 209) }, - { "darkviolet", rgb(148, 0, 211) }, - { "deeppink", rgb(255, 20, 147) }, - { "deepskyblue", rgb( 0, 191, 255) }, - { "dimgray", rgb(105, 105, 105) }, - { "dimgrey", rgb(105, 105, 105) }, - { "dodgerblue", rgb( 30, 144, 255) }, - { "firebrick", rgb(178, 34, 34) }, - { "floralwhite", rgb(255, 250, 240) }, - { "forestgreen", rgb( 34, 139, 34) }, - { "fuchsia", rgb(255, 0, 255) }, - { "gainsboro", rgb(220, 220, 220) }, - { "ghostwhite", rgb(248, 248, 255) }, - { "gold", rgb(255, 215, 0) }, - { "goldenrod", rgb(218, 165, 32) }, - { "gray", rgb(128, 128, 128) }, - { "green", rgb( 0, 128, 0) }, - { "greenyellow", rgb(173, 255, 47) }, - { "grey", rgb(128, 128, 128) }, - { "honeydew", rgb(240, 255, 240) }, - { "hotpink", rgb(255, 105, 180) }, - { "indianred", rgb(205, 92, 92) }, - { "indigo", rgb( 75, 0, 130) }, - { "ivory", rgb(255, 255, 240) }, - { "khaki", rgb(240, 230, 140) }, - { "lavender", rgb(230, 230, 250) }, - { "lavenderblush", rgb(255, 240, 245) }, - { "lawngreen", rgb(124, 252, 0) }, - { "lemonchiffon", rgb(255, 250, 205) }, - { "lightblue", rgb(173, 216, 230) }, - { "lightcoral", rgb(240, 128, 128) }, - { "lightcyan", rgb(224, 255, 255) }, - { "lightgoldenrodyellow", rgb(250, 250, 210) }, - { "lightgray", rgb(211, 211, 211) }, - { "lightgreen", rgb(144, 238, 144) }, - { "lightgrey", rgb(211, 211, 211) }, - { "lightpink", rgb(255, 182, 193) }, - { "lightsalmon", rgb(255, 160, 122) }, - { "lightseagreen", rgb( 32, 178, 170) }, - { "lightskyblue", rgb(135, 206, 250) }, - { "lightslategray", rgb(119, 136, 153) }, - { "lightslategrey", rgb(119, 136, 153) }, - { "lightsteelblue", rgb(176, 196, 222) }, - { "lightyellow", rgb(255, 255, 224) }, - { "lime", rgb( 0, 255, 0) }, - { "limegreen", rgb( 50, 205, 50) }, - { "linen", rgb(250, 240, 230) }, - { "magenta", rgb(255, 0, 255) }, - { "maroon", rgb(128, 0, 0) }, - { "mediumaquamarine", rgb(102, 205, 170) }, - { "mediumblue", rgb( 0, 0, 205) }, - { "mediumorchid", rgb(186, 85, 211) }, - { "mediumpurple", rgb(147, 112, 219) }, - { "mediumseagreen", rgb( 60, 179, 113) }, - { "mediumslateblue", rgb(123, 104, 238) }, - { "mediumspringgreen", rgb( 0, 250, 154) }, - { "mediumturquoise", rgb( 72, 209, 204) }, - { "mediumvioletred", rgb(199, 21, 133) }, - { "midnightblue", rgb( 25, 25, 112) }, - { "mintcream", rgb(245, 255, 250) }, - { "mistyrose", rgb(255, 228, 225) }, - { "moccasin", rgb(255, 228, 181) }, - { "navajowhite", rgb(255, 222, 173) }, - { "navy", rgb( 0, 0, 128) }, - { "oldlace", rgb(253, 245, 230) }, - { "olive", rgb(128, 128, 0) }, - { "olivedrab", rgb(107, 142, 35) }, - { "orange", rgb(255, 165, 0) }, - { "orangered", rgb(255, 69, 0) }, - { "orchid", rgb(218, 112, 214) }, - { "palegoldenrod", rgb(238, 232, 170) }, - { "palegreen", rgb(152, 251, 152) }, - { "paleturquoise", rgb(175, 238, 238) }, - { "palevioletred", rgb(219, 112, 147) }, - { "papayawhip", rgb(255, 239, 213) }, - { "peachpuff", rgb(255, 218, 185) }, - { "peru", rgb(205, 133, 63) }, - { "pink", rgb(255, 192, 203) }, - { "plum", rgb(221, 160, 221) }, - { "powderblue", rgb(176, 224, 230) }, - { "purple", rgb(128, 0, 128) }, - { "red", rgb(255, 0, 0) }, - { "rosybrown", rgb(188, 143, 143) }, - { "royalblue", rgb( 65, 105, 225) }, - { "saddlebrown", rgb(139, 69, 19) }, - { "salmon", rgb(250, 128, 114) }, - { "sandybrown", rgb(244, 164, 96) }, - { "seagreen", rgb( 46, 139, 87) }, - { "seashell", rgb(255, 245, 238) }, - { "sienna", rgb(160, 82, 45) }, - { "silver", rgb(192, 192, 192) }, - { "skyblue", rgb(135, 206, 235) }, - { "slateblue", rgb(106, 90, 205) }, - { "slategray", rgb(112, 128, 144) }, - { "slategrey", rgb(112, 128, 144) }, - { "snow", rgb(255, 250, 250) }, - { "springgreen", rgb( 0, 255, 127) }, - { "steelblue", rgb( 70, 130, 180) }, - { "tan", rgb(210, 180, 140) }, - { "teal", rgb( 0, 128, 128) }, - { "thistle", rgb(216, 191, 216) }, - { "tomato", rgb(255, 99, 71) }, - { "transparent", 0 }, - { "turquoise", rgb( 64, 224, 208) }, - { "violet", rgb(238, 130, 238) }, - { "wheat", rgb(245, 222, 179) }, - { "white", rgb(255, 255, 255) }, - { "whitesmoke", rgb(245, 245, 245) }, - { "yellow", rgb(255, 255, 0) }, - { "yellowgreen", rgb(154, 205, 50) } -}; - -static const int rgbTblSize = sizeof(rgbTbl) / sizeof(RGBData); - -#undef rgb - -#if defined(Q_CC_MSVC) && _MSC_VER < 1600 -inline bool operator<(const RGBData &data1, const RGBData &data2) -{ return qstrcmp(data1.name, data2.name) < 0; } -#endif - -inline bool operator<(const char *name, const RGBData &data) -{ return qstrcmp(name, data.name) < 0; } -inline bool operator<(const RGBData &data, const char *name) -{ return qstrcmp(data.name, name) < 0; } - -static bool get_named_rgb(const char *name_no_space, QRgb *rgb) -{ - const RGBData *r = std::lower_bound(rgbTbl, rgbTbl + rgbTblSize, name_no_space); - if ((r != rgbTbl + rgbTblSize) && !(name_no_space < *r)) { - *rgb = r->value; - return true; - } - return false; -} - -bool qt_get_named_rgb(const char *name, QRgb* rgb) -{ - int len = int(strlen(name)); - if(len > 255) - return false; - char name_no_space[256]; - int pos = 0; - for(int i = 0; i < len; i++) { - if(name[i] != '\t' && name[i] != ' ') - name_no_space[pos++] = QChar::toLower(name[i]); - } - name_no_space[pos] = 0; - - return get_named_rgb(name_no_space, rgb); -} - -bool qt_get_named_rgb(const QChar *name, int len, QRgb *rgb) -{ - if(len > 255) - return false; - char name_no_space[256]; - int pos = 0; - for(int i = 0; i < len; i++) { - if(name[i] != QLatin1Char('\t') && name[i] != QLatin1Char(' ')) - name_no_space[pos++] = name[i].toLower().toLatin1(); - } - name_no_space[pos] = 0; - return get_named_rgb(name_no_space, rgb); -} - -QStringList qt_get_colornames() -{ - int i = 0; - QStringList lst; - lst.reserve(rgbTblSize); - for (i = 0; i < rgbTblSize; i++) - lst << QLatin1String(rgbTbl[i].name); - return lst; -} - -#else - -bool qt_get_named_rgb(const char *, QRgb*) -{ - return false; -} - -QStringList qt_get_colornames() -{ - return QStringList(); -} -#endif // QT_NO_COLORNAMES - -QT_END_NAMESPACE -- cgit v1.2.3 From bb7e3e2dd71490eeffbfc12b7ee2a9d4c8b70f07 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Sun, 28 Aug 2016 20:17:24 +0200 Subject: QTest: allow to mark QFETCH variables const [ChangeLog][QtTest] QFETCH variables can now be declared const (QFETCH(const T, name)). Change-Id: I7cc1e4568d7082f27f90d8b5abf53ffafb1c48c7 Reviewed-by: Thiago Macieira --- src/testlib/qtestcase.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/testlib/qtestcase.h b/src/testlib/qtestcase.h index 09da575bc9..106fa7abd5 100644 --- a/src/testlib/qtestcase.h +++ b/src/testlib/qtestcase.h @@ -52,11 +52,11 @@ #include +#include #ifndef QT_NO_EXCEPTIONS # include #endif // QT_NO_EXCEPTIONS - QT_BEGIN_NAMESPACE class QRegularExpression; @@ -204,11 +204,11 @@ do {\ return;\ } while (0) -#define QFETCH(type, name)\ - type name = *static_cast(QTest::qData(#name, ::qMetaTypeId())) +#define QFETCH(Type, name)\ + Type name = *static_cast(QTest::qData(#name, ::qMetaTypeId::type>())) -#define QFETCH_GLOBAL(type, name)\ - type name = *static_cast(QTest::qGlobalData(#name, ::qMetaTypeId())) +#define QFETCH_GLOBAL(Type, name)\ + Type name = *static_cast(QTest::qGlobalData(#name, ::qMetaTypeId::type>())) #define QTEST(actual, testElement)\ do {\ -- cgit v1.2.3 From ed9f8a0e9d2984b0b9d6aa31ab3a7209bae1708e Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Thu, 1 Sep 2016 15:17:27 +0200 Subject: bearer plugins: eradicate Java-style iterators and Q_FOREACH This is the simple part of the job, removing Q_FOREACH loops which are obviously safe to be replaced by C++11 range-for. In QNetworkManagerEngine::sessionStateForId(), instead of iterating over QHash::keys(), iterate over the QHash directly (using C++11 range-for, as we're only using the values, not the keys). In QNetworkManagerEngine::connectToId(), simplify the loop body by merging three identical if blocks into one. Saves ~1.7KiB accumulated over the three Linux bearer plugins: connman, generic, nm (optimized GCC 6.1 Linux AMD64 build). Change-Id: Ic66139c25f7e2173f5a919927e269b873334d2c8 Reviewed-by: Lorn Potter --- src/plugins/bearer/connman/qconnmanengine.cpp | 16 +++-- .../bearer/connman/qconnmanservice_linux.cpp | 14 ++-- .../bearer/linux_common/qofonoservice_linux.cpp | 12 ++-- .../networkmanager/qnetworkmanagerengine.cpp | 74 +++++++++------------- src/plugins/bearer/qnetworksession_impl.cpp | 6 +- 5 files changed, 56 insertions(+), 66 deletions(-) (limited to 'src') diff --git a/src/plugins/bearer/connman/qconnmanengine.cpp b/src/plugins/bearer/connman/qconnmanengine.cpp index 51ee51a64a..eabae5a07b 100644 --- a/src/plugins/bearer/connman/qconnmanengine.cpp +++ b/src/plugins/bearer/connman/qconnmanengine.cpp @@ -93,9 +93,9 @@ void QConnmanEngine::initialize() connect(connmanManager,SIGNAL(servicesReady(QStringList)),this,SLOT(servicesReady(QStringList))); connect(connmanManager,SIGNAL(scanFinished(bool)),this,SLOT(finishedScan(bool))); - foreach (const QString &servPath, connmanManager->getServices()) { + const auto servPaths = connmanManager->getServices(); + for (const QString &servPath : servPaths) addServiceConfiguration(servPath); - } Q_EMIT updateCompleted(); } @@ -115,9 +115,8 @@ void QConnmanEngine::changedModem() void QConnmanEngine::servicesReady(const QStringList &list) { QMutexLocker locker(&mutex); - foreach (const QString &servPath, list) { + for (const QString &servPath : list) addServiceConfiguration(servPath); - } Q_EMIT updateCompleted(); } @@ -329,7 +328,8 @@ QNetworkSessionPrivate *QConnmanEngine::createSessionBackend() QNetworkConfigurationPrivatePointer QConnmanEngine::defaultConfiguration() { const QMutexLocker locker(&mutex); - Q_FOREACH (const QString &servPath, connmanManager->getServices()) { + const auto servPaths = connmanManager->getServices(); + for (const QString &servPath : servPaths) { if (connmanServiceInterfaces.contains(servPath)) { if (accessPointConfigurations.contains(servPath)) return accessPointConfigurations.value(servPath); @@ -461,7 +461,8 @@ QNetworkConfiguration::BearerType QConnmanEngine::ofonoTechToBearerType(const QS bool QConnmanEngine::isRoamingAllowed(const QString &context) { - foreach (const QString &dcPath, ofonoContextManager->contexts()) { + const auto dcPaths = ofonoContextManager->contexts(); + for (const QString &dcPath : dcPaths) { if (dcPath.contains(context.section("_",-1))) { return ofonoContextManager->roamingAllowed(); } @@ -557,7 +558,8 @@ bool QConnmanEngine::requiresPolling() const void QConnmanEngine::reEvaluateCellular() { - Q_FOREACH (const QString &servicePath, connmanManager->getServices()) { + const auto servicePaths = connmanManager->getServices(); + for (const QString &servicePath : servicePaths) { if (servicePath.contains("cellular") && accessPointConfigurations.contains(servicePath)) { configurationChange(connmanServiceInterfaces.value(servicePath)); } diff --git a/src/plugins/bearer/connman/qconnmanservice_linux.cpp b/src/plugins/bearer/connman/qconnmanservice_linux.cpp index 7fbbe2cd07..bc89f540fc 100644 --- a/src/plugins/bearer/connman/qconnmanservice_linux.cpp +++ b/src/plugins/bearer/connman/qconnmanservice_linux.cpp @@ -144,10 +144,9 @@ void QConnmanManagerInterface::servicesReply(QDBusPendingCallWatcher *call) qDebug() << serv_reply.error().message(); } else { servicesList.clear(); //connman list changes order - ConnmanMap connmanobj; - Q_FOREACH (connmanobj, serv_reply.value()) { + const ConnmanMapList connmanobjs = serv_reply.value(); + for (const ConnmanMap &connmanobj : connmanobjs) servicesList << connmanobj.objectPath.path(); - } Q_EMIT servicesReady(servicesList); } call->deleteLater(); @@ -181,7 +180,7 @@ void QConnmanManagerInterface::connectNotify(const QMetaMethod &signal) void QConnmanManagerInterface::onServicesChanged(const ConnmanMapList &changed, const QList &removed) { servicesList.clear(); //connman list changes order - Q_FOREACH (const ConnmanMap &connmanobj, changed) { + for (const ConnmanMap &connmanobj : changed) { const QString svcPath(connmanobj.objectPath.path()); servicesList << svcPath; } @@ -225,7 +224,8 @@ QStringList QConnmanManagerInterface::getTechnologies() QDBusPendingReply reply = call(QLatin1String("GetTechnologies")); reply.waitForFinished(); if (!reply.isError()) { - Q_FOREACH (const ConnmanMap &map, reply.value()) { + const ConnmanMapList maps = reply.value(); + for (const ConnmanMap &map : maps) { if (!technologiesMap.contains(map.objectPath.path())) { technologyAdded(map.objectPath, map.propertyMap); } @@ -241,9 +241,9 @@ QStringList QConnmanManagerInterface::getServices() QDBusPendingReply reply = call(QLatin1String("GetServices")); reply.waitForFinished(); if (!reply.isError()) { - Q_FOREACH (const ConnmanMap &map, reply.value()) { + const ConnmanMapList maps = reply.value(); + for (const ConnmanMap &map : maps) servicesList << map.objectPath.path(); - } } } return servicesList; diff --git a/src/plugins/bearer/linux_common/qofonoservice_linux.cpp b/src/plugins/bearer/linux_common/qofonoservice_linux.cpp index b0f5f29f6c..adf7feef2e 100644 --- a/src/plugins/bearer/linux_common/qofonoservice_linux.cpp +++ b/src/plugins/bearer/linux_common/qofonoservice_linux.cpp @@ -103,9 +103,9 @@ QStringList QOfonoManagerInterface::getModems() QDBusPendingReply reply = callWithArgumentList(QDBus::Block, QLatin1String("GetModems"), argumentList); reply.waitForFinished(); if (!reply.isError()) { - foreach (const ObjectPathProperties &modem, reply.value()) { + const auto modems = reply.value(); + for (const ObjectPathProperties &modem : modems) modemList << modem.path.path(); - } } } @@ -114,8 +114,8 @@ QStringList QOfonoManagerInterface::getModems() QString QOfonoManagerInterface::currentModem() { - QStringList modems = getModems(); - foreach (const QString &modem, modems) { + const QStringList modems = getModems(); + for (const QString &modem : modems) { QOfonoModemInterface device(modem); if (device.isPowered() && device.isOnline() && device.interfaces().contains(QStringLiteral("org.ofono.NetworkRegistration"))) @@ -266,9 +266,9 @@ QStringList QOfonoDataConnectionManagerInterface::contexts() QDBusPendingReply reply = call(QLatin1String("GetContexts")); reply.waitForFinished(); if (!reply.isError()) { - foreach (const ObjectPathProperties &context, reply.value()) { + const auto contexts = reply.value(); + for (const ObjectPathProperties &context : contexts) contextList << context.path.path(); - } } } return contextList; diff --git a/src/plugins/bearer/networkmanager/qnetworkmanagerengine.cpp b/src/plugins/bearer/networkmanager/qnetworkmanagerengine.cpp index f02b6befb8..543e66491d 100644 --- a/src/plugins/bearer/networkmanager/qnetworkmanagerengine.cpp +++ b/src/plugins/bearer/networkmanager/qnetworkmanagerengine.cpp @@ -127,7 +127,8 @@ void QNetworkManagerEngine::setupConfigurations() { QMutexLocker locker(&mutex); // Get active connections. - foreach (const QDBusObjectPath &acPath, managerInterface->activeConnections()) { + const auto acPaths = managerInterface->activeConnections(); + for (const QDBusObjectPath &acPath : acPaths) { if (activeConnectionsList.contains(acPath.path())) continue; @@ -144,8 +145,10 @@ void QNetworkManagerEngine::setupConfigurations() connectionInterfaces.insert(activeConnection->connection().path(),device.networkInterface()); } } + // Get connections. - foreach (const QDBusObjectPath &settingsPath, systemSettings->listConnections()) { + const auto settingsPaths = systemSettings->listConnections(); + for (const QDBusObjectPath &settingsPath : settingsPaths) { locker.unlock(); if (!hasIdentifier(settingsPath.path())) newConnection(settingsPath, systemSettings); //add system connection configs @@ -189,21 +192,13 @@ void QNetworkManagerEngine::connectToId(const QString &id) if (isConnectionActive(settingsPath)) return; - QHashIterator i(interfaceDevices); - while (i.hasNext()) { - i.next(); - if (i.value()->deviceType() == DEVICE_TYPE_ETHERNET && - connectionType == DEVICE_TYPE_ETHERNET) { - dbusDevicePath = i.key(); - break; - } else if (i.value()->deviceType() == DEVICE_TYPE_WIFI && - connectionType == DEVICE_TYPE_WIFI) { - dbusDevicePath = i.key(); - break; - } else if (i.value()->deviceType() == DEVICE_TYPE_MODEM && - connectionType == DEVICE_TYPE_MODEM) { - dbusDevicePath = i.key(); - break; + for (auto i = interfaceDevices.cbegin(), end = interfaceDevices.cend(); i != end; ++i) { + const auto type = i.value()->deviceType(); + if (type == DEVICE_TYPE_ETHERNET || type == DEVICE_TYPE_WIFI || type == DEVICE_TYPE_MODEM) { + if (type == connectionType) { + dbusDevicePath = i.key(); + break; + } } } @@ -230,9 +225,7 @@ void QNetworkManagerEngine::disconnectFromId(const QString &id) return; } - QHashIterator i(activeConnectionsList); - while (i.hasNext()) { - i.next(); + for (auto i = activeConnectionsList.cbegin(), end = activeConnectionsList.cend(); i != end; ++i) { if (id == i.value()->connection().path() && accessPointConfigurations.contains(id)) { managerInterface->deactivateConnection(QDBusObjectPath(i.key())); break; @@ -243,11 +236,8 @@ void QNetworkManagerEngine::disconnectFromId(const QString &id) void QNetworkManagerEngine::requestUpdate() { if (managerInterface && managerInterface->wirelessEnabled()) { - QHashIterator i(wirelessDevices); - while (i.hasNext()) { - i.next(); - i.value()->requestScan(); - } + for (auto *wirelessDevice : qAsConst(wirelessDevices)) + wirelessDevice->requestScan(); } QMetaObject::invokeMethod(this, "updateCompleted", Qt::QueuedConnection); } @@ -255,20 +245,17 @@ void QNetworkManagerEngine::requestUpdate() void QNetworkManagerEngine::interfacePropertiesChanged(const QMap &properties) { QMutexLocker locker(&mutex); - QMapIterator i(properties); - while (i.hasNext()) { - i.next(); + for (auto i = properties.cbegin(), end = properties.cend(); i != end; ++i) { if (i.key() == QLatin1String("ActiveConnections")) { // Active connections changed, update configurations. - QList activeConnections = - qdbus_cast >(i.value().value()); + const auto activeConnections = qdbus_cast >(i.value().value()); QStringList identifiers = accessPointConfigurations.keys(); QStringList priorActiveConnections = activeConnectionsList.keys(); - foreach (const QDBusObjectPath &acPath, activeConnections) { + for (const QDBusObjectPath &acPath : activeConnections) { priorActiveConnections.removeOne(acPath.path()); QNetworkManagerConnectionActive *activeConnection = activeConnectionsList.value(acPath.path()); @@ -399,7 +386,8 @@ void QNetworkManagerEngine::wiredCarrierChanged(bool carrier) if (!deviceWired) return; QMutexLocker locker(&mutex); - foreach (const QDBusObjectPath &settingsPath, systemSettings->listConnections()) { + const auto settingsPaths = systemSettings->listConnections(); + for (const QDBusObjectPath &settingsPath : settingsPaths) { for (int i = 0; i < connections.count(); ++i) { QNetworkManagerSettingsConnection *connection = connections.at(i); if (connection->getType() == DEVICE_TYPE_ETHERNET @@ -477,12 +465,9 @@ void QNetworkManagerEngine::newConnection(const QDBusObjectPath &path, cpPriv->state |= QNetworkConfiguration::Active; if (deviceType == DEVICE_TYPE_ETHERNET) { - QHashIterator i(interfaceDevices); - while (i.hasNext()) { - i.next(); - if (i.value()->deviceType() == deviceType) { - QNetworkManagerInterfaceDeviceWired *wiredDevice - = wiredDevices.value(i.value()->path()); + for (const auto *interfaceDevice : interfaceDevices) { + if (interfaceDevice->deviceType() == deviceType) { + auto *wiredDevice = wiredDevices.value(interfaceDevice->path()); if (wiredDevice && wiredDevice->carrier()) { cpPriv->state |= QNetworkConfiguration::Discovered; } @@ -559,7 +544,8 @@ void QNetworkManagerEngine::updateConnection() QNetworkConfigurationPrivate *cpPriv = parseConnection(settingsPath, connection->getSettings()); // Check if connection is active. - foreach (const QDBusObjectPath &acPath, managerInterface->activeConnections()) { + const auto acPaths = managerInterface->activeConnections(); + for (const QDBusObjectPath &acPath : acPaths) { QNetworkManagerConnectionActive activeConnection(acPath.path()); if (activeConnection.connection().path() == settingsPath && @@ -635,7 +621,8 @@ QNetworkConfigurationPrivate *QNetworkManagerEngine::parseConnection(const QStri if (connectionType == QLatin1String("802-3-ethernet")) { cpPriv->bearerType = QNetworkConfiguration::BearerEthernet; - foreach (const QDBusObjectPath &devicePath, managerInterface->getDevices()) { + const auto devicePaths = managerInterface->getDevices(); + for (const QDBusObjectPath &devicePath : devicePaths) { QNetworkManagerInterfaceDevice device(devicePath.path(),this); if (device.deviceType() == DEVICE_TYPE_ETHERNET) { QNetworkManagerInterfaceDeviceWired *wiredDevice = wiredDevices.value(device.path()); @@ -729,9 +716,7 @@ QNetworkSession::State QNetworkManagerEngine::sessionStateForId(const QString &i if (!ptr->isValid) return QNetworkSession::Invalid; - foreach (const QString &acPath, activeConnectionsList.keys()) { - QNetworkManagerConnectionActive *activeConnection = activeConnectionsList.value(acPath); - + for (QNetworkManagerConnectionActive *activeConnection : activeConnectionsList) { const QString identifier = activeConnection->connection().path(); if (id == identifier) { @@ -932,7 +917,8 @@ void QNetworkManagerEngine::ofonoRegistered(const QString &) } ofonoManager = new QOfonoManagerInterface(this); if (ofonoManager && ofonoManager->isValid()) { - Q_FOREACH (const QString &modem, ofonoManager->getModems()) { + const auto modems = ofonoManager->getModems(); + for (const QString &modem : modems) { QOfonoDataConnectionManagerInterface *ofonoContextManager = new QOfonoDataConnectionManagerInterface(modem,this); ofonoContextManagers.insert(modem, ofonoContextManager); diff --git a/src/plugins/bearer/qnetworksession_impl.cpp b/src/plugins/bearer/qnetworksession_impl.cpp index 85942b56f1..5ce51670f7 100644 --- a/src/plugins/bearer/qnetworksession_impl.cpp +++ b/src/plugins/bearer/qnetworksession_impl.cpp @@ -54,7 +54,8 @@ static QBearerEngineImpl *getEngineFromId(const QString &id) { QNetworkConfigurationManagerPrivate *priv = qNetworkConfigurationManagerPrivate(); - foreach (QBearerEngine *engine, priv->engines()) { + const auto engines = priv->engines(); + for (QBearerEngine *engine : engines) { QBearerEngineImpl *engineImpl = qobject_cast(engine); if (engineImpl && engineImpl->hasIdentifier(id)) return engineImpl; @@ -306,7 +307,8 @@ void QNetworkSessionPrivateImpl::updateStateFromServiceNetwork() { QNetworkSession::State oldState = state; - foreach (const QNetworkConfiguration &config, serviceConfig.children()) { + const auto configs = serviceConfig.children(); + for (const QNetworkConfiguration &config : configs) { if ((config.state() & QNetworkConfiguration::Active) != QNetworkConfiguration::Active) continue; -- cgit v1.2.3 From 7f801ed73a3b9e9098fafed64c21e98ae7d73dff Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Tue, 16 Aug 2016 10:01:05 +0200 Subject: tuiotouch: clean up - order includes from most specific to most general - include only what you need - port uses of inefficient QLists to QVector (required adding default ctors to the payload types) - mark types as Q_MOVABLE_TYPE - inline some trivial functions - add explicit to ctors - mark plugin with QT_NO_FOREACH Change-Id: I7ae13141ece22bfdf49be42deb0987d51da2d72b Reviewed-by: Shawn Rutledge Reviewed-by: Robin Burchell --- src/plugins/generic/tuiotouch/qoscbundle.cpp | 23 +++++------------------ src/plugins/generic/tuiotouch/qoscbundle_p.h | 19 +++++++++++++------ src/plugins/generic/tuiotouch/qoscmessage.cpp | 25 +++++-------------------- src/plugins/generic/tuiotouch/qoscmessage_p.h | 18 ++++++++++++++---- src/plugins/generic/tuiotouch/qtuiocursor_p.h | 1 + src/plugins/generic/tuiotouch/qtuiohandler.cpp | 23 +++++++++++++---------- src/plugins/generic/tuiotouch/qtuiotoken_p.h | 1 + src/plugins/generic/tuiotouch/tuiotouch.pro | 1 + 8 files changed, 53 insertions(+), 58 deletions(-) (limited to 'src') diff --git a/src/plugins/generic/tuiotouch/qoscbundle.cpp b/src/plugins/generic/tuiotouch/qoscbundle.cpp index 6ddca9b09d..b84ae39aca 100644 --- a/src/plugins/generic/tuiotouch/qoscbundle.cpp +++ b/src/plugins/generic/tuiotouch/qoscbundle.cpp @@ -38,17 +38,20 @@ ** ****************************************************************************/ +#include "qoscbundle_p.h" +#include "qtuio_p.h" + #include #include #include -#include "qoscbundle_p.h" -#include "qtuio_p.h" QT_BEGIN_NAMESPACE Q_LOGGING_CATEGORY(lcTuioBundle, "qt.qpa.tuio.bundle") +QOscBundle::QOscBundle() {} + // TUIO packets are transmitted using the OSC protocol, located at: // http://opensoundcontrol.org/specification // Snippets of this specification have been pasted into the source as a means of @@ -172,21 +175,5 @@ QOscBundle::QOscBundle(const QByteArray &data) } } - -bool QOscBundle::isValid() const -{ - return m_isValid; -} - -QList QOscBundle::bundles() const -{ - return m_bundles; -} - -QList QOscBundle::messages() const -{ - return m_messages; -} - QT_END_NAMESPACE diff --git a/src/plugins/generic/tuiotouch/qoscbundle_p.h b/src/plugins/generic/tuiotouch/qoscbundle_p.h index e95a202ae7..cb3ec4d251 100644 --- a/src/plugins/generic/tuiotouch/qoscbundle_p.h +++ b/src/plugins/generic/tuiotouch/qoscbundle_p.h @@ -43,25 +43,32 @@ #include "qoscmessage_p.h" +#include + QT_BEGIN_NAMESPACE +class QByteArray; + class QOscBundle { + QOscBundle(); // for QVector, don't use + friend class QVector; public: - QOscBundle(const QByteArray &data); + explicit QOscBundle(const QByteArray &data); - bool isValid() const; - QList bundles() const; - QList messages() const; + bool isValid() const { return m_isValid; } + QVector bundles() const { return m_bundles; } + QVector messages() const { return m_messages; } private: bool m_isValid; bool m_immediate; quint32 m_timeEpoch; quint32 m_timePico; - QList m_bundles; - QList m_messages; + QVector m_bundles; + QVector m_messages; }; +Q_DECLARE_TYPEINFO(QOscBundle, Q_MOVABLE_TYPE); QT_END_NAMESPACE diff --git a/src/plugins/generic/tuiotouch/qoscmessage.cpp b/src/plugins/generic/tuiotouch/qoscmessage.cpp index 6f82cd784b..b2004903bd 100644 --- a/src/plugins/generic/tuiotouch/qoscmessage.cpp +++ b/src/plugins/generic/tuiotouch/qoscmessage.cpp @@ -38,19 +38,19 @@ ** ****************************************************************************/ -#include +#include "qoscmessage_p.h" +#include "qtuio_p.h" + #include #include -#include #include -#include "qoscmessage_p.h" -#include "qtuio_p.h" - QT_BEGIN_NAMESPACE Q_LOGGING_CATEGORY(lcTuioMessage, "qt.qpa.tuio.message") +QOscMessage::QOscMessage() {} + // TUIO packets are transmitted using the OSC protocol, located at: // http://opensoundcontrol.org/specification // Snippets of this specification have been pasted into the source as a means of @@ -125,20 +125,5 @@ QOscMessage::QOscMessage(const QByteArray &data) qCDebug(lcTuioMessage) << "Message with address pattern: " << addressPattern << " arguments: " << arguments; } -bool QOscMessage::isValid() const -{ - return m_isValid; -} - -QByteArray QOscMessage::addressPattern() const -{ - return m_addressPattern; -} - -QList QOscMessage::arguments() const -{ - return m_arguments; -} - QT_END_NAMESPACE diff --git a/src/plugins/generic/tuiotouch/qoscmessage_p.h b/src/plugins/generic/tuiotouch/qoscmessage_p.h index 788a03e504..76d40ceb18 100644 --- a/src/plugins/generic/tuiotouch/qoscmessage_p.h +++ b/src/plugins/generic/tuiotouch/qoscmessage_p.h @@ -41,22 +41,32 @@ #ifndef QOSCMESSAGE_P_H #define QOSCMESSAGE_P_H +#include +#include +#include +#include + + QT_BEGIN_NAMESPACE class QOscMessage { + QOscMessage(); // for QVector, don't use + friend class QVector; public: - QOscMessage(const QByteArray &data); - bool isValid() const; + explicit QOscMessage(const QByteArray &data); + + bool isValid() const { return m_isValid; } - QByteArray addressPattern() const; - QList arguments() const; + QByteArray addressPattern() const { return m_addressPattern; } + QList arguments() const { return m_arguments; } private: bool m_isValid; QByteArray m_addressPattern; QList m_arguments; }; +Q_DECLARE_TYPEINFO(QOscMessage, Q_MOVABLE_TYPE); QT_END_NAMESPACE diff --git a/src/plugins/generic/tuiotouch/qtuiocursor_p.h b/src/plugins/generic/tuiotouch/qtuiocursor_p.h index 2ff762b836..46134e6f3f 100644 --- a/src/plugins/generic/tuiotouch/qtuiocursor_p.h +++ b/src/plugins/generic/tuiotouch/qtuiocursor_p.h @@ -102,6 +102,7 @@ private: float m_acceleration; Qt::TouchPointState m_state; }; +Q_DECLARE_TYPEINFO(QTuioCursor, Q_MOVABLE_TYPE); // Q_PRIMITIVE_TYPE: not possible, m_state is = 1, not 0. QT_END_NAMESPACE diff --git a/src/plugins/generic/tuiotouch/qtuiohandler.cpp b/src/plugins/generic/tuiotouch/qtuiohandler.cpp index 38105fe656..26b88d6d78 100644 --- a/src/plugins/generic/tuiotouch/qtuiohandler.cpp +++ b/src/plugins/generic/tuiotouch/qtuiohandler.cpp @@ -38,19 +38,22 @@ ** ****************************************************************************/ -#include -#include -#include -#include -#include -#include - -#include +#include "qtuiohandler_p.h" #include "qtuiocursor_p.h" #include "qtuiotoken_p.h" -#include "qtuiohandler_p.h" #include "qoscbundle_p.h" +#include "qoscmessage_p.h" + +#include + +#include +#include +#include + +#include +#include +#include QT_BEGIN_NAMESPACE @@ -151,7 +154,7 @@ void QTuioHandler::processPackets() // messages. The FSEQ frame ID is incremented for each delivered bundle, // while redundant bundles can be marked using the frame sequence ID // -1." - QList messages; + QVector messages; QOscBundle bundle(datagram); if (bundle.isValid()) { diff --git a/src/plugins/generic/tuiotouch/qtuiotoken_p.h b/src/plugins/generic/tuiotouch/qtuiotoken_p.h index 5084aeed11..b784190d53 100644 --- a/src/plugins/generic/tuiotouch/qtuiotoken_p.h +++ b/src/plugins/generic/tuiotouch/qtuiotoken_p.h @@ -138,6 +138,7 @@ private: float m_angularAcceleration; Qt::TouchPointState m_state; }; +Q_DECLARE_TYPEINFO(QTuioToken, Q_MOVABLE_TYPE); // Q_PRIMITIVE_TYPE: not possible: m_id, m_classId == -1 QT_END_NAMESPACE diff --git a/src/plugins/generic/tuiotouch/tuiotouch.pro b/src/plugins/generic/tuiotouch/tuiotouch.pro index ad6a1c6876..08f7036c92 100644 --- a/src/plugins/generic/tuiotouch/tuiotouch.pro +++ b/src/plugins/generic/tuiotouch/tuiotouch.pro @@ -21,6 +21,7 @@ HEADERS += \ OTHER_FILES += \ tuiotouch.json +DEFINES += QT_NO_FOREACH PLUGIN_TYPE = generic PLUGIN_EXTENDS = - PLUGIN_CLASS_NAME = QTuioTouchPlugin -- cgit v1.2.3 From 816a6238761810c28a991a959ea61a834de2a2a5 Mon Sep 17 00:00:00 2001 From: Dyami Caliri Date: Tue, 16 Aug 2016 20:52:14 -0700 Subject: uic: generate translate calls with Q_NULLPTR instead of 0 uic should use Q_NULLPTR instead of 0 as the default disambiguation context. Task-number: QTBUG-45291 Change-Id: I889182c7fe1c4be3336f3cd645aa60838863c633 Reviewed-by: Marc Mutz --- src/tools/uic/cpp/cppwriteinitialization.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/tools/uic/cpp/cppwriteinitialization.cpp b/src/tools/uic/cpp/cppwriteinitialization.cpp index 518944d9d7..a59c14faf9 100644 --- a/src/tools/uic/cpp/cppwriteinitialization.cpp +++ b/src/tools/uic/cpp/cppwriteinitialization.cpp @@ -2320,7 +2320,7 @@ QString WriteInitialization::trCall(const QString &str, const QString &commentHi return QLatin1String("QString()"); QString result; - const QString comment = commentHint.isEmpty() ? QString(QLatin1Char('0')) : fixString(commentHint, m_dindent); + const QString comment = commentHint.isEmpty() ? QString(QLatin1String("Q_NULLPTR")) : fixString(commentHint, m_dindent); if (m_option.translateFunction.isEmpty()) { result = QLatin1String("QApplication::translate(\""); -- cgit v1.2.3 From 312d08b290d079f5d72d9afc14a47606ebdde240 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Fri, 26 Aug 2016 10:03:05 +0200 Subject: qstrncpy: don't call strncpy_s with invalid parameters According to https://msdn.microsoft.com/en-us/library/5dae5d43.aspx, strncpy_s' second argument must not be 0: > If strDest or strSource is NULL, *or numberOfElements is 0*, the > invalid parameter handler is invoked. Move the existing check for len > 0 up to protect the strncpy_s call, too. Change-Id: I70d339ea60d4b76f3038b2e4e4756f6590a9bd31 Reviewed-by: Edward Welbourne Reviewed-by: Thiago Macieira --- src/corelib/tools/qbytearray.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/corelib/tools/qbytearray.cpp b/src/corelib/tools/qbytearray.cpp index 00d15fd518..8bae505d76 100644 --- a/src/corelib/tools/qbytearray.cpp +++ b/src/corelib/tools/qbytearray.cpp @@ -208,13 +208,14 @@ char *qstrncpy(char *dst, const char *src, uint len) { if (!src || !dst) return 0; + if (len > 0) { #if defined(_MSC_VER) && _MSC_VER >= 1400 - strncpy_s(dst, len, src, len-1); + strncpy_s(dst, len, src, len - 1); #else - strncpy(dst, src, len); + strncpy(dst, src, len); #endif - if (len > 0) dst[len-1] = '\0'; + } return dst; } -- cgit v1.2.3 From 2a6bea7a55308776a76cef838f307e272f23f406 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Thu, 1 Sep 2016 08:27:57 +0200 Subject: qcompilerdetection.h: retract Q_COMPILER_DEFAULT_MEMBERS for MSVC < 2015 Earlier versions of the compiler cannot default move special member functions, even though we also define Q_COMPILER_RVALUE_REFS for them. Fix by retracting the less-often-used of the two compiler feature defines. Q_COMPILER_DEFAULT_MEMBERS is not used outside QtBase in neither 5.6 nor 5.7 (5.8 is not released at this time, so wasn't considered). The same is true of the dependent macros Q_COMPILER_DEFAULT_DELETE_MEMBERS and Q_DECL_EQ_DEFAULT. In QtBase, the three uses are: 1. in QAtomic*, where the user also requires Q_COMPILER_CONSTEXPR, which is not defined for any MSVC at this time, 2. for QEnableSharedFromThis, which is a class template with an alternative {} implementa- tion of the default constructor, and uncon- ditional user-defined copy special member functions. 3. The test of the corresponding functionality in tst_compiler, which this commit amends. That means that neither of these two only uses of the macro in Qt libraries are affected by the change. The reason we do this change, then, is that in the future, we want to be able to more easily restore move special member functions for classes for which they are suppressed due to user-defined dtors or copy special member functions. Change-Id: I6f88cad66d6b87a758231f16355c3bddae697b86 Reviewed-by: Thiago Macieira --- src/corelib/global/qcompilerdetection.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/corelib/global/qcompilerdetection.h b/src/corelib/global/qcompilerdetection.h index 2d9e0463b7..e324c043af 100644 --- a/src/corelib/global/qcompilerdetection.h +++ b/src/corelib/global/qcompilerdetection.h @@ -887,7 +887,8 @@ # endif /* VC 11 */ # if _MSC_VER >= 1800 /* C++11 features in VC12 = VC2013 */ -# define Q_COMPILER_DEFAULT_MEMBERS +/* Implemented, but can't be used on move special members */ +/* # define Q_COMPILER_DEFAULT_MEMBERS */ # define Q_COMPILER_DELETE_MEMBERS # define Q_COMPILER_DELEGATING_CONSTRUCTORS # define Q_COMPILER_EXPLICIT_CONVERSIONS @@ -905,6 +906,7 @@ # endif /* VC 12 SP 2 RC */ # if _MSC_VER >= 1900 /* C++11 features in VC14 = VC2015 */ +# define Q_COMPILER_DEFAULT_MEMBERS # define Q_COMPILER_ALIGNAS # define Q_COMPILER_ALIGNOF // Partial support, insufficient for Qt -- cgit v1.2.3 From c8cb188dd47d89da18f44a08557ca875baefcba7 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Tue, 23 Aug 2016 16:40:56 +0200 Subject: Ensure the fontdatabase is initialized when requesting fallbacks Otherwise we will return an empty list of fallbacks if no QFontDatabase has been created yet. Task-number: QTBUG-55222 Change-Id: I50508162fad3206e0acf3cc6eb39aefac5c3e197 Reviewed-by: Peter Varga Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/gui/text/qfontdatabase.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/gui/text/qfontdatabase.cpp b/src/gui/text/qfontdatabase.cpp index 0621f2a524..f063541249 100644 --- a/src/gui/text/qfontdatabase.cpp +++ b/src/gui/text/qfontdatabase.cpp @@ -840,9 +840,13 @@ QStringList QPlatformFontDatabase::fallbacksForFamily(const QString &family, QFo return retList; } +static void initializeDb(); + static QStringList fallbacksForFamily(const QString &family, QFont::Style style, QFont::StyleHint styleHint, QChar::Script script) { QFontDatabasePrivate *db = privateDb(); + if (!db->count) + initializeDb(); const FallbacksCacheKey cacheKey = { family, style, styleHint, script }; -- cgit v1.2.3 From 24bd7fd6518985f00e4102c2702ef50a8852b731 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Thu, 1 Sep 2016 14:00:58 +0200 Subject: Fix crash when rendering to grayscale8 images An entry was missing in one of the tables. This patch adds it back in and adds the enum comments used to keep track of whether they all are there and correctly set. Change-Id: Ic6a55a8f81f9c42a3174a2a75c80c3a354f173b7 Reviewed-by: Olivier Goffart (Woboq GmbH) --- src/gui/painting/qdrawhelper.cpp | 65 ++++++++++++++++++++-------------------- 1 file changed, 33 insertions(+), 32 deletions(-) (limited to 'src') diff --git a/src/gui/painting/qdrawhelper.cpp b/src/gui/painting/qdrawhelper.cpp index ac22c7fc00..ee3863ceb8 100644 --- a/src/gui/painting/qdrawhelper.cpp +++ b/src/gui/painting/qdrawhelper.cpp @@ -5384,17 +5384,17 @@ static const ProcessSpans processTextureSpans[NBlendTypes][QImage::NImageFormats blend_src_generic, // ARGB32 blend_transformed_argb, // ARGB32_Premultiplied blend_transformed_rgb565, - blend_src_generic, - blend_src_generic, - blend_src_generic, - blend_src_generic, - blend_src_generic, - blend_src_generic, - blend_src_generic, - blend_src_generic, - blend_src_generic, - blend_src_generic, - blend_src_generic, + blend_src_generic, // ARGB8565_Premultiplied + blend_src_generic, // RGB666 + blend_src_generic, // ARGB6666_Premultiplied + blend_src_generic, // RGB555 + blend_src_generic, // ARGB8555_Premultiplied + blend_src_generic, // RGB888 + blend_src_generic, // RGB444 + blend_src_generic, // ARGB4444_Premultiplied + blend_src_generic, // RGBX8888 + blend_src_generic, // RGBA8888 + blend_src_generic, // RGBA8888_Premultiplied blend_src_generic_rgb64, blend_src_generic_rgb64, blend_src_generic_rgb64, @@ -5412,16 +5412,17 @@ static const ProcessSpans processTextureSpans[NBlendTypes][QImage::NImageFormats blend_src_generic, // ARGB32 blend_transformed_tiled_argb, // ARGB32_Premultiplied blend_transformed_tiled_rgb565, - blend_src_generic, - blend_src_generic, - blend_src_generic, - blend_src_generic, - blend_src_generic, - blend_src_generic, - blend_src_generic, - blend_src_generic, - blend_src_generic, - blend_src_generic, + blend_src_generic, // ARGB8565_Premultiplied + blend_src_generic, // RGB666 + blend_src_generic, // ARGB6666_Premultiplied + blend_src_generic, // RGB555 + blend_src_generic, // ARGB8555_Premultiplied + blend_src_generic, // RGB888 + blend_src_generic, // RGB444 + blend_src_generic, // ARGB4444_Premultiplied + blend_src_generic, // RGBX8888 + blend_src_generic, // RGBA8888 + blend_src_generic, // RGBA8888_Premultiplied blend_src_generic_rgb64, blend_src_generic_rgb64, blend_src_generic_rgb64, @@ -5439,17 +5440,17 @@ static const ProcessSpans processTextureSpans[NBlendTypes][QImage::NImageFormats blend_src_generic, // ARGB32 blend_src_generic, // ARGB32_Premultiplied blend_transformed_bilinear_rgb565, - blend_src_generic, - blend_src_generic, - blend_src_generic, - blend_src_generic, - blend_src_generic, - blend_src_generic, - blend_src_generic, - blend_src_generic, - blend_src_generic, - blend_src_generic, - blend_src_generic, + blend_src_generic, // ARGB8565_Premultiplied + blend_src_generic, // RGB666 + blend_src_generic, // ARGB6666_Premultiplied + blend_src_generic, // RGB555 + blend_src_generic, // ARGB8555_Premultiplied + blend_src_generic, // RGB888 + blend_src_generic, // RGB444 + blend_src_generic, // ARGB4444_Premultiplied + blend_src_generic, // RGBX8888 + blend_src_generic, // RGBA8888 + blend_src_generic, // RGBA8888_Premultiplied blend_src_generic_rgb64, blend_src_generic_rgb64, blend_src_generic_rgb64, -- cgit v1.2.3 From 4eb2feb29c5078cd3eda19e4d2331c54a35843ce Mon Sep 17 00:00:00 2001 From: Jake Petroules Date: Fri, 2 Sep 2016 15:42:52 +0200 Subject: Remove the ability to build simulator/device targets from SUBDIRS projects This is done because a followup patch will cause simulator_and_device builds to no longer use exclusive builds and so this feature could not work, but it is not strictly necessary anyways because users do not need to be able to do this. Done-with: Oswald Buddenhagen Change-Id: If869fbfea776751553c352c2d652edf745a3638d Reviewed-by: Oswald Buddenhagen --- src/src.pro | 8 -------- 1 file changed, 8 deletions(-) (limited to 'src') diff --git a/src/src.pro b/src/src.pro index ec656e483c..96a88a62ac 100644 --- a/src/src.pro +++ b/src/src.pro @@ -5,44 +5,36 @@ src_qtzlib.target = sub-zlib src_tools_bootstrap.subdir = tools/bootstrap src_tools_bootstrap.target = sub-bootstrap -src_tools_bootstrap.CONFIG = host_build src_tools_moc.subdir = tools/moc src_tools_moc.target = sub-moc src_tools_moc.depends = src_tools_bootstrap -src_tools_moc.CONFIG = host_build src_tools_rcc.subdir = tools/rcc src_tools_rcc.target = sub-rcc src_tools_rcc.depends = src_tools_bootstrap -src_tools_rcc.CONFIG = host_build src_tools_qlalr.subdir = tools/qlalr src_tools_qlalr.target = sub-qlalr -src_tools_qlalr.CONFIG = host_build force_bootstrap: src_tools_qlalr.depends = src_tools_bootstrap else: src_tools_qlalr.depends = src_corelib src_tools_uic.subdir = tools/uic src_tools_uic.target = sub-uic -src_tools_uic.CONFIG = host_build force_bootstrap: src_tools_uic.depends = src_tools_bootstrap else: src_tools_uic.depends = src_corelib src_tools_bootstrap_dbus.subdir = tools/bootstrap-dbus src_tools_bootstrap_dbus.target = sub-bootstrap_dbus src_tools_bootstrap_dbus.depends = src_tools_bootstrap -src_tools_bootstrap_dbus.CONFIG = host_build src_tools_qdbusxml2cpp.subdir = tools/qdbusxml2cpp src_tools_qdbusxml2cpp.target = sub-qdbusxml2cpp -src_tools_qdbusxml2cpp.CONFIG = host_build force_bootstrap: src_tools_qdbusxml2cpp.depends = src_tools_bootstrap_dbus else: src_tools_qdbusxml2cpp.depends = src_dbus src_tools_qdbuscpp2xml.subdir = tools/qdbuscpp2xml src_tools_qdbuscpp2xml.target = sub-qdbuscpp2xml -src_tools_qdbuscpp2xml.CONFIG = host_build force_bootstrap: src_tools_qdbuscpp2xml.depends = src_tools_bootstrap_dbus else: src_tools_qdbuscpp2xml.depends = src_dbus -- cgit v1.2.3 From 6dbb16a856ab98830d8deb1741fc2615add340a5 Mon Sep 17 00:00:00 2001 From: Anton Kudryavtsev Date: Fri, 26 Aug 2016 13:26:29 +0300 Subject: Replace QLatin1Literal with QLatin1String QLatin1Literal is just alias of QLatin1String for Qt4 compatibility. So it's style cleanup patch. Change-Id: Ia3b3e5dc3169f13a1ef819d69be576b8a8bfb258 Reviewed-by: Marc Mutz Reviewed-by: Edward Welbourne --- src/gui/image/qiconloader.cpp | 2 +- src/gui/text/qtextimagehandler.cpp | 4 ++-- src/plugins/sqldrivers/psql/qsql_psql.cpp | 4 ++-- src/testlib/qteamcitylogger.cpp | 12 ++++++------ 4 files changed, 11 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/gui/image/qiconloader.cpp b/src/gui/image/qiconloader.cpp index e61a6bb48e..eda9d6f24e 100644 --- a/src/gui/image/qiconloader.cpp +++ b/src/gui/image/qiconloader.cpp @@ -199,7 +199,7 @@ private: QIconCacheGtkReader::QIconCacheGtkReader(const QString &dirName) : m_isValid(false) { - QFileInfo info(dirName + QLatin1Literal("/icon-theme.cache")); + QFileInfo info(dirName + QLatin1String("/icon-theme.cache")); if (!info.exists() || info.lastModified() < QFileInfo(dirName).lastModified()) return; m_file.setFileName(info.absoluteFilePath()); diff --git a/src/gui/text/qtextimagehandler.cpp b/src/gui/text/qtextimagehandler.cpp index 18311ed161..f7117bfe0a 100644 --- a/src/gui/text/qtextimagehandler.cpp +++ b/src/gui/text/qtextimagehandler.cpp @@ -61,10 +61,10 @@ static QString resolveFileName(QString fileName, QUrl *url, qreal targetDevicePi // Also, QFile{Info}::exists works only on filepaths (not urls) if (url->isValid()) { - if (url->scheme() == QLatin1Literal("qrc")) { + if (url->scheme() == QLatin1String("qrc")) { fileName = fileName.right(fileName.length() - 3); } - else if (url->scheme() == QLatin1Literal("file")) { + else if (url->scheme() == QLatin1String("file")) { fileName = url->toLocalFile(); } } diff --git a/src/plugins/sqldrivers/psql/qsql_psql.cpp b/src/plugins/sqldrivers/psql/qsql_psql.cpp index fcf75af298..968b71a27d 100644 --- a/src/plugins/sqldrivers/psql/qsql_psql.cpp +++ b/src/plugins/sqldrivers/psql/qsql_psql.cpp @@ -704,10 +704,10 @@ void QPSQLDriverPrivate::detectBackslashEscape() hasBackslashEscape = true; } else { hasBackslashEscape = false; - PGresult* result = exec(QLatin1Literal("SELECT '\\\\' x")); + PGresult* result = exec(QLatin1String("SELECT '\\\\' x")); int status = PQresultStatus(result); if (status == PGRES_COMMAND_OK || status == PGRES_TUPLES_OK) - if (QString::fromLatin1(PQgetvalue(result, 0, 0)) == QLatin1Literal("\\")) + if (QString::fromLatin1(PQgetvalue(result, 0, 0)) == QLatin1String("\\")) hasBackslashEscape = true; PQclear(result); } diff --git a/src/testlib/qteamcitylogger.cpp b/src/testlib/qteamcitylogger.cpp index 4773ea937f..1d700d8201 100644 --- a/src/testlib/qteamcitylogger.cpp +++ b/src/testlib/qteamcitylogger.cpp @@ -228,22 +228,22 @@ QString QTeamCityLogger::tcEscapedString(const QString &str) const switch (ch.toLatin1()) { case '\n': - formattedString.append(QLatin1Literal("|n")); + formattedString.append(QLatin1String("|n")); break; case '\r': - formattedString.append(QLatin1Literal("|r")); + formattedString.append(QLatin1String("|r")); break; case '|': - formattedString.append(QLatin1Literal("||")); + formattedString.append(QLatin1String("||")); break; case '[': - formattedString.append(QLatin1Literal("|[")); + formattedString.append(QLatin1String("|[")); break; case ']': - formattedString.append(QLatin1Literal("|]")); + formattedString.append(QLatin1String("|]")); break; case '\'': - formattedString.append(QLatin1Literal("|'")); + formattedString.append(QLatin1String("|'")); break; default: formattedString.append(ch); -- cgit v1.2.3 From b94111116f09a6e48741d35cf7abea47af99ef26 Mon Sep 17 00:00:00 2001 From: Peng Wu Date: Mon, 29 Aug 2016 13:47:08 +0300 Subject: Style sheets: detect and apply font set on QHeaderView section Detect and apply style sheets font set when calculating QHeaderView section content size and drawing it. Change-Id: I542cd0d31bbe62f127c509f297eef0a576fec054 Task-number: QTBUG-55597 Reviewed-by: Olivier Goffart (Woboq GmbH) --- src/widgets/styles/qstylesheetstyle.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/widgets/styles/qstylesheetstyle.cpp b/src/widgets/styles/qstylesheetstyle.cpp index 568a4755e4..eae4658bc9 100644 --- a/src/widgets/styles/qstylesheetstyle.cpp +++ b/src/widgets/styles/qstylesheetstyle.cpp @@ -3753,6 +3753,13 @@ void QStyleSheetStyle::drawControl(ControlElement ce, const QStyleOption *opt, Q ParentStyle::drawControl(ce, opt, p, w); return; } + if (subRule.hasFont) { + const QFont oldFont = p->font(); + p->setFont(subRule.font.resolve(p->font())); + baseStyle()->drawControl(ce, opt, p, w); + p->setFont(oldFont); + return; + } } break; case CE_HeaderSection: @@ -4866,13 +4873,14 @@ QSize QStyleSheetStyle::sizeFromContents(ContentsType ct, const QStyleOption *op case CT_HeaderSection: { if (const QStyleOptionHeader *hdr = qstyleoption_cast(opt)) { QRenderRule subRule = renderRule(w, opt, PseudoElement_HeaderViewSection); - if (subRule.hasGeometry() || subRule.hasBox() || !subRule.hasNativeBorder()) { + if (subRule.hasGeometry() || subRule.hasBox() || !subRule.hasNativeBorder() || subRule.hasFont) { sz = subRule.adjustSize(csz); if (!subRule.hasGeometry()) { QSize nativeContentsSize; bool nullIcon = hdr->icon.isNull(); int iconSize = nullIcon ? 0 : pixelMetric(QStyle::PM_SmallIconSize, hdr, w); - QSize txt = hdr->fontMetrics.size(0, hdr->text); + const QSize txt = subRule.hasFont ? QFontMetrics(subRule.font).size(0, hdr->text) + : hdr->fontMetrics.size(0, hdr->text); nativeContentsSize.setHeight(qMax(iconSize, txt.height())); nativeContentsSize.setWidth(iconSize + txt.width()); sz = sz.expandedTo(nativeContentsSize); -- cgit v1.2.3 From cec8cdba4d1b856e17c8743ba8803349d42dc701 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Sun, 4 Sep 2016 09:55:59 +0200 Subject: QTextStream: log the defect that op<< uses Latin 1 The rest of Qt, including the QString constructor, uses UTF-8 to interpret narrow character literals. The fact that QTextStream uses Latin 1 should be considered a defect. We can't fix this in Qt 5, so log it for consideration in Qt 6. Change-Id: I9e96ecd4f6aa4ff0ae08fffd14710fa61673db57 Reviewed-by: Marc Mutz --- src/corelib/io/qtextstream.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/corelib/io/qtextstream.cpp b/src/corelib/io/qtextstream.cpp index b8db23329a..4fdb1505ff 100644 --- a/src/corelib/io/qtextstream.cpp +++ b/src/corelib/io/qtextstream.cpp @@ -2644,6 +2644,7 @@ QTextStream &QTextStream::operator<<(const char *string) { Q_D(QTextStream); CHECK_VALID_STREAM(*this); + // ### Qt6: consider changing to UTF-8 d->putString(QLatin1String(string)); return *this; } -- cgit v1.2.3 From 2997a60e1eaf0efbeb22516ae184fa93f278fec5 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Thu, 6 Nov 2014 12:14:41 +0100 Subject: Do not force the default fontconfig configuration Since 74cade1ee42dbe15d3242b08d5880e08e6294e2e, QFontconfigDatabase has forced a full init to the default configuration breaking applications that set a custom fontconfig. Change-Id: If9ee3e185c42af10c05ae3852d088881da1d4f1a Reviewed-by: Eskil Abrahamsen Blomfeldt --- .../fontdatabases/fontconfig/qfontconfigdatabase.cpp | 8 +++++++- .../fontdatabases/fontconfig/qfontconfigdatabase_p.h | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp b/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp index 02b7e1bd63..5847c601a8 100644 --- a/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp +++ b/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp @@ -504,7 +504,7 @@ static void populateFromPattern(FcPattern *pattern) void QFontconfigDatabase::populateFontDatabase() { - FcInitReinitialize(); + FcInit(); FcFontSet *fonts; { @@ -568,6 +568,12 @@ void QFontconfigDatabase::populateFontDatabase() // QApplication::setFont(font); } +void QFontconfigDatabase::invalidate() +{ + // Clear app fonts. + FcConfigAppFontClear(0); +} + QFontEngineMulti *QFontconfigDatabase::fontEngineMulti(QFontEngine *fontEngine, QChar::Script script) { return new QFontEngineMultiFontConfig(fontEngine, script); diff --git a/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase_p.h b/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase_p.h index 197a442d5b..244558b910 100644 --- a/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase_p.h +++ b/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase_p.h @@ -62,6 +62,7 @@ class QFontconfigDatabase : public QBasicFontDatabase { public: void populateFontDatabase() Q_DECL_OVERRIDE; + void invalidate() Q_DECL_OVERRIDE; QFontEngineMulti *fontEngineMulti(QFontEngine *fontEngine, QChar::Script script) Q_DECL_OVERRIDE; QFontEngine *fontEngine(const QFontDef &fontDef, void *handle) Q_DECL_OVERRIDE; QFontEngine *fontEngine(const QByteArray &fontData, qreal pixelSize, QFont::HintingPreference hintingPreference) Q_DECL_OVERRIDE; -- cgit v1.2.3 From 21b7661a797ecf77fbcad4380e6dcb2ade929a18 Mon Sep 17 00:00:00 2001 From: BogDan Vatra Date: Tue, 23 Aug 2016 22:32:11 +0300 Subject: Parse namespaces only for current file, add Q_NAMESPACE support to qmake Parsing the other files will (re)generate the same metaobject info in two places Change-Id: I8984ed30751a7587de870f55dd427f067d1b2495 Reviewed-by: Olivier Goffart (Woboq GmbH) --- src/tools/moc/moc.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/tools/moc/moc.cpp b/src/tools/moc/moc.cpp index 22207a9030..eda410783c 100644 --- a/src/tools/moc/moc.cpp +++ b/src/tools/moc/moc.cpp @@ -560,7 +560,8 @@ void Moc::parse() until(RBRACE); def.end = index; index = def.begin + 1; - while (inNamespace(&def) && hasNext()) { + const bool parseNamespace = currentFilenames.size() <= 1; + while (parseNamespace && inNamespace(&def) && hasNext()) { switch (next()) { case Q_NAMESPACE_TOKEN: def.hasQNamespace = true; -- cgit v1.2.3 From aa624a768c216366139a694a2e6c33e2abcf42a2 Mon Sep 17 00:00:00 2001 From: Maurice Kalinowski Date: Thu, 1 Sep 2016 11:05:36 +0200 Subject: winrt: Differentiate between windows and winrt While there are similarities, we want to keep control over those tests which affect only one platform. Change-Id: Id1f6eb9954169148d70cea14969f34f21d1e6690 Reviewed-by: Oliver Wolff --- src/testlib/qtestblacklist.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/testlib/qtestblacklist.cpp b/src/testlib/qtestblacklist.cpp index 3fec0ad98a..587930ca73 100644 --- a/src/testlib/qtestblacklist.cpp +++ b/src/testlib/qtestblacklist.cpp @@ -97,7 +97,7 @@ static QSet keywords() #ifdef Q_OS_OSX << "osx" #endif -#ifdef Q_OS_WIN +#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT) << "windows" #endif #ifdef Q_OS_IOS -- cgit v1.2.3 From 25d30ddb3e952ceb5964ce8cd6e8fd8aff3a2c59 Mon Sep 17 00:00:00 2001 From: Maurice Kalinowski Date: Tue, 6 Sep 2016 10:21:22 +0200 Subject: winrt: Fix build without SSL support Task-number: QTBUG-55716 Change-Id: I0c843af7592803362ff2498b102e9264a03b389a Reviewed-by: Oliver Wolff --- src/network/socket/qnativesocketengine_winrt.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/network/socket/qnativesocketengine_winrt.cpp b/src/network/socket/qnativesocketengine_winrt.cpp index 641863b4fd..6b71912838 100644 --- a/src/network/socket/qnativesocketengine_winrt.cpp +++ b/src/network/socket/qnativesocketengine_winrt.cpp @@ -1306,10 +1306,12 @@ HRESULT QNativeSocketEnginePrivate::handleConnectOpFinished(IAsyncAction *action if (socketType != QAbstractSocket::TcpSocket) return S_OK; +#ifndef QT_NO_SSL // Delay the reader so that the SSL socket can upgrade if (sslSocket) QObject::connect(qobject_cast(sslSocket), &QSslSocket::encrypted, q, &QNativeSocketEngine::establishRead); else +#endif q->establishRead(); return S_OK; } -- cgit v1.2.3 From a5915f260ff882f3e5cf09060ffa007856a0a33f Mon Sep 17 00:00:00 2001 From: Oliver Wolff Date: Tue, 6 Sep 2016 13:35:28 +0200 Subject: winrt: Use ComPtrs in input context By doing so we no longer leak the input pane inside the destructor. Additionally the coding style is closer to the rest of the WinRT port. Change-Id: I0d56086719c98585cec8bc3c4bcb2d86c3ea2e79 Reviewed-by: Maurice Kalinowski --- src/plugins/platforms/winrt/qwinrtinputcontext.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/plugins/platforms/winrt/qwinrtinputcontext.cpp b/src/plugins/platforms/winrt/qwinrtinputcontext.cpp index 3f476556ee..065ed28cc0 100644 --- a/src/plugins/platforms/winrt/qwinrtinputcontext.cpp +++ b/src/plugins/platforms/winrt/qwinrtinputcontext.cpp @@ -59,7 +59,7 @@ QT_BEGIN_NAMESPACE Q_LOGGING_CATEGORY(lcQpaInputMethods, "qt.qpa.input.methods") -inline QRectF getInputPaneRect(IInputPane *pane, qreal scaleFactor) +inline QRectF getInputPaneRect(ComPtr pane, qreal scaleFactor) { Rect rect; pane->get_OccludedRect(&rect); @@ -85,16 +85,15 @@ QWinRTInputContext::QWinRTInputContext(QWinRTScreen *screen) { qCDebug(lcQpaInputMethods) << __FUNCTION__ << screen; - IInputPaneStatics *statics; + ComPtr statics; if (FAILED(GetActivationFactory(HString::MakeReference(RuntimeClass_Windows_UI_ViewManagement_InputPane).Get(), &statics))) { qWarning("failed to retrieve input pane statics."); return; } - IInputPane *inputPane; + ComPtr inputPane; statics->GetForCurrentView(&inputPane); - statics->Release(); if (inputPane) { EventRegistrationToken showToken, hideToken; inputPane->add_Showing(Callback( -- cgit v1.2.3 From f104e43a72380f66f8c517b90326a9209612106d Mon Sep 17 00:00:00 2001 From: Oliver Wolff Date: Thu, 1 Sep 2016 14:06:10 +0200 Subject: winrt: Make sure that cursor is visible when virtual keyboard is shown We have to check whether the cursor is covered by the virtual keyboard when it is shown. If that is the case and the keyboard is snapped to the bottom of the screen the whole content is moved up to ensure the cursors's visibility. WinRT's input context had to be moved from the XAML to the GUI thread as the signal/slot connection does not work otherwise. Signals from QInputMethod were emitted but not handled in QWinRTInputContext as it ran on another thread which did not spin an event loop. Task-number: QTBUG-50291 Change-Id: Id89e970dc194c25ad07ceab14d9fea51bd7388b2 Reviewed-by: Maurice Kalinowski --- src/plugins/platforms/winrt/qwinrtinputcontext.cpp | 22 ++++++++--- src/plugins/platforms/winrt/qwinrtinputcontext.h | 4 ++ src/plugins/platforms/winrt/qwinrtintegration.cpp | 2 +- src/plugins/platforms/winrt/qwinrtscreen.cpp | 43 ++++++++++++++++++++++ src/plugins/platforms/winrt/qwinrtscreen.h | 4 ++ 5 files changed, 69 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/plugins/platforms/winrt/qwinrtinputcontext.cpp b/src/plugins/platforms/winrt/qwinrtinputcontext.cpp index 065ed28cc0..968c47f2c2 100644 --- a/src/plugins/platforms/winrt/qwinrtinputcontext.cpp +++ b/src/plugins/platforms/winrt/qwinrtinputcontext.cpp @@ -39,6 +39,7 @@ #include "qwinrtinputcontext.h" #include "qwinrtscreen.h" +#include #include #include @@ -95,17 +96,22 @@ QWinRTInputContext::QWinRTInputContext(QWinRTScreen *screen) ComPtr inputPane; statics->GetForCurrentView(&inputPane); if (inputPane) { - EventRegistrationToken showToken, hideToken; - inputPane->add_Showing(Callback( - this, &QWinRTInputContext::onShowing).Get(), &showToken); - inputPane->add_Hiding(Callback( - this, &QWinRTInputContext::onHiding).Get(), &hideToken); + QEventDispatcherWinRT::runOnXamlThread([this, inputPane]() { + EventRegistrationToken showToken, hideToken; + inputPane->add_Showing(Callback( + this, &QWinRTInputContext::onShowing).Get(), &showToken); + inputPane->add_Hiding(Callback( + this, &QWinRTInputContext::onHiding).Get(), &hideToken); + return S_OK; + }); m_keyboardRect = getInputPaneRect(inputPane, m_screen->scaleFactor()); m_isInputPanelVisible = !m_keyboardRect.isEmpty(); } else { qWarning("failed to retrieve InputPane."); } + connect(QGuiApplication::inputMethod(), &QInputMethod::cursorRectangleChanged, + this, &QWinRTInputContext::updateScreenCursorRect); } QRectF QWinRTInputContext::keyboardRect() const @@ -118,6 +124,11 @@ bool QWinRTInputContext::isInputPanelVisible() const return m_isInputPanelVisible; } +void QWinRTInputContext::updateScreenCursorRect() +{ + m_screen->setCursorRect(QGuiApplication::inputMethod()->cursorRectangle()); +} + HRESULT QWinRTInputContext::onShowing(IInputPane *pane, IInputPaneVisibilityEventArgs *) { qCDebug(lcQpaInputMethods) << __FUNCTION__ << pane; @@ -140,6 +151,7 @@ HRESULT QWinRTInputContext::handleVisibilityChange(IInputPane *pane) const QRectF keyboardRect = getInputPaneRect(pane, m_screen->scaleFactor()); if (m_keyboardRect != keyboardRect) { m_keyboardRect = keyboardRect; + m_screen->setKeyboardRect(m_keyboardRect); emitKeyboardRectChanged(); } return S_OK; diff --git a/src/plugins/platforms/winrt/qwinrtinputcontext.h b/src/plugins/platforms/winrt/qwinrtinputcontext.h index 5e416bb99f..9d5c4187e2 100644 --- a/src/plugins/platforms/winrt/qwinrtinputcontext.h +++ b/src/plugins/platforms/winrt/qwinrtinputcontext.h @@ -79,6 +79,9 @@ public: void hideInputPanel(); #endif +private slots: + void updateScreenCursorRect(); + private: HRESULT onShowing(ABI::Windows::UI::ViewManagement::IInputPane *, ABI::Windows::UI::ViewManagement::IInputPaneVisibilityEventArgs *); @@ -89,6 +92,7 @@ private: QWinRTScreen *m_screen; QRectF m_keyboardRect; + QRectF m_cursorRect; bool m_isInputPanelVisible; }; diff --git a/src/plugins/platforms/winrt/qwinrtintegration.cpp b/src/plugins/platforms/winrt/qwinrtintegration.cpp index 42b7f7e909..32edf2b1a2 100644 --- a/src/plugins/platforms/winrt/qwinrtintegration.cpp +++ b/src/plugins/platforms/winrt/qwinrtintegration.cpp @@ -197,9 +197,9 @@ QWinRTIntegration::QWinRTIntegration() : d_ptr(new QWinRTIntegrationPrivate) QEventDispatcherWinRT::runOnXamlThread([d]() { d->mainScreen = new QWinRTScreen; - d->inputContext.reset(new QWinRTInputContext(d->mainScreen)); return S_OK; }); + d->inputContext.reset(new QWinRTInputContext(d->mainScreen)); screenAdded(d->mainScreen); d->platformServices = new QWinRTServices; diff --git a/src/plugins/platforms/winrt/qwinrtscreen.cpp b/src/plugins/platforms/winrt/qwinrtscreen.cpp index ad32c046df..4574439b1a 100644 --- a/src/plugins/platforms/winrt/qwinrtscreen.cpp +++ b/src/plugins/platforms/winrt/qwinrtscreen.cpp @@ -753,6 +753,49 @@ void QWinRTScreen::initialize() onVisibilityChanged(nullptr, nullptr); } +void QWinRTScreen::setCursorRect(const QRectF &cursorRect) +{ + mCursorRect = cursorRect; +} + +void QWinRTScreen::setKeyboardRect(const QRectF &keyboardRect) +{ + Q_D(QWinRTScreen); + QRectF visibleRectF; + HRESULT hr; + Rect windowSize; + + hr = d->coreWindow->get_Bounds(&windowSize); + if (FAILED(hr)) { + qErrnoWarning(hr, "Failed to get window bounds"); + return; + } + d->logicalRect = QRectF(windowSize.X, windowSize.Y, windowSize.Width, windowSize.Height); +#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PHONE_APP) + Rect visibleRect; + hr = d->view2->get_VisibleBounds(&visibleRect); + if (FAILED(hr)) { + qErrnoWarning(hr, "Failed to get window visible bounds"); + return; + } + visibleRectF = QRectF(visibleRect.X, visibleRect.Y, visibleRect.Width, visibleRect.Height); +#else + visibleRectF = d->logicalRect; +#endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PHONE_APP) + // if keyboard is snapped to the bottom of the screen and would cover the cursor the content is + // moved up to make it visible + if (keyboardRect.intersects(mCursorRect) + && qFuzzyCompare(geometry().height(), keyboardRect.y() + keyboardRect.height())) { + visibleRectF.moveTop(visibleRectF.top() - keyboardRect.height() / d->scaleFactor); + } + d->visibleRect = visibleRectF; + + qCDebug(lcQpaWindows) << __FUNCTION__ << d->visibleRect; + QWindowSystemInterface::handleScreenGeometryChange(screen(), geometry(), availableGeometry()); + QPlatformScreen::resizeMaximizedWindows(); + handleExpose(); +} + QWindow *QWinRTScreen::topWindow() const { Q_D(const QWinRTScreen); diff --git a/src/plugins/platforms/winrt/qwinrtscreen.h b/src/plugins/platforms/winrt/qwinrtscreen.h index 0e753b748b..1862c0afcf 100644 --- a/src/plugins/platforms/winrt/qwinrtscreen.h +++ b/src/plugins/platforms/winrt/qwinrtscreen.h @@ -116,6 +116,9 @@ public: void initialize(); + void setCursorRect(const QRectF &cursorRect); + void setKeyboardRect(const QRectF &keyboardRect); + private: void handleExpose(); @@ -140,6 +143,7 @@ private: #endif QScopedPointer d_ptr; + QRectF mCursorRect; Q_DECLARE_PRIVATE(QWinRTScreen) }; -- cgit v1.2.3 From fe82f50a65ecafee9ea7d0e48cf3bb2106414001 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Thu, 1 Sep 2016 16:54:43 +0200 Subject: Minor improvements to bilinear filtering Duplicates the improved bounds check for rotated sampling in RGB64, and improves two prologs by using that x1 == x2 during the prolog. Change-Id: I562c5bee12e314c36d3b304f2f72d7635d22d7d4 Reviewed-by: Olivier Goffart (Woboq GmbH) --- src/gui/painting/qdrawhelper.cpp | 52 +++++++++++++++++++++------------------- 1 file changed, 28 insertions(+), 24 deletions(-) (limited to 'src') diff --git a/src/gui/painting/qdrawhelper.cpp b/src/gui/painting/qdrawhelper.cpp index 7e06a71a22..491f2d80da 100644 --- a/src/gui/painting/qdrawhelper.cpp +++ b/src/gui/painting/qdrawhelper.cpp @@ -2176,7 +2176,8 @@ static const uint * QT_FASTCALL fetchTransformedBilinearARGB32PM(uint *buffer, c fetchTransformedBilinear_pixelBounds(image_height, image_y1, image_y2, y1, y2); const uint *s1 = (const uint *)data->texture.scanLine(y1); const uint *s2 = (const uint *)data->texture.scanLine(y2); - int disty = ((fy & 0x0000ffff) + 0x0800) >> 12; + const int disty8 = (fy & 0x0000ffff) >> 8; + const int disty4 = (disty8 + 0x08) >> 4; if (blendType != BlendTransformedBilinearTiled) { #define BILINEAR_DOWNSCALE_BOUNDS_PROLOG \ @@ -2188,12 +2189,9 @@ static const uint * QT_FASTCALL fetchTransformedBilinearARGB32PM(uint *buffer, c fetchTransformedBilinear_pixelBounds(image_width, image_x1, image_x2, x1, x2); \ if (x1 != x2) \ break; \ - uint tl = s1[x1]; \ - uint tr = s1[x2]; \ - uint bl = s2[x1]; \ - uint br = s2[x2]; \ - int distx = ((fx & 0x0000ffff) + 0x0800) >> 12; \ - *b = interpolate_4_pixels_16(tl, tr, bl, br, distx, disty); \ + uint top = s1[x1]; \ + uint bot = s2[x1]; \ + *b = INTERPOLATE_PIXEL_256(top, 256 - disty8, bot, disty8); \ fx += fdx; \ ++b; \ } \ @@ -2209,7 +2207,7 @@ static const uint * QT_FASTCALL fetchTransformedBilinearARGB32PM(uint *buffer, c const __m128i colorMask = _mm_set1_epi32(0x00ff00ff); const __m128i v_256 = _mm_set1_epi16(256); - const __m128i v_disty = _mm_set1_epi16(disty); + const __m128i v_disty = _mm_set1_epi16(disty4); const __m128i v_fdx = _mm_set1_epi32(fdx*4); const __m128i v_fx_r = _mm_set1_epi32(0x8); __m128i v_fx = _mm_setr_epi32(fx, fx + fdx, fx + fdx + fdx, fx + fdx + fdx + fdx); @@ -2241,7 +2239,7 @@ static const uint * QT_FASTCALL fetchTransformedBilinearARGB32PM(uint *buffer, c const int16x8_t colorMask = vdupq_n_s16(0x00ff); const int16x8_t invColorMask = vmvnq_s16(colorMask); const int16x8_t v_256 = vdupq_n_s16(256); - const int16x8_t v_disty = vdupq_n_s16(disty); + const int16x8_t v_disty = vdupq_n_s16(disty4); const int16x8_t v_disty_ = vshlq_n_s16(v_disty, 4); int32x4_t v_fdx = vdupq_n_s32(fdx*4); @@ -2298,8 +2296,14 @@ static const uint * QT_FASTCALL fetchTransformedBilinearARGB32PM(uint *buffer, c uint tr = s1[x2]; uint bl = s2[x1]; uint br = s2[x2]; - int distx = ((fx & 0x0000ffff) + 0x0800) >> 12; - *b = interpolate_4_pixels_16(tl, tr, bl, br, distx, disty); +#if defined(__SSE2__) || defined(__ARM_NEON__) + // The optimized interpolate_4_pixels are faster than interpolate_4_pixels_16. + int distx8 = (fx & 0x0000ffff) >> 8; + *b = interpolate_4_pixels(tl, tr, bl, br, distx8, disty8); +#else + int distx4 = ((fx & 0x0000ffff) + 0x0800) >> 12; + *b = interpolate_4_pixels_16(tl, tr, bl, br, distx4, disty4); +#endif fx += fdx; ++b; } @@ -2980,10 +2984,8 @@ static const QRgba64 *QT_FASTCALL fetchTransformedBilinear64(QRgba64 *buffer, co fetchTransformedBilinear_pixelBounds(image_width, image_x1, image_x2, x1, x2); if (x1 != x2) break; - sbuf1[i * 2 + 0] = ((const uint*)s1)[x1]; - sbuf1[i * 2 + 1] = ((const uint*)s1)[x2]; - sbuf2[i * 2 + 0] = ((const uint*)s2)[x1]; - sbuf2[i * 2 + 1] = ((const uint*)s2)[x2]; + sbuf1[i * 2 + 0] = sbuf1[i * 2 + 1] = ((const uint*)s1)[x1]; + sbuf2[i * 2 + 0] = sbuf2[i * 2 + 1] = ((const uint*)s2)[x1]; fx += fdx; } int fastLen; @@ -3102,6 +3104,16 @@ static const QRgba64 *QT_FASTCALL fetchTransformedBilinear64(QRgba64 *buffer, co fx += fdx; fy += fdy; } + int fastLen = len; + if (fdx > 0) + fastLen = qMin(fastLen, int((qint64(image_x2) * fixed_scale - fx) / fdx)); + else if (fdx < 0) + fastLen = qMin(fastLen, int((qint64(image_x1) * fixed_scale - fx) / fdx)); + if (fdy > 0) + fastLen = qMin(fastLen, int((qint64(image_y2) * fixed_scale - fy) / fdy)); + else if (fdy < 0) + fastLen = qMin(fastLen, int((qint64(image_y1) * fixed_scale - fy) / fdy)); + fastLen -= 3; const __m128i v_fdx = _mm_set1_epi32(fdx*4); const __m128i v_fdy = _mm_set1_epi32(fdy*4); @@ -3111,15 +3123,7 @@ static const QRgba64 *QT_FASTCALL fetchTransformedBilinear64(QRgba64 *buffer, co const uchar *s1 = data->texture.imageData; const uchar *s2 = s1 + bytesPerLine; const __m128i vbpl = _mm_shufflelo_epi16(_mm_cvtsi32_si128(bytesPerLine/4), _MM_SHUFFLE(0, 0, 0, 0)); - for (; i < len-3; i+=4) { - if (fdx > 0 && (short)_mm_extract_epi16(v_fx, 7) >= image_x2) - break; - if (fdx < 0 && (short)_mm_extract_epi16(v_fx, 7) < image_x1) - break; - if (fdy > 0 && (short)_mm_extract_epi16(v_fy, 7) >= image_y2) - break; - if (fdy < 0 && (short)_mm_extract_epi16(v_fy, 7) < image_y1) - break; + for (; i < fastLen; i += 4) { const __m128i vy = _mm_packs_epi32(_mm_srai_epi32(v_fy, 16), _mm_setzero_si128()); __m128i voffset = _mm_unpacklo_epi16(_mm_mullo_epi16(vy, vbpl), _mm_mulhi_epu16(vy, vbpl)); voffset = _mm_add_epi32(voffset, _mm_srli_epi32(v_fx, 16)); -- cgit v1.2.3 From 806b45e7c76f6825e32fde10824beb62eecc40ab Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Tue, 6 Sep 2016 11:03:33 +0200 Subject: Make blendPixel function general Moves the blendPixel function from the SSSE3 file and use it more generally, also adds a const_alpha version. Change-Id: Ia29d1ab3879a845d5b65e0610b7836507e33c7ed Reviewed-by: Thiago Macieira --- src/gui/painting/qdrawhelper_p.h | 16 ++++++++++++++++ src/gui/painting/qdrawhelper_ssse3.cpp | 9 --------- src/gui/painting/qdrawingprimitive_sse2_p.h | 24 ++++-------------------- 3 files changed, 20 insertions(+), 29 deletions(-) (limited to 'src') diff --git a/src/gui/painting/qdrawhelper_p.h b/src/gui/painting/qdrawhelper_p.h index 664117a730..45a3174734 100644 --- a/src/gui/painting/qdrawhelper_p.h +++ b/src/gui/painting/qdrawhelper_p.h @@ -636,6 +636,22 @@ static Q_ALWAYS_INLINE uint BYTE_MUL(uint x, uint a) { } #endif +static Q_ALWAYS_INLINE void blend_pixel(quint32 &dst, const quint32 src) +{ + if (src >= 0xff000000) + dst = src; + else if (src != 0) + dst = src + BYTE_MUL(dst, qAlpha(~src)); +} + +static Q_ALWAYS_INLINE void blend_pixel(quint32 &dst, const quint32 src, const int const_alpha) +{ + if (src != 0) { + const quint32 s = BYTE_MUL(src, const_alpha); + dst = s + BYTE_MUL(dst, qAlpha(~s)); + } +} + #if defined(__SSE2__) static Q_ALWAYS_INLINE uint interpolate_4_pixels_sse2(__m128i vt, __m128i vb, uint distx, uint disty) { diff --git a/src/gui/painting/qdrawhelper_ssse3.cpp b/src/gui/painting/qdrawhelper_ssse3.cpp index 7cd3e9ca1b..2026a4e656 100644 --- a/src/gui/painting/qdrawhelper_ssse3.cpp +++ b/src/gui/painting/qdrawhelper_ssse3.cpp @@ -45,15 +45,6 @@ QT_BEGIN_NAMESPACE -inline static void blend_pixel(quint32 &dst, const quint32 src) -{ - if (src >= 0xff000000) - dst = src; - else if (src != 0) - dst = src + BYTE_MUL(dst, qAlpha(~src)); -} - - /* The instruction palignr uses direct arguments, so we have to generate the code fo the different shift (4, 8, 12). Checking the alignment inside the loop is unfortunatelly way too slow. */ diff --git a/src/gui/painting/qdrawingprimitive_sse2_p.h b/src/gui/painting/qdrawingprimitive_sse2_p.h index 8799dff92a..7affc63b32 100644 --- a/src/gui/painting/qdrawingprimitive_sse2_p.h +++ b/src/gui/painting/qdrawingprimitive_sse2_p.h @@ -171,11 +171,7 @@ QT_BEGIN_NAMESPACE \ /* First, get dst aligned. */ \ ALIGNMENT_PROLOGUE_16BYTES(dst, x, length) { \ - uint s = src[x]; \ - if (s >= 0xff000000) \ - dst[x] = s; \ - else if (s != 0) \ - dst[x] = s + BYTE_MUL(dst[x], qAlpha(~s)); \ + blend_pixel(dst[x], src[x]); \ } \ \ for (; x < length-3; x += 4) { \ @@ -183,11 +179,7 @@ QT_BEGIN_NAMESPACE BLEND_SOURCE_OVER_ARGB32_SSE2_helper(dst, srcVector, nullVector, half, one, colorMask, alphaMask) \ } \ for (; x < length; ++x) { \ - uint s = src[x]; \ - if (s >= 0xff000000) \ - dst[x] = s; \ - else if (s != 0) \ - dst[x] = s + BYTE_MUL(dst[x], qAlpha(~s)); \ + blend_pixel(dst[x], src[x]); \ } \ } @@ -207,11 +199,7 @@ QT_BEGIN_NAMESPACE int x = 0; \ \ ALIGNMENT_PROLOGUE_16BYTES(dst, x, length) { \ - quint32 s = src[x]; \ - if (s != 0) { \ - s = BYTE_MUL(s, const_alpha); \ - dst[x] = s + BYTE_MUL(dst[x], qAlpha(~s)); \ - } \ + blend_pixel(dst[x], src[x], const_alpha); \ } \ \ for (; x < length-3; x += 4) { \ @@ -232,11 +220,7 @@ QT_BEGIN_NAMESPACE } \ } \ for (; x < length; ++x) { \ - quint32 s = src[x]; \ - if (s != 0) { \ - s = BYTE_MUL(s, const_alpha); \ - dst[x] = s + BYTE_MUL(dst[x], qAlpha(~s)); \ - } \ + blend_pixel(dst[x], src[x], const_alpha); \ } \ } -- cgit v1.2.3 From 6549bd383d64881ba6b9dad8529fd904d17da100 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Wed, 31 Aug 2016 13:00:13 +0200 Subject: Optimize Q_FOREACH for rvalues Add an rvalue overload of the QForeachContainer ctor to allow moving rvalues into the internal container copy. This does not change the semantics of Q_FOREACH. It is just an optimization. Port to NSDMI to minimize code duplication. Costs ~1.3KiB across all libraries and plugins in a QtBase Linux build (optimized GCC 6.1 AMD64). Change-Id: I180e35ecab68aa1d37773b3546787481bb5515a2 Reviewed-by: Olivier Goffart (Woboq GmbH) --- src/corelib/global/qglobal.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index e6d65b0f99..c463a392b7 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -943,10 +943,11 @@ template class QForeachContainer { QForeachContainer &operator=(const QForeachContainer &) Q_DECL_EQ_DELETE; public: - inline QForeachContainer(const T& t) : c(t), i(c.begin()), e(c.end()), control(1) { } + QForeachContainer(const T &t) : c(t) {} + QForeachContainer(T &&t) : c(std::move(t)) {} const T c; - typename T::const_iterator i, e; - int control; + typename T::const_iterator i = c.begin(), e = c.end(); + int control = 1; }; // Explanation of the control word: -- cgit v1.2.3 From 137e690ac76b6db59592f9a8f0b55e445d6f5ab1 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Thu, 8 Sep 2016 11:31:46 +0200 Subject: Turn the available sql drivers into public features This is required to do the modularization of those features properly. Change-Id: I384aff20274e795aa70483980f0ef25309328800 Reviewed-by: Oswald Buddenhagen --- src/plugins/sqldrivers/sqldrivers.pro | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/plugins/sqldrivers/sqldrivers.pro b/src/plugins/sqldrivers/sqldrivers.pro index 37dbd2394e..afd2008826 100644 --- a/src/plugins/sqldrivers/sqldrivers.pro +++ b/src/plugins/sqldrivers/sqldrivers.pro @@ -1,11 +1,11 @@ TEMPLATE = subdirs -contains(sql-drivers, psql) : SUBDIRS += psql -contains(sql-drivers, mysql) : SUBDIRS += mysql -contains(sql-drivers, odbc) : SUBDIRS += odbc -contains(sql-drivers, tds) : SUBDIRS += tds -contains(sql-drivers, oci) : SUBDIRS += oci -contains(sql-drivers, db2) : SUBDIRS += db2 -contains(sql-drivers, sqlite) : SUBDIRS += sqlite -contains(sql-drivers, sqlite2) : SUBDIRS += sqlite2 -contains(sql-drivers, ibase) : SUBDIRS += ibase +qtConfig(sql-psql) : SUBDIRS += psql +qtConfig(sql-mysql) : SUBDIRS += mysql +qtConfig(sql-odbc) : SUBDIRS += odbc +qtConfig(sql-tds) : SUBDIRS += tds +qtConfig(sql-oci) : SUBDIRS += oci +qtConfig(sql-db2) : SUBDIRS += db2 +qtConfig(sql-sqlite) : SUBDIRS += sqlite +qtConfig(sql-sqlite2) : SUBDIRS += sqlite2 +qtConfig(sql-ibase) : SUBDIRS += ibase -- cgit v1.2.3 From 7373929d6831358c3d0c1556bd94da9310c1cb92 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Mon, 5 Sep 2016 15:47:26 +0200 Subject: Fix missing GL function protos with newer GLES headers A recent ANGLE update added GL_GLEXT_PROTOTYPES for gl2.h. That was a good first step, but we need this for gl3.h and gl31.h as well, because once one upgrades to a newer EGL/GLES capable build of Mesa, the same problem will surface. Change-Id: I138ae32e3461dc87bf789aa641359ae46c0ec170 Reviewed-by: Oliver Wolff --- src/gui/opengl/qopengl.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/gui/opengl/qopengl.h b/src/gui/opengl/qopengl.h index e2408d0047..c7a3e79666 100644 --- a/src/gui/opengl/qopengl.h +++ b/src/gui/opengl/qopengl.h @@ -95,14 +95,15 @@ typedef void* GLeglImageOES; // applications cannot target ES 3. Therefore QOpenGLFunctions and // friends do everything dynamically and never rely on these macros. +# ifndef GL_GLEXT_PROTOTYPES +# define GL_GLEXT_PROTOTYPES +# endif + # if defined(QT_OPENGL_ES_3_1) # include # elif defined(QT_OPENGL_ES_3) # include # else -# ifndef GL_GLEXT_PROTOTYPES -# define GL_GLEXT_PROTOTYPES -# endif # include #endif -- cgit v1.2.3 From e9b51781d0dd8badda301da61b08735c256313ca Mon Sep 17 00:00:00 2001 From: Maurice Kalinowski Date: Mon, 22 Aug 2016 12:04:59 +0200 Subject: winrt: Fix display of tooltips This touches multiple areas. First adding a tooltip to the window list should not automatically invoke focussing and hence handleWindowActivated should not be invoked. This is the same approach as on the windows qpa. The winrt qpa supports multiple (non-fullscreen) windows since a while. However, pointerUpdated still acted on the top level window, which caused problems resolving the real target of a mouse event. In this case the tooltip received all events, while the application window should get them. Hence identify the target window via the system coordinates. Task-number: QTBUG-50733 Change-Id: Iea1f4cd7406e6cde85ab3fc83f018b871fc30824 Reviewed-by: Oliver Wolff --- src/plugins/platforms/winrt/qwinrtscreen.cpp | 40 +++++++++++++++++++++------- src/plugins/platforms/winrt/qwinrtscreen.h | 1 + 2 files changed, 31 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/plugins/platforms/winrt/qwinrtscreen.cpp b/src/plugins/platforms/winrt/qwinrtscreen.cpp index 4574439b1a..9236de58a1 100644 --- a/src/plugins/platforms/winrt/qwinrtscreen.cpp +++ b/src/plugins/platforms/winrt/qwinrtscreen.cpp @@ -802,6 +802,17 @@ QWindow *QWinRTScreen::topWindow() const return d->visibleWindows.isEmpty() ? 0 : d->visibleWindows.first(); } +QWindow *QWinRTScreen::windowAt(const QPoint &pos) +{ + Q_D(const QWinRTScreen); + for (auto w : qAsConst(d->visibleWindows)) { + if (w->geometry().contains(pos)) + return w; + } + qCDebug(lcQpaWindows) << __FUNCTION__ << ": No window found at:" << pos; + return nullptr; +} + void QWinRTScreen::addWindow(QWindow *window) { Q_D(QWinRTScreen); @@ -810,8 +821,12 @@ void QWinRTScreen::addWindow(QWindow *window) return; d->visibleWindows.prepend(window); - updateWindowTitle(window->title()); - QWindowSystemInterface::handleWindowActivated(window, Qt::OtherFocusReason); + const Qt::WindowType type = window->type(); + if (type != Qt::Popup && type != Qt::ToolTip && type != Qt::Tool) { + updateWindowTitle(window->title()); + QWindowSystemInterface::handleWindowActivated(window, Qt::OtherFocusReason); + } + handleExpose(); QWindowSystemInterface::flushWindowSystemEvents(); @@ -828,7 +843,9 @@ void QWinRTScreen::removeWindow(QWindow *window) const bool wasTopWindow = window == topWindow(); if (!d->visibleWindows.removeAll(window)) return; - if (wasTopWindow) + + const Qt::WindowType type = window->type(); + if (wasTopWindow && type != Qt::Popup && type != Qt::ToolTip && type != Qt::Tool) QWindowSystemInterface::handleWindowActivated(Q_NULLPTR, Qt::OtherFocusReason); handleExpose(); QWindowSystemInterface::flushWindowSystemEvents(); @@ -1044,9 +1061,12 @@ HRESULT QWinRTScreen::onPointerUpdated(ICoreWindow *, IPointerEventArgs *args) pointerPoint->get_Position(&point); QPointF pos(point.X * d->scaleFactor, point.Y * d->scaleFactor); QPointF localPos = pos; - if (topWindow()) { - const QPointF globalPosDelta = pos - pos.toPoint(); - localPos = topWindow()->mapFromGlobal(pos.toPoint()) + globalPosDelta; + + const QPoint posPoint = pos.toPoint(); + QWindow *targetWindow = windowAt(posPoint); + if (targetWindow) { + const QPointF globalPosDelta = pos - posPoint; + localPos = targetWindow->mapFromGlobal(posPoint) + globalPosDelta; } VirtualKeyModifiers modifiers; @@ -1081,7 +1101,7 @@ HRESULT QWinRTScreen::onPointerUpdated(ICoreWindow *, IPointerEventArgs *args) boolean isHorizontal; properties->get_IsHorizontalMouseWheel(&isHorizontal); QPoint angleDelta(isHorizontal ? delta : 0, isHorizontal ? 0 : delta); - QWindowSystemInterface::handleWheelEvent(topWindow(), localPos, pos, QPoint(), angleDelta, mods); + QWindowSystemInterface::handleWheelEvent(targetWindow, localPos, pos, QPoint(), angleDelta, mods); break; } @@ -1107,7 +1127,7 @@ HRESULT QWinRTScreen::onPointerUpdated(ICoreWindow *, IPointerEventArgs *args) if (isPressed) buttons |= Qt::XButton2; - QWindowSystemInterface::handleMouseEvent(topWindow(), localPos, pos, buttons, mods); + QWindowSystemInterface::handleMouseEvent(targetWindow, localPos, pos, buttons, mods); break; } @@ -1159,7 +1179,7 @@ HRESULT QWinRTScreen::onPointerUpdated(ICoreWindow *, IPointerEventArgs *args) it.value().normalPosition = QPointF(point.X/d->logicalRect.width(), point.Y/d->logicalRect.height()); it.value().pressure = pressure; - QWindowSystemInterface::handleTouchEvent(topWindow(), d->touchDevice, d->touchPoints.values(), mods); + QWindowSystemInterface::handleTouchEvent(targetWindow, d->touchDevice, d->touchPoints.values(), mods); // Fall-through for pen to generate tablet event if (pointerDeviceType != PointerDeviceType_Pen) @@ -1178,7 +1198,7 @@ HRESULT QWinRTScreen::onPointerUpdated(ICoreWindow *, IPointerEventArgs *args) float rotation; properties->get_Twist(&rotation); - QWindowSystemInterface::handleTabletEvent(topWindow(), isPressed, pos, pos, 0, + QWindowSystemInterface::handleTabletEvent(targetWindow, isPressed, pos, pos, 0, pointerType, pressure, xTilt, yTilt, 0, rotation, 0, id, mods); diff --git a/src/plugins/platforms/winrt/qwinrtscreen.h b/src/plugins/platforms/winrt/qwinrtscreen.h index 1862c0afcf..e489e208d5 100644 --- a/src/plugins/platforms/winrt/qwinrtscreen.h +++ b/src/plugins/platforms/winrt/qwinrtscreen.h @@ -104,6 +104,7 @@ public: Qt::ScreenOrientation orientation() const Q_DECL_OVERRIDE; QWindow *topWindow() const; + QWindow *windowAt(const QPoint &pos); void addWindow(QWindow *window); void removeWindow(QWindow *window); void raise(QWindow *window); -- cgit v1.2.3 From 13d20e47870deac5ecd0f06d8b4a78b82f655654 Mon Sep 17 00:00:00 2001 From: Maurice Kalinowski Date: Wed, 7 Sep 2016 13:47:26 +0200 Subject: winrt: Report system languages for QLocale::uiLanguages dc3e7e45ebe447c139868cc161b484eac478194d introduced locales from a packaging perspective, providing the information available from the package manifest. However, developers are rather interested in the available and preferred system languages to update user interfaces. Task-number: QTBUG-55672 Change-Id: I740d4f9c9ca21a8cbd437d3b232470897c569d34 Reviewed-by: Jens Bache-Wiig Reviewed-by: Oliver Wolff --- src/corelib/tools/qlocale_win.cpp | 44 +++++++-------------------------------- 1 file changed, 8 insertions(+), 36 deletions(-) (limited to 'src') diff --git a/src/corelib/tools/qlocale_win.cpp b/src/corelib/tools/qlocale_win.cpp index 42ac888e47..b5f97b5fe8 100644 --- a/src/corelib/tools/qlocale_win.cpp +++ b/src/corelib/tools/qlocale_win.cpp @@ -57,7 +57,7 @@ #include #include #include -#include +#include #endif // Q_OS_WINRT QT_BEGIN_NAMESPACE @@ -70,6 +70,7 @@ static QString winIso3116CtryName(LCID id = LOCALE_USER_DEFAULT); using namespace Microsoft::WRL; using namespace Microsoft::WRL::Wrappers; using namespace ABI::Windows::Foundation; +using namespace ABI::Windows::System::UserProfile; static QByteArray getWinLocaleName(LPWSTR id = LOCALE_NAME_USER_DEFAULT); static const char *winLangCodeToIsoName(int code); @@ -624,16 +625,17 @@ QVariant QSystemLocalePrivate::uiLanguages() return result; #else // !Q_OS_WINRT QStringList result; - ComPtr appLanguagesStatics; - if (FAILED(GetActivationFactory(HString::MakeReference(RuntimeClass_Windows_Globalization_ApplicationLanguages).Get(), &appLanguagesStatics))) { + + ComPtr preferences; + HRESULT hr = GetActivationFactory(HString::MakeReference(RuntimeClass_Windows_System_UserProfile_GlobalizationPreferences).Get(), &preferences); + if (FAILED(hr)) { qWarning("Could not obtain ApplicationLanguagesStatic"); return QStringList(); } ComPtr > languageList; - // Languages is a ranked list of "long names" (e.g. en-US) of preferred languages, which matches - // languages from the manifest with languages from the user's system. - HRESULT hr = appLanguagesStatics->get_Languages(&languageList); + // Languages is a ranked list of "long names" (e.g. en-US) of preferred languages + hr = preferences->get_Languages(&languageList); Q_ASSERT_SUCCEEDED(hr); unsigned int size; hr = languageList->get_Size(&size); @@ -648,36 +650,6 @@ QVariant QSystemLocalePrivate::uiLanguages() result << QString::fromWCharArray(rawString, length); } - // ManifestLanguages covers all languages given in the manifest and uses short names (like "en"). - hr = appLanguagesStatics->get_ManifestLanguages(&languageList); - Q_ASSERT_SUCCEEDED(hr); - hr = languageList->get_Size(&size); - Q_ASSERT_SUCCEEDED(hr); - for (unsigned int i = 0; i < size; ++i) { - HString language; - hr = languageList->GetAt(i, language.GetAddressOf()); - Q_ASSERT_SUCCEEDED(hr); - UINT32 length; - PCWSTR rawString = language.GetRawBuffer(&length); - const QString qLanguage = QString::fromWCharArray(rawString, length); - bool found = false; - // Since ApplicationLanguages:::Languages uses long names, we compare the "pre-dash" part of - // the language and filter it out, if it is already covered by a more specialized form. - for (const QString &lang : qAsConst(result)) { - int dashIndex = lang.indexOf('-'); - // There will not be any long name after the first short name was found, so we can stop. - if (dashIndex == -1) - break; - - if (lang.leftRef(dashIndex) == qLanguage) { - found = true; - break; - } - } - if (!found) - result << qLanguage; - } - return result; #endif // Q_OS_WINRT } -- cgit v1.2.3 From 8cedf59a6815bf6457879822c0429f4becf85567 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Tue, 6 Sep 2016 12:30:33 +0200 Subject: Fix Linux build without XINPUT2 XcbConnection::TabletData only exist if XCB_USE_XINPUT2 is defined and QT_NO_TABLETEVENT is not. Change-Id: I94f4558714b105f2ce98b9b4a7462e7a8eb628e3 Reviewed-by: Shawn Rutledge --- src/plugins/platforms/xcb/qxcbconnection.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/plugins/platforms/xcb/qxcbconnection.h b/src/plugins/platforms/xcb/qxcbconnection.h index dca32af9b1..6ad8a36460 100644 --- a/src/plugins/platforms/xcb/qxcbconnection.h +++ b/src/plugins/platforms/xcb/qxcbconnection.h @@ -686,8 +686,12 @@ private: friend class QXcbEventReader; }; +#ifdef XCB_USE_XINPUT2 +#ifndef QT_NO_TABLETEVENT Q_DECLARE_TYPEINFO(QXcbConnection::TabletData::ValuatorClassInfo, Q_PRIMITIVE_TYPE); Q_DECLARE_TYPEINFO(QXcbConnection::TabletData, Q_MOVABLE_TYPE); +#endif +#endif #define DISPLAY_FROM_XCB(object) ((Display *)(object->connection()->xlib_display())) #define CREATE_VISUALINFO_FROM_DEFAULT_VISUALID(object) ((XVisualInfo *)(object->connection()->createVisualInfoForDefaultVisualId())) -- cgit v1.2.3 From fc098de70a5dda5f45ebe238a43f24f674426f3d Mon Sep 17 00:00:00 2001 From: Alexander Volkov Date: Wed, 24 Aug 2016 18:13:42 +0300 Subject: xcb: Remove unused NoFontHinting hint It is unused since 0f7bc885aa7ae8cc3c448cc751aba4eba8c1c8b8 (Turn off font hinting when active highdpi scaling). Change-Id: I901407bedf24ae301acbe6afa94bc0a4cadb0620 Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/plugins/platforms/xcb/qxcbnativeinterface.cpp | 4 ---- src/plugins/platforms/xcb/qxcbnativeinterface.h | 1 - src/plugins/platforms/xcb/qxcbscreen.cpp | 1 - src/plugins/platforms/xcb/qxcbscreen.h | 2 -- 4 files changed, 8 deletions(-) (limited to 'src') diff --git a/src/plugins/platforms/xcb/qxcbnativeinterface.cpp b/src/plugins/platforms/xcb/qxcbnativeinterface.cpp index a3e8da7df8..189ec53050 100644 --- a/src/plugins/platforms/xcb/qxcbnativeinterface.cpp +++ b/src/plugins/platforms/xcb/qxcbnativeinterface.cpp @@ -85,7 +85,6 @@ static int resourceType(const QByteArray &key) QByteArrayLiteral("gettimestamp"), QByteArrayLiteral("x11screen"), QByteArrayLiteral("rootwindow"), QByteArrayLiteral("subpixeltype"), QByteArrayLiteral("antialiasingenabled"), - QByteArrayLiteral("nofonthinting"), QByteArrayLiteral("atspibus"), QByteArrayLiteral("compositingenabled") }; @@ -242,9 +241,6 @@ void *QXcbNativeInterface::nativeResourceForScreen(const QByteArray &resourceStr case GetTimestamp: result = getTimestamp(xcbScreen); break; - case NoFontHinting: - result = xcbScreen->noFontHinting() ? this : 0; //qboolptr... - break; case RootWindow: result = reinterpret_cast(xcbScreen->root()); break; diff --git a/src/plugins/platforms/xcb/qxcbnativeinterface.h b/src/plugins/platforms/xcb/qxcbnativeinterface.h index ba19cd869c..8728b6e937 100644 --- a/src/plugins/platforms/xcb/qxcbnativeinterface.h +++ b/src/plugins/platforms/xcb/qxcbnativeinterface.h @@ -73,7 +73,6 @@ public: RootWindow, ScreenSubpixelType, ScreenAntialiasingEnabled, - NoFontHinting, AtspiBus, CompositingEnabled }; diff --git a/src/plugins/platforms/xcb/qxcbscreen.cpp b/src/plugins/platforms/xcb/qxcbscreen.cpp index dc6846b20b..e4c92c5206 100644 --- a/src/plugins/platforms/xcb/qxcbscreen.cpp +++ b/src/plugins/platforms/xcb/qxcbscreen.cpp @@ -188,7 +188,6 @@ QXcbScreen::QXcbScreen(QXcbConnection *connection, QXcbVirtualDesktop *virtualDe , m_forcedDpi(-1) , m_pixelDensity(1) , m_hintStyle(QFontEngine::HintStyle(-1)) - , m_noFontHinting(false) , m_subpixelType(QFontEngine::SubpixelAntialiasingType(-1)) , m_antialiasingEnabled(-1) { diff --git a/src/plugins/platforms/xcb/qxcbscreen.h b/src/plugins/platforms/xcb/qxcbscreen.h index 8716af29b5..0d32c3d624 100644 --- a/src/plugins/platforms/xcb/qxcbscreen.h +++ b/src/plugins/platforms/xcb/qxcbscreen.h @@ -172,7 +172,6 @@ public: void readXResources(); QFontEngine::HintStyle hintStyle() const { return m_hintStyle; } - bool noFontHinting() const { return m_noFontHinting; } QFontEngine::SubpixelAntialiasingType subpixelType() const { return m_subpixelType; } int antialiasingEnabled() const { return m_antialiasingEnabled; } @@ -208,7 +207,6 @@ private: int m_forcedDpi; int m_pixelDensity; QFontEngine::HintStyle m_hintStyle; - bool m_noFontHinting; QFontEngine::SubpixelAntialiasingType m_subpixelType; int m_antialiasingEnabled; }; -- cgit v1.2.3 From 2d3c73fcfe7a93cb46190e8e82410fe93145dbe0 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Fri, 9 Sep 2016 09:50:08 +0200 Subject: Modularize configure.json/.pri Move the different parts of configure.json/.pri into the libraries where they belong. Gui is not yet fully modularized, and contains many things related to the different QPA plugins. Done-with: Oswald Buddenhagen Change-Id: I6659bb29354ed1f36b95b8c69e7fce58f642053f Reviewed-by: Lars Knoll --- src/3rdparty/freetype/freetype.pro | 2 + src/3rdparty/pcre_dependency.pri | 6 +- src/angle/src/common/common.pri | 1 + .../src/compiler/preprocessor/preprocessor.pro | 1 + src/angle/src/compiler/translator.pro | 1 + src/corelib/configure.json | 434 ++++++++++ src/corelib/global/qglobal.h | 2 +- src/corelib/global/qglobal_p.h | 1 + src/gui/configure.json | 905 +++++++++++++++++++++ src/gui/configure.pri | 67 ++ src/gui/kernel/qtguiglobal.h | 1 + src/gui/kernel/qtguiglobal_p.h | 1 + src/network/configure.json | 216 +++++ src/network/configure.pri | 12 + src/network/kernel/qtnetworkglobal.h | 1 + src/network/kernel/qtnetworkglobal_p.h | 1 + src/network/ssl/qsslcertificate.cpp | 2 +- src/platformsupport/fbconvenience/qfbvthandler_p.h | 1 + .../input/evdevtouch/qevdevtouchhandler_p.h | 1 + src/plugins/bearer/bearer.pro | 1 + src/plugins/generic/generic.pro | 1 + src/plugins/imageformats/imageformats.pro | 1 + .../platforminputcontexts.pro | 1 + .../eglfs/deviceintegration/deviceintegration.pro | 1 + src/plugins/platforms/platforms.pro | 1 + .../xcb/gl_integrations/gl_integrations.pro | 1 + src/plugins/platforms/xcb/qxcbconnection.h | 1 + src/plugins/platforms/xcb/xcb.pro | 1 + src/plugins/platformthemes/platformthemes.pro | 3 +- src/plugins/printsupport/printsupport.pro | 2 +- src/plugins/sqldrivers/sqldrivers.pro | 1 + src/printsupport/configure.json | 42 + src/printsupport/kernel/qtprintsupportglobal.h | 1 + src/sql/configure.json | 201 +++++ src/sql/configure.pri | 89 ++ src/src.pro | 4 + src/widgets/configure.json | 97 +++ src/widgets/configure.pri | 8 + src/widgets/kernel/qtwidgetsglobal.h | 1 + src/widgets/kernel/qtwidgetsglobal_p.h | 1 + src/widgets/styles/styles.pri | 2 + 41 files changed, 2110 insertions(+), 7 deletions(-) create mode 100644 src/corelib/configure.json create mode 100644 src/gui/configure.json create mode 100644 src/gui/configure.pri create mode 100644 src/network/configure.json create mode 100644 src/network/configure.pri create mode 100644 src/printsupport/configure.json create mode 100644 src/sql/configure.json create mode 100644 src/sql/configure.pri create mode 100644 src/widgets/configure.json create mode 100644 src/widgets/configure.pri (limited to 'src') diff --git a/src/3rdparty/freetype/freetype.pro b/src/3rdparty/freetype/freetype.pro index 41ca469576..1e12dadc5d 100644 --- a/src/3rdparty/freetype/freetype.pro +++ b/src/3rdparty/freetype/freetype.pro @@ -68,6 +68,8 @@ DEFINES += FT2_BUILD_LIBRARY DEFINES += FT_CONFIG_OPTION_SYSTEM_ZLIB include(../zlib_dependency.pri) +QT_FOR_CONFIG += gui-private +include(../../gui/qtgui-config.pri) DEFINES += FT_CONFIG_OPTION_USE_PNG include($$PWD/../png_dependency.pri) diff --git a/src/3rdparty/pcre_dependency.pri b/src/3rdparty/pcre_dependency.pri index fa7df4df0e..f1355eabe6 100644 --- a/src/3rdparty/pcre_dependency.pri +++ b/src/3rdparty/pcre_dependency.pri @@ -1,7 +1,7 @@ -pcre { +qtConfig(system-pcre) { + QMAKE_USE_PRIVATE += pcre +} else { win32: DEFINES += PCRE_STATIC INCLUDEPATH += $$PWD/pcre LIBS_PRIVATE += -L$$QT_BUILD_TREE/lib -lqtpcre$$qtPlatformTargetSuffix() -} else { - QMAKE_USE_PRIVATE += pcre } diff --git a/src/angle/src/common/common.pri b/src/angle/src/common/common.pri index c948e27dc3..e9351b2c42 100644 --- a/src/angle/src/common/common.pri +++ b/src/angle/src/common/common.pri @@ -1,4 +1,5 @@ # static builds should still link ANGLE dynamically when dynamic GL is enabled +include(../../../gui/qtgui-config.pri) static:qtConfig(dynamicgl) { CONFIG -= static CONFIG += shared diff --git a/src/angle/src/compiler/preprocessor/preprocessor.pro b/src/angle/src/compiler/preprocessor/preprocessor.pro index f9170b3bee..c13cf7ba8d 100644 --- a/src/angle/src/compiler/preprocessor/preprocessor.pro +++ b/src/angle/src/compiler/preprocessor/preprocessor.pro @@ -1,4 +1,5 @@ CONFIG += static +include(../../../../gui/qtgui-config.pri) qtConfig(dynamicgl): CONFIG += not_installed include(../../config.pri) diff --git a/src/angle/src/compiler/translator.pro b/src/angle/src/compiler/translator.pro index cee13d06bb..4c0a05e45c 100644 --- a/src/angle/src/compiler/translator.pro +++ b/src/angle/src/compiler/translator.pro @@ -1,4 +1,5 @@ CONFIG += static +include(../../../gui/qtgui-config.pri) qtConfig(dynamicgl): CONFIG += not_installed include(../config.pri) diff --git a/src/corelib/configure.json b/src/corelib/configure.json new file mode 100644 index 0000000000..4cccab9f5d --- /dev/null +++ b/src/corelib/configure.json @@ -0,0 +1,434 @@ +{ + "module": "core", + "testDir": "../../config.tests", + + "commandline": { + "options": { + "doubleconversion": { "type": "enum", "values": [ "no", "qt", "system" ] }, + "eventfd": "boolean", + "glib": "boolean", + "iconv": { "type": "enum", "values": [ "no", "yes", "posix", "sun", "gnu" ] }, + "icu": "boolean", + "inotify": "boolean", + "journald": "boolean", + "pcre": { "type": "enum", "values": [ "qt", "system" ] }, + "posix-ipc": { "type": "boolean", "name": "ipc_posix" }, + "pps": { "type": "boolean", "name": "qqnx_pps" }, + "slog2": "boolean", + "syslog": "boolean" + } + }, + + "libraries": { + "doubleconversion": { + "description": "DoubleConversion", + "test": "unix/doubleconversion", + "sources": [ + "-ldouble-conversion" + ] + }, + "glib": { + "description": "GLib", + "test": "unix/glib", + "sources": [ + { "type": "pkgConfig", "args": "glib-2.0 gthread-2.0" } + ] + }, + "gnu_iconv": { + "description": "GNU libiconv", + "export": "iconv", + "test": "unix/gnu-libiconv", + "sources": [ + "-liconv" + ] + }, + "icu": { + "description": "ICU", + "export": "", + "test": "unix/icu", + "sources": [ + { + "builds": { + "debug": "-lsicuind -lsicuucd -lsicudtd", + "release": "-lsicuin -lsicuuc -lsicudt" + }, + "condition": "config.win32 && !features.shared" + }, + { "libs": "-licuin -licuuc -licudt", "condition": "config.win32 && features.shared" }, + { "libs": "-licui18n -licuuc -licudata", "condition": "!config.win32" } + ] + }, + "journald": { + "description": "journald", + "test": "unix/journald", + "export": "", + "sources": [ + { "type": "pkgConfig", "args": "libsystemd" }, + { "type": "pkgConfig", "args": "libsystemd-journal" } + ] + }, + "libatomic": { + "description": "64 bit atomics in libatomic", + "test": "common/atomic64", + "sources": [ + "-latomic" + ] + }, + "libdl": { + "description": "dlopen() in libdl", + "export": "", + "test": "unix/dlopen", + "sources": [ + "-ldl" + ] + }, + "pcre": { + "description": "PCRE", + "test": "unix/pcre", + "sources": [ + "-lpcre16" + ] + }, + "pps": { + "description": "PPS", + "test": "unix/pps", + "sources": [ + "-lpps" + ] + }, + "slog2": { + "description": "slog2", + "test": "unix/slog2", + "export": "", + "sources": [ + "-lslog2" + ] + } + }, + + "tests": { + "atomic64": { + "description": "64 bit atomics", + "type": "compile", + "test": "common/atomic64" + }, + "atomicfptr": { + "description": "working std::atomic for function pointers", + "type": "compile", + "test": "common/atomicfptr" + }, + "clock-gettime": { + "description": "clock_gettime()", + "type": "compile", + "test": "unix/clock-gettime" + }, + "clock-monotonic": { + "description": "POSIX monotonic clock", + "type": "compile", + "test": "unix/clock-monotonic" + }, + "cloexec": { + "description": "O_CLOEXEC", + "type": "compile", + "test": "unix/cloexec" + }, + "dlopen": { + "description": "dlopen() in libc", + "type": "compile", + "test": "unix/dlopen" + }, + "eventfd": { + "description": "eventfd", + "type": "compile", + "test": "unix/eventfd" + }, + "posix-iconv": { + "description": "POSIX iconv", + "type": "compile", + "test": "unix/iconv" + }, + "sun-iconv": { + "description": "SUN libiconv", + "type": "compile", + "test": "unix/sun-libiconv" + }, + "inotify": { + "description": "inotify", + "type": "compile", + "test": "unix/inotify" + }, + "ipc_sysv": { + "description": "SysV IPC", + "type": "compile", + "test": "unix/ipc_sysv" + }, + "ipc_posix": { + "description": "POSIX IPC", + "type": "compile", + "test": "unix/ipc_posix" + }, + "journald": { + "description": "journald", + "type": "compile", + "test": "unix/journald" + }, + "ppoll": { + "description": "ppoll()", + "type": "compile", + "test": "unix/ppoll" + }, + "pollts": { + "description": "pollts()", + "type": "compile", + "test": "unix/pollts" + }, + "poll": { + "description": "poll()", + "type": "compile", + "test": "unix/poll" + }, + "syslog": { + "description": "syslog", + "type": "compile", + "test": "unix/syslog" + }, + "xlocalescanprint": { + "description": "xlocale.h (or equivalents)", + "type": "compile", + "test": "common/xlocalescanprint" + } + }, + + "features": { + "clock-gettime": { + "description": "clock_gettime()", + "condition": "tests.clock-gettime", + "output": [ "privateFeature" ] + }, + "clock-monotonic": { + "description": "POSIX monotonic clock", + "condition": "features.clock-gettime && tests.clock-monotonic", + "output": [ "feature" ] + }, + "dlopen": { + "description": "dlopen()", + "condition": "tests.dlopen || libs.libdl", + "output": [ { "type": "define", "negative": true, "name": "QT_NO_DYNAMIC_LIBRARY" } ] + }, + "libdl": { + "description": "dlopen() in libdl", + "condition": "!tests.dlopen && libs.libdl", + "output": [ { "type": "privateConfig", "negative": true } ] + }, + "doubleconversion": { + "description": "DoubleConversion", + "output": [ "privateFeature", "feature" ] + }, + "system-doubleconversion": { + "description": " Using system DoubleConversion", + "enable": "input.doubleconversion == 'system'", + "disable": "input.doubleconversion == 'qt'", + "condition": "features.doubleconversion && libs.doubleconversion", + "output": [ "privateFeature" ] + }, + "eventfd": { + "description": "eventfd", + "condition": "tests.eventfd", + "output": [ "feature" ] + }, + "glib": { + "description": "GLib", + "autoDetect": "!config.win32", + "condition": "libs.glib", + "output": [ "privateFeature", "feature" ] + }, + "iconv": { + "description": "iconv", + "condition": "features.posix-libiconv || features.sun-libiconv || features.gnu-libiconv", + "output": [ "privateFeature", "feature" ] + }, + "posix-libiconv": { + "description": "POSIX iconv", + "enable": "input.iconv == 'posix'", + "disable": "input.iconv == 'sun' || input.iconv == 'gnu' || input.iconv == 'no'", + "condition": "!config.win32 && !config.qnx && !config.android && !config.darwin && tests.posix-iconv" + }, + "sun-libiconv": { + "description": "SUN iconv", + "enable": "input.iconv == 'sun'", + "disable": "input.iconv == 'posix' || input.iconv == 'gnu' || input.iconv == 'no'", + "condition": "!config.win32 && !config.qnx && !config.android && !config.darwin && !features.posix-libiconv && tests.sun-iconv", + "output": [ "privateFeature", "publicQtConfig" ] + }, + "gnu-libiconv": { + "description": "GNU iconv", + "enable": "input.iconv == 'gnu'", + "disable": "input.iconv == 'posix' || input.iconv == 'sun' || input.iconv == 'no'", + "condition": "!config.win32 && !config.qnx && !config.android && !config.darwin && !features.posix-libiconv && !features.sun-libiconv && libs.gnu_iconv", + "output": [ "privateFeature" ] + }, + "icu": { + "description": "ICU", + "autoDetect": "!config.win32", + "condition": "libs.icu", + "output": [ "privateFeature" ] + }, + "inotify": { + "description": "inotify", + "condition": "tests.inotify", + "output": [ "privateFeature", "feature" ] + }, + "ipc_posix": { + "description": "Using POSIX IPC", + "autoDetect": "!config.win32", + "condition": "!tests.ipc_sysv && tests.ipc_posix", + "output": [ { "type": "define", "name": "QT_POSIX_IPC" } ] + }, + "journald": { + "description": "journald", + "autoDetect": false, + "condition": "libs.journald", + "output": [ "privateConfig" ] + }, + "std-atomic64": { + "description": "64 bit atomic operations", + "condition": "tests.atomic64 || libs.libatomic", + "output": [ { "type": "define", "negative": true, "name": "QT_NO_STD_ATOMIC64" } ] + }, + "libatomic": { + "description": "64 bit atomic operations in libatomic", + "condition": "!tests.atomic64 && libs.libatomic", + "output": [ "privateFeature" ] + }, + "mimetype": { + "description": "Mimetype handling", + "output": [ "publicFeature", "feature" ] + }, + "system-pcre": { + "description": "Using system PCRE", + "disable": "input.pcre == 'qt'", + "enable": "input.pcre == 'system'", + "condition": "libs.pcre", + "output": [ + "privateFeature", + { "type": "privateConfig", "negative": true, "name": "pcre" } + ] + }, + "poll_ppoll": { + "description": "Native ppoll()", + "emitIf": "!config.win32", + "condition": "tests.ppoll", + "output": [ "privateFeature" ] + }, + "poll_pollts": { + "description": "Native pollts()", + "emitIf": "!config.win32", + "condition": "!features.poll_ppoll && tests.pollts", + "output": [ "privateFeature" ] + }, + "poll_poll": { + "description": "Native poll()", + "emitIf": "!config.win32", + "condition": "!features.poll_ppoll && !features.poll_pollts && tests.poll", + "output": [ "privateFeature" ] + }, + "poll_select": { + "description": "Emulated poll()", + "emitIf": "!config.win32", + "condition": "!features.poll_ppoll && !features.poll_pollts && !features.poll_poll", + "output": [ + "privateFeature", + { "type": "define", "name": "QT_NO_NATIVE_POLL" } + ] + }, + "qqnx_pps": { + "description": "PPS", + "emitIf": "config.qnx", + "condition": "libs.pps", + "output": [ "privateConfig" ] + }, + "qeventtransition": { + "description": "QEventTransition class", + "output": [ "publicFeature" ] + }, + "sharedmemory": { + "description": "Enable QSharedMemory", + "condition": "config.android || config.win32 || tests.ipc_sysv || tests.ipc_posix", + "output": [ { "type": "define", "negative": true, "name": "QT_NO_SHAREDMEMORY" } ] + }, + "slog2": { + "description": "slog2", + "condition": "libs.slog2", + "emitIf": "config.qnx", + "output": [ "privateConfig" ] + }, + "syslog": { + "description": "syslog", + "autoDetect": false, + "condition": "tests.syslog", + "output": [ "privateConfig" ] + }, + "systemsemaphore": { + "description": "Enable QSystemSemaphore", + "condition": "config.android || config.win32 || tests.ipc_sysv || tests.ipc_posix", + "output": [ { "type": "define", "negative": true, "name": "QT_NO_SYSTEMSEMAPHORE" } ] + }, + "threadsafe-cloexec": { + "description": "Threadsafe pipe creation", + "condition": "tests.cloexec", + "output": [ + "publicQtConfig", + { "type": "define", "name": "QT_THREADSAFE_CLOEXEC", "value": 1 } + ] + } + }, + + "report": [ + { + "type": "note", + "condition": "features.journald || features.syslog || (config.qnx && features.slog2)", + "message": "journald, syslog or slog2 integration is enabled. +If your users intend to develop applications against this build, +ensure that the IDEs they use either set QT_LOGGING_TO_CONSOLE to 1 +or are able to read the logged output from journald, syslog or slog2." + }, + { + "type": "error", + "condition": "input.doubleconversion == 'no' && !tests.xlocalescanprint", + "message": "Your C library does not provide sscanf_l or snprintf_l. +You need to use libdouble-conversion for double/string conversion." + }, + { + "type": "error", + "condition": "!tests.atomicfptr", + "message": "detected a std::atomic implementation that fails for function pointers. +Please apply the patch corresponding to your Standard Library vendor, found in + qtbase/config.tests/common/atomicfptr" + } + ], + + "summary": [ + { + "section": "Qt Core", + "entries": [ + "doubleconversion", + "system-doubleconversion", + "glib", + "iconv", + "icu", + { + "section": "Logging backends", + "entries": [ + "journald", "syslog", "slog2" + ] + }, + { + "type": "feature", + "args": "qqnx_pps", + "condition": "config.qnx" + }, + "system-pcre" + ] + } + ] +} diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index c463a392b7..f11ec127e0 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -58,7 +58,7 @@ #ifndef QT_BOOTSTRAPPED #include -#include +#include #endif // The QT_SUPPORTS macro is deprecated. Don't use it in new code. diff --git a/src/corelib/global/qglobal_p.h b/src/corelib/global/qglobal_p.h index e75d87b384..c329357f46 100644 --- a/src/corelib/global/qglobal_p.h +++ b/src/corelib/global/qglobal_p.h @@ -50,6 +50,7 @@ #ifndef QT_BOOTSTRAPPED #include +#include #endif #define QT_LIBRARY_VERSION(lib) QT_LIBRARY_VERSION_##lib diff --git a/src/gui/configure.json b/src/gui/configure.json new file mode 100644 index 0000000000..c662c0a524 --- /dev/null +++ b/src/gui/configure.json @@ -0,0 +1,905 @@ +{ + "module": "gui", + "depends": [ + "core" + ], + "testDir": "../../config.tests", + + "commandline": { + "options": { + "angle": "boolean", + "directfb": "boolean", + "directwrite": "boolean", + "egl": "boolean", + "eglfs": "boolean", + "evdev": "boolean", + "fontconfig": "boolean", + "freetype": { "type": "enum", "values": [ "no", "qt", "system" ] }, + "gbm": "boolean", + "gif": "boolean", + "harfbuzz": { "type": "enum", "values": [ "no", "qt", "system" ] }, + "ico": "boolean", + "imf": { "type": "boolean", "name": "qqnx_imf" }, + "kms": "boolean", + "lgmon": "boolean", + "libinput": "boolean", + "libjpeg": { "type": "enum", "values": [ "no", "qt", "system" ] }, + "libpng": { "type": "enum", "values": [ "no", "qt", "system" ] }, + "linuxfb": "boolean", + "mirclient": "boolean", + "mtdev": "boolean", + "opengl": { "type": "optionalString", "values": [ "no", "yes", "desktop", "es2", "dynamic" ] }, + "opengl-es-2": { "type": "void", "name": "opengl", "value": "es2" }, + "opengles3": "boolean", + "qpa": { "type": "string", "name": "qpa_default_platform" }, + "qpa-platform-guard": "boolean", + "sm": { "type": "boolean", "name": "sessionmanager" }, + "tslib": "boolean", + "xcb": { "type": "enum", "values": [ "no", "yes", "qt", "system" ] }, + "xcb-xlib": "boolean", + "xinput2": "boolean", + "xkb": "boolean", + "xkb-config-root": "string", + "xkbcommon": { "type": "enum", "values": [ "no", "qt", "system" ] }, + "xkbcommon-evdev": "boolean", + "xkbcommon-x11": { "type": "enum", "name": "xkbcommon", "values": [ "no", "qt", "system" ] }, + "xrender": "boolean" + } + }, + + "libraries": { + "bcm_host": { + "export": "", + "sources": [ + "-lbcm_host" + ] + }, + "directfb": { + "description": "DirectFB", + "test": "qpa/directfb", + "sources": [ + { "type": "pkgConfig", "args": "directfb" } + ] + }, + "directwrite": { + "description": "DirectWrite", + "export": "", + "test": "win/directwrite", + "sources": [ + "-ldwrite" + ] + }, + "drm": { + "description": "KMS", + "test": "qpa/kms", + "sources": [ + { "type": "pkgConfig", "args": "libdrm" }, + "-ldrm" + ] + }, + "egl": { + "description": "EGL", + "test": "qpa/egl", + "sources": [ + { "type": "pkgConfig", "args": "egl" }, + { "type": "makeSpec", "spec": "EGL" } + ] + }, + "freetype": { + "description": "FreeType", + "export": "", + "test": "unix/freetype", + "sources": [ + "-lfreetype" + ] + }, + "fontconfig": { + "description": "Fontconfig", + "test": "unix/fontconfig", + "sources": [ + { "type": "pkgConfig", "args": "fontconfig freetype2" }, + "-lfontconfig -lfreetype" + ] + }, + "gbm": { + "description": "GBM", + "test": "qpa/gbm", + "sources": [ + { "type": "pkgConfig", "args": "gbm" } + ] + }, + "harfbuzz": { + "description": "HarfBuzz", + "test": "unix/harfbuzz", + "sources": [ + "-lharfbuzz" + ] + }, + "imf": { + "description": "IMF", + "export": "", + "test": "unix/qqnx_imf", + "sources": [ + "-linput_client" + ] + }, + "lgmon": { + "description": "lgmon", + "test": "unix/lgmon", + "sources": [ + "-llgmon" + ] + }, + "libinput": { + "description": "libinput", + "test": "unix/libinput", + "sources": [ + { "type": "pkgConfig", "args": "libinput" } + ] + }, + "libjpeg": { + "description": "libjpeg", + "test": "unix/libjpeg", + "sources": [ + { "libs": "-llibjpeg", "condition": "config.msvc" }, + { "libs": "-ljpeg", "condition": "!config.msvc" } + ] + }, + "libpng": { + "description": "libpng", + "test": "unix/libpng", + "sources": [ + { "type": "pkgConfig", "args": "libpng" }, + { "libs": "-llibpng", "condition": "config.msvc" }, + { "libs": "-lpng", "condition": "!config.msvc" } + ] + }, + "mirclient": { + "description": "Mir client libraries", + "export": "", + "test": "qpa/mirclient", + "sources": [ + { "type": "pkgConfig", "args": "egl mirclient ubuntu-platform-api" } + ] + }, + "mtdev": { + "description": "mtdev", + "export": "", + "test": "unix/mtdev", + "sources": [ + { "type": "pkgConfig", "args": "mtdev" } + ] + }, + "opengl": { + "description": "Desktop OpenGL", + "test": "unix/opengldesktop", + "sources": [ + { "type": "pkgConfig", "args": "gl" }, + { "type": "makeSpec", "spec": "OPENGL" } + ] + }, + "opengl_es2": { + "description": "OpenGL ES 2.0", + "test": "unix/opengles2", + "sources": [ + { "type": "pkgConfig", "args": "glesv2" }, + { "type": "makeSpec", "spec": "OPENGL_ES2" } + ] + }, + "tslib": { + "description": "tslib", + "test": "unix/tslib", + "sources": [ + "-lts" + ] + }, + "wayland_server": { + "description": "Wayland Server", + "export": "", + "test": "qpa/wayland-server", + "sources": [ + { "type": "pkgConfig", "args": "wayland-server" } + ] + }, + "x11sm": { + "description": "X11 session management", + "sources": [ + { "type": "pkgConfig", "args": "sm ice" } + ] + }, + "xcb": { + "description": "XCB >= 1.5 (core)", + "test": "qpa/xcb", + "sources": [ + { "type": "pkgConfig", "args": "xcb >= 1.5" }, + "-lxcb" + ] + }, + "xcb_syslibs": { + "description": "XCB (secondary)", + "test": "qpa/xcb-syslibs", + "sources": [ + { "type": "pkgConfig", + "args": "xcb xcb-shm xcb-sync xcb-xfixes xcb-randr xcb-image xcb-keysyms xcb-icccm xcb-shape" }, + "-lxcb -lxcb-shm -lxcb-sync -lxcb-xfixes -lxcb-randr -lxcb-image -lxcb-keysyms -lxcb-icccm -lxcb-shape" + ] + }, + "xcb_xlib": { + "description": "XCB Xlib", + "test": "qpa/xcb-xlib", + "sources": [ + { "type": "pkgConfig", "args": "X11-xcb x11 xcb" }, + "-lxcb -lX11 -lX11-xcb" + ] + }, + "xcb_xkb": { + "description": "XCB XKB >= 1.10", + "test": "qpa/xcb-xkb", + "sources": [ + { "type": "pkgConfig", "args": "xcb-xkb >= 1.10 xcb" }, + "-lxcb-xkb -lxcb" + ] + }, + "xcb_render": { + "description": "XCB XRender", + "test": "qpa/xcb-render", + "sources": [ + { "type": "pkgConfig", "args": "xcb-renderutil xcb-render xcb" }, + "-lxcb-render-util -lxcb-render -lxcb" + ] + }, + "xcb_glx": { + "description": "XCB GLX", + "test": "qpa/xcb-glx", + "sources": [ + { "type": "pkgConfig", "args": "xcb-glx xcb" }, + "-lxcb-glx -lxcb" + ] + }, + "xinput2": { + "description": "Xinput2", + "test": "x11/xinput2", + "sources": [ + { "type": "pkgConfig", "args": "xi" }, + "-lXi" + ] + }, + "xkbcommon": { + "description": "xkbcommon", + "export": "xkbcommon_evdev", + "test": "unix/xkbcommon", + "sources": [ + { "type": "pkgConfig", "args": "xkbcommon" } + ] + }, + "xkbcommon_x11": { + "description": "xkbcommon-x11 >= 0.4.1", + "export": "xkbcommon", + "sources": [ + { "type": "pkgConfig", "args": "xkbcommon xkbcommon-x11 >= 0.4.1" } + ] + }, + "xrender": { + "description": "XRender", + "test": "x11/xrender", + "sources": [ + "-lXrender" + ] + } + }, + + "testTypeAliases": { + "files": [ "directX" ], + "getPkgConfigVariable": [ "xkbConfigRoot" ] + }, + + "tests": { + "direct2d": { + "description": "Direct 2D", + "type": "compile", + "test": "qpa/direct2d", + "use": "direct2d" + }, + "directwrite2": { + "description": "DirectWrite 2", + "type": "compile", + "test": "win/directwrite2", + "use": "directwrite" + }, + "directx": { + "description": "DirectX SDK", + "type": "directX", + "files": [ + "d3dcompiler.h", + "d3d11.lib", + "fxc.exe" + ] + }, + "egl-x11": { + "description": "EGL on X11", + "type": "compile", + "test": "qpa/egl-x11", + "use": "egl xcb_xlib" + }, + "egl-brcm": { + "description": "Broadcom EGL (Rasberry Pi)", + "type": "compile", + "test": "qpa/eglfs-brcm", + "use": "egl bcm_host" + }, + "egl-egldevice": { + "description": "EGLDevice", + "type": "compile", + "test": "qpa/eglfs-egldevice", + "use": "egl" + }, + "egl-mali": { + "description": "Mali EGL", + "type": "compile", + "test": "qpa/eglfs-mali", + "use": "egl" + }, + "egl-mali-2": { + "description": "Mali 2 EGL", + "type": "compile", + "test": "qpa/eglfs-mali-2", + "use": "egl" + }, + "egl-viv": { + "description": "i.Mx6 EGL", + "type": "compile", + "test": "qpa/eglfs-viv", + "use": "egl" + }, + "evdev": { + "description": "evdev", + "type": "compile", + "test": "unix/evdev" + }, + "linuxfb": { + "description": "LinuxFB", + "type": "compile", + "test": "qpa/linuxfb" + }, + "opengles3": { + "description": "OpenGL ES 3.0", + "type": "compile", + "test": "unix/opengles3", + "use": "opengl_es2" + }, + "opengles31": { + "description": "OpenGL ES 3.1", + "type": "compile", + "test": "unix/opengles31", + "use": "opengl_es2" + }, + "qpa_default_platform": { + "description": "default QPA platform", + "type": "qpaDefaultPlatform", + "log": "value" + }, + "x11prefix": { + "description": "X11 prefix", + "type": "getPkgConfigVariable", + "pkg-config-args": "x11", + "pkg-config-variable": "prefix", + "value": "/usr", + "log": "value" + }, + "xkbconfigroot": { + "description": "XKB config root", + "type": "xkbConfigRoot", + "pkg-config-args": "xkeyboard-config", + "pkg-config-variable": "xkb_base", + "log": "value" + }, + "xlib": { + "description": "XLib", + "type": "compile", + "test": "x11/xlib" + } + }, + + "features": { + "accessibility-atspi-bridge": { + "description": "ATSPI Bridge", + "condition": "features.accessibility && features.xcb && features.dbus", + "output": [ "privateFeature", "feature" ] + }, + "angle": { + "description": "ANGLE", + "autoDetect": "features.opengles2 || features.opengl-dynamic", + "condition": "config.win32 && tests.directx", + "output": [ + "publicFeature", + { "type": "define", "name": "QT_OPENGL_ES_2_ANGLE" } + ] + }, + "directfb": { + "description": "DirectFB", + "autoDetect": false, + "condition": "libs.directfb", + "output": [ "privateFeature" ] + }, + "directwrite": { + "description": "DirectWrite", + "emitIf": "config.win32", + "condition": "libs.directwrite", + "output": [ "privateFeature" ] + }, + "directwrite2": { + "description": "DirectWrite 2", + "emitIf": "config.win32", + "condition": "features.directwrite && tests.directwrite2", + "output": [ "privateFeature" ] + }, + "direct2d": { + "description": "Direct 2D", + "autoDetect": false, + "condition": "tests.direct2d", + "output": [ "privateFeature" ] + }, + "evdev": { + "description": "evdev", + "condition": "tests.evdev", + "output": [ "privateFeature" ] + }, + "freetype": { + "description": "FreeType", + "output": [ "privateFeature", "feature" ] + }, + "system-freetype": { + "description": " Using system FreeType", + "enable": "input.freetype == 'system'", + "disable": "input.freetype == 'qt'", + "autoDetect": "!config.win32", + "condition": "features.freetype && libs.freetype", + "output": [ "privateFeature" ] + }, + "fontconfig": { + "description": "Fontconfig", + "condition": "!config.win32 && !config.darwin && features.system-freetype && libs.fontconfig", + "output": [ "privateFeature", "feature" ] + }, + "gbm": { + "description": "GBM", + "condition": "libs.gbm", + "output": [ "publicQtConfig" ] + }, + "harfbuzz": { + "description": "HarfBuzz", + "output": [ "privateFeature", "feature" ] + }, + "system-harfbuzz": { + "description": " Using system HarfBuzz", + "enable": "input.harfbuzz == 'system'", + "disable": "input.harfbuzz == 'qt'", + "autoDetect": "!config.darwin && !config.win32", + "condition": "features.harfbuzz && libs.harfbuzz", + "output": [ "privateFeature" ] + }, + "qqnx_imf": { + "description": "IMF", + "emitIf": "config.qnx", + "condition": "libs.imf", + "output": [ "privateConfig" ] + }, + "integrityfb": { + "description": "INTEGRITY framebuffer", + "condition": "config.integrity", + "output": [ "privateFeature" ] + }, + "kms": { + "description": "KMS", + "condition": "libs.drm", + "output": [ "publicQtConfig" ] + }, + "libinput": { + "description": "libinput", + "condition": "features.libudev && libs.libinput", + "output": [ "privateFeature" ] + }, + "lgmon": { + "description": "lgmon", + "emitIf": "config.qnx", + "condition": "libs.lgmon", + "output": [ "privateConfig" ] + }, + "linuxfb": { + "description": "LinuxFB", + "condition": "tests.linuxfb", + "output": [ "privateFeature" ] + }, + "mirclient": { + "description": "Mir client", + "condition": "libs.mirclient", + "output": [ "privateFeature" ] + }, + "mtdev": { + "description": "mtdev", + "condition": "libs.mtdev", + "output": [ "privateFeature" ] + }, + "opengles2": { + "description": "OpenGL ES 2.0", + "enable": "input.opengl == 'es2'", + "disable": "input.opengl == 'desktop' || input.opengl == 'dynamic' || input.opengl == 'no'", + "condition": "config.win32 || (!config.watchos && !features.opengl-desktop && libs.opengl_es2)", + "output": [ + "publicFeature", + "publicQtConfig", + { "type": "define", "name": "QT_OPENGL_ES" }, + { "type": "define", "name": "QT_OPENGL_ES_2" } + ] + }, + "opengles3": { + "description": "OpenGL ES 3.0", + "condition": "features.opengles2 && !features.angle && tests.opengles3", + "output": [ + "publicFeature", + { "type": "define", "name": "QT_OPENGL_ES_3" } + ] + }, + "opengles31": { + "description": "OpenGL ES 3.1", + "condition": "features.opengles3 && tests.opengles31", + "output": [ + "publicFeature", + { "type": "define", "name": "QT_OPENGL_ES_3_1" } + ] + }, + "opengl-desktop": { + "description": "Desktop OpenGL", + "enable": "input.opengl == 'desktop'", + "disable": "input.opengl == 'es2' || input.opengl == 'dynamic' || input.opengl == 'no'", + "condition": "(config.win32 && !config.winrt && !features.opengles2 && (config.msvc || libs.opengl)) + || (!config.watchos && !config.win32 && libs.opengl)" + }, + "opengl-dynamic": { + "description": "Dynamic OpenGL", + "enable": "input.opengl == 'dynamic'", + "autoDetect": false, + "condition": "config.win32 && !config.winrt", + "output": [ + { "type": "publicFeature", "name": "dynamicgl" }, + { "type": "define", "name": "QT_OPENGL_DYNAMIC" } + ] + }, + "opengl": { + "description": "OpenGL", + "condition": "features.opengl-desktop || features.opengl-dynamic || features.opengles2", + "output": [ "publicFeature", "feature" ] + }, + "egl": { + "description": "EGL", + "condition": "features.opengl && (features.angle || libs.egl)", + "output": [ "privateFeature", "feature" ] + }, + "egl_x11": { + "description": "EGL on X11", + "condition": "features.egl && tests.egl-x11", + "output": [ "privateFeature" ] + }, + "eglfs": { + "description": "EGLFS", + "autoDetect": "!config.android && !config.win32", + "condition": "features.egl", + "output": [ "privateFeature" ] + }, + "eglfs_brcm": { + "description": "EGLFS Rasberry Pi", + "condition": "features.eglfs && tests.egl-brcm", + "output": [ "privateFeature" ] + }, + "eglfs_egldevice": { + "description": "EGLFS EGLDevice", + "condition": "features.eglfs && tests.egl-egldevice && features.kms", + "output": [ "privateFeature" ] + }, + "eglfs_gbm": { + "description": "EGLFS GBM", + "condition": "features.eglfs && features.gbm && features.kms", + "output": [ "privateFeature" ] + }, + "eglfs_mali": { + "description": "EGLFS Mali", + "condition": "features.eglfs && (tests.egl-mali || tests.egl-mali-2)", + "output": [ "privateFeature" ] + }, + "eglfs_viv": { + "description": "EGLFS i.Mx6", + "condition": "features.eglfs && tests.egl-viv", + "output": [ "privateFeature" ] + }, + "eglfs_viv_wl": { + "description": "EGLFS i.Mx6 Wayland", + "condition": "features.eglfs_viv && libs.wayland_server", + "output": [ "privateFeature" ] + }, + "gif": { + "description": "GIF", + "output": [ + "privateFeature", + { "type": "define", "negative": true, "name": "QT_NO_IMAGEFORMAT_GIF" } + ] + }, + "ico": { + "description": "ICO", + "output": [ "privateFeature", "feature" ] + }, + "jpeg": { + "description": "JPEG", + "disable": "input.libjpeg == 'no'", + "output": [ + "privateFeature", + { "type": "define", "negative": true, "name": "QT_NO_IMAGEFORMAT_JPEG" } + ] + }, + "system-jpeg": { + "description": " Using system libjpeg", + "disable": "input.libjpeg == 'qt'", + "enable": "input.libjpeg == 'system'", + "condition": "features.jpeg && libs.libjpeg", + "output": [ "privateFeature" ] + }, + "png": { + "description": "PNG", + "disable": "input.libpng == 'no'", + "output": [ + "privateFeature", + { "type": "define", "negative": true, "name": "QT_NO_IMAGEFORMAT_PNG" } + ] + }, + "system-png": { + "description": " Using system libpng", + "disable": "input.libpng == 'qt'", + "enable": "input.libpng == 'system'", + "condition": "features.png && libs.libpng", + "output": [ "privateFeature" ] + }, + "qpa_default_platform": { + "description": "QPA default platform", + "condition": "features.gui", + "output": [ + { "type": "define", "name": "QT_QPA_DEFAULT_PLATFORM_NAME", "value": "tests.qpa_default_platform.name" }, + { "type": "varAssign", "public": true, "name": "QT_DEFAULT_QPA_PLUGIN", "value": "tests.qpa_default_platform.plugin", + "condition": "!features.shared" } + ] + }, + "sessionmanager": { + "description": "Session Management", + "output": [ "feature" ] + }, + "tslib": { + "description": "tslib", + "condition": "libs.tslib", + "output": [ "privateFeature" ] + }, + "xcb": { + "description": "XCB", + "autoDetect": "!config.darwin", + "condition": "libs.xcb", + "output": [ "privateFeature" ] + }, + "system-xcb": { + "description": "Using system provided XCB libraries", + "enable": "input.xcb == 'system' || input.xcb == 'yes'", + "disable": "input.xcb == 'qt' || input.xcb == 'no'", + "autoDetect": "!config.darwin", + "condition": "libs.xcb && libs.xcb_syslibs", + "output": [ "privateFeature" ] + }, + "x11-prefix": { + "description": "X11 prefix", + "emitIf": "features.xcb", + "output": [ { "type": "varAssign", "name": "QMAKE_X11_PREFIX", "value": "tests.x11prefix.value" } ] + }, + "xcb-glx": { + "description": "XCB GLX", + "emitIf": "features.xcb", + "condition": "libs.xcb_glx", + "output": [ "privateFeature" ] + }, + "xcb-render": { + "description": "XCB render", + "emitIf": "features.system-xcb", + "condition": "libs.xcb_render", + "output": [ "privateFeature" ] + }, + "xcb-xlib": { + "description": "XCB Xlib", + "emitIf": "features.xcb", + "condition": "libs.xcb_xlib", + "output": [ "privateFeature" ] + }, + "xcb-sm": { + "description": "xcb-sm", + "emitIf": "features.xcb", + "condition": "features.sessionmanager && libs.x11sm", + "output": [ "privateFeature" ] + }, + "xinput2": { + "description": "Xinput2", + "condition": "libs.xinput2", + "output": [ "privateFeature" ] + }, + "xkbcommon-evdev": { + "description": "xkbcommon-evdev", + "condition": "libs.xkbcommon", + "output": [ "privateFeature" ] + }, + "xkbcommon-system": { + "description": "Using system-provided xkbcommon", + "emitIf": "features.xcb", + "enable": "input.xkbcommon == 'system'", + "disable": "input.xkbcommon == 'qt' || input.xkbcommon == 'no'", + "condition": "libs.xkbcommon_x11", + "output": [ "privateFeature" ] + }, + "xkb": { + "description": "XCB XKB", + "condition": "features.system-xcb && libs.xcb_xkb", + "output": [ "privateFeature" ] + }, + "xkb-config-root": { + "description": "XKB config root", + "emitIf": "features.xcb", + "condition": "features.xcb && !features.xkbcommon-system && tests.xkbconfigroot", + "output": [ { "type": "varAssign", "name": "QMAKE_XKB_CONFIG_ROOT", "value": "tests.xkbconfigroot.value"} ] + }, + "xlib": { + "description": "XLib", + "condition": "tests.xlib", + "output": [ "privateFeature" ] + }, + "xrender": { + "description": "Xrender", + "condition": "libs.xrender", + "output": [ "privateFeature", "feature" ] + } + }, + + "earlyReport": [ + { + "type": "error", + "condition": "input.xcb != '' && input.xcb != 'no' && input.xkbcommon == 'no'", + "message": "XCB plugin requires libxkbcommon. See -qt-xkbcommon-x11 and -system-xkbcommon-x11." + } + ], + + "report": [ + { + "type": "warning", + "condition": "features.xcb && !features.xkbcommon-system && !features.xkb-config-root", + "message": "Could not find XKB config root, use -xkb-config-root to set a path to +XKB configuration data. This is required for keyboard input support." + }, + { + "type": "note", + "condition": "features.accessibility && features.xcb && !features.accessibility-atspi-bridge", + "message": "Disabling Linux Accessibility Bridge: D-Bus is missing." + }, + { + "type": "warning", + "condition": "input.qpa-platform-guard != ''", + "message": "The [-no]-qpa-platform-guard argument is deprecated and has no effect." + }, + { + "type": "warning", + "condition": "features.gui && config.linux && !features.xcb && !features.eglfs && !features.directfb && !features.linuxfb && !features.mirclient", + "message": "No QPA platform plugin enabled! This will +produce a Qt that cannot run GUI applications. +The dependencies needed for xcb to build are listed in +src/plugins/platforms/xcb/README" + }, + { + "type": "warning", + "condition": "config.win32 && (features.opengles2 || features.opengl-dynamic) && !features.angle", + "message": "Using OpenGL ES 2.0 on Windows without ANGLE. +The build will most likely fail. +Specify -opengl desktop to use regular OpenGL." + }, + { + "type": "warning", + "condition": "config.darwin && features.system-harfbuzz", + "message": "On OS X, AAT is supported only with -qt-harfbuzz." + }, + { + "type": "error", + "condition": "features.gui && !config.watchos && input.opengl != 'no' && !features.opengl-desktop && !features.opengles2 && !features.opengl-dynamic", + "message": "The OpenGL functionality tests failed! +You might need to modify the include and library search paths by editing QMAKE_INCDIR_OPENGL[_ES2], +QMAKE_LIBDIR_OPENGL[_ES2] and QMAKE_LIBS_OPENGL[_ES2] in the mkspec for your platform." + } + ], + + "summary": [ + { + "section": "Qt Gui", + "entries": [ + "freetype", + "system-freetype", + "harfbuzz", + "system-harfbuzz", + "fontconfig", + { + "section": "Image formats", + "entries": [ + "gif", "ico", "jpeg", "system-jpeg", "png", "system-png" + ] + }, + { + "section": "OpenGL", + "entries": [ + { + "type": "feature", + "args": "angle", + "condition": "config.win32" + }, + "egl", + "opengl-desktop", + { + "type": "feature", + "args": "opengl-dynamic", + "condition": "config.win32" + }, + "opengles2", + "opengles3", + "opengles31" + ] + }, + "sessionmanager" + ] + }, + { + "section": "Features used by QPA backends", + "entries": [ + "evdev", + "libinput", + "mtdev", + "tslib", + "xkbcommon-evdev" + ] + }, + { + "section": "QPA backends", + "entries": [ + "directfb", "eglfs", + { + "section": "EGLFS details", + "condition": "features.eglfs", + "entries": [ + "eglfs_viv", "eglfs_viv_wl", "eglfs_egldevice", "eglfs_gbm", "eglfs_mali", "eglfs_brcm", "egl_x11" + ] + }, + "linuxfb", "mirclient", + { + "message": "INTEGRITY framebuffer", + "condition": "config.integrity", + "args": "integrityfb" + }, + { + "section": "QNX", + "condition": "config.qnx", + "entries": [ + "lgmon", "qqnx_imf" + ] + }, + { + "section": "X11", + "condition": "features.xcb", + "entries": [ + "system-xcb", "egl_x11", "xinput2", "xkb", "xlib", "xrender", "xcb-render", "xcb-glx", "xcb-xlib", "xkbcommon-system" + ] + }, + { + "section": "Windows", + "condition": "config.win32", + "entries": [ + "direct2d", "directwrite", "directwrite2" + ] + } + ] + } + ] +} diff --git a/src/gui/configure.pri b/src/gui/configure.pri new file mode 100644 index 0000000000..d79c5a6bba --- /dev/null +++ b/src/gui/configure.pri @@ -0,0 +1,67 @@ +# custom tests + +# Check for Direct X SDK (include, lib, and direct shader compiler 'fxc'). +# Up to Direct X SDK June 2010 and for MinGW, this is pointed to by the +# DXSDK_DIR variable. Starting with Windows Kit 8, it is included in +# the Windows SDK. Checking for the header is not sufficient, since it +# is also present in MinGW. +defineTest(qtConfTest_directX) { + dxdir = $$getenv("DXSDK_DIR") + !isEmpty(dxdir) { + EXTRA_INCLUDEPATH += $$dxdir/include + equals(QT_ARCH, x86_64): \ + EXTRA_LIBDIR += $$dxdir/lib/x64 + else: \ + EXTRA_LIBDIR += $$dxdir/lib/x86 + EXTRA_PATH += $$dxdir/Utilities/bin/x86 + } + + $$qtConfEvaluate("features.sse2") { + ky = $$size($${1}.files._KEYS_) + $${1}.files._KEYS_ += $$ky + # Not present on MinGW-32 + $${1}.files.$${ky} = "intrin.h" + } + + qtConfTest_files($${1}): return(true) + return(false) +} + +defineTest(qtConfTest_xkbConfigRoot) { + qtConfTest_getPkgConfigVariable($${1}): return(true) + + for (dir, $$list("/usr/share/X11/xkb", "/usr/local/share/X11/xkb")) { + exists($$dir) { + $${1}.value = $$dir + export($${1}.value) + $${1}.cache += value + export($${1}.cache) + return(true) + } + } + return(false) +} + +defineTest(qtConfTest_qpaDefaultPlatform) { + name = + !isEmpty(config.input.qpa_default_platform): name = $$config.input.qpa_default_platform + else: !isEmpty(QT_QPA_DEFAULT_PLATFORM): name = $$QT_QPA_DEFAULT_PLATFORM + else: winrt: name = winrt + else: win32: name = windows + else: android: name = android + else: macos: name = cocoa + else: ios: name = ios + else: qnx: name = qnx + else: integrity: name = integrityfb + else: name = xcb + + $${1}.value = $$name + $${1}.plugin = q$$name + $${1}.name = "\"$$name\"" + export($${1}.value) + export($${1}.plugin) + export($${1}.name) + $${1}.cache += value plugin name + export($${1}.cache) + return(true) +} diff --git a/src/gui/kernel/qtguiglobal.h b/src/gui/kernel/qtguiglobal.h index f0e64fbc53..8a7409e3d9 100644 --- a/src/gui/kernel/qtguiglobal.h +++ b/src/gui/kernel/qtguiglobal.h @@ -41,6 +41,7 @@ #define QTGUIGLOBAL_H #include +#include QT_BEGIN_NAMESPACE diff --git a/src/gui/kernel/qtguiglobal_p.h b/src/gui/kernel/qtguiglobal_p.h index fd04b8ff95..d2c0b3c5d1 100644 --- a/src/gui/kernel/qtguiglobal_p.h +++ b/src/gui/kernel/qtguiglobal_p.h @@ -53,5 +53,6 @@ #include #include +#include #endif // QTGUIGLOBAL_P_H diff --git a/src/network/configure.json b/src/network/configure.json new file mode 100644 index 0000000000..a647439b19 --- /dev/null +++ b/src/network/configure.json @@ -0,0 +1,216 @@ +{ + "module": "network", + "depends": [ + "core" + ], + "testDir": "../../config.tests", + + "commandline": { + "assignments": { + "OPENSSL_LIBS": "openssl.libs", + "OPENSSL_LIBS_DEBUG": "openssl.libs.debug", + "OPENSSL_LIBS_RELEASE": "openssl.libs.release", + "OPENSSL_PATH": "openssl.prefix" + }, + "options": { + "libproxy": "boolean", + "openssl": { "type": "optionalString", "values": [ "no", "yes", "linked", "runtime" ] }, + "openssl-linked": { "type": "void", "name": "openssl", "value": "linked" }, + "openssl-runtime": { "type": "void", "name": "openssl", "value": "runtime" }, + "sctp": "boolean", + "securetransport": "boolean", + "ssl": "boolean", + "system-proxies": "boolean" + } + }, + + "libraries": { + "corewlan": { + "description": "CoreWLan", + "export": "", + "test": "mac/corewlan", + "sources": [ + "-framework CoreWLAN -framework Foundation" + ] + }, + "network": { + "export": "", + "sources": [ + { "type": "makeSpec", "spec": "NETWORK" } + ] + }, + "libproxy": { + "description": "libproxy", + "test": "common/libproxy", + "sources": [ + "-lproxy" + ] + }, + "openssl": { + "description": "OpenSSL Libraries", + "export": "", + "sources": [ + { "type": "openssl" }, + { + "comment": "placeholder for OPENSSL_LIBS{,_{DEBUG,RELEASE}}", + "libs": "", + "builds": { + "debug": "", + "release": "" + }, + "condition": "config.win32 && !features.shared" + }, + { "libs": "-lssleay32 -llibeay32", "condition": "config.win32 && features.shared" }, + { "libs": "-lssl -lcrypto", "condition": "!config.win32" } + ] + } + }, + + "tests": { + "getaddrinfo": { + "description": "getaddrinfo()", + "type": "compile", + "test": "unix/getaddrinfo", + "use": "network" + }, + "getifaddrs": { + "description": "getifaddrs()", + "type": "compile", + "test": "unix/getifaddrs", + "use": "network" + }, + "ipv6ifname": { + "description": "IPv6 ifname", + "type": "compile", + "test": "unix/ipv6ifname", + "use": "network" + }, + "openssl": { + "description": "OpenSSL", + "type": "compile", + "test": "unix/openssl" + }, + "sctp": { + "description": "SCTP support", + "type": "compile", + "test": "unix/sctp", + "use": "network" + } + }, + + "features": { + "corewlan": { + "description": "CoreWLan", + "condition": "libs.corewlan", + "emitIf": "config.darwin", + "output": [ "feature", "privateFeature" ] + }, + "getaddrinfo": { + "description": "getaddrinfo()", + "condition": "tests.getaddrinfo", + "output": [ "feature" ] + }, + "getifaddrs": { + "description": "getifaddrs()", + "condition": "tests.getifaddrs", + "output": [ "feature" ] + }, + "ipv6ifname": { + "description": "IPv6 ifname", + "condition": "tests.ipv6ifname", + "output": [ "feature" ] + }, + "libproxy": { + "description": "libproxy", + "autoDetect": false, + "condition": "libs.libproxy", + "output": [ "privateFeature" ] + }, + "openssl": { + "description": "OpenSSL", + "enable": "input.openssl == 'yes' || input.openssl == 'linked' || input.openssl == 'runtime'", + "disable": "input.openssl == 'no' || input.ssl == 'no'", + "autoDetect": "!config.winrt", + "condition": "!features.securetransport && tests.openssl", + "output": [ + "privateFeature", + { "type": "publicQtConfig", "condition": "!features.openssl-linked" }, + { "type": "define", "negative": true, "name": "QT_NO_OPENSSL" } + ] + }, + "openssl-linked": { + "description": " Qt directly linked to OpenSSL", + "enable": "input.openssl == 'linked'", + "disable": "input.openssl != 'linked'", + "condition": "features.openssl && libs.openssl", + "output": [ + "privateFeature", + { "type": "varAssign", "name": "OPENSSL_LIBS", "value": "libs.openssl.libs", "eval": "true" }, + { "type": "varAssign", "name": "OPENSSL_LIBS_DEBUG", "value": "libs.openssl.builds.debug.libs", + "eval": "true", "condition": "config.win32" }, + { "type": "varAssign", "name": "OPENSSL_LIBS_RELEASE", "value": "libs.openssl.builds.release.libs", + "eval": "true", "condition": "config.win32" }, + { "type": "define", "name": "QT_LINKED_OPENSSL" } + ] + }, + "securetransport": { + "description": "SecureTransport", + "disable": "input.securetransport == 'no' || input.ssl == 'no'", + "condition": "config.darwin && (input.openssl == '' || input.openssl == 'no')", + "output": [ + "privateFeature", + { "type": "define", "name": "QT_SECURETRANSPORT" } + ] + }, + "ssl": { + "description": "SSL", + "condition": "config.winrt || features.securetransport || features.openssl", + "output": [ "publicFeature", "feature" ] + }, + "sctp": { + "description": "SCTP", + "autoDetect": false, + "condition": "tests.sctp", + "output": [ "publicFeature", "feature" ] + }, + "system-proxies": { + "description": "Use system proxies", + "output": [ "privateFeature" ] + } + }, + + "report": [ + { + "type": "note", + "condition": "features.openssl-linked && libs.openssl.source != 0 + && input.openssl.prefix == '' && input.openssl.libs == '' && input.openssl.libs.debug == ''", + "message": "When linking against OpenSSL, you can override the default +library names through OPENSSL_LIBS. +For example: + OPENSSL_LIBS='-L/opt/ssl/lib -lssl -lcrypto' ./configure -openssl-linked" + } + ], + + "summary": [ + { + "section": "Qt Network", + "entries": [ + { + "type": "feature", + "args": "corewlan", + "condition": "config.darwin" + }, + "getaddrinfo", "getifaddrs", "ipv6ifname", "libproxy", + { + "type": "feature", + "args": "securetransport", + "condition": "config.darwin" + }, + "openssl", + "openssl-linked", + "sctp", + "system-proxies" + ] + } + ] +} diff --git a/src/network/configure.pri b/src/network/configure.pri new file mode 100644 index 0000000000..57568902e4 --- /dev/null +++ b/src/network/configure.pri @@ -0,0 +1,12 @@ +# custom tests + +defineTest(qtConfLibrary_openssl) { + libs = $$getenv("OPENSSL_LIBS") + !isEmpty(libs) { + $${1}.libs = $$libs + export($${1}.libs) + return(true) + } + return(false) +} + diff --git a/src/network/kernel/qtnetworkglobal.h b/src/network/kernel/qtnetworkglobal.h index 192601970a..586b847816 100644 --- a/src/network/kernel/qtnetworkglobal.h +++ b/src/network/kernel/qtnetworkglobal.h @@ -41,6 +41,7 @@ #define QTNETWORKGLOBAL_H #include +#include QT_BEGIN_NAMESPACE diff --git a/src/network/kernel/qtnetworkglobal_p.h b/src/network/kernel/qtnetworkglobal_p.h index 51347e440d..859e3d9ebd 100644 --- a/src/network/kernel/qtnetworkglobal_p.h +++ b/src/network/kernel/qtnetworkglobal_p.h @@ -53,5 +53,6 @@ #include #include +#include #endif // QTNETWORKGLOBAL_P_H diff --git a/src/network/ssl/qsslcertificate.cpp b/src/network/ssl/qsslcertificate.cpp index 96ba68089d..ce78399e01 100644 --- a/src/network/ssl/qsslcertificate.cpp +++ b/src/network/ssl/qsslcertificate.cpp @@ -111,7 +111,7 @@ \value EmailAddress The email address associated with the certificate */ -#include +#include #ifndef QT_NO_OPENSSL #include "qsslsocket_openssl_symbols_p.h" #endif diff --git a/src/platformsupport/fbconvenience/qfbvthandler_p.h b/src/platformsupport/fbconvenience/qfbvthandler_p.h index e05a9d3ffc..17d07317b2 100644 --- a/src/platformsupport/fbconvenience/qfbvthandler_p.h +++ b/src/platformsupport/fbconvenience/qfbvthandler_p.h @@ -51,6 +51,7 @@ // We mean it. // +#include #include QT_BEGIN_NAMESPACE diff --git a/src/platformsupport/input/evdevtouch/qevdevtouchhandler_p.h b/src/platformsupport/input/evdevtouch/qevdevtouchhandler_p.h index b29aa3a793..6554d4998c 100644 --- a/src/platformsupport/input/evdevtouch/qevdevtouchhandler_p.h +++ b/src/platformsupport/input/evdevtouch/qevdevtouchhandler_p.h @@ -51,6 +51,7 @@ // We mean it. // +#include #include #include #include diff --git a/src/plugins/bearer/bearer.pro b/src/plugins/bearer/bearer.pro index 8078a5708c..b362722b28 100644 --- a/src/plugins/bearer/bearer.pro +++ b/src/plugins/bearer/bearer.pro @@ -1,4 +1,5 @@ TEMPLATE = subdirs +QT_FOR_CONFIG += network-private !android:linux*:qtHaveModule(dbus) { SUBDIRS += generic diff --git a/src/plugins/generic/generic.pro b/src/plugins/generic/generic.pro index c0a81d4dc8..69e832906b 100644 --- a/src/plugins/generic/generic.pro +++ b/src/plugins/generic/generic.pro @@ -1,4 +1,5 @@ TEMPLATE = subdirs +QT_FOR_CONFIG += gui-private load(qfeatures) diff --git a/src/plugins/imageformats/imageformats.pro b/src/plugins/imageformats/imageformats.pro index d2588c1b18..9d1c0c8fdf 100644 --- a/src/plugins/imageformats/imageformats.pro +++ b/src/plugins/imageformats/imageformats.pro @@ -1,4 +1,5 @@ TEMPLATE = subdirs +QT_FOR_CONFIG += gui-private qtConfig(ico): SUBDIRS += ico qtConfig(jpeg): SUBDIRS += jpeg diff --git a/src/plugins/platforminputcontexts/platforminputcontexts.pro b/src/plugins/platforminputcontexts/platforminputcontexts.pro index f22b8b69db..ed6b1b8702 100644 --- a/src/plugins/platforminputcontexts/platforminputcontexts.pro +++ b/src/plugins/platforminputcontexts/platforminputcontexts.pro @@ -1,4 +1,5 @@ TEMPLATE = subdirs +QT_FOR_CONFIG += gui-private qtHaveModule(dbus) { !mac:!win32:SUBDIRS += ibus diff --git a/src/plugins/platforms/eglfs/deviceintegration/deviceintegration.pro b/src/plugins/platforms/eglfs/deviceintegration/deviceintegration.pro index b46b04d149..d86a67b4f4 100644 --- a/src/plugins/platforms/eglfs/deviceintegration/deviceintegration.pro +++ b/src/plugins/platforms/eglfs/deviceintegration/deviceintegration.pro @@ -1,4 +1,5 @@ TEMPLATE = subdirs +QT_FOR_CONFIG += gui-private qtConfig(egl_x11): SUBDIRS += eglfs_x11 qtConfig(eglfs_gbm): SUBDIRS += eglfs_kms_support eglfs_kms diff --git a/src/plugins/platforms/platforms.pro b/src/plugins/platforms/platforms.pro index fcfebf6e94..938e63d95a 100644 --- a/src/plugins/platforms/platforms.pro +++ b/src/plugins/platforms/platforms.pro @@ -1,4 +1,5 @@ TEMPLATE = subdirs +QT_FOR_CONFIG += gui-private android: SUBDIRS += android diff --git a/src/plugins/platforms/xcb/gl_integrations/gl_integrations.pro b/src/plugins/platforms/xcb/gl_integrations/gl_integrations.pro index 0cdee03f62..b8f878ffe8 100644 --- a/src/plugins/platforms/xcb/gl_integrations/gl_integrations.pro +++ b/src/plugins/platforms/xcb/gl_integrations/gl_integrations.pro @@ -1,4 +1,5 @@ TEMPLATE = subdirs +QT_FOR_CONFIG += gui-private qtConfig(egl):qtConfig(egl_x11):qtConfig(opengl) { SUBDIRS += xcb_egl diff --git a/src/plugins/platforms/xcb/qxcbconnection.h b/src/plugins/platforms/xcb/qxcbconnection.h index 6ad8a36460..f6ba828a15 100644 --- a/src/plugins/platforms/xcb/qxcbconnection.h +++ b/src/plugins/platforms/xcb/qxcbconnection.h @@ -43,6 +43,7 @@ #include #include +#include #include "qxcbexport.h" #include #include diff --git a/src/plugins/platforms/xcb/xcb.pro b/src/plugins/platforms/xcb/xcb.pro index 7840a4583f..0d27645a60 100644 --- a/src/plugins/platforms/xcb/xcb.pro +++ b/src/plugins/platforms/xcb/xcb.pro @@ -1,5 +1,6 @@ TEMPLATE = subdirs CONFIG += ordered +QT_FOR_CONFIG += gui-private !qtConfig(system-xcb): SUBDIRS += xcb-static diff --git a/src/plugins/platformthemes/platformthemes.pro b/src/plugins/platformthemes/platformthemes.pro index 166b39ce8c..0e2812bed3 100644 --- a/src/plugins/platformthemes/platformthemes.pro +++ b/src/plugins/platformthemes/platformthemes.pro @@ -1,3 +1,4 @@ TEMPLATE = subdirs +QT_FOR_CONFIG += widgets-private -qtConfig(gtk3): SUBDIRS += gtk3 +qtHaveModule(widgets):qtConfig(gtk3): SUBDIRS += gtk3 diff --git a/src/plugins/printsupport/printsupport.pro b/src/plugins/printsupport/printsupport.pro index 55feaba40c..05cf1bc0b2 100644 --- a/src/plugins/printsupport/printsupport.pro +++ b/src/plugins/printsupport/printsupport.pro @@ -1,5 +1,5 @@ -QT += printsupport TEMPLATE = subdirs +QT_FOR_CONFIG += printsupport-private osx: SUBDIRS += cocoa win32: SUBDIRS += windows diff --git a/src/plugins/sqldrivers/sqldrivers.pro b/src/plugins/sqldrivers/sqldrivers.pro index afd2008826..30fb6019ce 100644 --- a/src/plugins/sqldrivers/sqldrivers.pro +++ b/src/plugins/sqldrivers/sqldrivers.pro @@ -1,4 +1,5 @@ TEMPLATE = subdirs +QT_FOR_CONFIG += sql qtConfig(sql-psql) : SUBDIRS += psql qtConfig(sql-mysql) : SUBDIRS += mysql diff --git a/src/printsupport/configure.json b/src/printsupport/configure.json new file mode 100644 index 0000000000..986bb9d678 --- /dev/null +++ b/src/printsupport/configure.json @@ -0,0 +1,42 @@ +{ + "module": "printsupport", + "depends": [ + "core", + "gui", + "widgets" + ], + "testDir": "../../config.tests", + + "commandline": { + "options": { + "cups": "boolean" + } + }, + + "libraries": { + "cups": { + "description": "CUPS", + "test": "unix/cups", + "sources": [ + "-lcups" + ] + } + }, + + "features": { + "cups": { + "description": "CUPS", + "condition": "libs.cups", + "output": [ "privateFeature", "feature" ] + } + }, + + "summary": [ + { + "section": "Qt PrintSupport", + "entries": [ + "cups" + ] + } + ] +} diff --git a/src/printsupport/kernel/qtprintsupportglobal.h b/src/printsupport/kernel/qtprintsupportglobal.h index c060b98958..67779af5a2 100644 --- a/src/printsupport/kernel/qtprintsupportglobal.h +++ b/src/printsupport/kernel/qtprintsupportglobal.h @@ -41,6 +41,7 @@ #define QTPRINTSUPPORTGLOBAL_H #include +#include QT_BEGIN_NAMESPACE diff --git a/src/sql/configure.json b/src/sql/configure.json new file mode 100644 index 0000000000..2277fcb546 --- /dev/null +++ b/src/sql/configure.json @@ -0,0 +1,201 @@ +{ + "module": "sql", + "depends": [ + "core" + ], + "testDir": "../../config.tests", + + "commandline": { + "assignments": { + "MYSQL_PATH": "mysql.prefix", + "PSQL_LIBS": "psql.libs", + "SYBASE": "tds.prefix", + "SYBASE_LIBS": "tds.libs" + }, + "options": { + "mysql_config": "string", + "psql_config": "string", + "sqlite": { "type": "enum", "name": "system-sqlite", "values": { "qt": "no", "system": "yes" } }, + "sql-db2": "boolean", + "sql-ibase": "boolean", + "sql-mysql": "boolean", + "sql-oci": "boolean", + "sql-odbc": "boolean", + "sql-psql": "boolean", + "sql-sqlite": "boolean", + "sql-sqlite2": "boolean", + "sql-tds": "boolean", + "plugin-sql-db2": { "type": "void", "name": "sql-db2" }, + "plugin-sql-ibase": { "type": "void", "name": "sql-ibase" }, + "plugin-sql-mysql": { "type": "void", "name": "sql-mysql" }, + "plugin-sql-oci": { "type": "void", "name": "sql-oci" }, + "plugin-sql-odbc": { "type": "void", "name": "sql-odbc" }, + "plugin-sql-psql": { "type": "void", "name": "sql-psql" }, + "plugin-sql-sqlite": { "type": "void", "name": "sql-sqlite" }, + "plugin-sql-sqlite2": { "type": "void", "name": "sql-sqlite2" }, + "plugin-sql-tds": { "type": "void", "name": "sql-tds" } + } + }, + + "libraries": { + "db2": { + "description": "DB2 (IBM)", + "test": "unix/db2", + "sources": [ + { "libs": "-ldb2cli", "condition": "config.win32" }, + { "libs": "-ldb2", "condition": "!config.win32" } + ] + }, + "ibase": { + "description": "InterBase", + "test": "unix/ibase", + "sources": [ + { "libs": "-lgds32_ms", "condition": "config.win32" }, + { "libs": "-lgds", "condition": "!config.win32" } + ] + }, + "mysql": { + "description": "MySQL", + "test": "unix/mysql", + "sources": [ + { "type": "mysqlConfig", "query": "--libs_r" }, + { "type": "mysqlConfig", "query": "--libs" }, + { "libs": "-lmysqlclient_r", "condition": "!config.win32" }, + { "libs": "-llibmysql", "condition": "config.win32" }, + { "libs": "-lmysqlclient", "condition": "!config.win32" } + ] + }, + "psql": { + "description": "PostgreSQL", + "test": "unix/psql", + "sources": [ + { "type": "psqlConfig" }, + { "type": "psqlEnv", "libs": "-llibpq -lws2_32 -ladvapi32", "condition": "config.win32" }, + { "type": "psqlEnv", "libs": "-lpq", "condition": "!config.win32" } + ] + }, + "tds": { + "description": "TDS (Sybase)", + "test": "unix/tds", + "sources": [ + { "type": "sybaseEnv", "libs": "-lNTWDBLIB", "condition": "config.win32" }, + { "type": "sybaseEnv", "libs": "-lsybdb", "condition": "!config.win32" } + ] + }, + "oci": { + "description": "OCI (Oracle)", + "test": "unix/oci", + "sources": [ + { "libs": "-loci", "condition": "config.win32" }, + { "libs": "-lclntsh", "condition": "!config.win32" } + ] + }, + "odbc": { + "description": "ODBC", + "test": "unix/odbc", + "sources": [ + { "libs": "-lodbc32", "condition": "config.win32" }, + { "libs": "-liodbc", "condition": "config.darwin" }, + { "libs": "-lodbc", "condition": "!config.win32 && !config.darwin" } + ] + }, + "sqlite2": { + "description": "SQLite (version 2)", + "test": "unix/sqlite2", + "sources": [ + "-lsqlite" + ] + }, + "sqlite3": { + "description": "SQLite (version 3)", + "export": "sqlite", + "test": "unix/sqlite", + "sources": [ + { "type": "pkgConfig", "args": "sqlite3" }, + { "libs": "-lsqlite3", "condition": "config.win32" }, + { "libs": "-lsqlite3 -lz", "condition": "!config.win32" } + ] + } + }, + + "tests": { + }, + + "features": { + "sql-db2": { + "description": "DB2 (IBM)", + "condition": "libs.db2", + "output": [ "publicFeature" ] + }, + "sql-ibase": { + "description": "InterBase", + "condition": "libs.ibase", + "output": [ "publicFeature" ] + }, + "sql-mysql": { + "description": "MySql", + "condition": "libs.mysql", + "output": [ "publicFeature" ] + }, + "use_libmysqlclient_r": { + "description": "MySql (threadsafe)", + "condition": "features.sql-mysql && (libs.mysql.source == 0 || libs.mysql.source == 2)", + "output": [ "privateConfig" ] + }, + "sql-oci": { + "description": "OCI (Oracle)", + "condition": "libs.oci", + "output": [ "publicFeature" ] + }, + "sql-odbc": { + "description": "ODBC", + "condition": "libs.odbc", + "output": [ "publicFeature" ] + }, + "sql-psql": { + "description": "PostgreSQL", + "condition": "libs.psql", + "output": [ "publicFeature" ] + }, + "sql-sqlite2": { + "description": "SQLite2", + "condition": "libs.sqlite2", + "output": [ "publicFeature" ] + }, + "sql-sqlite": { + "description": "SQLite", + "output": [ "publicFeature" ] + }, + "system-sqlite": { + "description": " Using system provided SQLite", + "autoDetect": false, + "condition": "features.sql-sqlite && libs.sqlite3", + "output": [ "publicQtConfig" ] + }, + "sql-tds": { + "description": "TDS (Sybase)", + "condition": "libs.tds", + "output": [ "publicFeature" ] + } + }, + + "report": [ + { + "type": "warning", + "condition": "config.win32 && !config.msvc && features.sql-oci", + "message": "Qt does not support compiling the Oracle database driver with +MinGW, due to lack of such support from Oracle. Consider disabling the +Oracle driver, as the current build will most likely fail." + } + ], + + "summary": [ + { + "section": "Qt Sql", + "entries": [ + "sql-db2", "sql-ibase", "sql-mysql", "sql-oci", "sql-odbc", "sql-psql", + "sql-sqlite2", "sql-sqlite", "system-sqlite", "sql-tds" + ] + } + ] +} diff --git a/src/sql/configure.pri b/src/sql/configure.pri new file mode 100644 index 0000000000..948808f4f7 --- /dev/null +++ b/src/sql/configure.pri @@ -0,0 +1,89 @@ +# custom tests + +defineReplace(filterLibraryPath) { + str = $${1} + for (l, QMAKE_DEFAULT_LIBDIRS): \ + str -= "-L$$l" + + return($$str) +} + +defineTest(qtConfLibrary_psqlConfig) { + pg_config = $$config.input.psql_config + isEmpty(pg_config): \ + pg_config = $$qtConfFindInPath("pg_config") + !win32:!isEmpty(pg_config) { + qtRunLoggedCommand("$$pg_config --libdir", libdir)|return(false) + qtRunLoggedCommand("$$pg_config --includedir", includedir)|return(false) + libdir -= $$QMAKE_DEFAULT_LIBDIRS + libs = + !isEmpty(libdir): libs += "-L$$libdir" + libs += "-lpq" + $${1}.libs = "$$val_escape(libs)" + includedir -= $$QMAKE_DEFAULT_INCDIRS + $${1}.includedir = "$$val_escape(includedir)" + !isEmpty(includedir): \ + $${1}.cflags = "-I$$val_escape(includedir)" + export($${1}.libs) + export($${1}.includedir) + export($${1}.cflags) + return(true) + } + return(false) +} + +defineTest(qtConfLibrary_psqlEnv) { + # Respect PSQL_LIBS if set + PSQL_LIBS = $$getenv(PSQL_LIBS) + !isEmpty(PSQL_LIBS) { + $${1}.libs = $$PSQL_LIBS + export($${1}.libs) + } + return(true) +} + +defineTest(qtConfLibrary_mysqlConfig) { + mysql_config = $$config.input.mysql_config + isEmpty(mysql_config): \ + mysql_config = $$qtConfFindInPath("mysql_config") + !isEmpty(mysql_config) { + qtRunLoggedCommand("$$mysql_config --version", version)|return(false) + version = $$split(version, '.') + version = $$first(version) + isEmpty(version)|lessThan(version, 4): return(false)] + + # query is either --libs or --libs_r + query = $$eval($${1}.query) + qtRunLoggedCommand("$$mysql_config $$query", libs)|return(false) + qtRunLoggedCommand("$$mysql_config --include", includedir)|return(false) + eval(libs = $$libs) + libs = $$filterLibraryPath($$libs) + # -rdynamic should not be returned by mysql_config, but is on RHEL 6.6 + libs -= -rdynamic + $${1}.libs = "$$val_escape(libs)" + eval(includedir = $$includedir) + includedir ~= s/^-I//g + includedir -= $$QMAKE_DEFAULT_INCDIRS + $${1}.includedir = "$$val_escape(includedir)" + !isEmpty(includedir): \ + $${1}.cflags = "-I$$val_escape(includedir)" + export($${1}.libs) + export($${1}.includedir) + export($${1}.cflags) + return(true) + } + return(false) +} + +defineTest(qtConfLibrary_sybaseEnv) { + libs = + sybase = $$getenv(SYBASE) + !isEmpty(sybase): \ + libs += "-L$${sybase}/lib" + libs += $$getenv(SYBASE_LIBS) + !isEmpty(libs) { + $${1}.libs = "$$val_escape(libs)" + export($${1}.libs) + } + return(true) +} diff --git a/src/src.pro b/src/src.pro index 96a88a62ac..60d6a57e2a 100644 --- a/src/src.pro +++ b/src/src.pro @@ -1,5 +1,9 @@ TEMPLATE = subdirs +QT_FOR_CONFIG += gui-private +include($$OUT_PWD/corelib/qtcore-config.pri) +include($$OUT_PWD/gui/qtgui-config.pri) + src_qtzlib.file = $$PWD/corelib/qtzlib.pro src_qtzlib.target = sub-zlib diff --git a/src/widgets/configure.json b/src/widgets/configure.json new file mode 100644 index 0000000000..23ee540c32 --- /dev/null +++ b/src/widgets/configure.json @@ -0,0 +1,97 @@ +{ + "module": "widgets", + "depends": [ + "core-private", + "gui" + ], + "testDir": "../../config.tests", + + "commandline": { + "options": { + "android-style-assets": "boolean", + "gtk": { "type": "boolean", "name": "gtk3" }, + "style-windows": "boolean", + "style-windowsxp": "boolean", + "style-windowsvista": "boolean", + "style-fusion": "boolean", + "style-mac": "boolean", + "style-android": "boolean" + } + }, + + "libraries": { + "gtk3": { + "description": "GTK+", + "sources": [ + { "type": "pkgConfig", "args": "gtk+-3.0" } + ] + } + }, + + "tests": { + "uxtheme": { + "description": "uxtheme.h", + "type": "files", + "files": [ "uxtheme.h" ] + } + }, + + "features": { + "gtk3": { + "description": "GTK+", + "autoDetect": "!config.darwin", + "condition": "features.glib && libs.gtk3", + "output": [ "privateFeature" ] + }, + "style-fusion": { + "description": "Fusion Style", + "output": [ "styles" ] + }, + "style-mac": { + "description": "Mac Style", + "condition": "config.osx", + "output": [ "styles" ] + }, + "style-windows": { + "description": "Windows Style", + "output": [ "styles" ] + }, + "style-windowsxp": { + "description": "Windows XP Style", + "condition": "features.style-windows && config.win32 && !config.winrt && tests.uxtheme", + "output": [ "styles" ] + }, + "style-windowsvista": { + "description": "Windows Vista Style", + "condition": "features.style-windowsxp", + "output": [ "styles" ] + }, + "style-android": { + "description": "Android Style", + "autoDetect": "config.android", + "output": [ "styles" ] + }, + "android-style-assets": { + "description": "Android Style Assets", + "condition": "features.style-android", + "output": [ "privateConfig" ] + } + }, + + "report": [ + ], + + "summary": [ + { + "section": "Qt Widgets", + "entries": [ + "gtk3", + { + "message": "Styles", + "type": "featureList", + "args": "style-fusion style-mac style-windows style-windowsxp style-windowsvista style-android" + } + ] + } + ] +} diff --git a/src/widgets/configure.pri b/src/widgets/configure.pri new file mode 100644 index 0000000000..ddb3657700 --- /dev/null +++ b/src/widgets/configure.pri @@ -0,0 +1,8 @@ +# custom outputs + +defineTest(qtConfOutput_styles) { + !$${2}: return() + + style = $$replace($${1}.feature, "style-", "") + qtConfOutputVar(append, "privatePro", "styles", $$style) +} diff --git a/src/widgets/kernel/qtwidgetsglobal.h b/src/widgets/kernel/qtwidgetsglobal.h index f6d003e629..1c74f37618 100644 --- a/src/widgets/kernel/qtwidgetsglobal.h +++ b/src/widgets/kernel/qtwidgetsglobal.h @@ -41,6 +41,7 @@ #define QTWIDGETSGLOBAL_H #include +#include QT_BEGIN_NAMESPACE diff --git a/src/widgets/kernel/qtwidgetsglobal_p.h b/src/widgets/kernel/qtwidgetsglobal_p.h index 7dd545415c..22ba876022 100644 --- a/src/widgets/kernel/qtwidgetsglobal_p.h +++ b/src/widgets/kernel/qtwidgetsglobal_p.h @@ -53,5 +53,6 @@ #include #include +#include #endif // QTWIDGETSGLOBAL_P_H diff --git a/src/widgets/styles/styles.pri b/src/widgets/styles/styles.pri index 7b9497172c..69e13fb6ec 100644 --- a/src/widgets/styles/styles.pri +++ b/src/widgets/styles/styles.pri @@ -35,6 +35,8 @@ SOURCES += \ RESOURCES += styles/qstyle.qrc +include($$OUT_PWD/qtwidgets-config.pri) + contains( styles, mac ) { HEADERS += \ styles/qmacstyle_mac_p.h \ -- cgit v1.2.3 From b754b2815d342334f335816b901c051940954942 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 26 Aug 2016 21:10:56 +0200 Subject: rename description => label in configure.json "description" suggests something slightly longer. this may seem like a gratuitous change, but the upcoming replacement of the old feature system clarifies makes it seem much less so. Change-Id: Ibe702e01cb146b59127bf1f990b4acaef1c61d55 Reviewed-by: Lars Knoll --- src/corelib/configure.json | 118 +++++++++++----------- src/gui/configure.json | 212 ++++++++++++++++++++-------------------- src/network/configure.json | 38 +++---- src/printsupport/configure.json | 4 +- src/sql/configure.json | 40 ++++---- src/widgets/configure.json | 20 ++-- 6 files changed, 216 insertions(+), 216 deletions(-) (limited to 'src') diff --git a/src/corelib/configure.json b/src/corelib/configure.json index 4cccab9f5d..887e1ea5bf 100644 --- a/src/corelib/configure.json +++ b/src/corelib/configure.json @@ -21,21 +21,21 @@ "libraries": { "doubleconversion": { - "description": "DoubleConversion", + "label": "DoubleConversion", "test": "unix/doubleconversion", "sources": [ "-ldouble-conversion" ] }, "glib": { - "description": "GLib", + "label": "GLib", "test": "unix/glib", "sources": [ { "type": "pkgConfig", "args": "glib-2.0 gthread-2.0" } ] }, "gnu_iconv": { - "description": "GNU libiconv", + "label": "GNU libiconv", "export": "iconv", "test": "unix/gnu-libiconv", "sources": [ @@ -43,7 +43,7 @@ ] }, "icu": { - "description": "ICU", + "label": "ICU", "export": "", "test": "unix/icu", "sources": [ @@ -59,7 +59,7 @@ ] }, "journald": { - "description": "journald", + "label": "journald", "test": "unix/journald", "export": "", "sources": [ @@ -68,14 +68,14 @@ ] }, "libatomic": { - "description": "64 bit atomics in libatomic", + "label": "64 bit atomics in libatomic", "test": "common/atomic64", "sources": [ "-latomic" ] }, "libdl": { - "description": "dlopen() in libdl", + "label": "dlopen() in libdl", "export": "", "test": "unix/dlopen", "sources": [ @@ -83,21 +83,21 @@ ] }, "pcre": { - "description": "PCRE", + "label": "PCRE", "test": "unix/pcre", "sources": [ "-lpcre16" ] }, "pps": { - "description": "PPS", + "label": "PPS", "test": "unix/pps", "sources": [ "-lpps" ] }, "slog2": { - "description": "slog2", + "label": "slog2", "test": "unix/slog2", "export": "", "sources": [ @@ -108,92 +108,92 @@ "tests": { "atomic64": { - "description": "64 bit atomics", + "label": "64 bit atomics", "type": "compile", "test": "common/atomic64" }, "atomicfptr": { - "description": "working std::atomic for function pointers", + "label": "working std::atomic for function pointers", "type": "compile", "test": "common/atomicfptr" }, "clock-gettime": { - "description": "clock_gettime()", + "label": "clock_gettime()", "type": "compile", "test": "unix/clock-gettime" }, "clock-monotonic": { - "description": "POSIX monotonic clock", + "label": "POSIX monotonic clock", "type": "compile", "test": "unix/clock-monotonic" }, "cloexec": { - "description": "O_CLOEXEC", + "label": "O_CLOEXEC", "type": "compile", "test": "unix/cloexec" }, "dlopen": { - "description": "dlopen() in libc", + "label": "dlopen() in libc", "type": "compile", "test": "unix/dlopen" }, "eventfd": { - "description": "eventfd", + "label": "eventfd", "type": "compile", "test": "unix/eventfd" }, "posix-iconv": { - "description": "POSIX iconv", + "label": "POSIX iconv", "type": "compile", "test": "unix/iconv" }, "sun-iconv": { - "description": "SUN libiconv", + "label": "SUN libiconv", "type": "compile", "test": "unix/sun-libiconv" }, "inotify": { - "description": "inotify", + "label": "inotify", "type": "compile", "test": "unix/inotify" }, "ipc_sysv": { - "description": "SysV IPC", + "label": "SysV IPC", "type": "compile", "test": "unix/ipc_sysv" }, "ipc_posix": { - "description": "POSIX IPC", + "label": "POSIX IPC", "type": "compile", "test": "unix/ipc_posix" }, "journald": { - "description": "journald", + "label": "journald", "type": "compile", "test": "unix/journald" }, "ppoll": { - "description": "ppoll()", + "label": "ppoll()", "type": "compile", "test": "unix/ppoll" }, "pollts": { - "description": "pollts()", + "label": "pollts()", "type": "compile", "test": "unix/pollts" }, "poll": { - "description": "poll()", + "label": "poll()", "type": "compile", "test": "unix/poll" }, "syslog": { - "description": "syslog", + "label": "syslog", "type": "compile", "test": "unix/syslog" }, "xlocalescanprint": { - "description": "xlocale.h (or equivalents)", + "label": "xlocale.h (or equivalents)", "type": "compile", "test": "common/xlocalescanprint" } @@ -201,111 +201,111 @@ "features": { "clock-gettime": { - "description": "clock_gettime()", + "label": "clock_gettime()", "condition": "tests.clock-gettime", "output": [ "privateFeature" ] }, "clock-monotonic": { - "description": "POSIX monotonic clock", + "label": "POSIX monotonic clock", "condition": "features.clock-gettime && tests.clock-monotonic", "output": [ "feature" ] }, "dlopen": { - "description": "dlopen()", + "label": "dlopen()", "condition": "tests.dlopen || libs.libdl", "output": [ { "type": "define", "negative": true, "name": "QT_NO_DYNAMIC_LIBRARY" } ] }, "libdl": { - "description": "dlopen() in libdl", + "label": "dlopen() in libdl", "condition": "!tests.dlopen && libs.libdl", "output": [ { "type": "privateConfig", "negative": true } ] }, "doubleconversion": { - "description": "DoubleConversion", + "label": "DoubleConversion", "output": [ "privateFeature", "feature" ] }, "system-doubleconversion": { - "description": " Using system DoubleConversion", + "label": " Using system DoubleConversion", "enable": "input.doubleconversion == 'system'", "disable": "input.doubleconversion == 'qt'", "condition": "features.doubleconversion && libs.doubleconversion", "output": [ "privateFeature" ] }, "eventfd": { - "description": "eventfd", + "label": "eventfd", "condition": "tests.eventfd", "output": [ "feature" ] }, "glib": { - "description": "GLib", + "label": "GLib", "autoDetect": "!config.win32", "condition": "libs.glib", "output": [ "privateFeature", "feature" ] }, "iconv": { - "description": "iconv", + "label": "iconv", "condition": "features.posix-libiconv || features.sun-libiconv || features.gnu-libiconv", "output": [ "privateFeature", "feature" ] }, "posix-libiconv": { - "description": "POSIX iconv", + "label": "POSIX iconv", "enable": "input.iconv == 'posix'", "disable": "input.iconv == 'sun' || input.iconv == 'gnu' || input.iconv == 'no'", "condition": "!config.win32 && !config.qnx && !config.android && !config.darwin && tests.posix-iconv" }, "sun-libiconv": { - "description": "SUN iconv", + "label": "SUN iconv", "enable": "input.iconv == 'sun'", "disable": "input.iconv == 'posix' || input.iconv == 'gnu' || input.iconv == 'no'", "condition": "!config.win32 && !config.qnx && !config.android && !config.darwin && !features.posix-libiconv && tests.sun-iconv", "output": [ "privateFeature", "publicQtConfig" ] }, "gnu-libiconv": { - "description": "GNU iconv", + "label": "GNU iconv", "enable": "input.iconv == 'gnu'", "disable": "input.iconv == 'posix' || input.iconv == 'sun' || input.iconv == 'no'", "condition": "!config.win32 && !config.qnx && !config.android && !config.darwin && !features.posix-libiconv && !features.sun-libiconv && libs.gnu_iconv", "output": [ "privateFeature" ] }, "icu": { - "description": "ICU", + "label": "ICU", "autoDetect": "!config.win32", "condition": "libs.icu", "output": [ "privateFeature" ] }, "inotify": { - "description": "inotify", + "label": "inotify", "condition": "tests.inotify", "output": [ "privateFeature", "feature" ] }, "ipc_posix": { - "description": "Using POSIX IPC", + "label": "Using POSIX IPC", "autoDetect": "!config.win32", "condition": "!tests.ipc_sysv && tests.ipc_posix", "output": [ { "type": "define", "name": "QT_POSIX_IPC" } ] }, "journald": { - "description": "journald", + "label": "journald", "autoDetect": false, "condition": "libs.journald", "output": [ "privateConfig" ] }, "std-atomic64": { - "description": "64 bit atomic operations", + "label": "64 bit atomic operations", "condition": "tests.atomic64 || libs.libatomic", "output": [ { "type": "define", "negative": true, "name": "QT_NO_STD_ATOMIC64" } ] }, "libatomic": { - "description": "64 bit atomic operations in libatomic", + "label": "64 bit atomic operations in libatomic", "condition": "!tests.atomic64 && libs.libatomic", "output": [ "privateFeature" ] }, "mimetype": { - "description": "Mimetype handling", + "label": "Mimetype handling", "output": [ "publicFeature", "feature" ] }, "system-pcre": { - "description": "Using system PCRE", + "label": "Using system PCRE", "disable": "input.pcre == 'qt'", "enable": "input.pcre == 'system'", "condition": "libs.pcre", @@ -315,25 +315,25 @@ ] }, "poll_ppoll": { - "description": "Native ppoll()", + "label": "Native ppoll()", "emitIf": "!config.win32", "condition": "tests.ppoll", "output": [ "privateFeature" ] }, "poll_pollts": { - "description": "Native pollts()", + "label": "Native pollts()", "emitIf": "!config.win32", "condition": "!features.poll_ppoll && tests.pollts", "output": [ "privateFeature" ] }, "poll_poll": { - "description": "Native poll()", + "label": "Native poll()", "emitIf": "!config.win32", "condition": "!features.poll_ppoll && !features.poll_pollts && tests.poll", "output": [ "privateFeature" ] }, "poll_select": { - "description": "Emulated poll()", + "label": "Emulated poll()", "emitIf": "!config.win32", "condition": "!features.poll_ppoll && !features.poll_pollts && !features.poll_poll", "output": [ @@ -342,39 +342,39 @@ ] }, "qqnx_pps": { - "description": "PPS", + "label": "PPS", "emitIf": "config.qnx", "condition": "libs.pps", "output": [ "privateConfig" ] }, "qeventtransition": { - "description": "QEventTransition class", + "label": "QEventTransition class", "output": [ "publicFeature" ] }, "sharedmemory": { - "description": "Enable QSharedMemory", + "label": "Enable QSharedMemory", "condition": "config.android || config.win32 || tests.ipc_sysv || tests.ipc_posix", "output": [ { "type": "define", "negative": true, "name": "QT_NO_SHAREDMEMORY" } ] }, "slog2": { - "description": "slog2", + "label": "slog2", "condition": "libs.slog2", "emitIf": "config.qnx", "output": [ "privateConfig" ] }, "syslog": { - "description": "syslog", + "label": "syslog", "autoDetect": false, "condition": "tests.syslog", "output": [ "privateConfig" ] }, "systemsemaphore": { - "description": "Enable QSystemSemaphore", + "label": "Enable QSystemSemaphore", "condition": "config.android || config.win32 || tests.ipc_sysv || tests.ipc_posix", "output": [ { "type": "define", "negative": true, "name": "QT_NO_SYSTEMSEMAPHORE" } ] }, "threadsafe-cloexec": { - "description": "Threadsafe pipe creation", + "label": "Threadsafe pipe creation", "condition": "tests.cloexec", "output": [ "publicQtConfig", diff --git a/src/gui/configure.json b/src/gui/configure.json index c662c0a524..8513bff5d0 100644 --- a/src/gui/configure.json +++ b/src/gui/configure.json @@ -55,14 +55,14 @@ ] }, "directfb": { - "description": "DirectFB", + "label": "DirectFB", "test": "qpa/directfb", "sources": [ { "type": "pkgConfig", "args": "directfb" } ] }, "directwrite": { - "description": "DirectWrite", + "label": "DirectWrite", "export": "", "test": "win/directwrite", "sources": [ @@ -70,7 +70,7 @@ ] }, "drm": { - "description": "KMS", + "label": "KMS", "test": "qpa/kms", "sources": [ { "type": "pkgConfig", "args": "libdrm" }, @@ -78,7 +78,7 @@ ] }, "egl": { - "description": "EGL", + "label": "EGL", "test": "qpa/egl", "sources": [ { "type": "pkgConfig", "args": "egl" }, @@ -86,7 +86,7 @@ ] }, "freetype": { - "description": "FreeType", + "label": "FreeType", "export": "", "test": "unix/freetype", "sources": [ @@ -94,7 +94,7 @@ ] }, "fontconfig": { - "description": "Fontconfig", + "label": "Fontconfig", "test": "unix/fontconfig", "sources": [ { "type": "pkgConfig", "args": "fontconfig freetype2" }, @@ -102,21 +102,21 @@ ] }, "gbm": { - "description": "GBM", + "label": "GBM", "test": "qpa/gbm", "sources": [ { "type": "pkgConfig", "args": "gbm" } ] }, "harfbuzz": { - "description": "HarfBuzz", + "label": "HarfBuzz", "test": "unix/harfbuzz", "sources": [ "-lharfbuzz" ] }, "imf": { - "description": "IMF", + "label": "IMF", "export": "", "test": "unix/qqnx_imf", "sources": [ @@ -124,21 +124,21 @@ ] }, "lgmon": { - "description": "lgmon", + "label": "lgmon", "test": "unix/lgmon", "sources": [ "-llgmon" ] }, "libinput": { - "description": "libinput", + "label": "libinput", "test": "unix/libinput", "sources": [ { "type": "pkgConfig", "args": "libinput" } ] }, "libjpeg": { - "description": "libjpeg", + "label": "libjpeg", "test": "unix/libjpeg", "sources": [ { "libs": "-llibjpeg", "condition": "config.msvc" }, @@ -146,7 +146,7 @@ ] }, "libpng": { - "description": "libpng", + "label": "libpng", "test": "unix/libpng", "sources": [ { "type": "pkgConfig", "args": "libpng" }, @@ -155,7 +155,7 @@ ] }, "mirclient": { - "description": "Mir client libraries", + "label": "Mir client libraries", "export": "", "test": "qpa/mirclient", "sources": [ @@ -163,7 +163,7 @@ ] }, "mtdev": { - "description": "mtdev", + "label": "mtdev", "export": "", "test": "unix/mtdev", "sources": [ @@ -171,7 +171,7 @@ ] }, "opengl": { - "description": "Desktop OpenGL", + "label": "Desktop OpenGL", "test": "unix/opengldesktop", "sources": [ { "type": "pkgConfig", "args": "gl" }, @@ -179,7 +179,7 @@ ] }, "opengl_es2": { - "description": "OpenGL ES 2.0", + "label": "OpenGL ES 2.0", "test": "unix/opengles2", "sources": [ { "type": "pkgConfig", "args": "glesv2" }, @@ -187,14 +187,14 @@ ] }, "tslib": { - "description": "tslib", + "label": "tslib", "test": "unix/tslib", "sources": [ "-lts" ] }, "wayland_server": { - "description": "Wayland Server", + "label": "Wayland Server", "export": "", "test": "qpa/wayland-server", "sources": [ @@ -202,13 +202,13 @@ ] }, "x11sm": { - "description": "X11 session management", + "label": "X11 session management", "sources": [ { "type": "pkgConfig", "args": "sm ice" } ] }, "xcb": { - "description": "XCB >= 1.5 (core)", + "label": "XCB >= 1.5 (core)", "test": "qpa/xcb", "sources": [ { "type": "pkgConfig", "args": "xcb >= 1.5" }, @@ -216,7 +216,7 @@ ] }, "xcb_syslibs": { - "description": "XCB (secondary)", + "label": "XCB (secondary)", "test": "qpa/xcb-syslibs", "sources": [ { "type": "pkgConfig", @@ -225,7 +225,7 @@ ] }, "xcb_xlib": { - "description": "XCB Xlib", + "label": "XCB Xlib", "test": "qpa/xcb-xlib", "sources": [ { "type": "pkgConfig", "args": "X11-xcb x11 xcb" }, @@ -233,7 +233,7 @@ ] }, "xcb_xkb": { - "description": "XCB XKB >= 1.10", + "label": "XCB XKB >= 1.10", "test": "qpa/xcb-xkb", "sources": [ { "type": "pkgConfig", "args": "xcb-xkb >= 1.10 xcb" }, @@ -241,7 +241,7 @@ ] }, "xcb_render": { - "description": "XCB XRender", + "label": "XCB XRender", "test": "qpa/xcb-render", "sources": [ { "type": "pkgConfig", "args": "xcb-renderutil xcb-render xcb" }, @@ -249,7 +249,7 @@ ] }, "xcb_glx": { - "description": "XCB GLX", + "label": "XCB GLX", "test": "qpa/xcb-glx", "sources": [ { "type": "pkgConfig", "args": "xcb-glx xcb" }, @@ -257,7 +257,7 @@ ] }, "xinput2": { - "description": "Xinput2", + "label": "Xinput2", "test": "x11/xinput2", "sources": [ { "type": "pkgConfig", "args": "xi" }, @@ -265,7 +265,7 @@ ] }, "xkbcommon": { - "description": "xkbcommon", + "label": "xkbcommon", "export": "xkbcommon_evdev", "test": "unix/xkbcommon", "sources": [ @@ -273,14 +273,14 @@ ] }, "xkbcommon_x11": { - "description": "xkbcommon-x11 >= 0.4.1", + "label": "xkbcommon-x11 >= 0.4.1", "export": "xkbcommon", "sources": [ { "type": "pkgConfig", "args": "xkbcommon xkbcommon-x11 >= 0.4.1" } ] }, "xrender": { - "description": "XRender", + "label": "XRender", "test": "x11/xrender", "sources": [ "-lXrender" @@ -295,19 +295,19 @@ "tests": { "direct2d": { - "description": "Direct 2D", + "label": "Direct 2D", "type": "compile", "test": "qpa/direct2d", "use": "direct2d" }, "directwrite2": { - "description": "DirectWrite 2", + "label": "DirectWrite 2", "type": "compile", "test": "win/directwrite2", "use": "directwrite" }, "directx": { - "description": "DirectX SDK", + "label": "DirectX SDK", "type": "directX", "files": [ "d3dcompiler.h", @@ -316,70 +316,70 @@ ] }, "egl-x11": { - "description": "EGL on X11", + "label": "EGL on X11", "type": "compile", "test": "qpa/egl-x11", "use": "egl xcb_xlib" }, "egl-brcm": { - "description": "Broadcom EGL (Rasberry Pi)", + "label": "Broadcom EGL (Rasberry Pi)", "type": "compile", "test": "qpa/eglfs-brcm", "use": "egl bcm_host" }, "egl-egldevice": { - "description": "EGLDevice", + "label": "EGLDevice", "type": "compile", "test": "qpa/eglfs-egldevice", "use": "egl" }, "egl-mali": { - "description": "Mali EGL", + "label": "Mali EGL", "type": "compile", "test": "qpa/eglfs-mali", "use": "egl" }, "egl-mali-2": { - "description": "Mali 2 EGL", + "label": "Mali 2 EGL", "type": "compile", "test": "qpa/eglfs-mali-2", "use": "egl" }, "egl-viv": { - "description": "i.Mx6 EGL", + "label": "i.Mx6 EGL", "type": "compile", "test": "qpa/eglfs-viv", "use": "egl" }, "evdev": { - "description": "evdev", + "label": "evdev", "type": "compile", "test": "unix/evdev" }, "linuxfb": { - "description": "LinuxFB", + "label": "LinuxFB", "type": "compile", "test": "qpa/linuxfb" }, "opengles3": { - "description": "OpenGL ES 3.0", + "label": "OpenGL ES 3.0", "type": "compile", "test": "unix/opengles3", "use": "opengl_es2" }, "opengles31": { - "description": "OpenGL ES 3.1", + "label": "OpenGL ES 3.1", "type": "compile", "test": "unix/opengles31", "use": "opengl_es2" }, "qpa_default_platform": { - "description": "default QPA platform", + "label": "default QPA platform", "type": "qpaDefaultPlatform", "log": "value" }, "x11prefix": { - "description": "X11 prefix", + "label": "X11 prefix", "type": "getPkgConfigVariable", "pkg-config-args": "x11", "pkg-config-variable": "prefix", @@ -387,14 +387,14 @@ "log": "value" }, "xkbconfigroot": { - "description": "XKB config root", + "label": "XKB config root", "type": "xkbConfigRoot", "pkg-config-args": "xkeyboard-config", "pkg-config-variable": "xkb_base", "log": "value" }, "xlib": { - "description": "XLib", + "label": "XLib", "type": "compile", "test": "x11/xlib" } @@ -402,12 +402,12 @@ "features": { "accessibility-atspi-bridge": { - "description": "ATSPI Bridge", + "label": "ATSPI Bridge", "condition": "features.accessibility && features.xcb && features.dbus", "output": [ "privateFeature", "feature" ] }, "angle": { - "description": "ANGLE", + "label": "ANGLE", "autoDetect": "features.opengles2 || features.opengl-dynamic", "condition": "config.win32 && tests.directx", "output": [ @@ -416,40 +416,40 @@ ] }, "directfb": { - "description": "DirectFB", + "label": "DirectFB", "autoDetect": false, "condition": "libs.directfb", "output": [ "privateFeature" ] }, "directwrite": { - "description": "DirectWrite", + "label": "DirectWrite", "emitIf": "config.win32", "condition": "libs.directwrite", "output": [ "privateFeature" ] }, "directwrite2": { - "description": "DirectWrite 2", + "label": "DirectWrite 2", "emitIf": "config.win32", "condition": "features.directwrite && tests.directwrite2", "output": [ "privateFeature" ] }, "direct2d": { - "description": "Direct 2D", + "label": "Direct 2D", "autoDetect": false, "condition": "tests.direct2d", "output": [ "privateFeature" ] }, "evdev": { - "description": "evdev", + "label": "evdev", "condition": "tests.evdev", "output": [ "privateFeature" ] }, "freetype": { - "description": "FreeType", + "label": "FreeType", "output": [ "privateFeature", "feature" ] }, "system-freetype": { - "description": " Using system FreeType", + "label": " Using system FreeType", "enable": "input.freetype == 'system'", "disable": "input.freetype == 'qt'", "autoDetect": "!config.win32", @@ -457,21 +457,21 @@ "output": [ "privateFeature" ] }, "fontconfig": { - "description": "Fontconfig", + "label": "Fontconfig", "condition": "!config.win32 && !config.darwin && features.system-freetype && libs.fontconfig", "output": [ "privateFeature", "feature" ] }, "gbm": { - "description": "GBM", + "label": "GBM", "condition": "libs.gbm", "output": [ "publicQtConfig" ] }, "harfbuzz": { - "description": "HarfBuzz", + "label": "HarfBuzz", "output": [ "privateFeature", "feature" ] }, "system-harfbuzz": { - "description": " Using system HarfBuzz", + "label": " Using system HarfBuzz", "enable": "input.harfbuzz == 'system'", "disable": "input.harfbuzz == 'qt'", "autoDetect": "!config.darwin && !config.win32", @@ -479,49 +479,49 @@ "output": [ "privateFeature" ] }, "qqnx_imf": { - "description": "IMF", + "label": "IMF", "emitIf": "config.qnx", "condition": "libs.imf", "output": [ "privateConfig" ] }, "integrityfb": { - "description": "INTEGRITY framebuffer", + "label": "INTEGRITY framebuffer", "condition": "config.integrity", "output": [ "privateFeature" ] }, "kms": { - "description": "KMS", + "label": "KMS", "condition": "libs.drm", "output": [ "publicQtConfig" ] }, "libinput": { - "description": "libinput", + "label": "libinput", "condition": "features.libudev && libs.libinput", "output": [ "privateFeature" ] }, "lgmon": { - "description": "lgmon", + "label": "lgmon", "emitIf": "config.qnx", "condition": "libs.lgmon", "output": [ "privateConfig" ] }, "linuxfb": { - "description": "LinuxFB", + "label": "LinuxFB", "condition": "tests.linuxfb", "output": [ "privateFeature" ] }, "mirclient": { - "description": "Mir client", + "label": "Mir client", "condition": "libs.mirclient", "output": [ "privateFeature" ] }, "mtdev": { - "description": "mtdev", + "label": "mtdev", "condition": "libs.mtdev", "output": [ "privateFeature" ] }, "opengles2": { - "description": "OpenGL ES 2.0", + "label": "OpenGL ES 2.0", "enable": "input.opengl == 'es2'", "disable": "input.opengl == 'desktop' || input.opengl == 'dynamic' || input.opengl == 'no'", "condition": "config.win32 || (!config.watchos && !features.opengl-desktop && libs.opengl_es2)", @@ -533,7 +533,7 @@ ] }, "opengles3": { - "description": "OpenGL ES 3.0", + "label": "OpenGL ES 3.0", "condition": "features.opengles2 && !features.angle && tests.opengles3", "output": [ "publicFeature", @@ -541,7 +541,7 @@ ] }, "opengles31": { - "description": "OpenGL ES 3.1", + "label": "OpenGL ES 3.1", "condition": "features.opengles3 && tests.opengles31", "output": [ "publicFeature", @@ -549,14 +549,14 @@ ] }, "opengl-desktop": { - "description": "Desktop OpenGL", + "label": "Desktop OpenGL", "enable": "input.opengl == 'desktop'", "disable": "input.opengl == 'es2' || input.opengl == 'dynamic' || input.opengl == 'no'", "condition": "(config.win32 && !config.winrt && !features.opengles2 && (config.msvc || libs.opengl)) || (!config.watchos && !config.win32 && libs.opengl)" }, "opengl-dynamic": { - "description": "Dynamic OpenGL", + "label": "Dynamic OpenGL", "enable": "input.opengl == 'dynamic'", "autoDetect": false, "condition": "config.win32 && !config.winrt", @@ -566,69 +566,69 @@ ] }, "opengl": { - "description": "OpenGL", + "label": "OpenGL", "condition": "features.opengl-desktop || features.opengl-dynamic || features.opengles2", "output": [ "publicFeature", "feature" ] }, "egl": { - "description": "EGL", + "label": "EGL", "condition": "features.opengl && (features.angle || libs.egl)", "output": [ "privateFeature", "feature" ] }, "egl_x11": { - "description": "EGL on X11", + "label": "EGL on X11", "condition": "features.egl && tests.egl-x11", "output": [ "privateFeature" ] }, "eglfs": { - "description": "EGLFS", + "label": "EGLFS", "autoDetect": "!config.android && !config.win32", "condition": "features.egl", "output": [ "privateFeature" ] }, "eglfs_brcm": { - "description": "EGLFS Rasberry Pi", + "label": "EGLFS Rasberry Pi", "condition": "features.eglfs && tests.egl-brcm", "output": [ "privateFeature" ] }, "eglfs_egldevice": { - "description": "EGLFS EGLDevice", + "label": "EGLFS EGLDevice", "condition": "features.eglfs && tests.egl-egldevice && features.kms", "output": [ "privateFeature" ] }, "eglfs_gbm": { - "description": "EGLFS GBM", + "label": "EGLFS GBM", "condition": "features.eglfs && features.gbm && features.kms", "output": [ "privateFeature" ] }, "eglfs_mali": { - "description": "EGLFS Mali", + "label": "EGLFS Mali", "condition": "features.eglfs && (tests.egl-mali || tests.egl-mali-2)", "output": [ "privateFeature" ] }, "eglfs_viv": { - "description": "EGLFS i.Mx6", + "label": "EGLFS i.Mx6", "condition": "features.eglfs && tests.egl-viv", "output": [ "privateFeature" ] }, "eglfs_viv_wl": { - "description": "EGLFS i.Mx6 Wayland", + "label": "EGLFS i.Mx6 Wayland", "condition": "features.eglfs_viv && libs.wayland_server", "output": [ "privateFeature" ] }, "gif": { - "description": "GIF", + "label": "GIF", "output": [ "privateFeature", { "type": "define", "negative": true, "name": "QT_NO_IMAGEFORMAT_GIF" } ] }, "ico": { - "description": "ICO", + "label": "ICO", "output": [ "privateFeature", "feature" ] }, "jpeg": { - "description": "JPEG", + "label": "JPEG", "disable": "input.libjpeg == 'no'", "output": [ "privateFeature", @@ -636,14 +636,14 @@ ] }, "system-jpeg": { - "description": " Using system libjpeg", + "label": " Using system libjpeg", "disable": "input.libjpeg == 'qt'", "enable": "input.libjpeg == 'system'", "condition": "features.jpeg && libs.libjpeg", "output": [ "privateFeature" ] }, "png": { - "description": "PNG", + "label": "PNG", "disable": "input.libpng == 'no'", "output": [ "privateFeature", @@ -651,14 +651,14 @@ ] }, "system-png": { - "description": " Using system libpng", + "label": " Using system libpng", "disable": "input.libpng == 'qt'", "enable": "input.libpng == 'system'", "condition": "features.png && libs.libpng", "output": [ "privateFeature" ] }, "qpa_default_platform": { - "description": "QPA default platform", + "label": "QPA default platform", "condition": "features.gui", "output": [ { "type": "define", "name": "QT_QPA_DEFAULT_PLATFORM_NAME", "value": "tests.qpa_default_platform.name" }, @@ -667,22 +667,22 @@ ] }, "sessionmanager": { - "description": "Session Management", + "label": "Session Management", "output": [ "feature" ] }, "tslib": { - "description": "tslib", + "label": "tslib", "condition": "libs.tslib", "output": [ "privateFeature" ] }, "xcb": { - "description": "XCB", + "label": "XCB", "autoDetect": "!config.darwin", "condition": "libs.xcb", "output": [ "privateFeature" ] }, "system-xcb": { - "description": "Using system provided XCB libraries", + "label": "Using system provided XCB libraries", "enable": "input.xcb == 'system' || input.xcb == 'yes'", "disable": "input.xcb == 'qt' || input.xcb == 'no'", "autoDetect": "!config.darwin", @@ -690,46 +690,46 @@ "output": [ "privateFeature" ] }, "x11-prefix": { - "description": "X11 prefix", + "label": "X11 prefix", "emitIf": "features.xcb", "output": [ { "type": "varAssign", "name": "QMAKE_X11_PREFIX", "value": "tests.x11prefix.value" } ] }, "xcb-glx": { - "description": "XCB GLX", + "label": "XCB GLX", "emitIf": "features.xcb", "condition": "libs.xcb_glx", "output": [ "privateFeature" ] }, "xcb-render": { - "description": "XCB render", + "label": "XCB render", "emitIf": "features.system-xcb", "condition": "libs.xcb_render", "output": [ "privateFeature" ] }, "xcb-xlib": { - "description": "XCB Xlib", + "label": "XCB Xlib", "emitIf": "features.xcb", "condition": "libs.xcb_xlib", "output": [ "privateFeature" ] }, "xcb-sm": { - "description": "xcb-sm", + "label": "xcb-sm", "emitIf": "features.xcb", "condition": "features.sessionmanager && libs.x11sm", "output": [ "privateFeature" ] }, "xinput2": { - "description": "Xinput2", + "label": "Xinput2", "condition": "libs.xinput2", "output": [ "privateFeature" ] }, "xkbcommon-evdev": { - "description": "xkbcommon-evdev", + "label": "xkbcommon-evdev", "condition": "libs.xkbcommon", "output": [ "privateFeature" ] }, "xkbcommon-system": { - "description": "Using system-provided xkbcommon", + "label": "Using system-provided xkbcommon", "emitIf": "features.xcb", "enable": "input.xkbcommon == 'system'", "disable": "input.xkbcommon == 'qt' || input.xkbcommon == 'no'", @@ -737,23 +737,23 @@ "output": [ "privateFeature" ] }, "xkb": { - "description": "XCB XKB", + "label": "XCB XKB", "condition": "features.system-xcb && libs.xcb_xkb", "output": [ "privateFeature" ] }, "xkb-config-root": { - "description": "XKB config root", + "label": "XKB config root", "emitIf": "features.xcb", "condition": "features.xcb && !features.xkbcommon-system && tests.xkbconfigroot", "output": [ { "type": "varAssign", "name": "QMAKE_XKB_CONFIG_ROOT", "value": "tests.xkbconfigroot.value"} ] }, "xlib": { - "description": "XLib", + "label": "XLib", "condition": "tests.xlib", "output": [ "privateFeature" ] }, "xrender": { - "description": "Xrender", + "label": "Xrender", "condition": "libs.xrender", "output": [ "privateFeature", "feature" ] } diff --git a/src/network/configure.json b/src/network/configure.json index a647439b19..3372d177c3 100644 --- a/src/network/configure.json +++ b/src/network/configure.json @@ -26,7 +26,7 @@ "libraries": { "corewlan": { - "description": "CoreWLan", + "label": "CoreWLan", "export": "", "test": "mac/corewlan", "sources": [ @@ -40,14 +40,14 @@ ] }, "libproxy": { - "description": "libproxy", + "label": "libproxy", "test": "common/libproxy", "sources": [ "-lproxy" ] }, "openssl": { - "description": "OpenSSL Libraries", + "label": "OpenSSL Libraries", "export": "", "sources": [ { "type": "openssl" }, @@ -68,30 +68,30 @@ "tests": { "getaddrinfo": { - "description": "getaddrinfo()", + "label": "getaddrinfo()", "type": "compile", "test": "unix/getaddrinfo", "use": "network" }, "getifaddrs": { - "description": "getifaddrs()", + "label": "getifaddrs()", "type": "compile", "test": "unix/getifaddrs", "use": "network" }, "ipv6ifname": { - "description": "IPv6 ifname", + "label": "IPv6 ifname", "type": "compile", "test": "unix/ipv6ifname", "use": "network" }, "openssl": { - "description": "OpenSSL", + "label": "OpenSSL", "type": "compile", "test": "unix/openssl" }, "sctp": { - "description": "SCTP support", + "label": "SCTP support", "type": "compile", "test": "unix/sctp", "use": "network" @@ -100,34 +100,34 @@ "features": { "corewlan": { - "description": "CoreWLan", + "label": "CoreWLan", "condition": "libs.corewlan", "emitIf": "config.darwin", "output": [ "feature", "privateFeature" ] }, "getaddrinfo": { - "description": "getaddrinfo()", + "label": "getaddrinfo()", "condition": "tests.getaddrinfo", "output": [ "feature" ] }, "getifaddrs": { - "description": "getifaddrs()", + "label": "getifaddrs()", "condition": "tests.getifaddrs", "output": [ "feature" ] }, "ipv6ifname": { - "description": "IPv6 ifname", + "label": "IPv6 ifname", "condition": "tests.ipv6ifname", "output": [ "feature" ] }, "libproxy": { - "description": "libproxy", + "label": "libproxy", "autoDetect": false, "condition": "libs.libproxy", "output": [ "privateFeature" ] }, "openssl": { - "description": "OpenSSL", + "label": "OpenSSL", "enable": "input.openssl == 'yes' || input.openssl == 'linked' || input.openssl == 'runtime'", "disable": "input.openssl == 'no' || input.ssl == 'no'", "autoDetect": "!config.winrt", @@ -139,7 +139,7 @@ ] }, "openssl-linked": { - "description": " Qt directly linked to OpenSSL", + "label": " Qt directly linked to OpenSSL", "enable": "input.openssl == 'linked'", "disable": "input.openssl != 'linked'", "condition": "features.openssl && libs.openssl", @@ -154,7 +154,7 @@ ] }, "securetransport": { - "description": "SecureTransport", + "label": "SecureTransport", "disable": "input.securetransport == 'no' || input.ssl == 'no'", "condition": "config.darwin && (input.openssl == '' || input.openssl == 'no')", "output": [ @@ -163,18 +163,18 @@ ] }, "ssl": { - "description": "SSL", + "label": "SSL", "condition": "config.winrt || features.securetransport || features.openssl", "output": [ "publicFeature", "feature" ] }, "sctp": { - "description": "SCTP", + "label": "SCTP", "autoDetect": false, "condition": "tests.sctp", "output": [ "publicFeature", "feature" ] }, "system-proxies": { - "description": "Use system proxies", + "label": "Use system proxies", "output": [ "privateFeature" ] } }, diff --git a/src/printsupport/configure.json b/src/printsupport/configure.json index 986bb9d678..6bf4208e9c 100644 --- a/src/printsupport/configure.json +++ b/src/printsupport/configure.json @@ -15,7 +15,7 @@ "libraries": { "cups": { - "description": "CUPS", + "label": "CUPS", "test": "unix/cups", "sources": [ "-lcups" @@ -25,7 +25,7 @@ "features": { "cups": { - "description": "CUPS", + "label": "CUPS", "condition": "libs.cups", "output": [ "privateFeature", "feature" ] } diff --git a/src/sql/configure.json b/src/sql/configure.json index 2277fcb546..d1dc198656 100644 --- a/src/sql/configure.json +++ b/src/sql/configure.json @@ -39,7 +39,7 @@ "libraries": { "db2": { - "description": "DB2 (IBM)", + "label": "DB2 (IBM)", "test": "unix/db2", "sources": [ { "libs": "-ldb2cli", "condition": "config.win32" }, @@ -47,7 +47,7 @@ ] }, "ibase": { - "description": "InterBase", + "label": "InterBase", "test": "unix/ibase", "sources": [ { "libs": "-lgds32_ms", "condition": "config.win32" }, @@ -55,7 +55,7 @@ ] }, "mysql": { - "description": "MySQL", + "label": "MySQL", "test": "unix/mysql", "sources": [ { "type": "mysqlConfig", "query": "--libs_r" }, @@ -66,7 +66,7 @@ ] }, "psql": { - "description": "PostgreSQL", + "label": "PostgreSQL", "test": "unix/psql", "sources": [ { "type": "psqlConfig" }, @@ -75,7 +75,7 @@ ] }, "tds": { - "description": "TDS (Sybase)", + "label": "TDS (Sybase)", "test": "unix/tds", "sources": [ { "type": "sybaseEnv", "libs": "-lNTWDBLIB", "condition": "config.win32" }, @@ -83,7 +83,7 @@ ] }, "oci": { - "description": "OCI (Oracle)", + "label": "OCI (Oracle)", "test": "unix/oci", "sources": [ { "libs": "-loci", "condition": "config.win32" }, @@ -91,7 +91,7 @@ ] }, "odbc": { - "description": "ODBC", + "label": "ODBC", "test": "unix/odbc", "sources": [ { "libs": "-lodbc32", "condition": "config.win32" }, @@ -100,14 +100,14 @@ ] }, "sqlite2": { - "description": "SQLite (version 2)", + "label": "SQLite (version 2)", "test": "unix/sqlite2", "sources": [ "-lsqlite" ] }, "sqlite3": { - "description": "SQLite (version 3)", + "label": "SQLite (version 3)", "export": "sqlite", "test": "unix/sqlite", "sources": [ @@ -123,57 +123,57 @@ "features": { "sql-db2": { - "description": "DB2 (IBM)", + "label": "DB2 (IBM)", "condition": "libs.db2", "output": [ "publicFeature" ] }, "sql-ibase": { - "description": "InterBase", + "label": "InterBase", "condition": "libs.ibase", "output": [ "publicFeature" ] }, "sql-mysql": { - "description": "MySql", + "label": "MySql", "condition": "libs.mysql", "output": [ "publicFeature" ] }, "use_libmysqlclient_r": { - "description": "MySql (threadsafe)", + "label": "MySql (threadsafe)", "condition": "features.sql-mysql && (libs.mysql.source == 0 || libs.mysql.source == 2)", "output": [ "privateConfig" ] }, "sql-oci": { - "description": "OCI (Oracle)", + "label": "OCI (Oracle)", "condition": "libs.oci", "output": [ "publicFeature" ] }, "sql-odbc": { - "description": "ODBC", + "label": "ODBC", "condition": "libs.odbc", "output": [ "publicFeature" ] }, "sql-psql": { - "description": "PostgreSQL", + "label": "PostgreSQL", "condition": "libs.psql", "output": [ "publicFeature" ] }, "sql-sqlite2": { - "description": "SQLite2", + "label": "SQLite2", "condition": "libs.sqlite2", "output": [ "publicFeature" ] }, "sql-sqlite": { - "description": "SQLite", + "label": "SQLite", "output": [ "publicFeature" ] }, "system-sqlite": { - "description": " Using system provided SQLite", + "label": " Using system provided SQLite", "autoDetect": false, "condition": "features.sql-sqlite && libs.sqlite3", "output": [ "publicQtConfig" ] }, "sql-tds": { - "description": "TDS (Sybase)", + "label": "TDS (Sybase)", "condition": "libs.tds", "output": [ "publicFeature" ] } diff --git a/src/widgets/configure.json b/src/widgets/configure.json index 23ee540c32..2c1f8b1e6c 100644 --- a/src/widgets/configure.json +++ b/src/widgets/configure.json @@ -21,7 +21,7 @@ "libraries": { "gtk3": { - "description": "GTK+", + "label": "GTK+", "sources": [ { "type": "pkgConfig", "args": "gtk+-3.0" } ] @@ -30,7 +30,7 @@ "tests": { "uxtheme": { - "description": "uxtheme.h", + "label": "uxtheme.h", "type": "files", "files": [ "uxtheme.h" ] } @@ -38,41 +38,41 @@ "features": { "gtk3": { - "description": "GTK+", + "label": "GTK+", "autoDetect": "!config.darwin", "condition": "features.glib && libs.gtk3", "output": [ "privateFeature" ] }, "style-fusion": { - "description": "Fusion Style", + "label": "Fusion Style", "output": [ "styles" ] }, "style-mac": { - "description": "Mac Style", + "label": "Mac Style", "condition": "config.osx", "output": [ "styles" ] }, "style-windows": { - "description": "Windows Style", + "label": "Windows Style", "output": [ "styles" ] }, "style-windowsxp": { - "description": "Windows XP Style", + "label": "Windows XP Style", "condition": "features.style-windows && config.win32 && !config.winrt && tests.uxtheme", "output": [ "styles" ] }, "style-windowsvista": { - "description": "Windows Vista Style", + "label": "Windows Vista Style", "condition": "features.style-windowsxp", "output": [ "styles" ] }, "style-android": { - "description": "Android Style", + "label": "Android Style", "autoDetect": "config.android", "output": [ "styles" ] }, "android-style-assets": { - "description": "Android Style Assets", + "label": "Android Style Assets", "condition": "features.style-android", "output": [ "privateConfig" ] } -- cgit v1.2.3 From b22471edf9ff666e87b12398460dfd6e761bc24c Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Thu, 8 Sep 2016 15:04:53 +0200 Subject: Make things compile with the printer feature disabled Always include qtprintsupportglobal.h before checking the ifdef, and add ifdef's where they where missing. Change-Id: I535dce33b26955fb0196ea05d54be41fe93e9151 Reviewed-by: Jake Petroules Reviewed-by: Oswald Buddenhagen --- src/printsupport/dialogs/qprintdialog_unix.cpp | 1 + src/printsupport/dialogs/qprintdialog_win.cpp | 2 ++ src/printsupport/kernel/qpaintengine_alpha.cpp | 2 +- src/printsupport/kernel/qplatformprintplugin.cpp | 4 ++++ src/printsupport/kernel/qplatformprintplugin.h | 4 ++++ src/printsupport/kernel/qprintengine_win.cpp | 2 ++ 6 files changed, 14 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/printsupport/dialogs/qprintdialog_unix.cpp b/src/printsupport/dialogs/qprintdialog_unix.cpp index 9b08ffe4df..4d8299b115 100644 --- a/src/printsupport/dialogs/qprintdialog_unix.cpp +++ b/src/printsupport/dialogs/qprintdialog_unix.cpp @@ -38,6 +38,7 @@ ****************************************************************************/ #include "qplatformdefs.h" +#include #ifndef QT_NO_PRINTDIALOG diff --git a/src/printsupport/dialogs/qprintdialog_win.cpp b/src/printsupport/dialogs/qprintdialog_win.cpp index 93d09bc745..2e954a508d 100644 --- a/src/printsupport/dialogs/qprintdialog_win.cpp +++ b/src/printsupport/dialogs/qprintdialog_win.cpp @@ -37,6 +37,8 @@ ** ****************************************************************************/ +#include + #ifndef QT_NO_PRINTDIALOG #include "qprintdialog.h" diff --git a/src/printsupport/kernel/qpaintengine_alpha.cpp b/src/printsupport/kernel/qpaintengine_alpha.cpp index 939322cc07..cae5c2f522 100644 --- a/src/printsupport/kernel/qpaintengine_alpha.cpp +++ b/src/printsupport/kernel/qpaintengine_alpha.cpp @@ -37,7 +37,7 @@ ** ****************************************************************************/ -#include +#include #ifndef QT_NO_PRINTER #include diff --git a/src/printsupport/kernel/qplatformprintplugin.cpp b/src/printsupport/kernel/qplatformprintplugin.cpp index b50f43056b..9bc4b61829 100644 --- a/src/printsupport/kernel/qplatformprintplugin.cpp +++ b/src/printsupport/kernel/qplatformprintplugin.cpp @@ -43,6 +43,8 @@ #include "private/qfactoryloader_p.h" #include +#ifndef QT_NO_PRINTER + QT_BEGIN_NAMESPACE Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader, @@ -86,3 +88,5 @@ QPlatformPrinterSupport *QPlatformPrinterSupportPlugin::get() } QT_END_NAMESPACE + +#endif diff --git a/src/printsupport/kernel/qplatformprintplugin.h b/src/printsupport/kernel/qplatformprintplugin.h index 3e909519c2..30e8f7938a 100644 --- a/src/printsupport/kernel/qplatformprintplugin.h +++ b/src/printsupport/kernel/qplatformprintplugin.h @@ -53,6 +53,8 @@ #include #include +#ifndef QT_NO_PRINTER + QT_BEGIN_NAMESPACE @@ -74,4 +76,6 @@ public: QT_END_NAMESPACE +#endif + #endif // QPLATFORMPRINTPLUGIN_H diff --git a/src/printsupport/kernel/qprintengine_win.cpp b/src/printsupport/kernel/qprintengine_win.cpp index 36c873c4f6..706a7c4b02 100644 --- a/src/printsupport/kernel/qprintengine_win.cpp +++ b/src/printsupport/kernel/qprintengine_win.cpp @@ -37,6 +37,8 @@ ** ****************************************************************************/ +#include + #ifndef QT_NO_PRINTER #include "qprintengine_win_p.h" -- cgit v1.2.3 From a668c6a6b605ce516f71b9339df53699e85ad248 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Fri, 26 Aug 2016 21:19:12 +0200 Subject: Convert the old feature system ... to the new qmake based configuration system. This removes the old qfeatures.txt (distributed over configure.json files) and qfeatures.h (distributed over qconfig-.h files). qfeatures.prf is gone without replacement, as attempts to use it would lead to followup errors anyway. Change-Id: I1598de19db937082283a905b9592d3849d2199d0 Reviewed-by: Oswald Buddenhagen --- src/corelib/configure.json | 177 +++++++++++++++ src/corelib/corelib.pro | 3 +- src/corelib/tools/tools.pri | 2 +- src/gui/configure.json | 192 +++++++++++++++- src/network/configure.json | 58 +++++ src/plugins/generic/generic.pro | 6 +- src/plugins/plugins.pro | 11 +- src/printsupport/configure.json | 30 +++ src/src.pro | 2 +- src/widgets/configure.json | 470 ++++++++++++++++++++++++++++++++++++++++ src/xml/configure.json | 16 ++ src/xml/qtxmlglobal.h | 3 + 12 files changed, 955 insertions(+), 15 deletions(-) create mode 100644 src/xml/configure.json (limited to 'src') diff --git a/src/corelib/configure.json b/src/corelib/configure.json index 887e1ea5bf..b0c78f5122 100644 --- a/src/corelib/configure.json +++ b/src/corelib/configure.json @@ -244,6 +244,8 @@ }, "iconv": { "label": "iconv", + "purpose": "Provides internationalization on Unix.", + "section": "Internationalization", "condition": "features.posix-libiconv || features.sun-libiconv || features.gnu-libiconv", "output": [ "privateFeature", "feature" ] }, @@ -302,6 +304,8 @@ }, "mimetype": { "label": "Mimetype handling", + "purpose": "Provides MIME type handling.", + "section": "Utilities", "output": [ "publicFeature", "feature" ] }, "system-pcre": { @@ -380,6 +384,179 @@ "publicQtConfig", { "type": "define", "name": "QT_THREADSAFE_CLOEXEC", "value": 1 } ] + }, + "properties": { + "label": "Properties", + "purpose": "Supports scripting Qt-based applications.", + "section": "Kernel", + "output": [ "publicFeature", "feature" ] + }, + "regularexpression": { + "label": "QRegularExpression", + "purpose": "Provides an API to Perl-compatible regular expressions.", + "section": "Kernel", + "output": [ "publicFeature", "feature" ] + }, + "sharedmemory": { + "label": "QSharedMemory", + "purpose": "Provides access to a shared memory segment.", + "section": "Kernel", + "output": [ "publicFeature", "feature" ] + }, + "systemsemaphore": { + "label": "QSystemSemaphore", + "purpose": "Provides a general counting system semaphore.", + "section": "Kernel", + "output": [ "publicFeature", "feature" ] + }, + "xmlstream": { + "label": "XML Streaming APIs", + "purpose": "Provides a simple streaming API for XML.", + "section": "Kernel", + "output": [ "publicFeature", "feature" ] + }, + "xmlstreamreader": { + "label": "QXmlStreamReader", + "purpose": "Provides a well-formed XML parser with a simple streaming API.", + "section": "Kernel", + "condition": "features.xmlstream", + "output": [ "publicFeature", "feature" ] + }, + "xmlstreamwriter": { + "label": "QXmlStreamWriter", + "purpose": "Provides a XML writer with a simple streaming API.", + "section": "Kernel", + "condition": "features.xmlstream", + "output": [ "publicFeature", "feature" ] + }, + "textdate": { + "label": "Text Date", + "purpose": "Supports month and day names in dates.", + "section": "Data structures", + "output": [ "publicFeature", "feature" ] + }, + "datestring": { + "label": "QDate/QTime/QDateTime", + "purpose": "Provides convertion between dates and strings.", + "section": "Data structures", + "condition": "features.textdate", + "output": [ "publicFeature", "feature" ] + }, + "process": { + "label": "QProcess", + "purpose": "Supports external process invocation.", + "section": "File I/O", + "output": [ "publicFeature", "feature" ] + }, + "temporaryfile": { + "label": "QTemporaryFile", + "purpose": "Provides an I/O device that operates on temporary files.", + "section": "File I/O", + "output": [ "publicFeature", "feature" ] + }, + "library": { + "label": "QLibrary", + "purpose": "Provides a wrapper for dynamically loaded libraries.", + "section": "File I/O", + "output": [ "publicFeature", "feature" ] + }, + "settings": { + "label": "QSettings", + "purpose": "Provides persistent application settings.", + "section": "File I/O", + "output": [ "publicFeature", "feature" ] + }, + "filesystemwatcher": { + "label": "QFileSystemWatcher", + "purpose": "Provides an interface for monitoring files and directories for modifications.", + "section": "File I/O", + "output": [ "publicFeature", "feature" ] + }, + "filesystemiterator": { + "label": "QFileSystemIterator", + "purpose": "Provides fast file system iteration.", + "section": "File I/O", + "output": [ "publicFeature", "feature" ] + }, + "itemmodel": { + "label": "Qt Item Model", + "purpose": "Provides the item model for item views", + "section": "ItemViews", + "output": [ "publicFeature", "feature" ] + }, + "proxymodel": { + "label": "QAbstractProxyModel", + "purpose": "Supports processing of data passed between another model and a view.", + "section": "ItemViews", + "condition": "features.itemmodel", + "output": [ "publicFeature", "feature" ] + }, + "sortfilterproxymodel": { + "label": "QSortFilterProxyModel", + "purpose": "Supports sorting and filtering of data passed between another model and a view.", + "section": "ItemViews", + "condition": "features.proxymodel", + "output": [ "publicFeature", "feature" ] + }, + "identityproxymodel": { + "label": "QIdentityProxyModel", + "purpose": "Supports proxying a source model unmodified.", + "section": "ItemViews", + "condition": "features.proxymodel", + "output": [ "publicFeature", "feature" ] + }, + "stringlistmodel": { + "label": "QStringListModel", + "purpose": "Provides a model that supplies strings to views.", + "section": "ItemViews", + "condition": "features.itemmodel", + "output": [ "publicFeature", "feature" ] + }, + "translation": { + "label": "Translation", + "purpose": "Supports translations using QObject::tr().", + "section": "Internationalization", + "output": [ "publicFeature", "feature" ] + }, + "textcodec": { + "label": "QTextCodec", + "purpose": "Supports conversions between text encodings.", + "section": "Internationalization", + "output": [ "publicFeature", "feature" ] + }, + "codecs": { + "label": "Codecs", + "purpose": "Supports non-unicode text conversions.", + "section": "Internationalization", + "condition": "features.textcodec", + "output": [ "publicFeature", "feature" ] + }, + "big_codecs": { + "label": "Big Codecs", + "purpose": "Supports big codecs, e.g. CJK.", + "section": "Internationalization", + "condition": "features.textcodec", + "output": [ "publicFeature", "feature" ] + }, + "animation": { + "label": "Animation", + "purpose": "Provides a framework for animations.", + "section": "Utilities", + "condition": "features.properties", + "output": [ "publicFeature", "feature" ] + }, + "statemachine": { + "label": "State machine", + "purpose": "Provides hierarchical finite state machines.", + "section": "Utilities", + "condition": "features.properties", + "output": [ "publicFeature", "feature" ] + }, + "gestures": { + "label": "Gesture", + "purpose": "Provides a framework for gestures.", + "section": "Utilities", + "output": [ "publicFeature", "feature" ] } }, diff --git a/src/corelib/corelib.pro b/src/corelib/corelib.pro index 1db814180b..616a9641a1 100644 --- a/src/corelib/corelib.pro +++ b/src/corelib/corelib.pro @@ -31,8 +31,6 @@ ANDROID_PERMISSIONS = \ # OpenBSD 6.0 will include environ in libc. freebsd|openbsd: QMAKE_LFLAGS_NOUNDEF = -load(qfeatures) - include(animation/animation.pri) include(arch/arch.pri) include(global/global.pri) @@ -100,6 +98,7 @@ cmake_umbrella_config_version_file.output = $$DESTDIR/cmake/Qt5/Qt5ConfigVersion load(cmake_functions) +##### This requires fixing, so that the feature system works with cmake as well CMAKE_DISABLED_FEATURES = $$join(QT_DISABLED_FEATURES, "$$escape_expand(\\n) ") CMAKE_HOST_DATA_DIR = $$cmakeRelativePath($$[QT_HOST_DATA/src], $$[QT_INSTALL_PREFIX]) diff --git a/src/corelib/tools/tools.pri b/src/corelib/tools/tools.pri index 7ebd9cf710..e3d89651e4 100644 --- a/src/corelib/tools/tools.pri +++ b/src/corelib/tools/tools.pri @@ -168,7 +168,7 @@ qtConfig(icu) { SOURCES += tools/qcollator_posix.cpp } -!contains(QT_DISABLED_FEATURES, regularexpression) { +qtConfig(regularexpression) { include($$PWD/../../3rdparty/pcre_dependency.pri) HEADERS += tools/qregularexpression.h diff --git a/src/gui/configure.json b/src/gui/configure.json index 8513bff5d0..46014188e5 100644 --- a/src/gui/configure.json +++ b/src/gui/configure.json @@ -668,7 +668,9 @@ }, "sessionmanager": { "label": "Session Management", - "output": [ "feature" ] + "purpose": "Provides an interface to the windowing system's session management.", + "section": "Kernel", + "output": [ "publicFeature", "feature" ] }, "tslib": { "label": "tslib", @@ -756,6 +758,194 @@ "label": "Xrender", "condition": "libs.xrender", "output": [ "privateFeature", "feature" ] + }, + "texthtmlparser": { + "label": "HtmlParser", + "purpose": "Provides a parser for HTML.", + "section": "Kernel", + "output": [ "publicFeature", "feature" ] + }, + "textodfwriter": { + "label": "OdfWriter", + "purpose": "Provides an ODF writer.", + "section": "Kernel", + "condition": "features.xmlstreamwriter", + "output": [ "publicFeature", "feature" ] + }, + "cssparser": { + "label": "CssParser", + "purpose": "Provides a parser for Cascading Style Sheets.", + "section": "Kernel", + "output": [ "publicFeature", "feature" ] + }, + "draganddrop": { + "label": "Drag and Drop", + "purpose": "Supports the drag and drop mechansim.", + "section": "Kernel", + "condition": "features.imageformat_xpm", + "output": [ "publicFeature", "feature" ] + }, + "shortcut": { + "label": "QShortcut", + "purpose": "Provides keyboard accelerators and shortcuts.", + "section": "Kernel", + "output": [ "publicFeature", "feature" ] + }, + "action": { + "label": "QAction", + "purpose": "Provides widget actions.", + "section": "Kernel", + "output": [ "publicFeature", "feature" ] + }, + "cursor": { + "label": "QCursor", + "purpose": "Provides mouse cursors.", + "section": "Kernel", + "output": [ "publicFeature", "feature" ] + }, + "clipboard": { + "label": "QClipboard", + "purpose": "Provides cut and paste operations.", + "section": "Kernel", + "condition": "!config.integrity && !config.qnx", + "output": [ "publicFeature", "feature" ] + }, + "wheelevent": { + "label": "QWheelEvent", + "purpose": "Supports wheel events.", + "section": "Kernel", + "output": [ "publicFeature", "feature" ] + }, + "tabletevent": { + "label": "QTabletEvent", + "purpose": "Supports tablet events.", + "section": "Kernel", + "output": [ "publicFeature", "feature" ] + }, + "im": { + "label": "QInputContext", + "purpose": "Provides complex input methods.", + "section": "Kernel", + "condition": "features.library", + "output": [ "publicFeature", "feature" ] + }, + "validator": { + "label": "QValidator", + "purpose": "Supports validation of input text.", + "section": "Widgets", + "output": [ "publicFeature", "feature" ] + }, + "standarditemmodel": { + "label": "QStandardItemModel", + "purpose": "Provides a generic model for storing custom data.", + "section": "ItemViews", + "condition": "features.itemmodel", + "output": [ "publicFeature", "feature" ] + }, + "imageformatplugin": { + "label": "QImageIOPlugin", + "purpose": "Provides a base for writing a image format plugins.", + "section": "Images", + "condition": "features.library", + "output": [ "publicFeature", "feature" ] + }, + "movie": { + "label": "QMovie", + "purpose": "Supports animated images.", + "section": "Images", + "output": [ "publicFeature", "feature" ] + }, + "imageformat_bmp": { + "label": "BMP Image Format", + "purpose": "Supports Microsoft's Bitmap image file format.", + "section": "Images", + "output": [ "publicFeature", "feature" ] + }, + "imageformat_ppm": { + "label": "PPM Image Format", + "purpose": "Supports the Portable Pixmap image file format.", + "section": "Images", + "output": [ "publicFeature", "feature" ] + }, + "imageformat_xbm": { + "label": "XBM Image Format", + "purpose": "Supports the X11 Bitmap image file format.", + "section": "Images", + "output": [ "publicFeature", "feature" ] + }, + "imageformat_xpm": { + "label": "XPM Image Format", + "purpose": "Supports the X11 Pixmap image file format.", + "section": "Images", + "output": [ "publicFeature", "feature" ] + }, + "imageformat_png": { + "label": "PNG Image Format", + "purpose": "Supports the Portable Network Graphics image file format.", + "section": "Images", + "output": [ "publicFeature", "feature" ] + }, + "imageformat_jpeg": { + "label": "JPEG Image Format", + "purpose": "Supports the Joint Photographic Experts Group image file format.", + "section": "Images", + "output": [ "publicFeature", "feature" ] + }, + "image_heuristic_mask": { + "label": "QImage::createHeuristicMask()", + "purpose": "Supports creating a 1-bpp heuristic mask for images.", + "section": "Images", + "output": [ "publicFeature", "feature" ] + }, + "image_text": { + "label": "Image Text", + "purpose": "Supports image file text strings.", + "section": "Images", + "output": [ "publicFeature", "feature" ] + }, + "picture": { + "label": "QPicture", + "purpose": "Supports recording and replaying QPainter commands.", + "section": "Painting", + "output": [ "publicFeature", "feature" ] + }, + "colornames": { + "label": "Color Names", + "purpose": "Supports color names such as \"red\", used by QColor and by some HTML documents.", + "section": "Painting", + "output": [ "publicFeature", "feature" ] + }, + "pdf": { + "label": "QPdf", + "purpose": "Provides a PDF backend for QPainter.", + "section": "Painting", + "condition": "features.temporaryfile", + "output": [ "publicFeature", "feature" ] + }, + "freetype": { + "label": "Freetype Font Engine", + "purpose": "Supports the FreeType 2 font engine (and its supported font formats).", + "section": "Fonts", + "output": [ "publicFeature", "feature" ] + }, + "desktopservices": { + "label": "QDesktopServices", + "purpose": "Provides methods for accessing common desktop services.", + "section": "Utilities", + "output": [ "publicFeature", "feature" ] + }, + "systemtrayicon": { + "label": "QSystemTrayIcon", + "purpose": "Provides an icon for an application in the system tray.", + "section": "Utilities", + "output": [ "publicFeature", "feature" ] + }, + "accessibility": { + "label": "Accessibility", + "purpose": "Provides accessibility support.", + "section": "Utilities", + "condition": "features.properties", + "output": [ "publicFeature", "feature" ] } }, diff --git a/src/network/configure.json b/src/network/configure.json index 3372d177c3..97bf92167d 100644 --- a/src/network/configure.json +++ b/src/network/configure.json @@ -176,6 +176,64 @@ "system-proxies": { "label": "Use system proxies", "output": [ "privateFeature" ] + }, + "ftp": { + "label": "FTP", + "purpose": "Provides support for the File Transfer Protocol in QNetworkAccessManager.", + "section": "Networking", + "condition": "features.textdate", + "output": [ "publicFeature", "feature" ] + }, + "http": { + "label": "HTTP", + "purpose": "Provides support for the Hypertext Transfer Protocol in QNetworkAccessManager.", + "section": "Networking", + "output": [ "publicFeature", "feature" ] + }, + "udpsocket": { + "label": "QUdpSocket", + "purpose": "Provides access to UDP sockets.", + "section": "Networking", + "output": [ "publicFeature", "feature" ] + }, + "networkproxy": { + "label": "QNetworkProxy", + "purpose": "Provides network proxy support.", + "section": "Networking", + "output": [ "publicFeature", "feature" ] + }, + "socks5": { + "label": "SOCKS5", + "purpose": "Provides SOCKS5 support in QNetworkProxy.", + "section": "Networking", + "output": [ "publicFeature", "feature" ] + }, + "networkinterface": { + "label": "QNetworkInterface", + "purpose": "Supports enumerating a host's IP addresses and network interfaces.", + "section": "Networking", + "output": [ "publicFeature", "feature" ] + }, + "networkdiskcache": { + "label": "QNetworkDiskCache", + "purpose": "Provides a disk cache for network resources.", + "section": "Networking", + "condition": "features.temporaryfile", + "output": [ "publicFeature", "feature" ] + }, + "bearermanagement": { + "label": "Bearer management", + "purpose": "Provides bearer management for the network stack.", + "section": "Networking", + "condition": "features.library && features.networkinterface && features.properties", + "output": [ "publicFeature", "feature" ] + }, + "localserver": { + "label": "QLocalServer", + "purpose": "Provides a local socket based server.", + "section": "Networking", + "condition": "features.temporaryfile", + "output": [ "publicFeature", "feature" ] } }, diff --git a/src/plugins/generic/generic.pro b/src/plugins/generic/generic.pro index 69e832906b..996e57d015 100644 --- a/src/plugins/generic/generic.pro +++ b/src/plugins/generic/generic.pro @@ -1,7 +1,5 @@ TEMPLATE = subdirs -QT_FOR_CONFIG += gui-private - -load(qfeatures) +QT_FOR_CONFIG += gui-private network-private qtConfig(evdev) { SUBDIRS += evdevmouse evdevtouch evdevkeyboard evdevtablet @@ -11,7 +9,7 @@ qtConfig(tslib) { SUBDIRS += tslib } -!contains(QT_DISABLED_FEATURES, udpsocket) { +qtConfig(udpsocket) { SUBDIRS += tuiotouch } diff --git a/src/plugins/plugins.pro b/src/plugins/plugins.pro index 0f4207c636..941c25361f 100644 --- a/src/plugins/plugins.pro +++ b/src/plugins/plugins.pro @@ -1,14 +1,13 @@ TEMPLATE = subdirs +QT_FOR_CONFIG += network -load(qfeatures) SUBDIRS *= sqldrivers -qtHaveModule(network):!contains(QT_DISABLED_FEATURES, bearermanagement): SUBDIRS += bearer +qtHaveModule(network):qtConfig(bearermanagement): SUBDIRS += bearer qtHaveModule(gui) { SUBDIRS *= platforms platforminputcontexts platformthemes - !contains(QT_DISABLED_FEATURES, imageformatplugin): SUBDIRS *= imageformats - !android:!contains(QT_DISABLED_FEATURES, library): SUBDIRS *= generic + qtConfig(imageformatplugin): SUBDIRS *= imageformats + !android:qtConfig(library): SUBDIRS *= generic } -!winrt:!wince*:qtHaveModule(widgets):!contains(QT_DISABLED_FEATURES, printer) { +!winrt:!wince:qtHaveModule(printsupport): \ SUBDIRS += printsupport -} diff --git a/src/printsupport/configure.json b/src/printsupport/configure.json index 6bf4208e9c..439f2dbdd8 100644 --- a/src/printsupport/configure.json +++ b/src/printsupport/configure.json @@ -26,8 +26,38 @@ "features": { "cups": { "label": "CUPS", + "purpose": "Provides support for the Common Unix Printing System.", + "section": "Painting", "condition": "libs.cups", "output": [ "privateFeature", "feature" ] + }, + "printer": { + "label": "QPrinter", + "purpose": "Provides a printer backend of QPainter.", + "section": "Painting", + "condition": "!config.android && !config.uikit && !config.winrt && features.picture && features.temporaryfile && features.pdf", + "output": [ "publicFeature", "feature" ] + }, + "printpreviewwidget": { + "label": "QPrintPreviewWidget", + "purpose": "Provides a widget for previewing page layouts for printer output.", + "section": "Widgets", + "condition": "features.graphicsview && features.printer && features.mainwindow", + "output": [ "publicFeature", "feature" ] + }, + "printdialog": { + "label": "QPrintDialog", + "purpose": "Provides a dialog widget for specifying printer configuration.", + "section": "Dialogs", + "condition": "features.printer && features.combobox && features.buttongroup && features.spinbox && features.treeview && features.tabwidget", + "output": [ "publicFeature", "feature" ] + }, + "printpreviewdialog": { + "label": "QPrintPreviewDialog", + "purpose": "Provides a dialog for previewing and configuring page layouts for printer output.", + "section": "Dialogs", + "condition": "features.printpreviewwidget && features.printdialog && features.toolbar", + "output": [ "publicFeature", "feature" ] } }, diff --git a/src/src.pro b/src/src.pro index 60d6a57e2a..541053eba5 100644 --- a/src/src.pro +++ b/src/src.pro @@ -134,7 +134,7 @@ src_android.subdir = $$PWD/android } } SUBDIRS += src_tools_bootstrap src_tools_moc src_tools_rcc -!contains(QT_DISABLED_FEATURES, regularexpression):pcre { +qtConfig(regularexpression):pcre { SUBDIRS += src_3rdparty_pcre src_corelib.depends += src_3rdparty_pcre } diff --git a/src/widgets/configure.json b/src/widgets/configure.json index 2c1f8b1e6c..ee7e1dd8e0 100644 --- a/src/widgets/configure.json +++ b/src/widgets/configure.json @@ -71,10 +71,480 @@ "autoDetect": "config.android", "output": [ "styles" ] }, + "style-stylesheet": { + "label": "QStyleSheetStyle", + "purpose": "Provides a widget style which is configurable via CSS.", + "section": "Styles", + "condition": "features.style-windows && features.properties && features.cssparser", + "output": [ "publicFeature", "feature" ] + }, "android-style-assets": { "label": "Android Style Assets", "condition": "features.style-android", "output": [ "privateConfig" ] + }, + "effects": { + "label": "Effects", + "purpose": "Provides special widget effects (e.g. fading and scrolling).", + "section": "Kernel" + }, + "filesystemmodel": { + "label": "QFileSystemModel", + "purpose": "Provides a data model for the local filesystem.", + "section": "File I/O", + "output": [ "publicFeature", "feature" ] + }, + "itemviews": { + "label": "The Model/View Framework", + "purpose": "Provides the model/view architecture managing the relationship between data and the way it is presented to the user.", + "section": "ItemViews", + "condition": "features.itemmodel && features.rubberband && features.scrollarea", + "output": [ "publicFeature", "feature" ] + }, + "treewidget": { + "label": "QTreeWidget", + "purpose": "Provides views using tree models.", + "section": "Widgets", + "condition": "features.treeview", + "output": [ "publicFeature", "feature" ] + }, + "listwidget": { + "label": "QListWidget", + "purpose": "Provides item-based list widgets.", + "section": "Widgets", + "condition": "features.listview", + "output": [ "publicFeature", "feature" ] + }, + "tablewidget": { + "label": "QTableWidget", + "purpose": "Provides item-based table views.", + "section": "Widgets", + "condition": "features.tableview", + "output": [ "publicFeature", "feature" ] + }, + "datetimeedit": { + "label": "QDateTimeEdit", + "purpose": "Supports editing dates and times.", + "section": "Widgets", + "condition": "features.calendarwidget && features.datestring", + "output": [ "publicFeature", "feature" ] + }, + "stackedwidget": { + "label": "QStackedWidget", + "purpose": "Provides stacked widgets.", + "section": "Widgets", + "output": [ "publicFeature", "feature" ] + }, + "textbrowser": { + "label": "QTextBrowser", + "purpose": "Supports HTML document browsing.", + "section": "Widgets", + "condition": "features.textedit", + "output": [ "publicFeature", "feature" ] + }, + "splashscreen": { + "label": "QSplashScreen", + "purpose": "Supports splash screens that can be shown during application startup.", + "section": "Widgets", + "output": [ "publicFeature", "feature" ] + }, + "splitter": { + "label": "QSplitter", + "purpose": "Provides user controlled splitter widgets.", + "section": "Widgets", + "condition": "features.rubberband", + "output": [ "publicFeature", "feature" ] + }, + "lcdnumber": { + "label": "QLCDNumber", + "purpose": "Provides LCD-like digits.", + "section": "Widgets", + "output": [ "publicFeature", "feature" ] + }, + "menu": { + "label": "QMenu", + "purpose": "Provides popup-menus.", + "section": "Widgets", + "condition": "features.action", + "output": [ "publicFeature", "feature" ] + }, + "lineedit": { + "label": "QLineEdit", + "purpose": "Provides single-line edits.", + "section": "Widgets", + "output": [ "publicFeature", "feature" ] + }, + "spinbox": { + "label": "QSpinBox", + "purpose": "Provides spin boxes handling integers and discrete sets of values.", + "section": "Widgets", + "condition": "features.spinwidget && features.lineedit && features.validator", + "output": [ "publicFeature", "feature" ] + }, + "tabbar": { + "label": "QTabBar", + "purpose": "Provides tab bars, e.g., for use in tabbed dialogs.", + "section": "Widgets", + "condition": "features.toolbutton", + "output": [ "publicFeature", "feature" ] + }, + "tabwidget": { + "label": "QTabWidget", + "purpose": "Supports stacking tabbed widgets.", + "section": "Widgets", + "condition": "features.tabbar && features.stackedwidget", + "output": [ "publicFeature", "feature" ] + }, + "combobox": { + "label": "QComboBox", + "purpose": "Provides drop-down boxes presenting a list of options to the user.", + "section": "Widgets", + "condition": "features.lineedit && features.standarditemmodel && features.listview", + "output": [ "publicFeature", "feature" ] + }, + "fontcombobox": { + "label": "QFontComboBox", + "purpose": "Provides a combobox that lets the user select a font family.", + "section": "Widgets", + "condition": "features.combobox && features.stringlistmodel", + "output": [ "publicFeature", "feature" ] + }, + "toolbutton": { + "label": "QToolButton", + "purpose": "Provides quick-access buttons to commands and options.", + "section": "Widgets", + "condition": "features.action", + "output": [ "publicFeature", "feature" ] + }, + "toolbar": { + "label": "QToolBar", + "purpose": "Provides movable panels containing a set of controls.", + "section": "Widgets", + "condition": "features.mainwindow", + "output": [ "publicFeature", "feature" ] + }, + "toolbox": { + "label": "QToolBox", + "purpose": "Provides columns of tabbed widget items.", + "section": "Widgets", + "condition": "features.toolbutton && features.scrollarea", + "output": [ "publicFeature", "feature" ] + }, + "groupbox": { + "label": "QGroupBox", + "purpose": "Provides widget grouping boxes with frames.", + "section": "Widgets", + "output": [ "publicFeature", "feature" ] + }, + "buttongroup": { + "label": "QButtonGroup", + "purpose": "Supports organizing groups of button widgets.", + "section": "Widgets", + "condition": "features.groupbox", + "output": [ "publicFeature", "feature" ] + }, + "mainwindow": { + "label": "QMainWindow", + "purpose": "Provides main application windows.", + "section": "Widgets", + "condition": "features.menu && features.resizehandler && features.toolbutton", + "output": [ "publicFeature", "feature" ] + }, + "dockwidget": { + "label": "QDockwidget", + "purpose": "Supports docking widgets inside a QMainWindow or floated as a top-level window on the desktop.", + "section": "Widgets", + "condition": "features.rubberband && features.mainwindow", + "output": [ "publicFeature", "feature" ] + }, + "mdiarea": { + "label": "QMdiArea", + "purpose": "Provides an area in which MDI windows are displayed.", + "section": "Widgets", + "condition": "features.scrollarea", + "output": [ "publicFeature", "feature" ] + }, + "resizehandler": { + "label": "QWidgetResizeHandler", + "purpose": "Provides an internal resize handler for dock widgets.", + "section": "Widgets", + "output": [ "publicFeature", "feature" ] + }, + "statusbar": { + "label": "QStatusBar", + "purpose": "Supports presentation of status information.", + "section": "Widgets", + "output": [ "publicFeature", "feature" ] + }, + "menubar": { + "label": "QMenuBar", + "purpose": "Provides pull-down menu items.", + "section": "Widgets", + "condition": "features.menu && features.toolbutton", + "output": [ "publicFeature", "feature" ] + }, + "contextmenu": { + "label": "Context menus", + "purpose": "Adds pop-up menus on right mouse click to numerous widgets.", + "section": "Widgets", + "condition": "features.menu", + "output": [ "publicFeature", "feature" ] + }, + "progressbar": { + "label": "QProgressBar", + "purpose": "Supports presentation of operation progress.", + "section": "Widgets", + "output": [ "publicFeature", "feature" ] + }, + "slider": { + "label": "QSlider", + "purpose": "Provides sliders controlling a bounded value.", + "section": "Widgets", + "output": [ "publicFeature", "feature" ] + }, + "scrollbar": { + "label": "QScrollBar", + "purpose": "Provides scrollbars allowing the user access parts of a document that is larger than the widget used to display it.", + "section": "Widgets", + "condition": "features.slider", + "output": [ "publicFeature", "feature" ] + }, + "dial": { + "label": "QDial", + "purpose": "Provides a rounded range control, e.g., like a speedometer.", + "section": "Widgets", + "condition": "features.slider", + "output": [ "publicFeature", "feature" ] + }, + "scrollarea": { + "label": "QScrollArea", + "purpose": "Supports scrolling views onto widgets.", + "section": "Widgets", + "condition": "features.scrollbar", + "output": [ "publicFeature", "feature" ] + }, + "graphicsview": { + "label": "QGraphicsView", + "purpose": "Provides a canvas/sprite framework.", + "section": "Widgets", + "condition": "features.scrollarea", + "output": [ "publicFeature", "feature" ] + }, + "graphicseffect": { + "label": "QGraphicsEffect", + "purpose": "Provides various graphics effects.", + "section": "Widgets", + "condition": "features.graphicsview", + "output": [ "publicFeature", "feature" ] + }, + "spinbox": { + "label": "QSpinBox", + "purpose": "Provides spinbox control widgets.", + "section": "Widgets", + "output": [ "publicFeature", "feature" ] + }, + "textedit": { + "label": "QTextEdit", + "purpose": "Supports rich text editing.", + "section": "Widgets", + "condition": "features.scrollarea && features.properties", + "output": [ "publicFeature", "feature" ] + }, + "syntaxhighlighter": { + "label": "QSyntaxHighlighter", + "purpose": "Supports custom syntax highlighting.", + "section": "Widgets", + "condition": "features.textedit", + "output": [ "publicFeature", "feature" ] + }, + "rubberband": { + "label": "QRubberBand", + "purpose": "Supports using rubberbands to indicate selections and boundaries.", + "section": "Widgets", + "output": [ "publicFeature", "feature" ] + }, + "tooltip": { + "label": "QToolTip", + "purpose": "Supports presentation of tooltips.", + "section": "Widgets", + "output": [ "publicFeature", "feature" ] + }, + "statustip": { + "label": "Status Tip", + "purpose": "Supports status tip functionality and events.", + "section": "Widgets", + "output": [ "publicFeature", "feature" ] + }, + "whatsthis": { + "label": "QWhatsThis", + "purpose": "Supports displaying \"What's this\" help.", + "section": "Widgets", + "condition": "features.toolbutton", + "output": [ "publicFeature", "feature" ] + }, + "sizegrip": { + "label": "QSizeGrip", + "purpose": "Provides corner-grips for resizing top-level windows.", + "section": "Widgets", + "output": [ "publicFeature", "feature" ] + }, + "calendarwidget": { + "label": "QCalendarWidget", + "purpose": "Provides a monthly based calendar widget allowing the user to select a date.", + "section": "Widgets", + "condition": "features.tableview && features.menu && features.textdate && features.spinbox && features.toolbutton", + "output": [ "publicFeature", "feature" ] + }, + "keysequenceedit": { + "label": "QKeySequenceEdit", + "purpose": "Provides a widget for editing QKeySequences.", + "section": "Widgets", + "condition": "features.lineedit && features.shortcut", + "output": [ "publicFeature", "feature" ] + }, + "messagebox": { + "label": "QMessageBox", + "purpose": "Provides message boxes displaying informative messages and simple questions.", + "section": "Dialogs", + "output": [ "publicFeature", "feature" ] + }, + "colordialog": { + "label": "QColorDialog", + "purpose": "Provides a dialog widget for specifying colors.", + "section": "Dialogs", + "condition": "features.spinbox", + "output": [ "publicFeature", "feature" ] + }, + "filedialog": { + "label": "QFileDialog", + "purpose": "Provides a dialog widget for selecting files or directories.", + "section": "Dialogs", + "condition": "features.dirmodel && features.treeview && features.combobox && features.toolbutton && features.buttongroup && features.tooltip && features.splitter && features.stackedwidget && features.proxymodel", + "output": [ "publicFeature", "feature" ] + }, + "fontdialog": { + "label": "QFontDialog", + "purpose": "Provides a dialog widget for selecting fonts.", + "section": "Dialogs", + "condition": "features.stringlistmodel && features.combobox && features.validator && features.groupbox", + "output": [ "publicFeature", "feature" ] + }, + "progressdialog": { + "label": "QProgressDialog", + "purpose": "Provides feedback on the progress of a slow operation.", + "section": "Dialogs", + "condition": "features.progressbar", + "output": [ "publicFeature", "feature" ] + }, + "inputdialog": { + "label": "QInputDialog", + "purpose": "Provides a simple convenience dialog to get a single value from the user.", + "section": "Dialogs", + "condition": "features.combobox && features.spinbox && features.stackedwidget", + "output": [ "publicFeature", "feature" ] + }, + "errormessage": { + "label": "QErrorMessage", + "purpose": "Provides an error message display dialog.", + "section": "Dialogs", + "condition": "features.textedit", + "output": [ "publicFeature", "feature" ] + }, + "wizard": { + "label": "QWizard", + "purpose": "Provides a framework for multi-page click-through dialogs.", + "section": "Dialogs", + "condition": "features.properties", + "output": [ "publicFeature", "feature" ] + }, + "dirmodel": { + "label": "QDirModel", + "purpose": "Provides a data model for the local filesystem.", + "section": "ItemViews", + "condition": "features.itemviews && features.filesystemmodel", + "output": [ "publicFeature", "feature" ] + }, + "listview": { + "label": "QListView", + "purpose": "Provides a list or icon view onto a model.", + "section": "ItemViews", + "condition": "features.itemviews", + "output": [ "publicFeature", "feature" ] + }, + "tableview": { + "label": "QTableView", + "purpose": "Provides a default model/view implementation of a table view.", + "section": "ItemViews", + "condition": "features.itemviews", + "output": [ "publicFeature", "feature" ] + }, + "treeview": { + "label": "QTreeView", + "purpose": "Provides a default model/view implementation of a tree view.", + "section": "ItemViews", + "condition": "features.itemviews", + "output": [ "publicFeature", "feature" ] + }, + "datawidgetmapper": { + "label": "QDataWidgetMapper", + "purpose": "Provides mapping between a section of a data model to widgets.", + "section": "ItemViews", + "condition": "features.itemviews && features.properties", + "output": [ "publicFeature", "feature" ] + }, + "columnview": { + "label": "QColumnView", + "purpose": "Provides a model/view implementation of a column view.", + "section": "ItemViews", + "condition": "features.listview", + "output": [ "publicFeature", "feature" ] + }, + "paint_debug": { + "label": "Painting Debug Utilities", + "purpose": "Enabled debugging painting with the environment variables QT_FLUSH_UPDATE and QT_FLUSH_PAINT.", + "section": "Painting", + "output": [ "publicFeature", "feature" ] + }, + "completer": { + "label": "QCompleter", + "purpose": "Provides completions based on an item model.", + "section": "Utilities", + "condition": "features.proxymodel", + "output": [ "publicFeature", "feature" ] + }, + "fscompleter": { + "label": "QFSCompleter", + "purpose": "Provides file name completion in QFileDialog.", + "section": "Utilities", + "condition": "features.filesystemmodel && features.completer", + "output": [ "publicFeature", "feature" ] + }, + "undocommand": { + "label": "QUndoCommand", + "purpose": "Applies (redo or) undo of a single change in a document.", + "section": "Utilities", + "output": [ "publicFeature", "feature" ] + }, + "undostack": { + "label": "QUndoStack", + "purpose": "Provides the ability to (redo or) undo a list of changes in a document.", + "section": "Utilities", + "condition": "features.undocommand", + "output": [ "publicFeature", "feature" ] + }, + "undogroup": { + "label": "QUndoGroup", + "purpose": "Provides the ability to cluster QUndoCommands.", + "section": "Utilities", + "condition": "features.undostack", + "output": [ "publicFeature", "feature" ] + }, + "undoview": { + "label": "QUndoView", + "purpose": "Provides a widget which shows the contents of an undo stack.", + "section": "Utilities", + "condition": "features.undostack && features.listview", + "output": [ "publicFeature", "feature" ] } }, diff --git a/src/xml/configure.json b/src/xml/configure.json new file mode 100644 index 0000000000..345eb8544b --- /dev/null +++ b/src/xml/configure.json @@ -0,0 +1,16 @@ +{ + "module": "xml", + "depends": [ + "core" + ], + "testDir": "../../config.tests", + + "features": { + "dom": { + "label": "DOM", + "purpose": "Supports the Document Object Model.", + "section": "File I/O", + "output": [ "publicFeature", "feature" ] + } + } +} diff --git a/src/xml/qtxmlglobal.h b/src/xml/qtxmlglobal.h index de5a8ab39d..ed5de8db87 100644 --- a/src/xml/qtxmlglobal.h +++ b/src/xml/qtxmlglobal.h @@ -41,6 +41,9 @@ #define QTXMLGLOBAL_H #include +#ifndef QT_BOOTSTRAPPED +# include +#endif QT_BEGIN_NAMESPACE -- cgit v1.2.3 From e4391bb403cacf79124e7a9ecdc3d609a285789e Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 26 Aug 2016 12:00:56 +0200 Subject: make the style listing in the configure summary less weird remove the redundant 'Style' suffix, and use CamelCased words (the list uses space as a separator). Change-Id: I169a741fdc293ac42ae6b97a5726477b53127506 Reviewed-by: Lars Knoll --- src/widgets/configure.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/widgets/configure.json b/src/widgets/configure.json index ee7e1dd8e0..c1931d9d80 100644 --- a/src/widgets/configure.json +++ b/src/widgets/configure.json @@ -44,30 +44,30 @@ "output": [ "privateFeature" ] }, "style-fusion": { - "label": "Fusion Style", + "label": "Fusion", "output": [ "styles" ] }, "style-mac": { - "label": "Mac Style", + "label": "macOS", "condition": "config.osx", "output": [ "styles" ] }, "style-windows": { - "label": "Windows Style", + "label": "Windows", "output": [ "styles" ] }, "style-windowsxp": { - "label": "Windows XP Style", + "label": "WindowsXP", "condition": "features.style-windows && config.win32 && !config.winrt && tests.uxtheme", "output": [ "styles" ] }, "style-windowsvista": { - "label": "Windows Vista Style", + "label": "WindowsVista", "condition": "features.style-windowsxp", "output": [ "styles" ] }, "style-android": { - "label": "Android Style", + "label": "Android", "autoDetect": "config.android", "output": [ "styles" ] }, -- cgit v1.2.3 From e8091eb6c87a89d9406141e3605ce5bcd50a46cf Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 26 Aug 2016 15:25:35 +0200 Subject: don't complain about missing QPA plugin on android android is linux, but the QPA plugin is not enabled by configure, so skip the warning here. Change-Id: Ib136dd142b775a00686cdaa0cec5414d035c9516 Reviewed-by: Lars Knoll --- src/gui/configure.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/gui/configure.json b/src/gui/configure.json index 46014188e5..376359ba37 100644 --- a/src/gui/configure.json +++ b/src/gui/configure.json @@ -976,7 +976,7 @@ XKB configuration data. This is required for keyboard input support." }, { "type": "warning", - "condition": "features.gui && config.linux && !features.xcb && !features.eglfs && !features.directfb && !features.linuxfb && !features.mirclient", + "condition": "features.gui && config.linux && !config.android && !features.xcb && !features.eglfs && !features.directfb && !features.linuxfb && !features.mirclient", "message": "No QPA platform plugin enabled! This will produce a Qt that cannot run GUI applications. The dependencies needed for xcb to build are listed in -- cgit v1.2.3 From 0a4d3a92184fce2cc0e92c19b5b1e834088122ea Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Thu, 1 Sep 2016 16:57:03 +0200 Subject: Minimize register conversions in NEON optimization Redoes the simple calculation of x coordinates in integer registers rather than use the potentially expensive extract/move from NEON register. Change-Id: I914b463d6c20be2281710d626407196112d1615b Reviewed-by: Erik Verbruggen --- src/gui/painting/qdrawhelper.cpp | 67 +++++++++++++++++----------------------- 1 file changed, 29 insertions(+), 38 deletions(-) (limited to 'src') diff --git a/src/gui/painting/qdrawhelper.cpp b/src/gui/painting/qdrawhelper.cpp index 491f2d80da..c697aceaf3 100644 --- a/src/gui/painting/qdrawhelper.cpp +++ b/src/gui/painting/qdrawhelper.cpp @@ -2244,13 +2244,9 @@ static const uint * QT_FASTCALL fetchTransformedBilinearARGB32PM(uint *buffer, c int32x4_t v_fdx = vdupq_n_s32(fdx*4); int32x4_t v_fx = vmovq_n_s32(fx); - fx += fdx; - v_fx = vsetq_lane_s32(fx, v_fx, 1); - fx += fdx; - v_fx = vsetq_lane_s32(fx, v_fx, 2); - fx += fdx; - v_fx = vsetq_lane_s32(fx, v_fx, 3); - fx += fdx; + v_fx = vsetq_lane_s32(fx + fdx, v_fx, 1); + v_fx = vsetq_lane_s32(fx + fdx * 2, v_fx, 2); + v_fx = vsetq_lane_s32(fx + fdx * 3, v_fx, 3); const int32x4_t v_ffff_mask = vdupq_n_s32(0x0000ffff); const int32x4_t v_fx_r = vdupq_n_s32(0x0800); @@ -2258,18 +2254,20 @@ static const uint * QT_FASTCALL fetchTransformedBilinearARGB32PM(uint *buffer, c while (b < boundedEnd) { uint32x4x2_t v_top, v_bot; - int32x4_t v_fx_shifted = vshrq_n_s32(v_fx, 16); - - int x1 = vgetq_lane_s32(v_fx_shifted, 0); + int x1 = (fx >> 16); + fx += fdx; v_top = vld2q_lane_u32(s1 + x1, v_top, 0); v_bot = vld2q_lane_u32(s2 + x1, v_bot, 0); - x1 = vgetq_lane_s32(v_fx_shifted, 1); + x1 = (fx >> 16); + fx += fdx; v_top = vld2q_lane_u32(s1 + x1, v_top, 1); v_bot = vld2q_lane_u32(s2 + x1, v_bot, 1); - x1 = vgetq_lane_s32(v_fx_shifted, 2); + x1 = (fx >> 16); + fx += fdx; v_top = vld2q_lane_u32(s1 + x1, v_top, 2); v_bot = vld2q_lane_u32(s2 + x1, v_bot, 2); - x1 = vgetq_lane_s32(v_fx_shifted, 3); + x1 = (fx >> 16); + fx += fdx; v_top = vld2q_lane_u32(s1 + x1, v_top, 3); v_bot = vld2q_lane_u32(s2 + x1, v_bot, 3); @@ -2284,7 +2282,6 @@ static const uint * QT_FASTCALL fetchTransformedBilinearARGB32PM(uint *buffer, c b+=4; v_fx = vaddq_s32(v_fx, v_fdx); } - fx = vgetq_lane_s32(v_fx, 0); #endif } @@ -2440,16 +2437,12 @@ static const uint * QT_FASTCALL fetchTransformedBilinearARGB32PM(uint *buffer, c int32x4_t v_fx = vmovq_n_s32(fx); int32x4_t v_fy = vmovq_n_s32(fy); - fx += fdx; fy += fdy; - v_fx = vsetq_lane_s32(fx, v_fx, 1); - v_fy = vsetq_lane_s32(fy, v_fy, 1); - fx += fdx; fy += fdy; - v_fx = vsetq_lane_s32(fx, v_fx, 2); - v_fy = vsetq_lane_s32(fy, v_fy, 2); - fx += fdx; fy += fdy; - v_fx = vsetq_lane_s32(fx, v_fx, 3); - v_fy = vsetq_lane_s32(fy, v_fy, 3); - fx += fdx; fy += fdy; + v_fx = vsetq_lane_s32(fx + fdx, v_fx, 1); + v_fy = vsetq_lane_s32(fy + fdy, v_fy, 1); + v_fx = vsetq_lane_s32(fx + fdx * 2, v_fx, 2); + v_fy = vsetq_lane_s32(fy + fdy * 2, v_fy, 2); + v_fx = vsetq_lane_s32(fx + fdx * 3, v_fx, 3); + v_fy = vsetq_lane_s32(fy + fdy * 3, v_fy, 3); const int32x4_t v_ffff_mask = vdupq_n_s32(0x0000ffff); const int32x4_t v_round = vdupq_n_s32(0x0800); @@ -2457,33 +2450,33 @@ static const uint * QT_FASTCALL fetchTransformedBilinearARGB32PM(uint *buffer, c while (b < boundedEnd) { uint32x4x2_t v_top, v_bot; - int32x4_t v_fx_shifted, v_fy_shifted; - v_fx_shifted = vshrq_n_s32(v_fx, 16); - v_fy_shifted = vshrq_n_s32(v_fy, 16); - - int x1 = vgetq_lane_s32(v_fx_shifted, 0); - int y1 = vgetq_lane_s32(v_fy_shifted, 0); + int x1 = (fx >> 16); + int y1 = (fy >> 16); + fx += fdx; fy += fdy; const uchar *sl = textureData + bytesPerLine * y1; const uint *s1 = reinterpret_cast(sl); const uint *s2 = reinterpret_cast(sl + bytesPerLine); v_top = vld2q_lane_u32(s1 + x1, v_top, 0); v_bot = vld2q_lane_u32(s2 + x1, v_bot, 0); - x1 = vgetq_lane_s32(v_fx_shifted, 1); - y1 = vgetq_lane_s32(v_fy_shifted, 1); + x1 = (fx >> 16); + y1 = (fy >> 16); + fx += fdx; fy += fdy; sl = textureData + bytesPerLine * y1; s1 = reinterpret_cast(sl); s2 = reinterpret_cast(sl + bytesPerLine); v_top = vld2q_lane_u32(s1 + x1, v_top, 1); v_bot = vld2q_lane_u32(s2 + x1, v_bot, 1); - x1 = vgetq_lane_s32(v_fx_shifted, 2); - y1 = vgetq_lane_s32(v_fy_shifted, 2); + x1 = (fx >> 16); + y1 = (fy >> 16); + fx += fdx; fy += fdy; sl = textureData + bytesPerLine * y1; s1 = reinterpret_cast(sl); s2 = reinterpret_cast(sl + bytesPerLine); v_top = vld2q_lane_u32(s1 + x1, v_top, 2); v_bot = vld2q_lane_u32(s2 + x1, v_bot, 2); - x1 = vgetq_lane_s32(v_fx_shifted, 3); - y1 = vgetq_lane_s32(v_fy_shifted, 3); + x1 = (fx >> 16); + y1 = (fy >> 16); + fx += fdx; fy += fdy; sl = textureData + bytesPerLine * y1; s1 = reinterpret_cast(sl); s2 = reinterpret_cast(sl + bytesPerLine); @@ -2505,8 +2498,6 @@ static const uint * QT_FASTCALL fetchTransformedBilinearARGB32PM(uint *buffer, c v_fx = vaddq_s32(v_fx, v_fdx); v_fy = vaddq_s32(v_fy, v_fdy); } - fx = vgetq_lane_s32(v_fx, 0); - fy = vgetq_lane_s32(v_fy, 0); #endif } -- cgit v1.2.3 From bee70b24c1d6180465e9040a0f8bbff051405e0c Mon Sep 17 00:00:00 2001 From: BogDan Vatra Date: Fri, 19 Aug 2016 16:58:49 +0300 Subject: Check the context of Q_ENUM[_NS] and Q_FLAG[_NS] Change-Id: Ifc8cb50efe3b07a79c8afbb382fba12649b602b2 Reviewed-by: Olivier Goffart (Woboq GmbH) --- src/tools/moc/moc.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src') diff --git a/src/tools/moc/moc.cpp b/src/tools/moc/moc.cpp index eda410783c..e4b9b19758 100644 --- a/src/tools/moc/moc.cpp +++ b/src/tools/moc/moc.cpp @@ -570,10 +570,16 @@ void Moc::parse() case Q_ENUM_NS_TOKEN: parseEnumOrFlag(&def, false); break; + case Q_ENUM_TOKEN: + error("Q_ENUM can't be used in a Q_NAMESPACE, use Q_ENUM_NS instead"); + break; case Q_FLAGS_TOKEN: case Q_FLAG_NS_TOKEN: parseEnumOrFlag(&def, true); break; + case Q_FLAG_TOKEN: + error("Q_FLAG can't be used in a Q_NAMESPACE, use Q_FLAG_NS instead"); + break; case Q_DECLARE_FLAGS_TOKEN: parseFlag(&def); break; @@ -736,10 +742,16 @@ void Moc::parse() case Q_ENUM_TOKEN: parseEnumOrFlag(&def, false); break; + case Q_ENUM_NS_TOKEN: + error("Q_ENUM_NS can't be used in a Q_OBJECT/Q_GADGET, use Q_ENUM instead"); + break; case Q_FLAGS_TOKEN: case Q_FLAG_TOKEN: parseEnumOrFlag(&def, true); break; + case Q_FLAG_NS_TOKEN: + error("Q_FLAG_NS can't be used in a Q_OBJECT/Q_GADGET, use Q_FLAG instead"); + break; case Q_DECLARE_FLAGS_TOKEN: parseFlag(&def); break; -- cgit v1.2.3 From 6b2071c697d4c48f0cd289b28b443ebffc3432e6 Mon Sep 17 00:00:00 2001 From: Anton Kudryavtsev Date: Mon, 22 Aug 2016 15:32:03 +0300 Subject: Use QStringBuilder more to optimize memory allocations Change-Id: I2939ffa10496fdc59e0402a9cb54458565ccd657 Reviewed-by: Thiago Macieira --- src/corelib/global/qlibraryinfo.cpp | 8 ++++---- src/gui/text/qfontdatabase.cpp | 7 ++----- src/gui/text/qplatformfontdatabase.cpp | 6 ++---- src/platformsupport/themes/qabstractfileiconengine.cpp | 3 +-- src/plugins/platforms/xcb/qxcbmime.cpp | 4 +--- src/plugins/platforms/xcb/qxcbscreen.cpp | 3 +-- src/tools/rcc/rcc.cpp | 4 +--- 7 files changed, 12 insertions(+), 23 deletions(-) (limited to 'src') diff --git a/src/corelib/global/qlibraryinfo.cpp b/src/corelib/global/qlibraryinfo.cpp index 4303f74709..1a7d64780f 100644 --- a/src/corelib/global/qlibraryinfo.cpp +++ b/src/corelib/global/qlibraryinfo.cpp @@ -616,10 +616,10 @@ QStringList QLibraryInfo::platformPluginArguments(const QString &platformName) #if !defined(QT_BUILD_QMAKE) && !defined(QT_NO_SETTINGS) QScopedPointer settings(QLibraryInfoPrivate::findConfiguration()); if (!settings.isNull()) { - QString key = QLatin1String(platformsSection); - key += QLatin1Char('/'); - key += platformName; - key += QLatin1String("Arguments"); + const QString key = QLatin1String(platformsSection) + + QLatin1Char('/') + + platformName + + QLatin1String("Arguments"); return settings->value(key).toStringList(); } #endif // !QT_BUILD_QMAKE && !QT_NO_SETTINGS diff --git a/src/gui/text/qfontdatabase.cpp b/src/gui/text/qfontdatabase.cpp index ba3b5eb7af..a3a3f20b18 100644 --- a/src/gui/text/qfontdatabase.cpp +++ b/src/gui/text/qfontdatabase.cpp @@ -663,11 +663,8 @@ struct QtFontDesc static void initFontDef(const QtFontDesc &desc, const QFontDef &request, QFontDef *fontDef, bool multi) { fontDef->family = desc.family->name; - if (! desc.foundry->name.isEmpty() && desc.family->count > 1) { - fontDef->family += QString::fromLatin1(" ["); - fontDef->family += desc.foundry->name; - fontDef->family += QLatin1Char(']'); - } + if (! desc.foundry->name.isEmpty() && desc.family->count > 1) + fontDef->family += QLatin1String(" [") + desc.foundry->name + QLatin1Char(']'); if (desc.style->smoothScalable || QGuiApplicationPrivate::platformIntegration()->fontDatabase()->fontsAlwaysScalable() diff --git a/src/gui/text/qplatformfontdatabase.cpp b/src/gui/text/qplatformfontdatabase.cpp index 0d7cb204ff..b83affecdc 100644 --- a/src/gui/text/qplatformfontdatabase.cpp +++ b/src/gui/text/qplatformfontdatabase.cpp @@ -395,10 +395,8 @@ void QPlatformFontDatabase::releaseHandle(void *handle) QString QPlatformFontDatabase::fontDir() const { QString fontpath = QString::fromLocal8Bit(qgetenv("QT_QPA_FONTDIR")); - if (fontpath.isEmpty()) { - fontpath = QLibraryInfo::location(QLibraryInfo::LibrariesPath); - fontpath += QLatin1String("/fonts"); - } + if (fontpath.isEmpty()) + fontpath = QLibraryInfo::location(QLibraryInfo::LibrariesPath) + QLatin1String("/fonts"); return fontpath; } diff --git a/src/platformsupport/themes/qabstractfileiconengine.cpp b/src/platformsupport/themes/qabstractfileiconengine.cpp index 19a8eee47b..192ed00510 100644 --- a/src/platformsupport/themes/qabstractfileiconengine.cpp +++ b/src/platformsupport/themes/qabstractfileiconengine.cpp @@ -73,8 +73,7 @@ QPixmap QAbstractFileIconEngine::pixmap(const QSize &size, QIcon::Mode mode, if (key.isEmpty()) return filePixmap(size, mode, state); - key += QLatin1Char('_'); - key += QString::number(size.width()); + key += QLatin1Char('_') + QString::number(size.width()); QPixmap result; if (!QPixmapCache::find(key, result)) { diff --git a/src/plugins/platforms/xcb/qxcbmime.cpp b/src/plugins/platforms/xcb/qxcbmime.cpp index 4803c14c4c..749906d1e8 100644 --- a/src/plugins/platforms/xcb/qxcbmime.cpp +++ b/src/plugins/platforms/xcb/qxcbmime.cpp @@ -121,9 +121,7 @@ bool QXcbMime::mimeDataForAtom(QXcbConnection *connection, xcb_atom_t a, QMimeDa // so QXcbConnection::atomName() has to be used. if (atomName == QLatin1String("text/uri-list") && connection->atomName(a) == "text/x-moz-url") { - const QByteArray uri = data->split('\n').first(); - QString mozUri = QString::fromLatin1(uri, uri.size()); - mozUri += QLatin1Char('\n'); + const QString mozUri = QLatin1String(data->split('\n').constFirst()) + QLatin1Char('\n'); *data = QByteArray(reinterpret_cast(mozUri.utf16()), mozUri.length() * 2); } else if (atomName == QLatin1String("application/x-color")) diff --git a/src/plugins/platforms/xcb/qxcbscreen.cpp b/src/plugins/platforms/xcb/qxcbscreen.cpp index e4c92c5206..a9675935f4 100644 --- a/src/plugins/platforms/xcb/qxcbscreen.cpp +++ b/src/plugins/platforms/xcb/qxcbscreen.cpp @@ -61,8 +61,7 @@ QXcbVirtualDesktop::QXcbVirtualDesktop(QXcbConnection *connection, xcb_screen_t , m_number(number) , m_xSettings(Q_NULLPTR) { - QByteArray cmAtomName("_NET_WM_CM_S"); - cmAtomName += QByteArray::number(m_number); + const QByteArray cmAtomName = "_NET_WM_CM_S" + QByteArray::number(m_number); m_net_wm_cm_atom = connection->internAtom(cmAtomName.constData()); m_compositingActive = connection->getSelectionOwner(m_net_wm_cm_atom); diff --git a/src/tools/rcc/rcc.cpp b/src/tools/rcc/rcc.cpp index 3156df3f30..18772d2816 100644 --- a/src/tools/rcc/rcc.cpp +++ b/src/tools/rcc/rcc.cpp @@ -705,9 +705,7 @@ static void resourceDataFileMapRecursion(const RCCFileInfo *m_root, const QStrin const ChildConstIterator cend = m_root->m_children.constEnd(); for (ChildConstIterator it = m_root->m_children.constBegin(); it != cend; ++it) { const RCCFileInfo *child = it.value(); - QString childName = path; - childName += slash; - childName += child->m_name; + const QString childName = path + slash + child->m_name; if (child->m_flags & RCCFileInfo::Directory) { resourceDataFileMapRecursion(child, childName, m); } else { -- cgit v1.2.3