From 216da37cc55c38a9901501ecb04f768ff4e78d8f Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 18 Jul 2017 14:14:17 +0200 Subject: Windows QPA: Compare against correct geometry when checking for fullscreen Do not scale the QPlatformScreen's geometry. Fixes tst_QWidget::showFullScreen() when run with a scale factor. Change-Id: I4a2e743303ff70b01fd3d2086281a790737d2c1d Reviewed-by: Oliver Wolff --- src/plugins/platforms/windows/qwindowswindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp index 3a5baf40f0..97550cbcf6 100644 --- a/src/plugins/platforms/windows/qwindowswindow.cpp +++ b/src/plugins/platforms/windows/qwindowswindow.cpp @@ -1763,7 +1763,7 @@ bool QWindowsWindow::isFullScreen_sys() const if (testFlag(HasBorderInFullScreen)) geometry += QMargins(1, 1, 1, 1); QPlatformScreen *screen = screenForGeometry(geometry); - return screen && geometry == QHighDpi::toNativePixels(screen->geometry(), screen); + return screen && geometry == screen->geometry(); } /*! -- cgit v1.2.3 From 1b190e7ea60e3752066b8a2fb255481651f8856e Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 18 Jul 2017 14:22:35 +0200 Subject: tst_QWidget: Fix to pass with High DPI scaling enabled Scale coordinates in a few places, remove pixmap scaling in grabWindow() (Windows). Change-Id: Iba9e5d3ca55422a14eda09c8d04329a455d3acb3 Reviewed-by: Oliver Wolff Reviewed-by: Joerg Bornemann --- tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp index 2b6dc5f7e1..bd5d5fac79 100644 --- a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp +++ b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp @@ -4952,8 +4952,7 @@ static QPixmap grabWindow(QWindow *window, int x, int y, int width, int height) { QScreen *screen = window->screen(); Q_ASSERT(screen); - QPixmap result = screen->grabWindow(window->winId(), x, y, width, height); - return result.devicePixelRatio() > 1 ? result.scaled(width, height) : result; + return screen->grabWindow(window->winId(), x, y, width, height); } #define VERIFY_COLOR(child, region, color) verifyColor(child, region, color, __LINE__) @@ -4971,7 +4970,8 @@ bool verifyColor(QWidget &child, const QRegion ®ion, const QColor &color, uns const QPixmap pixmap = grabBackingStore ? child.grab(rect) : grabWindow(window, rect.left(), rect.top(), rect.width(), rect.height()); - if (!QTest::qCompare(pixmap.size(), rect.size(), "pixmap.size()", "rect.size()", __FILE__, callerLine)) + const QSize actualSize = pixmap.size() / pixmap.devicePixelRatioF(); + if (!QTest::qCompare(actualSize, rect.size(), "pixmap.size()", "rect.size()", __FILE__, callerLine)) return false; QPixmap expectedPixmap(pixmap); /* ensure equal formats */ expectedPixmap.detach(); @@ -10339,7 +10339,8 @@ public slots: QPoint point2(15, 20); QPoint point3(20, 20); QWindow *window = modal->windowHandle(); - QWindowSystemInterface::handleEnterEvent(window, point1, window->mapToGlobal(point1)); + const QPoint nativePoint1 = QHighDpi::toNativePixels(point1, window->screen()); + QWindowSystemInterface::handleEnterEvent(window, nativePoint1); QTest::mouseMove(window, point1); QTest::mouseMove(window, point2); QTest::mouseMove(window, point3); -- cgit v1.2.3 From ea4fae0df689843fbcd6cf7f170d825557646ea2 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 17 Jul 2017 14:58:45 +0200 Subject: Windows QPA: Do not call enableNonClientDpiScaling() for embedded windows Do not call if the property indicating embedded windows is set. Task-number: QTBUG-61972 Change-Id: I8f34dd8a59f1e5c9c8064646bcb15acea115cd68 Reviewed-by: Oliver Wolff Reviewed-by: Joerg Bornemann --- src/plugins/platforms/windows/qwindowscontext.cpp | 4 +++- src/plugins/platforms/windows/qwindowswindow.cpp | 4 +++- src/plugins/platforms/windows/qwindowswindow.h | 2 ++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/plugins/platforms/windows/qwindowscontext.cpp b/src/plugins/platforms/windows/qwindowscontext.cpp index 7115d074c9..9ab131808b 100644 --- a/src/plugins/platforms/windows/qwindowscontext.cpp +++ b/src/plugins/platforms/windows/qwindowscontext.cpp @@ -970,8 +970,10 @@ bool QWindowsContext::windowsProc(HWND hwnd, UINT message, d->m_creationContext->obtainedGeometry.moveTo(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam)); return true; case QtWindows::NonClientCreate: - if (QSysInfo::windowsVersion() >= QSysInfo::WV_WINDOWS10 && d->m_creationContext->window->isTopLevel()) + if (QSysInfo::windowsVersion() >= QSysInfo::WV_WINDOWS10 && d->m_creationContext->window->isTopLevel() + && !d->m_creationContext->window->property(QWindowsWindow::embeddedNativeParentHandleProperty).isValid()) { enableNonClientDpiScaling(msg.hwnd); + } return false; case QtWindows::CalculateSize: return QWindowsGeometryHint::handleCalculateSize(d->m_creationContext->customMargins, msg, result); diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp index 97550cbcf6..3c79c8aefe 100644 --- a/src/plugins/platforms/windows/qwindowswindow.cpp +++ b/src/plugins/platforms/windows/qwindowswindow.cpp @@ -489,7 +489,7 @@ void WindowCreationData::fromWindow(const QWindow *w, const Qt::WindowFlags flag // Sometimes QWindow doesn't have a QWindow parent but does have a native parent window, // e.g. in case of embedded ActiveQt servers. They should not be considered a top-level // windows in such cases. - QVariant prop = w->property("_q_embedded_native_parent_handle"); + QVariant prop = w->property(QWindowsWindow::embeddedNativeParentHandleProperty); if (prop.isValid()) { embedded = true; parentHandle = reinterpret_cast(prop.value()); @@ -1035,6 +1035,8 @@ QWindowCreationContext::QWindowCreationContext(const QWindow *w, \ingroup qt-lighthouse-win */ +const char *QWindowsWindow::embeddedNativeParentHandleProperty = "_q_embedded_native_parent_handle"; + QWindowsWindow::QWindowsWindow(QWindow *aWindow, const QWindowsWindowData &data) : QWindowsBaseWindow(aWindow), m_data(data), diff --git a/src/plugins/platforms/windows/qwindowswindow.h b/src/plugins/platforms/windows/qwindowswindow.h index e541b110a6..aa8ce7e73a 100644 --- a/src/plugins/platforms/windows/qwindowswindow.h +++ b/src/plugins/platforms/windows/qwindowswindow.h @@ -319,6 +319,8 @@ public: void setHasBorderInFullScreen(bool border); static QString formatWindowTitle(const QString &title); + static const char *embeddedNativeParentHandleProperty; + private: inline void show_sys() const; inline QWindowsWindowData setWindowFlags_sys(Qt::WindowFlags wt, unsigned flags = 0) const; -- cgit v1.2.3 From a9dfdbd06acc6a11a03f298a794e290da1028992 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 18 Jul 2017 16:47:16 +0200 Subject: tst_QStyle::drawItemPixmap(): Check on the image color Verify that all pixels of the grabbed image are green instead of comparing an image loaded from file. The test then also passes when High DPI scaling is active in which case a twice as big pixmap with DPR=2 is obtained when grabbing the widget. Change-Id: Ie5244a39a68ea0defd2590cf30f251d660d0869b Reviewed-by: Oliver Wolff Reviewed-by: Joerg Bornemann --- tests/auto/widgets/styles/qstyle/task_25863.png | Bin 910 -> 0 bytes tests/auto/widgets/styles/qstyle/testdata.qrc | 1 - tests/auto/widgets/styles/qstyle/tst_qstyle.cpp | 15 ++++++++------- 3 files changed, 8 insertions(+), 8 deletions(-) delete mode 100644 tests/auto/widgets/styles/qstyle/task_25863.png diff --git a/tests/auto/widgets/styles/qstyle/task_25863.png b/tests/auto/widgets/styles/qstyle/task_25863.png deleted file mode 100644 index a2de8d6f78..0000000000 Binary files a/tests/auto/widgets/styles/qstyle/task_25863.png and /dev/null differ diff --git a/tests/auto/widgets/styles/qstyle/testdata.qrc b/tests/auto/widgets/styles/qstyle/testdata.qrc index c16b9be775..29bb46726e 100644 --- a/tests/auto/widgets/styles/qstyle/testdata.qrc +++ b/tests/auto/widgets/styles/qstyle/testdata.qrc @@ -15,6 +15,5 @@ images/vista/radiobutton.png images/vista/slider.png images/vista/spinbox.png - task_25863.png diff --git a/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp b/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp index 5925b764dd..fcb05f6b74 100644 --- a/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp +++ b/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp @@ -58,6 +58,8 @@ #include #include +#include + // Make a widget frameless to prevent size constraints of title bars // from interfering (Windows). static inline void setFrameless(QWidget *w) @@ -208,13 +210,12 @@ void tst_QStyle::drawItemPixmap() testWidget->resize(300, 300); testWidget->showNormal(); - const QString imageFileName = QFINDTESTDATA("task_25863.png"); - QVERIFY(!imageFileName.isEmpty()); - - QPixmap p(imageFileName, "PNG"); - const QPixmap actualPix = testWidget->grab(); - - QCOMPARE(actualPix, p); + QImage image = testWidget->grab().toImage(); + const QRgb green = QColor(Qt::green).rgb(); + QVERIFY(image.reinterpretAsFormat(QImage::Format_RGB32)); + const QRgb *bits = reinterpret_cast(image.constBits()); + const QRgb *end = bits + image.byteCount() / sizeof(QRgb); + QVERIFY(std::all_of(bits, end, [green] (QRgb r) { return r == green; })); testWidget->hide(); } -- cgit v1.2.3 From 5138fada0b9ce3968b23ec11df5f0d4e67544c43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Tue, 18 Jul 2017 16:52:08 +0200 Subject: Fix QHighDpi::fromNativeLocalExposedRegion rounding errors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Calling bottom/right/bottomRight on a QRect is discouraged, as it does not give the true bottom-right corner of the rectangle, instead giving a point one unit to the left and top of the true bottom right. Dividing this point by a scale factor of e.g. 2, and then using qCeil on the bottom right x and y coordinates would result in a pointRegion that was 1x1 * scaleFactor larger than it should, manifesting as rendering issues at later stages. We can get away from the whole problem by initially converting the QRect to a QRectF, and basing the pointRegion's rect on the scaled size instead of bottom-right coordinates. Change-Id: I4d4895660655cfa8749c93c7d2573ae79cd7898b Reviewed-by: Simon Hausmann Reviewed-by: Morten Johan Sørvig Reviewed-by: Tor Arne Vestbø --- src/gui/kernel/qhighdpiscaling_p.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gui/kernel/qhighdpiscaling_p.h b/src/gui/kernel/qhighdpiscaling_p.h index 32c8f07dc0..0a060a2d2c 100644 --- a/src/gui/kernel/qhighdpiscaling_p.h +++ b/src/gui/kernel/qhighdpiscaling_p.h @@ -398,11 +398,11 @@ inline QRegion fromNativeLocalExposedRegion(const QRegion &pixelRegion, const QW const qreal scaleFactor = QHighDpiScaling::factor(window); QRegion pointRegion; - for (const QRect &rect : pixelRegion) { - const QPointF topLeftP = QPointF(rect.topLeft()) / scaleFactor; - const QPointF bottomRightP = QPointF(rect.bottomRight()) / scaleFactor; + for (const QRectF &rect : pixelRegion) { + const QPointF topLeftP = rect.topLeft() / scaleFactor; + const QSizeF sizeP = rect.size() / scaleFactor; pointRegion += QRect(QPoint(qFloor(topLeftP.x()), qFloor(topLeftP.y())), - QPoint(qCeil(bottomRightP.x()), qCeil(bottomRightP.y()))); + QSize(qCeil(sizeP.width()), qCeil(sizeP.height()))); } return pointRegion; } -- cgit v1.2.3 From 429d726322cf4c092cf3704de87116e61b2c9195 Mon Sep 17 00:00:00 2001 From: Oliver Wolff Date: Fri, 14 Jul 2017 10:24:01 +0200 Subject: winrt: qmake: Fix deployment rules of created solution files If these rules are not added to the solution, Visual Studio will complain, that the project has to be deployed before it can be run. Change-Id: I6d3fbc949c85b11a92f78e13e2f6a1b92a5cfdc7 Reviewed-by: Joerg Bornemann --- qmake/generators/win32/msvc_vcproj.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/qmake/generators/win32/msvc_vcproj.cpp b/qmake/generators/win32/msvc_vcproj.cpp index ac198dcda3..1e92f1a025 100644 --- a/qmake/generators/win32/msvc_vcproj.cpp +++ b/qmake/generators/win32/msvc_vcproj.cpp @@ -629,6 +629,7 @@ void VcprojGenerator::writeSubDirs(QTextStream &t) for(QList::Iterator it = solution_cleanup.begin(); it != solution_cleanup.end(); ++it) { QString platform = is64Bit ? "x64" : "Win32"; QString xplatform = platform; + const bool isWinRT = project->isActiveConfig("winrt"); if (!project->isEmpty("VCPROJ_ARCH")) { xplatform = project->first("VCPROJ_ARCH").toQString(); } @@ -636,11 +637,11 @@ void VcprojGenerator::writeSubDirs(QTextStream &t) platform = xplatform; t << "\n\t\t" << (*it)->uuid << QString(_slnProjDbgConfTag1).arg(xplatform) << platform; t << "\n\t\t" << (*it)->uuid << QString(_slnProjDbgConfTag2).arg(xplatform) << platform; - if (!project->isEmpty("CE_SDK") && !project->isEmpty("CE_ARCH")) + if (!project->isEmpty("CE_SDK") && !project->isEmpty("CE_ARCH") || isWinRT) t << "\n\t\t" << (*it)->uuid << QString(_slnProjDbgConfTag3).arg(xplatform) << platform; t << "\n\t\t" << (*it)->uuid << QString(_slnProjRelConfTag1).arg(xplatform) << platform; t << "\n\t\t" << (*it)->uuid << QString(_slnProjRelConfTag2).arg(xplatform) << platform; - if (!project->isEmpty("CE_SDK") && !project->isEmpty("CE_ARCH")) + if (!project->isEmpty("CE_SDK") && !project->isEmpty("CE_ARCH") || isWinRT) t << "\n\t\t" << (*it)->uuid << QString(_slnProjRelConfTag3).arg(xplatform) << platform; } t << _slnProjConfEnd; -- cgit v1.2.3 From 06b5e4d706f4fd06ee03734fbaf53819af4c3062 Mon Sep 17 00:00:00 2001 From: Oliver Wolff Date: Fri, 14 Jul 2017 11:50:00 +0200 Subject: qmake: Remove last remains of WinCE support Change-Id: Ifc2ecee8464710efd02a38b3a9794104f15a0f04 Reviewed-by: Joerg Bornemann Reviewed-by: Oswald Buddenhagen --- qmake/generators/win32/msvc_vcproj.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/qmake/generators/win32/msvc_vcproj.cpp b/qmake/generators/win32/msvc_vcproj.cpp index 1e92f1a025..f261574482 100644 --- a/qmake/generators/win32/msvc_vcproj.cpp +++ b/qmake/generators/win32/msvc_vcproj.cpp @@ -637,11 +637,11 @@ void VcprojGenerator::writeSubDirs(QTextStream &t) platform = xplatform; t << "\n\t\t" << (*it)->uuid << QString(_slnProjDbgConfTag1).arg(xplatform) << platform; t << "\n\t\t" << (*it)->uuid << QString(_slnProjDbgConfTag2).arg(xplatform) << platform; - if (!project->isEmpty("CE_SDK") && !project->isEmpty("CE_ARCH") || isWinRT) + if (isWinRT) t << "\n\t\t" << (*it)->uuid << QString(_slnProjDbgConfTag3).arg(xplatform) << platform; t << "\n\t\t" << (*it)->uuid << QString(_slnProjRelConfTag1).arg(xplatform) << platform; t << "\n\t\t" << (*it)->uuid << QString(_slnProjRelConfTag2).arg(xplatform) << platform; - if (!project->isEmpty("CE_SDK") && !project->isEmpty("CE_ARCH") || isWinRT) + if (isWinRT) t << "\n\t\t" << (*it)->uuid << QString(_slnProjRelConfTag3).arg(xplatform) << platform; } t << _slnProjConfEnd; @@ -1017,7 +1017,7 @@ void VcprojGenerator::initConfiguration() initCustomBuildTool(); initPreBuildEventTools(); initPostBuildEventTools(); - // Only deploy for CE and WinRT projects + // Only deploy for crosscompiled projects if (!project->isHostBuild() || conf.WinRT) initDeploymentTool(); initWinDeployQtTool(); -- cgit v1.2.3 From e7471da4d6e025efc6fe2a8e9c1890e593b2d6b2 Mon Sep 17 00:00:00 2001 From: Daniel Teske Date: Thu, 15 Jun 2017 15:05:04 +0200 Subject: Windows Printer: Handle no default printer case GetDefaultPrinter can return ERROR_FILE_NOT_FOUND. In that case just return a empty string. Task-number: QTBUG-53290 Change-Id: Ib0e28b3425d100bc185d1d8827dc6b7fd90cbbeb Reviewed-by: Friedemann Kleint --- src/plugins/printsupport/windows/qwindowsprintdevice.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/plugins/printsupport/windows/qwindowsprintdevice.cpp b/src/plugins/printsupport/windows/qwindowsprintdevice.cpp index 99e8ec8999..1cb14514ee 100644 --- a/src/plugins/printsupport/windows/qwindowsprintdevice.cpp +++ b/src/plugins/printsupport/windows/qwindowsprintdevice.cpp @@ -449,7 +449,9 @@ QStringList QWindowsPrintDevice::availablePrintDeviceIds() QString QWindowsPrintDevice::defaultPrintDeviceId() { DWORD size = 0; - GetDefaultPrinter(NULL, &size); + if (GetDefaultPrinter(NULL, &size) == ERROR_FILE_NOT_FOUND) + return QString(); + QScopedArrayPointer name(new wchar_t[size]); GetDefaultPrinter(name.data(), &size); return QString::fromWCharArray(name.data()); -- cgit v1.2.3 From 13bceecc6bd3046772b2e662e08e0de3b37603a7 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 19 Jul 2017 11:02:05 +0200 Subject: Windows QPA: Fix local position reported for enter events Use QPlatformWindow::mapFromGlobal() instead of QWindow:::mapFromGlobal() as QPA operates in device pixels. Task-number: QTBUG-62028 Change-Id: I64ec4f4c9a536e122676d738db58805b98a45c82 Reviewed-by: Oliver Wolff --- src/plugins/platforms/windows/qwindowsmousehandler.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/plugins/platforms/windows/qwindowsmousehandler.cpp b/src/plugins/platforms/windows/qwindowsmousehandler.cpp index 34c34fd28e..d21581ba8a 100644 --- a/src/plugins/platforms/windows/qwindowsmousehandler.cpp +++ b/src/plugins/platforms/windows/qwindowsmousehandler.cpp @@ -387,12 +387,13 @@ bool QWindowsMouseHandler::translateMouseEvent(QWindow *window, HWND hwnd, && (!hasCapture || currentWindowUnderMouse == window)) || (m_previousCaptureWindow && window != m_previousCaptureWindow && currentWindowUnderMouse && currentWindowUnderMouse != m_previousCaptureWindow)) { + QPoint localPosition; qCDebug(lcQpaEvents) << "Entering " << currentWindowUnderMouse; - if (QWindowsWindow *wumPlatformWindow = QWindowsWindow::windowsWindowOf(currentWindowUnderMouse)) + if (QWindowsWindow *wumPlatformWindow = QWindowsWindow::windowsWindowOf(currentWindowUnderMouse)) { + localPosition = wumPlatformWindow->mapFromGlobal(globalPosition); wumPlatformWindow->applyCursor(); - QWindowSystemInterface::handleEnterEvent(currentWindowUnderMouse, - currentWindowUnderMouse->mapFromGlobal(globalPosition), - globalPosition); + } + QWindowSystemInterface::handleEnterEvent(currentWindowUnderMouse, localPosition, globalPosition); } // We need to track m_windowUnderMouse separately from m_trackedWindow, as // Windows mouse tracking will not trigger WM_MOUSELEAVE for leaving window when -- cgit v1.2.3 From 0e9ea9451174aeeb78f41f0cc213373e8ce76e5a Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 19 Jul 2017 12:37:24 +0200 Subject: QPMCache::remove(): Do not dereference erased iterator Fixes a crash in tst_QGL::textureCleanup() (developer build). Amends 467b15a20c3d6eb611ea5f6ccffd5fc0df81b0c4. Change-Id: I7026b3c2a27c02a80b995fde67a832dc2d19031d Reviewed-by: Allan Sandfeld Jensen --- src/gui/image/qpixmapcache.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gui/image/qpixmapcache.cpp b/src/gui/image/qpixmapcache.cpp index 625e145647..742aa31ba9 100644 --- a/src/gui/image/qpixmapcache.cpp +++ b/src/gui/image/qpixmapcache.cpp @@ -383,8 +383,9 @@ bool QPMCache::remove(const QString &key) //The key was not in the cache if (cacheKey == cacheKeys.constEnd()) return false; + const bool result = QCache::remove(cacheKey.value()); cacheKeys.erase(cacheKey); - return QCache::remove(cacheKey.value()); + return result; } bool QPMCache::remove(const QPixmapCache::Key &key) -- cgit v1.2.3 From 4585889467b6124f2e9ccca3d1c0da15e2bf790c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Wed, 19 Jul 2017 14:16:26 +0200 Subject: Fix race condition in the processEvents test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This test verifies processEvents(WaitForMoreEvents) behavior by first processing all pending events (in a loop) and then verifying that a following processEvents call actually waits. But there is no guarantee that the OS won’t introduce more events after the first loop has completed. This does indeed seem to happen on recent versions of macOS. Change the test to not require that the processEvents call blocked and de-blacklist. Task-number: QTBUG-61131 Change-Id: Ic8fa74a6085165442791264f6f137a2fa6083138 Reviewed-by: Tor Arne Vestbø --- tests/auto/corelib/kernel/qeventloop/tst_qeventloop.cpp | 9 ++++----- tests/auto/gui/kernel/qguieventloop/BLACKLIST | 2 -- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/tests/auto/corelib/kernel/qeventloop/tst_qeventloop.cpp b/tests/auto/corelib/kernel/qeventloop/tst_qeventloop.cpp index aff04afe08..0b4f76ef70 100644 --- a/tests/auto/corelib/kernel/qeventloop/tst_qeventloop.cpp +++ b/tests/auto/corelib/kernel/qeventloop/tst_qeventloop.cpp @@ -216,12 +216,11 @@ void tst_QEventLoop::processEvents() awakeSpy.clear(); QVERIFY(eventLoop.processEvents(QEventLoop::WaitForMoreEvents)); - // Verify that the eventloop has blocked and woken up. Some eventloops - // may block and wake up multiple times. - QVERIFY(aboutToBlockSpy.count() > 0); - QVERIFY(awakeSpy.count() > 0); // We should get one awake for each aboutToBlock, plus one awake when - // processEvents is entered. + // processEvents is entered. There is no guarantee that that the + // processEvents call actually blocked, since the OS may introduce + // native events at any time. + QVERIFY(awakeSpy.count() > 0); QVERIFY(awakeSpy.count() >= aboutToBlockSpy.count()); killTimer(timerId); diff --git a/tests/auto/gui/kernel/qguieventloop/BLACKLIST b/tests/auto/gui/kernel/qguieventloop/BLACKLIST index 2303d9380e..03acb2f5b0 100644 --- a/tests/auto/gui/kernel/qguieventloop/BLACKLIST +++ b/tests/auto/gui/kernel/qguieventloop/BLACKLIST @@ -1,4 +1,2 @@ -[processEvents] -osx-10.12 [testQuitLock] osx-10.12 -- cgit v1.2.3 From e71f7d7736ec2c845206daa5a48921affbcf8e44 Mon Sep 17 00:00:00 2001 From: Gatis Paeglis Date: Wed, 19 Jul 2017 09:09:16 +0200 Subject: xcb: fix freeze when (un)plugging input devices .. in an application that has many native windows. We don't need to select XI_HierarchyChangedMask and XI_DeviceChangedMask for every window. It is enough to register one window for these events to update state of our X11 client (application). Furthermore, XIAllDevices and XIAllMasterDevices always apply, even if the device has been added after the client has selected for events. So there is no need to call XISelectEvents on XIAllDevices/XIAllMasterDevices again, if we are not updating event masks. With this patch and the test application from QTBUG-57013, removing/attaching a device takes few hundred milliseconds instead of 23-24 seconds. Task-number: QTBUG-57013 Change-Id: Ieb0b5ee25feef2922f901165825cb4a1289fc852 Reviewed-by: Allan Sandfeld Jensen --- src/plugins/platforms/xcb/qxcbconnection.h | 1 + src/plugins/platforms/xcb/qxcbconnection_xi2.cpp | 28 ++++++++++++++---------- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/src/plugins/platforms/xcb/qxcbconnection.h b/src/plugins/platforms/xcb/qxcbconnection.h index bba987983e..1129090eca 100644 --- a/src/plugins/platforms/xcb/qxcbconnection.h +++ b/src/plugins/platforms/xcb/qxcbconnection.h @@ -428,6 +428,7 @@ public: #if QT_CONFIG(xinput2) void xi2Select(xcb_window_t window); + void xi2SelectStateEvents(); #endif #ifdef XCB_USE_XINPUT21 bool isAtLeastXI21() const { return m_xi2Enabled && m_xi2Minor >= 1; } diff --git a/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp b/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp index 4d2a83b3cf..38ea2d9ab9 100644 --- a/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp +++ b/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp @@ -90,12 +90,29 @@ void QXcbConnection::initializeXInput2() #else qCDebug(lcQpaXInputDevices, "XInput version %d.%d is available and Qt supports 2.0", xiMajor, m_xi2Minor); #endif + xi2SelectStateEvents(); } xi2SetupDevices(); } } +void QXcbConnection::xi2SelectStateEvents() +{ + // These state events do not depend on a specific X window, but are global + // for the X client's (application's) state. + unsigned int bitMask = 0; + unsigned char *xiBitMask = reinterpret_cast(&bitMask); + XIEventMask xiEventMask; + bitMask = XI_HierarchyChangedMask; + bitMask |= XI_DeviceChangedMask; + xiEventMask.deviceid = XIAllDevices; + xiEventMask.mask_len = sizeof(bitMask); + xiEventMask.mask = xiBitMask; + Display *dpy = static_cast(m_xlib_display); + XISelectEvents(dpy, DefaultRootWindow(dpy), &xiEventMask, 1); +} + void QXcbConnection::xi2SetupDevices() { #if QT_CONFIG(tabletevent) @@ -371,17 +388,6 @@ void QXcbConnection::xi2Select(xcb_window_t window) #else Q_UNUSED(xiBitMask); #endif - - { - // Listen for hotplug events - XIEventMask xiEventMask; - bitMask = XI_HierarchyChangedMask; - bitMask |= XI_DeviceChangedMask; - xiEventMask.deviceid = XIAllDevices; - xiEventMask.mask_len = sizeof(bitMask); - xiEventMask.mask = xiBitMask; - XISelectEvents(xDisplay, window, &xiEventMask, 1); - } } XInput2TouchDeviceData *QXcbConnection::touchDeviceForId(int id) -- cgit v1.2.3 From ad68bf51e79f52c1ffa597b76edaecadafddbd06 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Mon, 17 Jul 2017 08:57:07 +0200 Subject: Add executable name to description of Qt tools (Windows) Change f046ed395a5d2c383 set the default values of VERSION and QMAKE_TARGET_DESCRIPTION for Qt tools to generic ones. The version and description is shown in the properties of the executable, but also used for crash reports. For the latter it wasn't clear anymore which tool actually crashed. The patch therefore adds the executable name to the generic description. Tools can still overwrite the description on their own. Task-number: QTBUG-61970 Change-Id: I8366db22f88f0d6575e7f482f030b3c4f05af6c5 Reviewed-by: Oswald Buddenhagen --- mkspecs/features/qt_tool.prf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkspecs/features/qt_tool.prf b/mkspecs/features/qt_tool.prf index a516e5ba4b..4ba2b54623 100644 --- a/mkspecs/features/qt_tool.prf +++ b/mkspecs/features/qt_tool.prf @@ -12,7 +12,7 @@ CONFIG += no_launch_target isEmpty(VERSION): VERSION = $$MODULE_VERSION isEmpty(QMAKE_TARGET_DESCRIPTION): QMAKE_TARGET_DESCRIPTION = \ - "Tool for the Qt Application Development Framework" + "Tool for the Qt Application Development Framework ($$TARGET)" load(qt_app) CONFIG += console -- cgit v1.2.3 From 94cf203f36deb5b46d47197d31b780de5f464937 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Thu, 13 Jul 2017 17:19:49 +0200 Subject: Use QSharedPointer::create() more MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is the result of running the (experimental) clang-tidy check qt-modernize-qsharedpointer-create Discarded changes: - tst_qsharedpointer.cpp: not sure we want these replacements there (→ separate change) - tst_collations.cpp: hit in a template specialization that is instantiated with both QSharedPointer and QSharedDataPointer. Change-Id: I203c2646e91d026735d923473af3d151d19e3820 Reviewed-by: Thiago Macieira --- tests/auto/corelib/io/largefile/tst_largefile.cpp | 2 +- .../io/qabstractfileengine/tst_qabstractfileengine.cpp | 4 ++-- tests/auto/corelib/io/qdatastream/tst_qdatastream.cpp | 2 +- tests/auto/corelib/io/qiodevice/tst_qiodevice.cpp | 2 +- .../qdbusabstractinterface/tst_qdbusabstractinterface.cpp | 4 ++-- tests/auto/network/access/qftp/tst_qftp.cpp | 2 +- tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp | 2 +- tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp | 12 ++++++------ tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp | 8 ++++---- 9 files changed, 19 insertions(+), 19 deletions(-) diff --git a/tests/auto/corelib/io/largefile/tst_largefile.cpp b/tests/auto/corelib/io/largefile/tst_largefile.cpp index 99e1d5a32f..5975303ca6 100644 --- a/tests/auto/corelib/io/largefile/tst_largefile.cpp +++ b/tests/auto/corelib/io/largefile/tst_largefile.cpp @@ -228,7 +228,7 @@ QByteArray const &tst_LargeFile::getDataBlock(int index, qint64 position) void tst_LargeFile::initTestCase() { m_previousCurrent = QDir::currentPath(); - m_tempDir = QSharedPointer(new QTemporaryDir); + m_tempDir = QSharedPointer::create(); QVERIFY2(!m_tempDir.isNull(), qPrintable("Could not create temporary directory.")); QVERIFY2(QDir::setCurrent(m_tempDir->path()), qPrintable("Could not switch current directory")); diff --git a/tests/auto/corelib/io/qabstractfileengine/tst_qabstractfileengine.cpp b/tests/auto/corelib/io/qabstractfileengine/tst_qabstractfileengine.cpp index dba920d1f7..ddfd14550b 100644 --- a/tests/auto/corelib/io/qabstractfileengine/tst_qabstractfileengine.cpp +++ b/tests/auto/corelib/io/qabstractfileengine/tst_qabstractfileengine.cpp @@ -466,7 +466,7 @@ protected: if (create) { QSharedPointer &p = fileSystem[fileName_]; if (p.isNull()) - p = QSharedPointer(new File); + p = QSharedPointer::create(); return p; } @@ -564,7 +564,7 @@ class FileEngineHandler void tst_QAbstractFileEngine::initTestCase() { m_previousCurrent = QDir::currentPath(); - m_currentDir = QSharedPointer(new QTemporaryDir()); + m_currentDir = QSharedPointer::create(); QVERIFY2(!m_currentDir.isNull(), qPrintable("Could not create current directory.")); QDir::setCurrent(m_currentDir->path()); } diff --git a/tests/auto/corelib/io/qdatastream/tst_qdatastream.cpp b/tests/auto/corelib/io/qdatastream/tst_qdatastream.cpp index 0068411b94..14a2528cc6 100644 --- a/tests/auto/corelib/io/qdatastream/tst_qdatastream.cpp +++ b/tests/auto/corelib/io/qdatastream/tst_qdatastream.cpp @@ -300,7 +300,7 @@ void tst_QDataStream::getSetCheck() void tst_QDataStream::initTestCase() { m_previousCurrent = QDir::currentPath(); - m_tempDir = QSharedPointer(new QTemporaryDir); + m_tempDir = QSharedPointer::create(); QVERIFY2(!m_tempDir.isNull(), qPrintable("Could not create temporary directory.")); QVERIFY2(QDir::setCurrent(m_tempDir->path()), qPrintable("Could not switch current directory")); } diff --git a/tests/auto/corelib/io/qiodevice/tst_qiodevice.cpp b/tests/auto/corelib/io/qiodevice/tst_qiodevice.cpp index 5cb532f76b..a76fd4703e 100644 --- a/tests/auto/corelib/io/qiodevice/tst_qiodevice.cpp +++ b/tests/auto/corelib/io/qiodevice/tst_qiodevice.cpp @@ -71,7 +71,7 @@ void tst_QIODevice::initTestCase() || QFile::copy(QStringLiteral(":/tst_qiodevice.cpp"), QStringLiteral("./tst_qiodevice.cpp"))); #endif m_previousCurrent = QDir::currentPath(); - m_tempDir = QSharedPointer(new QTemporaryDir); + m_tempDir = QSharedPointer::create(); QVERIFY2(!m_tempDir.isNull(), qPrintable("Could not create temporary directory.")); QVERIFY2(QDir::setCurrent(m_tempDir->path()), qPrintable("Could not switch current directory")); } diff --git a/tests/auto/dbus/qdbusabstractinterface/tst_qdbusabstractinterface.cpp b/tests/auto/dbus/qdbusabstractinterface/tst_qdbusabstractinterface.cpp index 9e257267ca..11896d2f15 100644 --- a/tests/auto/dbus/qdbusabstractinterface/tst_qdbusabstractinterface.cpp +++ b/tests/auto/dbus/qdbusabstractinterface/tst_qdbusabstractinterface.cpp @@ -56,7 +56,7 @@ class tst_QDBusAbstractInterface: public QObject return Pinger(); if (service.isEmpty() && !service.isNull()) service = con.baseService(); - return Pinger(new org::qtproject::QtDBus::Pinger(service, path, con)); + return Pinger::create(service, path, con); } Pinger getPingerPeer(const QString &path = "/", const QString &service = "") @@ -64,7 +64,7 @@ class tst_QDBusAbstractInterface: public QObject QDBusConnection con = QDBusConnection("peer"); if (!con.isConnected()) return Pinger(); - return Pinger(new org::qtproject::QtDBus::Pinger(service, path, con)); + return Pinger::create(service, path, con); } void resetServer() diff --git a/tests/auto/network/access/qftp/tst_qftp.cpp b/tests/auto/network/access/qftp/tst_qftp.cpp index a1c8399a26..3711ce431c 100644 --- a/tests/auto/network/access/qftp/tst_qftp.cpp +++ b/tests/auto/network/access/qftp/tst_qftp.cpp @@ -205,7 +205,7 @@ void tst_QFtp::initTestCase() QVERIFY(QtNetworkSettings::verifyTestNetworkSettings()); #ifndef QT_NO_BEARERMANAGEMENT QNetworkConfigurationManager manager; - networkSessionImplicit = QSharedPointer(new QNetworkSession(manager.defaultConfiguration())); + networkSessionImplicit = QSharedPointer::create(manager.defaultConfiguration()); networkSessionImplicit->open(); QVERIFY(networkSessionImplicit->waitForOpened(60000)); //there may be user prompt on 1st connect #endif diff --git a/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp b/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp index 43d0781083..af7cf24838 100644 --- a/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp +++ b/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp @@ -213,7 +213,7 @@ void tst_QUdpSocket::initTestCase_data() #ifndef QT_NO_BEARERMANAGEMENT netConfMan = new QNetworkConfigurationManager(this); networkConfiguration = netConfMan->defaultConfiguration(); - networkSession = QSharedPointer(new QNetworkSession(networkConfiguration)); + networkSession = QSharedPointer::create(networkConfiguration); if (!networkSession->isOpen()) { networkSession->open(); QVERIFY(networkSession->waitForOpened(30000)); diff --git a/tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp b/tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp index c75c1dc87e..a27e0b6048 100644 --- a/tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp +++ b/tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp @@ -3442,7 +3442,7 @@ void tst_QTableView::editSpanFromDirections_data() +---+---+ */ keyPresses.clear(); keyPresses << Qt::Key_Right << Qt::Key_Down; - model.reset(new QStandardItemModel(4, 2)); + model = QSharedPointer::create(4, 2); QTest::newRow("row span, top down") << keyPresses << model << 1 << 1 << 2 << 1 << model->index(1, 1) << model->index(1, 1); @@ -3455,7 +3455,7 @@ void tst_QTableView::editSpanFromDirections_data() +---+---+---+ */ keyPresses.clear(); keyPresses << Qt::Key_End << Qt::Key_Down << Qt::Key_Left; - model.reset(new QStandardItemModel(3, 3)); + model = QSharedPointer::create(3, 3); QTest::newRow("row span, right to left") << keyPresses << model << 1 << 1 << 2 << 1 << model->index(1, 1) << model->index(1, 1); @@ -3468,7 +3468,7 @@ void tst_QTableView::editSpanFromDirections_data() +---+---+---+ */ keyPresses.clear(); keyPresses << Qt::Key_PageDown << Qt::Key_Right; - model.reset(new QStandardItemModel(3, 3)); + model = QSharedPointer::create(3, 3); QTest::newRow("row span, left to right") << keyPresses << model << 1 << 1 << 2 << 1 << model->index(2, 1) << model->index(1, 1); @@ -3481,7 +3481,7 @@ void tst_QTableView::editSpanFromDirections_data() +---+---+---+ */ keyPresses.clear(); keyPresses << Qt::Key_PageDown << Qt::Key_Up; - model.reset(new QStandardItemModel(3, 3)); + model = QSharedPointer::create(3, 3); QTest::newRow("col span, bottom up") << keyPresses << model << 1 << 0 << 1 << 3 << model->index(1, 0) << model->index(1, 0); @@ -3494,7 +3494,7 @@ void tst_QTableView::editSpanFromDirections_data() +---+---+---+ */ keyPresses.clear(); keyPresses << Qt::Key_PageDown << Qt::Key_Right << Qt::Key_Up; - model.reset(new QStandardItemModel(3, 3)); + model = QSharedPointer::create(3, 3); QTest::newRow("col span, bottom up #2") << keyPresses << model << 1 << 0 << 1 << 3 << model->index(1, 1) << model->index(1, 0); @@ -3507,7 +3507,7 @@ void tst_QTableView::editSpanFromDirections_data() +---+---+---+ */ keyPresses.clear(); keyPresses << Qt::Key_End << Qt::Key_Down; - model.reset(new QStandardItemModel(3, 3)); + model = QSharedPointer::create(3, 3); QTest::newRow("col span, top down") << keyPresses << model << 1 << 0 << 1 << 3 << model->index(1, 2) << model->index(1, 0); } diff --git a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp index bd5d5fac79..918df275e9 100644 --- a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp +++ b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp @@ -5753,14 +5753,14 @@ void tst_QWidget::testWindowIconChangeEventPropagation() QList applicationEventSpies; QList widgetEventSpies; foreach (QWidget *widget, widgets) { - applicationEventSpies.append(EventSpyPtr(new EventSpy(widget, QEvent::ApplicationWindowIconChange))); - widgetEventSpies.append(EventSpyPtr(new EventSpy(widget, QEvent::WindowIconChange))); + applicationEventSpies.append(EventSpyPtr::create(widget, QEvent::ApplicationWindowIconChange)); + widgetEventSpies.append(EventSpyPtr::create(widget, QEvent::WindowIconChange)); } QList appWindowEventSpies; QList windowEventSpies; foreach (QWindow *window, windows) { - appWindowEventSpies.append(WindowEventSpyPtr(new EventSpy(window, QEvent::ApplicationWindowIconChange))); - windowEventSpies.append(WindowEventSpyPtr(new EventSpy(window, QEvent::WindowIconChange))); + appWindowEventSpies.append(WindowEventSpyPtr::create(window, QEvent::ApplicationWindowIconChange)); + windowEventSpies.append(WindowEventSpyPtr::create(window, QEvent::WindowIconChange)); } // QApplication::setWindowIcon -- cgit v1.2.3 From 29f6b507325862fe3dd728913b5911f8edde9d35 Mon Sep 17 00:00:00 2001 From: Sergio Martins Date: Mon, 21 Nov 2016 19:16:31 +0000 Subject: Windows: Don't raise inactive windows when showing a tooltip The Qt4 Q_WS_WIN ifdef never got ported. Change-Id: Iad1ca1a3e20bd5254895781eee09897520b7d7d1 Task-Id: QTBUG-39147 Reviewed-by: Friedemann Kleint --- src/widgets/kernel/qtooltip.cpp | 6 +++--- tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/widgets/kernel/qtooltip.cpp b/src/widgets/kernel/qtooltip.cpp index 48afeb1dcc..830a328948 100644 --- a/src/widgets/kernel/qtooltip.cpp +++ b/src/widgets/kernel/qtooltip.cpp @@ -493,12 +493,12 @@ void QToolTip::showText(const QPoint &pos, const QString &text, QWidget *w, cons } if (!text.isEmpty()){ // no tip can be reused, create new tip: -#if 1 // Used to be excluded in Qt4 for Q_WS_WIN - new QTipLabel(text, w, msecDisplayTime); // sets QTipLabel::instance to itself -#else +#ifdef Q_OS_WIN32 // On windows, we can't use the widget as parent otherwise the window will be // raised when the tooltip will be shown new QTipLabel(text, QApplication::desktop()->screen(QTipLabel::getTipScreen(pos, w)), msecDisplayTime); +#else + new QTipLabel(text, w, msecDisplayTime); // sets QTipLabel::instance to itself #endif QTipLabel::instance->setTipRect(w, rect); QTipLabel::instance->placeTip(pos, w); diff --git a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp index 918df275e9..63ff8380f8 100644 --- a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp +++ b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp @@ -5716,6 +5716,8 @@ void tst_QWidget::setToolTip() QTest::qWait(2200); // delay is 2000 QTest::mouseMove(popupWindow); } + + QTRY_COMPARE(QApplication::topLevelWidgets().size(), 1); } void tst_QWidget::testWindowIconChangeEventPropagation() -- cgit v1.2.3 From f54327c3c3956c045f4bfe4023bf4ce92fceee3b Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 15 May 2017 12:44:30 +0200 Subject: Regular Expression Example: Add context menu Add context menu providing: "Escape Selection" Apply QRegularExpression::escape() to selection "Paste from Code" Paste from C++ "Copy to Code" (for completeness) Task-number: QTBUG-60635 Change-Id: Iee15c2243c7d0435b623dde4a1b26249aecd0553 Reviewed-by: Giuseppe D'Angelo --- .../regularexpression/regularexpressiondialog.cpp | 101 +++++++++++++++++++-- 1 file changed, 94 insertions(+), 7 deletions(-) diff --git a/examples/widgets/tools/regularexpression/regularexpressiondialog.cpp b/examples/widgets/tools/regularexpression/regularexpressiondialog.cpp index 371e2bda4b..7fdce3b674 100644 --- a/examples/widgets/tools/regularexpression/regularexpressiondialog.cpp +++ b/examples/widgets/tools/regularexpression/regularexpressiondialog.cpp @@ -58,12 +58,14 @@ #include #include #include +#include #include #include #include #include #include +#include #include #include @@ -75,6 +77,94 @@ Q_DECLARE_METATYPE(QRegularExpression::MatchType) +static QString patternToCode(QString pattern) +{ + pattern.replace(QLatin1String("\\"), QLatin1String("\\\\")); + pattern.replace(QLatin1String("\""), QLatin1String("\\\"")); + pattern.prepend(QLatin1Char('"')); + pattern.append(QLatin1Char('"')); + return pattern; +} + +static QString codeToPattern(QString code) +{ + for (int i = 0; i < code.size(); ++i) { + if (code.at(i) == QLatin1Char('\\')) + code.remove(i, 1); + } + if (code.startsWith(QLatin1Char('"')) && code.endsWith(QLatin1Char('"'))) { + code.chop(1); + code.remove(0, 1); + } + return code; +} + +class PatternLineEdit : public QLineEdit +{ + Q_OBJECT +public: + explicit PatternLineEdit(QWidget *parent = nullptr); + +private slots: + void copyToCode(); + void pasteFromCode(); + void escapeSelection(); + +protected: + void contextMenuEvent(QContextMenuEvent *event) override; + +private: + QAction *escapeSelectionAction; + QAction *copyToCodeAction; + QAction *pasteFromCodeAction; +}; + +PatternLineEdit::PatternLineEdit(QWidget *parent) : + QLineEdit(parent), + escapeSelectionAction(new QAction(tr("Escape Selection"), this)), + copyToCodeAction(new QAction(tr("Copy to Code"), this)), + pasteFromCodeAction(new QAction(tr("Paste from Code"), this)) +{ + setClearButtonEnabled(true); + connect(escapeSelectionAction, &QAction::triggered, this, &PatternLineEdit::escapeSelection); + connect(copyToCodeAction, &QAction::triggered, this, &PatternLineEdit::copyToCode); + connect(pasteFromCodeAction, &QAction::triggered, this, &PatternLineEdit::pasteFromCode); +} + +void PatternLineEdit::escapeSelection() +{ + const QString selection = selectedText(); + const QString escapedSelection = QRegularExpression::escape(selection); + if (escapedSelection != selection) { + QString t = text(); + t.replace(selectionStart(), selection.size(), escapedSelection); + setText(t); + } +} + +void PatternLineEdit::copyToCode() +{ + QGuiApplication::clipboard()->setText(patternToCode(text())); +} + +void PatternLineEdit::pasteFromCode() +{ + setText(codeToPattern(QGuiApplication::clipboard()->text())); +} + +void PatternLineEdit::contextMenuEvent(QContextMenuEvent *event) +{ + QMenu *menu = createStandardContextMenu(); + menu->setAttribute(Qt::WA_DeleteOnClose); + menu->addSeparator(); + escapeSelectionAction->setEnabled(hasSelectedText()); + menu->addAction(escapeSelectionAction); + menu->addSeparator(); + menu->addAction(copyToCodeAction); + menu->addAction(pasteFromCodeAction); + menu->popup(event->globalPos()); +} + RegularExpressionDialog::RegularExpressionDialog(QWidget *parent) : QDialog(parent) { @@ -131,12 +221,7 @@ void RegularExpressionDialog::refresh() offsetSpinBox->setMaximum(qMax(0, text.length() - 1)); - QString escaped = pattern; - escaped.replace(QLatin1String("\\"), QLatin1String("\\\\")); - escaped.replace(QLatin1String("\""), QLatin1String("\\\"")); - escaped.prepend(QLatin1Char('"')); - escaped.append(QLatin1Char('"')); - escapedPatternLineEdit->setText(escaped); + escapedPatternLineEdit->setText(patternToCode(pattern)); setTextColor(patternLineEdit, subjectTextEdit->palette().color(QPalette::Text)); matchDetailsTreeWidget->clear(); @@ -266,7 +351,7 @@ QWidget *RegularExpressionDialog::setupLeftUi() QLabel *regexpAndSubjectLabel = new QLabel(tr("

Regular expression and text input

")); layout->addRow(regexpAndSubjectLabel); - patternLineEdit = new QLineEdit; + patternLineEdit = new PatternLineEdit; patternLineEdit->setClearButtonEnabled(true); layout->addRow(tr("&Pattern:"), patternLineEdit); @@ -373,3 +458,5 @@ QWidget *RegularExpressionDialog::setupRightUi() return container; } + +#include "regularexpressiondialog.moc" -- cgit v1.2.3 From 82f701ed00546a01602413e90390388a1ec6dfbe Mon Sep 17 00:00:00 2001 From: James McDonnell Date: Wed, 10 May 2017 07:52:30 -0400 Subject: Skip EGL surface re-creation when the buffer size is unchanged Skip EGL surface re-creation when a sequence of unprocessed resizing requests leaves the buffer size unchanged. In this situation, the buffers won't be resized. Recreating the surface without resizing the buffers leads to screen providing incorrect information about the buffers. Change-Id: I1f75ab99eb1dffe0bcf9660bf014f047407b0c1b Reviewed-by: Rafael Roquetto --- src/plugins/platforms/qnx/qqnxeglwindow.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/plugins/platforms/qnx/qqnxeglwindow.cpp b/src/plugins/platforms/qnx/qqnxeglwindow.cpp index aa2e4db193..33ce0f924c 100644 --- a/src/plugins/platforms/qnx/qqnxeglwindow.cpp +++ b/src/plugins/platforms/qnx/qqnxeglwindow.cpp @@ -140,11 +140,17 @@ EGLSurface QQnxEglWindow::getSurface() if (m_newSurfaceRequested.testAndSetOrdered(true, false)) { const QMutexLocker locker(&m_mutex); //Set geomety must not reset the requestedBufferSize till //the surface is created - if (m_eglSurface != EGL_NO_SURFACE) { - platformOpenGLContext()->doneCurrent(); - destroyEGLSurface(); + + if ((m_requestedBufferSize != bufferSize()) || (m_eglSurface == EGL_NO_SURFACE)) { + if (m_eglSurface != EGL_NO_SURFACE) { + platformOpenGLContext()->doneCurrent(); + destroyEGLSurface(); + } + createEGLSurface(); + } else { + // Must've been a sequence of unprocessed changes returning us to the original size. + resetBuffers(); } - createEGLSurface(); } return m_eglSurface; -- cgit v1.2.3 From 548c2fbb3aa1ae6b7d3614b6381ea051977e2834 Mon Sep 17 00:00:00 2001 From: Giuseppe D'Angelo Date: Wed, 19 Jul 2017 15:22:15 +0200 Subject: QHash: make MSVC happy about the iterators passed to is_permutation MSVC warns about iterators being passed to certain Standard Library algorithms. dbd55cdaf367bdc9d6774bcb9927cbe19f18065f introduced a usa of std::is_permutation in a public header, which is causing such a warning to be emitted. To suppress the warning, Microsoft suggests to either use the 4-arg std::is_permutation overload (which however is not available in MSVC 2013) or to use a Standard Library extension, which we are already using elsewhere in Qt to deal with the same problem. However, that extension requires the iterator to be moved by size_t quantities, which isn't the case for QHash::iterator, and therefore generates more warnings about loss of precision (size_t -> int). Therefore, go with the 4-arg std::is_permutation, only on MSVC >= 2015. Change-Id: Idfcff28d14e0f1fde5d77f1deb9eec27c87ff5cd Task-number: QTBUG-61902 Reviewed-by: Thiago Macieira --- src/corelib/tools/qhash.h | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/corelib/tools/qhash.h b/src/corelib/tools/qhash.h index 035ec57957..703066857d 100644 --- a/src/corelib/tools/qhash.h +++ b/src/corelib/tools/qhash.h @@ -950,8 +950,22 @@ Q_OUTOFLINE_TEMPLATE bool QHash::operator==(const QHash &other) const return false; // Keys in the ranges are equal by construction; this checks only the values. - if (!std::is_permutation(it, thisEqualRangeEnd, otherEqualRange.first)) + // + // When using the 3-arg std::is_permutation, MSVC will emit warning C4996, + // passing an unchecked iterator to a Standard Library algorithm. We don't + // want to suppress the warning, and we can't use stdext::make_checked_array_iterator + // because QHash::(const_)iterator does not work with size_t and thus will + // emit more warnings. Use the 4-arg std::is_permutation instead (which + // is supported since MSVC 2015). + // + // ### Qt 6: if C++14 library support is a mandated minimum, remove the ifdef for MSVC. + if (!std::is_permutation(it, thisEqualRangeEnd, otherEqualRange.first +#if defined(Q_CC_MSVC) && _MSC_VER >= 1900 + , otherEqualRange.second +#endif + )) { return false; + } it = thisEqualRangeEnd; } -- cgit v1.2.3 From 922e410ebbf3b589385863b70e261e267968b9a4 Mon Sep 17 00:00:00 2001 From: Jake Petroules Date: Wed, 19 Jul 2017 16:07:34 -0700 Subject: Fix 32-bit build on macOS Some customers still need this for interoperability with legacy code. Let's continue to keep it working in 5.9.x, and then move to 64-bit exclusive features (thus dropping 32-bit entirely) in 5.10. Task-number: QTBUG-58401 Change-Id: Ibb7200c1885e9caba70439df5f7c86c81b1312b5 Reviewed-by: Gabriel de Dietrich --- src/plugins/platforms/cocoa/qcocoahelpers.h | 7 ++++++- src/plugins/platforms/cocoa/qcocoahelpers.mm | 5 +++++ src/plugins/platforms/cocoa/qnswindowdelegate.mm | 4 ++-- src/widgets/styles/qmacstyle_mac.mm | 8 ++++---- 4 files changed, 17 insertions(+), 7 deletions(-) diff --git a/src/plugins/platforms/cocoa/qcocoahelpers.h b/src/plugins/platforms/cocoa/qcocoahelpers.h index a2e0876073..4478895538 100644 --- a/src/plugins/platforms/cocoa/qcocoahelpers.h +++ b/src/plugins/platforms/cocoa/qcocoahelpers.h @@ -167,7 +167,12 @@ QT_END_NAMESPACE - (void)onCancelClicked; @end -@interface QT_MANGLE_NAMESPACE(QNSPanelContentsWrapper) : NSView +@interface QT_MANGLE_NAMESPACE(QNSPanelContentsWrapper) : NSView { + NSButton *_okButton; + NSButton *_cancelButton; + NSView *_panelContents; + NSEdgeInsets _panelContentsMargins; +} @property (nonatomic, readonly) NSButton *okButton; @property (nonatomic, readonly) NSButton *cancelButton; diff --git a/src/plugins/platforms/cocoa/qcocoahelpers.mm b/src/plugins/platforms/cocoa/qcocoahelpers.mm index 232e40769b..5d0f13c5a9 100644 --- a/src/plugins/platforms/cocoa/qcocoahelpers.mm +++ b/src/plugins/platforms/cocoa/qcocoahelpers.mm @@ -303,6 +303,11 @@ QT_END_NAMESPACE */ @implementation QNSPanelContentsWrapper +@synthesize okButton = _okButton; +@synthesize cancelButton = _cancelButton; +@synthesize panelContents = _panelContents; +@synthesize panelContentsMargins = _panelContentsMargins; + - (instancetype)initWithPanelDelegate:(id)panelDelegate { if ((self = [super initWithFrame:NSZeroRect])) { diff --git a/src/plugins/platforms/cocoa/qnswindowdelegate.mm b/src/plugins/platforms/cocoa/qnswindowdelegate.mm index 8295d4a36c..1224d138d9 100644 --- a/src/plugins/platforms/cocoa/qnswindowdelegate.mm +++ b/src/plugins/platforms/cocoa/qnswindowdelegate.mm @@ -75,7 +75,7 @@ // window.screen.visibleFrame directly, as that ensures we have the same // behavior for both use-cases/APIs. Q_ASSERT(window == m_cocoaWindow->nativeWindow()); - return m_cocoaWindow->screen()->availableGeometry().toCGRect(); + return NSRectFromCGRect(m_cocoaWindow->screen()->availableGeometry().toCGRect()); } #if QT_MACOS_DEPLOYMENT_TARGET_BELOW(__MAC_10_11) @@ -90,7 +90,7 @@ { Q_UNUSED(proposedSize); Q_ASSERT(window == m_cocoaWindow->nativeWindow()); - return m_cocoaWindow->screen()->geometry().size().toCGSize(); + return NSSizeFromCGSize(m_cocoaWindow->screen()->geometry().size().toCGSize()); } #endif diff --git a/src/widgets/styles/qmacstyle_mac.mm b/src/widgets/styles/qmacstyle_mac.mm index 99526683dd..6e8796970f 100644 --- a/src/widgets/styles/qmacstyle_mac.mm +++ b/src/widgets/styles/qmacstyle_mac.mm @@ -1018,17 +1018,17 @@ void QMacStylePrivate::drawFocusRing(QPainter *p, const QRect &targetRect, int h NSBezierPath *focusRingPath; if (radius > 0) { const CGFloat roundedRectInset = -1.5; - focusRingPath = [NSBezierPath bezierPathWithRoundedRect:CGRectInset(focusRingRect, roundedRectInset, roundedRectInset) + focusRingPath = [NSBezierPath bezierPathWithRoundedRect:NSRectFromCGRect(CGRectInset(focusRingRect, roundedRectInset, roundedRectInset)) xRadius:radius yRadius:radius]; } else { const CGFloat outerClipInset = -focusRingWidth / 2; - NSBezierPath *focusRingClipPath = [NSBezierPath bezierPathWithRect:CGRectInset(focusRingRect, outerClipInset, outerClipInset)]; + NSBezierPath *focusRingClipPath = [NSBezierPath bezierPathWithRect:NSRectFromCGRect(CGRectInset(focusRingRect, outerClipInset, outerClipInset))]; const CGFloat innerClipInset = 1; - NSBezierPath *focusRingInnerClipPath = [NSBezierPath bezierPathWithRect:CGRectInset(focusRingRect, innerClipInset, innerClipInset)]; + NSBezierPath *focusRingInnerClipPath = [NSBezierPath bezierPathWithRect:NSRectFromCGRect(CGRectInset(focusRingRect, innerClipInset, innerClipInset))]; [focusRingClipPath appendBezierPath:focusRingInnerClipPath.bezierPathByReversingPath]; [focusRingClipPath setClip]; - focusRingPath = [NSBezierPath bezierPathWithRect:focusRingRect]; + focusRingPath = [NSBezierPath bezierPathWithRect:NSRectFromCGRect(focusRingRect)]; focusRingPath.lineJoinStyle = NSRoundLineJoinStyle; } -- cgit v1.2.3 From 6e2eeee7f5ad30070c9195f78aa0d5e740d7daf3 Mon Sep 17 00:00:00 2001 From: Jake Petroules Date: Mon, 19 Jun 2017 14:27:11 -0700 Subject: qmake: fix warning about duplicate references in project file Task-number: QTBUG-59301 Change-Id: I2562b862465a52ecc56f551bcdb98fa7279ebfcf Reviewed-by: Oswald Buddenhagen Reviewed-by: Gabriel de Dietrich --- qmake/generators/mac/pbuilder_pbx.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/qmake/generators/mac/pbuilder_pbx.cpp b/qmake/generators/mac/pbuilder_pbx.cpp index 7507b26c09..ab699157ca 100644 --- a/qmake/generators/mac/pbuilder_pbx.cpp +++ b/qmake/generators/mac/pbuilder_pbx.cpp @@ -576,13 +576,13 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) FileFixifyFromOutdir | FileFixifyAbsolute)); //DUMP SOURCES + QSet processedSources; QMap groups; QList sources; sources.append(ProjectBuilderSources("SOURCES", true)); sources.append(ProjectBuilderSources("GENERATED_SOURCES", true)); sources.append(ProjectBuilderSources("GENERATED_FILES")); sources.append(ProjectBuilderSources("HEADERS")); - sources.append(ProjectBuilderSources("QMAKE_INTERNAL_INCLUDED_FILES")); if(!project->isEmpty("QMAKE_EXTRA_COMPILERS")) { const ProStringList &quc = project->values("QMAKE_EXTRA_COMPILERS"); for (ProStringList::ConstIterator it = quc.begin(); it != quc.end(); ++it) { @@ -626,6 +626,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) } } } + sources.append(ProjectBuilderSources("QMAKE_INTERNAL_INCLUDED_FILES")); for(int source = 0; source < sources.size(); ++source) { ProStringList &src_list = project->values(ProKey("QMAKE_PBX_" + sources.at(source).keyName())); ProStringList &root_group_list = project->values("QMAKE_PBX_GROUPS"); @@ -639,6 +640,9 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) continue; if(file.endsWith(Option::prl_ext)) continue; + if (processedSources.contains(file)) + continue; + processedSources.insert(file); bool in_root = true; QString src_key = keyFor(file); -- cgit v1.2.3 From e70258a155e5dbc0429ff75bcc857d188b60dbfd Mon Sep 17 00:00:00 2001 From: Stephan Binner Date: Sun, 9 Jul 2017 17:01:21 +0200 Subject: Convert features.listview to QT_[REQUIRE_]CONFIG Change-Id: I707a839bcfc7ad481342d1adb98c9b593f5ca6e2 Reviewed-by: Oswald Buddenhagen --- src/sql/models/qsqlrelationaldelegate.h | 2 ++ src/widgets/accessible/complexwidgets.cpp | 1 - src/widgets/accessible/itemviews.cpp | 4 +++- src/widgets/graphicsview/qgraphicsproxywidget.cpp | 1 - src/widgets/itemviews/itemviews.pri | 11 ++++++++--- src/widgets/itemviews/qlistview.cpp | 3 --- src/widgets/itemviews/qlistview.h | 7 ++----- src/widgets/itemviews/qlistview_p.h | 4 +--- src/widgets/styles/qmacstyle_mac_p_p.h | 2 ++ src/widgets/styles/qpixmapstyle.cpp | 2 ++ src/widgets/styles/qwindowsstyle.cpp | 4 +++- src/widgets/styles/qwindowsvistastyle_p_p.h | 2 ++ src/widgets/styles/qwindowsxpstyle.cpp | 2 ++ src/widgets/util/qcompleter.cpp | 14 ++++++++------ 14 files changed, 35 insertions(+), 24 deletions(-) diff --git a/src/sql/models/qsqlrelationaldelegate.h b/src/sql/models/qsqlrelationaldelegate.h index a689e88ba3..42c0cc27b1 100644 --- a/src/sql/models/qsqlrelationaldelegate.h +++ b/src/sql/models/qsqlrelationaldelegate.h @@ -45,7 +45,9 @@ #ifdef QT_WIDGETS_LIB #include +#if QT_CONFIG(listview) #include +#endif #include #include #include diff --git a/src/widgets/accessible/complexwidgets.cpp b/src/widgets/accessible/complexwidgets.cpp index 50aba759c3..42775d7324 100644 --- a/src/widgets/accessible/complexwidgets.cpp +++ b/src/widgets/accessible/complexwidgets.cpp @@ -45,7 +45,6 @@ #include #include #include -#include #include #include #include diff --git a/src/widgets/accessible/itemviews.cpp b/src/widgets/accessible/itemviews.cpp index 4d1a4589ee..1ccfcbe4e5 100644 --- a/src/widgets/accessible/itemviews.cpp +++ b/src/widgets/accessible/itemviews.cpp @@ -43,7 +43,9 @@ #if QT_CONFIG(tableview) #include #endif +#if QT_CONFIG(listview) #include +#endif #if QT_CONFIG(treeview) #include #include @@ -96,7 +98,7 @@ QAccessibleTable::QAccessibleTable(QWidget *w) m_role = QAccessible::Tree; } else #endif -#ifndef QT_NO_LISTVIEW +#if QT_CONFIG(listview) if (qobject_cast(view())) { m_role = QAccessible::List; } else diff --git a/src/widgets/graphicsview/qgraphicsproxywidget.cpp b/src/widgets/graphicsview/qgraphicsproxywidget.cpp index eface182ae..5e692abd73 100644 --- a/src/widgets/graphicsview/qgraphicsproxywidget.cpp +++ b/src/widgets/graphicsview/qgraphicsproxywidget.cpp @@ -55,7 +55,6 @@ #include #include #include -#include #include #include diff --git a/src/widgets/itemviews/itemviews.pri b/src/widgets/itemviews/itemviews.pri index c68aa590bc..effe9017e9 100644 --- a/src/widgets/itemviews/itemviews.pri +++ b/src/widgets/itemviews/itemviews.pri @@ -6,8 +6,6 @@ HEADERS += \ itemviews/qabstractitemview_p.h \ itemviews/qheaderview.h \ itemviews/qheaderview_p.h \ - itemviews/qlistview.h \ - itemviews/qlistview_p.h \ itemviews/qbsptree_p.h \ itemviews/qabstractitemdelegate.h \ itemviews/qabstractitemdelegate_p.h \ @@ -22,7 +20,6 @@ HEADERS += \ SOURCES += \ itemviews/qabstractitemview.cpp \ itemviews/qheaderview.cpp \ - itemviews/qlistview.cpp \ itemviews/qbsptree.cpp \ itemviews/qabstractitemdelegate.cpp \ itemviews/qitemdelegate.cpp \ @@ -43,6 +40,14 @@ qtConfig(columnview) { itemviews/qcolumnviewgrip.cpp } +qtConfig(listview) { + HEADERS += \ + itemviews/qlistview.h \ + itemviews/qlistview_p.h + + SOURCES += itemviews/qlistview.cpp +} + qtConfig(listwidget) { HEADERS += \ itemviews/qlistwidget.h \ diff --git a/src/widgets/itemviews/qlistview.cpp b/src/widgets/itemviews/qlistview.cpp index ca416d9c04..83962f3bbc 100644 --- a/src/widgets/itemviews/qlistview.cpp +++ b/src/widgets/itemviews/qlistview.cpp @@ -40,7 +40,6 @@ #include "qlistview.h" -#ifndef QT_NO_LISTVIEW #include #include #include @@ -3298,5 +3297,3 @@ QSize QListView::viewportSizeHint() const QT_END_NAMESPACE #include "moc_qlistview.cpp" - -#endif // QT_NO_LISTVIEW diff --git a/src/widgets/itemviews/qlistview.h b/src/widgets/itemviews/qlistview.h index 6b164aeec8..66ec9b18b1 100644 --- a/src/widgets/itemviews/qlistview.h +++ b/src/widgets/itemviews/qlistview.h @@ -43,10 +43,9 @@ #include #include -QT_BEGIN_NAMESPACE - +QT_REQUIRE_CONFIG(listview); -#ifndef QT_NO_LISTVIEW +QT_BEGIN_NAMESPACE class QListViewPrivate; @@ -195,8 +194,6 @@ private: Q_DISABLE_COPY(QListView) }; -#endif // QT_NO_LISTVIEW - QT_END_NAMESPACE #endif // QLISTVIEW_H diff --git a/src/widgets/itemviews/qlistview_p.h b/src/widgets/itemviews/qlistview_p.h index 6c0e470a93..8d29767951 100644 --- a/src/widgets/itemviews/qlistview_p.h +++ b/src/widgets/itemviews/qlistview_p.h @@ -58,7 +58,7 @@ #include #include -#ifndef QT_NO_LISTVIEW +QT_REQUIRE_CONFIG(listview); QT_BEGIN_NAMESPACE @@ -474,6 +474,4 @@ inline bool QCommonListViewBase::isRightToLeft() const { return qq->isRightToLef QT_END_NAMESPACE -#endif // QT_NO_LISTVIEW - #endif // QLISTVIEW_P_H diff --git a/src/widgets/styles/qmacstyle_mac_p_p.h b/src/widgets/styles/qmacstyle_mac_p_p.h index 7ff6279284..4a3ff1b8bf 100644 --- a/src/widgets/styles/qmacstyle_mac_p_p.h +++ b/src/widgets/styles/qmacstyle_mac_p_p.h @@ -69,7 +69,9 @@ #include #include #include +#if QT_CONFIG(listview) #include +#endif #include #include #include diff --git a/src/widgets/styles/qpixmapstyle.cpp b/src/widgets/styles/qpixmapstyle.cpp index 88482d28c9..20c9040a53 100644 --- a/src/widgets/styles/qpixmapstyle.cpp +++ b/src/widgets/styles/qpixmapstyle.cpp @@ -54,7 +54,9 @@ #include #include #include +#if QT_CONFIG(listview) #include +#endif #include #include #include diff --git a/src/widgets/styles/qwindowsstyle.cpp b/src/widgets/styles/qwindowsstyle.cpp index f805e29db1..d0ede56010 100644 --- a/src/widgets/styles/qwindowsstyle.cpp +++ b/src/widgets/styles/qwindowsstyle.cpp @@ -65,7 +65,9 @@ #if QT_CONFIG(wizard) #include "qwizard.h" #endif +#if QT_CONFIG(listview) #include "qlistview.h" +#endif #include #include #include @@ -548,7 +550,7 @@ int QWindowsStyle::styleHint(StyleHint hint, const QStyleOption *opt, const QWid break; case SH_ItemView_ShowDecorationSelected: -#ifndef QT_NO_LISTVIEW +#if QT_CONFIG(listview) if (qobject_cast(widget)) ret = 1; #endif diff --git a/src/widgets/styles/qwindowsvistastyle_p_p.h b/src/widgets/styles/qwindowsvistastyle_p_p.h index 5d772204a7..5c342df5a6 100644 --- a/src/widgets/styles/qwindowsvistastyle_p_p.h +++ b/src/widgets/styles/qwindowsvistastyle_p_p.h @@ -76,7 +76,9 @@ #include #include #include +#if QT_CONFIG(listview) #include +#endif #if QT_CONFIG(treeview) #include #endif diff --git a/src/widgets/styles/qwindowsxpstyle.cpp b/src/widgets/styles/qwindowsxpstyle.cpp index 87ac2ee4ae..e1c32d4ed6 100644 --- a/src/widgets/styles/qwindowsxpstyle.cpp +++ b/src/widgets/styles/qwindowsxpstyle.cpp @@ -63,7 +63,9 @@ #include #include #include +#if QT_CONFIG(listview) #include +#endif #include #if QT_CONFIG(pushbutton) #include diff --git a/src/widgets/util/qcompleter.cpp b/src/widgets/util/qcompleter.cpp index c412c4cbd5..9119c7896f 100644 --- a/src/widgets/util/qcompleter.cpp +++ b/src/widgets/util/qcompleter.cpp @@ -152,7 +152,9 @@ #include "QtWidgets/qfilesystemmodel.h" #endif #include "QtWidgets/qheaderview.h" +#if QT_CONFIG(listview) #include "QtWidgets/qlistview.h" +#endif #include "QtWidgets/qapplication.h" #include "QtGui/qevent.h" #include "QtWidgets/qdesktopwidget.h" @@ -816,11 +818,11 @@ void QCompleterPrivate::init(QAbstractItemModel *m) proxy = new QCompletionModel(this, q); QObject::connect(proxy, SIGNAL(rowsAdded()), q, SLOT(_q_autoResizePopup())); q->setModel(m); -#ifdef QT_NO_LISTVIEW +#if !QT_CONFIG(listview) q->setCompletionMode(QCompleter::InlineCompletion); #else q->setCompletionMode(QCompleter::PopupCompletion); -#endif // QT_NO_LISTVIEW +#endif // QT_CONFIG(listview) } void QCompleterPrivate::setCurrentIndex(QModelIndex index, bool select) @@ -1214,7 +1216,7 @@ void QCompleter::setPopup(QAbstractItemView *popup) popup->setFocusProxy(d->widget); popup->installEventFilter(this); popup->setItemDelegate(new QCompleterItemDelegate(popup)); -#ifndef QT_NO_LISTVIEW +#if QT_CONFIG(listview) if (QListView *listView = qobject_cast(popup)) { listView->setModelColumn(d->column); } @@ -1238,7 +1240,7 @@ void QCompleter::setPopup(QAbstractItemView *popup) QAbstractItemView *QCompleter::popup() const { Q_D(const QCompleter); -#ifndef QT_NO_LISTVIEW +#if QT_CONFIG(listview) if (!d->popup && completionMode() != QCompleter::InlineCompletion) { QListView *listView = new QListView; listView->setEditTriggers(QAbstractItemView::NoEditTriggers); @@ -1249,7 +1251,7 @@ QAbstractItemView *QCompleter::popup() const QCompleter *that = const_cast(this); that->setPopup(listView); } -#endif // QT_NO_LISTVIEW +#endif // QT_CONFIG(listview) return d->popup; } @@ -1580,7 +1582,7 @@ void QCompleter::setCompletionColumn(int column) Q_D(QCompleter); if (d->column == column) return; -#ifndef QT_NO_LISTVIEW +#if QT_CONFIG(listview) if (QListView *listView = qobject_cast(d->popup)) listView->setModelColumn(column); #endif -- cgit v1.2.3 From d819d6864a52d78cb86be3f2d3250a2c51835aeb Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Mon, 17 Jul 2017 13:50:36 -0700 Subject: QFileSystemWatcher/kqueue: make the fd duplication + FD_CLOEXEC atomic The original fd was already FD_CLOEXEC due to qt_safe_open. Change-Id: Ief61d358e2b54a0fac37fffd14d2394ee02da059 Reviewed-by: Oswald Buddenhagen --- src/corelib/io/qfilesystemwatcher_kqueue.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/corelib/io/qfilesystemwatcher_kqueue.cpp b/src/corelib/io/qfilesystemwatcher_kqueue.cpp index 4f6c83ebcf..c33fba2d1f 100644 --- a/src/corelib/io/qfilesystemwatcher_kqueue.cpp +++ b/src/corelib/io/qfilesystemwatcher_kqueue.cpp @@ -111,13 +111,12 @@ QStringList QKqueueFileSystemWatcherEngine::addPaths(const QStringList &paths, continue; } if (fd >= (int)FD_SETSIZE / 2 && fd < (int)FD_SETSIZE) { - int fddup = fcntl(fd, F_DUPFD, FD_SETSIZE); + int fddup = qt_safe_dup(fd, FD_SETSIZE); if (fddup != -1) { ::close(fd); fd = fddup; } } - fcntl(fd, F_SETFD, FD_CLOEXEC); QT_STATBUF st; if (QT_FSTAT(fd, &st) == -1) { -- cgit v1.2.3 From f9afae9e08986e84c5c4028fd09a849e92378300 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C5=82a=C5=BCej=20Szczygie=C5=82?= Date: Thu, 13 Jul 2017 22:19:31 +0200 Subject: QListView: Fix item movement in icon mode Since b13aa15e1007a1b5ed61049bbd9ef8f95b6d12a5 the event must not be accepted when calling "canDrop()" method. Inside it "dropOn()" method is called which requires not accepted event. Otherwise the event will be ignored later in "QListView::dragMoveEvent()". On next movement it will be accepted again - the event is now ignored, so "dropOn() method will work properly. If "filterDragMoveEvent()" returns false for any reason, the event acceptance is not changed - the same behavior as before. Task-number: QTBUG-61951 Change-Id: I2d49ce5b15300c42e2efc745e8e32d3d17f34a2f Reviewed-by: Friedemann Kleint Reviewed-by: Richard Moe Gustavsen --- src/widgets/itemviews/qlistview.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/widgets/itemviews/qlistview.cpp b/src/widgets/itemviews/qlistview.cpp index 83962f3bbc..9e959c8e1e 100644 --- a/src/widgets/itemviews/qlistview.cpp +++ b/src/widgets/itemviews/qlistview.cpp @@ -2814,11 +2814,17 @@ bool QIconModeViewBase::filterDragLeaveEvent(QDragLeaveEvent *e) bool QIconModeViewBase::filterDragMoveEvent(QDragMoveEvent *e) { - if (e->source() != qq || !dd->canDrop(e)) - return false; + const bool wasAccepted = e->isAccepted(); // ignore by default e->ignore(); + + if (e->source() != qq || !dd->canDrop(e)) { + // restore previous acceptance on failure + e->setAccepted(wasAccepted); + return false; + } + // get old dragged items rect QRect itemsRect = this->itemsRect(draggedItems); viewport()->update(itemsRect.translated(draggedItemsDelta())); -- cgit v1.2.3 From b28b3af38507942791df9d874ebaca71decc59ca Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Sun, 9 Jul 2017 12:41:32 -0700 Subject: QFileSystemEngine::id/Windows: Fix use with directories The Microsoft documentation says that CreateFile cannot be used to create directories, so you can only use it on a directory with OPEN_EXISTING and FILE_FLAG_BACKUP_SEMANTICS. This commit implements that. Change-Id: I658f552684924f8aa2cafffd14cfc0e5660a4a62 Reviewed-by: Friedemann Kleint Reviewed-by: Thiago Macieira --- src/corelib/io/qfilesystemengine_win.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/corelib/io/qfilesystemengine_win.cpp b/src/corelib/io/qfilesystemengine_win.cpp index 1cb4c75699..0542d9e16c 100644 --- a/src/corelib/io/qfilesystemengine_win.cpp +++ b/src/corelib/io/qfilesystemengine_win.cpp @@ -612,13 +612,20 @@ QByteArray fileIdWin8(HANDLE handle) QByteArray QFileSystemEngine::id(const QFileSystemEntry &entry) { QByteArray result; - const HANDLE handle = + #ifndef Q_OS_WINRT + const HANDLE handle = CreateFile((wchar_t*)entry.nativeFilePath().utf16(), 0, - FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + FILE_SHARE_READ, NULL, OPEN_EXISTING, + FILE_FLAG_BACKUP_SEMANTICS, NULL); #else // !Q_OS_WINRT + CREATEFILE2_EXTENDED_PARAMETERS params; + params.dwSize = sizeof(params); + params.dwFileAttributes = FILE_ATTRIBUTE_NORMAL; + params.dwFileFlags = FILE_FLAG_BACKUP_SEMANTICS; + const HANDLE handle = CreateFile2((const wchar_t*)entry.nativeFilePath().utf16(), 0, - FILE_SHARE_READ, OPEN_EXISTING, NULL); + FILE_SHARE_READ, OPEN_EXISTING, ¶ms); #endif // Q_OS_WINRT if (handle != INVALID_HANDLE_VALUE) { result = id(handle); -- cgit v1.2.3 From 2e2fa2a2836cfacef44d108269600c23b18e5c89 Mon Sep 17 00:00:00 2001 From: Alex Blasche Date: Fri, 21 Jul 2017 13:17:45 +0200 Subject: Fix documentation for QDBusError::Other Change-Id: I12c29833599793f0d42de6742109926ba78d5a6d Reviewed-by: Thiago Macieira --- src/dbus/qdbuserror.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dbus/qdbuserror.cpp b/src/dbus/qdbuserror.cpp index 61aacfc922..c599df6a32 100644 --- a/src/dbus/qdbuserror.cpp +++ b/src/dbus/qdbuserror.cpp @@ -197,7 +197,7 @@ static inline QDBusError::ErrorType get(const char *name) values: \value NoError QDBusError is invalid (i.e., the call succeeded) - \value Other QDBusError contains an error that is one of the well-known ones + \value Other QDBusError contains an error that is not one of the well-known ones \value Failed The call failed (\c org.freedesktop.DBus.Error.Failed) \value NoMemory Out of memory (\c org.freedesktop.DBus.Error.NoMemory) \value ServiceUnknown The called service is not known -- cgit v1.2.3 From 3becc8527e632e5d54e3d05d5c4f72246100c963 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Fri, 14 Jul 2017 11:13:20 +0200 Subject: Let QWindowsPipeWriter::write only warn about unexpected errors Do not print a critical message when the pipe connection dropped as this can happen with regular QLocalSocket usage as demonstrated in qtremoteobjects. Change-Id: If79915ce5d83b8cae5e090c04e893dafcb5a88a7 Reviewed-by: Friedemann Kleint --- src/corelib/io/qwindowspipewriter.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/corelib/io/qwindowspipewriter.cpp b/src/corelib/io/qwindowspipewriter.cpp index 7eb6dd0389..846891102f 100644 --- a/src/corelib/io/qwindowspipewriter.cpp +++ b/src/corelib/io/qwindowspipewriter.cpp @@ -201,7 +201,15 @@ bool QWindowsPipeWriter::write(const QByteArray &ba) writeSequenceStarted = false; numberOfBytesToWrite = 0; buffer.clear(); - qErrnoWarning("QWindowsPipeWriter::write failed."); + + const DWORD errorCode = GetLastError(); + switch (errorCode) { + case ERROR_NO_DATA: // "The pipe is being closed." + // The other end has closed the pipe. This can happen in QLocalSocket. Do not warn. + break; + default: + qErrnoWarning(errorCode, "QWindowsPipeWriter::write failed."); + } return false; } -- cgit v1.2.3 From fcfee98f62b8a8b8c3b1ac11cbb23620788a586c Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Thu, 13 Jul 2017 14:37:00 +0200 Subject: QLineEdit: Don't move the cursor after internalInsert() has done so internalInsert() will set the cursor to the right position which accounts for any input mask set on the control as well. Therefore it will already be placed at the next correct position and should not be changed again after that. Task-number: QTBUG-40943 Change-Id: Ic0f5fad6999ddd367e435ec4409a5db5b9eacb7b Reviewed-by: Daniel Teske Reviewed-by: David Faure --- src/widgets/widgets/qwidgetlinecontrol.cpp | 4 +-- .../widgets/widgets/qlineedit/tst_qlineedit.cpp | 32 ++++++++++++++++++++++ 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/src/widgets/widgets/qwidgetlinecontrol.cpp b/src/widgets/widgets/qwidgetlinecontrol.cpp index 97df3427b0..976cd173c5 100644 --- a/src/widgets/widgets/qwidgetlinecontrol.cpp +++ b/src/widgets/widgets/qwidgetlinecontrol.cpp @@ -548,10 +548,10 @@ void QWidgetLineControl::processInputMethodEvent(QInputMethodEvent *event) if (!event->commitString().isEmpty()) { internalInsert(event->commitString()); cursorPositionChanged = true; + } else { + m_cursor = qBound(0, c, m_text.length()); } - m_cursor = qBound(0, c, m_text.length()); - for (int i = 0; i < event->attributes().size(); ++i) { const QInputMethodEvent::Attribute &a = event->attributes().at(i); if (a.type == QInputMethodEvent::Selection) { diff --git a/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp b/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp index 3f7fdd6f6f..b434e48500 100644 --- a/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp +++ b/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp @@ -147,6 +147,7 @@ private slots: void keypress_inputMask_data(); void keypress_inputMask(); + void keypress_inputMethod_inputMask(); void inputMaskAndValidator_data(); void inputMaskAndValidator(); @@ -803,6 +804,37 @@ void tst_QLineEdit::keypress_inputMask() QCOMPARE(testWidget->displayText(), expectedDisplayText); } +void tst_QLineEdit::keypress_inputMethod_inputMask() +{ + // Similar to the keypress_inputMask test, but this is done solely via + // input methods + QLineEdit *testWidget = ensureTestWidget(); + testWidget->setInputMask("AA.AA.AA"); + { + QList attributes; + QInputMethodEvent event("", attributes); + event.setCommitString("EE"); + QApplication::sendEvent(testWidget, &event); + } + QCOMPARE(testWidget->cursorPosition(), 3); + QCOMPARE(testWidget->text(), QStringLiteral("EE..")); + { + QList attributes; + QInputMethodEvent event("", attributes); + event.setCommitString("EE"); + QApplication::sendEvent(testWidget, &event); + } + QCOMPARE(testWidget->cursorPosition(), 6); + QCOMPARE(testWidget->text(), QStringLiteral("EE.EE.")); + { + QList attributes; + QInputMethodEvent event("", attributes); + event.setCommitString("EE"); + QApplication::sendEvent(testWidget, &event); + } + QCOMPARE(testWidget->cursorPosition(), 8); + QCOMPARE(testWidget->text(), QStringLiteral("EE.EE.EE")); +} void tst_QLineEdit::hasAcceptableInputMask_data() { -- cgit v1.2.3 From 43b7c0c609ad4f01a392eb081a6d41adb80a92c7 Mon Sep 17 00:00:00 2001 From: Stephan Binner Date: Sat, 22 Jul 2017 15:11:58 +0200 Subject: Convert features.dirmodel to QT_[REQUIRE_]CONFIG Change-Id: I8e2c6b49857ffb292c4b08ccab560c59665cc3a4 Reviewed-by: Oswald Buddenhagen --- src/widgets/itemviews/itemviews.pri | 7 +++++-- src/widgets/itemviews/qdirmodel.cpp | 3 --- src/widgets/itemviews/qdirmodel.h | 7 ++----- src/widgets/util/qcompleter.cpp | 16 +++++++++------- 4 files changed, 16 insertions(+), 17 deletions(-) diff --git a/src/widgets/itemviews/itemviews.pri b/src/widgets/itemviews/itemviews.pri index effe9017e9..bdab346522 100644 --- a/src/widgets/itemviews/itemviews.pri +++ b/src/widgets/itemviews/itemviews.pri @@ -10,7 +10,6 @@ HEADERS += \ itemviews/qabstractitemdelegate.h \ itemviews/qabstractitemdelegate_p.h \ itemviews/qitemdelegate.h \ - itemviews/qdirmodel.h \ itemviews/qwidgetitemdata_p.h \ itemviews/qitemeditorfactory.h \ itemviews/qitemeditorfactory_p.h \ @@ -23,7 +22,6 @@ SOURCES += \ itemviews/qbsptree.cpp \ itemviews/qabstractitemdelegate.cpp \ itemviews/qitemdelegate.cpp \ - itemviews/qdirmodel.cpp \ itemviews/qitemeditorfactory.cpp \ itemviews/qdatawidgetmapper.cpp \ itemviews/qstyleditemdelegate.cpp @@ -40,6 +38,11 @@ qtConfig(columnview) { itemviews/qcolumnviewgrip.cpp } +qtConfig(dirmodel) { + HEADERS += itemviews/qdirmodel.h + SOURCES += itemviews/qdirmodel.cpp +} + qtConfig(listview) { HEADERS += \ itemviews/qlistview.h \ diff --git a/src/widgets/itemviews/qdirmodel.cpp b/src/widgets/itemviews/qdirmodel.cpp index 5526da8509..2cf76262e6 100644 --- a/src/widgets/itemviews/qdirmodel.cpp +++ b/src/widgets/itemviews/qdirmodel.cpp @@ -39,7 +39,6 @@ #include "qdirmodel.h" -#ifndef QT_NO_DIRMODEL #include #include #include @@ -1389,5 +1388,3 @@ QFileInfo QDirModelPrivate::resolvedInfo(QFileInfo info) QT_END_NAMESPACE #include "moc_qdirmodel.cpp" - -#endif // QT_NO_DIRMODEL diff --git a/src/widgets/itemviews/qdirmodel.h b/src/widgets/itemviews/qdirmodel.h index 90a9809986..30810cf4f6 100644 --- a/src/widgets/itemviews/qdirmodel.h +++ b/src/widgets/itemviews/qdirmodel.h @@ -45,10 +45,9 @@ #include #include -QT_BEGIN_NAMESPACE - +QT_REQUIRE_CONFIG(dirmodel); -#ifndef QT_NO_DIRMODEL +QT_BEGIN_NAMESPACE class QDirModelPrivate; @@ -143,8 +142,6 @@ private: Q_PRIVATE_SLOT(d_func(), void _q_refresh()) }; -#endif // QT_NO_DIRMODEL - QT_END_NAMESPACE #endif // QDIRMODEL_H diff --git a/src/widgets/util/qcompleter.cpp b/src/widgets/util/qcompleter.cpp index 9119c7896f..9ae0384020 100644 --- a/src/widgets/util/qcompleter.cpp +++ b/src/widgets/util/qcompleter.cpp @@ -147,7 +147,9 @@ #include "QtWidgets/qscrollbar.h" #include "QtCore/qstringlistmodel.h" +#if QT_CONFIG(dirmodel) #include "QtWidgets/qdirmodel.h" +#endif #if QT_CONFIG(filesystemmodel) #include "QtWidgets/qfilesystemmodel.h" #endif @@ -465,7 +467,7 @@ QMatchData QCompletionEngine::filterHistory() if (curParts.count() <= 1 || c->proxy->showAll || !source) return QMatchData(); -#ifndef QT_NO_DIRMODEL +#if QT_CONFIG(dirmodel) const bool isDirModel = (qobject_cast(source) != 0); #else const bool isDirModel = false; @@ -869,7 +871,7 @@ void QCompleterPrivate::_q_complete(QModelIndex index, bool highlighted) QModelIndex si = proxy->mapToSource(index); si = si.sibling(si.row(), column); // for clicked() completion = q->pathFromIndex(si); -#ifndef QT_NO_DIRMODEL +#if QT_CONFIG(dirmodel) // add a trailing separator in inline if (mode == QCompleter::InlineCompletion) { if (qobject_cast(proxy->sourceModel()) && QFileInfo(completion).isDir()) @@ -1057,7 +1059,7 @@ void QCompleter::setModel(QAbstractItemModel *model) setPopup(d->popup); // set the model and make new connections if (oldModel && oldModel->QObject::parent() == this) delete oldModel; -#ifndef QT_NO_DIRMODEL +#if QT_CONFIG(dirmodel) if (qobject_cast(model)) { #if defined(Q_OS_WIN) setCaseSensitivity(Qt::CaseInsensitive); @@ -1065,7 +1067,7 @@ void QCompleter::setModel(QAbstractItemModel *model) setCaseSensitivity(Qt::CaseSensitive); #endif } -#endif // QT_NO_DIRMODEL +#endif // QT_CONFIG(dirmodel) #if QT_CONFIG(filesystemmodel) QFileSystemModel *fsModel = qobject_cast(model); if (fsModel) { @@ -1771,7 +1773,7 @@ QString QCompleter::pathFromIndex(const QModelIndex& index) const return QString(); bool isDirModel = false; bool isFsModel = false; -#ifndef QT_NO_DIRMODEL +#if QT_CONFIG(dirmodel) isDirModel = qobject_cast(d->proxy->sourceModel()) != 0; #endif #if QT_CONFIG(filesystemmodel) @@ -1820,12 +1822,12 @@ QStringList QCompleter::splitPath(const QString& path) const { bool isDirModel = false; bool isFsModel = false; -#ifndef QT_NO_DIRMODEL +#if QT_CONFIG(dirmodel) Q_D(const QCompleter); isDirModel = qobject_cast(d->proxy->sourceModel()) != 0; #endif #if QT_CONFIG(filesystemmodel) -#ifdef QT_NO_DIRMODEL +#if !QT_CONFIG(dirmodel) Q_D(const QCompleter); #endif isFsModel = qobject_cast(d->proxy->sourceModel()) != 0; -- cgit v1.2.3 From 9a0e8895d6c254e060125060b15b039784405b85 Mon Sep 17 00:00:00 2001 From: Stephan Binner Date: Sat, 22 Jul 2017 15:13:53 +0200 Subject: Convert features.datawidgetmappper to QT_[REQUIRE_]CONFIG Change-Id: Icabee2b146a16b489ff6aa40261a694f74268dc1 Reviewed-by: Oswald Buddenhagen --- src/widgets/itemviews/itemviews.pri | 7 +++++-- src/widgets/itemviews/qdatawidgetmapper.cpp | 4 ---- src/widgets/itemviews/qdatawidgetmapper.h | 5 +---- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/src/widgets/itemviews/itemviews.pri b/src/widgets/itemviews/itemviews.pri index bdab346522..e95b640d18 100644 --- a/src/widgets/itemviews/itemviews.pri +++ b/src/widgets/itemviews/itemviews.pri @@ -13,7 +13,6 @@ HEADERS += \ itemviews/qwidgetitemdata_p.h \ itemviews/qitemeditorfactory.h \ itemviews/qitemeditorfactory_p.h \ - itemviews/qdatawidgetmapper.h \ itemviews/qstyleditemdelegate.h SOURCES += \ @@ -23,7 +22,6 @@ SOURCES += \ itemviews/qabstractitemdelegate.cpp \ itemviews/qitemdelegate.cpp \ itemviews/qitemeditorfactory.cpp \ - itemviews/qdatawidgetmapper.cpp \ itemviews/qstyleditemdelegate.cpp } @@ -38,6 +36,11 @@ qtConfig(columnview) { itemviews/qcolumnviewgrip.cpp } +qtConfig(datawidgetmapper) { + HEADERS += itemviews/qdatawidgetmapper.h + SOURCES += itemviews/qdatawidgetmapper.cpp +} + qtConfig(dirmodel) { HEADERS += itemviews/qdirmodel.h SOURCES += itemviews/qdirmodel.cpp diff --git a/src/widgets/itemviews/qdatawidgetmapper.cpp b/src/widgets/itemviews/qdatawidgetmapper.cpp index 99704c7911..1f0dbff7a9 100644 --- a/src/widgets/itemviews/qdatawidgetmapper.cpp +++ b/src/widgets/itemviews/qdatawidgetmapper.cpp @@ -39,8 +39,6 @@ #include "qdatawidgetmapper.h" -#ifndef QT_NO_DATAWIDGETMAPPER - #include "qabstractitemmodel.h" #include "qitemdelegate.h" #include "qmetaobject.h" @@ -827,5 +825,3 @@ QDataWidgetMapper::SubmitPolicy QDataWidgetMapper::submitPolicy() const QT_END_NAMESPACE #include "moc_qdatawidgetmapper.cpp" - -#endif // QT_NO_DATAWIDGETMAPPER diff --git a/src/widgets/itemviews/qdatawidgetmapper.h b/src/widgets/itemviews/qdatawidgetmapper.h index 4d244349ad..7d4d61378a 100644 --- a/src/widgets/itemviews/qdatawidgetmapper.h +++ b/src/widgets/itemviews/qdatawidgetmapper.h @@ -43,11 +43,10 @@ #include #include "QtCore/qobject.h" -#ifndef QT_NO_DATAWIDGETMAPPER +QT_REQUIRE_CONFIG(datawidgetmapper); QT_BEGIN_NAMESPACE - class QAbstractItemDelegate; class QAbstractItemModel; class QModelIndex; @@ -117,6 +116,4 @@ private: QT_END_NAMESPACE -#endif // QT_NO_DATAWIDGETMAPPER #endif - -- cgit v1.2.3 From 3ade30a2af5b64cb2437d214f25e4dcbfa00c49d Mon Sep 17 00:00:00 2001 From: Stephan Binner Date: Sat, 22 Jul 2017 15:15:12 +0200 Subject: Convert features.calendarwidget to QT_[REQUIRE_]CONFIG Change-Id: I93c2e00828a233f004c599bd0702d0a470ae29ff Reviewed-by: Oswald Buddenhagen --- src/widgets/accessible/qaccessiblewidgetfactory.cpp | 2 +- src/widgets/accessible/qaccessiblewidgets.cpp | 6 ++++-- src/widgets/accessible/qaccessiblewidgets_p.h | 4 ++-- src/widgets/widgets/qcalendarwidget.cpp | 4 ---- src/widgets/widgets/qcalendarwidget.h | 8 ++------ src/widgets/widgets/widgets.pri | 7 +++++-- tests/auto/other/qaccessibility/tst_qaccessibility.cpp | 4 ++-- 7 files changed, 16 insertions(+), 19 deletions(-) diff --git a/src/widgets/accessible/qaccessiblewidgetfactory.cpp b/src/widgets/accessible/qaccessiblewidgetfactory.cpp index a39674dc7a..20104eea68 100644 --- a/src/widgets/accessible/qaccessiblewidgetfactory.cpp +++ b/src/widgets/accessible/qaccessiblewidgetfactory.cpp @@ -209,7 +209,7 @@ QAccessibleInterface *qAccessibleFactory(const QString &classname, QObject *obje } else if (classname == QLatin1String("QScrollArea")) { iface = new QAccessibleScrollArea(widget); #endif -#ifndef QT_NO_CALENDARWIDGET +#if QT_CONFIG(calendarwidget) } else if (classname == QLatin1String("QCalendarWidget")) { iface = new QAccessibleCalendarWidget(widget); #endif diff --git a/src/widgets/accessible/qaccessiblewidgets.cpp b/src/widgets/accessible/qaccessiblewidgets.cpp index 60f489d487..eec60ac0c8 100644 --- a/src/widgets/accessible/qaccessiblewidgets.cpp +++ b/src/widgets/accessible/qaccessiblewidgets.cpp @@ -62,7 +62,9 @@ #include #endif #include +#if QT_CONFIG(calendarwidget) #include +#endif #include #include #include @@ -506,7 +508,7 @@ QAccessible::Role QAccessibleTextBrowser::role() const } #endif // QT_NO_TEXTBROWSER && QT_NO_CURSOR -#ifndef QT_NO_CALENDARWIDGET +#if QT_CONFIG(calendarwidget) // ===================== QAccessibleCalendarWidget ======================== QAccessibleCalendarWidget::QAccessibleCalendarWidget(QWidget *widget) : QAccessibleWidget(widget, QAccessible::Table) @@ -561,7 +563,7 @@ QWidget *QAccessibleCalendarWidget::navigationBar() const } return 0; } -#endif // QT_NO_CALENDARWIDGET +#endif // QT_CONFIG(calendarwidget) #ifndef QT_NO_DOCKWIDGET diff --git a/src/widgets/accessible/qaccessiblewidgets_p.h b/src/widgets/accessible/qaccessiblewidgets_p.h index 4d945a2016..781e297a3b 100644 --- a/src/widgets/accessible/qaccessiblewidgets_p.h +++ b/src/widgets/accessible/qaccessiblewidgets_p.h @@ -266,7 +266,7 @@ public: }; #endif // QT_NO_TEXTBROWSER && QT_NO_CURSOR -#ifndef QT_NO_CALENDARWIDGET +#if QT_CONFIG(calendarwidget) class QAccessibleCalendarWidget : public QAccessibleWidget { public: @@ -284,7 +284,7 @@ private: QAbstractItemView *calendarView() const; QWidget *navigationBar() const; }; -#endif // QT_NO_CALENDARWIDGET +#endif // QT_CONFIG(calendarwidget) #ifndef QT_NO_DOCKWIDGET class QAccessibleDockWidget: public QAccessibleWidget diff --git a/src/widgets/widgets/qcalendarwidget.cpp b/src/widgets/widgets/qcalendarwidget.cpp index b96492d623..94911d1cb1 100644 --- a/src/widgets/widgets/qcalendarwidget.cpp +++ b/src/widgets/widgets/qcalendarwidget.cpp @@ -39,8 +39,6 @@ #include "qcalendarwidget.h" -#ifndef QT_NO_CALENDARWIDGET - #include #include #include @@ -3129,5 +3127,3 @@ QT_END_NAMESPACE #include "qcalendarwidget.moc" #include "moc_qcalendarwidget.cpp" - -#endif //QT_NO_CALENDARWIDGET diff --git a/src/widgets/widgets/qcalendarwidget.h b/src/widgets/widgets/qcalendarwidget.h index 7780065117..29e2ff698b 100644 --- a/src/widgets/widgets/qcalendarwidget.h +++ b/src/widgets/widgets/qcalendarwidget.h @@ -44,10 +44,9 @@ #include #include -QT_BEGIN_NAMESPACE - +QT_REQUIRE_CONFIG(calendarwidget); -#ifndef QT_NO_CALENDARWIDGET +QT_BEGIN_NAMESPACE class QDate; class QTextCharFormat; @@ -184,9 +183,6 @@ private: }; -#endif // QT_NO_CALENDARWIDGET - QT_END_NAMESPACE #endif // QCALENDARWIDGET_H - diff --git a/src/widgets/widgets/widgets.pri b/src/widgets/widgets/widgets.pri index 610932c6ce..ee510bd120 100644 --- a/src/widgets/widgets/widgets.pri +++ b/src/widgets/widgets/widgets.pri @@ -5,7 +5,6 @@ HEADERS += \ widgets/qbuttongroup_p.h \ widgets/qabstractspinbox.h \ widgets/qabstractspinbox_p.h \ - widgets/qcalendarwidget.h \ widgets/qcombobox.h \ widgets/qcombobox_p.h \ widgets/qdial.h \ @@ -67,7 +66,6 @@ HEADERS += \ SOURCES += \ widgets/qbuttongroup.cpp \ widgets/qabstractspinbox.cpp \ - widgets/qcalendarwidget.cpp \ widgets/qcombobox.cpp \ widgets/qdial.cpp \ widgets/qdockwidget.cpp \ @@ -129,6 +127,11 @@ qtConfig(abstractslider) { widgets/qabstractslider.cpp } +qtConfig(calendarwidget) { + HEADERS += widgets/qcalendarwidget.h + SOURCES += widgets/qcalendarwidget.cpp +} + qtConfig(checkbox) { HEADERS += \ widgets/qcheckbox.h diff --git a/tests/auto/other/qaccessibility/tst_qaccessibility.cpp b/tests/auto/other/qaccessibility/tst_qaccessibility.cpp index 4f60fe3d96..4a64f06e81 100644 --- a/tests/auto/other/qaccessibility/tst_qaccessibility.cpp +++ b/tests/auto/other/qaccessibility/tst_qaccessibility.cpp @@ -3344,7 +3344,7 @@ void tst_QAccessibility::tableTest() void tst_QAccessibility::calendarWidgetTest() { -#ifndef QT_NO_CALENDARWIDGET +#if QT_CONFIG(calendarwidget) { QCalendarWidget calendarWidget; @@ -3420,7 +3420,7 @@ void tst_QAccessibility::calendarWidgetTest() } QTestAccessibility::clearEvents(); -#endif // QT_NO_CALENDARWIDGET +#endif // QT_CONFIG(calendarwidget) } void tst_QAccessibility::dockWidgetTest() -- cgit v1.2.3 From 163863f77d891f56573e4dae316d16cfc2fefc8f Mon Sep 17 00:00:00 2001 From: Stephan Binner Date: Sat, 22 Jul 2017 15:16:51 +0200 Subject: Convert features.combobox to QT_[REQUIRE_]CONFIG Change-Id: I2f415de8556289a6461a645d559be17089c43c99 Reviewed-by: Oswald Buddenhagen --- src/sql/models/qsqlrelationaldelegate.h | 2 ++ src/widgets/accessible/complexwidgets.cpp | 6 ++++-- src/widgets/accessible/complexwidgets_p.h | 4 ++-- .../accessible/qaccessiblewidgetfactory.cpp | 2 +- src/widgets/itemviews/qitemeditorfactory.cpp | 18 +++++++++++------- src/widgets/styles/qcommonstyle.cpp | 20 ++++++++++---------- src/widgets/styles/qfusionstyle.cpp | 2 ++ src/widgets/styles/qmacstyle_mac.mm | 22 ++++++++++++---------- src/widgets/styles/qmacstyle_mac_p_p.h | 2 ++ src/widgets/styles/qpixmapstyle.cpp | 2 ++ src/widgets/styles/qstylesheetstyle.cpp | 20 +++++++++++--------- src/widgets/styles/qwindowsstyle.cpp | 8 ++++---- src/widgets/styles/qwindowsvistastyle.cpp | 8 ++++---- src/widgets/styles/qwindowsvistastyle_p_p.h | 2 ++ src/widgets/styles/qwindowsxpstyle.cpp | 14 ++++++++------ src/widgets/widgets/qcombobox.cpp | 3 --- src/widgets/widgets/qcombobox.h | 6 ++---- src/widgets/widgets/qcombobox_p.h | 5 ++--- src/widgets/widgets/qdatetimeedit_p.h | 1 - src/widgets/widgets/qtoolbar.cpp | 2 ++ src/widgets/widgets/widgets.pri | 11 ++++++++--- 21 files changed, 91 insertions(+), 69 deletions(-) diff --git a/src/sql/models/qsqlrelationaldelegate.h b/src/sql/models/qsqlrelationaldelegate.h index 42c0cc27b1..53f43a4acb 100644 --- a/src/sql/models/qsqlrelationaldelegate.h +++ b/src/sql/models/qsqlrelationaldelegate.h @@ -48,7 +48,9 @@ #if QT_CONFIG(listview) #include #endif +#if QT_CONFIG(combobox) #include +#endif #include #include diff --git a/src/widgets/accessible/complexwidgets.cpp b/src/widgets/accessible/complexwidgets.cpp index 42775d7324..29e11556aa 100644 --- a/src/widgets/accessible/complexwidgets.cpp +++ b/src/widgets/accessible/complexwidgets.cpp @@ -44,7 +44,9 @@ #include #include #include +#if QT_CONFIG(combobox) #include +#endif #include #include #include @@ -260,7 +262,7 @@ QString QAccessibleTabBar::text(QAccessible::Text t) const #endif // QT_NO_TABBAR -#ifndef QT_NO_COMBOBOX +#if QT_CONFIG(combobox) /*! \class QAccessibleComboBox \brief The QAccessibleComboBox class implements the QAccessibleInterface for editable and read-only combo boxes. @@ -378,7 +380,7 @@ QStringList QAccessibleComboBox::keyBindingsForAction(const QString &/*actionNam return QStringList(); } -#endif // QT_NO_COMBOBOX +#endif // QT_CONFIG(combobox) #ifndef QT_NO_SCROLLAREA // ======================= QAccessibleAbstractScrollArea ======================= diff --git a/src/widgets/accessible/complexwidgets_p.h b/src/widgets/accessible/complexwidgets_p.h index d43b06f4a4..b4b4e89a1a 100644 --- a/src/widgets/accessible/complexwidgets_p.h +++ b/src/widgets/accessible/complexwidgets_p.h @@ -124,7 +124,7 @@ protected: }; #endif // QT_NO_TABBAR -#ifndef QT_NO_COMBOBOX +#if QT_CONFIG(combobox) class QAccessibleComboBox : public QAccessibleWidget { public: @@ -146,7 +146,7 @@ public: protected: QComboBox *comboBox() const; }; -#endif // QT_NO_COMBOBOX +#endif // QT_CONFIG(combobox) #endif // QT_NO_ACCESSIBILITY diff --git a/src/widgets/accessible/qaccessiblewidgetfactory.cpp b/src/widgets/accessible/qaccessiblewidgetfactory.cpp index 20104eea68..371158c73c 100644 --- a/src/widgets/accessible/qaccessiblewidgetfactory.cpp +++ b/src/widgets/accessible/qaccessiblewidgetfactory.cpp @@ -79,7 +79,7 @@ QAccessibleInterface *qAccessibleFactory(const QString &classname, QObject *obje else iface = new QAccessibleLineEdit(widget); #endif -#ifndef QT_NO_COMBOBOX +#if QT_CONFIG(combobox) } else if (classname == QLatin1String("QComboBox")) { iface = new QAccessibleComboBox(widget); #endif diff --git a/src/widgets/itemviews/qitemeditorfactory.cpp b/src/widgets/itemviews/qitemeditorfactory.cpp index a31689e0b5..dcfe4065a6 100644 --- a/src/widgets/itemviews/qitemeditorfactory.cpp +++ b/src/widgets/itemviews/qitemeditorfactory.cpp @@ -43,7 +43,9 @@ #ifndef QT_NO_ITEMVIEWS +#if QT_CONFIG(combobox) #include +#endif #if QT_CONFIG(datetimeedit) #include #endif @@ -52,6 +54,8 @@ #endif #include #include +#include +#include #include #include #include @@ -62,7 +66,7 @@ QT_BEGIN_NAMESPACE -#ifndef QT_NO_COMBOBOX +#if QT_CONFIG(combobox) class QBooleanComboBox : public QComboBox { @@ -75,7 +79,7 @@ public: bool value() const; }; -#endif // QT_NO_COMBOBOX +#endif // QT_CONFIG(combobox) #ifndef QT_NO_SPINBOX @@ -234,7 +238,7 @@ public: QWidget *QDefaultItemEditorFactory::createEditor(int userType, QWidget *parent) const { switch (userType) { -#ifndef QT_NO_COMBOBOX +#if QT_CONFIG(combobox) case QVariant::Bool: { QBooleanComboBox *cb = new QBooleanComboBox(parent); cb->setFrame(false); @@ -300,7 +304,7 @@ QWidget *QDefaultItemEditorFactory::createEditor(int userType, QWidget *parent) QByteArray QDefaultItemEditorFactory::valuePropertyName(int userType) const { switch (userType) { -#ifndef QT_NO_COMBOBOX +#if QT_CONFIG(combobox) case QVariant::Bool: return "currentIndex"; #endif @@ -595,7 +599,7 @@ void QExpandingLineEdit::resizeToContents() #endif // QT_NO_LINEEDIT -#ifndef QT_NO_COMBOBOX +#if QT_CONFIG(combobox) QBooleanComboBox::QBooleanComboBox(QWidget *parent) : QComboBox(parent) @@ -614,11 +618,11 @@ bool QBooleanComboBox::value() const return (currentIndex() == 1); } -#endif // QT_NO_COMBOBOX +#endif // QT_CONFIG(combobox) QT_END_NAMESPACE -#if !defined(QT_NO_LINEEDIT) || !defined(QT_NO_COMBOBOX) +#if !defined(QT_NO_LINEEDIT) || QT_CONFIG(combobox) #include "qitemeditorfactory.moc" #endif diff --git a/src/widgets/styles/qcommonstyle.cpp b/src/widgets/styles/qcommonstyle.cpp index 973e89b3ef..b1b84501c5 100644 --- a/src/widgets/styles/qcommonstyle.cpp +++ b/src/widgets/styles/qcommonstyle.cpp @@ -2096,7 +2096,7 @@ void QCommonStyle::drawControl(ControlElement element, const QStyleOption *opt, case CE_HeaderEmptyArea: p->fillRect(opt->rect, opt->palette.background()); break; -#ifndef QT_NO_COMBOBOX +#if QT_CONFIG(combobox) case CE_ComboBoxLabel: if (const QStyleOptionComboBox *cb = qstyleoption_cast(opt)) { QRect editRect = proxy()->subControlRect(CC_ComboBox, cb, SC_ComboBoxEditField, widget); @@ -2128,7 +2128,7 @@ void QCommonStyle::drawControl(ControlElement element, const QStyleOption *opt, p->restore(); } break; -#endif // QT_NO_COMBOBOX +#endif // QT_CONFIG(combobox) #ifndef QT_NO_TOOLBAR case CE_ToolBar: if (const QStyleOptionToolBar *toolBar = qstyleoption_cast(opt)) { @@ -2505,7 +2505,7 @@ QRect QCommonStyle::subElementRect(SubElement sr, const QStyleOption *opt, } break; #endif // QT_NO_PROGRESSBAR -#ifndef QT_NO_COMBOBOX +#if QT_CONFIG(combobox) case SE_ComboBoxFocusRect: if (const QStyleOptionComboBox *cb = qstyleoption_cast(opt)) { int margin = cb->frame ? 3 : 0; @@ -2514,7 +2514,7 @@ QRect QCommonStyle::subElementRect(SubElement sr, const QStyleOption *opt, r = visualRect(opt->direction, opt->rect, r); } break; -#endif // QT_NO_COMBOBOX +#endif // QT_CONFIG(combobox) #ifndef QT_NO_TOOLBOX case SE_ToolBoxTabContents: r = opt->rect; @@ -3892,7 +3892,7 @@ QStyle::SubControl QCommonStyle::hitTestComplexControl(ComplexControl cc, const } } break; -#ifndef QT_NO_COMBOBOX +#if QT_CONFIG(combobox) case CC_ComboBox: if (const QStyleOptionComboBox *cb = qstyleoption_cast(opt)) { QRect r; @@ -3907,7 +3907,7 @@ QStyle::SubControl QCommonStyle::hitTestComplexControl(ComplexControl cc, const } } break; -#endif // QT_NO_COMBOBOX +#endif // QT_CONFIG(combobox) #ifndef QT_NO_GROUPBOX case CC_GroupBox: if (const QStyleOptionGroupBox *groupBox = qstyleoption_cast(opt)) { @@ -4140,7 +4140,7 @@ QRect QCommonStyle::subControlRect(ComplexControl cc, const QStyleOptionComplex } break; #endif // QT_NO_TOOLBUTTON -#ifndef QT_NO_COMBOBOX +#if QT_CONFIG(combobox) case CC_ComboBox: if (const QStyleOptionComboBox *cb = qstyleoption_cast(opt)) { int x = cb->rect.x(), @@ -4172,7 +4172,7 @@ QRect QCommonStyle::subControlRect(ComplexControl cc, const QStyleOptionComplex ret = visualRect(cb->direction, cb->rect, ret); } break; -#endif // QT_NO_COMBOBOX +#endif // QT_CONFIG(combobox) case CC_TitleBar: if (const QStyleOptionTitleBar *tb = qstyleoption_cast(opt)) { const int controlMargin = 2; @@ -4839,7 +4839,7 @@ QSize QCommonStyle::sizeFromContents(ContentsType ct, const QStyleOption *opt, sz = QSize(sz.width() + 6, sz.height() + 5); break; #endif // QT_NO_TOOLBUTTON -#ifndef QT_NO_COMBOBOX +#if QT_CONFIG(combobox) case CT_ComboBox: if (const QStyleOptionComboBox *cmb = qstyleoption_cast(opt)) { int fw = cmb->frame ? proxy()->pixelMetric(PM_ComboBoxFrameWidth, opt, widget) * 2 : 0; @@ -4849,7 +4849,7 @@ QSize QCommonStyle::sizeFromContents(ContentsType ct, const QStyleOption *opt, sz = QSize(sz.width() + fw + other, sz.height() + fw); } break; -#endif // QT_NO_COMBOBOX +#endif // QT_CONFIG(combobox) case CT_HeaderSection: if (const QStyleOptionHeader *hdr = qstyleoption_cast(opt)) { bool nullIcon = hdr->icon.isNull(); diff --git a/src/widgets/styles/qfusionstyle.cpp b/src/widgets/styles/qfusionstyle.cpp index b6e61e7cc9..792d958d8b 100644 --- a/src/widgets/styles/qfusionstyle.cpp +++ b/src/widgets/styles/qfusionstyle.cpp @@ -42,7 +42,9 @@ #if QT_CONFIG(style_fusion) || defined(QT_PLUGIN) #include "qcommonstyle_p.h" +#if QT_CONFIG(combobox) #include +#endif #if QT_CONFIG(pushbutton) #include #endif diff --git a/src/widgets/styles/qmacstyle_mac.mm b/src/widgets/styles/qmacstyle_mac.mm index 6e8796970f..dbba51b00d 100644 --- a/src/widgets/styles/qmacstyle_mac.mm +++ b/src/widgets/styles/qmacstyle_mac.mm @@ -51,12 +51,14 @@ //#define DEBUG_SIZE_CONSTRAINT #include -#include #include #include #include #include +#if QT_CONFIG(combobox) +#include #include +#endif #if QT_CONFIG(dialogbuttonbox) #include #endif @@ -643,7 +645,7 @@ static QSize qt_aqua_get_known_size(QStyle::ContentsType ct, const QWidget *widg else if (qobject_cast(widg)) ct = QStyle::CT_CheckBox; #endif -#ifndef QT_NO_COMBOBOX +#if QT_CONFIG(combobox) else if (qobject_cast(widg)) ct = QStyle::CT_ComboBox; #endif @@ -889,7 +891,7 @@ static QSize qt_aqua_get_known_size(QStyle::ContentsType ct, const QWidget *widg break; } #endif -#ifndef QT_NO_COMBOBOX +#if QT_CONFIG(combobox) case QStyle::CT_LineEdit: if (!widg || !qobject_cast(widg->parentWidget())) { //should I take into account the font dimentions of the lineedit? -Sam @@ -2264,7 +2266,7 @@ void QMacStyle::polish(QWidget* w) #ifndef QT_NO_MENU if (qobject_cast(w) -#ifndef QT_NO_COMBOBOX +#if QT_CONFIG(combobox) || qobject_cast(w) #endif ) { @@ -2332,7 +2334,7 @@ void QMacStyle::unpolish(QWidget* w) w->setWindowOpacity(1.0); } -#ifndef QT_NO_COMBOBOX +#if QT_CONFIG(combobox) if (QComboBox *combo = qobject_cast(w)) { if (!combo->isEditable()) { if (QWidget *widget = combo->findChild()) @@ -4484,7 +4486,7 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter // Always be normal or disabled to follow the Mac style. int smallIconSize = proxy()->pixelMetric(PM_SmallIconSize); QSize iconSize(smallIconSize, smallIconSize); -#ifndef QT_NO_COMBOBOX +#if QT_CONFIG(combobox) if (const QComboBox *comboBox = qobject_cast(w)) { iconSize = comboBox->iconSize(); } @@ -5065,7 +5067,7 @@ QRect QMacStyle::subElementRect(SubElement sr, const QStyleOption *opt, #endif case SE_LineEditContents: rect = QCommonStyle::subElementRect(sr, opt, widget); -#ifndef QT_NO_COMBOBOX +#if QT_CONFIG(combobox) if (widget && qobject_cast(widget->parentWidget())) rect.adjust(-1, -2, 0, 0); else @@ -6742,7 +6744,7 @@ QSize QMacStyle::sizeFromContents(ContentsType ct, const QStyleOption *opt, case QStyle::CT_MenuItem: if (const QStyleOptionMenuItem *mi = qstyleoption_cast(opt)) { int maxpmw = mi->maxIconWidth; -#ifndef QT_NO_COMBOBOX +#if QT_CONFIG(combobox) const QComboBox *comboBox = qobject_cast(widget); #endif int w = sz.width(), @@ -6755,7 +6757,7 @@ QSize QMacStyle::sizeFromContents(ContentsType ct, const QStyleOption *opt, } else { h = mi->fontMetrics.height() + 2; if (!mi->icon.isNull()) { -#ifndef QT_NO_COMBOBOX +#if QT_CONFIG(combobox) if (comboBox) { const QSize &iconSize = comboBox->iconSize(); h = qMax(h, iconSize.height() + 4); @@ -6776,7 +6778,7 @@ QSize QMacStyle::sizeFromContents(ContentsType ct, const QStyleOption *opt, w += maxpmw + 6; // add space for a check. All items have place for a check too. w += 20; -#ifndef QT_NO_COMBOBOX +#if QT_CONFIG(combobox) if (comboBox && comboBox->isVisible()) { QStyleOptionComboBox cmb; cmb.initFrom(comboBox); diff --git a/src/widgets/styles/qmacstyle_mac_p_p.h b/src/widgets/styles/qmacstyle_mac_p_p.h index 4a3ff1b8bf..17e60e3bef 100644 --- a/src/widgets/styles/qmacstyle_mac_p_p.h +++ b/src/widgets/styles/qmacstyle_mac_p_p.h @@ -48,7 +48,9 @@ #include "qmacstyle_mac_p.h" #include "qcommonstyle_p.h" #include +#if QT_CONFIG(combobox) #include +#endif #include #include #include diff --git a/src/widgets/styles/qpixmapstyle.cpp b/src/widgets/styles/qpixmapstyle.cpp index 20c9040a53..795fe34975 100644 --- a/src/widgets/styles/qpixmapstyle.cpp +++ b/src/widgets/styles/qpixmapstyle.cpp @@ -52,7 +52,9 @@ #include #include #include +#if QT_CONFIG(combobox) #include +#endif #include #if QT_CONFIG(listview) #include diff --git a/src/widgets/styles/qstylesheetstyle.cpp b/src/widgets/styles/qstylesheetstyle.cpp index 5d977d75c0..e23a1f60b5 100644 --- a/src/widgets/styles/qstylesheetstyle.cpp +++ b/src/widgets/styles/qstylesheetstyle.cpp @@ -51,7 +51,9 @@ #include #include #include +#if QT_CONFIG(combobox) #include +#endif #include "private/qcssparser_p.h" #include "private/qmath_p.h" #include @@ -1639,7 +1641,7 @@ int QStyleSheetStyle::nativeFrameWidth(const QWidget *w) return base->pixelMetric(QStyle::PM_SpinBoxFrameWidth, 0, w); #endif -#ifndef QT_NO_COMBOBOX +#if QT_CONFIG(combobox) if (qobject_cast(w)) return base->pixelMetric(QStyle::PM_ComboBoxFrameWidth, 0, w); #endif @@ -2338,7 +2340,7 @@ QRect QStyleSheetStyle::positionRect(const QWidget *w, const QRenderRule& rule1, */ static QWidget *embeddedWidget(QWidget *w) { -#ifndef QT_NO_COMBOBOX +#if QT_CONFIG(combobox) if (QComboBox *cmb = qobject_cast(w)) { if (cmb->isEditable()) return cmb->lineEdit(); @@ -2372,7 +2374,7 @@ static QWidget *containerWidget(const QWidget *w) #ifndef QT_NO_LINEEDIT if (qobject_cast(w)) { //if the QLineEdit is an embeddedWidget, we need the rule of the real widget -#ifndef QT_NO_COMBOBOX +#if QT_CONFIG(combobox) if (qobject_cast(w->parentWidget())) return w->parentWidget(); #endif @@ -2411,7 +2413,7 @@ static bool unstylable(const QWidget *w) // detect QComboBoxPrivateContainer else if (qobject_cast(w)) { if (0 -#ifndef QT_NO_COMBOBOX +#if QT_CONFIG(combobox) || qobject_cast(w->parentWidget()) #endif ) @@ -2436,7 +2438,7 @@ static quint64 extendedPseudoClass(const QWidget *w) pc |= ((slider->orientation() == Qt::Vertical) ? PseudoClass_Vertical : PseudoClass_Horizontal); } else #endif -#ifndef QT_NO_COMBOBOX +#if QT_CONFIG(combobox) if (const QComboBox *combo = qobject_cast(w)) { if (combo->isEditable()) pc |= (combo->isEditable() ? PseudoClass_Editable : PseudoClass_ReadOnly); @@ -3769,7 +3771,7 @@ void QStyleSheetStyle::drawControl(ControlElement ce, const QStyleOption *opt, Q } return; -#ifndef QT_NO_COMBOBOX +#if QT_CONFIG(combobox) case CE_ComboBoxLabel: if (!rule.hasBox()) break; @@ -3805,7 +3807,7 @@ void QStyleSheetStyle::drawControl(ControlElement ce, const QStyleOption *opt, Q return; } break; -#endif // QT_NO_COMBOBOX +#endif // QT_CONFIG(combobox) case CE_Header: if (hasStyleRule(w, PseudoElement_HeaderViewUpArrow) @@ -5297,7 +5299,7 @@ int QStyleSheetStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWi case SH_TabBar_ElideMode: s = QLatin1String("tabbar-elide-mode"); break; case SH_TabBar_PreferNoArrows: s = QLatin1String("tabbar-prefer-no-arrows"); break; case SH_ComboBox_PopupFrameStyle: -#ifndef QT_NO_COMBOBOX +#if QT_CONFIG(combobox) if (qobject_cast(w)) { QAbstractItemView *view = w->findChild(); if (view) { @@ -5307,7 +5309,7 @@ int QStyleSheetStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWi return QFrame::NoFrame; } } -#endif // QT_NO_COMBOBOX +#endif // QT_CONFIG(combobox) break; case SH_DialogButtonBox_ButtonsHaveIcons: s = QLatin1String("dialogbuttonbox-buttons-have-icons"); break; case SH_Workspace_FillSpaceOnMaximize: s = QLatin1String("mdi-fill-space-on-maximize"); break; diff --git a/src/widgets/styles/qwindowsstyle.cpp b/src/widgets/styles/qwindowsstyle.cpp index d0ede56010..7b6da75089 100644 --- a/src/widgets/styles/qwindowsstyle.cpp +++ b/src/widgets/styles/qwindowsstyle.cpp @@ -1859,7 +1859,7 @@ void QWindowsStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPai } return; #endif // QT_NO_DOCKWIDGET -#ifndef QT_NO_COMBOBOX +#if QT_CONFIG(combobox) case CE_ComboBoxLabel: if (const QStyleOptionComboBox *cb = qstyleoption_cast(opt)) { if (cb->state & State_HasFocus) { @@ -1872,7 +1872,7 @@ void QWindowsStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPai } QCommonStyle::drawControl(ce, opt, p, widget); break; -#endif // QT_NO_COMBOBOX +#endif // QT_CONFIG(combobox) default: QCommonStyle::drawControl(ce, opt, p, widget); } @@ -2150,7 +2150,7 @@ void QWindowsStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComp } break; #endif // QT_NO_SCROLLBAR -#ifndef QT_NO_COMBOBOX +#if QT_CONFIG(combobox) case CC_ComboBox: if (const QStyleOptionComboBox *cmb = qstyleoption_cast(opt)) { QBrush editBrush = cmb->palette.brush(QPalette::Base); @@ -2223,7 +2223,7 @@ void QWindowsStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComp } } break; -#endif // QT_NO_COMBOBOX +#endif // QT_CONFIG(combobox) #ifndef QT_NO_SPINBOX case CC_SpinBox: if (const QStyleOptionSpinBox *sb = qstyleoption_cast(opt)) { diff --git a/src/widgets/styles/qwindowsvistastyle.cpp b/src/widgets/styles/qwindowsvistastyle.cpp index ae1b83957c..e400820256 100644 --- a/src/widgets/styles/qwindowsvistastyle.cpp +++ b/src/widgets/styles/qwindowsvistastyle.cpp @@ -1474,11 +1474,11 @@ void QWindowsVistaStyle::drawControl(ControlElement element, const QStyleOption break; } #endif // QT_NO_ITEMVIEWS -#ifndef QT_NO_COMBOBOX +#if QT_CONFIG(combobox) case CE_ComboBoxLabel: QCommonStyle::drawControl(element, option, painter, widget); break; -#endif // QT_NO_COMBOBOX +#endif // QT_CONFIG(combobox) default: QWindowsXPStyle::drawControl(element, option, painter, widget); break; @@ -2121,7 +2121,7 @@ QRect QWindowsVistaStyle::subControlRect(ComplexControl control, const QStyleOpt QRect rect = QWindowsXPStyle::subControlRect(control, option, subControl, widget); switch (control) { -#ifndef QT_NO_COMBOBOX +#if QT_CONFIG(combobox) case CC_ComboBox: if (const QStyleOptionComboBox *cb = qstyleoption_cast(option)) { int x = cb->rect.x(), @@ -2154,7 +2154,7 @@ QRect QWindowsVistaStyle::subControlRect(ComplexControl control, const QStyleOpt return rect; } break; -#endif // QT_NO_COMBOBOX +#endif // QT_CONFIG(combobox) case CC_TitleBar: if (const QStyleOptionTitleBar *tb = qstyleoption_cast(option)) { if (!buttonVisible(subControl, tb)) diff --git a/src/widgets/styles/qwindowsvistastyle_p_p.h b/src/widgets/styles/qwindowsvistastyle_p_p.h index 5c342df5a6..22ca1d3534 100644 --- a/src/widgets/styles/qwindowsvistastyle_p_p.h +++ b/src/widgets/styles/qwindowsvistastyle_p_p.h @@ -72,7 +72,9 @@ #include #include #include +#if QT_CONFIG(combobox) #include +#endif #include #include #include diff --git a/src/widgets/styles/qwindowsxpstyle.cpp b/src/widgets/styles/qwindowsxpstyle.cpp index e1c32d4ed6..418c4d256e 100644 --- a/src/widgets/styles/qwindowsxpstyle.cpp +++ b/src/widgets/styles/qwindowsxpstyle.cpp @@ -59,7 +59,9 @@ #include #include #include +#if QT_CONFIG(combobox) #include +#endif #include #include #include @@ -1147,9 +1149,9 @@ void QWindowsXPStyle::polish(QWidget *widget) #endif || qobject_cast(widget) || qobject_cast(widget) -#ifndef QT_NO_COMBOBOX +#if QT_CONFIG(combobox) || qobject_cast(widget) -#endif // QT_NO_COMBOBOX +#endif // QT_CONFIG(combobox) || qobject_cast(widget) || qobject_cast(widget) || qobject_cast(widget) @@ -1222,9 +1224,9 @@ void QWindowsXPStyle::unpolish(QWidget *widget) #endif || qobject_cast(widget) || qobject_cast(widget) -#ifndef QT_NO_COMBOBOX +#if QT_CONFIG(combobox) || qobject_cast(widget) -#endif // QT_NO_COMBOBOX +#endif // QT_CONFIG(combobox) || qobject_cast(widget) || qobject_cast(widget) || qobject_cast(widget) @@ -2550,7 +2552,7 @@ void QWindowsXPStyle::drawComplexControl(ComplexControl cc, const QStyleOptionCo } break; #endif // QT_NO_SPINBOX -#ifndef QT_NO_COMBOBOX +#if QT_CONFIG(combobox) case CC_ComboBox: if (const QStyleOptionComboBox *cmb = qstyleoption_cast(option)) { @@ -2601,7 +2603,7 @@ void QWindowsXPStyle::drawComplexControl(ComplexControl cc, const QStyleOptionCo } } break; -#endif // QT_NO_COMBOBOX +#endif // QT_CONFIG(combobox) case CC_ScrollBar: if (const QStyleOptionSlider *scrollbar = qstyleoption_cast(option)) { diff --git a/src/widgets/widgets/qcombobox.cpp b/src/widgets/widgets/qcombobox.cpp index 6a8167b5e5..506986f4ba 100644 --- a/src/widgets/widgets/qcombobox.cpp +++ b/src/widgets/widgets/qcombobox.cpp @@ -39,7 +39,6 @@ #include "qcombobox.h" -#ifndef QT_NO_COMBOBOX #include #include #include @@ -3486,5 +3485,3 @@ QT_END_NAMESPACE #include "moc_qcombobox.cpp" #include "moc_qcombobox_p.cpp" - -#endif // QT_NO_COMBOBOX diff --git a/src/widgets/widgets/qcombobox.h b/src/widgets/widgets/qcombobox.h index 8f99594a76..a6aac6f8aa 100644 --- a/src/widgets/widgets/qcombobox.h +++ b/src/widgets/widgets/qcombobox.h @@ -46,9 +46,9 @@ #include #include -QT_BEGIN_NAMESPACE +QT_REQUIRE_CONFIG(combobox); -#ifndef QT_NO_COMBOBOX +QT_BEGIN_NAMESPACE class QAbstractItemView; class QLineEdit; @@ -277,8 +277,6 @@ inline void QComboBox::insertItem(int aindex, const QString &atext, const QVariant &auserData) { insertItem(aindex, QIcon(), atext, auserData); } -#endif // QT_NO_COMBOBOX - QT_END_NAMESPACE #endif // QCOMBOBOX_H diff --git a/src/widgets/widgets/qcombobox_p.h b/src/widgets/widgets/qcombobox_p.h index 6c36359f81..ab4dd0281f 100644 --- a/src/widgets/widgets/qcombobox_p.h +++ b/src/widgets/widgets/qcombobox_p.h @@ -54,7 +54,6 @@ #include #include "QtWidgets/qcombobox.h" -#ifndef QT_NO_COMBOBOX #include "QtWidgets/qabstractslider.h" #include "QtWidgets/qapplication.h" #include "QtWidgets/qitemdelegate.h" @@ -74,6 +73,8 @@ #include +QT_REQUIRE_CONFIG(combobox); + QT_BEGIN_NAMESPACE class QAction; @@ -423,6 +424,4 @@ public: QT_END_NAMESPACE -#endif // QT_NO_COMBOBOX - #endif // QCOMBOBOX_P_H diff --git a/src/widgets/widgets/qdatetimeedit_p.h b/src/widgets/widgets/qdatetimeedit_p.h index bc70780de9..5ac5a9db6a 100644 --- a/src/widgets/widgets/qdatetimeedit_p.h +++ b/src/widgets/widgets/qdatetimeedit_p.h @@ -52,7 +52,6 @@ // #include -#include "QtWidgets/qcombobox.h" #include "QtWidgets/qcalendarwidget.h" #include "QtWidgets/qspinbox.h" #include "QtWidgets/qtoolbutton.h" diff --git a/src/widgets/widgets/qtoolbar.cpp b/src/widgets/widgets/qtoolbar.cpp index bdb17f10d3..893506f16f 100644 --- a/src/widgets/widgets/qtoolbar.cpp +++ b/src/widgets/widgets/qtoolbar.cpp @@ -42,7 +42,9 @@ #ifndef QT_NO_TOOLBAR #include +#if QT_CONFIG(combobox) #include +#endif #include #include #include diff --git a/src/widgets/widgets/widgets.pri b/src/widgets/widgets/widgets.pri index ee510bd120..7a39f3fb3e 100644 --- a/src/widgets/widgets/widgets.pri +++ b/src/widgets/widgets/widgets.pri @@ -5,8 +5,6 @@ HEADERS += \ widgets/qbuttongroup_p.h \ widgets/qabstractspinbox.h \ widgets/qabstractspinbox_p.h \ - widgets/qcombobox.h \ - widgets/qcombobox_p.h \ widgets/qdial.h \ widgets/qdockwidget.h \ widgets/qdockwidget_p.h \ @@ -66,7 +64,6 @@ HEADERS += \ SOURCES += \ widgets/qbuttongroup.cpp \ widgets/qabstractspinbox.cpp \ - widgets/qcombobox.cpp \ widgets/qdial.cpp \ widgets/qdockwidget.cpp \ widgets/qdockarealayout.cpp \ @@ -140,6 +137,14 @@ qtConfig(checkbox) { widgets/qcheckbox.cpp } +qtConfig(combobox) { + HEADERS += \ + widgets/qcombobox.h \ + widgets/qcombobox_p.h + + SOURCES += widgets/qcombobox.cpp +} + qtConfig(commandlinkbutton) { HEADERS += \ widgets/qcommandlinkbutton.h -- cgit v1.2.3 From 16f375f5490dec4bc69ceb52cd1f26e68011484f Mon Sep 17 00:00:00 2001 From: Stephan Binner Date: Sat, 22 Jul 2017 15:19:13 +0200 Subject: Convert features.itemviews to QT_[REQUIRE_]CONFIG The QT_NO_ITEMVIEWS queries in corelib/ seem to had no effect at all. Change-Id: I494ee2309a96b0cf25de18781fc9a675878a2ee9 Reviewed-by: Oswald Buddenhagen --- src/corelib/itemmodels/qitemselectionmodel.cpp | 4 ---- src/corelib/itemmodels/qitemselectionmodel.h | 4 ---- src/corelib/itemmodels/qitemselectionmodel_p.h | 3 --- src/widgets/accessible/accessible.pri | 7 +++++-- src/widgets/accessible/complexwidgets.cpp | 2 ++ src/widgets/accessible/complexwidgets_p.h | 2 ++ src/widgets/accessible/itemviews.cpp | 3 --- src/widgets/accessible/itemviews_p.h | 5 +---- .../accessible/qaccessiblewidgetfactory.cpp | 6 ++++-- src/widgets/accessible/qaccessiblewidgets.cpp | 2 ++ src/widgets/itemviews/qabstractitemdelegate.cpp | 3 --- src/widgets/itemviews/qabstractitemdelegate.h | 7 ++----- src/widgets/itemviews/qabstractitemdelegate_p.h | 4 +--- src/widgets/itemviews/qabstractitemview.cpp | 3 --- src/widgets/itemviews/qabstractitemview.h | 7 ++----- src/widgets/itemviews/qabstractitemview_p.h | 4 +--- src/widgets/itemviews/qheaderview.cpp | 3 --- src/widgets/itemviews/qheaderview.h | 7 ++----- src/widgets/itemviews/qheaderview_p.h | 6 ++---- src/widgets/itemviews/qitemdelegate.cpp | 3 --- src/widgets/itemviews/qitemdelegate.h | 7 ++----- src/widgets/itemviews/qitemeditorfactory.cpp | 4 ---- src/widgets/itemviews/qitemeditorfactory.h | 7 ++----- src/widgets/itemviews/qitemeditorfactory_p.h | 7 ++----- src/widgets/itemviews/qstyleditemdelegate.cpp | 3 --- src/widgets/itemviews/qstyleditemdelegate.h | 7 ++----- src/widgets/styles/qcommonstyle.cpp | 24 ++++++++++++---------- src/widgets/styles/qcommonstyle_p.h | 6 +++--- src/widgets/styles/qpixmapstyle.cpp | 4 +++- src/widgets/styles/qstyleoption.cpp | 4 ++-- src/widgets/styles/qstyleoption.h | 6 +++--- src/widgets/styles/qstylesheetstyle.cpp | 18 ++++++++-------- src/widgets/styles/qwindowsvistastyle.cpp | 4 ++-- src/widgets/widgets/qabstractbutton.cpp | 4 +++- src/widgets/widgets/qabstractscrollarea.cpp | 2 ++ src/widgets/widgets/qlineedit.cpp | 2 ++ src/widgets/widgets/qlineedit_p.cpp | 2 ++ src/widgets/widgets/qscrollbar.h | 2 +- src/widgets/widgets/qtabbar.cpp | 2 ++ src/widgets/widgets/qwidgetlinecontrol.cpp | 2 ++ 40 files changed, 84 insertions(+), 118 deletions(-) diff --git a/src/corelib/itemmodels/qitemselectionmodel.cpp b/src/corelib/itemmodels/qitemselectionmodel.cpp index 8dcd80808b..59a10e9057 100644 --- a/src/corelib/itemmodels/qitemselectionmodel.cpp +++ b/src/corelib/itemmodels/qitemselectionmodel.cpp @@ -44,8 +44,6 @@ #include #include -#ifndef QT_NO_ITEMVIEWS - QT_BEGIN_NAMESPACE /*! @@ -1917,5 +1915,3 @@ QDebug operator<<(QDebug dbg, const QItemSelectionRange &range) QT_END_NAMESPACE #include "moc_qitemselectionmodel.cpp" - -#endif // QT_NO_ITEMVIEWS diff --git a/src/corelib/itemmodels/qitemselectionmodel.h b/src/corelib/itemmodels/qitemselectionmodel.h index 2421610bce..9d33303ddc 100644 --- a/src/corelib/itemmodels/qitemselectionmodel.h +++ b/src/corelib/itemmodels/qitemselectionmodel.h @@ -42,8 +42,6 @@ #include -#ifndef QT_NO_ITEMVIEWS - #include #include #include @@ -273,6 +271,4 @@ QT_END_NAMESPACE Q_DECLARE_METATYPE(QItemSelectionRange) Q_DECLARE_METATYPE(QItemSelection) -#endif // QT_NO_ITEMVIEWS - #endif // QITEMSELECTIONMODEL_H diff --git a/src/corelib/itemmodels/qitemselectionmodel_p.h b/src/corelib/itemmodels/qitemselectionmodel_p.h index c2d9384b09..dfc0387563 100644 --- a/src/corelib/itemmodels/qitemselectionmodel_p.h +++ b/src/corelib/itemmodels/qitemselectionmodel_p.h @@ -55,7 +55,6 @@ QT_BEGIN_NAMESPACE -#ifndef QT_NO_ITEMVIEWS class QItemSelectionModelPrivate: public QObjectPrivate { Q_DECLARE_PUBLIC(QItemSelectionModel) @@ -106,8 +105,6 @@ public: int tableColCount, tableRowCount; }; -#endif // QT_NO_ITEMVIEWS - QT_END_NAMESPACE #endif // QITEMSELECTIONMODEL_P_H diff --git a/src/widgets/accessible/accessible.pri b/src/widgets/accessible/accessible.pri index e63ae28d30..06467d0ff0 100644 --- a/src/widgets/accessible/accessible.pri +++ b/src/widgets/accessible/accessible.pri @@ -5,7 +5,6 @@ qtConfig(accessibility) { accessible/qaccessiblewidget.h \ accessible/qaccessiblewidgetfactory_p.h \ accessible/complexwidgets_p.h \ - accessible/itemviews_p.h \ accessible/qaccessiblemenu_p.h \ accessible/qaccessiblewidgets_p.h \ accessible/rangecontrols_p.h \ @@ -15,9 +14,13 @@ qtConfig(accessibility) { accessible/qaccessiblewidget.cpp \ accessible/qaccessiblewidgetfactory.cpp \ accessible/complexwidgets.cpp \ - accessible/itemviews.cpp \ accessible/qaccessiblemenu.cpp \ accessible/qaccessiblewidgets.cpp \ accessible/rangecontrols.cpp \ accessible/simplewidgets.cpp + + qtConfig(itemviews) { + HEADERS += accessible/itemviews_p.h + SOURCES += accessible/itemviews.cpp + } } diff --git a/src/widgets/accessible/complexwidgets.cpp b/src/widgets/accessible/complexwidgets.cpp index 29e11556aa..9475b5a96c 100644 --- a/src/widgets/accessible/complexwidgets.cpp +++ b/src/widgets/accessible/complexwidgets.cpp @@ -42,7 +42,9 @@ #include #include #include +#if QT_CONFIG(itemviews) #include +#endif #include #if QT_CONFIG(combobox) #include diff --git a/src/widgets/accessible/complexwidgets_p.h b/src/widgets/accessible/complexwidgets_p.h index b4b4e89a1a..849169ab8a 100644 --- a/src/widgets/accessible/complexwidgets_p.h +++ b/src/widgets/accessible/complexwidgets_p.h @@ -54,7 +54,9 @@ #include #include #include +#if QT_CONFIG(itemviews) #include +#endif QT_BEGIN_NAMESPACE diff --git a/src/widgets/accessible/itemviews.cpp b/src/widgets/accessible/itemviews.cpp index 1ccfcbe4e5..4d37400dc9 100644 --- a/src/widgets/accessible/itemviews.cpp +++ b/src/widgets/accessible/itemviews.cpp @@ -56,7 +56,6 @@ QT_BEGIN_NAMESPACE -#ifndef QT_NO_ITEMVIEWS /* Implementation of the IAccessible2 table2 interface. Much simpler than the other table interfaces since there is only the main table and cells: @@ -1215,8 +1214,6 @@ QHeaderView *QAccessibleTableHeaderCell::headerView() const return header; } -#endif // QT_NO_ITEMVIEWS - QT_END_NAMESPACE #endif // QT_NO_ACCESSIBILITY diff --git a/src/widgets/accessible/itemviews_p.h b/src/widgets/accessible/itemviews_p.h index 9542a569db..72841b8a0f 100644 --- a/src/widgets/accessible/itemviews_p.h +++ b/src/widgets/accessible/itemviews_p.h @@ -58,13 +58,12 @@ #include #include +QT_REQUIRE_CONFIG(itemviews); QT_BEGIN_NAMESPACE #ifndef QT_NO_ACCESSIBILITY -#ifndef QT_NO_ITEMVIEWS - class QAccessibleTableCell; class QAccessibleTableHeaderCell; @@ -299,8 +298,6 @@ private: }; -#endif - #endif // QT_NO_ACCESSIBILITY QT_END_NAMESPACE diff --git a/src/widgets/accessible/qaccessiblewidgetfactory.cpp b/src/widgets/accessible/qaccessiblewidgetfactory.cpp index 371158c73c..8c1e591f0e 100644 --- a/src/widgets/accessible/qaccessiblewidgetfactory.cpp +++ b/src/widgets/accessible/qaccessiblewidgetfactory.cpp @@ -43,7 +43,9 @@ #include "simplewidgets_p.h" #include "rangecontrols_p.h" #include "complexwidgets_p.h" +#if QT_CONFIG(itemviews) #include "itemviews_p.h" +#endif #include #if QT_CONFIG(treeview) @@ -146,11 +148,11 @@ QAccessibleInterface *qAccessibleFactory(const QString &classname, QObject *obje } else if (classname == QLatin1String("QTreeView")) { iface = new QAccessibleTree(widget); #endif // QT_CONFIG(treeview) -#ifndef QT_NO_ITEMVIEWS +#if QT_CONFIG(itemviews) } else if (classname == QLatin1String("QTableView") || classname == QLatin1String("QListView")) { iface = new QAccessibleTable(widget); // ### This should be cleaned up. We return the parent for the scrollarea to hide it. -#endif // QT_NO_ITEMVIEWS +#endif // QT_CONFIG(itemviews) #ifndef QT_NO_TABBAR } else if (classname == QLatin1String("QTabBar")) { iface = new QAccessibleTabBar(widget); diff --git a/src/widgets/accessible/qaccessiblewidgets.cpp b/src/widgets/accessible/qaccessiblewidgets.cpp index eec60ac0c8..676ac67b56 100644 --- a/src/widgets/accessible/qaccessiblewidgets.cpp +++ b/src/widgets/accessible/qaccessiblewidgets.cpp @@ -65,7 +65,9 @@ #if QT_CONFIG(calendarwidget) #include #endif +#if QT_CONFIG(itemviews) #include +#endif #include #include #include diff --git a/src/widgets/itemviews/qabstractitemdelegate.cpp b/src/widgets/itemviews/qabstractitemdelegate.cpp index 5b119cc79e..fd4699409c 100644 --- a/src/widgets/itemviews/qabstractitemdelegate.cpp +++ b/src/widgets/itemviews/qabstractitemdelegate.cpp @@ -39,7 +39,6 @@ #include "qabstractitemdelegate.h" -#ifndef QT_NO_ITEMVIEWS #include #include #include @@ -606,5 +605,3 @@ void QAbstractItemDelegatePrivate::_q_commitDataAndCloseEditor(QWidget *editor) QT_END_NAMESPACE #include "moc_qabstractitemdelegate.cpp" - -#endif // QT_NO_ITEMVIEWS diff --git a/src/widgets/itemviews/qabstractitemdelegate.h b/src/widgets/itemviews/qabstractitemdelegate.h index 9f7a7716af..9b6bde1c87 100644 --- a/src/widgets/itemviews/qabstractitemdelegate.h +++ b/src/widgets/itemviews/qabstractitemdelegate.h @@ -44,10 +44,9 @@ #include #include -QT_BEGIN_NAMESPACE - +QT_REQUIRE_CONFIG(itemviews); -#ifndef QT_NO_ITEMVIEWS +QT_BEGIN_NAMESPACE class QPainter; class QModelIndex; @@ -127,8 +126,6 @@ private: Q_PRIVATE_SLOT(d_func(), void _q_commitDataAndCloseEditor(QWidget*)) }; -#endif // QT_NO_ITEMVIEWS - QT_END_NAMESPACE #endif // QABSTRACTITEMDELEGATE_H diff --git a/src/widgets/itemviews/qabstractitemdelegate_p.h b/src/widgets/itemviews/qabstractitemdelegate_p.h index 0b03be63f0..da76d31e8b 100644 --- a/src/widgets/itemviews/qabstractitemdelegate_p.h +++ b/src/widgets/itemviews/qabstractitemdelegate_p.h @@ -55,7 +55,7 @@ #include "qabstractitemdelegate.h" #include -#ifndef QT_NO_ITEMVIEWS +QT_REQUIRE_CONFIG(itemviews); QT_BEGIN_NAMESPACE @@ -73,6 +73,4 @@ public: QT_END_NAMESPACE -#endif // QT_NO_ITEMVIEWS - #endif // QABSTRACTITEMDELEGATE_P_H diff --git a/src/widgets/itemviews/qabstractitemview.cpp b/src/widgets/itemviews/qabstractitemview.cpp index 396016c44d..f056b7e5e5 100644 --- a/src/widgets/itemviews/qabstractitemview.cpp +++ b/src/widgets/itemviews/qabstractitemview.cpp @@ -39,7 +39,6 @@ #include "qabstractitemview.h" -#ifndef QT_NO_ITEMVIEWS #include #include #include @@ -4490,5 +4489,3 @@ QModelIndexList QAbstractItemViewPrivate::selectedDraggableIndexes() const QT_END_NAMESPACE #include "moc_qabstractitemview.cpp" - -#endif // QT_NO_ITEMVIEWS diff --git a/src/widgets/itemviews/qabstractitemview.h b/src/widgets/itemviews/qabstractitemview.h index f315ea6e4c..6be776ec52 100644 --- a/src/widgets/itemviews/qabstractitemview.h +++ b/src/widgets/itemviews/qabstractitemview.h @@ -49,10 +49,9 @@ class tst_QAbstractItemView; class tst_QTreeView; -QT_BEGIN_NAMESPACE - +QT_REQUIRE_CONFIG(itemviews); -#ifndef QT_NO_ITEMVIEWS +QT_BEGIN_NAMESPACE class QMenu; class QDrag; @@ -381,8 +380,6 @@ private: Q_DECLARE_OPERATORS_FOR_FLAGS(QAbstractItemView::EditTriggers) -#endif // QT_NO_ITEMVIEWS - QT_END_NAMESPACE #endif // QABSTRACTITEMVIEW_H diff --git a/src/widgets/itemviews/qabstractitemview_p.h b/src/widgets/itemviews/qabstractitemview_p.h index 5e3858f491..d8af96af55 100644 --- a/src/widgets/itemviews/qabstractitemview_p.h +++ b/src/widgets/itemviews/qabstractitemview_p.h @@ -64,7 +64,7 @@ #include "QtCore/qbasictimer.h" #include "QtCore/qelapsedtimer.h" -#ifndef QT_NO_ITEMVIEWS +QT_REQUIRE_CONFIG(itemviews); QT_BEGIN_NAMESPACE @@ -477,6 +477,4 @@ inline int qBinarySearch(const QVector &vec, const T &item, int start, int en QT_END_NAMESPACE -#endif // QT_NO_ITEMVIEWS - #endif // QABSTRACTITEMVIEW_P_H diff --git a/src/widgets/itemviews/qheaderview.cpp b/src/widgets/itemviews/qheaderview.cpp index 6a6991ebb8..213cc96b03 100644 --- a/src/widgets/itemviews/qheaderview.cpp +++ b/src/widgets/itemviews/qheaderview.cpp @@ -39,7 +39,6 @@ #include "qheaderview.h" -#ifndef QT_NO_ITEMVIEWS #include #include #include @@ -3949,6 +3948,4 @@ bool QHeaderViewPrivate::read(QDataStream &in) QT_END_NAMESPACE -#endif // QT_NO_ITEMVIEWS - #include "moc_qheaderview.cpp" diff --git a/src/widgets/itemviews/qheaderview.h b/src/widgets/itemviews/qheaderview.h index 4be97c0c7e..ec4500d81e 100644 --- a/src/widgets/itemviews/qheaderview.h +++ b/src/widgets/itemviews/qheaderview.h @@ -43,10 +43,9 @@ #include #include -QT_BEGIN_NAMESPACE - +QT_REQUIRE_CONFIG(itemviews); -#ifndef QT_NO_ITEMVIEWS +QT_BEGIN_NAMESPACE class QHeaderViewPrivate; class QStyleOptionHeader; @@ -265,8 +264,6 @@ inline void QHeaderView::hideSection(int alogicalIndex) inline void QHeaderView::showSection(int alogicalIndex) { setSectionHidden(alogicalIndex, false); } -#endif // QT_NO_ITEMVIEWS - QT_END_NAMESPACE #endif // QHEADERVIEW_H diff --git a/src/widgets/itemviews/qheaderview_p.h b/src/widgets/itemviews/qheaderview_p.h index d6b119512c..8fc8b88aa5 100644 --- a/src/widgets/itemviews/qheaderview_p.h +++ b/src/widgets/itemviews/qheaderview_p.h @@ -54,14 +54,14 @@ #include #include "private/qabstractitemview_p.h" -#ifndef QT_NO_ITEMVIEWS - #include "QtCore/qbitarray.h" #include "QtWidgets/qapplication.h" #if QT_CONFIG(label) #include "QtWidgets/qlabel.h" #endif +QT_REQUIRE_CONFIG(itemviews); + QT_BEGIN_NAMESPACE class QHeaderViewPrivate: public QAbstractItemViewPrivate @@ -391,6 +391,4 @@ Q_DECLARE_TYPEINFO(QHeaderViewPrivate::SectionItem, Q_PRIMITIVE_TYPE); QT_END_NAMESPACE -#endif // QT_NO_ITEMVIEWS - #endif // QHEADERVIEW_P_H diff --git a/src/widgets/itemviews/qitemdelegate.cpp b/src/widgets/itemviews/qitemdelegate.cpp index 6a6220cd0a..68c02e9edb 100644 --- a/src/widgets/itemviews/qitemdelegate.cpp +++ b/src/widgets/itemviews/qitemdelegate.cpp @@ -39,7 +39,6 @@ #include "qitemdelegate.h" -#ifndef QT_NO_ITEMVIEWS #include #include #include @@ -1199,5 +1198,3 @@ QStyleOptionViewItem QItemDelegate::setOptions(const QModelIndex &index, QT_END_NAMESPACE #include "moc_qitemdelegate.cpp" - -#endif // QT_NO_ITEMVIEWS diff --git a/src/widgets/itemviews/qitemdelegate.h b/src/widgets/itemviews/qitemdelegate.h index 3d98419c80..21594327ef 100644 --- a/src/widgets/itemviews/qitemdelegate.h +++ b/src/widgets/itemviews/qitemdelegate.h @@ -46,10 +46,9 @@ #include #include -QT_BEGIN_NAMESPACE - +QT_REQUIRE_CONFIG(itemviews); -#ifndef QT_NO_ITEMVIEWS +QT_BEGIN_NAMESPACE class QItemDelegatePrivate; class QItemEditorFactory; @@ -126,8 +125,6 @@ private: Q_DISABLE_COPY(QItemDelegate) }; -#endif // QT_NO_ITEMVIEWS - QT_END_NAMESPACE #endif // QITEMDELEGATE_H diff --git a/src/widgets/itemviews/qitemeditorfactory.cpp b/src/widgets/itemviews/qitemeditorfactory.cpp index dcfe4065a6..54b7c6666f 100644 --- a/src/widgets/itemviews/qitemeditorfactory.cpp +++ b/src/widgets/itemviews/qitemeditorfactory.cpp @@ -41,8 +41,6 @@ #include "qitemeditorfactory.h" #include "qitemeditorfactory_p.h" -#ifndef QT_NO_ITEMVIEWS - #if QT_CONFIG(combobox) #include #endif @@ -627,5 +625,3 @@ QT_END_NAMESPACE #endif #include "moc_qitemeditorfactory_p.cpp" - -#endif // QT_NO_ITEMVIEWS diff --git a/src/widgets/itemviews/qitemeditorfactory.h b/src/widgets/itemviews/qitemeditorfactory.h index dea9bce794..f2610ad3de 100644 --- a/src/widgets/itemviews/qitemeditorfactory.h +++ b/src/widgets/itemviews/qitemeditorfactory.h @@ -46,10 +46,9 @@ #include #include -QT_BEGIN_NAMESPACE - +QT_REQUIRE_CONFIG(itemviews); -#ifndef QT_NO_ITEMVIEWS +QT_BEGIN_NAMESPACE class QWidget; @@ -111,8 +110,6 @@ private: QHash creatorMap; }; -#endif // QT_NO_ITEMVIEWS - QT_END_NAMESPACE #endif // QITEMEDITORFACTORY_H diff --git a/src/widgets/itemviews/qitemeditorfactory_p.h b/src/widgets/itemviews/qitemeditorfactory_p.h index 91edcf65ba..409ecc684f 100644 --- a/src/widgets/itemviews/qitemeditorfactory_p.h +++ b/src/widgets/itemviews/qitemeditorfactory_p.h @@ -55,12 +55,11 @@ #include #include -#ifndef QT_NO_ITEMVIEWS - #ifndef QT_NO_LINEEDIT -QT_BEGIN_NAMESPACE +QT_REQUIRE_CONFIG(itemviews); +QT_BEGIN_NAMESPACE class QExpandingLineEdit : public QLineEdit { @@ -92,6 +91,4 @@ QT_END_NAMESPACE #endif // QT_NO_LINEEDIT -#endif //QT_NO_ITEMVIEWS - #endif //QITEMEDITORFACTORY_P_H diff --git a/src/widgets/itemviews/qstyleditemdelegate.cpp b/src/widgets/itemviews/qstyleditemdelegate.cpp index 0b8019c21c..bda3325adb 100644 --- a/src/widgets/itemviews/qstyleditemdelegate.cpp +++ b/src/widgets/itemviews/qstyleditemdelegate.cpp @@ -39,7 +39,6 @@ #include "qstyleditemdelegate.h" -#ifndef QT_NO_ITEMVIEWS #include #include #include @@ -643,5 +642,3 @@ bool QStyledItemDelegate::editorEvent(QEvent *event, QT_END_NAMESPACE #include "moc_qstyleditemdelegate.cpp" - -#endif // QT_NO_ITEMVIEWS diff --git a/src/widgets/itemviews/qstyleditemdelegate.h b/src/widgets/itemviews/qstyleditemdelegate.h index d30e6e0e9c..f3b7c4d1f4 100644 --- a/src/widgets/itemviews/qstyleditemdelegate.h +++ b/src/widgets/itemviews/qstyleditemdelegate.h @@ -46,10 +46,9 @@ #include #include -QT_BEGIN_NAMESPACE - +QT_REQUIRE_CONFIG(itemviews); -#ifndef QT_NO_ITEMVIEWS +QT_BEGIN_NAMESPACE class QStyledItemDelegatePrivate; class QItemEditorFactory; @@ -101,8 +100,6 @@ private: Q_DISABLE_COPY(QStyledItemDelegate) }; -#endif // QT_NO_ITEMVIEWS - QT_END_NAMESPACE #endif // QSTYLEDITEMDELEGATE_H diff --git a/src/widgets/styles/qcommonstyle.cpp b/src/widgets/styles/qcommonstyle.cpp index b1b84501c5..7a177fa604 100644 --- a/src/widgets/styles/qcommonstyle.cpp +++ b/src/widgets/styles/qcommonstyle.cpp @@ -41,7 +41,9 @@ #include "qcommonstyle_p.h" #include +#if QT_CONFIG(itemviews) #include +#endif #include #include #include @@ -91,7 +93,7 @@ #include -#ifndef QT_NO_ITEMVIEWS +#if QT_CONFIG(itemviews) # include "private/qtextengine_p.h" #endif @@ -675,7 +677,7 @@ void QCommonStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, Q else p->drawRect(rect); break; } -#ifndef QT_NO_ITEMVIEWS +#if QT_CONFIG(itemviews) case PE_PanelItemViewRow: if (const QStyleOptionViewItem *vopt = qstyleoption_cast(opt)) { QPalette::ColorGroup cg = (widget ? widget->isEnabled() : (vopt->state & QStyle::State_Enabled)) @@ -713,7 +715,7 @@ void QCommonStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, Q } } break; -#endif //QT_NO_ITEMVIEWS +#endif // QT_CONFIG(itemviews) case PE_PanelScrollAreaCorner: { const QBrush brush(opt->palette.brush(QPalette::Window)); p->fillRect(opt->rect, brush); @@ -824,7 +826,7 @@ static void drawArrow(const QStyle *style, const QStyleOptionToolButton *toolbut } #endif // QT_NO_TOOLBUTTON -#ifndef QT_NO_ITEMVIEWS +#if QT_CONFIG(itemviews) static QSizeF viewItemTextLayout(QTextLayout &textLayout, int lineWidth) { @@ -1095,7 +1097,7 @@ void QCommonStylePrivate::viewItemLayout(const QStyleOptionViewItem *opt, QRect *textRect = display; } } -#endif // QT_NO_ITEMVIEWS +#endif // QT_CONFIG(itemviews) #ifndef QT_NO_TABBAR @@ -2168,7 +2170,7 @@ void QCommonStyle::drawControl(ControlElement element, const QStyleOption *opt, } break; -#ifndef QT_NO_ITEMVIEWS +#if QT_CONFIG(itemviews) case CE_ItemViewItem: if (const QStyleOptionViewItem *vopt = qstyleoption_cast(opt)) { p->save(); @@ -2248,7 +2250,7 @@ void QCommonStyle::drawControl(ControlElement element, const QStyleOption *opt, } break; -#endif // QT_NO_ITEMVIEWS +#endif // QT_CONFIG(itemviews) #ifndef QT_NO_FRAME case CE_ShapedFrame: if (const QStyleOptionFrame *f = qstyleoption_cast(opt)) { @@ -3020,7 +3022,7 @@ QRect QCommonStyle::subElementRect(SubElement sr, const QStyleOption *opt, break; } #endif -#ifndef QT_NO_ITEMVIEWS +#if QT_CONFIG(itemviews) case SE_ItemViewItemCheckIndicator: if (!qstyleoption_cast(opt)) { r = subElementRect(SE_CheckBoxIndicator, opt, widget); @@ -3047,7 +3049,7 @@ QRect QCommonStyle::subElementRect(SubElement sr, const QStyleOption *opt, r = d->displayRect; } break; -#endif //QT_NO_ITEMVIEWS +#endif // QT_CONFIG(itemviews) #ifndef QT_NO_TOOLBAR case SE_ToolBarHandle: if (const QStyleOptionToolBar *tbopt = qstyleoption_cast(opt)) { @@ -4897,7 +4899,7 @@ QSize QCommonStyle::sizeFromContents(ContentsType ct, const QStyleOption *opt, sz = QSize(1 + 3 * (buttonSize + 1), buttonSize); } break; -#ifndef QT_NO_ITEMVIEWS +#if QT_CONFIG(itemviews) case CT_ItemViewItem: if (const QStyleOptionViewItem *vopt = qstyleoption_cast(opt)) { QRect decorationRect, displayRect, checkRect; @@ -4909,7 +4911,7 @@ QSize QCommonStyle::sizeFromContents(ContentsType ct, const QStyleOption *opt, break; #else Q_UNUSED(d); -#endif // QT_NO_ITEMVIEWS +#endif // QT_CONFIG(itemviews) #ifndef QT_NO_SPINBOX case CT_SpinBox: if (const QStyleOptionSpinBox *vopt = qstyleoption_cast(opt)) { diff --git a/src/widgets/styles/qcommonstyle_p.h b/src/widgets/styles/qcommonstyle_p.h index 2ef7f30d21..7c69109ff7 100644 --- a/src/widgets/styles/qcommonstyle_p.h +++ b/src/widgets/styles/qcommonstyle_p.h @@ -68,7 +68,7 @@ class QCommonStylePrivate : public QStylePrivate Q_DECLARE_PUBLIC(QCommonStyle) public: inline QCommonStylePrivate() : -#ifndef QT_NO_ITEMVIEWS +#if QT_CONFIG(itemviews) cachedOption(0), #endif animationFps(30) @@ -79,12 +79,12 @@ public: #ifndef QT_NO_ANIMATION qDeleteAll(animations); #endif -#ifndef QT_NO_ITEMVIEWS +#if QT_CONFIG(itemviews) delete cachedOption; #endif } -#ifndef QT_NO_ITEMVIEWS +#if QT_CONFIG(itemviews) void viewItemDrawText(QPainter *p, const QStyleOptionViewItem *option, const QRect &rect) const; void viewItemLayout(const QStyleOptionViewItem *opt, QRect *checkRect, QRect *pixmapRect, QRect *textRect, bool sizehint) const; diff --git a/src/widgets/styles/qpixmapstyle.cpp b/src/widgets/styles/qpixmapstyle.cpp index 795fe34975..63308a5e36 100644 --- a/src/widgets/styles/qpixmapstyle.cpp +++ b/src/widgets/styles/qpixmapstyle.cpp @@ -55,11 +55,13 @@ #if QT_CONFIG(combobox) #include #endif +#if QT_CONFIG(itemviews) #include +#include +#endif #if QT_CONFIG(listview) #include #endif -#include #include #include diff --git a/src/widgets/styles/qstyleoption.cpp b/src/widgets/styles/qstyleoption.cpp index 452f112117..80585a4825 100644 --- a/src/widgets/styles/qstyleoption.cpp +++ b/src/widgets/styles/qstyleoption.cpp @@ -3000,7 +3000,7 @@ QStyleOptionTitleBar::QStyleOptionTitleBar(int version) \sa Qt::WindowFlags */ -#ifndef QT_NO_ITEMVIEWS +#if QT_CONFIG(itemviews) /*! \class QStyleOptionViewItem \brief The QStyleOptionViewItem class is used to describe the @@ -3267,7 +3267,7 @@ QStyleOptionViewItem::QStyleOptionViewItem(int version) therefore both at the beginning and the end. */ -#endif // QT_NO_ITEMVIEWS +#endif // QT_CONFIG(itemviews) /*! \fn T qstyleoption_cast(const QStyleOption *option) \relates QStyleOption diff --git a/src/widgets/styles/qstyleoption.h b/src/widgets/styles/qstyleoption.h index a3ed35c762..c57c3eefef 100644 --- a/src/widgets/styles/qstyleoption.h +++ b/src/widgets/styles/qstyleoption.h @@ -53,7 +53,7 @@ #include #endif #include -#ifndef QT_NO_ITEMVIEWS +#if QT_CONFIG(itemviews) # include #endif @@ -388,7 +388,7 @@ protected: typedef Q_DECL_DEPRECATED QStyleOptionDockWidget QStyleOptionDockWidgetV2; -#ifndef QT_NO_ITEMVIEWS +#if QT_CONFIG(itemviews) class Q_WIDGETS_EXPORT QStyleOptionViewItem : public QStyleOption { @@ -443,7 +443,7 @@ typedef Q_DECL_DEPRECATED QStyleOptionViewItem QStyleOptionViewItemV2; typedef Q_DECL_DEPRECATED QStyleOptionViewItem QStyleOptionViewItemV3; typedef Q_DECL_DEPRECATED QStyleOptionViewItem QStyleOptionViewItemV4; -#endif // QT_NO_ITEMVIEWS +#endif // QT_CONFIG(itemviews) class Q_WIDGETS_EXPORT QStyleOptionToolBox : public QStyleOption { diff --git a/src/widgets/styles/qstylesheetstyle.cpp b/src/widgets/styles/qstylesheetstyle.cpp index e23a1f60b5..4e4907b1d4 100644 --- a/src/widgets/styles/qstylesheetstyle.cpp +++ b/src/widgets/styles/qstylesheetstyle.cpp @@ -71,7 +71,9 @@ #include #endif #include +#if QT_CONFIG(itemviews) #include +#endif #include #include #include @@ -2008,7 +2010,7 @@ QRenderRule QStyleSheetStyle::renderRule(const QObject *obj, const QStyleOption extraClass |= PseudoClass_Movable; } #endif // QT_NO_DOCKWIDGET -#ifndef QT_NO_ITEMVIEWS +#if QT_CONFIG(itemviews) else if (const QStyleOptionViewItem *vopt = qstyleoption_cast(opt)) { if (vopt->features & QStyleOptionViewItem::Alternate) extraClass |= PseudoClass_Alternate; @@ -2805,7 +2807,7 @@ void QStyleSheetStyle::polish(QWidget *w) QRenderRule rule = renderRule(w, PseudoElement_None, PseudoClass_Any); if (rule.hasDrawable() || rule.hasBox()) { if (w->metaObject() == &QWidget::staticMetaObject -#ifndef QT_NO_ITEMVIEWS +#if QT_CONFIG(itemviews) || qobject_cast(w) #endif #ifndef QT_NO_TABBAR @@ -4069,7 +4071,7 @@ void QStyleSheetStyle::drawControl(ControlElement ce, const QStyleOption *opt, Q fallback = true; break; -#ifndef QT_NO_ITEMVIEWS +#if QT_CONFIG(itemviews) case CE_ItemViewItem: if (const QStyleOptionViewItem *vopt = qstyleoption_cast(opt)) { QRenderRule subRule = renderRule(w, opt, PseudoElement_ViewItem); @@ -4086,7 +4088,7 @@ void QStyleSheetStyle::drawControl(ControlElement ce, const QStyleOption *opt, Q return; } break; -#endif // QT_NO_ITEMVIEWS +#endif // QT_CONFIG(itemviews) #ifndef QT_NO_TABBAR case CE_TabBarTab: @@ -5107,7 +5109,7 @@ QSize QStyleSheetStyle::sizeFromContents(ContentsType ct, const QStyleOption *op } break; -#ifndef QT_NO_ITEMVIEWS +#if QT_CONFIG(itemviews) case CT_ItemViewItem: { QRenderRule subRule = renderRule(w, opt, PseudoElement_ViewItem); sz = baseStyle()->sizeFromContents(ct, opt, csz, w); @@ -5116,7 +5118,7 @@ QSize QStyleSheetStyle::sizeFromContents(ContentsType ct, const QStyleOption *op sz = subRule.boxSize(sz); return sz; } -#endif // QT_NO_ITEMVIEWS +#endif // QT_CONFIG(itemviews) default: break; @@ -5756,7 +5758,7 @@ QRect QStyleSheetStyle::subElementRect(SubElement se, const QStyleOption *opt, c case SE_CheckBoxClickRect: // relies on indicator and contents return ParentStyle::subElementRect(se, opt, w); -#ifndef QT_NO_ITEMVIEWS +#if QT_CONFIG(itemviews) case SE_ViewItemCheckIndicator: if (!qstyleoption_cast(opt)) { return subElementRect(SE_CheckBoxIndicator, opt, w); @@ -5785,7 +5787,7 @@ QRect QStyleSheetStyle::subElementRect(SubElement se, const QStyleOption *opt, c } } break; -#endif // QT_NO_ITEMVIEWS +#endif // QT_CONFIG(itemviews) case SE_HeaderArrow: { QRenderRule subRule = renderRule(w, opt, PseudoElement_HeaderViewUpArrow); diff --git a/src/widgets/styles/qwindowsvistastyle.cpp b/src/widgets/styles/qwindowsvistastyle.cpp index e400820256..8ab4a61f5f 100644 --- a/src/widgets/styles/qwindowsvistastyle.cpp +++ b/src/widgets/styles/qwindowsvistastyle.cpp @@ -1438,7 +1438,7 @@ void QWindowsVistaStyle::drawControl(ControlElement element, const QStyleOption } } break; -#ifndef QT_NO_ITEMVIEWS +#if QT_CONFIG(itemviews) case CE_ItemViewItem: { const QStyleOptionViewItem *vopt; @@ -1473,7 +1473,7 @@ void QWindowsVistaStyle::drawControl(ControlElement element, const QStyleOption } break; } -#endif // QT_NO_ITEMVIEWS +#endif // QT_CONFIG(itemviews) #if QT_CONFIG(combobox) case CE_ComboBoxLabel: QCommonStyle::drawControl(element, option, painter, widget); diff --git a/src/widgets/widgets/qabstractbutton.cpp b/src/widgets/widgets/qabstractbutton.cpp index e65613d5cd..1d78d24a88 100644 --- a/src/widgets/widgets/qabstractbutton.cpp +++ b/src/widgets/widgets/qabstractbutton.cpp @@ -40,7 +40,9 @@ #include "private/qabstractbutton_p.h" #include "private/qbuttongroup_p.h" +#if QT_CONFIG(itemviews) #include "qabstractitemview.h" +#endif #include "qbuttongroup.h" #include "qabstractbutton_p.h" #include "qevent.h" @@ -1071,7 +1073,7 @@ void QAbstractButton::keyPressEvent(QKeyEvent *e) #ifndef QT_NO_BUTTONGROUP || d->group #endif -#ifndef QT_NO_ITEMVIEWS +#if QT_CONFIG(itemviews) || (pw && qobject_cast(pw->parentWidget())) #endif ) { diff --git a/src/widgets/widgets/qabstractscrollarea.cpp b/src/widgets/widgets/qabstractscrollarea.cpp index 673983d575..14498c8b90 100644 --- a/src/widgets/widgets/qabstractscrollarea.cpp +++ b/src/widgets/widgets/qabstractscrollarea.cpp @@ -50,7 +50,9 @@ #include "qboxlayout.h" #include "qpainter.h" #include "qmargins.h" +#if QT_CONFIG(itemviews) #include "qheaderview.h" +#endif #include diff --git a/src/widgets/widgets/qlineedit.cpp b/src/widgets/widgets/qlineedit.cpp index b9b50c307b..50eb1a7371 100644 --- a/src/widgets/widgets/qlineedit.cpp +++ b/src/widgets/widgets/qlineedit.cpp @@ -68,7 +68,9 @@ #ifndef QT_NO_ACCESSIBILITY #include "qaccessible.h" #endif +#if QT_CONFIG(itemviews) #include "qabstractitemview.h" +#endif #include "private/qstylesheetstyle_p.h" #ifndef QT_NO_SHORTCUT diff --git a/src/widgets/widgets/qlineedit_p.cpp b/src/widgets/widgets/qlineedit_p.cpp index e1c7a4e280..83dab9e110 100644 --- a/src/widgets/widgets/qlineedit_p.cpp +++ b/src/widgets/widgets/qlineedit_p.cpp @@ -43,7 +43,9 @@ #ifndef QT_NO_LINEEDIT #include "qvariant.h" +#if QT_CONFIG(itemviews) #include "qabstractitemview.h" +#endif #include "qdrag.h" #include "qwidgetaction.h" #include "qclipboard.h" diff --git a/src/widgets/widgets/qscrollbar.h b/src/widgets/widgets/qscrollbar.h index 963ae4263b..c180a62585 100644 --- a/src/widgets/widgets/qscrollbar.h +++ b/src/widgets/widgets/qscrollbar.h @@ -85,7 +85,7 @@ private: Q_DISABLE_COPY(QScrollBar) Q_DECLARE_PRIVATE(QScrollBar) -#ifndef QT_NO_ITEMVIEWS +#if QT_CONFIG(itemviews) friend class QTableView; friend class QTreeViewPrivate; friend class QCommonListViewBase; diff --git a/src/widgets/widgets/qtabbar.cpp b/src/widgets/widgets/qtabbar.cpp index 9e803f4388..5ec60b0425 100644 --- a/src/widgets/widgets/qtabbar.cpp +++ b/src/widgets/widgets/qtabbar.cpp @@ -38,7 +38,9 @@ ****************************************************************************/ #include "private/qlayoutengine_p.h" +#if QT_CONFIG(itemviews) #include "qabstractitemdelegate.h" +#endif #include "qapplication.h" #include "qbitmap.h" #include "qcursor.h" diff --git a/src/widgets/widgets/qwidgetlinecontrol.cpp b/src/widgets/widgets/qwidgetlinecontrol.cpp index 976cd173c5..9555ccc5b6 100644 --- a/src/widgets/widgets/qwidgetlinecontrol.cpp +++ b/src/widgets/widgets/qwidgetlinecontrol.cpp @@ -41,7 +41,9 @@ #ifndef QT_NO_LINEEDIT +#if QT_CONFIG(itemviews) #include "qabstractitemview.h" +#endif #include "qclipboard.h" #include #include -- cgit v1.2.3 From 4d70a501dbbb9fd94818e30d9cd87a2482deb7e2 Mon Sep 17 00:00:00 2001 From: Stephan Binner Date: Sun, 23 Jul 2017 11:34:00 +0200 Subject: Convert features.tabwidget to QT_[REQUIRE_]CONFIG Change-Id: Iab985564fd2069188df01f8ff3e00add86eb86f4 Reviewed-by: Oswald Buddenhagen --- src/widgets/kernel/qwidget.cpp | 2 ++ src/widgets/styles/qcommonstyle.cpp | 8 +++++--- src/widgets/styles/qmacstyle_mac.mm | 10 +++++----- src/widgets/styles/qstyleoption.cpp | 4 ++-- src/widgets/styles/qstyleoption.h | 6 ++++-- src/widgets/styles/qstylesheetstyle.cpp | 14 +++++++------- src/widgets/widgets/qmainwindow.cpp | 4 ++-- src/widgets/widgets/qmainwindow.h | 10 ++++++---- src/widgets/widgets/qmainwindowlayout.cpp | 12 ++++++------ src/widgets/widgets/qmainwindowlayout_p.h | 4 ++-- src/widgets/widgets/qmdiarea.cpp | 20 ++++++++++---------- src/widgets/widgets/qmdiarea.h | 6 ++++-- src/widgets/widgets/qmdiarea_p.h | 2 +- src/widgets/widgets/qtabbar.cpp | 4 +++- src/widgets/widgets/qtabwidget.cpp | 3 --- src/widgets/widgets/qtabwidget.h | 7 ++----- src/widgets/widgets/widgets.pri | 7 +++++-- 17 files changed, 66 insertions(+), 57 deletions(-) diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index 79b4d67fdc..88f332d34b 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -108,7 +108,9 @@ #include "private/qgesturemanager_p.h" #ifdef QT_KEYPAD_NAVIGATION +#if QT_CONFIG(tabwidget) #include "qtabwidget.h" // Needed in inTabWidget() +#endif #endif // QT_KEYPAD_NAVIGATION #include "qwindowcontainer_p.h" diff --git a/src/widgets/styles/qcommonstyle.cpp b/src/widgets/styles/qcommonstyle.cpp index 7a177fa604..e7b6f6bf35 100644 --- a/src/widgets/styles/qcommonstyle.cpp +++ b/src/widgets/styles/qcommonstyle.cpp @@ -68,7 +68,9 @@ #include #include #include +#if QT_CONFIG(tabwidget) #include +#endif #include #include #if QT_CONFIG(rubberband) @@ -2566,7 +2568,7 @@ QRect QCommonStyle::subElementRect(SubElement sr, const QStyleOption *opt, r = subElementRect(SE_CheckBoxFocusRect, opt, widget); r |= subElementRect(SE_CheckBoxIndicator, opt, widget); break; -#ifndef QT_NO_TABWIDGET +#if QT_CONFIG(tabwidget) case SE_TabWidgetTabBar: if (const QStyleOptionTabWidgetFrame *twf = qstyleoption_cast(opt)) { @@ -2808,7 +2810,7 @@ QRect QCommonStyle::subElementRect(SubElement sr, const QStyleOption *opt, } break; -#endif // QT_NO_TABWIDGET +#endif // QT_CONFIG(tabwidget) #ifndef QT_NO_TABBAR case SE_TabBarTearIndicator: if (const QStyleOptionTab *tab = qstyleoption_cast(opt)) { @@ -5179,7 +5181,7 @@ int QCommonStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget case SH_FocusFrame_AboveWidget: ret = false; break; -#ifndef QT_NO_TABWIDGET +#if QT_CONFIG(tabwidget) case SH_TabWidget_DefaultTabPosition: ret = QTabWidget::North; break; diff --git a/src/widgets/styles/qmacstyle_mac.mm b/src/widgets/styles/qmacstyle_mac.mm index dbba51b00d..b9d3542d57 100644 --- a/src/widgets/styles/qmacstyle_mac.mm +++ b/src/widgets/styles/qmacstyle_mac.mm @@ -2893,7 +2893,7 @@ int QMacStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget *w ret = Qt::AlignRight; break; case SH_TabBar_Alignment: { -#ifndef QT_NO_TABWIDGET +#if QT_CONFIG(tabwidget) if (const QTabWidget *tab = qobject_cast(w)) { if (tab->documentMode()) { ret = Qt::AlignLeft; @@ -3560,7 +3560,7 @@ void QMacStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPai } break; -#ifndef QT_NO_TABWIDGET +#if QT_CONFIG(tabwidget) case PE_FrameTabWidget: if (const QStyleOptionTabWidgetFrame *twf = qstyleoption_cast(opt)) { @@ -4934,7 +4934,7 @@ QRect QMacStyle::subElementRect(SubElement sr, const QStyleOption *opt, int(outRect.size.height)); break; } -#ifndef QT_NO_TABWIDGET +#if QT_CONFIG(tabwidget) case SE_TabWidgetLeftCorner: if (const QStyleOptionTabWidgetFrame *twf = qstyleoption_cast(opt)) { @@ -5211,7 +5211,7 @@ QRect QMacStyle::subElementRect(SubElement sr, const QStyleOption *opt, } rect.setBottom(rect.bottom() - 1); break; -#ifndef QT_NO_TABWIDGET +#if QT_CONFIG(tabwidget) case SE_TabWidgetLayoutItem: if (const QStyleOptionTabWidgetFrame *tabWidgetOpt = qstyleoption_cast(opt)) { @@ -6645,7 +6645,7 @@ QSize QMacStyle::sizeFromContents(ContentsType ct, const QStyleOption *opt, * overlap is how much the pane should overlap the tab bar */ // then add the size between the stackwidget and the "contentsRect" -#ifndef QT_NO_TABWIDGET +#if QT_CONFIG(tabwidget) if (const QStyleOptionTabWidgetFrame *twf = qstyleoption_cast(opt)) { QSize extra(0,0); diff --git a/src/widgets/styles/qstyleoption.cpp b/src/widgets/styles/qstyleoption.cpp index 80585a4825..ae28dc9374 100644 --- a/src/widgets/styles/qstyleoption.cpp +++ b/src/widgets/styles/qstyleoption.cpp @@ -3290,7 +3290,7 @@ QStyleOptionViewItem::QStyleOptionViewItem(int version) Returns a T or 0 depending on the type of the given \a option. */ -#ifndef QT_NO_TABWIDGET +#if QT_CONFIG(tabwidget) /*! \class QStyleOptionTabWidgetFrame \brief The QStyleOptionTabWidgetFrame class is used to describe the @@ -3434,7 +3434,7 @@ QStyleOptionTabWidgetFrame::QStyleOptionTabWidgetFrame(int version) and the height set to 0. */ -#endif // QT_NO_TABWIDGET +#endif // QT_CONFIG(tabwidget) #ifndef QT_NO_TABBAR diff --git a/src/widgets/styles/qstyleoption.h b/src/widgets/styles/qstyleoption.h index c57c3eefef..a951596776 100644 --- a/src/widgets/styles/qstyleoption.h +++ b/src/widgets/styles/qstyleoption.h @@ -48,7 +48,9 @@ #include #include #include +#if QT_CONFIG(tabwidget) #include +#endif #if QT_CONFIG(rubberband) #include #endif @@ -143,7 +145,7 @@ Q_DECLARE_OPERATORS_FOR_FLAGS(QStyleOptionFrame::FrameFeatures) typedef Q_DECL_DEPRECATED QStyleOptionFrame QStyleOptionFrameV2; typedef Q_DECL_DEPRECATED QStyleOptionFrame QStyleOptionFrameV3; -#ifndef QT_NO_TABWIDGET +#if QT_CONFIG(tabwidget) class Q_WIDGETS_EXPORT QStyleOptionTabWidgetFrame : public QStyleOption { public: @@ -168,7 +170,7 @@ protected: }; typedef Q_DECL_DEPRECATED QStyleOptionTabWidgetFrame QStyleOptionTabWidgetFrameV2; -#endif // QT_NO_TABWIDGET +#endif // QT_CONFIG(tabwidget) #ifndef QT_NO_TABBAR diff --git a/src/widgets/styles/qstylesheetstyle.cpp b/src/widgets/styles/qstylesheetstyle.cpp index 4e4907b1d4..2b89baaf27 100644 --- a/src/widgets/styles/qstylesheetstyle.cpp +++ b/src/widgets/styles/qstylesheetstyle.cpp @@ -1887,7 +1887,7 @@ QRenderRule QStyleSheetStyle::renderRule(const QObject *obj, const QStyleOption extraClass |= PseudoClass_NextSelected; else if (hdr->selectedPosition == QStyleOptionHeader::PreviousIsSelected) extraClass |= PseudoClass_PreviousSelected; -#ifndef QT_NO_TABWIDGET +#if QT_CONFIG(tabwidget) } else if (const QStyleOptionTabWidgetFrame *tab = qstyleoption_cast(opt)) { switch (tab->shape) { case QTabBar::RoundedNorth: @@ -4479,7 +4479,7 @@ void QStyleSheetStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *op rule.drawBorder(p, opt->rect); return; -#ifndef QT_NO_TABWIDGET +#if QT_CONFIG(tabwidget) case PE_FrameTabWidget: if (const QStyleOptionTabWidgetFrame *frm = qstyleoption_cast(opt)) { QRenderRule subRule = renderRule(w, opt, PseudoElement_TabWidgetPane); @@ -4494,7 +4494,7 @@ void QStyleSheetStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *op return; } break; -#endif // QT_NO_TABWIDGET +#endif // QT_CONFIG(tabwidget) case PE_IndicatorProgressChunk: pseudoElement = PseudoElement_ProgressBarChunk; @@ -4792,7 +4792,7 @@ int QStyleSheetStyle::pixelMetric(PixelMetric m, const QStyleOption *opt, const } break; -#ifndef QT_NO_TABWIDGET +#if QT_CONFIG(tabwidget) case PM_TabBarTabHSpace: case PM_TabBarTabVSpace: subRule = renderRule(w, opt, PseudoElement_TabBarTab); @@ -4825,7 +4825,7 @@ int QStyleSheetStyle::pixelMetric(PixelMetric m, const QStyleOption *opt, const } break; } -#endif // QT_NO_TABWIDGET +#endif // QT_CONFIG(tabwidget) case PM_SliderThickness: // horizontal slider's height (sizeHint) case PM_SliderLength: // minimum length of slider @@ -5277,13 +5277,13 @@ int QStyleSheetStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWi case SH_ScrollBar_RollBetweenButtons: s = QLatin1String("scrollbar-roll-between-buttons"); break; case SH_ScrollBar_ScrollWhenPointerLeavesControl: s = QLatin1String("scrollbar-scroll-when-pointer-leaves-control"); break; case SH_TabBar_Alignment: -#ifndef QT_NO_TABWIDGET +#if QT_CONFIG(tabwidget) if (qobject_cast(w)) { rule = renderRule(w, opt, PseudoElement_TabWidgetTabBar); if (rule.hasPosition()) return rule.position()->position; } -#endif // QT_NO_TABWIDGET +#endif // QT_CONFIG(tabwidget) s = QLatin1String("alignment"); break; #ifndef QT_NO_TABBAR diff --git a/src/widgets/widgets/qmainwindow.cpp b/src/widgets/widgets/qmainwindow.cpp index 2cc7ce35da..1e7abe0f55 100644 --- a/src/widgets/widgets/qmainwindow.cpp +++ b/src/widgets/widgets/qmainwindow.cpp @@ -1038,7 +1038,7 @@ void QMainWindow::setDocumentMode(bool enabled) } #endif // QT_NO_TABBAR -#ifndef QT_NO_TABWIDGET +#if QT_CONFIG(tabwidget) /*! \property QMainWindow::tabShape \brief the tab shape used for tabbed dock widgets. @@ -1090,7 +1090,7 @@ void QMainWindow::setTabPosition(Qt::DockWidgetAreas areas, QTabWidget::TabPosit { d_func()->layout->setTabPosition(areas, tabPosition); } -#endif // QT_NO_TABWIDGET +#endif // QT_CONFIG(tabwidget) /*! Adds the given \a dockwidget to the specified \a area. diff --git a/src/widgets/widgets/qmainwindow.h b/src/widgets/widgets/qmainwindow.h index bab1176d8a..b0ea0ba47e 100644 --- a/src/widgets/widgets/qmainwindow.h +++ b/src/widgets/widgets/qmainwindow.h @@ -42,7 +42,9 @@ #include #include +#if QT_CONFIG(tabwidget) #include +#endif QT_BEGIN_NAMESPACE @@ -67,9 +69,9 @@ class Q_WIDGETS_EXPORT QMainWindow : public QWidget #ifndef QT_NO_TABBAR Q_PROPERTY(bool documentMode READ documentMode WRITE setDocumentMode) #endif // QT_NO_TABBAR -#ifndef QT_NO_TABWIDGET +#if QT_CONFIG(tabwidget) Q_PROPERTY(QTabWidget::TabShape tabShape READ tabShape WRITE setTabShape) -#endif // QT_NO_TABWIDGET +#endif // QT_CONFIG(tabwidget) Q_PROPERTY(bool dockNestingEnabled READ isDockNestingEnabled WRITE setDockNestingEnabled) #endif // QT_NO_DOCKWIDGET Q_PROPERTY(DockOptions dockOptions READ dockOptions WRITE setDockOptions) @@ -109,12 +111,12 @@ public: void setDocumentMode(bool enabled); #endif -#ifndef QT_NO_TABWIDGET +#if QT_CONFIG(tabwidget) QTabWidget::TabShape tabShape() const; void setTabShape(QTabWidget::TabShape tabShape); QTabWidget::TabPosition tabPosition(Qt::DockWidgetArea area) const; void setTabPosition(Qt::DockWidgetAreas areas, QTabWidget::TabPosition tabPosition); -#endif // QT_NO_TABWIDGET +#endif // QT_CONFIG(tabwidget) void setDockOptions(DockOptions options); DockOptions dockOptions() const; diff --git a/src/widgets/widgets/qmainwindowlayout.cpp b/src/widgets/widgets/qmainwindowlayout.cpp index 1393294f0a..d2f043c407 100644 --- a/src/widgets/widgets/qmainwindowlayout.cpp +++ b/src/widgets/widgets/qmainwindowlayout.cpp @@ -1477,7 +1477,7 @@ void QMainWindowLayout::setVerticalTabsEnabled(bool enabled) #endif // QT_NO_TABBAR } -#ifndef QT_NO_TABWIDGET +#if QT_CONFIG(tabwidget) QTabWidget::TabShape QMainWindowLayout::tabShape() const { return _tabShape; @@ -1533,12 +1533,12 @@ static inline QTabBar::Shape tabBarShapeFrom(QTabWidget::TabShape shape, QTabWid return rounded ? QTabBar::RoundedWest : QTabBar::TriangularWest; return QTabBar::RoundedNorth; } -#endif // QT_NO_TABWIDGET +#endif // QT_CONFIG(tabwidget) #ifndef QT_NO_TABBAR void QMainWindowLayout::updateTabBarShapes() { -#ifndef QT_NO_TABWIDGET +#if QT_CONFIG(tabwidget) const QTabWidget::TabPosition vertical[] = { QTabWidget::West, QTabWidget::East, @@ -1557,7 +1557,7 @@ void QMainWindowLayout::updateTabBarShapes() QDockAreaLayout &layout = layoutState.dockAreaLayout; for (int i = 0; i < QInternal::DockCount; ++i) { -#ifndef QT_NO_TABWIDGET +#if QT_CONFIG(tabwidget) QTabWidget::TabPosition pos = verticalTabsEnabled ? vertical[i] : tabPositions[i]; QTabBar::Shape shape = tabBarShapeFrom(_tabShape, pos); #else @@ -2267,7 +2267,7 @@ QMainWindowLayout::QMainWindowLayout(QMainWindow *mainwindow, QLayout *parentLay #ifndef QT_NO_TABBAR , _documentMode(false) , verticalTabsEnabled(false) -#ifndef QT_NO_TABWIDGET +#if QT_CONFIG(tabwidget) , _tabShape(QTabWidget::Rounded) #endif #endif @@ -2286,7 +2286,7 @@ QMainWindowLayout::QMainWindowLayout(QMainWindow *mainwindow, QLayout *parentLay sep = mainwindow->style()->pixelMetric(QStyle::PM_DockWidgetSeparatorExtent, 0, mainwindow); #endif -#ifndef QT_NO_TABWIDGET +#if QT_CONFIG(tabwidget) for (int i = 0; i < QInternal::DockCount; ++i) tabPositions[i] = QTabWidget::South; #endif diff --git a/src/widgets/widgets/qmainwindowlayout_p.h b/src/widgets/widgets/qmainwindowlayout_p.h index 5544730c30..b0eae3762f 100644 --- a/src/widgets/widgets/qmainwindowlayout_p.h +++ b/src/widgets/widgets/qmainwindowlayout_p.h @@ -248,7 +248,7 @@ public: QList unusedSeparatorWidgets; int sep; // separator extent -#ifndef QT_NO_TABWIDGET +#if QT_CONFIG(tabwidget) QTabWidget::TabPosition tabPositions[4]; QTabWidget::TabShape _tabShape; @@ -258,7 +258,7 @@ public: void setTabPosition(Qt::DockWidgetAreas areas, QTabWidget::TabPosition tabPosition); QDockWidgetGroupWindow *createTabbedDockWindow(); -#endif // QT_NO_TABWIDGET +#endif // QT_CONFIG(tabwidget) #endif // QT_NO_TABBAR // separators diff --git a/src/widgets/widgets/qmdiarea.cpp b/src/widgets/widgets/qmdiarea.cpp index e25b454409..2e0ecd4831 100644 --- a/src/widgets/widgets/qmdiarea.cpp +++ b/src/widgets/widgets/qmdiarea.cpp @@ -257,7 +257,7 @@ static inline QMdiArea *mdiAreaParent(QWidget *widget) return 0; } -#ifndef QT_NO_TABWIDGET +#if QT_CONFIG(tabwidget) static inline QTabBar::Shape tabBarShapeFrom(QTabWidget::TabShape shape, QTabWidget::TabPosition position) { const bool rounded = (shape == QTabWidget::Rounded); @@ -271,7 +271,7 @@ static inline QTabBar::Shape tabBarShapeFrom(QTabWidget::TabShape shape, QTabWid return rounded ? QTabBar::RoundedWest : QTabBar::TriangularWest; return QTabBar::RoundedNorth; } -#endif // QT_NO_TABWIDGET +#endif // QT_CONFIG(tabwidget) static inline QString tabTextFor(QMdiSubWindow *subWindow) { @@ -685,7 +685,7 @@ QMdiAreaPrivate::QMdiAreaPrivate() tabsClosable(false), tabsMovable(false), #endif -#ifndef QT_NO_TABWIDGET +#if QT_CONFIG(tabwidget) tabShape(QTabWidget::Rounded), tabPosition(QTabWidget::North), #endif @@ -1570,7 +1570,7 @@ void QMdiAreaPrivate::setViewMode(QMdiArea::ViewMode mode) tabBar->setDocumentMode(documentMode); tabBar->setTabsClosable(tabsClosable); tabBar->setMovable(tabsMovable); -#ifndef QT_NO_TABWIDGET +#if QT_CONFIG(tabwidget) tabBar->setShape(tabBarShapeFrom(tabShape, tabPosition)); #endif @@ -1634,7 +1634,7 @@ void QMdiAreaPrivate::updateTabBarGeometry() return; Q_Q(QMdiArea); -#ifndef QT_NO_TABWIDGET +#if QT_CONFIG(tabwidget) Q_ASSERT(tabBarShapeFrom(tabShape, tabPosition) == tabBar->shape()); #endif const QSize tabBarSizeHint = tabBar->sizeHint(); @@ -1648,7 +1648,7 @@ void QMdiAreaPrivate::updateTabBarGeometry() areaWidth -= vbar->width(); QRect tabBarRect; -#ifndef QT_NO_TABWIDGET +#if QT_CONFIG(tabwidget) switch (tabPosition) { case QTabWidget::North: q->setViewportMargins(0, tabBarSizeHint.height(), 0, 0); @@ -1675,7 +1675,7 @@ void QMdiAreaPrivate::updateTabBarGeometry() default: break; } -#endif // QT_NO_TABWIDGET +#endif // QT_CONFIG(tabwidget) tabBar->setGeometry(QStyle::visualRect(q->layoutDirection(), q->contentsRect(), tabBarRect)); } @@ -1691,7 +1691,7 @@ void QMdiAreaPrivate::refreshTabBar() tabBar->setDocumentMode(documentMode); tabBar->setTabsClosable(tabsClosable); tabBar->setMovable(tabsMovable); -#ifndef QT_NO_TABWIDGET +#if QT_CONFIG(tabwidget) tabBar->setShape(tabBarShapeFrom(tabShape, tabPosition)); #endif updateTabBarGeometry(); @@ -2218,7 +2218,7 @@ void QMdiArea::setTabsMovable(bool movable) } #endif // QT_NO_TABBAR -#ifndef QT_NO_TABWIDGET +#if QT_CONFIG(tabwidget) /*! \property QMdiArea::tabShape \brief the shape of the tabs in tabbed view mode. @@ -2270,7 +2270,7 @@ void QMdiArea::setTabPosition(QTabWidget::TabPosition position) d->tabPosition = position; d->refreshTabBar(); } -#endif // QT_NO_TABWIDGET +#endif // QT_CONFIG(tabwidget) /*! \reimp diff --git a/src/widgets/widgets/qmdiarea.h b/src/widgets/widgets/qmdiarea.h index 44a40948af..a2cc478856 100644 --- a/src/widgets/widgets/qmdiarea.h +++ b/src/widgets/widgets/qmdiarea.h @@ -42,7 +42,9 @@ #include #include +#if QT_CONFIG(tabwidget) #include +#endif QT_BEGIN_NAMESPACE @@ -63,7 +65,7 @@ class Q_WIDGETS_EXPORT QMdiArea : public QAbstractScrollArea Q_PROPERTY(bool tabsClosable READ tabsClosable WRITE setTabsClosable) Q_PROPERTY(bool tabsMovable READ tabsMovable WRITE setTabsMovable) #endif -#ifndef QT_NO_TABWIDGET +#if QT_CONFIG(tabwidget) Q_PROPERTY(QTabWidget::TabShape tabShape READ tabShape WRITE setTabShape) Q_PROPERTY(QTabWidget::TabPosition tabPosition READ tabPosition WRITE setTabPosition) #endif @@ -121,7 +123,7 @@ public: void setTabsMovable(bool movable); bool tabsMovable() const; #endif -#ifndef QT_NO_TABWIDGET +#if QT_CONFIG(tabwidget) void setTabShape(QTabWidget::TabShape shape); QTabWidget::TabShape tabShape() const; diff --git a/src/widgets/widgets/qmdiarea_p.h b/src/widgets/widgets/qmdiarea_p.h index b77f3f63ea..6bdbe28b51 100644 --- a/src/widgets/widgets/qmdiarea_p.h +++ b/src/widgets/widgets/qmdiarea_p.h @@ -163,7 +163,7 @@ public: bool tabsClosable; bool tabsMovable; #endif -#ifndef QT_NO_TABWIDGET +#if QT_CONFIG(tabwidget) QTabWidget::TabShape tabShape; QTabWidget::TabPosition tabPosition; #endif diff --git a/src/widgets/widgets/qtabbar.cpp b/src/widgets/widgets/qtabbar.cpp index 5ec60b0425..75744c2adb 100644 --- a/src/widgets/widgets/qtabbar.cpp +++ b/src/widgets/widgets/qtabbar.cpp @@ -49,7 +49,9 @@ #include "qstyle.h" #include "qstyleoption.h" #include "qstylepainter.h" +#if QT_CONFIG(tabwidget) #include "qtabwidget.h" +#endif #include "qtooltip.h" #if QT_CONFIG(whatsthis) #include "qwhatsthis.h" @@ -207,7 +209,7 @@ void QTabBarPrivate::initBasicStyleOption(QStyleOptionTab *option, int tabIndex) option->position = QStyleOptionTab::Middle; } -#ifndef QT_NO_TABWIDGET +#if QT_CONFIG(tabwidget) if (const QTabWidget *tw = qobject_cast(q->parentWidget())) { option->features |= QStyleOptionTab::HasFrame; if (tw->cornerWidget(Qt::TopLeftCorner) || tw->cornerWidget(Qt::BottomLeftCorner)) diff --git a/src/widgets/widgets/qtabwidget.cpp b/src/widgets/widgets/qtabwidget.cpp index c84c78275d..c496d267b3 100644 --- a/src/widgets/widgets/qtabwidget.cpp +++ b/src/widgets/widgets/qtabwidget.cpp @@ -39,7 +39,6 @@ #include "qtabwidget.h" -#ifndef QT_NO_TABWIDGET #include "private/qwidget_p.h" #include "private/qtabbar_p.h" #include "qapplication.h" @@ -1375,5 +1374,3 @@ void QTabWidget::clear() QT_END_NAMESPACE #include "moc_qtabwidget.cpp" - -#endif //QT_NO_TABWIDGET diff --git a/src/widgets/widgets/qtabwidget.h b/src/widgets/widgets/qtabwidget.h index 7d8864241a..b80fdba1fb 100644 --- a/src/widgets/widgets/qtabwidget.h +++ b/src/widgets/widgets/qtabwidget.h @@ -44,10 +44,9 @@ #include #include -QT_BEGIN_NAMESPACE - +QT_REQUIRE_CONFIG(tabwidget); -#ifndef QT_NO_TABWIDGET +QT_BEGIN_NAMESPACE class QTabBar; class QTabWidgetPrivate; @@ -181,8 +180,6 @@ private: void setUpLayout(bool = false); }; -#endif // QT_NO_TABWIDGET - QT_END_NAMESPACE #endif // QTABWIDGET_H diff --git a/src/widgets/widgets/widgets.pri b/src/widgets/widgets/widgets.pri index 7a39f3fb3e..0fcd389030 100644 --- a/src/widgets/widgets/widgets.pri +++ b/src/widgets/widgets/widgets.pri @@ -39,7 +39,6 @@ HEADERS += \ widgets/qstatusbar.h \ widgets/qtabbar.h \ widgets/qtabbar_p.h \ - widgets/qtabwidget.h \ widgets/qtextedit.h \ widgets/qtextedit_p.h \ widgets/qtextbrowser.h \ @@ -88,7 +87,6 @@ SOURCES += \ widgets/qstackedwidget.cpp \ widgets/qstatusbar.cpp \ widgets/qtabbar.cpp \ - widgets/qtabwidget.cpp \ widgets/qtextedit.cpp \ widgets/qtextbrowser.cpp \ widgets/qtoolbar.cpp \ @@ -222,6 +220,11 @@ qtConfig(splashscreen) { widgets/qsplashscreen.cpp } +qtConfig(tabwidget) { + HEADERS += widgets/qtabwidget.h + SOURCES += widgets/qtabwidget.cpp +} + qtConfig(widgettextcontrol) { HEADERS += \ widgets/qwidgettextcontrol_p.h \ -- cgit v1.2.3 From 2d02c4c799a4c45fe3f096a9bce95bd0b48b2743 Mon Sep 17 00:00:00 2001 From: Stephan Binner Date: Sun, 23 Jul 2017 11:35:27 +0200 Subject: Convert features.dockwidget to QT_[REQUIRE_]CONFIG Change-Id: I1d4b0268df01f8bc0aec28af52cc4b639a376863 Reviewed-by: Oswald Buddenhagen --- .../accessible/qaccessiblewidgetfactory.cpp | 2 +- src/widgets/accessible/qaccessiblewidgets.cpp | 8 +- src/widgets/accessible/qaccessiblewidgets_p.h | 4 +- src/widgets/styles/qcommonstyle.cpp | 20 +-- src/widgets/styles/qmacstyle_mac.mm | 6 +- src/widgets/styles/qmacstyle_mac_p_p.h | 2 + src/widgets/styles/qstylesheetstyle.cpp | 8 +- src/widgets/styles/qwindowsstyle.cpp | 12 +- src/widgets/styles/qwindowsvistastyle_p_p.h | 2 + src/widgets/styles/qwindowsxpstyle.cpp | 4 +- src/widgets/widgets/qdockarealayout.cpp | 4 - src/widgets/widgets/qdockarealayout_p.h | 4 +- src/widgets/widgets/qdockwidget.cpp | 3 - src/widgets/widgets/qdockwidget.h | 7 +- src/widgets/widgets/qdockwidget_p.h | 4 +- src/widgets/widgets/qmainwindow.cpp | 36 +++--- src/widgets/widgets/qmainwindow.h | 16 +-- src/widgets/widgets/qmainwindowlayout.cpp | 144 +++++++++++---------- src/widgets/widgets/qmainwindowlayout_p.h | 16 ++- src/widgets/widgets/qtoolbarlayout.cpp | 2 +- src/widgets/widgets/widgets.pri | 16 ++- .../other/qaccessibility/tst_qaccessibility.cpp | 4 +- .../widgets/qmainwindow/tst_qmainwindow.cpp | 8 +- 23 files changed, 172 insertions(+), 160 deletions(-) diff --git a/src/widgets/accessible/qaccessiblewidgetfactory.cpp b/src/widgets/accessible/qaccessiblewidgetfactory.cpp index 8c1e591f0e..796485c81a 100644 --- a/src/widgets/accessible/qaccessiblewidgetfactory.cpp +++ b/src/widgets/accessible/qaccessiblewidgetfactory.cpp @@ -215,7 +215,7 @@ QAccessibleInterface *qAccessibleFactory(const QString &classname, QObject *obje } else if (classname == QLatin1String("QCalendarWidget")) { iface = new QAccessibleCalendarWidget(widget); #endif -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) } else if (classname == QLatin1String("QDockWidget")) { iface = new QAccessibleDockWidget(widget); #endif diff --git a/src/widgets/accessible/qaccessiblewidgets.cpp b/src/widgets/accessible/qaccessiblewidgets.cpp index 676ac67b56..e28833274e 100644 --- a/src/widgets/accessible/qaccessiblewidgets.cpp +++ b/src/widgets/accessible/qaccessiblewidgets.cpp @@ -68,9 +68,11 @@ #if QT_CONFIG(itemviews) #include #endif +#if QT_CONFIG(dockwidget) #include -#include #include +#endif +#include #include #ifndef QT_NO_ACCESSIBILITY @@ -567,7 +569,7 @@ QWidget *QAccessibleCalendarWidget::navigationBar() const } #endif // QT_CONFIG(calendarwidget) -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) // Dock Widget - order of children: // - Content widget @@ -648,7 +650,7 @@ QString QAccessibleDockWidget::text(QAccessible::Text t) const } return QString(); } -#endif // QT_NO_DOCKWIDGET +#endif // QT_CONFIG(dockwidget) #ifndef QT_NO_CURSOR diff --git a/src/widgets/accessible/qaccessiblewidgets_p.h b/src/widgets/accessible/qaccessiblewidgets_p.h index 781e297a3b..3ff67c0c9b 100644 --- a/src/widgets/accessible/qaccessiblewidgets_p.h +++ b/src/widgets/accessible/qaccessiblewidgets_p.h @@ -286,7 +286,7 @@ private: }; #endif // QT_CONFIG(calendarwidget) -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) class QAccessibleDockWidget: public QAccessibleWidget { public: @@ -302,7 +302,7 @@ protected: QDockWidgetLayout *dockWidgetLayout() const; }; -#endif // QT_NO_DOCKWIDGET +#endif // QT_CONFIG(dockwidget) #ifndef QT_NO_MAINWINDOW class QAccessibleMainWindow : public QAccessibleWidget diff --git a/src/widgets/styles/qcommonstyle.cpp b/src/widgets/styles/qcommonstyle.cpp index e7b6f6bf35..12b4783827 100644 --- a/src/widgets/styles/qcommonstyle.cpp +++ b/src/widgets/styles/qcommonstyle.cpp @@ -49,7 +49,9 @@ #include #include #include +#if QT_CONFIG(dockwidget) #include +#endif #include #if QT_CONFIG(dialogbuttonbox) #include @@ -454,7 +456,7 @@ void QCommonStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, Q } break; #endif // QT_NO_GROUPBOX -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) case PE_FrameDockWidget: if (const QStyleOptionFrame *frame = qstyleoption_cast(opt)) { int lw = frame->lineWidth; @@ -464,7 +466,7 @@ void QCommonStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, Q qDrawShadePanel(p, frame->rect, frame->palette, false, lw); } break; -#endif // QT_NO_DOCKWIDGET +#endif // QT_CONFIG(dockwidget) #ifndef QT_NO_TOOLBAR case PE_IndicatorToolBarHandle: p->save(); @@ -2040,7 +2042,7 @@ void QCommonStyle::drawControl(ControlElement element, const QStyleOption *opt, } break; } #endif // QT_CONFIG(rubberband) -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) case CE_DockWidgetTitle: if (const QStyleOptionDockWidget *dwOpt = qstyleoption_cast(opt)) { QRect r = dwOpt->rect.adjusted(0, 0, -1, -1); @@ -2072,7 +2074,7 @@ void QCommonStyle::drawControl(ControlElement element, const QStyleOption *opt, } } break; -#endif // QT_NO_DOCKWIDGET +#endif // QT_CONFIG(dockwidget) case CE_Header: if (const QStyleOptionHeader *header = qstyleoption_cast(opt)) { QRegion clipRegion = p->clipRegion(); @@ -2923,7 +2925,7 @@ QRect QCommonStyle::subElementRect(SubElement sr, const QStyleOption *opt, r = f->rect.adjusted(frameWidth, frameWidth, -frameWidth, -frameWidth); } break; -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) case SE_DockWidgetCloseButton: case SE_DockWidgetFloatButton: case SE_DockWidgetTitleBarText: @@ -3443,7 +3445,7 @@ void QCommonStyle::drawComplexControl(ComplexControl cc, const QStyleOptionCompl ir = proxy()->subControlRect(CC_TitleBar, tb, SC_TitleBarCloseButton, widget); down = tb->activeSubControls & SC_TitleBarCloseButton && (opt->state & State_Sunken); if ((tb->titleBarFlags & Qt::WindowType_Mask) == Qt::Tool -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) || qobject_cast(widget) #endif ) @@ -4416,7 +4418,7 @@ int QCommonStyle::pixelMetric(PixelMetric m, const QStyleOption *opt, const QWid if (const QStyleOptionTitleBar *tb = qstyleoption_cast(opt)) { if ((tb->titleBarFlags & Qt::WindowType_Mask) == Qt::Tool) { ret = qMax(widget ? widget->fontMetrics().height() : opt->fontMetrics.height(), 16); -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) } else if (qobject_cast(widget)) { ret = qMax(widget->fontMetrics().height(), int(QStyleHelper::dpiScaled(13))); #endif @@ -4528,7 +4530,7 @@ int QCommonStyle::pixelMetric(PixelMetric m, const QStyleOption *opt, const QWid } break; #endif // QT_NO_SLIDER -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) case PM_DockWidgetSeparatorExtent: ret = int(QStyleHelper::dpiScaled(6.)); break; @@ -4542,7 +4544,7 @@ int QCommonStyle::pixelMetric(PixelMetric m, const QStyleOption *opt, const QWid case PM_DockWidgetFrameWidth: ret = 1; break; -#endif // QT_NO_DOCKWIDGET +#endif // QT_CONFIG(dockwidget) case PM_SpinBoxSliderHeight: case PM_MenuBarPanelWidth: diff --git a/src/widgets/styles/qmacstyle_mac.mm b/src/widgets/styles/qmacstyle_mac.mm index b9d3542d57..beedb5ee39 100644 --- a/src/widgets/styles/qmacstyle_mac.mm +++ b/src/widgets/styles/qmacstyle_mac.mm @@ -62,7 +62,9 @@ #if QT_CONFIG(dialogbuttonbox) #include #endif +#if QT_CONFIG(dockwidget) #include +#endif #include #include #include @@ -4319,7 +4321,7 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter } break; #endif -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) case CE_DockWidgetTitle: if (const QDockWidget *dockWidget = qobject_cast(w)) { bool floating = dockWidget->isFloating(); @@ -5226,7 +5228,7 @@ QRect QMacStyle::subElementRect(SubElement sr, const QStyleOption *opt, } break; #endif -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) case SE_DockWidgetCloseButton: case SE_DockWidgetFloatButton: case SE_DockWidgetTitleBarText: diff --git a/src/widgets/styles/qmacstyle_mac_p_p.h b/src/widgets/styles/qmacstyle_mac_p_p.h index 17e60e3bef..e465222137 100644 --- a/src/widgets/styles/qmacstyle_mac_p_p.h +++ b/src/widgets/styles/qmacstyle_mac_p_p.h @@ -62,7 +62,9 @@ #if QT_CONFIG(dialogbuttonbox) #include #endif +#if QT_CONFIG(dockwidget) #include +#endif #include #include #include diff --git a/src/widgets/styles/qstylesheetstyle.cpp b/src/widgets/styles/qstylesheetstyle.cpp index 2b89baaf27..2274e5280f 100644 --- a/src/widgets/styles/qstylesheetstyle.cpp +++ b/src/widgets/styles/qstylesheetstyle.cpp @@ -79,7 +79,9 @@ #include #include #include +#if QT_CONFIG(dockwidget) #include +#endif #include #if QT_CONFIG(dialog) #include @@ -1721,7 +1723,7 @@ static quint64 pseudoClass(QStyle::State state) static void qt_check_if_internal_object(const QObject **obj, int *element) { -#ifdef QT_NO_DOCKWIDGET +#if !QT_CONFIG(dockwidget) Q_UNUSED(obj); Q_UNUSED(element); #else @@ -1996,7 +1998,7 @@ QRenderRule QStyleSheetStyle::renderRule(const QObject *obj, const QStyleOption extraClass |= PseudoClass_PreviousSelected; } #endif // QT_NO_TOOLBOX -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) else if (const QStyleOptionDockWidget *dw = qstyleoption_cast(opt)) { if (dw->verticalTitleBar) extraClass |= PseudoClass_Vertical; @@ -2009,7 +2011,7 @@ QRenderRule QStyleSheetStyle::renderRule(const QObject *obj, const QStyleOption if (dw->movable) extraClass |= PseudoClass_Movable; } -#endif // QT_NO_DOCKWIDGET +#endif // QT_CONFIG(dockwidget) #if QT_CONFIG(itemviews) else if (const QStyleOptionViewItem *vopt = qstyleoption_cast(opt)) { if (vopt->features & QStyleOptionViewItem::Alternate) diff --git a/src/widgets/styles/qwindowsstyle.cpp b/src/widgets/styles/qwindowsstyle.cpp index 7b6da75089..a8c4c33ada 100644 --- a/src/widgets/styles/qwindowsstyle.cpp +++ b/src/widgets/styles/qwindowsstyle.cpp @@ -717,7 +717,7 @@ void QWindowsStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, case PE_FrameButtonTool: case PE_PanelButtonTool: { QPen oldPen = p->pen(); -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) if (w && w->inherits("QDockWidgetTitleButton")) { if (const QWidget *dw = w->parentWidget()) if (dw->isWindow()){ @@ -727,7 +727,7 @@ void QWindowsStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, return; } } -#endif // QT_NO_DOCKWIDGET +#endif // QT_CONFIG(dockwidget) QBrush fill; bool stippled; bool panel = (pe == PE_PanelButtonTool); @@ -1022,7 +1022,7 @@ void QWindowsStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, popupPal.setColor(QPalette::Midlight, opt->palette.light().color()); qDrawWinPanel(p, opt->rect, popupPal, opt->state & State_Sunken); break; } -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) case PE_IndicatorDockWidgetResizeHandle: break; case PE_FrameDockWidget: @@ -1030,7 +1030,7 @@ void QWindowsStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, proxy()->drawPrimitive(QStyle::PE_FrameWindow, opt, p, w); } break; -#endif // QT_NO_DOCKWIDGET +#endif // QT_CONFIG(dockwidget) case PE_FrameStatusBarItem: qDrawShadePanel(p, opt->rect, opt->palette, true, 1, 0); @@ -1784,7 +1784,7 @@ void QWindowsStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPai } break; -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) case CE_DockWidgetTitle: if (const QStyleOptionDockWidget *dwOpt = qstyleoption_cast(opt)) { @@ -1858,7 +1858,7 @@ void QWindowsStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPai p->restore(); } return; -#endif // QT_NO_DOCKWIDGET +#endif // QT_CONFIG(dockwidget) #if QT_CONFIG(combobox) case CE_ComboBoxLabel: if (const QStyleOptionComboBox *cb = qstyleoption_cast(opt)) { diff --git a/src/widgets/styles/qwindowsvistastyle_p_p.h b/src/widgets/styles/qwindowsvistastyle_p_p.h index 22ca1d3534..5e2200b876 100644 --- a/src/widgets/styles/qwindowsvistastyle_p_p.h +++ b/src/widgets/styles/qwindowsvistastyle_p_p.h @@ -77,7 +77,9 @@ #endif #include #include +#if QT_CONFIG(dockwidget) #include +#endif #if QT_CONFIG(listview) #include #endif diff --git a/src/widgets/styles/qwindowsxpstyle.cpp b/src/widgets/styles/qwindowsxpstyle.cpp index 418c4d256e..3c6b27bf7f 100644 --- a/src/widgets/styles/qwindowsxpstyle.cpp +++ b/src/widgets/styles/qwindowsxpstyle.cpp @@ -2290,7 +2290,7 @@ void QWindowsXPStyle::drawControl(ControlElement element, const QStyleOption *op drawItemText(p, mbi->rect, alignment, mbi->palette, mbi->state & State_Enabled, mbi->text, textRole); } return; -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) case CE_DockWidgetTitle: if (const QStyleOptionDockWidget *dwOpt = qstyleoption_cast(option)) { @@ -2415,7 +2415,7 @@ void QWindowsXPStyle::drawControl(ControlElement element, const QStyleOption *op return; } break; -#endif // QT_NO_DOCKWIDGET +#endif // QT_CONFIG(dockwidget) #if QT_CONFIG(rubberband) case CE_RubberBand: if (qstyleoption_cast(option)) { diff --git a/src/widgets/widgets/qdockarealayout.cpp b/src/widgets/widgets/qdockarealayout.cpp index 8140fa6def..742148b7ec 100644 --- a/src/widgets/widgets/qdockarealayout.cpp +++ b/src/widgets/widgets/qdockarealayout.cpp @@ -56,8 +56,6 @@ #include #include -#ifndef QT_NO_DOCKWIDGET - QT_BEGIN_NAMESPACE // qmainwindow.cpp @@ -3483,5 +3481,3 @@ void QDockAreaLayout::styleChangedEvent() } QT_END_NAMESPACE - -#endif // QT_NO_DOCKWIDGET diff --git a/src/widgets/widgets/qdockarealayout_p.h b/src/widgets/widgets/qdockarealayout_p.h index 21787283f4..e7bfc305ca 100644 --- a/src/widgets/widgets/qdockarealayout_p.h +++ b/src/widgets/widgets/qdockarealayout_p.h @@ -58,7 +58,7 @@ #include "QtCore/qvector.h" #include "QtWidgets/qlayout.h" -#ifndef QT_NO_DOCKWIDGET +QT_REQUIRE_CONFIG(dockwidget); QT_BEGIN_NAMESPACE @@ -310,6 +310,4 @@ public: QT_END_NAMESPACE -#endif // QT_NO_QDOCKWIDGET - #endif // QDOCKAREALAYOUT_P_H diff --git a/src/widgets/widgets/qdockwidget.cpp b/src/widgets/widgets/qdockwidget.cpp index 6d9731e962..12235e48b7 100644 --- a/src/widgets/widgets/qdockwidget.cpp +++ b/src/widgets/widgets/qdockwidget.cpp @@ -39,7 +39,6 @@ #include "qdockwidget.h" -#ifndef QT_NO_DOCKWIDGET #include #include #include @@ -1695,5 +1694,3 @@ QT_END_NAMESPACE #include "qdockwidget.moc" #include "moc_qdockwidget.cpp" #include "moc_qdockwidget_p.cpp" - -#endif // QT_NO_DOCKWIDGET diff --git a/src/widgets/widgets/qdockwidget.h b/src/widgets/widgets/qdockwidget.h index 80df009007..b53fa19a03 100644 --- a/src/widgets/widgets/qdockwidget.h +++ b/src/widgets/widgets/qdockwidget.h @@ -43,10 +43,9 @@ #include #include -QT_BEGIN_NAMESPACE - +QT_REQUIRE_CONFIG(dockwidget); -#ifndef QT_NO_DOCKWIDGET +QT_BEGIN_NAMESPACE class QDockAreaLayout; class QDockWidgetPrivate; @@ -134,8 +133,6 @@ private: Q_DECLARE_OPERATORS_FOR_FLAGS(QDockWidget::DockWidgetFeatures) -#endif // QT_NO_DOCKWIDGET - QT_END_NAMESPACE #endif // QDYNAMICDOCKWIDGET_H diff --git a/src/widgets/widgets/qdockwidget_p.h b/src/widgets/widgets/qdockwidget_p.h index 2d62cf5acd..2c16176c37 100644 --- a/src/widgets/widgets/qdockwidget_p.h +++ b/src/widgets/widgets/qdockwidget_p.h @@ -57,7 +57,7 @@ #include "QtWidgets/qboxlayout.h" #include "QtWidgets/qdockwidget.h" -#ifndef QT_NO_DOCKWIDGET +QT_REQUIRE_CONFIG(dockwidget); QT_BEGIN_NAMESPACE @@ -204,6 +204,4 @@ inline QDockWidgetLayout *QDockWidgetItem::dockWidgetLayout() const QT_END_NAMESPACE -#endif // QT_NO_DOCKWIDGET - #endif // QDYNAMICDOCKWIDGET_P_H diff --git a/src/widgets/widgets/qmainwindow.cpp b/src/widgets/widgets/qmainwindow.cpp index 1e7abe0f55..5b9d728b86 100644 --- a/src/widgets/widgets/qmainwindow.cpp +++ b/src/widgets/widgets/qmainwindow.cpp @@ -44,7 +44,9 @@ #ifndef QT_NO_MAINWINDOW +#if QT_CONFIG(dockwidget) #include "qdockwidget.h" +#endif #include "qtoolbar.h" #include @@ -84,7 +86,7 @@ public: , useHIToolBar(false) , activateUnifiedToolbarAfterFullScreen(false) #endif -#if !defined(QT_NO_DOCKWIDGET) && !defined(QT_NO_CURSOR) +#if QT_CONFIG(dockwidget) && !defined(QT_NO_CURSOR) , hasOldCursor(false) , cursorAdjusted(false) #endif { } @@ -103,7 +105,7 @@ public: QList hoverSeparator; QPoint hoverPos; -#if !defined(QT_NO_DOCKWIDGET) && !defined(QT_NO_CURSOR) +#if QT_CONFIG(dockwidget) && !defined(QT_NO_CURSOR) QCursor separatorCursor(const QList &path) const; void adjustCursor(const QPoint &pos); QCursor oldCursor; @@ -377,7 +379,7 @@ void QMainWindowPrivate::init() \sa setToolButtonStyle() */ -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) /*! \fn void QMainWindow::tabifiedDockWidgetActivated(QDockWidget *dockWidget) @@ -689,7 +691,7 @@ QWidget *QMainWindow::takeCentralWidget() return oldcentralwidget; } -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) /*! Sets the given dock widget \a area to occupy the specified \a corner. @@ -795,12 +797,12 @@ void QMainWindow::addToolBar(Qt::ToolBarArea area, QToolBar *toolbar) if(toolbar->d_func()->state && toolbar->d_func()->state->dragging) { //removing a toolbar which is dragging will cause crash -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) bool animated = isAnimated(); setAnimated(false); #endif toolbar->d_func()->endDrag(); -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) setAnimated(animated); #endif } @@ -903,7 +905,7 @@ bool QMainWindow::toolBarBreak(QToolBar *toolbar) const #endif // QT_NO_TOOLBAR -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) /*! \property QMainWindow::animated \brief whether manipulating dock widgets and tool bars is animated @@ -1280,7 +1282,7 @@ void QMainWindow::resizeDocks(const QList &docks, } -#endif // QT_NO_DOCKWIDGET +#endif // QT_CONFIG(dockwidget) /*! Saves the current state of this mainwindow's toolbars and @@ -1344,7 +1346,7 @@ bool QMainWindow::restoreState(const QByteArray &state, int version) return restored; } -#if !defined(QT_NO_DOCKWIDGET) && !defined(QT_NO_CURSOR) +#if QT_CONFIG(dockwidget) && !defined(QT_NO_CURSOR) QCursor QMainWindowPrivate::separatorCursor(const QList &path) const { QDockAreaLayoutInfo *info = layout->layoutState.dockAreaLayout.info(path); @@ -1426,7 +1428,7 @@ bool QMainWindow::event(QEvent *event) Q_D(QMainWindow); switch (event->type()) { -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) case QEvent::Paint: { QPainter p(this); QRegion r = static_cast(event)->region(); @@ -1510,7 +1512,7 @@ bool QMainWindow::event(QEvent *event) #endif // QT_CONFIG(statustip) case QEvent::StyleChange: -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) d->layout->layoutState.dockAreaLayout.styleChangedEvent(); #endif if (!d->explicitIconSize) @@ -1536,7 +1538,7 @@ bool QMainWindow::event(QEvent *event) } break; #endif -#if !defined(QT_NO_DOCKWIDGET) && !defined(QT_NO_CURSOR) +#if QT_CONFIG(dockwidget) && !defined(QT_NO_CURSOR) case QEvent::CursorChange: // CursorChange events are triggered as mouse moves to new widgets even // if the cursor doesn't actually change, so do not change oldCursor if @@ -1639,7 +1641,7 @@ bool QMainWindow::unifiedTitleAndToolBarOnMac() const */ bool QMainWindow::isSeparator(const QPoint &pos) const { -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) Q_D(const QMainWindow); return !d->layout->layoutState.dockAreaLayout.findSeparator(pos).isEmpty(); #else @@ -1666,7 +1668,7 @@ void QMainWindow::contextMenuEvent(QContextMenuEvent *event) break; } #endif -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) if (QDockWidget *dw = qobject_cast(child)) { if (dw->parentWidget() != this) return; @@ -1677,7 +1679,7 @@ void QMainWindow::contextMenuEvent(QContextMenuEvent *event) } break; } -#endif // QT_NO_DOCKWIDGET +#endif // QT_CONFIG(dockwidget) #ifndef QT_NO_TOOLBAR if (QToolBar *tb = qobject_cast(child)) { if (tb->parentWidget() != this) @@ -1725,7 +1727,7 @@ QMenu *QMainWindow::createPopupMenu() { Q_D(QMainWindow); QMenu *menu = 0; -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) QList dockwidgets = findChildren(); if (dockwidgets.size()) { menu = new QMenu(this); @@ -1748,7 +1750,7 @@ QMenu *QMainWindow::createPopupMenu() } menu->addSeparator(); } -#endif // QT_NO_DOCKWIDGET +#endif // QT_CONFIG(dockwidget) #ifndef QT_NO_TOOLBAR QList toolbars = findChildren(); if (toolbars.size()) { diff --git a/src/widgets/widgets/qmainwindow.h b/src/widgets/widgets/qmainwindow.h index b0ea0ba47e..3c808ac669 100644 --- a/src/widgets/widgets/qmainwindow.h +++ b/src/widgets/widgets/qmainwindow.h @@ -64,7 +64,7 @@ class Q_WIDGETS_EXPORT QMainWindow : public QWidget Q_PROPERTY(QSize iconSize READ iconSize WRITE setIconSize) Q_PROPERTY(Qt::ToolButtonStyle toolButtonStyle READ toolButtonStyle WRITE setToolButtonStyle) -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) Q_PROPERTY(bool animated READ isAnimated WRITE setAnimated) #ifndef QT_NO_TABBAR Q_PROPERTY(bool documentMode READ documentMode WRITE setDocumentMode) @@ -73,7 +73,7 @@ class Q_WIDGETS_EXPORT QMainWindow : public QWidget Q_PROPERTY(QTabWidget::TabShape tabShape READ tabShape WRITE setTabShape) #endif // QT_CONFIG(tabwidget) Q_PROPERTY(bool dockNestingEnabled READ isDockNestingEnabled WRITE setDockNestingEnabled) -#endif // QT_NO_DOCKWIDGET +#endif // QT_CONFIG(dockwidget) Q_PROPERTY(DockOptions dockOptions READ dockOptions WRITE setDockOptions) #ifndef QT_NO_TOOLBAR Q_PROPERTY(bool unifiedTitleAndToolBarOnMac READ unifiedTitleAndToolBarOnMac WRITE setUnifiedTitleAndToolBarOnMac) @@ -101,7 +101,7 @@ public: Qt::ToolButtonStyle toolButtonStyle() const; void setToolButtonStyle(Qt::ToolButtonStyle toolButtonStyle); -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) bool isAnimated() const; bool isDockNestingEnabled() const; #endif @@ -141,7 +141,7 @@ public: QWidget *takeCentralWidget(); -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) void setCorner(Qt::Corner corner, Qt::DockWidgetArea area); Qt::DockWidgetArea corner(Qt::Corner corner) const; #endif @@ -162,7 +162,7 @@ public: Qt::ToolBarArea toolBarArea(QToolBar *toolbar) const; bool toolBarBreak(QToolBar *toolbar) const; #endif -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) void addDockWidget(Qt::DockWidgetArea area, QDockWidget *dockwidget); void addDockWidget(Qt::DockWidgetArea area, QDockWidget *dockwidget, Qt::Orientation orientation); @@ -177,7 +177,7 @@ public: void resizeDocks(const QList &docks, const QList &sizes, Qt::Orientation orientation); -#endif // QT_NO_DOCKWIDGET +#endif // QT_CONFIG(dockwidget) QByteArray saveState(int version = 0) const; bool restoreState(const QByteArray &state, int version = 0); @@ -187,7 +187,7 @@ public: #endif public Q_SLOTS: -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) void setAnimated(bool enabled); void setDockNestingEnabled(bool enabled); #endif @@ -198,7 +198,7 @@ public Q_SLOTS: Q_SIGNALS: void iconSizeChanged(const QSize &iconSize); void toolButtonStyleChanged(Qt::ToolButtonStyle toolButtonStyle); -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) void tabifiedDockWidgetActivated(QDockWidget *dockWidget); #endif diff --git a/src/widgets/widgets/qmainwindowlayout.cpp b/src/widgets/widgets/qmainwindowlayout.cpp index d2f043c407..3d716046c0 100644 --- a/src/widgets/widgets/qmainwindowlayout.cpp +++ b/src/widgets/widgets/qmainwindowlayout.cpp @@ -39,11 +39,13 @@ ****************************************************************************/ #include "qmainwindowlayout_p.h" -#include "qdockarealayout_p.h" #ifndef QT_NO_MAINWINDOW +#if QT_CONFIG(dockwidget) +#include "qdockarealayout_p.h" #include "qdockwidget.h" #include "qdockwidget_p.h" +#endif #include "qtoolbar_p.h" #include "qmainwindow.h" #include "qtoolbar.h" @@ -85,7 +87,7 @@ extern QMainWindowLayout *qt_mainwindow_layout(const QMainWindow *window); ** debug */ -#if !defined(QT_NO_DOCKWIDGET) && !defined(QT_NO_DEBUG_STREAM) +#if QT_CONFIG(dockwidget) && !defined(QT_NO_DEBUG_STREAM) static void dumpLayout(QTextStream &qout, const QDockAreaLayoutInfo &layout, QString indent); @@ -174,7 +176,7 @@ QDebug operator<<(QDebug debug, const QMainWindowLayout *layout) return debug; } -#endif // !defined(QT_NO_DOCKWIDGET) && !defined(QT_NO_DEBUG) +#endif // QT_CONFIG(dockwidget) && !defined(QT_NO_DEBUG) /****************************************************************************** ** QDockWidgetGroupWindow @@ -183,7 +185,7 @@ QDebug operator<<(QDebug debug, const QMainWindowLayout *layout) // dockwidgets are dragged together (QMainWindow::GroupedDragging feature). // QDockWidgetGroupLayout is the layout of that window and use a QDockAreaLayoutInfo to layout // the tabs inside it. -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) class QDockWidgetGroupLayout : public QLayout { QDockAreaLayoutInfo info; QWidgetResizeHandler *resizer; @@ -462,7 +464,7 @@ QMainWindowLayoutState::QMainWindowLayoutState(QMainWindow *win) #ifndef QT_NO_TOOLBAR toolBarAreaLayout(win), #endif -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) dockAreaLayout(win) #else centralWidgetItem(0) @@ -477,7 +479,7 @@ QSize QMainWindowLayoutState::sizeHint() const QSize result(0, 0); -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) result = dockAreaLayout.sizeHint(); #else if (centralWidgetItem != 0) @@ -495,7 +497,7 @@ QSize QMainWindowLayoutState::minimumSize() const { QSize result(0, 0); -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) result = dockAreaLayout.minimumSize(); #else if (centralWidgetItem != 0) @@ -515,7 +517,7 @@ void QMainWindowLayoutState::apply(bool animated) toolBarAreaLayout.apply(animated); #endif -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) // dumpLayout(dockAreaLayout, QString()); dockAreaLayout.apply(animated); #else @@ -537,7 +539,7 @@ void QMainWindowLayoutState::fitLayout() r = toolBarAreaLayout.fitLayout(); #endif // QT_NO_TOOLBAR -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) dockAreaLayout.rect = r; dockAreaLayout.fitLayout(); #else @@ -551,14 +553,14 @@ void QMainWindowLayoutState::deleteAllLayoutItems() toolBarAreaLayout.deleteAllLayoutItems(); #endif -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) dockAreaLayout.deleteAllLayoutItems(); #endif } void QMainWindowLayoutState::deleteCentralWidgetItem() { -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) delete dockAreaLayout.centralWidgetItem; dockAreaLayout.centralWidgetItem = 0; #else @@ -574,7 +576,7 @@ QLayoutItem *QMainWindowLayoutState::itemAt(int index, int *x) const return ret; #endif -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) if (QLayoutItem *ret = dockAreaLayout.itemAt(x, index)) return ret; #else @@ -592,7 +594,7 @@ QLayoutItem *QMainWindowLayoutState::takeAt(int index, int *x) return ret; #endif -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) if (QLayoutItem *ret = dockAreaLayout.takeAt(x, index)) return ret; #else @@ -620,7 +622,7 @@ QList QMainWindowLayoutState::indexOf(QWidget *widget) const } #endif -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) // is it a dock widget? if (qobject_cast(widget) || qobject_cast(widget)) { result = dockAreaLayout.indexOf(widget); @@ -628,14 +630,14 @@ QList QMainWindowLayoutState::indexOf(QWidget *widget) const result.prepend(1); return result; } -#endif //QT_NO_DOCKWIDGET +#endif // QT_CONFIG(dockwidget) return result; } bool QMainWindowLayoutState::contains(QWidget *widget) const { -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) if (dockAreaLayout.centralWidgetItem != 0 && dockAreaLayout.centralWidgetItem->widget() == widget) return true; if (!dockAreaLayout.indexOf(widget).isEmpty()) @@ -661,7 +663,7 @@ void QMainWindowLayoutState::setCentralWidget(QWidget *widget) if (widget != 0) item = new QWidgetItemV2(widget); -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) dockAreaLayout.centralWidgetItem = item; #else centralWidgetItem = item; @@ -672,7 +674,7 @@ QWidget *QMainWindowLayoutState::centralWidget() const { QLayoutItem *item = 0; -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) item = dockAreaLayout.centralWidgetItem; #else item = centralWidgetItem; @@ -698,7 +700,7 @@ QList QMainWindowLayoutState::gapIndex(QWidget *widget, } #endif -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) // is it a dock widget? if (qobject_cast(widget) != 0 || qobject_cast(widget)) { @@ -707,7 +709,7 @@ QList QMainWindowLayoutState::gapIndex(QWidget *widget, result.prepend(1); return result; } -#endif //QT_NO_DOCKWIDGET +#endif // QT_CONFIG(dockwidget) return result; } @@ -726,12 +728,12 @@ bool QMainWindowLayoutState::insertGap(const QList &path, QLayoutItem *item } #endif -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) if (i == 1) { Q_ASSERT(qobject_cast(item->widget()) || qobject_cast(item->widget())); return dockAreaLayout.insertGap(path.mid(1), item); } -#endif //QT_NO_DOCKWIDGET +#endif // QT_CONFIG(dockwidget) return false; } @@ -745,10 +747,10 @@ void QMainWindowLayoutState::remove(const QList &path) toolBarAreaLayout.remove(path.mid(1)); #endif -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) if (i == 1) dockAreaLayout.remove(path.mid(1)); -#endif //QT_NO_DOCKWIDGET +#endif // QT_CONFIG(dockwidget) } void QMainWindowLayoutState::remove(QLayoutItem *item) @@ -757,14 +759,14 @@ void QMainWindowLayoutState::remove(QLayoutItem *item) toolBarAreaLayout.remove(item); #endif -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) // is it a dock widget? if (QDockWidget *dockWidget = qobject_cast(item->widget())) { QList path = dockAreaLayout.indexOf(dockWidget); if (!path.isEmpty()) dockAreaLayout.remove(path); } -#endif //QT_NO_DOCKWIDGET +#endif // QT_CONFIG(dockwidget) } void QMainWindowLayoutState::clear() @@ -773,7 +775,7 @@ void QMainWindowLayoutState::clear() toolBarAreaLayout.clear(); #endif -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) dockAreaLayout.clear(); #else centralWidgetRect = QRect(); @@ -799,10 +801,10 @@ QLayoutItem *QMainWindowLayoutState::item(const QList &path) } #endif -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) if (i == 1) return dockAreaLayout.item(path.mid(1)).widgetItem; -#endif //QT_NO_DOCKWIDGET +#endif // QT_CONFIG(dockwidget) return 0; } @@ -816,10 +818,10 @@ QRect QMainWindowLayoutState::itemRect(const QList &path) const return toolBarAreaLayout.itemRect(path.mid(1)); #endif -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) if (i == 1) return dockAreaLayout.itemRect(path.mid(1)); -#endif //QT_NO_DOCKWIDGET +#endif // QT_CONFIG(dockwidget) return QRect(); } @@ -833,10 +835,10 @@ QRect QMainWindowLayoutState::gapRect(const QList &path) const return toolBarAreaLayout.itemRect(path.mid(1)); #endif -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) if (i == 1) return dockAreaLayout.gapRect(path.mid(1)); -#endif //QT_NO_DOCKWIDGET +#endif // QT_CONFIG(dockwidget) return QRect(); } @@ -850,10 +852,10 @@ QLayoutItem *QMainWindowLayoutState::plug(const QList &path) return toolBarAreaLayout.plug(path.mid(1)); #endif -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) if (i == 1) return dockAreaLayout.plug(path.mid(1)); -#endif //QT_NO_DOCKWIDGET +#endif // QT_CONFIG(dockwidget) return 0; } @@ -869,17 +871,17 @@ QLayoutItem *QMainWindowLayoutState::unplug(const QList &path, QMainWindowL return toolBarAreaLayout.unplug(path.mid(1), other ? &other->toolBarAreaLayout : 0); #endif -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) if (i == 1) return dockAreaLayout.unplug(path.mid(1)); -#endif //QT_NO_DOCKWIDGET +#endif // QT_CONFIG(dockwidget) return 0; } void QMainWindowLayoutState::saveState(QDataStream &stream) const { -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) dockAreaLayout.saveState(stream); #ifndef QT_NO_TABBAR QList floatingTabs = @@ -913,7 +915,7 @@ static QList findChildrenHelper(const QObject *o) return result; } -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) static QList allMyDockWidgets(const QWidget *mainWindow) { QList result; @@ -930,7 +932,7 @@ static QList allMyDockWidgets(const QWidget *mainWindow) return result; } -#endif // QT_NO_DOCKWIDGET +#endif // QT_CONFIG(dockwidget) //pre4.3 tests the format that was used before 4.3 bool QMainWindowLayoutState::checkFormat(QDataStream &stream) @@ -952,7 +954,7 @@ bool QMainWindowLayoutState::checkFormat(QDataStream &stream) break; #endif // QT_NO_TOOLBAR -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) case QDockAreaLayout::DockWidgetStateMarker: { const auto dockWidgets = allMyDockWidgets(mainWindow); @@ -973,7 +975,7 @@ bool QMainWindowLayoutState::checkFormat(QDataStream &stream) } break; #endif // QT_NO_TABBAR -#endif // QT_NO_DOCKWIDGET +#endif // QT_CONFIG(dockwidget) default: //there was an error during the parsing return false; @@ -1008,7 +1010,7 @@ bool QMainWindowLayoutState::restoreState(QDataStream &_stream, stream >> marker; switch(marker) { -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) case QDockAreaLayout::DockWidgetStateMarker: { const auto dockWidgets = allMyDockWidgets(mainWindow); @@ -1057,7 +1059,7 @@ bool QMainWindowLayoutState::restoreState(QDataStream &_stream, } break; #endif // QT_CONFIG(tabwidget) -#endif // QT_NO_DOCKWIDGET +#endif // QT_CONFIG(dockwidget) #ifndef QT_NO_TOOLBAR case QToolBarAreaLayout::ToolBarStateMarker: @@ -1358,7 +1360,7 @@ void QMainWindowLayout::toggleToolBarsVisible() ** QMainWindowLayoutState - dock areas */ -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) static QInternal::DockPosition toDockPos(Qt::DockWidgetArea area) { @@ -1823,7 +1825,7 @@ void QMainWindowLayout::raise(QDockWidget *widget) #endif } -#endif // QT_NO_DOCKWIDGET +#endif // QT_CONFIG(dockwidget) /****************************************************************************** @@ -1953,7 +1955,7 @@ void QMainWindowLayout::invalidate() minSize = szHint = QSize(); } -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) void QMainWindowLayout::setCurrentHoveredFloat(QWidget *w) { if (currentHoveredFloat != w) { @@ -1972,7 +1974,7 @@ void QMainWindowLayout::setCurrentHoveredFloat(QWidget *w) updateGapIndicator(); } } -#endif //QT_NO_DOCKWIDGET +#endif // QT_CONFIG(dockwidget) /****************************************************************************** ** QMainWindowLayout - remaining stuff @@ -2030,7 +2032,7 @@ void QMainWindowLayout::revert(QLayoutItem *widgetItem) bool QMainWindowLayout::plug(QLayoutItem *widgetItem) { -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) if (currentHoveredFloat) { QWidget *widget = widgetItem->widget(); QList previousPath = layoutState.indexOf(widget); @@ -2087,7 +2089,7 @@ bool QMainWindowLayout::plug(QLayoutItem *widgetItem) QWidget *widget = widgetItem->widget(); -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) // Let's remove the widget from any possible group window foreach (QDockWidgetGroupWindow *dwgw, parent()->findChildren(QString(), Qt::FindDirectChildrenOnly)) { @@ -2109,7 +2111,7 @@ bool QMainWindowLayout::plug(QLayoutItem *widgetItem) pluggingWidget = widget; QRect globalRect = currentGapRect; globalRect.moveTopLeft(parentWidget()->mapToGlobal(globalRect.topLeft())); -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) if (qobject_cast(widget) != 0) { QDockWidgetLayout *layout = qobject_cast(widget->layout()); if (layout->nativeWindowDeco()) { @@ -2143,7 +2145,7 @@ void QMainWindowLayout::animationFinished(QWidget *widget) if (widget == pluggingWidget) { -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) if (QDockWidgetGroupWindow *dwgw = qobject_cast(widget)) { // When the animated widget was a QDockWidgetGroupWindow, it means each of the // embedded QDockWidget needs to be plugged back into the QMainWindow layout. @@ -2217,7 +2219,7 @@ void QMainWindowLayout::animationFinished(QWidget *widget) //and all the geometries (especially the one from the central widget) is correct layoutState.apply(false); -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) #ifndef QT_NO_TABBAR if (qobject_cast(widget) != 0) { // info() might return null if the widget is destroyed while @@ -2231,13 +2233,13 @@ void QMainWindowLayout::animationFinished(QWidget *widget) if (!widgetAnimator.animating()) { //all animations are finished -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) parentWidget()->update(layoutState.dockAreaLayout.separatorRegion()); #ifndef QT_NO_TABBAR foreach (QTabBar *tab_bar, usedTabBars) tab_bar->show(); #endif // QT_NO_TABBAR -#endif // QT_NO_DOCKWIDGET +#endif // QT_CONFIG(dockwidget) } updateGapIndicator(); @@ -2263,7 +2265,7 @@ QMainWindowLayout::QMainWindowLayout(QMainWindow *mainwindow, QLayout *parentLay , savedState(mainwindow) , dockOptions(QMainWindow::AnimatedDocks | QMainWindow::AllowTabbedDocks) , statusbar(0) -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) #ifndef QT_NO_TABBAR , _documentMode(false) , verticalTabsEnabled(false) @@ -2271,7 +2273,7 @@ QMainWindowLayout::QMainWindowLayout(QMainWindow *mainwindow, QLayout *parentLay , _tabShape(QTabWidget::Rounded) #endif #endif -#endif // QT_NO_DOCKWIDGET +#endif // QT_CONFIG(dockwidget) , widgetAnimator(this) , pluggingWidget(0) #if 0 // Used to be included in Qt4 for Q_WS_MAC @@ -2281,7 +2283,7 @@ QMainWindowLayout::QMainWindowLayout(QMainWindow *mainwindow, QLayout *parentLay if (parentLayout) setParent(parentLayout); -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) #ifndef QT_NO_TABBAR sep = mainwindow->style()->pixelMetric(QStyle::PM_DockWidgetSeparatorExtent, 0, mainwindow); #endif @@ -2290,7 +2292,7 @@ QMainWindowLayout::QMainWindowLayout(QMainWindow *mainwindow, QLayout *parentLay for (int i = 0; i < QInternal::DockCount; ++i) tabPositions[i] = QTabWidget::South; #endif -#endif // QT_NO_DOCKWIDGET +#endif // QT_CONFIG(dockwidget) pluggingWidget = 0; setObjectName(mainwindow->objectName() + QLatin1String("_layout")); @@ -2315,7 +2317,7 @@ void QMainWindowLayout::setDockOptions(QMainWindow::DockOptions opts) dockOptions = opts; -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) setVerticalTabsEnabled(opts & QMainWindow::VerticalTabs); #endif @@ -2347,7 +2349,7 @@ void QMainWindowLayout::setCentralWidget(QWidget *widget) addChildWidget(widget); layoutState.setCentralWidget(widget); if (savedState.isValid()) { -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) savedState.dockAreaLayout.centralWidgetItem = layoutState.dockAreaLayout.centralWidgetItem; savedState.dockAreaLayout.fallbackToSizeHints = true; #else @@ -2369,7 +2371,7 @@ void QMainWindowLayout::setCentralWidget(QWidget *widget) */ QLayoutItem *QMainWindowLayout::unplug(QWidget *widget, bool group) { -#if !defined(QT_NO_DOCKWIDGET) && !defined(QT_NO_TABBAR) +#if QT_CONFIG(dockwidget) && !defined(QT_NO_TABBAR) if (!widget->isWindow() && qobject_cast(widget->parentWidget())) { if (group) { // We are just dragging a floating window as it, not need to do anything, we just have to @@ -2397,7 +2399,7 @@ QLayoutItem *QMainWindowLayout::unplug(QWidget *widget, bool group) QRect r = layoutState.itemRect(path); savedState = layoutState; -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) if (QDockWidget *dw = qobject_cast(widget)) { Q_ASSERT(path.constFirst() == 1); bool actualGroup = false; @@ -2427,7 +2429,7 @@ QLayoutItem *QMainWindowLayout::unplug(QWidget *widget, bool group) dw->d_func()->unplug(r); } } -#endif // QT_NO_DOCKWIDGET +#endif // QT_CONFIG(dockwidget) #ifndef QT_NO_TOOLBAR if (QToolBar *tb = qobject_cast(widget)) { tb->d_func()->unplug(r); @@ -2490,7 +2492,7 @@ void QMainWindowLayout::hover(QLayoutItem *widgetItem, const QPoint &mousePos) QWidget *widget = widgetItem->widget(); -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) if ((dockOptions & QMainWindow::GroupedDragging) && (qobject_cast(widget) || qobject_cast(widget))) { @@ -2528,7 +2530,7 @@ void QMainWindowLayout::hover(QLayoutItem *widgetItem, const QPoint &mousePos) } } setCurrentHoveredFloat(nullptr); -#endif //QT_NO_DOCKWIDGET +#endif // QT_CONFIG(dockwidget) QPoint pos = parentWidget()->mapFromGlobal(mousePos); @@ -2540,7 +2542,7 @@ void QMainWindowLayout::hover(QLayoutItem *widgetItem, const QPoint &mousePos) if (!path.isEmpty()) { bool allowed = false; -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) if (QDockWidget *dw = qobject_cast(widget)) allowed = dw->isAreaAllowed(toDockWidgetArea(path.at(1))); @@ -2587,7 +2589,7 @@ void QMainWindowLayout::hover(QLayoutItem *widgetItem, const QPoint &mousePos) currentGapRect = newState.gapRect(currentGapPos); -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) parentWidget()->update(layoutState.dockAreaLayout.separatorRegion()); #endif layoutState = newState; @@ -2666,7 +2668,7 @@ bool QMainWindowLayout::restoreState(QDataStream &stream) savedState.deleteAllLayoutItems(); savedState.clear(); -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) if (parentWidget()->isVisible()) { #ifndef QT_NO_TABBAR foreach (QTabBar *tab_bar, usedTabBars) @@ -2674,7 +2676,7 @@ bool QMainWindowLayout::restoreState(QDataStream &stream) #endif } -#endif // QT_NO_DOCKWIDGET +#endif // QT_CONFIG(dockwidget) return true; } @@ -2697,7 +2699,7 @@ bool QMainWindowLayout::usesHIToolBar(QToolBar *toolbar) const void QMainWindowLayout::timerEvent(QTimerEvent *e) { -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) if (e->timerId() == separatorMoveTimer.timerId()) { //let's move the separators separatorMoveTimer.stop(); diff --git a/src/widgets/widgets/qmainwindowlayout_p.h b/src/widgets/widgets/qmainwindowlayout_p.h index b0eae3762f..a7ae76eb69 100644 --- a/src/widgets/widgets/qmainwindowlayout_p.h +++ b/src/widgets/widgets/qmainwindowlayout_p.h @@ -64,7 +64,9 @@ #include "private/qlayoutengine_p.h" #include "private/qwidgetanimator_p.h" +#if QT_CONFIG(dockwidget) #include "qdockarealayout_p.h" +#endif #include "qtoolbararealayout_p.h" QT_BEGIN_NAMESPACE @@ -72,7 +74,7 @@ QT_BEGIN_NAMESPACE class QToolBar; class QRubberBand; -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) class QDockWidgetGroupWindow : public QWidget { Q_OBJECT @@ -126,7 +128,7 @@ public: QToolBarAreaLayout toolBarAreaLayout; #endif -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) QDockAreaLayout dockAreaLayout; #else QLayoutItem *centralWidgetItem; @@ -217,7 +219,7 @@ public: // dock widgets -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) void setCorner(Qt::Corner corner, Qt::DockWidgetArea area); Qt::DockWidgetArea corner(Qt::Corner corner) const; void addDockWidget(Qt::DockWidgetArea area, @@ -271,7 +273,7 @@ public: bool separatorMove(const QPoint &pos); bool endSeparatorMove(const QPoint &pos); void keepSize(QDockWidget *w); -#endif // QT_NO_DOCKWIDGET +#endif // QT_CONFIG(dockwidget) // save/restore @@ -304,7 +306,7 @@ public: #if QT_CONFIG(rubberband) QPointer gapIndicator; #endif -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) QPointer currentHoveredFloat; // set when dragging over a floating dock widget void setCurrentHoveredFloat(QWidget *w); #endif @@ -321,7 +323,7 @@ public: private Q_SLOTS: void updateGapIndicator(); -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) #ifndef QT_NO_TABBAR void tabChanged(); void tabMoved(int from, int to); @@ -367,7 +369,7 @@ public: #endif }; -#if !defined(QT_NO_DOCKWIDGET) && !defined(QT_NO_DEBUG_STREAM) +#if QT_CONFIG(dockwidget) && !defined(QT_NO_DEBUG_STREAM) class QDebug; QDebug operator<<(QDebug debug, const QDockAreaLayout &layout); QDebug operator<<(QDebug debug, const QMainWindowLayout *layout); diff --git a/src/widgets/widgets/qtoolbarlayout.cpp b/src/widgets/widgets/qtoolbarlayout.cpp index 79174bdbff..39e61a1951 100644 --- a/src/widgets/widgets/qtoolbarlayout.cpp +++ b/src/widgets/widgets/qtoolbarlayout.cpp @@ -666,7 +666,7 @@ void QToolBarLayout::setExpanded(bool exp) extension->setChecked(expanded); if (QMainWindow *win = qobject_cast(tb->parentWidget())) { -#ifdef QT_NO_DOCKWIDGET +#if !QT_CONFIG(dockwidget) animating = false; #else animating = !tb->isWindow() && win->isAnimated(); diff --git a/src/widgets/widgets/widgets.pri b/src/widgets/widgets/widgets.pri index 0fcd389030..83ddba04bb 100644 --- a/src/widgets/widgets/widgets.pri +++ b/src/widgets/widgets/widgets.pri @@ -6,9 +6,6 @@ HEADERS += \ widgets/qabstractspinbox.h \ widgets/qabstractspinbox_p.h \ widgets/qdial.h \ - widgets/qdockwidget.h \ - widgets/qdockwidget_p.h \ - widgets/qdockarealayout_p.h \ widgets/qframe.h \ widgets/qframe_p.h \ widgets/qgroupbox.h \ @@ -64,8 +61,6 @@ SOURCES += \ widgets/qbuttongroup.cpp \ widgets/qabstractspinbox.cpp \ widgets/qdial.cpp \ - widgets/qdockwidget.cpp \ - widgets/qdockarealayout.cpp \ widgets/qeffects.cpp \ widgets/qframe.cpp \ widgets/qgroupbox.cpp \ @@ -160,6 +155,17 @@ qtConfig(datetimeedit) { widgets/qdatetimeedit.cpp } +qtConfig(dockwidget) { + HEADERS += \ + widgets/qdockwidget.h \ + widgets/qdockwidget_p.h \ + widgets/qdockarealayout_p.h + + SOURCES += \ + widgets/qdockwidget.cpp \ + widgets/qdockarealayout.cpp +} + qtConfig(fontcombobox) { HEADERS += widgets/qfontcombobox.h SOURCES += widgets/qfontcombobox.cpp diff --git a/tests/auto/other/qaccessibility/tst_qaccessibility.cpp b/tests/auto/other/qaccessibility/tst_qaccessibility.cpp index 4a64f06e81..4ffdc4c762 100644 --- a/tests/auto/other/qaccessibility/tst_qaccessibility.cpp +++ b/tests/auto/other/qaccessibility/tst_qaccessibility.cpp @@ -3425,7 +3425,7 @@ void tst_QAccessibility::calendarWidgetTest() void tst_QAccessibility::dockWidgetTest() { -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) // Set up a proper main window with two dock widgets QMainWindow *mw = new QMainWindow(); QFrame *central = new QFrame(mw); @@ -3558,7 +3558,7 @@ void tst_QAccessibility::dockWidgetTest() delete mw; QTestAccessibility::clearEvents(); -#endif // QT_NO_DOCKWIDGET +#endif // QT_CONFIG(dockwidget) } void tst_QAccessibility::comboBoxTest() diff --git a/tests/auto/widgets/widgets/qmainwindow/tst_qmainwindow.cpp b/tests/auto/widgets/widgets/qmainwindow/tst_qmainwindow.cpp index 680fea27dd..7942109a0a 100644 --- a/tests/auto/widgets/widgets/qmainwindow/tst_qmainwindow.cpp +++ b/tests/auto/widgets/widgets/qmainwindow/tst_qmainwindow.cpp @@ -29,8 +29,10 @@ #include - +#include +#if QT_CONFIG(dockwidget) #include +#endif #include #include #include @@ -148,7 +150,7 @@ private slots: void QTBUG21378_animationFinished(); void resizeDocks(); void resizeDocks_data(); -#if !defined(QT_NO_DOCKWIDGET) && !defined(QT_NO_TABBAR) +#if QT_CONFIG(dockwidget) && !defined(QT_NO_TABBAR) void QTBUG52175_tabifiedDockWidgetActivated(); #endif }; @@ -2044,7 +2046,7 @@ void tst_QMainWindow::resizeDocks() } } -#if !defined(QT_NO_DOCKWIDGET) && !defined(QT_NO_TABBAR) +#if QT_CONFIG(dockwidget) && !defined(QT_NO_TABBAR) void tst_QMainWindow::QTBUG52175_tabifiedDockWidgetActivated() { QMainWindow w; -- cgit v1.2.3 From 7964b7468de65459f3c0e431549fa93408c19a62 Mon Sep 17 00:00:00 2001 From: Stephan Binner Date: Sun, 23 Jul 2017 11:37:00 +0200 Subject: Convert features.tabbar to QT_[REQUIRE_]CONFIG Change-Id: Id21a95cbc61b2559a8f517ee60548b61536e3cc4 Reviewed-by: Oswald Buddenhagen --- src/widgets/accessible/complexwidgets.cpp | 8 +- src/widgets/accessible/complexwidgets_p.h | 4 +- .../accessible/qaccessiblewidgetfactory.cpp | 2 +- src/widgets/styles/qcommonstyle.cpp | 24 +++-- src/widgets/styles/qcommonstyle_p.h | 2 +- src/widgets/styles/qmacstyle_mac.mm | 28 ++--- src/widgets/styles/qmacstyle_mac_p_p.h | 2 +- src/widgets/styles/qstyleoption.cpp | 8 +- src/widgets/styles/qstyleoption.h | 10 +- src/widgets/styles/qstylesheetstyle.cpp | 32 +++--- src/widgets/styles/qwindowsstyle.cpp | 8 +- src/widgets/styles/qwindowsxpstyle.cpp | 2 + src/widgets/widgets/qdockarealayout.cpp | 118 ++++++++++----------- src/widgets/widgets/qdockarealayout_p.h | 14 ++- src/widgets/widgets/qdockwidget.cpp | 4 +- src/widgets/widgets/qmainwindow.cpp | 6 +- src/widgets/widgets/qmainwindow.h | 6 +- src/widgets/widgets/qmainwindowlayout.cpp | 40 +++---- src/widgets/widgets/qmainwindowlayout_p.h | 10 +- src/widgets/widgets/qmdiarea.cpp | 54 +++++----- src/widgets/widgets/qmdiarea.h | 4 +- src/widgets/widgets/qmdiarea_p.h | 4 +- src/widgets/widgets/qmdisubwindow.h | 2 +- src/widgets/widgets/qtabbar.cpp | 4 - src/widgets/widgets/qtabbar.h | 7 +- src/widgets/widgets/qtabbar_p.h | 7 +- src/widgets/widgets/widgets.pri | 11 +- .../widgets/qmainwindow/tst_qmainwindow.cpp | 6 +- 28 files changed, 219 insertions(+), 208 deletions(-) diff --git a/src/widgets/accessible/complexwidgets.cpp b/src/widgets/accessible/complexwidgets.cpp index 9475b5a96c..5442c145a0 100644 --- a/src/widgets/accessible/complexwidgets.cpp +++ b/src/widgets/accessible/complexwidgets.cpp @@ -45,7 +45,10 @@ #if QT_CONFIG(itemviews) #include #endif +#if QT_CONFIG(tabbar) #include +#include +#endif #if QT_CONFIG(combobox) #include #endif @@ -56,7 +59,6 @@ #if QT_CONFIG(whatsthis) #include #endif -#include #include #include #include @@ -69,7 +71,7 @@ QT_BEGIN_NAMESPACE QString qt_accStripAmp(const QString &text); QString qt_accHotKey(const QString &text); -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) /*! \class QAccessibleTabBar \brief The QAccessibleTabBar class implements the QAccessibleInterface for tab bars. @@ -262,7 +264,7 @@ QString QAccessibleTabBar::text(QAccessible::Text t) const return QString(); } -#endif // QT_NO_TABBAR +#endif // QT_CONFIG(tabbar) #if QT_CONFIG(combobox) /*! diff --git a/src/widgets/accessible/complexwidgets_p.h b/src/widgets/accessible/complexwidgets_p.h index 849169ab8a..6f5c950631 100644 --- a/src/widgets/accessible/complexwidgets_p.h +++ b/src/widgets/accessible/complexwidgets_p.h @@ -107,7 +107,7 @@ public: }; #endif // QT_NO_SCROLLAREA -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) class QAccessibleTabBar : public QAccessibleWidget { public: @@ -124,7 +124,7 @@ protected: QTabBar *tabBar() const; mutable QHash m_childInterfaces; }; -#endif // QT_NO_TABBAR +#endif // QT_CONFIG(tabbar) #if QT_CONFIG(combobox) class QAccessibleComboBox : public QAccessibleWidget diff --git a/src/widgets/accessible/qaccessiblewidgetfactory.cpp b/src/widgets/accessible/qaccessiblewidgetfactory.cpp index 796485c81a..c3de7a7dd6 100644 --- a/src/widgets/accessible/qaccessiblewidgetfactory.cpp +++ b/src/widgets/accessible/qaccessiblewidgetfactory.cpp @@ -153,7 +153,7 @@ QAccessibleInterface *qAccessibleFactory(const QString &classname, QObject *obje iface = new QAccessibleTable(widget); // ### This should be cleaned up. We return the parent for the scrollarea to hide it. #endif // QT_CONFIG(itemviews) -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) } else if (classname == QLatin1String("QTabBar")) { iface = new QAccessibleTabBar(widget); #endif diff --git a/src/widgets/styles/qcommonstyle.cpp b/src/widgets/styles/qcommonstyle.cpp index 12b4783827..5e43d69e8f 100644 --- a/src/widgets/styles/qcommonstyle.cpp +++ b/src/widgets/styles/qcommonstyle.cpp @@ -69,7 +69,9 @@ #include #include #include +#if QT_CONFIG(tabbar) #include +#endif #if QT_CONFIG(tabwidget) #include #endif @@ -368,7 +370,7 @@ void QCommonStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, Q p->setPen(oldPen); } break; -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) case PE_FrameTabBarBase: if (const QStyleOptionTabBarBase *tbb = qstyleoption_cast(opt)) { @@ -431,7 +433,7 @@ void QCommonStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, Q } #else Q_UNUSED(d); -#endif // QT_NO_TABBAR +#endif // QT_CONFIG(tabbar) case PE_FrameTabWidget: case PE_FrameWindow: qDrawWinPanel(p, opt->rect, opt->palette, false, 0); @@ -575,7 +577,7 @@ void QCommonStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, Q p->setBrush(oldBrush); break; } -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) case PE_IndicatorTabTear: if (const QStyleOptionTab *tab = qstyleoption_cast(opt)) { bool rtl = tab->direction == Qt::RightToLeft; @@ -609,7 +611,7 @@ void QCommonStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, Q p->drawPath(path); } break; -#endif // QT_NO_TABBAR +#endif // QT_CONFIG(tabbar) #ifndef QT_NO_LINEEDIT case PE_PanelLineEdit: if (const QStyleOptionFrame *panel = qstyleoption_cast(opt)) { @@ -1104,7 +1106,7 @@ void QCommonStylePrivate::viewItemLayout(const QStyleOptionViewItem *opt, QRect #endif // QT_CONFIG(itemviews) -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) /*! \internal Compute the textRect and the pixmapRect from the opt rect @@ -1171,7 +1173,7 @@ void QCommonStylePrivate::tabLayout(const QStyleOptionTab *opt, const QWidget *w *textRect = tr; } -#endif //QT_NO_TABBAR +#endif // QT_CONFIG(tabbar) #ifndef QT_NO_ANIMATION /*! \internal */ @@ -1718,7 +1720,7 @@ void QCommonStyle::drawControl(ControlElement element, const QStyleOption *opt, } break; #endif // QT_NO_TOOLBOX -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) case CE_TabBarTab: if (const QStyleOptionTab *tab = qstyleoption_cast(opt)) { proxy()->drawControl(CE_TabBarTabShape, tab, p, widget); @@ -1938,7 +1940,7 @@ void QCommonStyle::drawControl(ControlElement element, const QStyleOption *opt, } } break; -#endif // QT_NO_TABBAR +#endif // QT_CONFIG(tabbar) #ifndef QT_NO_SIZEGRIP case CE_SizeGrip: { p->save(); @@ -2813,7 +2815,7 @@ QRect QCommonStyle::subElementRect(SubElement sr, const QStyleOption *opt, break; #endif // QT_CONFIG(tabwidget) -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) case SE_TabBarTearIndicator: if (const QStyleOptionTab *tab = qstyleoption_cast(opt)) { switch (tab->shape) { @@ -4581,7 +4583,7 @@ int QCommonStyle::pixelMetric(PixelMetric m, const QStyleOption *opt, const QWid break; #endif // QT_NO_TOOLBAR -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) case PM_TabBarTabOverlap: ret = 3; break; @@ -5225,7 +5227,7 @@ int QCommonStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget case SH_ItemView_DrawDelegateFrame: ret = 0; break; -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) case SH_TabBar_CloseButtonPosition: ret = QTabBar::RightSide; break; diff --git a/src/widgets/styles/qcommonstyle_p.h b/src/widgets/styles/qcommonstyle_p.h index 7c69109ff7..9fb731239a 100644 --- a/src/widgets/styles/qcommonstyle_p.h +++ b/src/widgets/styles/qcommonstyle_p.h @@ -110,7 +110,7 @@ public: } #endif mutable QIcon tabBarcloseButtonIcon; -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) void tabLayout(const QStyleOptionTab *opt, const QWidget *widget, QRect *textRect, QRect *pixmapRect) const; #endif diff --git a/src/widgets/styles/qmacstyle_mac.mm b/src/widgets/styles/qmacstyle_mac.mm index beedb5ee39..6117ea22c7 100644 --- a/src/widgets/styles/qmacstyle_mac.mm +++ b/src/widgets/styles/qmacstyle_mac.mm @@ -51,7 +51,9 @@ //#define DEBUG_SIZE_CONSTRAINT #include +#if QT_CONFIG(tabbar) #include +#endif #include #include #include @@ -232,7 +234,7 @@ static const qreal closeButtonCornerRadius = 2.0; typedef HIRect * (*PtrHIShapeGetBounds)(HIShapeRef, HIRect *); static PtrHIShapeGetBounds ptrHIShapeGetBounds = 0; -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) static bool isVerticalTabs(const QTabBar::Shape shape) { return (shape == QTabBar::RoundedEast || shape == QTabBar::TriangularEast @@ -291,7 +293,7 @@ static void drawTabCloseButton(QPainter *p, bool hover, bool selected, bool pres p->drawLine(margin, height - margin, width - margin, margin); } -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) QRect rotateTabPainter(QPainter *p, QTabBar::Shape shape, QRect tabRect) { if (isVerticalTabs(shape)) { @@ -435,7 +437,7 @@ static inline bool isTreeView(const QWidget *widget) } #endif -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) static inline ThemeTabDirection getTabDirection(QTabBar::Shape shape) { ThemeTabDirection ttd; @@ -1077,7 +1079,7 @@ void QMacStylePrivate::drawFocusRing(QPainter *p, const QRect &targetRect, int h QRect(focusRingPixmap.width() - shCornerSize, svCornerSize, shCornerSize, focusRingPixmap.width() - 2 * svCornerSize)); } -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) void QMacStylePrivate::tabLayout(const QStyleOptionTab *opt, const QWidget *widget, QRect *textRect, QRect *iconRect) const { Q_ASSERT(textRect); @@ -1140,7 +1142,7 @@ void QMacStylePrivate::tabLayout(const QStyleOptionTab *opt, const QWidget *widg *textRect = tr; } -#endif //QT_NO_TABBAR +#endif // QT_CONFIG(tabbar) QAquaWidgetSize QMacStylePrivate::effectiveAquaSizeConstrain(const QStyleOption *option, const QWidget *widg, @@ -2293,7 +2295,7 @@ void QMacStyle::polish(QWidget* w) } #endif -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) if (QTabBar *tb = qobject_cast(w)) { if (tb->documentMode()) { w->setAttribute(Qt::WA_Hover); @@ -2345,7 +2347,7 @@ void QMacStyle::unpolish(QWidget* w) } #endif -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) if (qobject_cast(w)) { if (!w->testAttribute(Qt::WA_SetFont)) w->setFont(qApp->font(w)); @@ -2870,7 +2872,7 @@ int QMacStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget *w ret = QEvent::MouseButtonRelease; break; case SH_TabBar_SelectMouseType: -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) if (const QStyleOptionTabBarBase *opt2 = qstyleoption_cast(opt)) { ret = opt2->documentMode ? QEvent::MouseButtonPress : QEvent::MouseButtonRelease; } else @@ -2903,7 +2905,7 @@ int QMacStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget *w } } #endif -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) if (const QTabBar *tab = qobject_cast(w)) { if (tab->documentMode()) { ret = Qt::AlignLeft; @@ -3080,7 +3082,7 @@ int QMacStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget *w case SH_ItemView_PaintAlternatingRowColorsForEmptyArea: ret = true; break; -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) case SH_TabBar_CloseButtonPosition: ret = QTabBar::LeftSide; break; @@ -3236,7 +3238,7 @@ void QMacStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPai p->drawPath(path); p->restore(); break; } -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) case PE_FrameTabBarBase: if (const QStyleOptionTabBarBase *tbb = qstyleoption_cast(opt)) { @@ -4135,7 +4137,7 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter QCommonStyle::drawControl(CE_ComboBoxLabel, &comboCopy, p, w); } break; -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) case CE_TabBarTabShape: if (const QStyleOptionTab *tabOpt = qstyleoption_cast(opt)) { if (tabOpt->documentMode) { @@ -6663,7 +6665,7 @@ QSize QMacStyle::sizeFromContents(ContentsType ct, const QStyleOption *opt, } #endif break; -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) case QStyle::CT_TabBarTab: if (const QStyleOptionTab *tab = qstyleoption_cast(opt)) { const QAquaWidgetSize AquaSize = d->aquaSizeConstrain(opt, widget); diff --git a/src/widgets/styles/qmacstyle_mac_p_p.h b/src/widgets/styles/qmacstyle_mac_p_p.h index e465222137..50596e572d 100644 --- a/src/widgets/styles/qmacstyle_mac_p_p.h +++ b/src/widgets/styles/qmacstyle_mac_p_p.h @@ -244,7 +244,7 @@ public: void drawFocusRing(QPainter *p, const QRect &targetRect, int hMargin, int vMargin, qreal radius = 0) const; -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) void tabLayout(const QStyleOptionTab *opt, const QWidget *widget, QRect *textRect, QRect *iconRect) const; #endif diff --git a/src/widgets/styles/qstyleoption.cpp b/src/widgets/styles/qstyleoption.cpp index ae28dc9374..5d11b86ae7 100644 --- a/src/widgets/styles/qstyleoption.cpp +++ b/src/widgets/styles/qstyleoption.cpp @@ -1231,7 +1231,7 @@ QStyleOptionToolBar::QStyleOptionToolBar(int version) #endif -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) /*! \class QStyleOptionTab \brief The QStyleOptionTab class is used to describe the @@ -1479,7 +1479,7 @@ QStyleOptionTab::QStyleOptionTab(int version) The default value is QSize(-1, -1), i.e. an invalid size; */ -#endif // QT_NO_TABBAR +#endif // QT_CONFIG(tabbar) /*! \class QStyleOptionProgressBar @@ -3436,7 +3436,7 @@ QStyleOptionTabWidgetFrame::QStyleOptionTabWidgetFrame(int version) #endif // QT_CONFIG(tabwidget) -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) /*! \class QStyleOptionTabBarBase @@ -3556,7 +3556,7 @@ QStyleOptionTabBarBase::QStyleOptionTabBarBase(int version) The default value is false; */ -#endif // QT_NO_TABBAR +#endif // QT_CONFIG(tabbar) #ifndef QT_NO_SIZEGRIP /*! diff --git a/src/widgets/styles/qstyleoption.h b/src/widgets/styles/qstyleoption.h index a951596776..af97479ef0 100644 --- a/src/widgets/styles/qstyleoption.h +++ b/src/widgets/styles/qstyleoption.h @@ -47,7 +47,9 @@ #include #include #include +#if QT_CONFIG(tabbar) #include +#endif #if QT_CONFIG(tabwidget) #include #endif @@ -173,7 +175,7 @@ typedef Q_DECL_DEPRECATED QStyleOptionTabWidgetFrame QStyleOptionTabWidgetFrameV #endif // QT_CONFIG(tabwidget) -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) class Q_WIDGETS_EXPORT QStyleOptionTabBarBase : public QStyleOption { public: @@ -193,7 +195,7 @@ protected: }; typedef Q_DECL_DEPRECATED QStyleOptionTabBarBase QStyleOptionTabBarBaseV2; -#endif // QT_NO_TABBAR +#endif // QT_CONFIG(tabbar) class Q_WIDGETS_EXPORT QStyleOptionHeader : public QStyleOption { @@ -247,7 +249,7 @@ protected: Q_DECLARE_OPERATORS_FOR_FLAGS(QStyleOptionButton::ButtonFeatures) -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) class Q_WIDGETS_EXPORT QStyleOptionTab : public QStyleOption { public: @@ -286,7 +288,7 @@ Q_DECLARE_OPERATORS_FOR_FLAGS(QStyleOptionTab::CornerWidgets) typedef Q_DECL_DEPRECATED QStyleOptionTab QStyleOptionTabV2; typedef Q_DECL_DEPRECATED QStyleOptionTab QStyleOptionTabV3; -#endif // QT_NO_TABBAR +#endif // QT_CONFIG(tabbar) #ifndef QT_NO_TOOLBAR diff --git a/src/widgets/styles/qstylesheetstyle.cpp b/src/widgets/styles/qstylesheetstyle.cpp index 2274e5280f..5557dba430 100644 --- a/src/widgets/styles/qstylesheetstyle.cpp +++ b/src/widgets/styles/qstylesheetstyle.cpp @@ -76,7 +76,9 @@ #endif #include #include +#if QT_CONFIG(tabbar) #include +#endif #include #include #if QT_CONFIG(dockwidget) @@ -1912,7 +1914,7 @@ QRenderRule QStyleSheetStyle::renderRule(const QObject *obj, const QStyleOption break; } #endif -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) } else if (const QStyleOptionTab *tab = qstyleoption_cast(opt)) { if (tab->position == QStyleOptionTab::OnlyOneTab) extraClass |= PseudoClass_OnlyOne; @@ -1948,7 +1950,7 @@ QRenderRule QStyleSheetStyle::renderRule(const QObject *obj, const QStyleOption default: break; } -#endif // QT_NO_TABBAR +#endif // QT_CONFIG(tabbar) } else if (const QStyleOptionButton *btn = qstyleoption_cast(opt)) { if (btn->features & QStyleOptionButton::Flat) extraClass |= PseudoClass_Flat; @@ -2425,7 +2427,7 @@ static bool unstylable(const QWidget *w) } #endif -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) if (w->metaObject() == &QWidget::staticMetaObject && qobject_cast(w->parentWidget())) return true; // The moving tab of a QTabBar @@ -2812,7 +2814,7 @@ void QStyleSheetStyle::polish(QWidget *w) #if QT_CONFIG(itemviews) || qobject_cast(w) #endif -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) || qobject_cast(w) #endif #ifndef QT_NO_FRAME @@ -2916,7 +2918,7 @@ void QStyleSheetStyle::unpolish(QApplication *app) styleSheetCaches->styleSheetCache.remove(qApp); } -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) inline static bool verticalTabs(QTabBar::Shape shape) { return shape == QTabBar::RoundedWest @@ -2924,7 +2926,7 @@ inline static bool verticalTabs(QTabBar::Shape shape) || shape == QTabBar::TriangularWest || shape == QTabBar::TriangularEast; } -#endif // QT_NO_TABBAR +#endif // QT_CONFIG(tabbar) void QStyleSheetStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex *opt, QPainter *p, const QWidget *w) const @@ -4092,7 +4094,7 @@ void QStyleSheetStyle::drawControl(ControlElement ce, const QStyleOption *opt, Q break; #endif // QT_CONFIG(itemviews) -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) case CE_TabBarTab: if (hasStyleRule(w, PseudoElement_TabBarTab)) { QWindowsStyle::drawControl(ce, opt, p, w); @@ -4127,7 +4129,7 @@ void QStyleSheetStyle::drawControl(ControlElement ce, const QStyleOption *opt, Q return; } break; -#endif // QT_NO_TABBAR +#endif // QT_CONFIG(tabbar) case CE_ColumnViewGrip: if (rule.hasDrawable()) { @@ -4534,7 +4536,7 @@ void QStyleSheetStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *op case PE_IndicatorSpinPlus: pseudoElement = PseudoElement_SpinBoxUpArrow; break; -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) case PE_IndicatorTabClose: if (w) w = w->parentWidget(); //match on the QTabBar instead of the CloseButton @@ -5055,7 +5057,7 @@ QSize QStyleSheetStyle::sizeFromContents(ContentsType ct, const QStyleOption *op return rule.boxSize(sz); break; -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) case CT_TabBarTab: { QRenderRule subRule = renderRule(w, opt, PseudoElement_TabBarTab); if (subRule.hasBox() || !subRule.hasNativeBorder()) { @@ -5079,7 +5081,7 @@ QSize QStyleSheetStyle::sizeFromContents(ContentsType ct, const QStyleOption *op sz = subRule.adjustSize(csz); break; } -#endif // QT_NO_TABBAR +#endif // QT_CONFIG(tabbar) case CT_MdiControls: if (const QStyleOptionComplex *ccOpt = qstyleoption_cast(opt)) { @@ -5288,7 +5290,7 @@ int QStyleSheetStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWi #endif // QT_CONFIG(tabwidget) s = QLatin1String("alignment"); break; -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) case SH_TabBar_CloseButtonPosition: rule = renderRule(w, opt, PseudoElement_TabBarTabCloseButton); if (rule.hasPosition()) { @@ -5694,7 +5696,7 @@ QRect QStyleSheetStyle::subElementRect(SubElement se, const QStyleOption *opt, c RECURSION_GUARD(return baseStyle()->subElementRect(se, opt, w)) QRenderRule rule = renderRule(w, opt); -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) int pe = PseudoElement_None; #endif @@ -5822,7 +5824,7 @@ QRect QStyleSheetStyle::subElementRect(SubElement se, const QStyleOption *opt, c } break; -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) case SE_TabWidgetLeftCorner: pe = PseudoElement_TabWidgetLeftCorner; // intentionally falls through @@ -5889,7 +5891,7 @@ QRect QStyleSheetStyle::subElementRect(SubElement se, const QStyleOption *opt, c } break; } -#endif // QT_NO_TABBAR +#endif // QT_CONFIG(tabbar) case SE_DockWidgetCloseButton: case SE_DockWidgetFloatButton: { diff --git a/src/widgets/styles/qwindowsstyle.cpp b/src/widgets/styles/qwindowsstyle.cpp index a8c4c33ada..1c51360c1f 100644 --- a/src/widgets/styles/qwindowsstyle.cpp +++ b/src/widgets/styles/qwindowsstyle.cpp @@ -55,7 +55,9 @@ #include "qrubberband.h" #endif #include "qstyleoption.h" +#if QT_CONFIG(tabbar) #include "qtabbar.h" +#endif #include "qwidget.h" #include "qdebug.h" #include "qmainwindow.h" @@ -334,7 +336,7 @@ int QWindowsStylePrivate::fixedPixelMetric(QStyle::PixelMetric pm) break; case QStyle::PM_DockWidgetSeparatorExtent: return 4; -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) case QStyle::PM_TabBarTabShiftHorizontal: return 0; case QStyle::PM_TabBarTabShiftVertical: @@ -1283,7 +1285,7 @@ void QWindowsStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPai } break; #endif // QT_NO_MENUBAR -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) case CE_TabBarTabShape: if (const QStyleOptionTab *tab = qstyleoption_cast(opt)) { bool rtlHorTabs = (tab->direction == Qt::RightToLeft @@ -1486,7 +1488,7 @@ void QWindowsStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPai } } break; -#endif // QT_NO_TABBAR +#endif // QT_CONFIG(tabbar) case CE_ToolBoxTabShape: qDrawShadePanel(p, opt->rect, opt->palette, opt->state & (State_Sunken | State_On), 1, diff --git a/src/widgets/styles/qwindowsxpstyle.cpp b/src/widgets/styles/qwindowsxpstyle.cpp index 3c6b27bf7f..bb2c0688c4 100644 --- a/src/widgets/styles/qwindowsxpstyle.cpp +++ b/src/widgets/styles/qwindowsxpstyle.cpp @@ -58,7 +58,9 @@ #include #include +#if QT_CONFIG(tabbar) #include +#endif #if QT_CONFIG(combobox) #include #endif diff --git a/src/widgets/widgets/qdockarealayout.cpp b/src/widgets/widgets/qdockarealayout.cpp index 742148b7ec..21d1d4cb85 100644 --- a/src/widgets/widgets/qdockarealayout.cpp +++ b/src/widgets/widgets/qdockarealayout.cpp @@ -40,7 +40,9 @@ #include "QtWidgets/qapplication.h" #include "QtWidgets/qwidget.h" +#if QT_CONFIG(tabbar) #include "QtWidgets/qtabbar.h" +#endif #include "QtWidgets/qstyle.h" #include "QtWidgets/qdesktopwidget.h" #include "QtWidgets/qapplication.h" @@ -212,7 +214,7 @@ QDockAreaLayoutItem ** QDockAreaLayoutInfo */ -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) static quintptr tabId(const QDockAreaLayoutItem &item) { if (item.widgetItem == 0) @@ -225,7 +227,7 @@ static const int zero = 0; QDockAreaLayoutInfo::QDockAreaLayoutInfo() : sep(&zero), dockPos(QInternal::LeftDock), o(Qt::Horizontal), mainWindow(0) -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) , tabbed(false), tabBar(0), tabBarShape(QTabBar::RoundedSouth) #endif { @@ -235,11 +237,11 @@ QDockAreaLayoutInfo::QDockAreaLayoutInfo(const int *_sep, QInternal::DockPositio Qt::Orientation _o, int tbshape, QMainWindow *window) : sep(_sep), dockPos(_dockPos), o(_o), mainWindow(window) -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) , tabbed(false), tabBar(0), tabBarShape(static_cast(tbshape)) #endif { -#ifdef QT_NO_TABBAR +#if !QT_CONFIG(tabbar) Q_UNUSED(tbshape); #endif } @@ -253,7 +255,7 @@ void QDockAreaLayoutInfo::clear() { item_list.clear(); rect = QRect(); -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) tabbed = false; tabBar = 0; #endif @@ -287,7 +289,7 @@ QSize QDockAreaLayoutInfo::minimumSize() const continue; QSize min_size = item.minimumSize(); -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) if (tabbed) { a = qMax(a, pick(o, min_size)); } else @@ -306,7 +308,7 @@ QSize QDockAreaLayoutInfo::minimumSize() const rpick(o, result) = a; rperp(o, result) = b; -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) QSize tbm = tabBarMinimumSize(); if (!tbm.isNull()) { switch (tabBarShape) { @@ -328,7 +330,7 @@ QSize QDockAreaLayoutInfo::minimumSize() const break; } } -#endif // QT_NO_TABBAR +#endif // QT_CONFIG(tabbar) return result; } @@ -339,7 +341,7 @@ QSize QDockAreaLayoutInfo::maximumSize() const return QSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX); int a = 0, b = QWIDGETSIZE_MAX; -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) if (tabbed) a = QWIDGETSIZE_MAX; #endif @@ -355,7 +357,7 @@ QSize QDockAreaLayoutInfo::maximumSize() const QSize max_size = item.maximumSize(); min_perp = qMax(min_perp, perp(o, item.minimumSize())); -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) if (tabbed) { a = qMin(a, pick(o, max_size)); } else @@ -379,7 +381,7 @@ QSize QDockAreaLayoutInfo::maximumSize() const rpick(o, result) = a; rperp(o, result) = b; -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) QSize tbh = tabBarSizeHint(); if (!tbh.isNull()) { switch (tabBarShape) { @@ -395,7 +397,7 @@ QSize QDockAreaLayoutInfo::maximumSize() const break; } } -#endif // QT_NO_TABBAR +#endif // QT_CONFIG(tabbar) return result; } @@ -420,7 +422,7 @@ QSize QDockAreaLayoutInfo::sizeHint() const min_perp = qMax(min_perp, perp(o, item.minimumSize())); max_perp = qMin(max_perp, perp(o, item.maximumSize())); -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) if (tabbed) { a = qMax(a, gap ? item.size : pick(o, size_hint)); } else @@ -445,7 +447,7 @@ QSize QDockAreaLayoutInfo::sizeHint() const rpick(o, result) = a; rperp(o, result) = b; -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) if (tabbed) { QSize tbh = tabBarSizeHint(); switch (tabBarShape) { @@ -467,7 +469,7 @@ QSize QDockAreaLayoutInfo::sizeHint() const break; } } -#endif // QT_NO_TABBAR +#endif // QT_CONFIG(tabbar) return result; } @@ -543,7 +545,7 @@ static int realMaxSize(const QDockAreaLayoutInfo &info) void QDockAreaLayoutInfo::fitItems() { -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) if (tabbed) { return; } @@ -757,7 +759,7 @@ QList QDockAreaLayoutInfo::gapIndex(const QPoint& _pos, QRect item_rect; int item_index = 0; -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) if (tabbed) { item_rect = tabContentRect(); } else @@ -777,7 +779,7 @@ QList QDockAreaLayoutInfo::gapIndex(const QPoint& _pos, continue; if (item.subinfo != 0 -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) && !item.subinfo->tabbed #endif ) { @@ -939,7 +941,7 @@ static int separatorMoveHelper(QVector &list, int index, int delt int QDockAreaLayoutInfo::separatorMove(int index, int delta) { -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) Q_ASSERT(!tabbed); #endif @@ -1045,7 +1047,7 @@ QLayoutItem *QDockAreaLayoutInfo::plug(const QList &path) QRect result; -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) if (tabbed) { } else #endif @@ -1090,7 +1092,7 @@ QLayoutItem *QDockAreaLayoutInfo::unplug(const QList &path) Q_ASSERT(!(item.flags & QDockAreaLayoutItem::GapItem)); item.flags |= QDockAreaLayoutItem::GapItem; -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) if (tabbed) { } else #endif @@ -1106,7 +1108,7 @@ QLayoutItem *QDockAreaLayoutInfo::unplug(const QList &path) return item.widgetItem; } -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) quintptr QDockAreaLayoutInfo::currentTabId() const { @@ -1138,7 +1140,7 @@ void QDockAreaLayoutInfo::setCurrentTabId(quintptr id) } } -#endif // QT_NO_TABBAR +#endif // QT_CONFIG(tabbar) static QRect dockedGeometry(QWidget *widget) { @@ -1171,7 +1173,7 @@ bool QDockAreaLayoutInfo::insertGap(const QList &path, QLayoutItem *dockWid QDockAreaLayoutItem &item = item_list[index]; if (item.subinfo == 0 -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) || (item.subinfo->tabbed && !insert_tabbed) #endif ) { @@ -1184,7 +1186,7 @@ bool QDockAreaLayoutInfo::insertGap(const QList &path, QLayoutItem *dockWid QRect r = subinfo == 0 ? widgetItem ? dockedGeometry(widgetItem->widget()) : placeHolderItem->topLevelRect : subinfo->rect; Qt::Orientation opposite = o == Qt::Horizontal ? Qt::Vertical : Qt::Horizontal; -#ifdef QT_NO_TABBAR +#if !QT_CONFIG(tabbar) const int tabBarShape = 0; #endif QDockAreaLayoutInfo *new_info @@ -1202,7 +1204,7 @@ bool QDockAreaLayoutInfo::insertGap(const QList &path, QLayoutItem *dockWid new_item.size = pick(opposite, r.size()); new_item.pos = pick(opposite, r.topLeft()); new_info->item_list.append(new_item); -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) if (insert_tabbed) { new_info->tabbed = true; } @@ -1217,7 +1219,7 @@ bool QDockAreaLayoutInfo::insertGap(const QList &path, QLayoutItem *dockWid gap_item.flags |= QDockAreaLayoutItem::GapItem; gap_item.widgetItem = dockWidgetItem; // so minimumSize(), maximumSize() and // sizeHint() will work -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) if (!tabbed) #endif { @@ -1292,7 +1294,7 @@ QDockAreaLayoutInfo *QDockAreaLayoutInfo::info(QWidget *widget) if (item.skip()) continue; -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) if (tabbed && widget == tabBar) return this; #endif @@ -1330,7 +1332,7 @@ QRect QDockAreaLayoutInfo::itemRect(int index) const QRect result; -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) if (tabbed) { if (tabId(item) == currentTabId()) result = tabContentRect(); @@ -1365,7 +1367,7 @@ QRect QDockAreaLayoutInfo::itemRect(const QList &path) const QRect QDockAreaLayoutInfo::separatorRect(int index) const { -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) if (tabbed) return QRect(); #endif @@ -1397,7 +1399,7 @@ QRect QDockAreaLayoutInfo::separatorRect(const QList &path) const QList QDockAreaLayoutInfo::findSeparator(const QPoint &_pos) const { -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) if (tabbed) return QList(); #endif @@ -1508,7 +1510,7 @@ QDockWidget *QDockAreaLayoutInfo::apply(bool animate) { QWidgetAnimator &widgetAnimator = mainWindowLayout()->widgetAnimator; -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) if (tabbed) { QRect tab_rect; QSize tbh = tabBarSizeHint(); @@ -1541,7 +1543,7 @@ QDockWidget *QDockAreaLayoutInfo::apply(bool animate) widgetAnimator.animate(tabBar, tab_rect, animate); } -#endif // QT_NO_TABBAR +#endif // QT_CONFIG(tabbar) QDockWidget *activated = nullptr; @@ -1577,10 +1579,10 @@ QDockWidget *QDockAreaLayoutInfo::apply(bool animate) } } } -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) if (*sep == 1) updateSeparatorWidgets(); -#endif //QT_NO_TABBAR +#endif // QT_CONFIG(tabbar) return activated; } @@ -1607,7 +1609,7 @@ QRegion QDockAreaLayoutInfo::separatorRegion() const if (isEmpty()) return result; -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) if (tabbed) return result; #endif @@ -1637,7 +1639,7 @@ void QDockAreaLayoutInfo::paintSeparators(QPainter *p, QWidget *widget, { if (isEmpty()) return; -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) if (tabbed) return; #endif @@ -1686,7 +1688,7 @@ int QDockAreaLayoutInfo::prev(int index) const void QDockAreaLayoutInfo::tab(int index, QLayoutItem *dockWidgetItem) { -#ifdef QT_NO_TABBAR +#if !QT_CONFIG(tabbar) Q_UNUSED(index); Q_UNUSED(dockWidgetItem); #else @@ -1705,7 +1707,7 @@ void QDockAreaLayoutInfo::tab(int index, QLayoutItem *dockWidgetItem) new_info->updateTabBar(); new_info->setCurrentTab(dockWidgetItem->widget()); } -#endif // QT_NO_TABBAR +#endif // QT_CONFIG(tabbar) } void QDockAreaLayoutInfo::split(int index, Qt::Orientation orientation, @@ -1714,7 +1716,7 @@ void QDockAreaLayoutInfo::split(int index, Qt::Orientation orientation, if (orientation == o) { item_list.insert(index + 1, QDockAreaLayoutItem(dockWidgetItem)); } else { -#ifdef QT_NO_TABBAR +#if !QT_CONFIG(tabbar) const int tabBarShape = 0; #endif QDockAreaLayoutInfo *new_info @@ -1795,7 +1797,7 @@ void QDockAreaLayoutInfo::deleteAllLayoutItems() void QDockAreaLayoutInfo::saveState(QDataStream &stream) const { -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) if (tabbed) { stream << (uchar) TabMarker; @@ -1810,7 +1812,7 @@ void QDockAreaLayoutInfo::saveState(QDataStream &stream) const } stream << index; } else -#endif // QT_NO_TABBAR +#endif // QT_CONFIG(tabbar) { stream << (uchar) SequenceMarker; } @@ -1884,7 +1886,7 @@ bool QDockAreaLayoutInfo::restoreState(QDataStream &stream, QList if (marker != TabMarker && marker != SequenceMarker) return false; -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) tabbed = marker == TabMarker; int index = -1; @@ -1989,7 +1991,7 @@ bool QDockAreaLayoutInfo::restoreState(QDataStream &stream, QList } } else if (nextMarker == SequenceMarker) { int dummy; -#ifdef QT_NO_TABBAR +#if !QT_CONFIG(tabbar) const int tabBarShape = 0; #endif QDockAreaLayoutItem item(new QDockAreaLayoutInfo(sep, dockPos, o, @@ -2010,7 +2012,7 @@ bool QDockAreaLayoutInfo::restoreState(QDataStream &stream, QList } } -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) if (!testing && tabbed && index >= 0 && index < item_list.count()) { updateTabBar(); setCurrentTabId(tabId(item_list.at(index))); @@ -2022,7 +2024,7 @@ bool QDockAreaLayoutInfo::restoreState(QDataStream &stream, QList return true; } -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) void QDockAreaLayoutInfo::updateSeparatorWidgets() const { if (tabbed) { @@ -2073,9 +2075,7 @@ void QDockAreaLayoutInfo::updateSeparatorWidgets() const separatorWidgets.resize(j); Q_ASSERT(separatorWidgets.size() == j); } -#endif //QT_NO_TABBAR -#ifndef QT_NO_TABBAR /*! \internal reparent all the widgets contained in this layout portion to the specified parent. This is used to reparent dock widgets and tabbars @@ -2301,7 +2301,7 @@ void QDockAreaLayoutInfo::moveTab(int from, int to) { item_list.move(tabIndexToListIndex(from), tabIndexToListIndex(to)); } -#endif // QT_NO_TABBAR +#endif // QT_CONFIG(tabbar) /****************************************************************************** ** QDockAreaLayout @@ -2311,7 +2311,7 @@ QDockAreaLayout::QDockAreaLayout(QMainWindow *win) : fallbackToSizeHints(true) { mainWindow = win; sep = win->style()->pixelMetric(QStyle::PM_DockWidgetSeparatorExtent, 0, win); -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) const int tabShape = QTabBar::RoundedSouth; #else const int tabShape = 0; @@ -2431,7 +2431,7 @@ QList QDockAreaLayout::gapIndex(const QPoint &pos) const QMainWindow::DockOptions opts = mainWindow->dockOptions(); bool nestingEnabled = opts & QMainWindow::AllowNestedDocks; QDockAreaLayoutInfo::TabMode tabMode = QDockAreaLayoutInfo::NoTabs; -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) if (opts & QMainWindow::AllowTabbedDocks || opts & QMainWindow::VerticalTabs) tabMode = QDockAreaLayoutInfo::AllowTabs; @@ -3122,14 +3122,14 @@ void QDockAreaLayout::addDockWidget(QInternal::DockPosition pos, QDockWidget *do QDockAreaLayoutItem new_item(dockWidgetItem); info.item_list.append(new_item); -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) if (info.tabbed && !new_item.skip()) { info.updateTabBar(); info.setCurrentTabId(tabId(new_item)); } #endif } else { -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) int tbshape = info.tabBarShape; #else int tbshape = 0; @@ -3230,10 +3230,10 @@ void QDockAreaLayout::apply(bool animate) widgetAnimator.animate(centralWidgetItem->widget(), centralWidgetRect, animate); } -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) if (sep == 1) updateSeparatorWidgets(); -#endif //QT_NO_TABBAR +#endif // QT_CONFIG(tabbar) } void QDockAreaLayout::paintSeparators(QPainter *p, QWidget *widget, @@ -3311,7 +3311,7 @@ int QDockAreaLayout::separatorMove(const QList &separator, const QPoint &or return delta; } -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) // Sets the correct positions for the separator widgets // Allocates new sepearator widgets with getSeparatorWidget void QDockAreaLayout::updateSeparatorWidgets() const @@ -3345,7 +3345,7 @@ void QDockAreaLayout::updateSeparatorWidgets() const separatorWidgets.resize(j); } -#endif //QT_NO_TABBAR +#endif // QT_CONFIG(tabbar) QLayoutItem *QDockAreaLayout::itemAt(int *x, int index) const { @@ -3388,7 +3388,7 @@ void QDockAreaLayout::deleteAllLayoutItems() docks[i].deleteAllLayoutItems(); } -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) QSet QDockAreaLayout::usedTabBars() const { QSet result; @@ -3431,7 +3431,7 @@ QRect QDockAreaLayout::gapRect(const QList &path) const QRect result; -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) if (info->tabbed) { result = info->tabContentRect(); } else diff --git a/src/widgets/widgets/qdockarealayout_p.h b/src/widgets/widgets/qdockarealayout_p.h index e7bfc305ca..82244c192e 100644 --- a/src/widgets/widgets/qdockarealayout_p.h +++ b/src/widgets/widgets/qdockarealayout_p.h @@ -196,12 +196,10 @@ public: QRect rect; QMainWindow *mainWindow; QList item_list; -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) void updateSeparatorWidgets() const; QSet usedSeparatorWidgets() const; -#endif //QT_NO_TABBAR -#ifndef QT_NO_TABBAR quintptr currentTabId() const; void setCurrentTab(QWidget *widget); void setCurrentTabId(quintptr id); @@ -220,7 +218,7 @@ public: int tabIndexToListIndex(int) const; void moveTab(int from, int to); -#endif // QT_NO_TABBAR +#endif // QT_CONFIG(tabbar) }; class Q_AUTOTEST_EXPORT QDockAreaLayout @@ -285,9 +283,9 @@ public: const QPoint &mouse) const; QRegion separatorRegion() const; int separatorMove(const QList &separator, const QPoint &origin, const QPoint &dest); -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) void updateSeparatorWidgets() const; -#endif //QT_NO_TABBAR +#endif // QT_CONFIG(tabbar) QLayoutItem *itemAt(int *x, int index) const; QLayoutItem *takeAt(int *x, int index); @@ -301,10 +299,10 @@ public: QRect gapRect(const QList &path) const; void keepSize(QDockWidget *w); -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) QSet usedTabBars() const; QSet usedSeparatorWidgets() const; -#endif //QT_NO_TABBAR +#endif // QT_CONFIG(tabbar) void styleChangedEvent(); }; diff --git a/src/widgets/widgets/qdockwidget.cpp b/src/widgets/widgets/qdockwidget.cpp index 12235e48b7..2d5ee68f8e 100644 --- a/src/widgets/widgets/qdockwidget.cpp +++ b/src/widgets/widgets/qdockwidget.cpp @@ -1397,14 +1397,14 @@ void QDockWidget::changeEvent(QEvent *event) d->fixedWindowTitle = qt_setWindowTitle_helperHelper(windowTitle(), this); d->toggleViewAction->setText(d->fixedWindowTitle); #endif -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) { if (QMainWindowLayout *winLayout = qt_mainwindow_layout_from_dock(this)) { if (QDockAreaLayoutInfo *info = winLayout->layoutState.dockAreaLayout.info(this)) info->updateTabBar(); } } -#endif // QT_NO_TABBAR +#endif // QT_CONFIG(tabbar) break; default: break; diff --git a/src/widgets/widgets/qmainwindow.cpp b/src/widgets/widgets/qmainwindow.cpp index 5b9d728b86..271465ec00 100644 --- a/src/widgets/widgets/qmainwindow.cpp +++ b/src/widgets/widgets/qmainwindow.cpp @@ -1019,7 +1019,7 @@ static bool checkDockWidgetArea(Qt::DockWidgetArea area, const char *where) return false; } -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) /*! \property QMainWindow::documentMode \brief whether the tab bar for tabbed dockwidgets is set to document mode. @@ -1038,7 +1038,7 @@ void QMainWindow::setDocumentMode(bool enabled) { d_func()->layout->setDocumentMode(enabled); } -#endif // QT_NO_TABBAR +#endif // QT_CONFIG(tabbar) #if QT_CONFIG(tabwidget) /*! @@ -1210,7 +1210,7 @@ void QMainWindow::tabifyDockWidget(QDockWidget *first, QDockWidget *second) QList QMainWindow::tabifiedDockWidgets(QDockWidget *dockwidget) const { QList ret; -#if defined(QT_NO_TABBAR) +#if !QT_CONFIG(tabbar) Q_UNUSED(dockwidget); #else const QDockAreaLayoutInfo *info = d_func()->layout->layoutState.dockAreaLayout.info(dockwidget); diff --git a/src/widgets/widgets/qmainwindow.h b/src/widgets/widgets/qmainwindow.h index 3c808ac669..aa26d4c23b 100644 --- a/src/widgets/widgets/qmainwindow.h +++ b/src/widgets/widgets/qmainwindow.h @@ -66,9 +66,9 @@ class Q_WIDGETS_EXPORT QMainWindow : public QWidget Q_PROPERTY(Qt::ToolButtonStyle toolButtonStyle READ toolButtonStyle WRITE setToolButtonStyle) #if QT_CONFIG(dockwidget) Q_PROPERTY(bool animated READ isAnimated WRITE setAnimated) -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) Q_PROPERTY(bool documentMode READ documentMode WRITE setDocumentMode) -#endif // QT_NO_TABBAR +#endif // QT_CONFIG(tabbar) #if QT_CONFIG(tabwidget) Q_PROPERTY(QTabWidget::TabShape tabShape READ tabShape WRITE setTabShape) #endif // QT_CONFIG(tabwidget) @@ -106,7 +106,7 @@ public: bool isDockNestingEnabled() const; #endif -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) bool documentMode() const; void setDocumentMode(bool enabled); #endif diff --git a/src/widgets/widgets/qmainwindowlayout.cpp b/src/widgets/widgets/qmainwindowlayout.cpp index 3d716046c0..c0ad4e697d 100644 --- a/src/widgets/widgets/qmainwindowlayout.cpp +++ b/src/widgets/widgets/qmainwindowlayout.cpp @@ -54,7 +54,9 @@ #if QT_CONFIG(rubberband) #include "qrubberband.h" #endif +#if QT_CONFIG(tabbar) #include "qtabbar_p.h" +#endif #include #include @@ -883,7 +885,7 @@ void QMainWindowLayoutState::saveState(QDataStream &stream) const { #if QT_CONFIG(dockwidget) dockAreaLayout.saveState(stream); -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) QList floatingTabs = mainWindow->findChildren(QString(), Qt::FindDirectChildrenOnly); @@ -963,7 +965,7 @@ bool QMainWindowLayoutState::checkFormat(QDataStream &stream) } } break; -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) case QDockAreaLayout::FloatingDockWidgetTabMarker: { QRect geom; @@ -974,7 +976,7 @@ bool QMainWindowLayoutState::checkFormat(QDataStream &stream) return false; } break; -#endif // QT_NO_TABBAR +#endif // QT_CONFIG(tabbar) #endif // QT_CONFIG(dockwidget) default: //there was an error during the parsing @@ -1444,7 +1446,7 @@ bool QMainWindowLayout::restoreDockWidget(QDockWidget *dockwidget) return true; } -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) bool QMainWindowLayout::documentMode() const { return _documentMode; @@ -1463,11 +1465,11 @@ void QMainWindowLayout::setDocumentMode(bool enabled) foreach (QTabBar *bar, unusedTabBars) bar->setDocumentMode(_documentMode); } -#endif // QT_NO_TABBAR +#endif // QT_CONFIG(tabbar) void QMainWindowLayout::setVerticalTabsEnabled(bool enabled) { -#ifdef QT_NO_TABBAR +#if !QT_CONFIG(tabbar) Q_UNUSED(enabled); #else if (verticalTabsEnabled == enabled) @@ -1476,7 +1478,7 @@ void QMainWindowLayout::setVerticalTabsEnabled(bool enabled) verticalTabsEnabled = enabled; updateTabBarShapes(); -#endif // QT_NO_TABBAR +#endif // QT_CONFIG(tabbar) } #if QT_CONFIG(tabwidget) @@ -1537,7 +1539,7 @@ static inline QTabBar::Shape tabBarShapeFrom(QTabWidget::TabShape shape, QTabWid } #endif // QT_CONFIG(tabwidget) -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) void QMainWindowLayout::updateTabBarShapes() { #if QT_CONFIG(tabwidget) @@ -1568,7 +1570,7 @@ void QMainWindowLayout::updateTabBarShapes() layout.docks[i].setTabBarShape(shape); } } -#endif // QT_NO_TABBAR +#endif // QT_CONFIG(tabbar) void QMainWindowLayout::splitDockWidget(QDockWidget *after, QDockWidget *dockwidget, @@ -1593,7 +1595,7 @@ void QMainWindowLayout::keepSize(QDockWidget *w) layoutState.dockAreaLayout.keepSize(w); } -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) // Handle custom tooltip, and allow to drag tabs away. class QMainWindowTabBar : public QTabBar @@ -1778,7 +1780,7 @@ void QMainWindowLayout::tabMoved(int from, int to) info->moveTab(from, to); } -#endif // QT_NO_TABBAR +#endif // QT_CONFIG(tabbar) bool QMainWindowLayout::startSeparatorMove(const QPoint &pos) { @@ -1815,7 +1817,7 @@ bool QMainWindowLayout::endSeparatorMove(const QPoint&) void QMainWindowLayout::raise(QDockWidget *widget) { -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) QDockAreaLayoutInfo *info = dockInfo(widget); if (info == 0) return; @@ -2220,7 +2222,7 @@ void QMainWindowLayout::animationFinished(QWidget *widget) layoutState.apply(false); #if QT_CONFIG(dockwidget) -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) if (qobject_cast(widget) != 0) { // info() might return null if the widget is destroyed while // animating but before the animationFinished signal is received. @@ -2235,10 +2237,10 @@ void QMainWindowLayout::animationFinished(QWidget *widget) //all animations are finished #if QT_CONFIG(dockwidget) parentWidget()->update(layoutState.dockAreaLayout.separatorRegion()); -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) foreach (QTabBar *tab_bar, usedTabBars) tab_bar->show(); -#endif // QT_NO_TABBAR +#endif // QT_CONFIG(tabbar) #endif // QT_CONFIG(dockwidget) } @@ -2266,7 +2268,7 @@ QMainWindowLayout::QMainWindowLayout(QMainWindow *mainwindow, QLayout *parentLay , dockOptions(QMainWindow::AnimatedDocks | QMainWindow::AllowTabbedDocks) , statusbar(0) #if QT_CONFIG(dockwidget) -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) , _documentMode(false) , verticalTabsEnabled(false) #if QT_CONFIG(tabwidget) @@ -2284,7 +2286,7 @@ QMainWindowLayout::QMainWindowLayout(QMainWindow *mainwindow, QLayout *parentLay setParent(parentLayout); #if QT_CONFIG(dockwidget) -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) sep = mainwindow->style()->pixelMetric(QStyle::PM_DockWidgetSeparatorExtent, 0, mainwindow); #endif @@ -2371,7 +2373,7 @@ void QMainWindowLayout::setCentralWidget(QWidget *widget) */ QLayoutItem *QMainWindowLayout::unplug(QWidget *widget, bool group) { -#if QT_CONFIG(dockwidget) && !defined(QT_NO_TABBAR) +#if QT_CONFIG(dockwidget) && QT_CONFIG(tabbar) if (!widget->isWindow() && qobject_cast(widget->parentWidget())) { if (group) { // We are just dragging a floating window as it, not need to do anything, we just have to @@ -2670,7 +2672,7 @@ bool QMainWindowLayout::restoreState(QDataStream &stream) #if QT_CONFIG(dockwidget) if (parentWidget()->isVisible()) { -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) foreach (QTabBar *tab_bar, usedTabBars) tab_bar->show(); diff --git a/src/widgets/widgets/qmainwindowlayout_p.h b/src/widgets/widgets/qmainwindowlayout_p.h index a7ae76eb69..ed0c6b96c5 100644 --- a/src/widgets/widgets/qmainwindowlayout_p.h +++ b/src/widgets/widgets/qmainwindowlayout_p.h @@ -57,7 +57,9 @@ #ifndef QT_NO_MAINWINDOW #include "QtWidgets/qlayout.h" +#if QT_CONFIG(tabbar) #include "QtWidgets/qtabbar.h" +#endif #include "QtCore/qvector.h" #include "QtCore/qset.h" #include "QtCore/qbasictimer.h" @@ -234,7 +236,7 @@ public: void setVerticalTabsEnabled(bool enabled); bool restoreDockWidget(QDockWidget *dockwidget); -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) QDockAreaLayoutInfo *dockInfo(QWidget *w); bool _documentMode; bool documentMode() const; @@ -261,7 +263,7 @@ public: QDockWidgetGroupWindow *createTabbedDockWindow(); #endif // QT_CONFIG(tabwidget) -#endif // QT_NO_TABBAR +#endif // QT_CONFIG(tabbar) // separators @@ -324,13 +326,13 @@ public: private Q_SLOTS: void updateGapIndicator(); #if QT_CONFIG(dockwidget) -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) void tabChanged(); void tabMoved(int from, int to); #endif #endif private: -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) void updateTabBarShapes(); #endif #if 0 // Used to be included in Qt4 for Q_WS_MAC diff --git a/src/widgets/widgets/qmdiarea.cpp b/src/widgets/widgets/qmdiarea.cpp index 2e0ecd4831..513011f0ad 100644 --- a/src/widgets/widgets/qmdiarea.cpp +++ b/src/widgets/widgets/qmdiarea.cpp @@ -564,7 +564,7 @@ QPoint MinOverlapPlacer::place(const QSize &size, const QVector &rects, return findBestPlacement(domain, rects, candidates); } -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) class QMdiAreaTabBar : public QTabBar { public: @@ -662,7 +662,7 @@ QMdiSubWindow *QMdiAreaTabBar::subWindowFromIndex(int index) const return subWindow; } -#endif // QT_NO_TABBAR +#endif // QT_CONFIG(tabbar) /*! \internal @@ -675,12 +675,12 @@ QMdiAreaPrivate::QMdiAreaPrivate() #if QT_CONFIG(rubberband) rubberBand(0), #endif -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) tabBar(0), #endif activationOrder(QMdiArea::CreationOrder), viewMode(QMdiArea::SubWindowView), -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) documentMode(false), tabsClosable(false), tabsMovable(false), @@ -780,7 +780,7 @@ void QMdiAreaPrivate::_q_processWindowStateChanged(Qt::WindowStates oldState, void QMdiAreaPrivate::_q_currentTabChanged(int index) { -#ifdef QT_NO_TABBAR +#if !QT_CONFIG(tabbar) Q_UNUSED(index); #else if (!tabBar || index < 0) @@ -799,28 +799,28 @@ void QMdiAreaPrivate::_q_currentTabChanged(int index) QMdiSubWindow *subWindow = childWindows.at(index); Q_ASSERT(subWindow); activateWindow(subWindow); -#endif // QT_NO_TABBAR +#endif // QT_CONFIG(tabbar) } void QMdiAreaPrivate::_q_closeTab(int index) { -#ifdef QT_NO_TABBAR +#if !QT_CONFIG(tabbar) Q_UNUSED(index); #else QMdiSubWindow *subWindow = childWindows.at(index); Q_ASSERT(subWindow); subWindow->close(); -#endif // QT_NO_TABBAR +#endif // QT_CONFIG(tabbar) } void QMdiAreaPrivate::_q_moveTab(int from, int to) { -#ifdef QT_NO_TABBAR +#if !QT_CONFIG(tabbar) Q_UNUSED(from); Q_UNUSED(to); #else childWindows.move(from, to); -#endif // QT_NO_TABBAR +#endif // QT_CONFIG(tabbar) } /*! @@ -858,7 +858,7 @@ void QMdiAreaPrivate::appendChild(QMdiSubWindow *child) indicesToActivatedChildren.prepend(childWindows.size() - 1); Q_ASSERT(indicesToActivatedChildren.size() == childWindows.size()); -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) if (tabBar) { tabBar->addTab(child->windowIcon(), tabTextFor(child)); updateTabBarGeometry(); @@ -1082,7 +1082,7 @@ void QMdiAreaPrivate::emitWindowActivated(QMdiSubWindow *activeWindow) aboutToBecomeActive = 0; Q_ASSERT(active->d_func()->isActive); -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) if (tabBar && tabBar->currentIndex() != indexToActiveWindow) tabBar->setCurrentIndex(indexToActiveWindow); #endif @@ -1125,7 +1125,7 @@ void QMdiAreaPrivate::updateActiveWindow(int removedIndex, bool activeRemoved) { Q_ASSERT(indicesToActivatedChildren.size() == childWindows.size()); -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) if (tabBar && removedIndex >= 0) { const QSignalBlocker blocker(tabBar); tabBar->removeTab(removedIndex); @@ -1563,7 +1563,7 @@ void QMdiAreaPrivate::setViewMode(QMdiArea::ViewMode mode) // Just a guard since we cannot set viewMode = mode here. inViewModeChange = true; -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) if (mode == QMdiArea::TabbedView) { Q_ASSERT(!tabBar); tabBar = new QMdiAreaTabBar(q); @@ -1604,12 +1604,12 @@ void QMdiAreaPrivate::setViewMode(QMdiArea::ViewMode mode) QObject::connect(tabBar, SIGNAL(tabCloseRequested(int)), q, SLOT(_q_closeTab(int))); QObject::connect(tabBar, SIGNAL(tabMoved(int,int)), q, SLOT(_q_moveTab(int,int))); } else -#endif // QT_NO_TABBAR +#endif // QT_CONFIG(tabbar) { // SubWindowView -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) delete tabBar; tabBar = 0; -#endif // QT_NO_TABBAR +#endif // QT_CONFIG(tabbar) viewMode = mode; q->setViewportMargins(0, 0, 0, 0); @@ -1624,7 +1624,7 @@ void QMdiAreaPrivate::setViewMode(QMdiArea::ViewMode mode) inViewModeChange = false; } -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) /*! \internal */ @@ -1696,7 +1696,7 @@ void QMdiAreaPrivate::refreshTabBar() #endif updateTabBarGeometry(); } -#endif // QT_NO_TABBAR +#endif // QT_CONFIG(tabbar) /*! Constructs an empty mdi area. \a parent is passed to QWidget's @@ -2141,7 +2141,7 @@ void QMdiArea::setViewMode(ViewMode mode) d->setViewMode(mode); } -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) /*! \property QMdiArea::documentMode \brief whether the tab bar is set to document mode in tabbed view mode. @@ -2216,7 +2216,7 @@ void QMdiArea::setTabsMovable(bool movable) d->tabsMovable = movable; d->refreshTabBar(); } -#endif // QT_NO_TABBAR +#endif // QT_CONFIG(tabbar) #if QT_CONFIG(tabwidget) /*! @@ -2297,7 +2297,7 @@ void QMdiArea::resizeEvent(QResizeEvent *resizeEvent) return; } -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) d->updateTabBarGeometry(); #endif @@ -2535,7 +2535,7 @@ bool QMdiArea::event(QEvent *event) d->setActive(d->active, false, false); d->setChildActivationEnabled(false); break; -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) case QEvent::LayoutDirectionChange: d->updateTabBarGeometry(); break; @@ -2632,13 +2632,13 @@ bool QMdiArea::eventFilter(QObject *object, QEvent *event) d->isSubWindowsTiled = false; break; case QEvent::Show: -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) if (d->tabBar) { const int tabIndex = d->childWindows.indexOf(subWindow); if (!d->tabBar->isTabEnabled(tabIndex)) d->tabBar->setTabEnabled(tabIndex, true); } -#endif // QT_NO_TABBAR +#endif // QT_CONFIG(tabbar) // fall through case QEvent::Hide: d->isSubWindowsTiled = false; @@ -2649,7 +2649,7 @@ bool QMdiArea::eventFilter(QObject *object, QEvent *event) d->hideRubberBand(); break; #endif -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) case QEvent::WindowTitleChange: case QEvent::ModifiedChange: if (d->tabBar) @@ -2659,7 +2659,7 @@ bool QMdiArea::eventFilter(QObject *object, QEvent *event) if (d->tabBar) d->tabBar->setTabIcon(d->childWindows.indexOf(subWindow), subWindow->windowIcon()); break; -#endif // QT_NO_TABBAR +#endif // QT_CONFIG(tabbar) default: break; } diff --git a/src/widgets/widgets/qmdiarea.h b/src/widgets/widgets/qmdiarea.h index a2cc478856..acc59296b6 100644 --- a/src/widgets/widgets/qmdiarea.h +++ b/src/widgets/widgets/qmdiarea.h @@ -60,7 +60,7 @@ class Q_WIDGETS_EXPORT QMdiArea : public QAbstractScrollArea Q_PROPERTY(QBrush background READ background WRITE setBackground) Q_PROPERTY(WindowOrder activationOrder READ activationOrder WRITE setActivationOrder) Q_PROPERTY(ViewMode viewMode READ viewMode WRITE setViewMode) -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) Q_PROPERTY(bool documentMode READ documentMode WRITE setDocumentMode) Q_PROPERTY(bool tabsClosable READ tabsClosable WRITE setTabsClosable) Q_PROPERTY(bool tabsMovable READ tabsMovable WRITE setTabsMovable) @@ -113,7 +113,7 @@ public: void setViewMode(ViewMode mode); ViewMode viewMode() const; -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) bool documentMode() const; void setDocumentMode(bool enabled); diff --git a/src/widgets/widgets/qmdiarea_p.h b/src/widgets/widgets/qmdiarea_p.h index 6bdbe28b51..10b5de6840 100644 --- a/src/widgets/widgets/qmdiarea_p.h +++ b/src/widgets/widgets/qmdiarea_p.h @@ -158,7 +158,7 @@ public: QMdiArea::WindowOrder activationOrder; QMdiArea::AreaOptions options; QMdiArea::ViewMode viewMode; -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) bool documentMode; bool tabsClosable; bool tabsMovable; @@ -213,7 +213,7 @@ public: QList subWindowList(QMdiArea::WindowOrder, bool reversed = false) const; void disconnectSubWindow(QObject *subWindow); void setViewMode(QMdiArea::ViewMode mode); -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) void updateTabBarGeometry(); void refreshTabBar(); #endif diff --git a/src/widgets/widgets/qmdisubwindow.h b/src/widgets/widgets/qmdisubwindow.h index e2bb533ddf..875c9a22c8 100644 --- a/src/widgets/widgets/qmdisubwindow.h +++ b/src/widgets/widgets/qmdisubwindow.h @@ -138,7 +138,7 @@ private: Q_PRIVATE_SLOT(d_func(), void _q_enterInteractiveMode()) Q_PRIVATE_SLOT(d_func(), void _q_processFocusChanged(QWidget *, QWidget *)) friend class QMdiAreaPrivate; -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) friend class QMdiAreaTabBar; #endif friend class QMdi::ControlContainer; diff --git a/src/widgets/widgets/qtabbar.cpp b/src/widgets/widgets/qtabbar.cpp index 75744c2adb..adaafc7d21 100644 --- a/src/widgets/widgets/qtabbar.cpp +++ b/src/widgets/widgets/qtabbar.cpp @@ -67,8 +67,6 @@ #include "qdebug.h" #include "private/qtabbar_p.h" -#ifndef QT_NO_TABBAR - #if 0 // Used to be included in Qt4 for Q_WS_MAC #include #include @@ -2694,6 +2692,4 @@ QT_END_NAMESPACE #include "moc_qtabbar.cpp" -#endif // QT_NO_TABBAR - #include "moc_qtabbar_p.cpp" diff --git a/src/widgets/widgets/qtabbar.h b/src/widgets/widgets/qtabbar.h index 2a27a98661..ebcd1094ef 100644 --- a/src/widgets/widgets/qtabbar.h +++ b/src/widgets/widgets/qtabbar.h @@ -43,10 +43,9 @@ #include #include -QT_BEGIN_NAMESPACE - +QT_REQUIRE_CONFIG(tabbar); -#ifndef QT_NO_TABBAR +QT_BEGIN_NAMESPACE class QIcon; class QTabBarPrivate; @@ -221,8 +220,6 @@ private: Q_PRIVATE_SLOT(d_func(), void _q_closeTab()) }; -#endif // QT_NO_TABBAR - QT_END_NAMESPACE #endif // QTABBAR_H diff --git a/src/widgets/widgets/qtabbar_p.h b/src/widgets/widgets/qtabbar_p.h index 354c2fc05a..52e139c707 100644 --- a/src/widgets/widgets/qtabbar_p.h +++ b/src/widgets/widgets/qtabbar_p.h @@ -60,12 +60,12 @@ #include #include -#ifndef QT_NO_TABBAR - #define ANIMATION_DURATION 250 #include +QT_REQUIRE_CONFIG(tabbar); + QT_BEGIN_NAMESPACE class QMovableTabWidget : public QWidget @@ -286,9 +286,6 @@ public: void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE; }; - QT_END_NAMESPACE #endif - -#endif diff --git a/src/widgets/widgets/widgets.pri b/src/widgets/widgets/widgets.pri index 83ddba04bb..aed3f53478 100644 --- a/src/widgets/widgets/widgets.pri +++ b/src/widgets/widgets/widgets.pri @@ -34,8 +34,6 @@ HEADERS += \ widgets/qsplitter_p.h \ widgets/qstackedwidget.h \ widgets/qstatusbar.h \ - widgets/qtabbar.h \ - widgets/qtabbar_p.h \ widgets/qtextedit.h \ widgets/qtextedit_p.h \ widgets/qtextbrowser.h \ @@ -81,7 +79,6 @@ SOURCES += \ widgets/qsplitter.cpp \ widgets/qstackedwidget.cpp \ widgets/qstatusbar.cpp \ - widgets/qtabbar.cpp \ widgets/qtextedit.cpp \ widgets/qtextbrowser.cpp \ widgets/qtoolbar.cpp \ @@ -226,6 +223,14 @@ qtConfig(splashscreen) { widgets/qsplashscreen.cpp } +qtConfig(tabbar) { + HEADERS += \ + widgets/qtabbar.h \ + widgets/qtabbar_p.h + + SOURCES += widgets/qtabbar.cpp +} + qtConfig(tabwidget) { HEADERS += widgets/qtabwidget.h SOURCES += widgets/qtabwidget.cpp diff --git a/tests/auto/widgets/widgets/qmainwindow/tst_qmainwindow.cpp b/tests/auto/widgets/widgets/qmainwindow/tst_qmainwindow.cpp index 7942109a0a..292080c55f 100644 --- a/tests/auto/widgets/widgets/qmainwindow/tst_qmainwindow.cpp +++ b/tests/auto/widgets/widgets/qmainwindow/tst_qmainwindow.cpp @@ -47,7 +47,7 @@ #include #include -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) #include #endif @@ -150,7 +150,7 @@ private slots: void QTBUG21378_animationFinished(); void resizeDocks(); void resizeDocks_data(); -#if QT_CONFIG(dockwidget) && !defined(QT_NO_TABBAR) +#if QT_CONFIG(dockwidget) && QT_CONFIG(tabbar) void QTBUG52175_tabifiedDockWidgetActivated(); #endif }; @@ -2046,7 +2046,7 @@ void tst_QMainWindow::resizeDocks() } } -#if QT_CONFIG(dockwidget) && !defined(QT_NO_TABBAR) +#if QT_CONFIG(dockwidget) && QT_CONFIG(tabbar) void tst_QMainWindow::QTBUG52175_tabifiedDockWidgetActivated() { QMainWindow w; -- cgit v1.2.3 From a493170a94907242360584890c4158ed38b394b1 Mon Sep 17 00:00:00 2001 From: Jesus Fernandez Date: Tue, 25 Jul 2017 13:42:50 +0200 Subject: Fix memory leak CID 10994 (#1 of 1): Resource leak in object (CTOR_DTOR_LEAK) The font database was not destroyed in the destructor. Coverity-Id: 10994 Change-Id: Ibd4cb0b65d1e554593295a3654e8d8c946551cc2 Reviewed-by: Laszlo Agocs Reviewed-by: Jesus Fernandez --- src/plugins/platforms/minimalegl/qminimaleglintegration.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/plugins/platforms/minimalegl/qminimaleglintegration.cpp b/src/plugins/platforms/minimalegl/qminimaleglintegration.cpp index 81512b1561..a716a6092a 100644 --- a/src/plugins/platforms/minimalegl/qminimaleglintegration.cpp +++ b/src/plugins/platforms/minimalegl/qminimaleglintegration.cpp @@ -100,6 +100,7 @@ QMinimalEglIntegration::QMinimalEglIntegration() QMinimalEglIntegration::~QMinimalEglIntegration() { destroyScreen(mScreen); + delete mFontDb; } bool QMinimalEglIntegration::hasCapability(QPlatformIntegration::Capability cap) const -- cgit v1.2.3 From 28d1d19a526148845107b631612520a3524b402b Mon Sep 17 00:00:00 2001 From: Jesus Fernandez Date: Tue, 25 Jul 2017 11:26:36 +0200 Subject: Add QDebugStateSaver to QVectorPath operator<< &operator<<(QDebug &, const QVectorPath &) was modifying the QDebug state without restoring it after finishing. Change-Id: I28c377bc99bfeb5a7bc67ca9affa8123f04583df Coverity-Id: 11375 Reviewed-by: Simon Hausmann --- src/gui/painting/qpaintengineex.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/painting/qpaintengineex.cpp b/src/gui/painting/qpaintengineex.cpp index f3c9b92bae..812cb8c02d 100644 --- a/src/gui/painting/qpaintengineex.cpp +++ b/src/gui/painting/qpaintengineex.cpp @@ -137,6 +137,7 @@ const QVectorPath &qtVectorPathForPath(const QPainterPath &path) #ifndef QT_NO_DEBUG_STREAM QDebug Q_GUI_EXPORT &operator<<(QDebug &s, const QVectorPath &path) { + QDebugStateSaver saver(s); QRectF rf = path.controlPointRect(); s << "QVectorPath(size:" << path.elementCount() << " hints:" << hex << path.hints() -- cgit v1.2.3 From 2031196ad12ae7a641fc00c0990072f5fb3a7172 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCri=20Valdmann?= Date: Tue, 18 Jul 2017 10:34:02 +0200 Subject: Add test for QLocale::bcp47Name() Task-number: QTBUG-61949 Change-Id: I34fece0441afb1e69ea84ae59b90c5e2b7cf133f Reviewed-by: Edward Welbourne Reviewed-by: Thiago Macieira --- tests/auto/corelib/tools/qlocale/tst_qlocale.cpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp b/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp index f278a7470b..d08e5dc289 100644 --- a/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp +++ b/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp @@ -137,6 +137,8 @@ private slots: void textDirection_data(); void textDirection(); + void bcp47Name(); + private: QString m_decimal, m_thousand, m_sdate, m_ldate, m_time; QString m_sysapp; @@ -2525,5 +2527,26 @@ void tst_QLocale::textDirection() QCOMPARE(locale.textDirection() == Qt::RightToLeft, rightToLeft); } +void tst_QLocale::bcp47Name() +{ + QCOMPARE(QLocale("C").bcp47Name(), QStringLiteral("C")); + QCOMPARE(QLocale("en").bcp47Name(), QStringLiteral("en")); + QCOMPARE(QLocale("en_US").bcp47Name(), QStringLiteral("en")); + QCOMPARE(QLocale("en_GB").bcp47Name(), QStringLiteral("en-GB")); + QCOMPARE(QLocale("en_DE").bcp47Name(), QStringLiteral("en-DE")); + QCOMPARE(QLocale("de_DE").bcp47Name(), QStringLiteral("de")); + QCOMPARE(QLocale("sr_RS").bcp47Name(), QStringLiteral("sr")); + QCOMPARE(QLocale("sr_Cyrl_RS").bcp47Name(), QStringLiteral("sr")); + QCOMPARE(QLocale("sr_Latn_RS").bcp47Name(), QStringLiteral("sr-Latn")); + QCOMPARE(QLocale("sr_ME").bcp47Name(), QStringLiteral("sr-ME")); + QCOMPARE(QLocale("sr_Cyrl_ME").bcp47Name(), QStringLiteral("sr-Cyrl-ME")); + QCOMPARE(QLocale("sr_Latn_ME").bcp47Name(), QStringLiteral("sr-ME")); + + // Fall back to defaults when country isn't in CLDR for this language: + QCOMPARE(QLocale("sr_HR").bcp47Name(), QStringLiteral("sr")); + QCOMPARE(QLocale("sr_Cyrl_HR").bcp47Name(), QStringLiteral("sr")); + QCOMPARE(QLocale("sr_Latn_HR").bcp47Name(), QStringLiteral("sr-Latn")); +} + QTEST_MAIN(tst_QLocale) #include "tst_qlocale.moc" -- cgit v1.2.3 From af7e756155cf44e05816cf91be04e13d9e7ca084 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCri=20Valdmann?= Date: Tue, 18 Jul 2017 10:41:20 +0200 Subject: Return "en" for QLocale::c().bcp47Name() Currently QLocale::c().bcp47Name() returns "C" which, according to [BCP47], is not a valid language tag. In particular it does not conform to the ABNF grammar in section 2.1 which specifies a minimum length of 2 characters for all language tags. [BCP47]: https://tools.ietf.org/html/bcp47 This patch changes the return value to "en" seeing as the documentation for QLocale::Language states that the C language is identical in behavior to English. Task-number: QTBUG-61949 Change-Id: I2a381def8fb7156467e01d105da92bb1f4821204 Reviewed-by: Edward Welbourne --- src/corelib/tools/qlocale.cpp | 2 +- tests/auto/corelib/tools/qlocale/tst_qlocale.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/corelib/tools/qlocale.cpp b/src/corelib/tools/qlocale.cpp index ab95f60115..63219b5bab 100644 --- a/src/corelib/tools/qlocale.cpp +++ b/src/corelib/tools/qlocale.cpp @@ -328,7 +328,7 @@ QByteArray QLocalePrivate::bcp47Name(char separator) const if (m_data->m_language_id == QLocale::AnyLanguage) return QByteArray(); if (m_data->m_language_id == QLocale::C) - return QByteArrayLiteral("C"); + return QByteArrayLiteral("en"); QLocaleId localeId = QLocaleId::fromIds(m_data->m_language_id, m_data->m_script_id, m_data->m_country_id); return localeId.withLikelySubtagsRemoved().name(separator); diff --git a/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp b/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp index d08e5dc289..10d78b1f2f 100644 --- a/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp +++ b/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp @@ -2529,7 +2529,7 @@ void tst_QLocale::textDirection() void tst_QLocale::bcp47Name() { - QCOMPARE(QLocale("C").bcp47Name(), QStringLiteral("C")); + QCOMPARE(QLocale("C").bcp47Name(), QStringLiteral("en")); QCOMPARE(QLocale("en").bcp47Name(), QStringLiteral("en")); QCOMPARE(QLocale("en_US").bcp47Name(), QStringLiteral("en")); QCOMPARE(QLocale("en_GB").bcp47Name(), QStringLiteral("en-GB")); -- cgit v1.2.3 From 50275fbcaf60ed41bd4486f8239cc7914c8af0f5 Mon Sep 17 00:00:00 2001 From: Jonathan Liu Date: Wed, 26 Jul 2017 21:20:50 +1000 Subject: Use correct DRM event context version Explicitly declare which DRM event context version we want to use, rather than just the latest one libdrm supports. New versions may change semantics, or extend the structure, in ways we're unaware of. Stick with version 2, which is the version that introduced page_flip_handler. Change-Id: I1d2066d5ab485ea571f016a8660829f435821c82 Reviewed-by: Simon Hausmann Reviewed-by: Oswald Buddenhagen Reviewed-by: Laszlo Agocs --- .../platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmdevice.cpp | 2 +- src/plugins/platforms/linuxfb/qlinuxfbdrmscreen.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmdevice.cpp b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmdevice.cpp index 5f85e4b0b0..e218d580a2 100644 --- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmdevice.cpp +++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmdevice.cpp @@ -142,7 +142,7 @@ void QEglFSKmsGbmDevice::handleDrmEvent() { drmEventContext drmEvent; memset(&drmEvent, 0, sizeof(drmEvent)); - drmEvent.version = DRM_EVENT_CONTEXT_VERSION; + drmEvent.version = 2; drmEvent.vblank_handler = nullptr; drmEvent.page_flip_handler = pageFlipHandler; diff --git a/src/plugins/platforms/linuxfb/qlinuxfbdrmscreen.cpp b/src/plugins/platforms/linuxfb/qlinuxfbdrmscreen.cpp index c9fbb8281c..e15d6fee24 100644 --- a/src/plugins/platforms/linuxfb/qlinuxfbdrmscreen.cpp +++ b/src/plugins/platforms/linuxfb/qlinuxfbdrmscreen.cpp @@ -314,7 +314,7 @@ void QLinuxFbDevice::swapBuffers(Output *output) while (output->backFb == fbIdx) { drmEventContext drmEvent; memset(&drmEvent, 0, sizeof(drmEvent)); - drmEvent.version = DRM_EVENT_CONTEXT_VERSION; + drmEvent.version = 2; drmEvent.vblank_handler = nullptr; drmEvent.page_flip_handler = pageFlipHandler; // Blocks until there is something to read on the drm fd -- cgit v1.2.3 From be93d2de031fb870a1ff244304311e07536a13b9 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Fri, 21 Jul 2017 10:22:01 -0700 Subject: Blacklist use of [[nodiscard]] with Clang __has_cpp_attribute(nodiscard) is 1 in all compilation modes, but if you use it outside of C++1z, you get a warning. LLVM-bug: https://bugs.llvm.org/show_bug.cgi?id=33518 Task-number: QTBUG-61840 Task-number: QTBUG-62085 Change-Id: I84e45059a888497fb55ffffd14d3683f4808978b Reviewed-by: Eike Ziller Reviewed-by: Thiago Macieira --- src/corelib/global/qcompilerdetection.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/corelib/global/qcompilerdetection.h b/src/corelib/global/qcompilerdetection.h index 05e3f6c45a..2c58ff87e9 100644 --- a/src/corelib/global/qcompilerdetection.h +++ b/src/corelib/global/qcompilerdetection.h @@ -1172,7 +1172,8 @@ # define Q_DECL_ALIGN(n) alignas(n) #endif -#if QT_HAS_CPP_ATTRIBUTE(nodiscard) // P0188R1 +#if QT_HAS_CPP_ATTRIBUTE(nodiscard) && !defined(Q_CC_CLANG) // P0188R1 +// Can't use [[nodiscard]] with Clang, see https://bugs.llvm.org/show_bug.cgi?id=33518 # undef Q_REQUIRED_RESULT # define Q_REQUIRED_RESULT [[nodiscard]] #endif -- cgit v1.2.3 From 0fcc7ea02a327219ae4b870079221cd962ae03f7 Mon Sep 17 00:00:00 2001 From: Oliver Wolff Date: Wed, 26 Jul 2017 13:54:14 +0200 Subject: winrt: Fix platform theme for non-phone devices When running on a desktop machine (using Windws SDK 10.0.14393) the palette had fully transparent text colors which were assigned in the "phone only" part of the theme's initialization. By checking the API contract we can avoid that part of the initialization and thus return proper values. Change-Id: Id770a686c1c7e447a9594830fd7670352116eb21 Reviewed-by: Maurice Kalinowski --- src/plugins/platforms/winrt/qwinrttheme.cpp | 37 +++++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 5 deletions(-) diff --git a/src/plugins/platforms/winrt/qwinrttheme.cpp b/src/plugins/platforms/winrt/qwinrttheme.cpp index 5696ae7a10..283825a880 100644 --- a/src/plugins/platforms/winrt/qwinrttheme.cpp +++ b/src/plugins/platforms/winrt/qwinrttheme.cpp @@ -61,6 +61,26 @@ QT_BEGIN_NAMESPACE Q_LOGGING_CATEGORY(lcQpaTheme, "qt.qpa.theme") +class QWinRTApiInformationHandler { +public: + QWinRTApiInformationHandler() + { + HRESULT hr; + hr = RoGetActivationFactory(HString::MakeReference(RuntimeClass_Windows_Foundation_Metadata_ApiInformation).Get(), + IID_PPV_ARGS(&m_apiInformationStatics)); + Q_ASSERT_SUCCEEDED(hr); + } + + ComPtr apiInformationStatics() const + { + return m_apiInformationStatics; + } + +private: + ComPtr m_apiInformationStatics; +}; +Q_GLOBAL_STATIC(QWinRTApiInformationHandler, gApiHandler); + static IUISettings *uiSettings() { static ComPtr settings; @@ -86,17 +106,16 @@ static inline QColor fromColor(const Color &color) static bool uiColorSettings(const wchar_t *value, UIElementType type, Color *color) { - static ComPtr apiInformationStatics; - HRESULT hr; + ComPtr apiInformationStatics = gApiHandler->apiInformationStatics(); if (!apiInformationStatics) { - hr = RoGetActivationFactory(HString::MakeReference(RuntimeClass_Windows_Foundation_Metadata_ApiInformation).Get(), - IID_PPV_ARGS(&apiInformationStatics)); - RETURN_FALSE_IF_FAILED("Could not get ApiInformationStatics"); + qErrnoWarning("Could not get ApiInformationStatics"); + return false; } static const HStringReference enumRef(L"Windows.UI.ViewManagement.UIElementType"); HStringReference valueRef(value); + HRESULT hr; boolean exists; hr = apiInformationStatics->IsEnumNamedValuePresent(enumRef.Get(), valueRef.Get(), &exists); @@ -149,6 +168,14 @@ static void nativeColorSettings(QPalette &p) // Starting with SDK 15063 those have been removed. #ifndef QT_WINRT_DISABLE_PHONE_COLORS //Phone related + ComPtr apiInformationStatics = gApiHandler->apiInformationStatics(); + boolean phoneApiPresent = false; + HRESULT hr; + HStringReference phoneRef(L"Windows.Phone.PhoneContract"); + hr = apiInformationStatics.Get()->IsApiContractPresentByMajor(phoneRef.Get(), 1, &phoneApiPresent); + if (FAILED(hr) || !phoneApiPresent) + return; + if (uiColorSettings(L"PopupBackground", UIElementType_PopupBackground, &color)) { p.setColor(QPalette::ToolTipBase, fromColor(color)); p.setColor(QPalette::AlternateBase, fromColor(color)); -- cgit v1.2.3 From 5cdc4858653a7abb51878b1e5381f4bc8cff696c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A5rten=20Nordheim?= Date: Wed, 26 Jul 2017 15:19:00 +0200 Subject: Fix compilation failing for WinRT with QT_NO_SSL Change-Id: I5a2758065d3155f4f33b76c022c43955a9b096c2 Reviewed-by: Jesus Fernandez Reviewed-by: Timur Pocheptsov Reviewed-by: Edward Welbourne Reviewed-by: Oliver Wolff --- src/network/socket/qnativesocketengine_winrt.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/network/socket/qnativesocketengine_winrt.cpp b/src/network/socket/qnativesocketengine_winrt.cpp index 291d85844d..b7d7042923 100644 --- a/src/network/socket/qnativesocketengine_winrt.cpp +++ b/src/network/socket/qnativesocketengine_winrt.cpp @@ -535,8 +535,8 @@ QNativeSocketEngine::QNativeSocketEngine(QObject *parent) { qRegisterMetaType(); qRegisterMetaType(); -#ifndef QT_NO_SSL Q_D(QNativeSocketEngine); +#ifndef QT_NO_SSL if (parent) d->sslSocket = qobject_cast(parent->parent()); #endif -- cgit v1.2.3 From 7daf0ea58186cf18c550a32181cdef1163b8c401 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C4=99drzej=20Nowacki?= Date: Thu, 27 Jul 2017 10:58:33 +0200 Subject: Blacklist tst_MacGui::nonModalOrder The test is marked as expected failure for the last 3 years, in CI it is proven to be somehow flaky and it is failing now because of XPASS which is not covered by blacklist feature. This patch extends efforts of 7eba6d039dfbb9377a4358842fcd7210dc1fdd86 and 03b4838cb51513bd5d2edf76dccc4bc4a1181681 by blacklisting the test completely. Change-Id: Ia295d61620fa6bc97b168d4de9456a18ed5c064f Task-number: QTQAINFRA-1333 Reviewed-by: Simon Hausmann --- tests/auto/other/macgui/BLACKLIST | 3 +-- tests/auto/other/macgui/tst_macgui.cpp | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/tests/auto/other/macgui/BLACKLIST b/tests/auto/other/macgui/BLACKLIST index 2b6a0e2fe8..5a5d6a175f 100644 --- a/tests/auto/other/macgui/BLACKLIST +++ b/tests/auto/other/macgui/BLACKLIST @@ -1,3 +1,2 @@ [nonModalOrder] -osx-10.11 ci -osx-10.12 ci +osx diff --git a/tests/auto/other/macgui/tst_macgui.cpp b/tests/auto/other/macgui/tst_macgui.cpp index c6fc67f998..75fa4815c9 100644 --- a/tests/auto/other/macgui/tst_macgui.cpp +++ b/tests/auto/other/macgui/tst_macgui.cpp @@ -190,7 +190,6 @@ void tst_MacGui::nonModalOrder() primary.resize(400, 400); primary.move(100, 100); primary.exec(); - QEXPECT_FAIL("", "Non-modal child windows show behind the modal dialig", Abort); QCOMPARE(primary.frontWidget, primary.secondaryWindow); } -- cgit v1.2.3 From a8818d33466c5999d2e9b25da0e61404f29adeca Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 25 Jul 2017 09:49:13 +0200 Subject: QFontDatabase: Output family in warning about missing Open Type support OpenType support missing for script 11 becomes: OpenType support missing for "SimSun", script 11 Change-Id: I562e20d630c9cdd888f75fd99b987de5152cd77e Reviewed-by: Joerg Bornemann Reviewed-by: Oliver Wolff --- src/gui/text/qfontdatabase.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gui/text/qfontdatabase.cpp b/src/gui/text/qfontdatabase.cpp index 58933e38fb..2cc071d67b 100644 --- a/src/gui/text/qfontdatabase.cpp +++ b/src/gui/text/qfontdatabase.cpp @@ -948,7 +948,8 @@ QFontEngine *loadSingleEngine(int script, if (engine) { // Also check for OpenType tables when using complex scripts if (Q_UNLIKELY(!engine->supportsScript(QChar::Script(script)))) { - qWarning(" OpenType support missing for script %d", script); + qWarning(" OpenType support missing for \"%s\", script %d", + qPrintable(def.family), script); return 0; } @@ -972,7 +973,8 @@ QFontEngine *loadSingleEngine(int script, if (engine) { // Also check for OpenType tables when using complex scripts if (!engine->supportsScript(QChar::Script(script))) { - qWarning(" OpenType support missing for script %d", script); + qWarning(" OpenType support missing for \"%s\", script %d", ++ qPrintable(def.family), script); if (engine->ref.load() == 0) delete engine; return 0; -- cgit v1.2.3 From 5303225aef739c534714c1ac1d4dd096f0cc38d0 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 25 Jul 2017 09:52:19 +0200 Subject: Windows font database: Make DirectWrite warnings more verbose Output family and format error message using _comerror struct. QWindowsMultiFontEngine::loadEngine: CreateFontFromLOGFONT failed (The operation completed successfully.) becomes QWindowsMultiFontEngine::loadEngine: CreateFontFromLOGFONT failed for "8514oem": error 0x88985002 : Indicates the specified font does not exist. Change-Id: Iccd4622127d94870b4b7465a4b4fdbf34ad1c434 Reviewed-by: Joerg Bornemann --- .../fontdatabases/windows/qwindowsfontengine.cpp | 24 ++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/src/platformsupport/fontdatabases/windows/qwindowsfontengine.cpp b/src/platformsupport/fontdatabases/windows/qwindowsfontengine.cpp index 6e95fb5a05..1389b497d5 100644 --- a/src/platformsupport/fontdatabases/windows/qwindowsfontengine.cpp +++ b/src/platformsupport/fontdatabases/windows/qwindowsfontengine.cpp @@ -56,6 +56,7 @@ #include #include #include +#include #include #include #include @@ -66,6 +67,7 @@ #if !defined(QT_NO_DIRECTWRITE) # include +# include #endif QT_BEGIN_NAMESPACE @@ -1228,6 +1230,22 @@ QWindowsMultiFontEngine::QWindowsMultiFontEngine(QFontEngine *fe, int script) { } +#ifndef QT_NO_DIRECTWRITE +static QString msgDirectWriteFunctionFailed(HRESULT hr, const char *function, + const QString &fam, const QString &substitute) +{ + _com_error error(hr); + QString result; + QTextStream str(&result); + str << function << " failed for \"" << fam << '"'; + if (substitute != fam) + str << " (substitute: \"" << substitute << "\")"; + str << ": error " << hex << showbase << ulong(hr) << ' ' << noshowbase << dec + << ": " << QString::fromWCharArray(error.ErrorMessage()); + return result; +} +#endif // !QT_NO_DIRECTWRITE + QFontEngine *QWindowsMultiFontEngine::loadEngine(int at) { QFontEngine *fontEngine = engine(0); @@ -1266,7 +1284,8 @@ QFontEngine *QWindowsMultiFontEngine::loadEngine(int at) IDWriteFont *directWriteFont = 0; HRESULT hr = data->directWriteGdiInterop->CreateFontFromLOGFONT(&lf, &directWriteFont); if (FAILED(hr)) { - qErrnoWarning("%s: CreateFontFromLOGFONT failed", __FUNCTION__); + qWarning("%s: %s", __FUNCTION__, + qPrintable(msgDirectWriteFunctionFailed(hr, "CreateFontFromLOGFONT", fam, nameSubstitute))); } else { Q_ASSERT(directWriteFont); IDWriteFontFace *directWriteFontFace = NULL; @@ -1284,7 +1303,8 @@ QFontEngine *QWindowsMultiFontEngine::loadEngine(int at) fedw->fontDef.stretch = fontEngine->fontDef.stretch; return fedw; } else { - qErrnoWarning("%s: CreateFontFace failed", __FUNCTION__); + qWarning("%s: %s", __FUNCTION__, + qPrintable(msgDirectWriteFunctionFailed(hr, "CreateFontFace", fam, nameSubstitute))); } } } -- cgit v1.2.3 From 7c45c6a3c44f73aac5a7422ce66235bf32b510e3 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 26 Jul 2017 10:35:55 -0700 Subject: Revert "Make QFile::open fail when using an invalid file name" This reverts commit 346cd79192ef71afa572812e17f1d422594651a0. The bug report was incorrect, since the suggested file name is actually valid, it just happens to name an Alternate Data Stream (ADS) "20:803Z.txt" in file "testLog-03". [ChangeLog][QtCore][QFile] Reverted an incorrect change from Qt 5.9.0 that forbade the creation and access to Alternate Data Streams on NTFS on Windows. This means that file names containing a colon (':') are allowed again, but note that they are not regular files. Task-number: QTBUG-57023 Change-Id: I81480fdb578d4d43b3fcfffd14d4f2147e8a0ade Reviewed-by: Oswald Buddenhagen Reviewed-by: Kai Koehne Reviewed-by: Jesus Fernandez --- src/corelib/io/qfsfileengine_win.cpp | 14 -------------- tests/auto/corelib/io/qfile/tst_qfile.cpp | 1 - 2 files changed, 15 deletions(-) diff --git a/src/corelib/io/qfsfileengine_win.cpp b/src/corelib/io/qfsfileengine_win.cpp index 7a010df671..c99a25f30d 100644 --- a/src/corelib/io/qfsfileengine_win.cpp +++ b/src/corelib/io/qfsfileengine_win.cpp @@ -108,20 +108,6 @@ bool QFSFileEnginePrivate::nativeOpen(QIODevice::OpenMode openMode) { Q_Q(QFSFileEngine); - // Check if the file name is valid: - // https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx#naming_conventions - const QString fileName = fileEntry.fileName(); - for (QString::const_iterator it = fileName.constBegin(), end = fileName.constEnd(); - it != end; ++it) { - const QChar c = *it; - if (c == QLatin1Char('<') || c == QLatin1Char('>') || c == QLatin1Char(':') || - c == QLatin1Char('\"') || c == QLatin1Char('/') || c == QLatin1Char('\\') || - c == QLatin1Char('|') || c == QLatin1Char('?') || c == QLatin1Char('*')) { - q->setError(QFile::OpenError, QStringLiteral("Invalid file name")); - return false; - } - } - // All files are opened in share mode (both read and write). DWORD shareMode = FILE_SHARE_READ | FILE_SHARE_WRITE; diff --git a/tests/auto/corelib/io/qfile/tst_qfile.cpp b/tests/auto/corelib/io/qfile/tst_qfile.cpp index c7216dc169..32165ad2b8 100644 --- a/tests/auto/corelib/io/qfile/tst_qfile.cpp +++ b/tests/auto/corelib/io/qfile/tst_qfile.cpp @@ -1155,7 +1155,6 @@ void tst_QFile::invalidFile_data() #else #if !defined(Q_OS_WINRT) QTest::newRow( "colon2" ) << invalidDriveLetter() + QString::fromLatin1(":ail:invalid"); - QTest::newRow( "date" ) << QString( "testLog-03:20.803Z.txt" ); #endif QTest::newRow( "colon3" ) << QString( ":failinvalid" ); QTest::newRow( "forwardslash" ) << QString( "fail/invalid" ); -- cgit v1.2.3 From 763b0a68beb3b1502f6f4c1b979f0a576fc9980b Mon Sep 17 00:00:00 2001 From: Jesus Fernandez Date: Tue, 20 Jun 2017 12:51:40 +0200 Subject: Fix QStandardItem::setChild crash when passing a null pointer Passing a null pointer as a parameter to the setChild function no longer crashes when calling the QStandardItemModelPrivate::itemChanged signal. The child is removed from the model. The patch also fixes the behavior of deleting a item. A dataChanged signal is emitted. Change-Id: I027e8b0d84fe33c5fca056df870f0e60a020824b Reviewed-by: David Faure --- src/gui/itemmodels/qstandarditemmodel.cpp | 15 ++++++++++-- .../qstandarditemmodel/tst_qstandarditemmodel.cpp | 27 ++++++++++++++++++++++ 2 files changed, 40 insertions(+), 2 deletions(-) diff --git a/src/gui/itemmodels/qstandarditemmodel.cpp b/src/gui/itemmodels/qstandarditemmodel.cpp index 1d6e2924b1..07e372b1ae 100644 --- a/src/gui/itemmodels/qstandarditemmodel.cpp +++ b/src/gui/itemmodels/qstandarditemmodel.cpp @@ -148,8 +148,14 @@ void QStandardItemPrivate::setChild(int row, int column, QStandardItem *item, if (model && emitChanged) emit model->layoutChanged(); - if (emitChanged && model) - model->d_func()->itemChanged(item); + if (emitChanged && model) { + if (item) { + model->d_func()->itemChanged(item); + } else { + const QModelIndex idx = model->index(row, column, q->index()); + emit model->dataChanged(idx, idx); + } + } } @@ -174,7 +180,9 @@ void QStandardItemPrivate::childDeleted(QStandardItem *child) { int index = childIndex(child); Q_ASSERT(index != -1); + const auto modelIndex = child->index(); children.replace(index, 0); + emit model->dataChanged(modelIndex, modelIndex); } /*! @@ -476,6 +484,7 @@ bool QStandardItemPrivate::insertColumns(int column, int count, const QListd_func()->parent == 0) { // Header item int idx = columnHeaderItems.indexOf(item); @@ -1721,6 +1730,8 @@ bool QStandardItem::hasChildren() const item) takes ownership of \a item. If necessary, the row count and column count are increased to fit the item. + \note Passing a null pointer as \a item removes the item. + \sa child() */ void QStandardItem::setChild(int row, int column, QStandardItem *item) diff --git a/tests/auto/gui/itemmodels/qstandarditemmodel/tst_qstandarditemmodel.cpp b/tests/auto/gui/itemmodels/qstandarditemmodel/tst_qstandarditemmodel.cpp index cff26be7bb..2f5537adfe 100644 --- a/tests/auto/gui/itemmodels/qstandarditemmodel/tst_qstandarditemmodel.cpp +++ b/tests/auto/gui/itemmodels/qstandarditemmodel/tst_qstandarditemmodel.cpp @@ -117,6 +117,9 @@ private slots: void useCase2(); void useCase3(); + void setNullChild(); + void deleteChild(); + void rootItemFlags(); #ifdef QT_BUILD_INTERNAL void treeDragAndDrop(); @@ -1364,6 +1367,30 @@ void tst_QStandardItemModel::useCase3() delete childItem; } +void tst_QStandardItemModel::setNullChild() +{ + QStandardItemModel model; + model.setColumnCount(2); + createChildren(&model, model.invisibleRootItem(), 0); + QStandardItem *item = model.item(0); + QSignalSpy spy(&model, SIGNAL(dataChanged(QModelIndex,QModelIndex,QVector))); + item->setChild(0, nullptr); + QCOMPARE(item->child(0), nullptr); + QCOMPARE(spy.count(), 1); +} + +void tst_QStandardItemModel::deleteChild() +{ + QStandardItemModel model; + model.setColumnCount(2); + createChildren(&model, model.invisibleRootItem(), 0); + QStandardItem *item = model.item(0); + QSignalSpy spy(&model, SIGNAL(dataChanged(QModelIndex,QModelIndex,QVector))); + delete item->child(0); + QCOMPARE(item->child(0), nullptr); + QCOMPARE(spy.count(), 1); +} + void tst_QStandardItemModel::rootItemFlags() { QStandardItemModel model(6, 4); -- cgit v1.2.3 From aca9c93fa06e266dd44a74410eb129bdbc719607 Mon Sep 17 00:00:00 2001 From: Dongmei Wang Date: Tue, 25 Jul 2017 13:11:04 -0700 Subject: QFileDialog: Fix a crash occurring when deleting a file A crash has been observed on Windows in the use case below: 1) In a non-native QFileDialog, select a file and press "Del" key to delete it, and a warning message box appears for user to confirm the deletion. 2) Delete the file in the Windows Explorer. 3) Click "Yes" on the warning message box, a crash happens In QFileDialog::_q_deleteCurrent(), use QPersistentModelIndex instead of QModelIndex to ensure that the index is valid to be deleted. The change is intended to fix . The patch is to use QPersistentModelIndex instead of QModelIndex in QFileDialog::_q_deleteCurrent() to ensure that the index is valid to be deleted. Change-Id: I8959124dc071f7cf0ab47f954d611211a789978d Reviewed-by: Friedemann Kleint --- src/widgets/dialogs/qfiledialog.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/widgets/dialogs/qfiledialog.cpp b/src/widgets/dialogs/qfiledialog.cpp index b638adeaec..b953c63569 100644 --- a/src/widgets/dialogs/qfiledialog.cpp +++ b/src/widgets/dialogs/qfiledialog.cpp @@ -3417,7 +3417,7 @@ void QFileDialogPrivate::_q_deleteCurrent() QModelIndexList list = qFileDialogUi->listView->selectionModel()->selectedRows(); for (int i = list.count() - 1; i >= 0; --i) { - QModelIndex index = list.at(i); + QPersistentModelIndex index = list.at(i); if (index == qFileDialogUi->listView->rootIndex()) continue; @@ -3443,12 +3443,15 @@ void QFileDialogPrivate::_q_deleteCurrent() QMessageBox::Yes | QMessageBox::No, QMessageBox::No) == QMessageBox::No) return; + // the event loop has run, we have to validate if the index is valid because the model might have removed it. + if (!index.isValid()) + return; + #else if (!(p & QFile::WriteUser)) return; #endif // QT_CONFIG(messagebox) - // the event loop has run, we can NOT reuse index because the model might have removed it. if (isDir) { if (!removeDirectory(filePath)) { #if QT_CONFIG(messagebox) -- cgit v1.2.3 From 5978be31295eb78106fa968a86ba3182f31b2d21 Mon Sep 17 00:00:00 2001 From: Kevin Funk Date: Thu, 27 Jul 2017 21:51:33 +0200 Subject: Use correct paths in Qt5CoreConfigExtrasMkspecDir Before we generated the following content: set(_qt5_corelib_extra_includes "${_qt5Core_install_prefix}/X:/src/qt5.9/qtbase/mkspecs/win32-msvc") Which lead to the following error when used: CMake Error at Z:/build/qt59/qtbase/lib/cmake/Qt5Core/Qt5CoreConfig.cmake:15 (message): The imported target "Qt5::Core" references the file "Z:/build/qt59/qtbase/X:/src/qt5.9/qtbase//mkspecs/win32-msvc" => We prefixed an absolute path with another absolute path which is obviously wrong After the patch we generate this content: set(_qt5_corelib_extra_includes "X:/src/qt5.9/qtbase/mkspecs/win32-msvc") This patch ensures we never prefix an absolute path additionally Patch by Konstantin Tokarev Change-Id: I05dab7f681958723594ceb78064be41798e83fb8 Task-number: QTBUG-61768 Reviewed-by: Thiago Macieira Reviewed-by: Konstantin Tokarev --- src/corelib/corelib.pro | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/corelib/corelib.pro b/src/corelib/corelib.pro index 0bd7c9b99d..7d09070b81 100644 --- a/src/corelib/corelib.pro +++ b/src/corelib/corelib.pro @@ -104,11 +104,17 @@ cmake_umbrella_config_version_file.output = $$DESTDIR/cmake/Qt5/Qt5ConfigVersion load(cmake_functions) +defineTest(pathIsAbsolute) { + p = $$clean_path($$1) + !isEmpty(p):isEqual(p, $$absolute_path($$p)): return(true) + return(false) +} + ##### 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]) -contains(CMAKE_HOST_DATA_DIR, "^\\.\\./.*"):!isEmpty(CMAKE_HOST_DATA_DIR) { +pathIsAbsolute($$CMAKE_HOST_DATA_DIR) { CMAKE_HOST_DATA_DIR = $$[QT_HOST_DATA/src]/ CMAKE_HOST_DATA_DIR_IS_ABSOLUTE = True } @@ -117,7 +123,7 @@ cmake_extras_mkspec_dir.input = $$PWD/Qt5CoreConfigExtrasMkspecDir.cmake.in cmake_extras_mkspec_dir.output = $$DESTDIR/cmake/Qt5Core/Qt5CoreConfigExtrasMkspecDir.cmake CMAKE_INSTALL_DATA_DIR = $$cmakeRelativePath($$[QT_HOST_DATA], $$[QT_INSTALL_PREFIX]) -contains(CMAKE_INSTALL_DATA_DIR, "^\\.\\./.*"):!isEmpty(CMAKE_INSTALL_DATA_DIR) { +pathIsAbsolute($$CMAKE_INSTALL_DATA_DIR) { CMAKE_INSTALL_DATA_DIR = $$[QT_HOST_DATA]/ CMAKE_INSTALL_DATA_DIR_IS_ABSOLUTE = True } -- cgit v1.2.3 From 23187ade6075e88e9212acef7c829a319f0a39dc Mon Sep 17 00:00:00 2001 From: Antonio Larrosa Date: Tue, 18 Apr 2017 17:56:35 +0200 Subject: Fix open/chmod race condition in QSaveFile This fixes a problem introduced in a60571b3700e80f44705ebc4bab9628cf852891c The problem happens when an application like Kate (actually, ktexteditor) uses QSaveFile to save files. So if you open a secretfile.txt file (with permissions 0600), edit and save it, then QSaveFile currently generates a temporary file with 0666 that afterwards gets chmod'ed to 0600 again, but in between, some other user in the system can open the temporary file and get a file descriptor that would allow him/her to read the contents of a file with 0600 permissions. Change-Id: I824025f54d6faf853da88e4dfcb092b577b4df04 Reviewed-by: Thiago Macieira Reviewed-by: Oswald Buddenhagen --- src/corelib/io/qsavefile.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/corelib/io/qsavefile.cpp b/src/corelib/io/qsavefile.cpp index 0283c5f31f..3f45ca5f91 100644 --- a/src/corelib/io/qsavefile.cpp +++ b/src/corelib/io/qsavefile.cpp @@ -232,7 +232,11 @@ bool QSaveFile::open(OpenMode mode) } d->fileEngine = new QTemporaryFileEngine; - static_cast(d->fileEngine)->initialize(d->finalFileName, 0666); + // if the target file exists, we'll copy its permissions below, + // but until then, let's ensure the temporary file is not accessible + // to a third party + int perm = (existingFile.exists() ? 0600 : 0666); + static_cast(d->fileEngine)->initialize(d->finalFileName, perm); // Same as in QFile: QIODevice provides the buffering, so there's no need to request it from the file engine. if (!d->fileEngine->open(mode | QIODevice::Unbuffered)) { QFileDevice::FileError err = d->fileEngine->error(); -- cgit v1.2.3 From 5157c3e8bd78d31efea885d8e2d36e24f41a4a2f Mon Sep 17 00:00:00 2001 From: Dongmei Wang Date: Sat, 22 Jul 2017 10:57:59 -0700 Subject: In QFileDialog delete a symlink rather than actual target it points to In QFileDialog, when a resolved symlink gets deleted, the actual target it points to gets deleted instead of the symlink itself. The patch is to delete the symlink rather than actual target by doing the following: 1. In QFileDialog, if a directory being deleted is a resolved symlink, do not remove the directory. Instead, call QFileSystemModel to remove the model index. 2. In QFileSystemModel::remove(), use the full file path instead of the resolved file path for deletion. For a symlink, delete the symlink itself. The patch is for Windows and Linux. Task-number: QTBUG-29770 Change-Id: I4db545f0b5963acde3f89a8ee858338c23104804 Reviewed-by: Friedemann Kleint Reviewed-by: Gabriel de Dietrich --- src/widgets/dialogs/qfiledialog.cpp | 3 +-- src/widgets/dialogs/qfilesystemmodel.cpp | 8 ++++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/widgets/dialogs/qfiledialog.cpp b/src/widgets/dialogs/qfiledialog.cpp index b953c63569..97afce1734 100644 --- a/src/widgets/dialogs/qfiledialog.cpp +++ b/src/widgets/dialogs/qfiledialog.cpp @@ -3427,7 +3427,6 @@ void QFileDialogPrivate::_q_deleteCurrent() QString fileName = index.data(QFileSystemModel::FileNameRole).toString(); QString filePath = index.data(QFileSystemModel::FilePathRole).toString(); - bool isDir = model->isDir(index); QFile::Permissions p(index.parent().data(QFileSystemModel::FilePermissions).toInt()); #if QT_CONFIG(messagebox) @@ -3452,7 +3451,7 @@ void QFileDialogPrivate::_q_deleteCurrent() return; #endif // QT_CONFIG(messagebox) - if (isDir) { + if (model->isDir(index) && !model->fileInfo(index).isSymLink()) { if (!removeDirectory(filePath)) { #if QT_CONFIG(messagebox) QMessageBox::warning(q, q->windowTitle(), diff --git a/src/widgets/dialogs/qfilesystemmodel.cpp b/src/widgets/dialogs/qfilesystemmodel.cpp index 63b5cf7aaf..bf14b5c6fd 100644 --- a/src/widgets/dialogs/qfilesystemmodel.cpp +++ b/src/widgets/dialogs/qfilesystemmodel.cpp @@ -203,8 +203,12 @@ QFileInfo QFileSystemModel::fileInfo(const QModelIndex &index) const bool QFileSystemModel::remove(const QModelIndex &aindex) { - const QString path = filePath(aindex); - const bool success = QFileInfo(path).isFile() ? QFile::remove(path) : QDir(path).removeRecursively(); + Q_D(QFileSystemModel); + + const QString path = d->filePath(aindex); + const QFileInfo fileInfo(path); + const bool success = (fileInfo.isFile() || fileInfo.isSymLink()) + ? QFile::remove(path) : QDir(path).removeRecursively(); #ifndef QT_NO_FILESYSTEMWATCHER if (success) { QFileSystemModelPrivate * d = const_cast(d_func()); -- cgit v1.2.3 From 5bce6aabdcb7e174d3b6ba33c5c4e22ebcf85abf Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Thu, 27 Jul 2017 15:47:44 +0200 Subject: Enrich tst_macNativeEvents blacklist MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Amends 0c7e4b97a7990b29255abaf4568f62b6a6b6c470 Task-number: QTQAINFRA-1292 Change-Id: I599dc1e7d39a96617d48fa32227093c8501b1323 Reviewed-by: Jędrzej Nowacki --- tests/auto/other/macnativeevents/BLACKLIST | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/auto/other/macnativeevents/BLACKLIST b/tests/auto/other/macnativeevents/BLACKLIST index f1eb038201..3998eb616a 100644 --- a/tests/auto/other/macnativeevents/BLACKLIST +++ b/tests/auto/other/macnativeevents/BLACKLIST @@ -24,3 +24,19 @@ osx # QTQAINFRA-1292 [testPushButtonPressRelease] osx-10.11 ci +osx-10.12 ci +# QTQAINFRA-1292 +[testKeyPressOnToplevel] +osx-10.12 ci +# QTQAINFRA-1292 +[testModifierShift] +osx-10.12 ci +# QTQAINFRA-1292 +[testModifierAlt] +osx-10.12 ci +# QTQAINFRA-1292 +[testModifierCtrl] +osx-10.12 ci +# QTQAINFRA-1292 +[testModifierCtrlWithDontSwapCtrlAndMeta] +osx-10.12 ci -- cgit v1.2.3 From 5a9247166c07e8eecee972f78388e22fd156697f Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Fri, 28 Jul 2017 12:45:28 +0200 Subject: Ignore failure of qaccessbilitymac on macOS 10.12 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Task-number: QTQAINFRA-1351 Change-Id: I9b41e5664cdb6cedcb68be6197fc21b2cc45963d Reviewed-by: Jędrzej Nowacki --- tests/auto/other/qaccessibilitymac/BLACKLIST | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 tests/auto/other/qaccessibilitymac/BLACKLIST diff --git a/tests/auto/other/qaccessibilitymac/BLACKLIST b/tests/auto/other/qaccessibilitymac/BLACKLIST new file mode 100644 index 0000000000..f53fa7e853 --- /dev/null +++ b/tests/auto/other/qaccessibilitymac/BLACKLIST @@ -0,0 +1,2 @@ +[hierarchyTest] +osx-10.12 ci -- cgit v1.2.3 From 5881fc0d2d58ae3e46c8fd3567c98ee689f5c900 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Fri, 28 Jul 2017 13:43:58 +0200 Subject: Ignore tst_QFocusEvent failures on macOS 10.12 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Task-number: QTQAINFRA-1352 Change-Id: Ia5cad1af74a2ea581d768ce150e480f3a97b6495 Reviewed-by: Jędrzej Nowacki --- tests/auto/other/qfocusevent/BLACKLIST | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 tests/auto/other/qfocusevent/BLACKLIST diff --git a/tests/auto/other/qfocusevent/BLACKLIST b/tests/auto/other/qfocusevent/BLACKLIST new file mode 100644 index 0000000000..502820fa12 --- /dev/null +++ b/tests/auto/other/qfocusevent/BLACKLIST @@ -0,0 +1,5 @@ +[checkReason_Shortcut] +osx-10.12 ci +[checkReason_ActiveWindow] +osx-10.12 ci + -- cgit v1.2.3 From 3760120ab33ea454bed320b10e8afcb29f7869ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C4=99drzej=20Nowacki?= Date: Fri, 28 Jul 2017 09:42:03 +0200 Subject: Remove tst_qtconcurrentiteratekernel blockSize test The test is just wrong. It suggests, that it tests minimal block size, but in reality it is checking if a maximal peak of block size is bigger then expected minimum block size. The minimal block size is 1, not 1024 / ideal threads count and it is defined in BlockSizeManagerV2. The maximal block size is defined and it is fixed, but it is an implementation detail, probably not worth testing. The test is based on a race condition as peakBegin and peakBlockSize are modified in parallel from multiple threads, without any synchronization. Change-Id: I430eedcf83b0fa3e2ce2cfd294eaee7b301e48ae Reviewed-by: Simon Hausmann --- .../tst_qtconcurrentiteratekernel.cpp | 45 ---------------------- 1 file changed, 45 deletions(-) diff --git a/tests/auto/concurrent/qtconcurrentiteratekernel/tst_qtconcurrentiteratekernel.cpp b/tests/auto/concurrent/qtconcurrentiteratekernel/tst_qtconcurrentiteratekernel.cpp index 4bb3fa5b28..2e698e6615 100644 --- a/tests/auto/concurrent/qtconcurrentiteratekernel/tst_qtconcurrentiteratekernel.cpp +++ b/tests/auto/concurrent/qtconcurrentiteratekernel/tst_qtconcurrentiteratekernel.cpp @@ -81,7 +81,6 @@ private slots: void stresstest(); void noIterations(); void throttling(); - void blockSize(); void multipleResults(); }; @@ -240,50 +239,6 @@ void tst_QtConcurrentIterateKernel::throttling() QCOMPARE(threads.count(), 1); } -class BlockSizeRecorder : public IterateKernel -{ -public: - BlockSizeRecorder(TestIterator begin, TestIterator end) - : IterateKernel(begin, end) - , peakBlockSize(0) - , peakBegin(0) - {} - - inline bool runIterations(TestIterator, int begin, int end, void *) - { - const int blockSize = end - begin; - if (blockSize > peakBlockSize) { - peakBlockSize = blockSize; - peakBegin = begin; - } - return false; - } - int peakBlockSize; - int peakBegin; -}; - -static QByteArray msgBlockSize(const BlockSizeRecorder &recorder, int expectedMinimumBlockSize) -{ - return QByteArrayLiteral("peakBlockSize=") + QByteArray::number(recorder.peakBlockSize) - + QByteArrayLiteral(" is less than expectedMinimumBlockSize=") - + QByteArray::number(expectedMinimumBlockSize) - + QByteArrayLiteral(", reached at: ") + QByteArray::number(recorder.peakBegin) - + QByteArrayLiteral(" (ideal thread count: ") + QByteArray::number(QThread::idealThreadCount()) - + ')'; -} - -void tst_QtConcurrentIterateKernel::blockSize() -{ - const int expectedMinimumBlockSize = 1024 / QThread::idealThreadCount(); - BlockSizeRecorder recorder(0, 10000); - recorder.startBlocking(); -#ifdef Q_OS_WIN - if (recorder.peakBlockSize < expectedMinimumBlockSize) - QEXPECT_FAIL("", msgBlockSize(recorder, expectedMinimumBlockSize).constData(), Abort); -#endif // Q_OS_WIN - QVERIFY2(recorder.peakBlockSize >= expectedMinimumBlockSize, msgBlockSize(recorder, expectedMinimumBlockSize)); -} - class MultipleResultsFor : public IterateKernel { public: -- cgit v1.2.3 From 3bdd59920fab954fd94a7b643042e1aaf7801674 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 29 Jun 2017 08:38:51 +0200 Subject: Refactor tst_qdir::entryList() Split the test in two: one test that requires the symlinks and test files and one that does not need them. In the test with test files, verify each step and the deletion of the files. Task-number: QTBUG-58654 Task-number: QTBUG-50835 Change-Id: I14de57ce7a1df2d834d5a7565c804dead1d89088 Reviewed-by: Oliver Wolff Reviewed-by: Thiago Macieira --- tests/auto/corelib/io/qdir/tst_qdir.cpp | 99 +++++++++++++++++++++++---------- 1 file changed, 69 insertions(+), 30 deletions(-) diff --git a/tests/auto/corelib/io/qdir/tst_qdir.cpp b/tests/auto/corelib/io/qdir/tst_qdir.cpp index da948849f6..e6bad9a8ef 100644 --- a/tests/auto/corelib/io/qdir/tst_qdir.cpp +++ b/tests/auto/corelib/io/qdir/tst_qdir.cpp @@ -93,6 +93,9 @@ private slots: void entryList_data(); void entryList(); + void entryListWithTestFiles_data(); + void entryListWithTestFiles(); + void entryListTimedSort(); void entryListSimple_data(); @@ -717,6 +720,32 @@ void tst_QDir::entryList_data() QTest::newRow("resources2") << QString(":/tst_qdir/resources/entryList") << QStringList("*.data") << (int)(QDir::Files) << (int)(QDir::NoSort) << QString("file1.data,file2.data,file3.data").split(','); +} + +void tst_QDir::entryList() +{ + QFETCH(QString, dirName); + QFETCH(QStringList, nameFilters); + QFETCH(int, filterspec); + QFETCH(int, sortspec); + QFETCH(QStringList, expected); + + QDir dir(dirName); + QVERIFY2(dir.exists(), msgDoesNotExist(dirName).constData()); + + QStringList actual = dir.entryList(nameFilters, (QDir::Filters)filterspec, + (QDir::SortFlags)sortspec); + + QCOMPARE(actual, expected); +} + +void tst_QDir::entryListWithTestFiles_data() +{ + QTest::addColumn("dirName"); // relative from current path or abs + QTest::addColumn("nameFilters"); + QTest::addColumn("filterspec"); + QTest::addColumn("sortspec"); + QTest::addColumn("expected"); QTest::newRow("nofilter") << (m_dataPath + "/entrylist/") << QStringList("*") << int(QDir::NoFilter) << int(QDir::Name) @@ -823,7 +852,7 @@ void tst_QDir::entryList_data() << QString("c,b,a,a.a,a.b,a.c,b.b,b.c,b.a,c.c,c.b,c.a,f.c,f.b,f.a,f,e.c,e.b,e.a,e,d.c,d.b,d.a,d").split(','); } -void tst_QDir::entryList() +void tst_QDir::entryListWithTestFiles() { QFETCH(QString, dirName); QFETCH(QStringList, nameFilters); @@ -831,28 +860,49 @@ void tst_QDir::entryList() QFETCH(int, sortspec); QFETCH(QStringList, expected); + QStringList testFiles; + QString entrylistPath = (m_dataPath + "/entrylist/"); - QFile(entrylistPath + "writable").open(QIODevice::ReadWrite); - QFile(entrylistPath + "file").setPermissions(QFile::ReadOwner | QFile::ReadUser); - QFile::remove(entrylistPath + "linktofile"); - QFile::remove(entrylistPath + "linktodirectory"); - QFile::remove(entrylistPath + "linktofile.lnk"); - QFile::remove(entrylistPath + "linktodirectory.lnk"); - QFile::remove(entrylistPath + "brokenlink.lnk"); - QFile::remove(entrylistPath + "brokenlink"); + + { + const QString writableFileName = entrylistPath + "writable"; + QFile writableFile(writableFileName); + testFiles.append(writableFileName); + + QVERIFY2(writableFile.open(QIODevice::ReadWrite), + qPrintable(writableFile.errorString())); + } + + { + QFile readOnlyFile(entrylistPath + "file"); + QVERIFY2(readOnlyFile.setPermissions(QFile::ReadOwner | QFile::ReadUser), + qPrintable(readOnlyFile.errorString())); + } + #ifndef Q_NO_SYMLINKS #if defined(Q_OS_WIN) // ### Sadly, this is a platform difference right now. // Note we are using capital L in entryList on one side here, to test case-insensitivity - QFile::link((m_dataPath + "/entryList/") + "file", entrylistPath + "linktofile.lnk"); - QFile::link((m_dataPath + "/entryList/") + "directory", entrylistPath + "linktodirectory.lnk"); - QFile::link((m_dataPath + "/entryList/") + "nothing", entrylistPath + "brokenlink.lnk"); + const QVector > symLinks = + { + {m_dataPath + "/entryList/file", entrylistPath + "linktofile.lnk"}, + {m_dataPath + "/entryList/directory", entrylistPath + "linktodirectory.lnk"}, + {m_dataPath + "/entryList/nothing", entrylistPath + "brokenlink.lnk"} + }; #else - QFile::link("file", entrylistPath + "linktofile.lnk"); - QFile::link("directory", entrylistPath + "linktodirectory.lnk"); - QFile::link("nothing", entrylistPath + "brokenlink.lnk"); + const QVector > symLinks = + { + {"file", entrylistPath + "linktofile.lnk"}, + {"directory", entrylistPath + "linktodirectory.lnk"}, + {"nothing", entrylistPath + "brokenlink.lnk"} + }; #endif + for (const auto &symLink : symLinks) { + QVERIFY2(QFile::link(symLink.first, symLink.second), + qPrintable(symLink.first + "->" + symLink.second)); + testFiles.append(symLink.second); + } #endif //Q_NO_SYMLINKS QDir dir(dirName); @@ -861,8 +911,6 @@ void tst_QDir::entryList() QStringList actual = dir.entryList(nameFilters, (QDir::Filters)filterspec, (QDir::SortFlags)sortspec); - int max = qMin(actual.count(), expected.count()); - bool doContentCheck = true; #if defined(Q_OS_UNIX) if (qstrcmp(QTest::currentDataTag(), "QDir::AllEntries | QDir::Writable") == 0) { @@ -872,20 +920,11 @@ void tst_QDir::entryList() } #endif - if (doContentCheck) { - for (int i=0; i= 0; --i) + QVERIFY2(QFile::remove(testFiles.at(i)), qPrintable(testFiles.at(i))); - QFile::remove(entrylistPath + "writable"); - QFile::remove(entrylistPath + "linktofile"); - QFile::remove(entrylistPath + "linktodirectory"); - QFile::remove(entrylistPath + "linktofile.lnk"); - QFile::remove(entrylistPath + "linktodirectory.lnk"); - QFile::remove(entrylistPath + "brokenlink.lnk"); - QFile::remove(entrylistPath + "brokenlink"); + if (doContentCheck) + QCOMPARE(actual, expected); } void tst_QDir::entryListTimedSort() -- cgit v1.2.3 From 8f32e34734832013da9be7a2d794ca2125113a7e Mon Sep 17 00:00:00 2001 From: Stephan Binner Date: Sat, 29 Apr 2017 19:52:43 +0200 Subject: Fix build for -no-feature-icu -no-feature-textcodec Change-Id: Ibb19e5bce3da81518f0967ae7677f42de80ec73e Reviewed-by: Thiago Macieira --- src/corelib/configure.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/configure.json b/src/corelib/configure.json index 2b3efbeb15..6399e4d3c4 100644 --- a/src/corelib/configure.json +++ b/src/corelib/configure.json @@ -241,7 +241,7 @@ "label": "iconv", "purpose": "Provides internationalization on Unix.", "section": "Internationalization", - "condition": "!features.icu && (features.posix-libiconv || features.sun-libiconv || features.gnu-libiconv)", + "condition": "!features.icu && features.textcodec && (features.posix-libiconv || features.sun-libiconv || features.gnu-libiconv)", "output": [ "privateFeature", "feature" ] }, "posix-libiconv": { -- cgit v1.2.3 From 7c2850cd8f1029b74d960fad5754320b61176f46 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 24 Jul 2017 09:35:12 +0200 Subject: QEventDispatcherWin32: Check for WM_QT_SOCKETNOTIFIER on internal window only Restrict the checking to the internal window handle to prevent it being thrown off by other WM_USER messages used by applications. Complements change 124b9a6ff89da8be83a256135ec6c4d0603e9a6f. Task-number: QTBUG-62083 Change-Id: Ifb1b00e4ff70cb7e53873943e46cea0d72ff6257 Reviewed-by: Alex Trotsenko Reviewed-by: Thiago Macieira --- src/corelib/kernel/qeventdispatcher_win.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/corelib/kernel/qeventdispatcher_win.cpp b/src/corelib/kernel/qeventdispatcher_win.cpp index 0952464f53..7a6149b405 100644 --- a/src/corelib/kernel/qeventdispatcher_win.cpp +++ b/src/corelib/kernel/qeventdispatcher_win.cpp @@ -207,7 +207,8 @@ LRESULT QT_WIN_CALLBACK qt_internal_proc(HWND hwnd, UINT message, WPARAM wp, LPA // in the queue. WM_QT_ACTIVATENOTIFIERS will be posted again as a result of // event processing. MSG msg; - if (!PeekMessage(&msg, 0, WM_QT_SOCKETNOTIFIER, WM_QT_SOCKETNOTIFIER, PM_NOREMOVE) + if (!PeekMessage(&msg, d->internalHwnd, + WM_QT_SOCKETNOTIFIER, WM_QT_SOCKETNOTIFIER, PM_NOREMOVE) && d->queuedSocketEvents.isEmpty()) { // register all socket notifiers for (QSFDict::iterator it = d->active_fd.begin(), end = d->active_fd.end(); -- cgit v1.2.3 From 6adff20fe6afe8d17db2d8183506abd2792789bd Mon Sep 17 00:00:00 2001 From: Alex Trotsenko Date: Thu, 15 Jun 2017 20:16:21 +0300 Subject: Fix bytesAvailable() on UDP under Windows When ::WSAIoctl() reports 1 byte available for reading, we are trying to peek an incoming datagram to ensure that the data is actually delivered. But, according to MSDN docs, we are not allowed to pass NULL as 'lpNumberOfBytesRecvd' parameter to ::WSARecvFrom() call, if 'lpOverlapped' parameter is also NULL. The case with an empty datagram is fixed accordingly. Change-Id: Id13038245332d3fb4bc18038d44a7cfd7ce04775 Reviewed-by: Edward Welbourne Reviewed-by: Thiago Macieira --- src/network/socket/qnativesocketengine_win.cpp | 5 ++++- tests/auto/network/socket/qudpsocket/BLACKLIST | 1 - 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/network/socket/qnativesocketengine_win.cpp b/src/network/socket/qnativesocketengine_win.cpp index a09d611e89..eb633eb1d2 100644 --- a/src/network/socket/qnativesocketengine_win.cpp +++ b/src/network/socket/qnativesocketengine_win.cpp @@ -1090,11 +1090,14 @@ qint64 QNativeSocketEnginePrivate::nativeBytesAvailable() const WSABUF buf; buf.buf = &c; buf.len = sizeof(c); + DWORD bytesReceived; DWORD flags = MSG_PEEK; - if (::WSARecvFrom(socketDescriptor, &buf, 1, 0, &flags, 0,0,0,0) == SOCKET_ERROR) { + if (::WSARecvFrom(socketDescriptor, &buf, 1, &bytesReceived, &flags, 0,0,0,0) == SOCKET_ERROR) { int err = WSAGetLastError(); if (err != WSAECONNRESET && err != WSAENETRESET) return 0; + } else { + return bytesReceived; } } return nbytes; diff --git a/tests/auto/network/socket/qudpsocket/BLACKLIST b/tests/auto/network/socket/qudpsocket/BLACKLIST index cf25c96fd8..5adb05d3f2 100644 --- a/tests/auto/network/socket/qudpsocket/BLACKLIST +++ b/tests/auto/network/socket/qudpsocket/BLACKLIST @@ -6,7 +6,6 @@ osx windows osx [asyncReadDatagram] -windows osx [multicastLeaveAfterClose] osx -- cgit v1.2.3 From 79737d03bc7f8b15bd0344848d58a36a580a59ae Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Thu, 27 Jul 2017 10:29:24 +0200 Subject: Windows: Simplify generic tool description Make the tool description even simpler so that e.g. moc shows up as "Qt Moc". The 'description' is shown in various places as the mere title, so it shouldn't be too verbose. This augments change ad68bf51e7. Task-number: QTBUG-61970 Change-Id: I4b30b95a10d597a9a8a2c388c2381ea38a340be6 Reviewed-by: Oswald Buddenhagen --- mkspecs/features/qt_tool.prf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mkspecs/features/qt_tool.prf b/mkspecs/features/qt_tool.prf index 4ba2b54623..05cb4335ab 100644 --- a/mkspecs/features/qt_tool.prf +++ b/mkspecs/features/qt_tool.prf @@ -11,8 +11,8 @@ CONFIG += no_launch_target isEmpty(VERSION): VERSION = $$MODULE_VERSION -isEmpty(QMAKE_TARGET_DESCRIPTION): QMAKE_TARGET_DESCRIPTION = \ - "Tool for the Qt Application Development Framework ($$TARGET)" +isEmpty(QMAKE_TARGET_DESCRIPTION): \ + QMAKE_TARGET_DESCRIPTION = "Qt $$title($$TARGET)" load(qt_app) CONFIG += console -- cgit v1.2.3 From 6b7b37cf2e3a9bccecf6f4c03eab7ee5b9e1b255 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Thu, 27 Jul 2017 10:32:23 +0200 Subject: Windows: Automatically set metadata for all Qt apps Move the logic to set default values for VERSION, QMAKE_TARGET_DESCRIPTION to qt_app.prf. This way, a lot more executables get sane defaults. Change-Id: I8394418c118a8877cec792eddc8894397c0fbf2d Reviewed-by: Oswald Buddenhagen --- mkspecs/features/qt_app.prf | 4 ++++ mkspecs/features/qt_tool.prf | 3 --- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/mkspecs/features/qt_app.prf b/mkspecs/features/qt_app.prf index cb84ae0da8..883f8ca215 100644 --- a/mkspecs/features/qt_app.prf +++ b/mkspecs/features/qt_app.prf @@ -14,6 +14,10 @@ TEMPLATE = app load(qt_build_paths) DESTDIR = $$MODULE_BASE_OUTDIR/bin +isEmpty(VERSION): VERSION = $$MODULE_VERSION +isEmpty(QMAKE_TARGET_DESCRIPTION): \ + QMAKE_TARGET_DESCRIPTION = "Qt $$title($$TARGET)" + isEmpty(QMAKE_INFO_PLIST): CONFIG -= app_bundle # This decreases the binary size for tools if statically linked diff --git a/mkspecs/features/qt_tool.prf b/mkspecs/features/qt_tool.prf index 05cb4335ab..a8d589f0fa 100644 --- a/mkspecs/features/qt_tool.prf +++ b/mkspecs/features/qt_tool.prf @@ -10,9 +10,6 @@ # CONFIG += no_launch_target -isEmpty(VERSION): VERSION = $$MODULE_VERSION -isEmpty(QMAKE_TARGET_DESCRIPTION): \ - QMAKE_TARGET_DESCRIPTION = "Qt $$title($$TARGET)" load(qt_app) CONFIG += console -- cgit v1.2.3 From 256854cf9760f2b8e8702c2ce2066f67213c0169 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Fri, 28 Jul 2017 10:54:44 +0200 Subject: Windows/QFileSystemModel: Fix updating of removed drives Previously, the updating of drives in QFileSystemModel was connected to a signal triggering when a drive containing watched files was removed via QFileSystemWatcher notification. This did not trigger when a drive that was not expanded in the view was removed, since no files were watched. Since QFileSystemModel is not interested in the path of the drive being removed, add a generic signal triggered by DBT_DEVTYP_VOLUME/DBT_DEVICEREMOVECOMPLETE and use that to update the drives. Complements 8e79806d08ab77aa0f87b69a2ef65789216f41c0. Task-number: QTBUG-18729 Task-number: QTBUG-53436 Change-Id: Ibcde4665824c41151042237d4d620c48bc1e2e18 Reviewed-by: Oliver Wolff Reviewed-by: Joerg Bornemann --- src/corelib/io/qfilesystemwatcher_win.cpp | 9 ++++++--- src/widgets/dialogs/qfileinfogatherer.cpp | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/corelib/io/qfilesystemwatcher_win.cpp b/src/corelib/io/qfilesystemwatcher_win.cpp index ff0d45935c..2b5cb63282 100644 --- a/src/corelib/io/qfilesystemwatcher_win.cpp +++ b/src/corelib/io/qfilesystemwatcher_win.cpp @@ -113,7 +113,8 @@ public: signals: void driveAdded(); - void driveRemoved(const QString &); + void driveRemoved(); // Some drive removed + void driveRemoved(const QString &); // Watched/known drive removed void driveLockForRemoval(const QString &); void driveLockForRemovalFailed(const QString &); @@ -252,7 +253,8 @@ inline void QWindowsRemovableDriveListener::handleDbtDriveArrivalRemoval(const M case DBT_DEVICEARRIVAL: emit driveAdded(); break; - case DBT_DEVICEREMOVECOMPLETE: // handled by DBT_DEVTYP_HANDLE above + case DBT_DEVICEREMOVECOMPLETE: // See above for handling of drives registered with watchers + emit driveRemoved(); break; } } @@ -348,7 +350,8 @@ QWindowsFileSystemWatcherEngine::QWindowsFileSystemWatcherEngine(QObject *parent this, &QWindowsFileSystemWatcherEngine::driveLockForRemoval); QObject::connect(m_driveListener, &QWindowsRemovableDriveListener::driveLockForRemovalFailed, this, &QWindowsFileSystemWatcherEngine::driveLockForRemovalFailed); - QObject::connect(m_driveListener, &QWindowsRemovableDriveListener::driveRemoved, + QObject::connect(m_driveListener, + QOverload::of(&QWindowsRemovableDriveListener::driveRemoved), this, &QWindowsFileSystemWatcherEngine::driveRemoved); #endif // !Q_OS_WINRT } diff --git a/src/widgets/dialogs/qfileinfogatherer.cpp b/src/widgets/dialogs/qfileinfogatherer.cpp index 9f2d15d31b..710ee611b9 100644 --- a/src/widgets/dialogs/qfileinfogatherer.cpp +++ b/src/widgets/dialogs/qfileinfogatherer.cpp @@ -98,7 +98,7 @@ QFileInfoGatherer::QFileInfoGatherer(QObject *parent) if (listener.canConvert()) { if (QObject *driveListener = listener.value()) { connect(driveListener, SIGNAL(driveAdded()), this, SLOT(driveAdded())); - connect(driveListener, SIGNAL(driveRemoved(QString)), this, SLOT(driveRemoved())); + connect(driveListener, SIGNAL(driveRemoved()), this, SLOT(driveRemoved())); } } # endif // Q_OS_WIN && !Q_OS_WINRT -- cgit v1.2.3 From 286c53f217d5a8d634cb2b8c08d2c5a3db67158b Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Mon, 12 Jun 2017 13:33:46 +0200 Subject: Fix composition on xcb with misconfigured ibus MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If ibus has been set, but either isn't installed or doesn't launch, all composition fails on xcb. This ensures we fallback to "compose" which is needed for working composition on XCB. Change-Id: Ic2061c330bcb907759a13920c3eede14f3036563 Reviewed-by: René J.V. Bertin Reviewed-by: Thiago Macieira --- src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.cpp | 2 +- src/plugins/platforms/xcb/qxcbintegration.cpp | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.cpp b/src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.cpp index eb9e9c8b8d..6df454adb0 100644 --- a/src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.cpp +++ b/src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.cpp @@ -133,7 +133,7 @@ QIBusPlatformInputContext::~QIBusPlatformInputContext (void) bool QIBusPlatformInputContext::isValid() const { - return d->valid; + return d->valid && d->busConnected; } void QIBusPlatformInputContext::invokeAction(QInputMethod::Action a, int) diff --git a/src/plugins/platforms/xcb/qxcbintegration.cpp b/src/plugins/platforms/xcb/qxcbintegration.cpp index 859b55b0d8..b372ecd7c4 100644 --- a/src/plugins/platforms/xcb/qxcbintegration.cpp +++ b/src/plugins/platforms/xcb/qxcbintegration.cpp @@ -289,12 +289,15 @@ QAbstractEventDispatcher *QXcbIntegration::createEventDispatcher() const void QXcbIntegration::initialize() { + const QLatin1String defaultInputContext("compose"); // Perform everything that may potentially need the event dispatcher (timers, socket // notifiers) here instead of the constructor. QString icStr = QPlatformInputContextFactory::requested(); if (icStr.isNull()) - icStr = QLatin1String("compose"); + icStr = defaultInputContext; m_inputContext.reset(QPlatformInputContextFactory::create(icStr)); + if (!m_inputContext && icStr != defaultInputContext && icStr != QLatin1String("none")) + m_inputContext.reset(QPlatformInputContextFactory::create(defaultInputContext)); } void QXcbIntegration::moveToScreen(QWindow *window, int screen) -- cgit v1.2.3 From b7a898b8fee7552fb319f3fbdd44a23a3dc26919 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9rgio=20Martins?= Date: Fri, 28 Jul 2017 22:20:43 +0100 Subject: android-clang: Use -Oz instead of -Os to produce smaller binaries For clang -Os is very similar to -O2 and doesn't really reduce size much. -Oz is usually what you want to use with clang for code reduction. Now clang binaries are only 9% bigger than gcc's, instead of 22%. Change-Id: Ib0ba560be26db68aeb21c13df4b151b7fbd81431 Reviewed-by: BogDan Vatra Reviewed-by: Oswald Buddenhagen --- mkspecs/common/android-base-tail.conf | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/mkspecs/common/android-base-tail.conf b/mkspecs/common/android-base-tail.conf index 2610918c4e..3f1b414d3f 100644 --- a/mkspecs/common/android-base-tail.conf +++ b/mkspecs/common/android-base-tail.conf @@ -15,8 +15,14 @@ QMAKE_CFLAGS += --sysroot=$$ANDROID_PLATFORM_ROOT_PATH QMAKE_CFLAGS_WARN_ON = -Wall -W QMAKE_CFLAGS_WARN_OFF = equals(ANDROID_TARGET_ARCH, armeabi-v7a) | equals(ANDROID_TARGET_ARCH, armeabi) { - QMAKE_CFLAGS_RELEASE = -Os - QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO = -g -Os + contains(QMAKE_COMPILER, clang) { + QMAKE_CFLAGS_RELEASE = -Oz + QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO = -g -Oz + } else { + QMAKE_CFLAGS_RELEASE = -Os + QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO = -g -Os + } + QMAKE_CFLAGS_DEBUG = -g -marm -O0 equals(ANDROID_TARGET_ARCH, armeabi):if(equals(NDK_TOOLCHAIN_VERSION, 4.8)|equals(NDK_TOOLCHAIN_VERSION, 4.9)) { DEFINES += QT_OS_ANDROID_GCC_48_WORKAROUND -- cgit v1.2.3 From 0a5f71c6062d575602ff041fb1b88ec2d8ad92bc Mon Sep 17 00:00:00 2001 From: Joni Poikelin Date: Fri, 14 Jul 2017 09:25:54 +0300 Subject: Fix storing of QDateTime timespec for Sqlite Commit 9e64fc9e1cebf1e11694c4f536881128f5aee288 caused a regression which stored all QDateTime entries as if they were in localtime, which causes them to be offset by the amount of local timezone offset. This is fixed by adding "Z" if the time should be in UTC or using "+/-hh:mm" if it should use fixed UTC offset or specific timezone. Task-number: QTBUG-57138 Change-Id: Ie60905dfb3a517db442b636ca41daf8348753d84 Reviewed-by: Edward Welbourne Reviewed-by: Andy Shaw --- src/plugins/sqldrivers/sqlite/qsql_sqlite.cpp | 29 ++++++++++++++++- tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp | 38 +++++++++++++++++++++++ 2 files changed, 66 insertions(+), 1 deletion(-) diff --git a/src/plugins/sqldrivers/sqlite/qsql_sqlite.cpp b/src/plugins/sqldrivers/sqlite/qsql_sqlite.cpp index 1cb0f10494..13ec024924 100644 --- a/src/plugins/sqldrivers/sqlite/qsql_sqlite.cpp +++ b/src/plugins/sqldrivers/sqlite/qsql_sqlite.cpp @@ -51,6 +51,7 @@ #include #include #include +#include #if defined Q_OS_WIN # include @@ -410,6 +411,32 @@ bool QSQLiteResult::prepare(const QString &query) return true; } +static QString secondsToOffset(int seconds) +{ + const QChar sign = ushort(seconds < 0 ? '-' : '+'); + seconds = qAbs(seconds); + const int hours = seconds / 3600; + const int minutes = (seconds % 3600) / 60; + + return QString(QStringLiteral("%1%2:%3")).arg(sign).arg(hours, 2, 10, QLatin1Char('0')).arg(minutes, 2, 10, QLatin1Char('0')); +} + +static QString timespecToString(const QDateTime &dateTime) +{ + switch (dateTime.timeSpec()) { + case Qt::LocalTime: + return QString(); + case Qt::UTC: + return QStringLiteral("Z"); + case Qt::OffsetFromUTC: + return secondsToOffset(dateTime.offsetFromUtc()); + case Qt::TimeZone: + return secondsToOffset(dateTime.timeZone().offsetFromUtc(dateTime)); + default: + return QString(); + } +} + bool QSQLiteResult::exec() { Q_D(QSQLiteResult); @@ -456,7 +483,7 @@ bool QSQLiteResult::exec() break; case QVariant::DateTime: { const QDateTime dateTime = value.toDateTime(); - const QString str = dateTime.toString(QStringLiteral("yyyy-MM-ddThh:mm:ss.zzz")); + const QString str = dateTime.toString(QStringLiteral("yyyy-MM-ddThh:mm:ss.zzz") + timespecToString(dateTime)); res = sqlite3_bind_text16(d->stmt, i + 1, str.utf16(), str.size() * sizeof(ushort), SQLITE_TRANSIENT); break; diff --git a/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp b/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp index 8deb5ddf8f..35f86772e2 100644 --- a/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp +++ b/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp @@ -243,6 +243,9 @@ private slots: void integralTypesMysql_data() { generic_data("QMYSQL"); } void integralTypesMysql(); + void QTBUG_57138_data() { generic_data("QSQLITE"); } + void QTBUG_57138(); + private: // returns all database connections void generic_data(const QString &engine=QString()); @@ -4083,5 +4086,40 @@ void tst_QSqlQuery::integralTypesMysql() } } +void tst_QSqlQuery::QTBUG_57138() +{ + QDateTime utc = QDateTime(QDate(2150, 1, 5), QTime(14, 0, 0, 123), Qt::UTC); + QDateTime localtime = QDateTime(QDate(2150, 1, 5), QTime(14, 0, 0, 123), Qt::LocalTime); + QDateTime tzoffset = QDateTime(QDate(2150, 1, 5), QTime(14, 0, 0, 123), Qt::OffsetFromUTC, 3600); + + QFETCH(QString, dbName); + QSqlDatabase db = QSqlDatabase::database(dbName); + CHECK_DATABASE(db); + + QSqlQuery create(db); + QString tableName = qTableName("qtbug57138", __FILE__, db); + + QVERIFY_SQL(create, exec("create table " + tableName + " (id int, dt_utc datetime, dt_lt datetime, dt_tzoffset datetime)")); + QVERIFY_SQL(create, prepare("insert into " + tableName + " (id, dt_utc, dt_lt, dt_tzoffset) values (?, ?, ?, ?)")); + + create.addBindValue(0); + create.addBindValue(utc); + create.addBindValue(localtime); + create.addBindValue(tzoffset); + + QVERIFY_SQL(create, exec()); + + QSqlQuery q(db); + q.prepare("SELECT dt_utc, dt_lt, dt_tzoffset FROM " + tableName + " WHERE id = ?"); + q.addBindValue(0); + + QVERIFY_SQL(q, exec()); + QVERIFY(q.next()); + + QCOMPARE(q.value(0).toDateTime(), utc); + QCOMPARE(q.value(1).toDateTime(), localtime); + QCOMPARE(q.value(2).toDateTime(), tzoffset); +} + QTEST_MAIN( tst_QSqlQuery ) #include "tst_qsqlquery.moc" -- cgit v1.2.3 From f8df9bb277a7033a2588d320122e745a35ebbe43 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Wed, 2 Aug 2017 11:35:25 +0200 Subject: Fix precisions check for using fast transforms The coordinates need to be representable in signed 16-bit not unsigned. Task-number: QTBUG-62251 Change-Id: I1d4aaa2fb90b8f428380277d5b4e416a4672ee6a Reviewed-by: Eirik Aavitsland --- src/gui/painting/qpaintengine_raster.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp index eb43453ddb..f99a247270 100644 --- a/src/gui/painting/qpaintengine_raster.cpp +++ b/src/gui/painting/qpaintengine_raster.cpp @@ -2339,8 +2339,8 @@ void QRasterPaintEngine::drawImage(const QRectF &r, const QImage &img, const QRe if (s->matrix.type() > QTransform::TxTranslate || stretch_sr) { QRectF targetBounds = s->matrix.mapRect(r); - bool exceedsPrecision = targetBounds.width() > 0xffff - || targetBounds.height() > 0xffff; + bool exceedsPrecision = targetBounds.width() > 0x7fff + || targetBounds.height() > 0x7fff; if (!exceedsPrecision && d->canUseFastImageBlending(d->rasterBuffer->compositionMode, img)) { if (s->matrix.type() > QTransform::TxScale) { -- cgit v1.2.3 From 30d32ae72cccca816429d12c371fc23fe46c80c4 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Wed, 2 Aug 2017 14:41:26 +0200 Subject: Ignore failures of submenuTearOffDontClose on macOS 10.12 Change-Id: Ie3409da033325aea832907579d4d61dfd3610e7a Task-number: QTQAINFRA-1358 Reviewed-by: Frederik Gladhorn --- tests/auto/widgets/widgets/qmenu/BLACKLIST | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/auto/widgets/widgets/qmenu/BLACKLIST b/tests/auto/widgets/widgets/qmenu/BLACKLIST index ea468b378e..cfd6bb1247 100644 --- a/tests/auto/widgets/widgets/qmenu/BLACKLIST +++ b/tests/auto/widgets/widgets/qmenu/BLACKLIST @@ -2,3 +2,4 @@ osx [submenuTearOffDontClose] osx-10.11 ci +osx-10.12 ci -- cgit v1.2.3 From f3ca13f3d12f52c60f4cd41d0b336c24a8d3359d Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Wed, 2 Aug 2017 14:43:16 +0200 Subject: Ignore failures of showMinimizedKeepsFocus/activateWindow on macOS 10.12 Change-Id: I1b5823b48c5dd5bebb8172fd696fc521b7de75b2 Task-number: QTQAINFRA-1359 Reviewed-by: Frederik Gladhorn --- tests/auto/widgets/kernel/qwidget/BLACKLIST | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/auto/widgets/kernel/qwidget/BLACKLIST b/tests/auto/widgets/kernel/qwidget/BLACKLIST index ab45a342e3..0750526464 100644 --- a/tests/auto/widgets/kernel/qwidget/BLACKLIST +++ b/tests/auto/widgets/kernel/qwidget/BLACKLIST @@ -48,6 +48,7 @@ osx [showMinimizedKeepsFocus] osx-10.10 osx-10.11 ci +osx-10.12 ci [moveWindowInShowEvent:1] osx [moveWindowInShowEvent:2] @@ -75,3 +76,5 @@ osx-10.9 ubuntu-14.04 [moveChild:right] osx +[activateWindow] +osx-10.12 ci -- cgit v1.2.3 From d1d2ca2b41bcae399ed2ec563933e0725bffc075 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Wed, 2 Aug 2017 15:04:02 +0200 Subject: Ignore hanging tst_qinputdialog::getInt/getDouble() test on macOS 10.12 Change-Id: I495cd98144ba9145e44a9ee5cb8748ae97a6166f Task-number: QTQAINFRA-1356 Reviewed-by: Simon Hausmann --- .../widgets/dialogs/qinputdialog/tst_qinputdialog.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/auto/widgets/dialogs/qinputdialog/tst_qinputdialog.cpp b/tests/auto/widgets/dialogs/qinputdialog/tst_qinputdialog.cpp index 4ea0de5ab9..8da6ef0363 100644 --- a/tests/auto/widgets/dialogs/qinputdialog/tst_qinputdialog.cpp +++ b/tests/auto/widgets/dialogs/qinputdialog/tst_qinputdialog.cpp @@ -257,6 +257,14 @@ void tst_QInputDialog::getInt() QFETCH(int, min); QFETCH(int, max); QVERIFY(min < max); + +#if defined(Q_OS_MACOS) + if (QSysInfo::productVersion() == QLatin1String("10.12")) { + QSKIP("Test hangs on macOS 10.12 -- QTQAINFRA-1356"); + return; + } +#endif + parent = new QWidget; doneCode = QDialog::Accepted; testFunc = &tst_QInputDialog::testFuncGetInt; @@ -297,6 +305,14 @@ void tst_QInputDialog::getDouble() QFETCH(double, max); QFETCH(int, decimals); QVERIFY(min < max && decimals >= 0 && decimals <= 13); + +#if defined(Q_OS_MACOS) + if (QSysInfo::productVersion() == QLatin1String("10.12")) { + QSKIP("Test hangs on macOS 10.12 -- QTQAINFRA-1356"); + return; + } +#endif + parent = new QWidget; doneCode = QDialog::Accepted; testFunc = &tst_QInputDialog::testFuncGetDouble; -- cgit v1.2.3 From fe9be10b9258f52c30fe5963207f96c791d6d795 Mon Sep 17 00:00:00 2001 From: Jesus Fernandez Date: Tue, 25 Jul 2017 13:26:24 +0200 Subject: Add a Q_FALLTHROUGH MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CID 11161 (#1 of 1): Missing break in switch (MISSING_BREAK) unterminated_case: The case for value Qt::BottomToolBarArea is not terminated by a 'break' statement. Coverity-Id: 11161 Change-Id: Ie254d0339e41a58004632e9997febac4a1ab4edd Reviewed-by: Jan Arve Sæther --- src/widgets/styles/qwindowsstyle.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/widgets/styles/qwindowsstyle.cpp b/src/widgets/styles/qwindowsstyle.cpp index 1c51360c1f..63f7cd43ef 100644 --- a/src/widgets/styles/qwindowsstyle.cpp +++ b/src/widgets/styles/qwindowsstyle.cpp @@ -1621,6 +1621,7 @@ void QWindowsStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPai default: break; } + Q_FALLTHROUGH(); // It continues in the end of the next case case Qt::TopToolBarArea : switch(toolbar->positionWithinLine){ case QStyleOptionToolBar::Beginning: -- cgit v1.2.3 From 6f735b683948f24b47cd6da1fccbc3bd7c5400e3 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 28 Jul 2017 17:42:27 +0200 Subject: configure: factor out $$qtConfScalarOrList() we'll need it in more places. Change-Id: Ia7e3d9ea4a27cc01294bde4cafe6721eb9f59343 Reviewed-by: Thiago Macieira --- mkspecs/features/qt_configure.prf | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/mkspecs/features/qt_configure.prf b/mkspecs/features/qt_configure.prf index f3db6b467d..4b2ba560fb 100644 --- a/mkspecs/features/qt_configure.prf +++ b/mkspecs/features/qt_configure.prf @@ -34,6 +34,18 @@ defineTest(qtConfFatalError) { error() } +# Return a string list for the specified JSON path, which may be either a +# single string or an array of strings. +# Note that this returns a variable name, so it can be directly iterated over. +defineReplace(qtConfScalarOrList) { + defined($$1, var): return($$1) + vals = $$list() + for (i, $${1}._KEYS_): \ + $$vals += $$eval($${1}.$$i) + export($$vals) + return($$vals) +} + defineTest(qtConfCommandlineSetInput) { arg = $${1} val = $${2} @@ -1340,17 +1352,10 @@ defineTest(qtConfCheckFeature) { # feature not auto-detected and not explicitly enabled result = false } else { - condition = $$eval($${fpfx}.condition) - !isEmpty(condition) { + result = true + for (condition, $$qtConfScalarOrList($${fpfx}.condition)) { result = $$qtConfCheckSingleCondition($$1, $$condition, $$enabled) - } else { - result = true - # check whether we have an array of conditions - for (i, $${fpfx}.condition._KEYS_) { - condition = $$eval($${fpfx}.condition.$$i) - result = $$qtConfCheckSingleCondition($$1, $$condition, $$enabled) - !$$result: break() - } + !$$result: break() } } $${fpfx}.available = $$result -- cgit v1.2.3 From 479b2ab55f45f392ee3a9ad36dca25279bac1a8c Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 28 Jul 2017 22:52:05 +0200 Subject: configure: get rid of indirect #defines in gl tests in the gles tests, use #ifdef __APPLE__ directly instead of defining BUILD_ON_MAC. this is consistent with the desktop gl test, less magic, and corresponds with the later usage (which does #ifdef Q_OS_MAC). amends f3d82a89. in the desktop gl test, clean out the dead Q_OS_MAC define from the project file (added in 45dc5852 concurrently to the more direct fix in 864815ef). Change-Id: Ieebad3c7e87218b887f61485c331b93eadfcf406 Reviewed-by: Thiago Macieira Reviewed-by: Laszlo Agocs Reviewed-by: Jake Petroules --- config.tests/unix/opengldesktop/opengldesktop.pro | 2 -- config.tests/unix/opengles2/opengles2.cpp | 2 +- config.tests/unix/opengles2/opengles2.pro | 4 ---- config.tests/unix/opengles3/opengles3.cpp | 2 +- config.tests/unix/opengles3/opengles3.pro | 4 ---- 5 files changed, 2 insertions(+), 12 deletions(-) diff --git a/config.tests/unix/opengldesktop/opengldesktop.pro b/config.tests/unix/opengldesktop/opengldesktop.pro index 22c0be247d..7b53aa460d 100644 --- a/config.tests/unix/opengldesktop/opengldesktop.pro +++ b/config.tests/unix/opengldesktop/opengldesktop.pro @@ -1,5 +1,3 @@ SOURCES = opengldesktop.cpp CONFIG -= qt - -mac:DEFINES += Q_OS_MAC diff --git a/config.tests/unix/opengles2/opengles2.cpp b/config.tests/unix/opengles2/opengles2.cpp index a9ad0d6766..39a48dcf29 100644 --- a/config.tests/unix/opengles2/opengles2.cpp +++ b/config.tests/unix/opengles2/opengles2.cpp @@ -37,7 +37,7 @@ ** ****************************************************************************/ -#ifdef BUILD_ON_MAC +#ifdef __APPLE__ #include #else #define GL_GLEXT_PROTOTYPES diff --git a/config.tests/unix/opengles2/opengles2.pro b/config.tests/unix/opengles2/opengles2.pro index c84563f62e..15e4ce3ca0 100644 --- a/config.tests/unix/opengles2/opengles2.pro +++ b/config.tests/unix/opengles2/opengles2.pro @@ -1,7 +1,3 @@ SOURCES = opengles2.cpp CONFIG -= qt - -mac { - DEFINES += BUILD_ON_MAC -} diff --git a/config.tests/unix/opengles3/opengles3.cpp b/config.tests/unix/opengles3/opengles3.cpp index b5bf9b4a80..7bcfc0e4bc 100644 --- a/config.tests/unix/opengles3/opengles3.cpp +++ b/config.tests/unix/opengles3/opengles3.cpp @@ -37,7 +37,7 @@ ** ****************************************************************************/ -#ifdef BUILD_ON_MAC +#ifdef __APPLE__ #include #else #define GL_GLEXT_PROTOTYPES diff --git a/config.tests/unix/opengles3/opengles3.pro b/config.tests/unix/opengles3/opengles3.pro index 956a3bc102..dc62f7856a 100644 --- a/config.tests/unix/opengles3/opengles3.pro +++ b/config.tests/unix/opengles3/opengles3.pro @@ -5,7 +5,3 @@ SOURCES = opengles3.cpp CONFIG -= qt - -mac { - DEFINES += BUILD_ON_MAC -} -- cgit v1.2.3 From aaed0530fd59b9c6c6f10ee4c815d492f0214fa1 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 28 Jul 2017 23:14:33 +0200 Subject: configure: don't force debug build for arch & cpu feature tests amends b4525b3407, which gives no indication for why this was done. judging by other tests, it wasn't cargo-culted. i presume it was just about disabling debug-and-release, and the debug choice was arbitrary. the central system nowadays does the same, just that it uses release. amends 1533bfc5fc, which certainly _was_ cargo-culted from the former. as a side effect, this removes some other CONFIG manipulations which are handled centrally or are wholly ineffective nowadays. Change-Id: Ib9af2837925a2f19af05506e798a26d363635735 Reviewed-by: Thiago Macieira --- config.tests/arch/arch.pro | 2 -- config.tests/common/avx/avx.pro | 2 -- config.tests/common/avx2/avx2.pro | 2 -- config.tests/common/avx512/avx512.pro | 2 -- config.tests/common/f16c/f16c.pro | 2 -- config.tests/common/sse2/sse2.pro | 2 -- config.tests/common/sse3/sse3.pro | 2 -- config.tests/common/sse4_1/sse4_1.pro | 2 -- config.tests/common/sse4_2/sse4_2.pro | 2 -- config.tests/common/ssse3/ssse3.pro | 2 -- 10 files changed, 20 deletions(-) diff --git a/config.tests/arch/arch.pro b/config.tests/arch/arch.pro index d89d70b1ee..2ffdb2c889 100644 --- a/config.tests/arch/arch.pro +++ b/config.tests/arch/arch.pro @@ -1,4 +1,2 @@ TARGET = arch SOURCES = arch.cpp -CONFIG -= qt dylib release debug_and_release -CONFIG += debug console diff --git a/config.tests/common/avx/avx.pro b/config.tests/common/avx/avx.pro index bf84089883..fde4adaea2 100644 --- a/config.tests/common/avx/avx.pro +++ b/config.tests/common/avx/avx.pro @@ -1,5 +1,3 @@ SOURCES = avx.cpp -CONFIG -= qt dylib release debug_and_release -CONFIG += debug console !defined(QMAKE_CFLAGS_AVX, "var"):error("This compiler does not support AVX") else:QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_AVX diff --git a/config.tests/common/avx2/avx2.pro b/config.tests/common/avx2/avx2.pro index 7ccf66ca28..1963bdb4b9 100644 --- a/config.tests/common/avx2/avx2.pro +++ b/config.tests/common/avx2/avx2.pro @@ -1,5 +1,3 @@ SOURCES = avx2.cpp -CONFIG -= qt dylib release debug_and_release -CONFIG += debug console !defined(QMAKE_CFLAGS_AVX2, "var"):error("This compiler does not support AVX2") else:QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_AVX2 diff --git a/config.tests/common/avx512/avx512.pro b/config.tests/common/avx512/avx512.pro index 96dddb14fd..1edf5e5432 100644 --- a/config.tests/common/avx512/avx512.pro +++ b/config.tests/common/avx512/avx512.pro @@ -1,6 +1,4 @@ SOURCES = avx512.cpp -CONFIG -= qt dylib release debug_and_release -CONFIG += debug console !defined(AVX512, "var"): error("You must set the AVX512 variable!") diff --git a/config.tests/common/f16c/f16c.pro b/config.tests/common/f16c/f16c.pro index 6b36c99d96..fcab1877c1 100644 --- a/config.tests/common/f16c/f16c.pro +++ b/config.tests/common/f16c/f16c.pro @@ -1,5 +1,3 @@ SOURCES = f16c.cpp -CONFIG -= qt dylib release debug_and_release -CONFIG += debug console !defined(QMAKE_CFLAGS_F16C, "var"):error("This compiler does not support F16C") else:QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_F16C diff --git a/config.tests/common/sse2/sse2.pro b/config.tests/common/sse2/sse2.pro index 0567eba19d..75f5266745 100644 --- a/config.tests/common/sse2/sse2.pro +++ b/config.tests/common/sse2/sse2.pro @@ -1,5 +1,3 @@ SOURCES = sse2.cpp -CONFIG -= qt dylib release debug_and_release -CONFIG += debug console !defined(QMAKE_CFLAGS_SSE2, var): error("This compiler does not support SSE2") else:QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_SSE2 diff --git a/config.tests/common/sse3/sse3.pro b/config.tests/common/sse3/sse3.pro index e2e09bac91..b26b832e22 100644 --- a/config.tests/common/sse3/sse3.pro +++ b/config.tests/common/sse3/sse3.pro @@ -1,5 +1,3 @@ SOURCES = sse3.cpp -CONFIG -= qt dylib release debug_and_release -CONFIG += debug console !defined(QMAKE_CFLAGS_SSE3, "var"):error("This compiler does not support SSE3") else:QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_SSE3 diff --git a/config.tests/common/sse4_1/sse4_1.pro b/config.tests/common/sse4_1/sse4_1.pro index 273c705efc..bee9c12adb 100644 --- a/config.tests/common/sse4_1/sse4_1.pro +++ b/config.tests/common/sse4_1/sse4_1.pro @@ -1,5 +1,3 @@ SOURCES = sse4_1.cpp -CONFIG -= qt dylib release debug_and_release -CONFIG += debug console !defined(QMAKE_CFLAGS_SSE4_1, "var"):error("This compiler does not support SSE4.1") else:QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_SSE4_1 diff --git a/config.tests/common/sse4_2/sse4_2.pro b/config.tests/common/sse4_2/sse4_2.pro index 3816fdeae9..1626ad748c 100644 --- a/config.tests/common/sse4_2/sse4_2.pro +++ b/config.tests/common/sse4_2/sse4_2.pro @@ -1,5 +1,3 @@ SOURCES = sse4_2.cpp -CONFIG -= qt dylib release debug_and_release -CONFIG += debug console !defined(QMAKE_CFLAGS_SSE4_2, "var"):error("This compiler does not support SSE4.2") else:QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_SSE4_2 diff --git a/config.tests/common/ssse3/ssse3.pro b/config.tests/common/ssse3/ssse3.pro index 597b169140..1d3aebf61d 100644 --- a/config.tests/common/ssse3/ssse3.pro +++ b/config.tests/common/ssse3/ssse3.pro @@ -1,5 +1,3 @@ SOURCES = ssse3.cpp -CONFIG -= qt dylib release debug_and_release -CONFIG += debug console !defined(QMAKE_CFLAGS_SSSE3, "var"):error("This compiler does not support SSSE3") else:QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_SSSE3 -- cgit v1.2.3 From b56846a43019355a3d302c1c2a03e40a1d61a737 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 28 Jul 2017 23:54:36 +0200 Subject: configure: remove support for obsolete platforms - #error hack for MIPSpro compiler from unix/clock-* - irix exclusions from unix/*iconv - hpux defines from unix/{getifaddrs,ipv6ifname} (the obsolete hpuxi-g++-64 spec would add them automatically anyway) Change-Id: Ib227e5626c0e8c8f6faebf76c312d77955f80b92 Reviewed-by: Thiago Macieira --- config.tests/unix/clock-gettime/clock-gettime.cpp | 2 -- config.tests/unix/clock-monotonic/clock-monotonic.cpp | 2 -- config.tests/unix/getifaddrs/getifaddrs.cpp | 4 ---- config.tests/unix/gnu-libiconv/gnu-libiconv.cpp | 4 ---- config.tests/unix/iconv/iconv.cpp | 4 ---- config.tests/unix/ipv6ifname/ipv6ifname.cpp | 4 ---- 6 files changed, 20 deletions(-) diff --git a/config.tests/unix/clock-gettime/clock-gettime.cpp b/config.tests/unix/clock-gettime/clock-gettime.cpp index 486cdc6b38..cef9f6a1ae 100644 --- a/config.tests/unix/clock-gettime/clock-gettime.cpp +++ b/config.tests/unix/clock-gettime/clock-gettime.cpp @@ -47,8 +47,6 @@ int main(int, char **) clock_gettime(CLOCK_REALTIME, &ts); #else # error "Feature _POSIX_TIMERS not available" - // MIPSpro doesn't understand #error, so force a compiler error - force_compiler_error = true; #endif return 0; } diff --git a/config.tests/unix/clock-monotonic/clock-monotonic.cpp b/config.tests/unix/clock-monotonic/clock-monotonic.cpp index 0e75ed5a59..777a6d1c21 100644 --- a/config.tests/unix/clock-monotonic/clock-monotonic.cpp +++ b/config.tests/unix/clock-monotonic/clock-monotonic.cpp @@ -47,8 +47,6 @@ int main(int, char **) clock_gettime(CLOCK_MONOTONIC, &ts); #else # error "Feature _POSIX_MONOTONIC_CLOCK not available" - // MIPSpro doesn't understand #error, so force a compiler error - force_compiler_error = true; #endif return 0; } diff --git a/config.tests/unix/getifaddrs/getifaddrs.cpp b/config.tests/unix/getifaddrs/getifaddrs.cpp index ad1ecc3fb2..a66ce4af37 100644 --- a/config.tests/unix/getifaddrs/getifaddrs.cpp +++ b/config.tests/unix/getifaddrs/getifaddrs.cpp @@ -40,10 +40,6 @@ /* Sample program for configure to test for if_nametoindex support on target platforms. */ -#if defined(__hpux) -#define _HPUX_SOURCE -#endif - #include #include #include diff --git a/config.tests/unix/gnu-libiconv/gnu-libiconv.cpp b/config.tests/unix/gnu-libiconv/gnu-libiconv.cpp index 1276311e08..fe4b87b923 100644 --- a/config.tests/unix/gnu-libiconv/gnu-libiconv.cpp +++ b/config.tests/unix/gnu-libiconv/gnu-libiconv.cpp @@ -37,9 +37,6 @@ ** ****************************************************************************/ -#if defined(__sgi) -#error "iconv not supported on IRIX" -#else #include int main(int, char **) @@ -55,4 +52,3 @@ int main(int, char **) return 0; } -#endif diff --git a/config.tests/unix/iconv/iconv.cpp b/config.tests/unix/iconv/iconv.cpp index 993a12c7ee..be4236436f 100644 --- a/config.tests/unix/iconv/iconv.cpp +++ b/config.tests/unix/iconv/iconv.cpp @@ -37,9 +37,6 @@ ** ****************************************************************************/ -#if defined(__sgi) -#error "iconv not supported on IRIX" -#else #include int main(int, char **) @@ -55,4 +52,3 @@ int main(int, char **) return 0; } -#endif diff --git a/config.tests/unix/ipv6ifname/ipv6ifname.cpp b/config.tests/unix/ipv6ifname/ipv6ifname.cpp index bf2fe6f6ae..fd58e85adb 100644 --- a/config.tests/unix/ipv6ifname/ipv6ifname.cpp +++ b/config.tests/unix/ipv6ifname/ipv6ifname.cpp @@ -40,10 +40,6 @@ /* Sample program for configure to test for if_nametoindex support on target platforms. */ -#if defined(__hpux) -#define _HPUX_SOURCE -#endif - #include #include #include -- cgit v1.2.3 From 245bd9bf789acfd315dedd34e418027a1e6d1c9b Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Sat, 29 Jul 2017 10:31:58 +0200 Subject: configure: prune checks for ancient compilers from some tests these would be caught by the central verifyspec test, if we even got that far. Change-Id: I3eda80c4614b94f869d907f0a40166f4914ea692 Reviewed-by: Thiago Macieira --- config.tests/common/sse2/sse2.cpp | 3 --- config.tests/unix/reduce_exports/fvisibility.c | 6 ------ 2 files changed, 9 deletions(-) diff --git a/config.tests/common/sse2/sse2.cpp b/config.tests/common/sse2/sse2.cpp index 7ae0eaf4a7..8b4d5334b5 100644 --- a/config.tests/common/sse2/sse2.cpp +++ b/config.tests/common/sse2/sse2.cpp @@ -38,9 +38,6 @@ ****************************************************************************/ #include -#if defined(__GNUC__) && __GNUC__ < 4 && __GNUC_MINOR__ < 3 -#error GCC < 3.2 is known to create internal compiler errors with our MMX code -#endif int main(int, char**) { diff --git a/config.tests/unix/reduce_exports/fvisibility.c b/config.tests/unix/reduce_exports/fvisibility.c index 71af9d99a3..12055ead46 100644 --- a/config.tests/unix/reduce_exports/fvisibility.c +++ b/config.tests/unix/reduce_exports/fvisibility.c @@ -38,14 +38,8 @@ ****************************************************************************/ #if defined(__GNUC__) -# if (__GNUC__ < 4) -# error "GCC3 with backported visibility patch is known to miscompile Qt" -# endif __attribute((visibility("default"))) void blah(); #elif defined(__SUNPRO_CC) -# if (__SUNPRO_CC < 0x0550) -# error "SunStudio 8 or later is required for ELF visibility" -# endif __global void blah(); #else # error "GCC4+ or SunStudio 8+ are required to support ELF visibility" -- cgit v1.2.3 From 799e09a9472493e7f661582d8247a75211df151e Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 28 Jul 2017 23:55:05 +0200 Subject: configure: remove check for ancient libpng < 1.0.17 that's just noise nowadays. Change-Id: Ife75ebcc67de45db76265b1a8fb3b8130ff58c0f Reviewed-by: Thiago Macieira --- config.tests/unix/libpng/libpng.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/config.tests/unix/libpng/libpng.cpp b/config.tests/unix/libpng/libpng.cpp index 6808b5fcb3..d3f836e49e 100644 --- a/config.tests/unix/libpng/libpng.cpp +++ b/config.tests/unix/libpng/libpng.cpp @@ -39,10 +39,6 @@ #include -#if !defined(PNG_LIBPNG_VER) || PNG_LIBPNG_VER < 10017 -# error "Required libpng version 1.0.17 not found." -#endif - int main(int, char **) { png_structp png_ptr; -- cgit v1.2.3 From 1229558a40d269477a31b39e84cc5522489cf8c9 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Sat, 29 Jul 2017 10:36:28 +0200 Subject: configure: modernize dbus test remove useless define and ifdef/error, and check for a more appropriate function. Change-Id: I1a1622cc157c49ebb6787068ade7b33e45e228ca Reviewed-by: Thiago Macieira --- config.tests/unix/dbus/dbus.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/config.tests/unix/dbus/dbus.cpp b/config.tests/unix/dbus/dbus.cpp index 295c904400..8b1e241cd3 100644 --- a/config.tests/unix/dbus/dbus.cpp +++ b/config.tests/unix/dbus/dbus.cpp @@ -37,15 +37,10 @@ ** ****************************************************************************/ -#define DBUS_API_SUBJECT_TO_CHANGE #include -#if DBUS_MAJOR_PROTOCOL_VERSION < 1 -#error Needs at least dbus version 1 -#endif - int main(int, char **) { - dbus_shutdown(); + (void) dbus_bus_get_private(DBUS_BUS_SYSTEM, (DBusError *)NULL); return 0; } -- cgit v1.2.3 From a3b5020a1aee9f8d505b82ba70700518e5786686 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 31 Jul 2017 11:42:44 +0200 Subject: configure: prune dead tests::journald libraries::journald is the actually used one. Change-Id: I2da4ae106dd1041cdb269e05def93523ed5011b2 Reviewed-by: Thiago Macieira --- src/corelib/configure.json | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/corelib/configure.json b/src/corelib/configure.json index 6399e4d3c4..0cbb35e688 100644 --- a/src/corelib/configure.json +++ b/src/corelib/configure.json @@ -167,11 +167,6 @@ "type": "compile", "test": "unix/ipc_posix" }, - "journald": { - "label": "journald", - "type": "compile", - "test": "unix/journald" - }, "ppoll": { "label": "ppoll()", "type": "compile", -- cgit v1.2.3 From acf75d733708f2275cc363566c2457f5c4486362 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 31 Jul 2017 12:17:09 +0200 Subject: configure: standardize handling of 64 bit atomics replace the custom QT_NO_STD_ATOMIC64 with a regular public feature, and give libatomic an empty source rather than using a separate config test. Change-Id: Iaf4a7f4c4874f61bf93aa58fe41843a86baf1ab7 Reviewed-by: Thiago Macieira --- src/corelib/arch/arch.pri | 2 +- src/corelib/arch/qatomic_cxx11.h | 2 +- src/corelib/configure.json | 17 ++++------------- 3 files changed, 6 insertions(+), 15 deletions(-) diff --git a/src/corelib/arch/arch.pri b/src/corelib/arch/arch.pri index b628bcc6ec..e490617c6b 100644 --- a/src/corelib/arch/arch.pri +++ b/src/corelib/arch/arch.pri @@ -4,4 +4,4 @@ HEADERS += \ arch/qatomic_bootstrap.h \ arch/qatomic_cxx11.h -qtConfig(libatomic): QMAKE_USE += libatomic +qtConfig(std-atomic64): QMAKE_USE += libatomic diff --git a/src/corelib/arch/qatomic_cxx11.h b/src/corelib/arch/qatomic_cxx11.h index 484ec73e7f..1404849382 100644 --- a/src/corelib/arch/qatomic_cxx11.h +++ b/src/corelib/arch/qatomic_cxx11.h @@ -187,7 +187,7 @@ template <> Q_DECL_CONSTEXPR inline bool QAtomicTraits<2>::isLockFree() { return false; } #endif -#ifndef QT_NO_STD_ATOMIC64 +#if QT_CONFIG(std_atomic64) template<> struct QAtomicOpsSupport<8> { enum { IsSupported = 1 }; }; # define Q_ATOMIC_INT64_IS_SUPPORTED # if ATOMIC_LLONG_LOCK_FREE == 2 diff --git a/src/corelib/configure.json b/src/corelib/configure.json index 0cbb35e688..67a1a2ad4b 100644 --- a/src/corelib/configure.json +++ b/src/corelib/configure.json @@ -69,9 +69,10 @@ ] }, "libatomic": { - "label": "64 bit atomics in libatomic", + "label": "64 bit atomics", "test": "common/atomic64", "sources": [ + "", "-latomic" ] }, @@ -116,11 +117,6 @@ }, "tests": { - "atomic64": { - "label": "64 bit atomics", - "type": "compile", - "test": "common/atomic64" - }, "atomicfptr": { "label": "working std::atomic for function pointers", "type": "compile", @@ -284,13 +280,8 @@ }, "std-atomic64": { "label": "64 bit atomic operations", - "condition": "tests.atomic64 || libs.libatomic", - "output": [ { "type": "define", "negative": true, "name": "QT_NO_STD_ATOMIC64" } ] - }, - "libatomic": { - "label": "64 bit atomic operations in libatomic", - "condition": "!tests.atomic64 && libs.libatomic", - "output": [ "privateFeature" ] + "condition": "libs.libatomic", + "output": [ "publicFeature" ] }, "mimetype": { "label": "Mimetype handling", -- cgit v1.2.3 From 92ff8a25005f21c36398ab72e6b00a92183338be Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 31 Jul 2017 12:53:50 +0200 Subject: configure: dispose of which.test just use 'which' and be done with it. the script was rather arcane, and worked around deficiencies of cygwin (no longer relevant) and solaris (assumed to be somewhat sane meanwhile). Change-Id: I2e11ea3c87ac06a85604ac8d58d8fee95eae2e15 Reviewed-by: Thiago Macieira --- config.tests/unix/which.test | 39 --------------------------------------- configure | 4 +--- 2 files changed, 1 insertion(+), 42 deletions(-) delete mode 100755 config.tests/unix/which.test diff --git a/config.tests/unix/which.test b/config.tests/unix/which.test deleted file mode 100755 index 37c858c2f7..0000000000 --- a/config.tests/unix/which.test +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/sh - -HOME=/dev/null -export HOME - -unset which - -WHICH=`which which 2>/dev/null` -if echo $WHICH | grep 'shell built-in command' >/dev/null 2>&1; then - WHICH=which -elif [ -z "$WHICH" ]; then - if which which >/dev/null 2>&1; then - WHICH=which - else - for a in /usr/ucb /usr/bin /bin /usr/local/bin; do - if [ -x $a/which ]; then - WHICH=$a/which - break; - fi - done - fi -fi - -if [ -z "$WHICH" ]; then - IFS=: - for a in $PATH; do - if [ -x $a/$1 ]; then - echo "$a/$1" - exit 0 - fi - done -else - a=`"$WHICH" "$1" 2>/dev/null` - if [ ! -z "$a" -a -x "$a" ]; then - echo "$a" - exit 0 - fi -fi -exit 1 diff --git a/configure b/configure index bf37224d24..08b49a8d12 100755 --- a/configure +++ b/configure @@ -40,9 +40,7 @@ relpath=`(cd "$relpath"; /bin/pwd)` # the current directory is the "build tree" or "object tree" outpath=`/bin/pwd` -# where to find which.. -unixtests="$relpath/config.tests/unix" -WHICH="$unixtests/which.test" +WHICH="which" PERL=`$WHICH perl 2>/dev/null` -- cgit v1.2.3 From 90588d57d71e1eedf6becd3ebf505f3bd67b592b Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 1 Aug 2017 18:40:10 +0200 Subject: configure: remove redundant parts of xcb_xkb test testing the non-xkb xcb parts is unnecessary, as we already did that separately. Change-Id: I452cc746315117a0169f0e0c764fe7e0229437e9 Reviewed-by: Gatis Paeglis --- config.tests/qpa/xcb-xkb/xcb-xkb.cpp | 9 --------- 1 file changed, 9 deletions(-) diff --git a/config.tests/qpa/xcb-xkb/xcb-xkb.cpp b/config.tests/qpa/xcb-xkb/xcb-xkb.cpp index 9685649633..f7ec9a7d43 100644 --- a/config.tests/qpa/xcb-xkb/xcb-xkb.cpp +++ b/config.tests/qpa/xcb-xkb/xcb-xkb.cpp @@ -37,8 +37,6 @@ ** ****************************************************************************/ -#include - // This is needed to make Qt compile together with XKB. xkb.h is using a variable // which is called 'explicit', this is a reserved keyword in c++ */ #define explicit dont_use_cxx_explicit @@ -47,15 +45,8 @@ int main(int, char **) { - int primaryScreen = 0; - - xcb_connection_t *connection = xcb_connect("", &primaryScreen); - // This takes more arguments in xcb-xkb < 1.10. xcb_xkb_get_kbd_by_name_unchecked(NULL, 0, 0, 0, 0); - // This won't compile unless libxcb >= 1.5 which defines XCB_ATOM_PRIMARY. - int xcbAtomPrimary = XCB_ATOM_PRIMARY; - return 0; } -- cgit v1.2.3 From f54f7d847099db448223fd630c5416b6fbd84c9e Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 1 Aug 2017 18:30:33 +0200 Subject: configure: Add a feature to write tests in the .json file We're adding a lot of unnecessary files that end up later as cargo-cult, for at most a handful of lines. So instead move the testcases directly into the .json file. The following sources were not inlined, because multiple tests share them, and the inlining infra does not support that (yet): - avx512 - openssl - gnu-libiconv/sun-libiconv (there is also a command line option to select the exact variant, which makes it hard/impossible to properly coalesce the library sources) The following sources were not inlined because of "complications": - verifyspec contains a lengthy function in the project file - stl contains lots of code in the source file - xlocalescanprint includes a private header from the source tree via a relative path, which we can't do, as the test's physical location is variable. - corewlan uses objective c++, which the inline system doesn't support reduce_relocs and reduce_exports now create libraries with main(), which is weird enough, but doesn't hurt. Done-with: Oswald Buddenhagen Change-Id: Ic3a088f9f08a4fd7ae91fffd14ce8a262021cca0 Reviewed-by: Oswald Buddenhagen --- config.tests/common/alloca/alloca.cpp | 56 --- config.tests/common/alloca/alloca.pro | 1 - config.tests/common/atomic64/atomic64.cpp | 60 --- config.tests/common/atomic64/atomic64.pro | 3 - config.tests/common/atomicfptr/atomicfptr.cpp | 64 --- config.tests/common/atomicfptr/atomicfptr.pro | 3 - config.tests/common/avx/avx.cpp | 49 --- config.tests/common/avx/avx.pro | 3 - config.tests/common/avx2/avx2.cpp | 53 --- config.tests/common/avx2/avx2.pro | 3 - config.tests/common/c++14/c++14.cpp | 46 -- config.tests/common/c++14/c++14.pro | 3 - config.tests/common/c++1z/c++1z.cpp | 48 -- config.tests/common/c++1z/c++1z.pro | 3 - config.tests/common/f16c/f16c.cpp | 51 --- config.tests/common/f16c/f16c.pro | 3 - config.tests/common/libproxy/libproxy.cpp | 57 --- config.tests/common/libproxy/libproxy.pro | 3 - config.tests/common/sse2/sse2.cpp | 47 -- config.tests/common/sse2/sse2.pro | 3 - config.tests/common/sse3/sse3.cpp | 49 --- config.tests/common/sse3/sse3.pro | 3 - config.tests/common/sse4_1/sse4_1.cpp | 49 --- config.tests/common/sse4_1/sse4_1.pro | 3 - config.tests/common/sse4_2/sse4_2.cpp | 49 --- config.tests/common/sse4_2/sse4_2.pro | 3 - config.tests/common/ssse3/ssse3.cpp | 49 --- config.tests/common/ssse3/ssse3.pro | 3 - config.tests/qpa/direct2d/direct2d.cpp | 57 --- config.tests/qpa/direct2d/direct2d.pro | 3 - config.tests/qpa/directfb/directfb.cpp | 49 --- config.tests/qpa/directfb/directfb.pro | 2 - config.tests/qpa/egl-x11/egl-x11.cpp | 60 --- config.tests/qpa/egl-x11/egl-x11.pro | 3 - config.tests/qpa/egl/egl.cpp | 49 --- config.tests/qpa/egl/egl.pro | 3 - config.tests/qpa/eglfs-brcm/eglfs-brcm.cpp | 50 --- config.tests/qpa/eglfs-brcm/eglfs-brcm.pro | 3 - .../qpa/eglfs-egldevice/eglfs-egldevice.cpp | 49 --- .../qpa/eglfs-egldevice/eglfs-egldevice.pro | 3 - config.tests/qpa/eglfs-mali-2/eglfs-mali-2.cpp | 50 --- config.tests/qpa/eglfs-mali-2/eglfs-mali-2.pro | 3 - config.tests/qpa/eglfs-mali/eglfs-mali.cpp | 51 --- config.tests/qpa/eglfs-mali/eglfs-mali.pro | 3 - config.tests/qpa/eglfs-viv/eglfs-viv.cpp | 53 --- config.tests/qpa/eglfs-viv/eglfs-viv.pro | 7 - config.tests/qpa/gbm/gbm.cpp | 50 --- config.tests/qpa/gbm/gbm.pro | 2 - config.tests/qpa/integrityfb/integrityfb.cpp | 46 -- config.tests/qpa/integrityfb/integrityfb.pro | 3 - config.tests/qpa/integrityhid/integrityhid.cpp | 52 --- config.tests/qpa/integrityhid/integrityhid.pro | 2 - config.tests/qpa/kms/kms.cpp | 51 --- config.tests/qpa/kms/kms.pro | 2 - config.tests/qpa/linuxfb/linuxfb.cpp | 54 --- config.tests/qpa/linuxfb/linuxfb.pro | 3 - config.tests/qpa/mirclient/mirclient.cpp | 53 --- config.tests/qpa/mirclient/mirclient.pro | 2 - config.tests/qpa/wayland-server/wayland-server.pro | 3 - config.tests/qpa/wayland-server/wl.cpp | 46 -- config.tests/qpa/xcb-glx/xcb-glx.cpp | 55 --- config.tests/qpa/xcb-glx/xcb-glx.pro | 2 - config.tests/qpa/xcb-render/xcb-render.cpp | 70 --- config.tests/qpa/xcb-render/xcb-render.pro | 2 - config.tests/qpa/xcb-syslibs/xcb-syslibs.pro | 2 - config.tests/qpa/xcb-syslibs/xcb.cpp | 61 --- config.tests/qpa/xcb-xkb/xcb-xkb.cpp | 52 --- config.tests/qpa/xcb-xkb/xcb-xkb.pro | 2 - config.tests/qpa/xcb-xlib/xcb-xlib.cpp | 50 --- config.tests/qpa/xcb-xlib/xcb-xlib.pro | 2 - config.tests/qpa/xcb/xcb.cpp | 51 --- config.tests/qpa/xcb/xcb.pro | 2 - config.tests/unix/clock-gettime/clock-gettime.cpp | 53 --- config.tests/unix/clock-gettime/clock-gettime.pro | 2 - .../unix/clock-monotonic/clock-monotonic.cpp | 53 --- .../unix/clock-monotonic/clock-monotonic.pro | 2 - config.tests/unix/cloexec/cloexec.cpp | 59 --- config.tests/unix/cloexec/cloexec.pro | 3 - config.tests/unix/cups/cups.cpp | 47 -- config.tests/unix/cups/cups.pro | 2 - config.tests/unix/db2/db2.cpp | 46 -- config.tests/unix/db2/db2.pro | 2 - config.tests/unix/dbus/dbus.cpp | 46 -- config.tests/unix/dbus/dbus.pro | 8 - config.tests/unix/dlopen/dlopen.cpp | 45 -- config.tests/unix/dlopen/dlopen.pro | 2 - .../unix/doubleconversion/doubleconversion.cpp | 46 -- .../unix/doubleconversion/doubleconversion.pro | 3 - config.tests/unix/evdev/evdev.cpp | 59 --- config.tests/unix/evdev/evdev.pro | 2 - config.tests/unix/eventfd/eventfd.pro | 2 - config.tests/unix/eventfd/main.cpp | 49 --- config.tests/unix/fontconfig/fontconfig.cpp | 59 --- config.tests/unix/fontconfig/fontconfig.pro | 2 - config.tests/unix/freetype/freetype.cpp | 52 --- config.tests/unix/freetype/freetype.pro | 2 - config.tests/unix/getaddrinfo/getaddrinfo.pro | 2 - config.tests/unix/getaddrinfo/getaddrinfotest.cpp | 62 --- config.tests/unix/getifaddrs/getifaddrs.cpp | 54 --- config.tests/unix/getifaddrs/getifaddrs.pro | 3 - config.tests/unix/glib/glib.cpp | 56 --- config.tests/unix/glib/glib.pro | 2 - config.tests/unix/harfbuzz/harfbuzz.cpp | 58 --- config.tests/unix/harfbuzz/harfbuzz.pro | 2 - config.tests/unix/ibase/ibase.cpp | 45 -- config.tests/unix/ibase/ibase.pro | 2 - config.tests/unix/icu/icu.cpp | 52 --- config.tests/unix/icu/icu.pro | 9 - config.tests/unix/inotify/inotify.pro | 2 - config.tests/unix/inotify/inotifytest.cpp | 48 -- config.tests/unix/ipc_posix/ipc.cpp | 55 --- config.tests/unix/ipc_posix/ipc_posix.pro | 4 - config.tests/unix/ipc_sysv/ipc.cpp | 57 --- config.tests/unix/ipc_sysv/ipc_sysv.pro | 3 - config.tests/unix/ipv6ifname/ipv6ifname.cpp | 53 --- config.tests/unix/ipv6ifname/ipv6ifname.pro | 3 - config.tests/unix/journald/journald.c | 52 --- config.tests/unix/journald/journald.pro | 3 - config.tests/unix/lgmon/lgmon.cpp | 47 -- config.tests/unix/lgmon/lgmon.pro | 2 - config.tests/unix/libinput/libinput.cpp | 46 -- config.tests/unix/libinput/libinput.pro | 2 - .../unix/libinput_axis_api/libinput_axis_api.cpp | 46 -- .../unix/libinput_axis_api/libinput_axis_api.pro | 2 - config.tests/unix/libjpeg/libjpeg.cpp | 52 --- config.tests/unix/libjpeg/libjpeg.pro | 2 - config.tests/unix/libpng/libpng.cpp | 47 -- config.tests/unix/libpng/libpng.pro | 2 - config.tests/unix/libudev/libudev.cpp | 47 -- config.tests/unix/libudev/libudev.pro | 2 - config.tests/unix/mtdev/mtdev.cpp | 47 -- config.tests/unix/mtdev/mtdev.pro | 3 - config.tests/unix/mysql/mysql.cpp | 49 --- config.tests/unix/mysql/mysql.pro | 2 - config.tests/unix/objcopy/objcopy.cpp | 43 -- config.tests/unix/objcopy/objcopy.pro | 7 - config.tests/unix/oci/oci.cpp | 45 -- config.tests/unix/oci/oci.pro | 2 - config.tests/unix/odbc/odbc.cpp | 51 --- config.tests/unix/odbc/odbc.pro | 2 - config.tests/unix/opengldesktop/opengldesktop.cpp | 55 --- config.tests/unix/opengldesktop/opengldesktop.pro | 3 - config.tests/unix/opengles2/opengles2.cpp | 53 --- config.tests/unix/opengles2/opengles2.pro | 3 - config.tests/unix/opengles3/opengles3.cpp | 56 --- config.tests/unix/opengles3/opengles3.pro | 7 - config.tests/unix/opengles31/opengles31.cpp | 48 -- config.tests/unix/opengles31/opengles31.pro | 7 - config.tests/unix/openvg/openvg.cpp | 49 --- config.tests/unix/openvg/openvg.pro | 3 - config.tests/unix/pcre2/pcre2.cpp | 52 --- config.tests/unix/pcre2/pcre2.pro | 2 - config.tests/unix/poll/poll.cpp | 51 --- config.tests/unix/poll/poll.pro | 2 - config.tests/unix/pollts/pollts.cpp | 57 --- config.tests/unix/pollts/pollts.pro | 2 - .../unix/posix_fallocate/posix_fallocate.cpp | 49 --- .../unix/posix_fallocate/posix_fallocate.pro | 2 - config.tests/unix/ppoll/ppoll.cpp | 56 --- config.tests/unix/ppoll/ppoll.pro | 2 - config.tests/unix/pps/pps.cpp | 48 -- config.tests/unix/pps/pps.pro | 2 - config.tests/unix/psql/psql.cpp | 47 -- config.tests/unix/psql/psql.pro | 2 - config.tests/unix/qqnx_imf/qqnx_imf.cpp | 46 -- config.tests/unix/qqnx_imf/qqnx_imf.pro | 2 - config.tests/unix/reduce_exports/fvisibility.c | 46 -- .../unix/reduce_exports/reduce_exports.pro | 5 - .../unix/reduce_relocs/bsymbolic_functions.c | 44 -- config.tests/unix/reduce_relocs/reduce_relocs.pro | 5 - config.tests/unix/sctp/sctp.cpp | 62 --- config.tests/unix/sctp/sctp.pro | 3 - config.tests/unix/slog2/slog2.cpp | 46 -- config.tests/unix/slog2/slog2.pro | 2 - config.tests/unix/sqlite/sqlite.cpp | 46 -- config.tests/unix/sqlite/sqlite.pro | 2 - config.tests/unix/sqlite2/sqlite2.cpp | 45 -- config.tests/unix/sqlite2/sqlite2.pro | 2 - .../unix/stack-protector/stack-protector.cpp | 52 --- .../unix/stack-protector/stack-protector.pro | 2 - config.tests/unix/syslog/syslog.c | 48 -- config.tests/unix/syslog/syslog.pro | 3 - config.tests/unix/tds/tds.cpp | 46 -- config.tests/unix/tds/tds.pro | 2 - config.tests/unix/tslib/tslib.cpp | 46 -- config.tests/unix/tslib/tslib.pro | 2 - config.tests/unix/xkbcommon/xkbcommon.cpp | 48 -- config.tests/unix/xkbcommon/xkbcommon.pro | 2 - config.tests/unix/zlib/zlib.cpp | 52 --- config.tests/unix/zlib/zlib.pro | 2 - config.tests/win/directwrite/directwrite.cpp | 50 --- config.tests/win/directwrite/directwrite.pro | 3 - config.tests/win/directwrite2/directwrite2.cpp | 51 --- config.tests/win/directwrite2/directwrite2.pro | 3 - config.tests/x11/xinput2/xinput2.cpp | 73 ---- config.tests/x11/xinput2/xinput2.pro | 3 - config.tests/x11/xlib/xlib.cpp | 48 -- config.tests/x11/xlib/xlib.pro | 3 - configure.json | 241 +++++++++- mkspecs/features/qt_configure.prf | 52 ++- src/corelib/configure.json | 220 +++++++++- src/gui/configure.json | 484 +++++++++++++++++++-- src/network/configure.json | 58 ++- src/plugins/sqldrivers/configure.json | 56 ++- src/printsupport/configure.json | 5 +- 205 files changed, 1007 insertions(+), 5468 deletions(-) delete mode 100644 config.tests/common/alloca/alloca.cpp delete mode 100644 config.tests/common/alloca/alloca.pro delete mode 100644 config.tests/common/atomic64/atomic64.cpp delete mode 100644 config.tests/common/atomic64/atomic64.pro delete mode 100644 config.tests/common/atomicfptr/atomicfptr.cpp delete mode 100644 config.tests/common/atomicfptr/atomicfptr.pro delete mode 100644 config.tests/common/avx/avx.cpp delete mode 100644 config.tests/common/avx/avx.pro delete mode 100644 config.tests/common/avx2/avx2.cpp delete mode 100644 config.tests/common/avx2/avx2.pro delete mode 100644 config.tests/common/c++14/c++14.cpp delete mode 100644 config.tests/common/c++14/c++14.pro delete mode 100644 config.tests/common/c++1z/c++1z.cpp delete mode 100644 config.tests/common/c++1z/c++1z.pro delete mode 100644 config.tests/common/f16c/f16c.cpp delete mode 100644 config.tests/common/f16c/f16c.pro delete mode 100644 config.tests/common/libproxy/libproxy.cpp delete mode 100644 config.tests/common/libproxy/libproxy.pro delete mode 100644 config.tests/common/sse2/sse2.cpp delete mode 100644 config.tests/common/sse2/sse2.pro delete mode 100644 config.tests/common/sse3/sse3.cpp delete mode 100644 config.tests/common/sse3/sse3.pro delete mode 100644 config.tests/common/sse4_1/sse4_1.cpp delete mode 100644 config.tests/common/sse4_1/sse4_1.pro delete mode 100644 config.tests/common/sse4_2/sse4_2.cpp delete mode 100644 config.tests/common/sse4_2/sse4_2.pro delete mode 100644 config.tests/common/ssse3/ssse3.cpp delete mode 100644 config.tests/common/ssse3/ssse3.pro delete mode 100644 config.tests/qpa/direct2d/direct2d.cpp delete mode 100644 config.tests/qpa/direct2d/direct2d.pro delete mode 100644 config.tests/qpa/directfb/directfb.cpp delete mode 100644 config.tests/qpa/directfb/directfb.pro delete mode 100644 config.tests/qpa/egl-x11/egl-x11.cpp delete mode 100644 config.tests/qpa/egl-x11/egl-x11.pro delete mode 100644 config.tests/qpa/egl/egl.cpp delete mode 100644 config.tests/qpa/egl/egl.pro delete mode 100644 config.tests/qpa/eglfs-brcm/eglfs-brcm.cpp delete mode 100644 config.tests/qpa/eglfs-brcm/eglfs-brcm.pro delete mode 100644 config.tests/qpa/eglfs-egldevice/eglfs-egldevice.cpp delete mode 100644 config.tests/qpa/eglfs-egldevice/eglfs-egldevice.pro delete mode 100644 config.tests/qpa/eglfs-mali-2/eglfs-mali-2.cpp delete mode 100644 config.tests/qpa/eglfs-mali-2/eglfs-mali-2.pro delete mode 100644 config.tests/qpa/eglfs-mali/eglfs-mali.cpp delete mode 100644 config.tests/qpa/eglfs-mali/eglfs-mali.pro delete mode 100644 config.tests/qpa/eglfs-viv/eglfs-viv.cpp delete mode 100644 config.tests/qpa/eglfs-viv/eglfs-viv.pro delete mode 100644 config.tests/qpa/gbm/gbm.cpp delete mode 100644 config.tests/qpa/gbm/gbm.pro delete mode 100644 config.tests/qpa/integrityfb/integrityfb.cpp delete mode 100644 config.tests/qpa/integrityfb/integrityfb.pro delete mode 100644 config.tests/qpa/integrityhid/integrityhid.cpp delete mode 100644 config.tests/qpa/integrityhid/integrityhid.pro delete mode 100644 config.tests/qpa/kms/kms.cpp delete mode 100644 config.tests/qpa/kms/kms.pro delete mode 100644 config.tests/qpa/linuxfb/linuxfb.cpp delete mode 100644 config.tests/qpa/linuxfb/linuxfb.pro delete mode 100644 config.tests/qpa/mirclient/mirclient.cpp delete mode 100644 config.tests/qpa/mirclient/mirclient.pro delete mode 100644 config.tests/qpa/wayland-server/wayland-server.pro delete mode 100644 config.tests/qpa/wayland-server/wl.cpp delete mode 100644 config.tests/qpa/xcb-glx/xcb-glx.cpp delete mode 100644 config.tests/qpa/xcb-glx/xcb-glx.pro delete mode 100644 config.tests/qpa/xcb-render/xcb-render.cpp delete mode 100644 config.tests/qpa/xcb-render/xcb-render.pro delete mode 100644 config.tests/qpa/xcb-syslibs/xcb-syslibs.pro delete mode 100644 config.tests/qpa/xcb-syslibs/xcb.cpp delete mode 100644 config.tests/qpa/xcb-xkb/xcb-xkb.cpp delete mode 100644 config.tests/qpa/xcb-xkb/xcb-xkb.pro delete mode 100644 config.tests/qpa/xcb-xlib/xcb-xlib.cpp delete mode 100644 config.tests/qpa/xcb-xlib/xcb-xlib.pro delete mode 100644 config.tests/qpa/xcb/xcb.cpp delete mode 100644 config.tests/qpa/xcb/xcb.pro delete mode 100644 config.tests/unix/clock-gettime/clock-gettime.cpp delete mode 100644 config.tests/unix/clock-gettime/clock-gettime.pro delete mode 100644 config.tests/unix/clock-monotonic/clock-monotonic.cpp delete mode 100644 config.tests/unix/clock-monotonic/clock-monotonic.pro delete mode 100644 config.tests/unix/cloexec/cloexec.cpp delete mode 100644 config.tests/unix/cloexec/cloexec.pro delete mode 100644 config.tests/unix/cups/cups.cpp delete mode 100644 config.tests/unix/cups/cups.pro delete mode 100644 config.tests/unix/db2/db2.cpp delete mode 100644 config.tests/unix/db2/db2.pro delete mode 100644 config.tests/unix/dbus/dbus.cpp delete mode 100644 config.tests/unix/dbus/dbus.pro delete mode 100644 config.tests/unix/dlopen/dlopen.cpp delete mode 100644 config.tests/unix/dlopen/dlopen.pro delete mode 100644 config.tests/unix/doubleconversion/doubleconversion.cpp delete mode 100644 config.tests/unix/doubleconversion/doubleconversion.pro delete mode 100644 config.tests/unix/evdev/evdev.cpp delete mode 100644 config.tests/unix/evdev/evdev.pro delete mode 100644 config.tests/unix/eventfd/eventfd.pro delete mode 100644 config.tests/unix/eventfd/main.cpp delete mode 100644 config.tests/unix/fontconfig/fontconfig.cpp delete mode 100644 config.tests/unix/fontconfig/fontconfig.pro delete mode 100644 config.tests/unix/freetype/freetype.cpp delete mode 100644 config.tests/unix/freetype/freetype.pro delete mode 100644 config.tests/unix/getaddrinfo/getaddrinfo.pro delete mode 100644 config.tests/unix/getaddrinfo/getaddrinfotest.cpp delete mode 100644 config.tests/unix/getifaddrs/getifaddrs.cpp delete mode 100644 config.tests/unix/getifaddrs/getifaddrs.pro delete mode 100644 config.tests/unix/glib/glib.cpp delete mode 100644 config.tests/unix/glib/glib.pro delete mode 100644 config.tests/unix/harfbuzz/harfbuzz.cpp delete mode 100644 config.tests/unix/harfbuzz/harfbuzz.pro delete mode 100644 config.tests/unix/ibase/ibase.cpp delete mode 100644 config.tests/unix/ibase/ibase.pro delete mode 100644 config.tests/unix/icu/icu.cpp delete mode 100644 config.tests/unix/icu/icu.pro delete mode 100644 config.tests/unix/inotify/inotify.pro delete mode 100644 config.tests/unix/inotify/inotifytest.cpp delete mode 100644 config.tests/unix/ipc_posix/ipc.cpp delete mode 100644 config.tests/unix/ipc_posix/ipc_posix.pro delete mode 100644 config.tests/unix/ipc_sysv/ipc.cpp delete mode 100644 config.tests/unix/ipc_sysv/ipc_sysv.pro delete mode 100644 config.tests/unix/ipv6ifname/ipv6ifname.cpp delete mode 100644 config.tests/unix/ipv6ifname/ipv6ifname.pro delete mode 100644 config.tests/unix/journald/journald.c delete mode 100644 config.tests/unix/journald/journald.pro delete mode 100644 config.tests/unix/lgmon/lgmon.cpp delete mode 100644 config.tests/unix/lgmon/lgmon.pro delete mode 100644 config.tests/unix/libinput/libinput.cpp delete mode 100644 config.tests/unix/libinput/libinput.pro delete mode 100644 config.tests/unix/libinput_axis_api/libinput_axis_api.cpp delete mode 100644 config.tests/unix/libinput_axis_api/libinput_axis_api.pro delete mode 100644 config.tests/unix/libjpeg/libjpeg.cpp delete mode 100644 config.tests/unix/libjpeg/libjpeg.pro delete mode 100644 config.tests/unix/libpng/libpng.cpp delete mode 100644 config.tests/unix/libpng/libpng.pro delete mode 100644 config.tests/unix/libudev/libudev.cpp delete mode 100644 config.tests/unix/libudev/libudev.pro delete mode 100644 config.tests/unix/mtdev/mtdev.cpp delete mode 100644 config.tests/unix/mtdev/mtdev.pro delete mode 100644 config.tests/unix/mysql/mysql.cpp delete mode 100644 config.tests/unix/mysql/mysql.pro delete mode 100644 config.tests/unix/objcopy/objcopy.cpp delete mode 100644 config.tests/unix/objcopy/objcopy.pro delete mode 100644 config.tests/unix/oci/oci.cpp delete mode 100644 config.tests/unix/oci/oci.pro delete mode 100644 config.tests/unix/odbc/odbc.cpp delete mode 100644 config.tests/unix/odbc/odbc.pro delete mode 100644 config.tests/unix/opengldesktop/opengldesktop.cpp delete mode 100644 config.tests/unix/opengldesktop/opengldesktop.pro delete mode 100644 config.tests/unix/opengles2/opengles2.cpp delete mode 100644 config.tests/unix/opengles2/opengles2.pro delete mode 100644 config.tests/unix/opengles3/opengles3.cpp delete mode 100644 config.tests/unix/opengles3/opengles3.pro delete mode 100644 config.tests/unix/opengles31/opengles31.cpp delete mode 100644 config.tests/unix/opengles31/opengles31.pro delete mode 100644 config.tests/unix/openvg/openvg.cpp delete mode 100644 config.tests/unix/openvg/openvg.pro delete mode 100644 config.tests/unix/pcre2/pcre2.cpp delete mode 100644 config.tests/unix/pcre2/pcre2.pro delete mode 100644 config.tests/unix/poll/poll.cpp delete mode 100644 config.tests/unix/poll/poll.pro delete mode 100644 config.tests/unix/pollts/pollts.cpp delete mode 100644 config.tests/unix/pollts/pollts.pro delete mode 100644 config.tests/unix/posix_fallocate/posix_fallocate.cpp delete mode 100644 config.tests/unix/posix_fallocate/posix_fallocate.pro delete mode 100644 config.tests/unix/ppoll/ppoll.cpp delete mode 100644 config.tests/unix/ppoll/ppoll.pro delete mode 100644 config.tests/unix/pps/pps.cpp delete mode 100644 config.tests/unix/pps/pps.pro delete mode 100644 config.tests/unix/psql/psql.cpp delete mode 100644 config.tests/unix/psql/psql.pro delete mode 100644 config.tests/unix/qqnx_imf/qqnx_imf.cpp delete mode 100644 config.tests/unix/qqnx_imf/qqnx_imf.pro delete mode 100644 config.tests/unix/reduce_exports/fvisibility.c delete mode 100644 config.tests/unix/reduce_exports/reduce_exports.pro delete mode 100644 config.tests/unix/reduce_relocs/bsymbolic_functions.c delete mode 100644 config.tests/unix/reduce_relocs/reduce_relocs.pro delete mode 100644 config.tests/unix/sctp/sctp.cpp delete mode 100644 config.tests/unix/sctp/sctp.pro delete mode 100644 config.tests/unix/slog2/slog2.cpp delete mode 100644 config.tests/unix/slog2/slog2.pro delete mode 100644 config.tests/unix/sqlite/sqlite.cpp delete mode 100644 config.tests/unix/sqlite/sqlite.pro delete mode 100644 config.tests/unix/sqlite2/sqlite2.cpp delete mode 100644 config.tests/unix/sqlite2/sqlite2.pro delete mode 100644 config.tests/unix/stack-protector/stack-protector.cpp delete mode 100644 config.tests/unix/stack-protector/stack-protector.pro delete mode 100644 config.tests/unix/syslog/syslog.c delete mode 100644 config.tests/unix/syslog/syslog.pro delete mode 100644 config.tests/unix/tds/tds.cpp delete mode 100644 config.tests/unix/tds/tds.pro delete mode 100644 config.tests/unix/tslib/tslib.cpp delete mode 100644 config.tests/unix/tslib/tslib.pro delete mode 100644 config.tests/unix/xkbcommon/xkbcommon.cpp delete mode 100644 config.tests/unix/xkbcommon/xkbcommon.pro delete mode 100644 config.tests/unix/zlib/zlib.cpp delete mode 100644 config.tests/unix/zlib/zlib.pro delete mode 100644 config.tests/win/directwrite/directwrite.cpp delete mode 100644 config.tests/win/directwrite/directwrite.pro delete mode 100644 config.tests/win/directwrite2/directwrite2.cpp delete mode 100644 config.tests/win/directwrite2/directwrite2.pro delete mode 100644 config.tests/x11/xinput2/xinput2.cpp delete mode 100644 config.tests/x11/xinput2/xinput2.pro delete mode 100644 config.tests/x11/xlib/xlib.cpp delete mode 100644 config.tests/x11/xlib/xlib.pro diff --git a/config.tests/common/alloca/alloca.cpp b/config.tests/common/alloca/alloca.cpp deleted file mode 100644 index 500bdb9ba2..0000000000 --- a/config.tests/common/alloca/alloca.cpp +++ /dev/null @@ -1,56 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests 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$ -** -****************************************************************************/ - -#if defined(USE_ALLOCA_H) -# include -# ifdef __QNXNTO__ -// extra include needed in QNX7 to define NULL for the alloca() macro -# include -# endif -#elif defined(USE_MALLOC_H) -# include -#else -# include -#endif - -int main(int, char **) -{ - alloca(1); - return 0; -} diff --git a/config.tests/common/alloca/alloca.pro b/config.tests/common/alloca/alloca.pro deleted file mode 100644 index a2d7d45da2..0000000000 --- a/config.tests/common/alloca/alloca.pro +++ /dev/null @@ -1 +0,0 @@ -SOURCES = alloca.cpp diff --git a/config.tests/common/atomic64/atomic64.cpp b/config.tests/common/atomic64/atomic64.cpp deleted file mode 100644 index 3181caf15e..0000000000 --- a/config.tests/common/atomic64/atomic64.cpp +++ /dev/null @@ -1,60 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 Intel Corporation. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the configuration 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 -#include - -void test(volatile std::atomic &a) -{ - std::int64_t v = a.load(std::memory_order_acquire); - while (!a.compare_exchange_strong(v, v + 1, - std::memory_order_acq_rel, - std::memory_order_acquire)) { - v = a.exchange(v - 1); - } - - a.store(v + 1, std::memory_order_release); -} - -int main(int, char **) -{ - void *ptr = (void*)0xffffffc0; // any random pointer - test(*reinterpret_cast *>(ptr)); - return 0; -} diff --git a/config.tests/common/atomic64/atomic64.pro b/config.tests/common/atomic64/atomic64.pro deleted file mode 100644 index c9a85817ca..0000000000 --- a/config.tests/common/atomic64/atomic64.pro +++ /dev/null @@ -1,3 +0,0 @@ -SOURCES = atomic64.cpp -CONFIG += c++11 console -CONFIG -= qt diff --git a/config.tests/common/atomicfptr/atomicfptr.cpp b/config.tests/common/atomicfptr/atomicfptr.cpp deleted file mode 100644 index a993357127..0000000000 --- a/config.tests/common/atomicfptr/atomicfptr.cpp +++ /dev/null @@ -1,64 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 Intel Corporation. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the FOO 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 - -typedef void (*fptr)(int); -typedef std::atomic atomicfptr; - -void testfunction(int) { } - -void test(volatile atomicfptr &a) -{ - fptr v = a.load(std::memory_order_acquire); - while (!a.compare_exchange_strong(v, &testfunction, - std::memory_order_acq_rel, - std::memory_order_acquire)) { - v = a.exchange(&testfunction); - } - - a.store(&testfunction, std::memory_order_release); -} - -int main(int, char **) -{ - atomicfptr fptr(testfunction); - test(fptr); - return 0; -} diff --git a/config.tests/common/atomicfptr/atomicfptr.pro b/config.tests/common/atomicfptr/atomicfptr.pro deleted file mode 100644 index 5509862a30..0000000000 --- a/config.tests/common/atomicfptr/atomicfptr.pro +++ /dev/null @@ -1,3 +0,0 @@ -SOURCES = atomicfptr.cpp -CONFIG += c++11 console -CONFIG -= qt app_bundle diff --git a/config.tests/common/avx/avx.cpp b/config.tests/common/avx/avx.cpp deleted file mode 100644 index a26f87f157..0000000000 --- a/config.tests/common/avx/avx.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests 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 - -int main(int, char**) -{ - __m256d a = _mm256_setzero_pd(); - __m256d b = _mm256_set1_pd(42.42); - __m256d result = _mm256_add_pd(a, b); - (void)result; - return 0; -} diff --git a/config.tests/common/avx/avx.pro b/config.tests/common/avx/avx.pro deleted file mode 100644 index fde4adaea2..0000000000 --- a/config.tests/common/avx/avx.pro +++ /dev/null @@ -1,3 +0,0 @@ -SOURCES = avx.cpp -!defined(QMAKE_CFLAGS_AVX, "var"):error("This compiler does not support AVX") -else:QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_AVX diff --git a/config.tests/common/avx2/avx2.cpp b/config.tests/common/avx2/avx2.cpp deleted file mode 100644 index 2df7e908dd..0000000000 --- a/config.tests/common/avx2/avx2.cpp +++ /dev/null @@ -1,53 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 Intel Corporation. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the configuration 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 - -int main(int, char**) -{ - /* AVX */ - _mm256_zeroall(); - __m256i a = _mm256_setzero_si256(); - - /* AVX2 */ - __m256i b = _mm256_and_si256(a, a); - __m256i result = _mm256_add_epi8(a, b); - (void)result; - return 0; -} diff --git a/config.tests/common/avx2/avx2.pro b/config.tests/common/avx2/avx2.pro deleted file mode 100644 index 1963bdb4b9..0000000000 --- a/config.tests/common/avx2/avx2.pro +++ /dev/null @@ -1,3 +0,0 @@ -SOURCES = avx2.cpp -!defined(QMAKE_CFLAGS_AVX2, "var"):error("This compiler does not support AVX2") -else:QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_AVX2 diff --git a/config.tests/common/c++14/c++14.cpp b/config.tests/common/c++14/c++14.cpp deleted file mode 100644 index 1129213d1f..0000000000 --- a/config.tests/common/c++14/c++14.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 Intel Corporation. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the configuration 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$ -** -****************************************************************************/ - -#if __cplusplus > 201103L -// Compiler claims to support C++14, trust it -#else -# error "__cplusplus must be > 201103L (the value of C++11)" -#endif - -int main(int, char **) { return 0; } diff --git a/config.tests/common/c++14/c++14.pro b/config.tests/common/c++14/c++14.pro deleted file mode 100644 index cbd78ba6fe..0000000000 --- a/config.tests/common/c++14/c++14.pro +++ /dev/null @@ -1,3 +0,0 @@ -SOURCES = c++14.cpp -CONFIG += c++11 c++14 console -CONFIG -= qt diff --git a/config.tests/common/c++1z/c++1z.cpp b/config.tests/common/c++1z/c++1z.cpp deleted file mode 100644 index 63c6fb5b8a..0000000000 --- a/config.tests/common/c++1z/c++1z.cpp +++ /dev/null @@ -1,48 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 Intel Corporation. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the configuration 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$ -** -****************************************************************************/ - -#if __cplusplus > 201402L -// Compiler claims to support experimental C++1z, trust it -#else -# error "__cplusplus must be > 201402L (the value for C++14)" -#endif - -#include // https://bugs.llvm.org//show_bug.cgi?id=33117 - -int main(int, char **) { return 0; } diff --git a/config.tests/common/c++1z/c++1z.pro b/config.tests/common/c++1z/c++1z.pro deleted file mode 100644 index 3a24946276..0000000000 --- a/config.tests/common/c++1z/c++1z.pro +++ /dev/null @@ -1,3 +0,0 @@ -SOURCES = c++1z.cpp -CONFIG += c++11 c++14 c++1z console -CONFIG -= qt diff --git a/config.tests/common/f16c/f16c.cpp b/config.tests/common/f16c/f16c.cpp deleted file mode 100644 index aeeb35eac3..0000000000 --- a/config.tests/common/f16c/f16c.cpp +++ /dev/null @@ -1,51 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests 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 - -int main(int, char**) -{ - __m128i a = _mm_setzero_si128(); - __m128 b = _mm_cvtph_ps(a); - __m256 b256 = _mm256_cvtph_ps(a); - __m128i c = _mm_cvtps_ph(b, 0); - c = _mm256_cvtps_ph(b256, 0); - (void)c; - return 0; -} diff --git a/config.tests/common/f16c/f16c.pro b/config.tests/common/f16c/f16c.pro deleted file mode 100644 index fcab1877c1..0000000000 --- a/config.tests/common/f16c/f16c.pro +++ /dev/null @@ -1,3 +0,0 @@ -SOURCES = f16c.cpp -!defined(QMAKE_CFLAGS_F16C, "var"):error("This compiler does not support F16C") -else:QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_F16C diff --git a/config.tests/common/libproxy/libproxy.cpp b/config.tests/common/libproxy/libproxy.cpp deleted file mode 100644 index 97a1a94ed7..0000000000 --- a/config.tests/common/libproxy/libproxy.cpp +++ /dev/null @@ -1,57 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests 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 -#include -#include - -int main(int, char **) -{ - pxProxyFactory *factory = px_proxy_factory_new(); - char **proxies = px_proxy_factory_get_proxies(factory, "http://qt-project.org"); - if (proxies) { - for (int i = 0; proxies[i]; i++) { - printf("%s\n", proxies[i]); - free(proxies[i]); - } - free(proxies); - } - px_proxy_factory_free(factory); - return 0; -} diff --git a/config.tests/common/libproxy/libproxy.pro b/config.tests/common/libproxy/libproxy.pro deleted file mode 100644 index e3183d99e7..0000000000 --- a/config.tests/common/libproxy/libproxy.pro +++ /dev/null @@ -1,3 +0,0 @@ -SOURCES = libproxy.cpp -CONFIG -= qt dylib -mac:CONFIG -= app_bundle diff --git a/config.tests/common/sse2/sse2.cpp b/config.tests/common/sse2/sse2.cpp deleted file mode 100644 index 8b4d5334b5..0000000000 --- a/config.tests/common/sse2/sse2.cpp +++ /dev/null @@ -1,47 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests 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 - -int main(int, char**) -{ - __m128i a = _mm_setzero_si128(); - _mm_maskmoveu_si128(a, _mm_setzero_si128(), 0); - return 0; -} diff --git a/config.tests/common/sse2/sse2.pro b/config.tests/common/sse2/sse2.pro deleted file mode 100644 index 75f5266745..0000000000 --- a/config.tests/common/sse2/sse2.pro +++ /dev/null @@ -1,3 +0,0 @@ -SOURCES = sse2.cpp -!defined(QMAKE_CFLAGS_SSE2, var): error("This compiler does not support SSE2") -else:QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_SSE2 diff --git a/config.tests/common/sse3/sse3.cpp b/config.tests/common/sse3/sse3.cpp deleted file mode 100644 index a1e7694daa..0000000000 --- a/config.tests/common/sse3/sse3.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests 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 - -int main(int, char**) -{ - __m128d a = _mm_set1_pd(6.28); - __m128d b = _mm_set1_pd(3.14); - __m128d result = _mm_addsub_pd(a, b); - result = _mm_movedup_pd(result); - return 0; -} diff --git a/config.tests/common/sse3/sse3.pro b/config.tests/common/sse3/sse3.pro deleted file mode 100644 index b26b832e22..0000000000 --- a/config.tests/common/sse3/sse3.pro +++ /dev/null @@ -1,3 +0,0 @@ -SOURCES = sse3.cpp -!defined(QMAKE_CFLAGS_SSE3, "var"):error("This compiler does not support SSE3") -else:QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_SSE3 diff --git a/config.tests/common/sse4_1/sse4_1.cpp b/config.tests/common/sse4_1/sse4_1.cpp deleted file mode 100644 index 7592ac33f4..0000000000 --- a/config.tests/common/sse4_1/sse4_1.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests 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 - -int main(int, char**) -{ - __m128 a = _mm_setzero_ps(); - _mm_ceil_ps(a); - __m128i result = _mm_mullo_epi32(_mm_set1_epi32(42), _mm_set1_epi32(64)); - (void)result; - return 0; -} diff --git a/config.tests/common/sse4_1/sse4_1.pro b/config.tests/common/sse4_1/sse4_1.pro deleted file mode 100644 index bee9c12adb..0000000000 --- a/config.tests/common/sse4_1/sse4_1.pro +++ /dev/null @@ -1,3 +0,0 @@ -SOURCES = sse4_1.cpp -!defined(QMAKE_CFLAGS_SSE4_1, "var"):error("This compiler does not support SSE4.1") -else:QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_SSE4_1 diff --git a/config.tests/common/sse4_2/sse4_2.cpp b/config.tests/common/sse4_2/sse4_2.cpp deleted file mode 100644 index 5ad151c96c..0000000000 --- a/config.tests/common/sse4_2/sse4_2.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests 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 - -int main(int, char**) -{ - __m128i a = _mm_setzero_si128(); - __m128i b = _mm_set1_epi32(42); - __m128i result = _mm_cmpestrm(a, 16, b, 16, 0); - (void)result; - return 0; -} diff --git a/config.tests/common/sse4_2/sse4_2.pro b/config.tests/common/sse4_2/sse4_2.pro deleted file mode 100644 index 1626ad748c..0000000000 --- a/config.tests/common/sse4_2/sse4_2.pro +++ /dev/null @@ -1,3 +0,0 @@ -SOURCES = sse4_2.cpp -!defined(QMAKE_CFLAGS_SSE4_2, "var"):error("This compiler does not support SSE4.2") -else:QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_SSE4_2 diff --git a/config.tests/common/ssse3/ssse3.cpp b/config.tests/common/ssse3/ssse3.cpp deleted file mode 100644 index 79c0e2b6b6..0000000000 --- a/config.tests/common/ssse3/ssse3.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests 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 - -int main(int, char**) -{ - __m128i a = _mm_set1_epi32(42); - _mm_abs_epi8(a); - __m128i result = _mm_sign_epi16(a, _mm_set1_epi32(64)); - (void)result; - return 0; -} diff --git a/config.tests/common/ssse3/ssse3.pro b/config.tests/common/ssse3/ssse3.pro deleted file mode 100644 index 1d3aebf61d..0000000000 --- a/config.tests/common/ssse3/ssse3.pro +++ /dev/null @@ -1,3 +0,0 @@ -SOURCES = ssse3.cpp -!defined(QMAKE_CFLAGS_SSSE3, "var"):error("This compiler does not support SSSE3") -else:QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_SSSE3 diff --git a/config.tests/qpa/direct2d/direct2d.cpp b/config.tests/qpa/direct2d/direct2d.cpp deleted file mode 100644 index 87ce1d1dab..0000000000 --- a/config.tests/qpa/direct2d/direct2d.cpp +++ /dev/null @@ -1,57 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests 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 -#include -#include -#include -#include -#include - -using Microsoft::WRL::ComPtr; - -int main(int, char**) -{ - ComPtr d2dFactory; - D2D1CreateFactory(D2D1_FACTORY_TYPE_SINGLE_THREADED, d2dFactory.ReleaseAndGetAddressOf()); - ComPtr surface; - (void)surface; // Q_UNUSED - - return 0; -} diff --git a/config.tests/qpa/direct2d/direct2d.pro b/config.tests/qpa/direct2d/direct2d.pro deleted file mode 100644 index 98527b12a7..0000000000 --- a/config.tests/qpa/direct2d/direct2d.pro +++ /dev/null @@ -1,3 +0,0 @@ -SOURCES = direct2d.cpp -CONFIG -= qt -CONFIG += console diff --git a/config.tests/qpa/directfb/directfb.cpp b/config.tests/qpa/directfb/directfb.cpp deleted file mode 100644 index 72df1195b0..0000000000 --- a/config.tests/qpa/directfb/directfb.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 Intel Corporation. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests 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 - -#ifdef __typeof__ -#error DirectFB headers are unclean and cannot compile -#endif - -int main(int, char **) -{ - return 0; -} diff --git a/config.tests/qpa/directfb/directfb.pro b/config.tests/qpa/directfb/directfb.pro deleted file mode 100644 index b138fd0109..0000000000 --- a/config.tests/qpa/directfb/directfb.pro +++ /dev/null @@ -1,2 +0,0 @@ -SOURCES = directfb.cpp -CONFIG -= qt diff --git a/config.tests/qpa/egl-x11/egl-x11.cpp b/config.tests/qpa/egl-x11/egl-x11.cpp deleted file mode 100644 index 9cda661a47..0000000000 --- a/config.tests/qpa/egl-x11/egl-x11.cpp +++ /dev/null @@ -1,60 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests 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 -#include -#include -#include - -// Check if EGL is compatible with X. Some EGL implementations, typically on -// embedded devices, are not intended to be used together with X. EGL support -// has to be disabled in plugins like xcb in this case since the native display, -// window and pixmap types will be different than what an X-based platform -// plugin would expect. - -int main(int, char **) -{ - Display *dpy = EGL_DEFAULT_DISPLAY; - EGLNativeDisplayType egldpy = XOpenDisplay(""); - dpy = egldpy; - EGLNativeWindowType w = XCreateWindow(dpy, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - XDestroyWindow(dpy, w); - XCloseDisplay(dpy); - return 0; -} diff --git a/config.tests/qpa/egl-x11/egl-x11.pro b/config.tests/qpa/egl-x11/egl-x11.pro deleted file mode 100644 index fd8479ba35..0000000000 --- a/config.tests/qpa/egl-x11/egl-x11.pro +++ /dev/null @@ -1,3 +0,0 @@ -SOURCES = egl-x11.cpp - -CONFIG -= qt diff --git a/config.tests/qpa/egl/egl.cpp b/config.tests/qpa/egl/egl.cpp deleted file mode 100644 index a4ef1f2f0e..0000000000 --- a/config.tests/qpa/egl/egl.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests 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 - -int main(int, char **) -{ - EGLint x = 0; - EGLDisplay dpy = 0; - EGLContext ctx = 0; - eglDestroyContext(dpy, ctx); - return 0; -} diff --git a/config.tests/qpa/egl/egl.pro b/config.tests/qpa/egl/egl.pro deleted file mode 100644 index 2c4ae07e64..0000000000 --- a/config.tests/qpa/egl/egl.pro +++ /dev/null @@ -1,3 +0,0 @@ -SOURCES = egl.cpp - -CONFIG -= qt diff --git a/config.tests/qpa/eglfs-brcm/eglfs-brcm.cpp b/config.tests/qpa/eglfs-brcm/eglfs-brcm.cpp deleted file mode 100644 index e6ba06f89b..0000000000 --- a/config.tests/qpa/eglfs-brcm/eglfs-brcm.cpp +++ /dev/null @@ -1,50 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests 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 -#include - -int main(int, char **) -{ - EGLDisplay dpy = 0; - EGLContext ctx = 0; - eglDestroyContext(dpy, ctx); - vc_dispmanx_display_open(0); - return 0; -} diff --git a/config.tests/qpa/eglfs-brcm/eglfs-brcm.pro b/config.tests/qpa/eglfs-brcm/eglfs-brcm.pro deleted file mode 100644 index d4afa460f7..0000000000 --- a/config.tests/qpa/eglfs-brcm/eglfs-brcm.pro +++ /dev/null @@ -1,3 +0,0 @@ -SOURCES = eglfs-brcm.cpp - -CONFIG -= qt diff --git a/config.tests/qpa/eglfs-egldevice/eglfs-egldevice.cpp b/config.tests/qpa/eglfs-egldevice/eglfs-egldevice.cpp deleted file mode 100644 index fa3e9d33f7..0000000000 --- a/config.tests/qpa/eglfs-egldevice/eglfs-egldevice.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests 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 -#include - -int main(int, char **) -{ - EGLDeviceEXT device = 0; - EGLStreamKHR stream = 0; - EGLOutputLayerEXT layer = 0; - return EGL_DRM_CRTC_EXT; -} diff --git a/config.tests/qpa/eglfs-egldevice/eglfs-egldevice.pro b/config.tests/qpa/eglfs-egldevice/eglfs-egldevice.pro deleted file mode 100644 index 2f20d993f5..0000000000 --- a/config.tests/qpa/eglfs-egldevice/eglfs-egldevice.pro +++ /dev/null @@ -1,3 +0,0 @@ -SOURCES = eglfs-egldevice.cpp - -CONFIG -= qt diff --git a/config.tests/qpa/eglfs-mali-2/eglfs-mali-2.cpp b/config.tests/qpa/eglfs-mali-2/eglfs-mali-2.cpp deleted file mode 100644 index f8481bb27c..0000000000 --- a/config.tests/qpa/eglfs-mali-2/eglfs-mali-2.cpp +++ /dev/null @@ -1,50 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests 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 -#include - -int main(int, char **) -{ - EGLDisplay dpy = 0; - EGLContext ctx = 0; - mali_native_window *w = 0; - eglDestroyContext(dpy, ctx); - return 0; -} diff --git a/config.tests/qpa/eglfs-mali-2/eglfs-mali-2.pro b/config.tests/qpa/eglfs-mali-2/eglfs-mali-2.pro deleted file mode 100644 index de6f85f20f..0000000000 --- a/config.tests/qpa/eglfs-mali-2/eglfs-mali-2.pro +++ /dev/null @@ -1,3 +0,0 @@ -SOURCES = eglfs-mali-2.cpp - -CONFIG -= qt diff --git a/config.tests/qpa/eglfs-mali/eglfs-mali.cpp b/config.tests/qpa/eglfs-mali/eglfs-mali.cpp deleted file mode 100644 index 13b10fce02..0000000000 --- a/config.tests/qpa/eglfs-mali/eglfs-mali.cpp +++ /dev/null @@ -1,51 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests 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 -#include -#include - -int main(int, char **) -{ - EGLDisplay dpy = 0; - EGLContext ctx = 0; - fbdev_window *w = 0; - eglDestroyContext(dpy, ctx); - return 0; -} diff --git a/config.tests/qpa/eglfs-mali/eglfs-mali.pro b/config.tests/qpa/eglfs-mali/eglfs-mali.pro deleted file mode 100644 index 80f8282842..0000000000 --- a/config.tests/qpa/eglfs-mali/eglfs-mali.pro +++ /dev/null @@ -1,3 +0,0 @@ -SOURCES = eglfs-mali.cpp - -CONFIG -= qt diff --git a/config.tests/qpa/eglfs-viv/eglfs-viv.cpp b/config.tests/qpa/eglfs-viv/eglfs-viv.cpp deleted file mode 100644 index 1f5c5dbf50..0000000000 --- a/config.tests/qpa/eglfs-viv/eglfs-viv.cpp +++ /dev/null @@ -1,53 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests 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 -#include - -int main(int, char **) -{ -#if defined(__INTEGRITY) - fbGetDisplay(); -#else - // Do not rely on fbGetDisplay() since the signature has changed over time. - // Stick to fbGetDisplayByIndex(). - fbGetDisplayByIndex(0); -#endif - return 0; -} diff --git a/config.tests/qpa/eglfs-viv/eglfs-viv.pro b/config.tests/qpa/eglfs-viv/eglfs-viv.pro deleted file mode 100644 index 2c3dc5cb01..0000000000 --- a/config.tests/qpa/eglfs-viv/eglfs-viv.pro +++ /dev/null @@ -1,7 +0,0 @@ -SOURCES = eglfs-viv.cpp -integrity { - DEFINES += EGL_API_FB=1 -} else { - DEFINES += LINUX=1 EGL_API_FB=1 -} -CONFIG -= qt diff --git a/config.tests/qpa/gbm/gbm.cpp b/config.tests/qpa/gbm/gbm.cpp deleted file mode 100644 index a1f436a7fe..0000000000 --- a/config.tests/qpa/gbm/gbm.cpp +++ /dev/null @@ -1,50 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests 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 -#include -extern "C" { -#include -} - -int main(int, char **) -{ - gbm_surface *surface = 0; - return 0; -} diff --git a/config.tests/qpa/gbm/gbm.pro b/config.tests/qpa/gbm/gbm.pro deleted file mode 100644 index 1c08eb4e67..0000000000 --- a/config.tests/qpa/gbm/gbm.pro +++ /dev/null @@ -1,2 +0,0 @@ -SOURCES = gbm.cpp -CONFIG -= qt diff --git a/config.tests/qpa/integrityfb/integrityfb.cpp b/config.tests/qpa/integrityfb/integrityfb.cpp deleted file mode 100644 index 7f2dd0705f..0000000000 --- a/config.tests/qpa/integrityfb/integrityfb.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests 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 - -int main(int, char **) -{ - FBDriver *driver = 0; - return 0; -} diff --git a/config.tests/qpa/integrityfb/integrityfb.pro b/config.tests/qpa/integrityfb/integrityfb.pro deleted file mode 100644 index 5da4e77923..0000000000 --- a/config.tests/qpa/integrityfb/integrityfb.pro +++ /dev/null @@ -1,3 +0,0 @@ -SOURCES = integrityfb.cpp - -CONFIG -= qt diff --git a/config.tests/qpa/integrityhid/integrityhid.cpp b/config.tests/qpa/integrityhid/integrityhid.cpp deleted file mode 100644 index 1493e7c7e4..0000000000 --- a/config.tests/qpa/integrityhid/integrityhid.cpp +++ /dev/null @@ -1,52 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests 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 -#include -#include - -int main(int, char **) -{ - HIDDriver *driver; - uintptr_t devicecontext; - uint32_t device_id; - gh_hid_enum_devices(driver, &device_id, &devicecontext); - - return 0; -} diff --git a/config.tests/qpa/integrityhid/integrityhid.pro b/config.tests/qpa/integrityhid/integrityhid.pro deleted file mode 100644 index 87fafde897..0000000000 --- a/config.tests/qpa/integrityhid/integrityhid.pro +++ /dev/null @@ -1,2 +0,0 @@ -SOURCES = integrityhid.cpp -CONFIG -= qt diff --git a/config.tests/qpa/kms/kms.cpp b/config.tests/qpa/kms/kms.cpp deleted file mode 100644 index fbd1bf095d..0000000000 --- a/config.tests/qpa/kms/kms.cpp +++ /dev/null @@ -1,51 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests 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 -#include -extern "C" { -#include -#include -} - -int main(int, char **) -{ - drmModeCrtcPtr currentMode = drmModeGetCrtc(0, 0); - return 0; -} diff --git a/config.tests/qpa/kms/kms.pro b/config.tests/qpa/kms/kms.pro deleted file mode 100644 index c823914308..0000000000 --- a/config.tests/qpa/kms/kms.pro +++ /dev/null @@ -1,2 +0,0 @@ -SOURCES = kms.cpp -CONFIG -= qt diff --git a/config.tests/qpa/linuxfb/linuxfb.cpp b/config.tests/qpa/linuxfb/linuxfb.cpp deleted file mode 100644 index ed9f9b242e..0000000000 --- a/config.tests/qpa/linuxfb/linuxfb.cpp +++ /dev/null @@ -1,54 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests 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 -#include -#include - -int main(int, char **) -{ - fb_fix_screeninfo finfo; - fb_var_screeninfo vinfo; - - int fd = 3; - ioctl(fd, FBIOGET_FSCREENINFO, &finfo); - ioctl(fd, FBIOGET_VSCREENINFO, &vinfo); - - return 0; -} diff --git a/config.tests/qpa/linuxfb/linuxfb.pro b/config.tests/qpa/linuxfb/linuxfb.pro deleted file mode 100644 index 45db4b78dd..0000000000 --- a/config.tests/qpa/linuxfb/linuxfb.pro +++ /dev/null @@ -1,3 +0,0 @@ -SOURCES = linuxfb.cpp - -CONFIG -= qt diff --git a/config.tests/qpa/mirclient/mirclient.cpp b/config.tests/qpa/mirclient/mirclient.cpp deleted file mode 100644 index c93f8509ef..0000000000 --- a/config.tests/qpa/mirclient/mirclient.cpp +++ /dev/null @@ -1,53 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests 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 -#include -#include - -static void surfaceCreateCallback(MirSurface*, void*) -{ -} - - -int main(int, char **) -{ - u_application_lifecycle_delegate_new(); - mir_surface_create(0, surfaceCreateCallback, 0); -} diff --git a/config.tests/qpa/mirclient/mirclient.pro b/config.tests/qpa/mirclient/mirclient.pro deleted file mode 100644 index 3e87194e4e..0000000000 --- a/config.tests/qpa/mirclient/mirclient.pro +++ /dev/null @@ -1,2 +0,0 @@ -SOURCES = mirclient.cpp -CONFIG -= qt diff --git a/config.tests/qpa/wayland-server/wayland-server.pro b/config.tests/qpa/wayland-server/wayland-server.pro deleted file mode 100644 index 969bc542bb..0000000000 --- a/config.tests/qpa/wayland-server/wayland-server.pro +++ /dev/null @@ -1,3 +0,0 @@ -SOURCES = wl.cpp - -CONFIG -= qt diff --git a/config.tests/qpa/wayland-server/wl.cpp b/config.tests/qpa/wayland-server/wl.cpp deleted file mode 100644 index a5ec3b5150..0000000000 --- a/config.tests/qpa/wayland-server/wl.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests 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 - -int main(int, char **) -{ - wl_display_create(); - return 0; -} diff --git a/config.tests/qpa/xcb-glx/xcb-glx.cpp b/config.tests/qpa/xcb-glx/xcb-glx.cpp deleted file mode 100644 index 3e78941f5c..0000000000 --- a/config.tests/qpa/xcb-glx/xcb-glx.cpp +++ /dev/null @@ -1,55 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests 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 -#include - -int main(int, char **) -{ - int primaryScreen = 0; - - xcb_connection_t *connection = xcb_connect("", &primaryScreen); - xcb_generic_error_t *error = 0; - xcb_glx_query_version_cookie_t xglx_query_cookie = xcb_glx_query_version(connection, - XCB_GLX_MAJOR_VERSION, - XCB_GLX_MINOR_VERSION); - xcb_glx_query_version_reply(connection, xglx_query_cookie, &error); - - return 0; -} diff --git a/config.tests/qpa/xcb-glx/xcb-glx.pro b/config.tests/qpa/xcb-glx/xcb-glx.pro deleted file mode 100644 index 8086e3a388..0000000000 --- a/config.tests/qpa/xcb-glx/xcb-glx.pro +++ /dev/null @@ -1,2 +0,0 @@ -SOURCES = xcb-glx.cpp -CONFIG -= qt diff --git a/config.tests/qpa/xcb-render/xcb-render.cpp b/config.tests/qpa/xcb-render/xcb-render.cpp deleted file mode 100644 index d19a9502bc..0000000000 --- a/config.tests/qpa/xcb-render/xcb-render.cpp +++ /dev/null @@ -1,70 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests 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 -#include - -// 'template' is used as a function argument name in xcb_renderutil.h -#define template template_param -// extern "C" is missing too -extern "C" { -#include -} -#undef template - -int main(int, char **) -{ - int primaryScreen = 0; - xcb_generic_error_t *error = 0; - - xcb_connection_t *connection = xcb_connect("", &primaryScreen); - xcb_render_query_pict_formats_cookie_t formatsCookie = - xcb_render_query_pict_formats(connection); - - xcb_render_query_pict_formats_reply_t *formatsReply = - xcb_render_query_pict_formats_reply( - connection, - formatsCookie, - &error); - - xcb_render_util_find_standard_format(formatsReply, - XCB_PICT_STANDARD_ARGB_32); - - return 0; -} diff --git a/config.tests/qpa/xcb-render/xcb-render.pro b/config.tests/qpa/xcb-render/xcb-render.pro deleted file mode 100644 index 7555fa9b61..0000000000 --- a/config.tests/qpa/xcb-render/xcb-render.pro +++ /dev/null @@ -1,2 +0,0 @@ -SOURCES = xcb-render.cpp -CONFIG -= qt diff --git a/config.tests/qpa/xcb-syslibs/xcb-syslibs.pro b/config.tests/qpa/xcb-syslibs/xcb-syslibs.pro deleted file mode 100644 index 6363ae90ee..0000000000 --- a/config.tests/qpa/xcb-syslibs/xcb-syslibs.pro +++ /dev/null @@ -1,2 +0,0 @@ -SOURCES = xcb.cpp -CONFIG -= qt diff --git a/config.tests/qpa/xcb-syslibs/xcb.cpp b/config.tests/qpa/xcb-syslibs/xcb.cpp deleted file mode 100644 index 00d0da1b6c..0000000000 --- a/config.tests/qpa/xcb-syslibs/xcb.cpp +++ /dev/null @@ -1,61 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests 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 - -// FIXME This workaround can be removed for xcb-icccm > 3.8 -#define class class_name -#include -#undef class - -#include -#include -#include -#include -#include -#include - -int main(int, char **) -{ - int primaryScreen = 0; - - xcb_connection_t *connection = xcb_connect("", &primaryScreen); - - return 0; -} diff --git a/config.tests/qpa/xcb-xkb/xcb-xkb.cpp b/config.tests/qpa/xcb-xkb/xcb-xkb.cpp deleted file mode 100644 index f7ec9a7d43..0000000000 --- a/config.tests/qpa/xcb-xkb/xcb-xkb.cpp +++ /dev/null @@ -1,52 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests 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$ -** -****************************************************************************/ - -// This is needed to make Qt compile together with XKB. xkb.h is using a variable -// which is called 'explicit', this is a reserved keyword in c++ */ -#define explicit dont_use_cxx_explicit -#include -#undef explicit - -int main(int, char **) -{ - // This takes more arguments in xcb-xkb < 1.10. - xcb_xkb_get_kbd_by_name_unchecked(NULL, 0, 0, 0, 0); - - return 0; -} diff --git a/config.tests/qpa/xcb-xkb/xcb-xkb.pro b/config.tests/qpa/xcb-xkb/xcb-xkb.pro deleted file mode 100644 index 804be7b894..0000000000 --- a/config.tests/qpa/xcb-xkb/xcb-xkb.pro +++ /dev/null @@ -1,2 +0,0 @@ -SOURCES = xcb-xkb.cpp -CONFIG -= qt diff --git a/config.tests/qpa/xcb-xlib/xcb-xlib.cpp b/config.tests/qpa/xcb-xlib/xcb-xlib.cpp deleted file mode 100644 index 5a850404e1..0000000000 --- a/config.tests/qpa/xcb-xlib/xcb-xlib.cpp +++ /dev/null @@ -1,50 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests 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 -#include -#include - -int main(int, char **) -{ - Display *dpy = XOpenDisplay(""); - xcb_connection_t *connection = XGetXCBConnection(dpy); - - return 0; -} diff --git a/config.tests/qpa/xcb-xlib/xcb-xlib.pro b/config.tests/qpa/xcb-xlib/xcb-xlib.pro deleted file mode 100644 index 0e98a00fd0..0000000000 --- a/config.tests/qpa/xcb-xlib/xcb-xlib.pro +++ /dev/null @@ -1,2 +0,0 @@ -SOURCES = xcb-xlib.cpp -CONFIG -= qt diff --git a/config.tests/qpa/xcb/xcb.cpp b/config.tests/qpa/xcb/xcb.cpp deleted file mode 100644 index efb4f0ca2e..0000000000 --- a/config.tests/qpa/xcb/xcb.cpp +++ /dev/null @@ -1,51 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests 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 - -int main(int, char **) -{ - int primaryScreen = 0; - xcb_connection_t *t = xcb_connect("", &primaryScreen); - - // This won't compile unless libxcb >= 1.5 which defines XCB_ATOM_PRIMARY. - int xcbAtomPrimary = XCB_ATOM_PRIMARY; - - return 0; -} diff --git a/config.tests/qpa/xcb/xcb.pro b/config.tests/qpa/xcb/xcb.pro deleted file mode 100644 index 6363ae90ee..0000000000 --- a/config.tests/qpa/xcb/xcb.pro +++ /dev/null @@ -1,2 +0,0 @@ -SOURCES = xcb.cpp -CONFIG -= qt diff --git a/config.tests/unix/clock-gettime/clock-gettime.cpp b/config.tests/unix/clock-gettime/clock-gettime.cpp deleted file mode 100644 index cef9f6a1ae..0000000000 --- a/config.tests/unix/clock-gettime/clock-gettime.cpp +++ /dev/null @@ -1,53 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests 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 -#include - -int main(int, char **) -{ -#if (defined(_POSIX_TIMERS) && (_POSIX_TIMERS > 0)) || defined(__OpenBSD__) - timespec ts; - clock_gettime(CLOCK_REALTIME, &ts); -#else -# error "Feature _POSIX_TIMERS not available" -#endif - return 0; -} - diff --git a/config.tests/unix/clock-gettime/clock-gettime.pro b/config.tests/unix/clock-gettime/clock-gettime.pro deleted file mode 100644 index 985b94e3fe..0000000000 --- a/config.tests/unix/clock-gettime/clock-gettime.pro +++ /dev/null @@ -1,2 +0,0 @@ -SOURCES = clock-gettime.cpp -CONFIG -= qt dylib diff --git a/config.tests/unix/clock-monotonic/clock-monotonic.cpp b/config.tests/unix/clock-monotonic/clock-monotonic.cpp deleted file mode 100644 index 777a6d1c21..0000000000 --- a/config.tests/unix/clock-monotonic/clock-monotonic.cpp +++ /dev/null @@ -1,53 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests 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 -#include - -int main(int, char **) -{ -#if defined(_POSIX_MONOTONIC_CLOCK) && (_POSIX_MONOTONIC_CLOCK-0 >= 0) - timespec ts; - clock_gettime(CLOCK_MONOTONIC, &ts); -#else -# error "Feature _POSIX_MONOTONIC_CLOCK not available" -#endif - return 0; -} - diff --git a/config.tests/unix/clock-monotonic/clock-monotonic.pro b/config.tests/unix/clock-monotonic/clock-monotonic.pro deleted file mode 100644 index 4c421c2413..0000000000 --- a/config.tests/unix/clock-monotonic/clock-monotonic.pro +++ /dev/null @@ -1,2 +0,0 @@ -SOURCES = clock-monotonic.cpp -CONFIG -= qt dylib diff --git a/config.tests/unix/cloexec/cloexec.cpp b/config.tests/unix/cloexec/cloexec.cpp deleted file mode 100644 index cc6948a280..0000000000 --- a/config.tests/unix/cloexec/cloexec.cpp +++ /dev/null @@ -1,59 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 Intel Corporation. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the configuration 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$ -** -****************************************************************************/ - -#define _GNU_SOURCE 1 - -#include -#include -#include -#include - -int main() -{ - int pipes[2]; - (void) pipe2(pipes, O_CLOEXEC | O_NONBLOCK); - (void) fcntl(0, F_DUPFD_CLOEXEC, 0); - (void) dup3(0, 3, O_CLOEXEC); -#if defined(__NetBSD__) - (void) paccept(0, 0, 0, NULL, SOCK_CLOEXEC | SOCK_NONBLOCK); -#else - (void) accept4(0, 0, 0, SOCK_CLOEXEC | SOCK_NONBLOCK); -#endif - return 0; -} diff --git a/config.tests/unix/cloexec/cloexec.pro b/config.tests/unix/cloexec/cloexec.pro deleted file mode 100644 index bc735f9b1f..0000000000 --- a/config.tests/unix/cloexec/cloexec.pro +++ /dev/null @@ -1,3 +0,0 @@ -SOURCES = cloexec.cpp -CONFIG -= qt -QT = diff --git a/config.tests/unix/cups/cups.cpp b/config.tests/unix/cups/cups.cpp deleted file mode 100644 index 20cdd7e969..0000000000 --- a/config.tests/unix/cups/cups.cpp +++ /dev/null @@ -1,47 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests 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 - -int main(int, char **) -{ - // CUPS 1.4 test - cupsGetNamedDest(CUPS_HTTP_DEFAULT, NULL, NULL); - return 0; -} diff --git a/config.tests/unix/cups/cups.pro b/config.tests/unix/cups/cups.pro deleted file mode 100644 index d19ce7d9a6..0000000000 --- a/config.tests/unix/cups/cups.pro +++ /dev/null @@ -1,2 +0,0 @@ -SOURCES = cups.cpp -CONFIG -= qt dylib diff --git a/config.tests/unix/db2/db2.cpp b/config.tests/unix/db2/db2.cpp deleted file mode 100644 index 98b90f78be..0000000000 --- a/config.tests/unix/db2/db2.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests 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 -#include - -int main(int, char **) -{ - return 0; -} diff --git a/config.tests/unix/db2/db2.pro b/config.tests/unix/db2/db2.pro deleted file mode 100644 index ef233fc184..0000000000 --- a/config.tests/unix/db2/db2.pro +++ /dev/null @@ -1,2 +0,0 @@ -SOURCES = db2.cpp -CONFIG -= qt dylib diff --git a/config.tests/unix/dbus/dbus.cpp b/config.tests/unix/dbus/dbus.cpp deleted file mode 100644 index 8b1e241cd3..0000000000 --- a/config.tests/unix/dbus/dbus.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests 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 - -int main(int, char **) -{ - (void) dbus_bus_get_private(DBUS_BUS_SYSTEM, (DBusError *)NULL); - return 0; -} diff --git a/config.tests/unix/dbus/dbus.pro b/config.tests/unix/dbus/dbus.pro deleted file mode 100644 index f9d793b867..0000000000 --- a/config.tests/unix/dbus/dbus.pro +++ /dev/null @@ -1,8 +0,0 @@ -SOURCES = dbus.cpp -CONFIG -= qt - -CONFIG += build_all -CONFIG(debug, debug|release): \ - LIBS += $$LIBS_DEBUG -else: \ - LIBS += $$LIBS_RELEASE diff --git a/config.tests/unix/dlopen/dlopen.cpp b/config.tests/unix/dlopen/dlopen.cpp deleted file mode 100644 index 454ca3bf72..0000000000 --- a/config.tests/unix/dlopen/dlopen.cpp +++ /dev/null @@ -1,45 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests 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 - -int main(int, char **) -{ - dlopen(0, 0); -} diff --git a/config.tests/unix/dlopen/dlopen.pro b/config.tests/unix/dlopen/dlopen.pro deleted file mode 100644 index 1d34314332..0000000000 --- a/config.tests/unix/dlopen/dlopen.pro +++ /dev/null @@ -1,2 +0,0 @@ -SOURCES = $$PWD/dlopen.cpp -CONFIG -= qt dylib diff --git a/config.tests/unix/doubleconversion/doubleconversion.cpp b/config.tests/unix/doubleconversion/doubleconversion.cpp deleted file mode 100644 index c26eef97e5..0000000000 --- a/config.tests/unix/doubleconversion/doubleconversion.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests 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 - -int main(int, char **) -{ - int flags = double_conversion::StringToDoubleConverter::NO_FLAGS; - return flags; -} diff --git a/config.tests/unix/doubleconversion/doubleconversion.pro b/config.tests/unix/doubleconversion/doubleconversion.pro deleted file mode 100644 index 8253d0c2a5..0000000000 --- a/config.tests/unix/doubleconversion/doubleconversion.pro +++ /dev/null @@ -1,3 +0,0 @@ -SOURCES = doubleconversion.cpp -CONFIG -= qt -CONFIG += console diff --git a/config.tests/unix/evdev/evdev.cpp b/config.tests/unix/evdev/evdev.cpp deleted file mode 100644 index b00b1a8141..0000000000 --- a/config.tests/unix/evdev/evdev.cpp +++ /dev/null @@ -1,59 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests 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$ -** -****************************************************************************/ - -#if defined(__FreeBSD__) -#include -#else -#include -#include -#endif - -enum { - e1 = ABS_PRESSURE, - e2 = ABS_X, - e3 = REL_X, - e4 = SYN_REPORT, -}; - -int main() -{ - ::input_event buf[32]; - (void) buf; - return 0; -} diff --git a/config.tests/unix/evdev/evdev.pro b/config.tests/unix/evdev/evdev.pro deleted file mode 100644 index 42db391216..0000000000 --- a/config.tests/unix/evdev/evdev.pro +++ /dev/null @@ -1,2 +0,0 @@ -SOURCES = evdev.cpp -CONFIG -= qt diff --git a/config.tests/unix/eventfd/eventfd.pro b/config.tests/unix/eventfd/eventfd.pro deleted file mode 100644 index de99717750..0000000000 --- a/config.tests/unix/eventfd/eventfd.pro +++ /dev/null @@ -1,2 +0,0 @@ -SOURCES = main.cpp -CONFIG -= qt dylib diff --git a/config.tests/unix/eventfd/main.cpp b/config.tests/unix/eventfd/main.cpp deleted file mode 100644 index 0f65fe7e2b..0000000000 --- a/config.tests/unix/eventfd/main.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 Intel Corporation. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests 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 - -int main() -{ - eventfd_t value; - int fd = eventfd(0, EFD_CLOEXEC); - eventfd_read(fd, &value); - eventfd_write(fd, value); - return 0; -} diff --git a/config.tests/unix/fontconfig/fontconfig.cpp b/config.tests/unix/fontconfig/fontconfig.cpp deleted file mode 100644 index 49c0d94a1e..0000000000 --- a/config.tests/unix/fontconfig/fontconfig.cpp +++ /dev/null @@ -1,59 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests 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 -#include FT_FREETYPE_H -#include - -#ifndef FC_RGBA_UNKNOWN -# error "This version of fontconfig is tool old, it is missing the FC_RGBA_UNKNOWN define" -#endif - -#if ((FREETYPE_MAJOR*10000 + FREETYPE_MINOR*100 + FREETYPE_PATCH) < 20110) -# error "This version of freetype is too old." -#endif - -int main(int, char **) -{ - FT_Face face; - face = 0; - FcPattern *pattern; - pattern = 0; - return 0; -} diff --git a/config.tests/unix/fontconfig/fontconfig.pro b/config.tests/unix/fontconfig/fontconfig.pro deleted file mode 100644 index d6fd00aa3c..0000000000 --- a/config.tests/unix/fontconfig/fontconfig.pro +++ /dev/null @@ -1,2 +0,0 @@ -SOURCES = fontconfig.cpp -CONFIG -= qt diff --git a/config.tests/unix/freetype/freetype.cpp b/config.tests/unix/freetype/freetype.cpp deleted file mode 100644 index c051600b02..0000000000 --- a/config.tests/unix/freetype/freetype.cpp +++ /dev/null @@ -1,52 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests 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 -#include FT_FREETYPE_H - -#if ((FREETYPE_MAJOR*10000 + FREETYPE_MINOR*100 + FREETYPE_PATCH) < 20200) -# error "This version of freetype is too old." -#endif - -int main(int, char **) -{ - FT_Face face; - face = 0; - return 0; -} diff --git a/config.tests/unix/freetype/freetype.pro b/config.tests/unix/freetype/freetype.pro deleted file mode 100644 index 525b60121b..0000000000 --- a/config.tests/unix/freetype/freetype.pro +++ /dev/null @@ -1,2 +0,0 @@ -SOURCES = freetype.cpp -CONFIG -= qt diff --git a/config.tests/unix/getaddrinfo/getaddrinfo.pro b/config.tests/unix/getaddrinfo/getaddrinfo.pro deleted file mode 100644 index 18e40971e5..0000000000 --- a/config.tests/unix/getaddrinfo/getaddrinfo.pro +++ /dev/null @@ -1,2 +0,0 @@ -SOURCES = getaddrinfotest.cpp -CONFIG -= qt dylib diff --git a/config.tests/unix/getaddrinfo/getaddrinfotest.cpp b/config.tests/unix/getaddrinfo/getaddrinfotest.cpp deleted file mode 100644 index b4deaae91e..0000000000 --- a/config.tests/unix/getaddrinfo/getaddrinfotest.cpp +++ /dev/null @@ -1,62 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests 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$ -** -****************************************************************************/ - -/* Sample program for configure to test for getaddrinfo on the unix - platform. we check for all structures and functions required. */ - -#include -#include -#ifdef __MINGW32__ -#include -#include -#else -#include -#include -#include -#endif - -int main() -{ - addrinfo *res = 0; - if (getaddrinfo("foo", 0, 0, &res) == 0) - freeaddrinfo(res); - gai_strerror(0); - - return 0; -} diff --git a/config.tests/unix/getifaddrs/getifaddrs.cpp b/config.tests/unix/getifaddrs/getifaddrs.cpp deleted file mode 100644 index a66ce4af37..0000000000 --- a/config.tests/unix/getifaddrs/getifaddrs.cpp +++ /dev/null @@ -1,54 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests 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$ -** -****************************************************************************/ - -/* Sample program for configure to test for if_nametoindex support -on target platforms. */ - -#include -#include -#include -#include - -int main() -{ - ifaddrs *list; - getifaddrs(&list); - freeifaddrs(list); - return 0; -} diff --git a/config.tests/unix/getifaddrs/getifaddrs.pro b/config.tests/unix/getifaddrs/getifaddrs.pro deleted file mode 100644 index db2956a338..0000000000 --- a/config.tests/unix/getifaddrs/getifaddrs.pro +++ /dev/null @@ -1,3 +0,0 @@ -SOURCES = getifaddrs.cpp -CONFIG -= qt -QT = diff --git a/config.tests/unix/glib/glib.cpp b/config.tests/unix/glib/glib.cpp deleted file mode 100644 index 63456c662d..0000000000 --- a/config.tests/unix/glib/glib.cpp +++ /dev/null @@ -1,56 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests 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$ -** -****************************************************************************/ - -typedef struct _GMainContext GMainContext; - -#include - -int main(int, char **) -{ - GMainContext *context; - GSource *source; - GPollFD *pollfd = NULL; - if (!g_thread_supported()) - g_thread_init(NULL); - context = g_main_context_default(); - (void)context; - source = g_source_new(0, 0); - g_source_add_poll(source, pollfd); - return 0; -} diff --git a/config.tests/unix/glib/glib.pro b/config.tests/unix/glib/glib.pro deleted file mode 100644 index 15d059df77..0000000000 --- a/config.tests/unix/glib/glib.pro +++ /dev/null @@ -1,2 +0,0 @@ -SOURCES = glib.cpp -CONFIG -= qt diff --git a/config.tests/unix/harfbuzz/harfbuzz.cpp b/config.tests/unix/harfbuzz/harfbuzz.cpp deleted file mode 100644 index d1d0530423..0000000000 --- a/config.tests/unix/harfbuzz/harfbuzz.cpp +++ /dev/null @@ -1,58 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests 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 - -#if !HB_VERSION_ATLEAST(0, 9, 42) -# error "This version of harfbuzz is too old." -#endif - -int main(int, char **) -{ - hb_buffer_t *buffer = hb_buffer_create(); - - const uint16_t string[] = { 'A', 'b', 'c' }; - hb_buffer_add_utf16(buffer, string, 3, 0, 3); - hb_buffer_guess_segment_properties(buffer); - hb_buffer_set_flags(buffer, hb_buffer_flags_t(HB_BUFFER_FLAG_PRESERVE_DEFAULT_IGNORABLES)); - - hb_buffer_destroy(buffer); - - return 0; -} diff --git a/config.tests/unix/harfbuzz/harfbuzz.pro b/config.tests/unix/harfbuzz/harfbuzz.pro deleted file mode 100644 index 71a7c355cb..0000000000 --- a/config.tests/unix/harfbuzz/harfbuzz.pro +++ /dev/null @@ -1,2 +0,0 @@ -SOURCES = harfbuzz.cpp -CONFIG -= qt dylib diff --git a/config.tests/unix/ibase/ibase.cpp b/config.tests/unix/ibase/ibase.cpp deleted file mode 100644 index c1e2a24b51..0000000000 --- a/config.tests/unix/ibase/ibase.cpp +++ /dev/null @@ -1,45 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests 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 - -int main(int, char **) -{ - return 0; -} diff --git a/config.tests/unix/ibase/ibase.pro b/config.tests/unix/ibase/ibase.pro deleted file mode 100644 index 8c47f66954..0000000000 --- a/config.tests/unix/ibase/ibase.pro +++ /dev/null @@ -1,2 +0,0 @@ -SOURCES = ibase.cpp -CONFIG -= qt dylib diff --git a/config.tests/unix/icu/icu.cpp b/config.tests/unix/icu/icu.cpp deleted file mode 100644 index e74de43980..0000000000 --- a/config.tests/unix/icu/icu.cpp +++ /dev/null @@ -1,52 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests 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 -#include -#include - -int main(int, char **) -{ - UErrorCode status = U_ZERO_ERROR; - UCollator *collator = ucol_open("ru_RU", &status); - if (U_FAILURE(status)) - return 0; - ucol_close(collator); - return 0; -} diff --git a/config.tests/unix/icu/icu.pro b/config.tests/unix/icu/icu.pro deleted file mode 100644 index eeed0eaff3..0000000000 --- a/config.tests/unix/icu/icu.pro +++ /dev/null @@ -1,9 +0,0 @@ -SOURCES = icu.cpp -CONFIG += console -CONFIG -= qt dylib - -CONFIG += build_all -CONFIG(debug, debug|release): \ - LIBS += $$LIBS_DEBUG -else: \ - LIBS += $$LIBS_RELEASE diff --git a/config.tests/unix/inotify/inotify.pro b/config.tests/unix/inotify/inotify.pro deleted file mode 100644 index 35880de3c0..0000000000 --- a/config.tests/unix/inotify/inotify.pro +++ /dev/null @@ -1,2 +0,0 @@ -SOURCES = inotifytest.cpp -CONFIG -= qt dylib diff --git a/config.tests/unix/inotify/inotifytest.cpp b/config.tests/unix/inotify/inotifytest.cpp deleted file mode 100644 index cb43bc81b7..0000000000 --- a/config.tests/unix/inotify/inotifytest.cpp +++ /dev/null @@ -1,48 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests 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 - -int main() -{ - inotify_init(); - inotify_add_watch(0, "foobar", IN_ACCESS); - inotify_rm_watch(0, 1); - return 0; -} diff --git a/config.tests/unix/ipc_posix/ipc.cpp b/config.tests/unix/ipc_posix/ipc.cpp deleted file mode 100644 index 9d14145ea2..0000000000 --- a/config.tests/unix/ipc_posix/ipc.cpp +++ /dev/null @@ -1,55 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests 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 -#include -#include -#include - -int main(int, char **) -{ - sem_t *semaphore = sem_open("test", O_CREAT | O_EXCL, 0666, 0); - if (semaphore != SEM_FAILED) - sem_close(semaphore); - - shm_open("test", O_RDWR | O_CREAT | O_EXCL, 0666); - shm_unlink("test"); - - return 0; -} diff --git a/config.tests/unix/ipc_posix/ipc_posix.pro b/config.tests/unix/ipc_posix/ipc_posix.pro deleted file mode 100644 index a8bcb397bb..0000000000 --- a/config.tests/unix/ipc_posix/ipc_posix.pro +++ /dev/null @@ -1,4 +0,0 @@ -SOURCES = ipc.cpp -CONFIG -= qt dylib -mac:CONFIG -= app_bundle -linux:LIBS += -lpthread -lrt diff --git a/config.tests/unix/ipc_sysv/ipc.cpp b/config.tests/unix/ipc_sysv/ipc.cpp deleted file mode 100644 index deb57622ba..0000000000 --- a/config.tests/unix/ipc_sysv/ipc.cpp +++ /dev/null @@ -1,57 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests 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 -#include -#include -#include -#include - -int main(int, char **) -{ - key_t unix_key = ftok("test", 'Q'); - int semaphore = semget(unix_key, 1, 0666 | IPC_CREAT | IPC_EXCL); - if (semaphore != -1) - semctl(semaphore, 0, IPC_RMID, 0); - - shmget(unix_key, 0, 0666 | IPC_CREAT | IPC_EXCL); - shmctl(0, 0, static_cast(0)); - - return 0; -} diff --git a/config.tests/unix/ipc_sysv/ipc_sysv.pro b/config.tests/unix/ipc_sysv/ipc_sysv.pro deleted file mode 100644 index 1b6de0296f..0000000000 --- a/config.tests/unix/ipc_sysv/ipc_sysv.pro +++ /dev/null @@ -1,3 +0,0 @@ -SOURCES = ipc.cpp -CONFIG -= qt dylib -mac:CONFIG -= app_bundle diff --git a/config.tests/unix/ipv6ifname/ipv6ifname.cpp b/config.tests/unix/ipv6ifname/ipv6ifname.cpp deleted file mode 100644 index fd58e85adb..0000000000 --- a/config.tests/unix/ipv6ifname/ipv6ifname.cpp +++ /dev/null @@ -1,53 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests 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$ -** -****************************************************************************/ - -/* Sample program for configure to test for if_nametoindex support -on target platforms. */ - -#include -#include -#include - -int main() -{ - char buf[IFNAMSIZ]; - if_nametoindex("eth0"); - if_indextoname(1, buf); - return 0; -} diff --git a/config.tests/unix/ipv6ifname/ipv6ifname.pro b/config.tests/unix/ipv6ifname/ipv6ifname.pro deleted file mode 100644 index 7574dce180..0000000000 --- a/config.tests/unix/ipv6ifname/ipv6ifname.pro +++ /dev/null @@ -1,3 +0,0 @@ -SOURCES = ipv6ifname.cpp -CONFIG -= qt -QT = diff --git a/config.tests/unix/journald/journald.c b/config.tests/unix/journald/journald.c deleted file mode 100644 index 6b14cd7c69..0000000000 --- a/config.tests/unix/journald/journald.c +++ /dev/null @@ -1,52 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 Jolla Ltd, author: -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests 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 -#include - -int main(int argc, char **argv) -{ - sd_journal_send("MESSAGE=%s", "test message", - "PRIORITY=%i", LOG_INFO, - "CODE_FUNC=%s", "unknown", - "CODE_LINE=%d", 0, - "CODE_FILE=%s", "foo.c", - NULL); - return 0; -} diff --git a/config.tests/unix/journald/journald.pro b/config.tests/unix/journald/journald.pro deleted file mode 100644 index deb28ae97f..0000000000 --- a/config.tests/unix/journald/journald.pro +++ /dev/null @@ -1,3 +0,0 @@ -SOURCES = journald.c - -CONFIG -= qt diff --git a/config.tests/unix/lgmon/lgmon.cpp b/config.tests/unix/lgmon/lgmon.cpp deleted file mode 100644 index 2f3800a422..0000000000 --- a/config.tests/unix/lgmon/lgmon.cpp +++ /dev/null @@ -1,47 +0,0 @@ -/*************************************************************************** -** -** Copyright (C) 2014 BlackBerry Limited. All rights reserved. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests 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 - -int main(int, char **) -{ - lgmon_supported(getpid()); - return 0; -} - diff --git a/config.tests/unix/lgmon/lgmon.pro b/config.tests/unix/lgmon/lgmon.pro deleted file mode 100644 index 33633b19f8..0000000000 --- a/config.tests/unix/lgmon/lgmon.pro +++ /dev/null @@ -1,2 +0,0 @@ -SOURCES = lgmon.cpp -CONFIG -= qt diff --git a/config.tests/unix/libinput/libinput.cpp b/config.tests/unix/libinput/libinput.cpp deleted file mode 100644 index 87bfe5c889..0000000000 --- a/config.tests/unix/libinput/libinput.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests 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 - -int main() -{ - libinput_udev_create_context(NULL, NULL, NULL); - return 0; -} diff --git a/config.tests/unix/libinput/libinput.pro b/config.tests/unix/libinput/libinput.pro deleted file mode 100644 index 941a0b73ef..0000000000 --- a/config.tests/unix/libinput/libinput.pro +++ /dev/null @@ -1,2 +0,0 @@ -SOURCES = libinput.cpp -CONFIG -= qt diff --git a/config.tests/unix/libinput_axis_api/libinput_axis_api.cpp b/config.tests/unix/libinput_axis_api/libinput_axis_api.cpp deleted file mode 100644 index d469b8920e..0000000000 --- a/config.tests/unix/libinput_axis_api/libinput_axis_api.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests 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 - -int main() -{ - libinput_event_pointer_has_axis(nullptr, LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL); - return 0; -} diff --git a/config.tests/unix/libinput_axis_api/libinput_axis_api.pro b/config.tests/unix/libinput_axis_api/libinput_axis_api.pro deleted file mode 100644 index 7221e62792..0000000000 --- a/config.tests/unix/libinput_axis_api/libinput_axis_api.pro +++ /dev/null @@ -1,2 +0,0 @@ -SOURCES = libinput_axis_api.cpp -CONFIG -= qt diff --git a/config.tests/unix/libjpeg/libjpeg.cpp b/config.tests/unix/libjpeg/libjpeg.cpp deleted file mode 100644 index 106043c608..0000000000 --- a/config.tests/unix/libjpeg/libjpeg.cpp +++ /dev/null @@ -1,52 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests 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 -#include -extern "C" { -#include -} - -j_compress_ptr cinfo; - -int main(int, char **) -{ - jpeg_create_compress(cinfo); - return 0; -} diff --git a/config.tests/unix/libjpeg/libjpeg.pro b/config.tests/unix/libjpeg/libjpeg.pro deleted file mode 100644 index 173249c634..0000000000 --- a/config.tests/unix/libjpeg/libjpeg.pro +++ /dev/null @@ -1,2 +0,0 @@ -SOURCES = libjpeg.cpp -CONFIG -= qt dylib diff --git a/config.tests/unix/libpng/libpng.cpp b/config.tests/unix/libpng/libpng.cpp deleted file mode 100644 index d3f836e49e..0000000000 --- a/config.tests/unix/libpng/libpng.cpp +++ /dev/null @@ -1,47 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests 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 - -int main(int, char **) -{ - png_structp png_ptr; - png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING,0,0,0); - return 0; -} diff --git a/config.tests/unix/libpng/libpng.pro b/config.tests/unix/libpng/libpng.pro deleted file mode 100644 index 72e5e77b06..0000000000 --- a/config.tests/unix/libpng/libpng.pro +++ /dev/null @@ -1,2 +0,0 @@ -SOURCES = libpng.cpp -CONFIG -= qt dylib diff --git a/config.tests/unix/libudev/libudev.cpp b/config.tests/unix/libudev/libudev.cpp deleted file mode 100644 index 6636f49732..0000000000 --- a/config.tests/unix/libudev/libudev.cpp +++ /dev/null @@ -1,47 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests 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 - -int main() -{ - udev *u = udev_new(); - udev_unref(u); - return 0; -} diff --git a/config.tests/unix/libudev/libudev.pro b/config.tests/unix/libudev/libudev.pro deleted file mode 100644 index b557e7b17b..0000000000 --- a/config.tests/unix/libudev/libudev.pro +++ /dev/null @@ -1,2 +0,0 @@ -SOURCES = libudev.cpp -CONFIG -= qt diff --git a/config.tests/unix/mtdev/mtdev.cpp b/config.tests/unix/mtdev/mtdev.cpp deleted file mode 100644 index bda6b06fda..0000000000 --- a/config.tests/unix/mtdev/mtdev.cpp +++ /dev/null @@ -1,47 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Jolla Ltd, author: -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests 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 - -int main(int, char **) -{ - mtdev m; - mtdev_open(&m, 0); - return 0; -} diff --git a/config.tests/unix/mtdev/mtdev.pro b/config.tests/unix/mtdev/mtdev.pro deleted file mode 100644 index 14111c6dc6..0000000000 --- a/config.tests/unix/mtdev/mtdev.pro +++ /dev/null @@ -1,3 +0,0 @@ -SOURCES = mtdev.cpp - -CONFIG -= qt diff --git a/config.tests/unix/mysql/mysql.cpp b/config.tests/unix/mysql/mysql.cpp deleted file mode 100644 index 3f83cb1e68..0000000000 --- a/config.tests/unix/mysql/mysql.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests 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$ -** -****************************************************************************/ -#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(WIN64) || defined(_WIN64) || defined(__WIN64__) -#include -#endif - -#include "mysql.h" - -int main(int, char **) -{ - mysql_get_client_version(); - return 0; -} diff --git a/config.tests/unix/mysql/mysql.pro b/config.tests/unix/mysql/mysql.pro deleted file mode 100644 index 745f9ee0fb..0000000000 --- a/config.tests/unix/mysql/mysql.pro +++ /dev/null @@ -1,2 +0,0 @@ -SOURCES = mysql.cpp -CONFIG -= qt dylib diff --git a/config.tests/unix/objcopy/objcopy.cpp b/config.tests/unix/objcopy/objcopy.cpp deleted file mode 100644 index 8e8ff43ae9..0000000000 --- a/config.tests/unix/objcopy/objcopy.cpp +++ /dev/null @@ -1,43 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 BlackBerry Limited. All rights reserved. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests 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$ -** -****************************************************************************/ - -int main() -{ - return 0; -} diff --git a/config.tests/unix/objcopy/objcopy.pro b/config.tests/unix/objcopy/objcopy.pro deleted file mode 100644 index 3c76ae92ef..0000000000 --- a/config.tests/unix/objcopy/objcopy.pro +++ /dev/null @@ -1,7 +0,0 @@ -SOURCES = objcopy.cpp -CONFIG -= qt -TARGET = objcopytest - -load(resolve_target) - -QMAKE_POST_LINK += $$QMAKE_OBJCOPY --only-keep-debug $$QMAKE_RESOLVED_TARGET objcopytest.debug && $$QMAKE_OBJCOPY --strip-debug $$QMAKE_RESOLVED_TARGET && $$QMAKE_OBJCOPY --add-gnu-debuglink=objcopytest.debug $$QMAKE_RESOLVED_TARGET diff --git a/config.tests/unix/oci/oci.cpp b/config.tests/unix/oci/oci.cpp deleted file mode 100644 index 0a73d06c7c..0000000000 --- a/config.tests/unix/oci/oci.cpp +++ /dev/null @@ -1,45 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests 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 - -int main(int, char **) -{ - return 0; -} diff --git a/config.tests/unix/oci/oci.pro b/config.tests/unix/oci/oci.pro deleted file mode 100644 index c9aec08ee0..0000000000 --- a/config.tests/unix/oci/oci.pro +++ /dev/null @@ -1,2 +0,0 @@ -SOURCES = oci.cpp -CONFIG -= qt dylib diff --git a/config.tests/unix/odbc/odbc.cpp b/config.tests/unix/odbc/odbc.cpp deleted file mode 100644 index fc36f121c4..0000000000 --- a/config.tests/unix/odbc/odbc.cpp +++ /dev/null @@ -1,51 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests 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$ -** -****************************************************************************/ - -#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(WIN64) || defined(_WIN64) || defined(__WIN64__) -#include -#endif -#include -#include - -int main(int, char **) -{ - SQLHANDLE env; - SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, &env); - return 0; -} diff --git a/config.tests/unix/odbc/odbc.pro b/config.tests/unix/odbc/odbc.pro deleted file mode 100644 index 6c72dc7b1c..0000000000 --- a/config.tests/unix/odbc/odbc.pro +++ /dev/null @@ -1,2 +0,0 @@ -SOURCES = odbc.cpp -CONFIG -= qt dylib diff --git a/config.tests/unix/opengldesktop/opengldesktop.cpp b/config.tests/unix/opengldesktop/opengldesktop.cpp deleted file mode 100644 index 0a5ce4e78c..0000000000 --- a/config.tests/unix/opengldesktop/opengldesktop.cpp +++ /dev/null @@ -1,55 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests 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$ -** -****************************************************************************/ - -#ifdef __APPLE__ -#include -#else -#define GL_GLEXT_PROTOTYPES -#include -#endif - -int main(int, char **) -{ - glBegin(GL_TRIANGLES); - glVertex2f(20.0f, 10.0f); - glVertex2f(10.0f, 30.0f); - glVertex2f(20.0f, 50.0f); - glEnd(); - return 0; -} diff --git a/config.tests/unix/opengldesktop/opengldesktop.pro b/config.tests/unix/opengldesktop/opengldesktop.pro deleted file mode 100644 index 7b53aa460d..0000000000 --- a/config.tests/unix/opengldesktop/opengldesktop.pro +++ /dev/null @@ -1,3 +0,0 @@ -SOURCES = opengldesktop.cpp - -CONFIG -= qt diff --git a/config.tests/unix/opengles2/opengles2.cpp b/config.tests/unix/opengles2/opengles2.cpp deleted file mode 100644 index 39a48dcf29..0000000000 --- a/config.tests/unix/opengles2/opengles2.cpp +++ /dev/null @@ -1,53 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests 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$ -** -****************************************************************************/ - -#ifdef __APPLE__ - #include -#else - #define GL_GLEXT_PROTOTYPES - #include -#endif - -int main(int, char **) -{ - glUniform1f(1, GLfloat(1.0)); - glClear(GL_COLOR_BUFFER_BIT); - - return 0; -} diff --git a/config.tests/unix/opengles2/opengles2.pro b/config.tests/unix/opengles2/opengles2.pro deleted file mode 100644 index 15e4ce3ca0..0000000000 --- a/config.tests/unix/opengles2/opengles2.pro +++ /dev/null @@ -1,3 +0,0 @@ -SOURCES = opengles2.cpp - -CONFIG -= qt diff --git a/config.tests/unix/opengles3/opengles3.cpp b/config.tests/unix/opengles3/opengles3.cpp deleted file mode 100644 index 7bcfc0e4bc..0000000000 --- a/config.tests/unix/opengles3/opengles3.cpp +++ /dev/null @@ -1,56 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests 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$ -** -****************************************************************************/ - -#ifdef __APPLE__ - #include -#else - #define GL_GLEXT_PROTOTYPES - #include -#endif - -int main(int, char **) -{ - glGetStringi(GL_EXTENSIONS, 0); - glReadBuffer(GL_COLOR_ATTACHMENT1); - static GLfloat f[6]; - glUniformMatrix2x3fv(0, 0, GL_FALSE, f); - glMapBufferRange(GL_ARRAY_BUFFER, 0, 0, GL_MAP_READ_BIT); - - return 0; -} diff --git a/config.tests/unix/opengles3/opengles3.pro b/config.tests/unix/opengles3/opengles3.pro deleted file mode 100644 index dc62f7856a..0000000000 --- a/config.tests/unix/opengles3/opengles3.pro +++ /dev/null @@ -1,7 +0,0 @@ -# The library is expected to be the same as in ES 2.0 (libGLESv2). -# The difference is the header and the presence of the functions in -# the library. - -SOURCES = opengles3.cpp - -CONFIG -= qt diff --git a/config.tests/unix/opengles31/opengles31.cpp b/config.tests/unix/opengles31/opengles31.cpp deleted file mode 100644 index dbc7eb3b29..0000000000 --- a/config.tests/unix/opengles31/opengles31.cpp +++ /dev/null @@ -1,48 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests 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 - -int main(int, char **) -{ - glDispatchCompute(1, 1, 1); - glProgramUniform1i(0, 0, 0); - - return 0; -} diff --git a/config.tests/unix/opengles31/opengles31.pro b/config.tests/unix/opengles31/opengles31.pro deleted file mode 100644 index 7895be9efc..0000000000 --- a/config.tests/unix/opengles31/opengles31.pro +++ /dev/null @@ -1,7 +0,0 @@ -# The library is expected to be the same as in ES 2.0 (libGLESv2). -# The difference is the header and the presence of the functions in -# the library. - -SOURCES = opengles31.cpp - -CONFIG -= qt diff --git a/config.tests/unix/openvg/openvg.cpp b/config.tests/unix/openvg/openvg.cpp deleted file mode 100644 index f9cf7786ab..0000000000 --- a/config.tests/unix/openvg/openvg.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the documentation 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 - - -int main(int, char **) -{ - VGint i; - i = 2; - vgFlush(); - return 0; -} diff --git a/config.tests/unix/openvg/openvg.pro b/config.tests/unix/openvg/openvg.pro deleted file mode 100644 index 1933e3789c..0000000000 --- a/config.tests/unix/openvg/openvg.pro +++ /dev/null @@ -1,3 +0,0 @@ -SOURCES += openvg.cpp - -CONFIG -= qt diff --git a/config.tests/unix/pcre2/pcre2.cpp b/config.tests/unix/pcre2/pcre2.cpp deleted file mode 100644 index 9c94d29999..0000000000 --- a/config.tests/unix/pcre2/pcre2.cpp +++ /dev/null @@ -1,52 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Giuseppe D'Angelo -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests 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$ -** -****************************************************************************/ - -#define PCRE2_CODE_UNIT_WIDTH 16 - -#include - -#if (PCRE2_MAJOR < 10) || ((PCRE2_MAJOR == 10) && (PCRE2_MINOR < 20)) -#error This PCRE version is not supported -#endif - -int main(int, char **) -{ - return 0; -} - diff --git a/config.tests/unix/pcre2/pcre2.pro b/config.tests/unix/pcre2/pcre2.pro deleted file mode 100644 index 6a3fc275bc..0000000000 --- a/config.tests/unix/pcre2/pcre2.pro +++ /dev/null @@ -1,2 +0,0 @@ -SOURCES = pcre2.cpp -CONFIG -= qt dylib diff --git a/config.tests/unix/poll/poll.cpp b/config.tests/unix/poll/poll.cpp deleted file mode 100644 index ad33900a63..0000000000 --- a/config.tests/unix/poll/poll.cpp +++ /dev/null @@ -1,51 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests 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 - -int main() -{ - struct pollfd pfd; - - pfd.fd = -1; - pfd.events = 0; - pfd.revents = 0; - - return ::poll(&pfd, 1, 0); -} diff --git a/config.tests/unix/poll/poll.pro b/config.tests/unix/poll/poll.pro deleted file mode 100644 index 70121b4586..0000000000 --- a/config.tests/unix/poll/poll.pro +++ /dev/null @@ -1,2 +0,0 @@ -SOURCES = poll.cpp -CONFIG -= qt diff --git a/config.tests/unix/pollts/pollts.cpp b/config.tests/unix/pollts/pollts.cpp deleted file mode 100644 index ce5db6a37b..0000000000 --- a/config.tests/unix/pollts/pollts.cpp +++ /dev/null @@ -1,57 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests 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 -#include -#include - -int main() -{ - struct pollfd pfd; - struct timespec ts; - - pfd.fd = -1; - pfd.events = 0; - pfd.revents = 0; - - ts.tv_sec = 0; - ts.tv_nsec = 0; - - return ::pollts(&pfd, 1, &ts, nullptr); -} diff --git a/config.tests/unix/pollts/pollts.pro b/config.tests/unix/pollts/pollts.pro deleted file mode 100644 index 5109dc33fd..0000000000 --- a/config.tests/unix/pollts/pollts.pro +++ /dev/null @@ -1,2 +0,0 @@ -SOURCES = pollts.cpp -CONFIG -= qt diff --git a/config.tests/unix/posix_fallocate/posix_fallocate.cpp b/config.tests/unix/posix_fallocate/posix_fallocate.cpp deleted file mode 100644 index ce1286813a..0000000000 --- a/config.tests/unix/posix_fallocate/posix_fallocate.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests 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 -// NetBSD 7 has posix_fallocate, but in unistd.h instead of fcntl.h -#ifdef __NetBSD__ -# include -#endif - -int main(int, char **) -{ - return ::posix_fallocate(0, 0, 0); -} diff --git a/config.tests/unix/posix_fallocate/posix_fallocate.pro b/config.tests/unix/posix_fallocate/posix_fallocate.pro deleted file mode 100644 index f01b15f3d7..0000000000 --- a/config.tests/unix/posix_fallocate/posix_fallocate.pro +++ /dev/null @@ -1,2 +0,0 @@ -SOURCES = posix_fallocate.cpp -CONFIG -= qt dylib diff --git a/config.tests/unix/ppoll/ppoll.cpp b/config.tests/unix/ppoll/ppoll.cpp deleted file mode 100644 index 9e065afadc..0000000000 --- a/config.tests/unix/ppoll/ppoll.cpp +++ /dev/null @@ -1,56 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests 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 -#include - -int main() -{ - struct pollfd pfd; - struct timespec ts; - - pfd.fd = -1; - pfd.events = 0; - pfd.revents = 0; - - ts.tv_sec = 0; - ts.tv_nsec = 0; - - return ::ppoll(&pfd, 1, &ts, nullptr); -} diff --git a/config.tests/unix/ppoll/ppoll.pro b/config.tests/unix/ppoll/ppoll.pro deleted file mode 100644 index d08a8a0679..0000000000 --- a/config.tests/unix/ppoll/ppoll.pro +++ /dev/null @@ -1,2 +0,0 @@ -SOURCES = ppoll.cpp -CONFIG -= qt diff --git a/config.tests/unix/pps/pps.cpp b/config.tests/unix/pps/pps.cpp deleted file mode 100644 index fba0673bf1..0000000000 --- a/config.tests/unix/pps/pps.cpp +++ /dev/null @@ -1,48 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 BlackBerry Limited. All rights reserved. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests 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 - -int main(int, char **) -{ - pps_decoder_t decoder; - - pps_decoder_initialize(&decoder, NULL); - return 0; -} diff --git a/config.tests/unix/pps/pps.pro b/config.tests/unix/pps/pps.pro deleted file mode 100644 index af9b339f97..0000000000 --- a/config.tests/unix/pps/pps.pro +++ /dev/null @@ -1,2 +0,0 @@ -SOURCES = pps.cpp -CONFIG -= qt diff --git a/config.tests/unix/psql/psql.cpp b/config.tests/unix/psql/psql.cpp deleted file mode 100644 index 8d40d84c9e..0000000000 --- a/config.tests/unix/psql/psql.cpp +++ /dev/null @@ -1,47 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests 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 "libpq-fe.h" - -int main(int, char **) -{ - PQescapeBytea(0, 0, 0); - PQunescapeBytea(0, 0); - return 0; -} diff --git a/config.tests/unix/psql/psql.pro b/config.tests/unix/psql/psql.pro deleted file mode 100644 index dae7375be5..0000000000 --- a/config.tests/unix/psql/psql.pro +++ /dev/null @@ -1,2 +0,0 @@ -SOURCES = psql.cpp -CONFIG -= qt dylib diff --git a/config.tests/unix/qqnx_imf/qqnx_imf.cpp b/config.tests/unix/qqnx_imf/qqnx_imf.cpp deleted file mode 100644 index 5af5fb627c..0000000000 --- a/config.tests/unix/qqnx_imf/qqnx_imf.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 BlackBerry Limited. All rights reserved. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests 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 "imf/imf_client.h" - -int main(int, char **) -{ - imf_client_init(); - return 0; -} diff --git a/config.tests/unix/qqnx_imf/qqnx_imf.pro b/config.tests/unix/qqnx_imf/qqnx_imf.pro deleted file mode 100644 index e1a2d9cecb..0000000000 --- a/config.tests/unix/qqnx_imf/qqnx_imf.pro +++ /dev/null @@ -1,2 +0,0 @@ -SOURCES = qqnx_imf.cpp -CONFIG -= qt diff --git a/config.tests/unix/reduce_exports/fvisibility.c b/config.tests/unix/reduce_exports/fvisibility.c deleted file mode 100644 index 12055ead46..0000000000 --- a/config.tests/unix/reduce_exports/fvisibility.c +++ /dev/null @@ -1,46 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the configuration 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$ -** -****************************************************************************/ - -#if defined(__GNUC__) -__attribute((visibility("default"))) void blah(); -#elif defined(__SUNPRO_CC) -__global void blah(); -#else -# error "GCC4+ or SunStudio 8+ are required to support ELF visibility" -#endif diff --git a/config.tests/unix/reduce_exports/reduce_exports.pro b/config.tests/unix/reduce_exports/reduce_exports.pro deleted file mode 100644 index dc8adc2637..0000000000 --- a/config.tests/unix/reduce_exports/reduce_exports.pro +++ /dev/null @@ -1,5 +0,0 @@ -TEMPLATE = lib -CONFIG += dll hide_symbols -SOURCES = fvisibility.c - -isEmpty(QMAKE_CFLAGS_HIDESYMS): error("Nope") diff --git a/config.tests/unix/reduce_relocs/bsymbolic_functions.c b/config.tests/unix/reduce_relocs/bsymbolic_functions.c deleted file mode 100644 index 36ff410c81..0000000000 --- a/config.tests/unix/reduce_relocs/bsymbolic_functions.c +++ /dev/null @@ -1,44 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the configuration 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$ -** -****************************************************************************/ - -#if !(defined(__i386) || defined(__i386__) || defined(__x86_64) || defined(__x86_64__) || defined(__amd64)) -# error Symbolic function binding on this architecture may be broken, disabling it (see QTBUG-36129). -#endif - -int main() { return 0; } diff --git a/config.tests/unix/reduce_relocs/reduce_relocs.pro b/config.tests/unix/reduce_relocs/reduce_relocs.pro deleted file mode 100644 index 2f23465a3f..0000000000 --- a/config.tests/unix/reduce_relocs/reduce_relocs.pro +++ /dev/null @@ -1,5 +0,0 @@ -TEMPLATE = lib -CONFIG += dll bsymbolic_functions -SOURCES = bsymbolic_functions.c - -isEmpty(QMAKE_LFLAGS_BSYMBOLIC_FUNC): error("Nope") diff --git a/config.tests/unix/sctp/sctp.cpp b/config.tests/unix/sctp/sctp.cpp deleted file mode 100644 index 61c33d5fc5..0000000000 --- a/config.tests/unix/sctp/sctp.cpp +++ /dev/null @@ -1,62 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 Alex Trotsenko -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests 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$ -** -****************************************************************************/ - -/* - Sample program for configure to test for SCTP sockets support - on target platforms. -*/ - -#include -#include -#include -#include - -int main() -{ - int fd; - sctp_initmsg sctpInitMsg; - socklen_t sctpInitMsgSize = sizeof(sctpInitMsg); - - fd = socket(PF_INET, SOCK_STREAM, IPPROTO_SCTP); - if (fd == -1 || getsockopt(fd, SOL_SCTP, SCTP_INITMSG, &sctpInitMsg, - &sctpInitMsgSize) != 0) - return 1; - - return 0; -} diff --git a/config.tests/unix/sctp/sctp.pro b/config.tests/unix/sctp/sctp.pro deleted file mode 100644 index 2138254732..0000000000 --- a/config.tests/unix/sctp/sctp.pro +++ /dev/null @@ -1,3 +0,0 @@ -SOURCES = sctp.cpp -CONFIG -= qt -QT = diff --git a/config.tests/unix/slog2/slog2.cpp b/config.tests/unix/slog2/slog2.cpp deleted file mode 100644 index 351829ea99..0000000000 --- a/config.tests/unix/slog2/slog2.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 - 2012 Research In Motion -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests 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 - -int main(int, char **) -{ - slog2_set_default_buffer((slog2_buffer_t)-1); - return 0; -} diff --git a/config.tests/unix/slog2/slog2.pro b/config.tests/unix/slog2/slog2.pro deleted file mode 100644 index 269a88a383..0000000000 --- a/config.tests/unix/slog2/slog2.pro +++ /dev/null @@ -1,2 +0,0 @@ -SOURCES = slog2.cpp -CONFIG -= qt diff --git a/config.tests/unix/sqlite/sqlite.cpp b/config.tests/unix/sqlite/sqlite.cpp deleted file mode 100644 index dd17f74101..0000000000 --- a/config.tests/unix/sqlite/sqlite.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests 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 - -int main(int, char **) -{ - sqlite3_open_v2(0, 0, 0, 0); - return 0; -} diff --git a/config.tests/unix/sqlite/sqlite.pro b/config.tests/unix/sqlite/sqlite.pro deleted file mode 100644 index 4b24e014ba..0000000000 --- a/config.tests/unix/sqlite/sqlite.pro +++ /dev/null @@ -1,2 +0,0 @@ -SOURCES = sqlite.cpp -CONFIG -= qt dylib diff --git a/config.tests/unix/sqlite2/sqlite2.cpp b/config.tests/unix/sqlite2/sqlite2.cpp deleted file mode 100644 index 1c1058052a..0000000000 --- a/config.tests/unix/sqlite2/sqlite2.cpp +++ /dev/null @@ -1,45 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests 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 - -int main(int, char **) -{ - return 0; -} diff --git a/config.tests/unix/sqlite2/sqlite2.pro b/config.tests/unix/sqlite2/sqlite2.pro deleted file mode 100644 index b1252721dc..0000000000 --- a/config.tests/unix/sqlite2/sqlite2.pro +++ /dev/null @@ -1,2 +0,0 @@ -SOURCES = sqlite2.cpp -CONFIG -= qt dylib diff --git a/config.tests/unix/stack-protector/stack-protector.cpp b/config.tests/unix/stack-protector/stack-protector.cpp deleted file mode 100644 index 8b3926fe1f..0000000000 --- a/config.tests/unix/stack-protector/stack-protector.cpp +++ /dev/null @@ -1,52 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests 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$ -** -****************************************************************************/ - -#if defined(__QNXNTO__) -#include - -#if _NTO_VERSION < 700 -#error stack-protector not used (by default) before QNX 7.0.0. -#endif - -#endif - -int main() -{ - return 0; -} diff --git a/config.tests/unix/stack-protector/stack-protector.pro b/config.tests/unix/stack-protector/stack-protector.pro deleted file mode 100644 index ac84d7f148..0000000000 --- a/config.tests/unix/stack-protector/stack-protector.pro +++ /dev/null @@ -1,2 +0,0 @@ -SOURCES = stack-protector.cpp -QMAKE_CXXFLAGS += -fstack-protector-strong diff --git a/config.tests/unix/syslog/syslog.c b/config.tests/unix/syslog/syslog.c deleted file mode 100644 index aaf0fe7509..0000000000 --- a/config.tests/unix/syslog/syslog.c +++ /dev/null @@ -1,48 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 Tasuku Suzuki -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests 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 - -int main(int argc, char **argv) -{ - openlog("qt", 0, LOG_USER); - syslog(LOG_INFO, "configure"); - closelog(); - return 0; -} diff --git a/config.tests/unix/syslog/syslog.pro b/config.tests/unix/syslog/syslog.pro deleted file mode 100644 index abe8cc9cd7..0000000000 --- a/config.tests/unix/syslog/syslog.pro +++ /dev/null @@ -1,3 +0,0 @@ -SOURCES = syslog.c - -CONFIG -= qt diff --git a/config.tests/unix/tds/tds.cpp b/config.tests/unix/tds/tds.cpp deleted file mode 100644 index 9d595154b7..0000000000 --- a/config.tests/unix/tds/tds.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests 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 -#include - -int main(int, char **) -{ - return 0; -} diff --git a/config.tests/unix/tds/tds.pro b/config.tests/unix/tds/tds.pro deleted file mode 100644 index f60fc0a602..0000000000 --- a/config.tests/unix/tds/tds.pro +++ /dev/null @@ -1,2 +0,0 @@ -SOURCES = tds.cpp -CONFIG -= qt dylib diff --git a/config.tests/unix/tslib/tslib.cpp b/config.tests/unix/tslib/tslib.cpp deleted file mode 100644 index 7afb07aa66..0000000000 --- a/config.tests/unix/tslib/tslib.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests 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 - -int main() -{ - ts_open("foo", 0); - return 0; -} diff --git a/config.tests/unix/tslib/tslib.pro b/config.tests/unix/tslib/tslib.pro deleted file mode 100644 index 6fc652dd96..0000000000 --- a/config.tests/unix/tslib/tslib.pro +++ /dev/null @@ -1,2 +0,0 @@ -SOURCES = tslib.cpp -CONFIG -= qt diff --git a/config.tests/unix/xkbcommon/xkbcommon.cpp b/config.tests/unix/xkbcommon/xkbcommon.cpp deleted file mode 100644 index f13b4f721a..0000000000 --- a/config.tests/unix/xkbcommon/xkbcommon.cpp +++ /dev/null @@ -1,48 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests 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 -#include -#include - -int main() -{ - xkb_context_new(XKB_CONTEXT_NO_FLAGS); - return 0; -} diff --git a/config.tests/unix/xkbcommon/xkbcommon.pro b/config.tests/unix/xkbcommon/xkbcommon.pro deleted file mode 100644 index 4bc6e493b2..0000000000 --- a/config.tests/unix/xkbcommon/xkbcommon.pro +++ /dev/null @@ -1,2 +0,0 @@ -SOURCES = xkbcommon.cpp -CONFIG -= qt diff --git a/config.tests/unix/zlib/zlib.cpp b/config.tests/unix/zlib/zlib.cpp deleted file mode 100644 index 3908e59c36..0000000000 --- a/config.tests/unix/zlib/zlib.cpp +++ /dev/null @@ -1,52 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests 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 - -int main(int, char **) -{ - z_streamp stream; - stream = 0; - const char *ver = zlibVersion(); - ver = 0; - // compress2 was added in zlib version 1.0.8 - int res = compress2(0, 0, 0, 0, 1); - res = 0; - return 0; -} diff --git a/config.tests/unix/zlib/zlib.pro b/config.tests/unix/zlib/zlib.pro deleted file mode 100644 index 6a6b324611..0000000000 --- a/config.tests/unix/zlib/zlib.pro +++ /dev/null @@ -1,2 +0,0 @@ -SOURCES = zlib.cpp -CONFIG -= qt dylib diff --git a/config.tests/win/directwrite/directwrite.cpp b/config.tests/win/directwrite/directwrite.cpp deleted file mode 100644 index 8380c703ad..0000000000 --- a/config.tests/win/directwrite/directwrite.cpp +++ /dev/null @@ -1,50 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests 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 -#include - -int main(int, char**) -{ - IDWriteFactory *factory = 0; - DWriteCreateFactory(DWRITE_FACTORY_TYPE_SHARED, - __uuidof(IDWriteFactory), - reinterpret_cast(&factory)); - return 0; -} diff --git a/config.tests/win/directwrite/directwrite.pro b/config.tests/win/directwrite/directwrite.pro deleted file mode 100644 index 88ff6ee2b8..0000000000 --- a/config.tests/win/directwrite/directwrite.pro +++ /dev/null @@ -1,3 +0,0 @@ -SOURCES = directwrite.cpp -CONFIG -= qt -CONFIG += console diff --git a/config.tests/win/directwrite2/directwrite2.cpp b/config.tests/win/directwrite2/directwrite2.cpp deleted file mode 100644 index 65fa9d44cd..0000000000 --- a/config.tests/win/directwrite2/directwrite2.cpp +++ /dev/null @@ -1,51 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests 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 -#include - -int main(int, char**) -{ - IUnknown *factory = 0; - const size_t dummy = size_t(DWRITE_E_NOCOLOR) + sizeof(IDWriteFontFace2); - DWriteCreateFactory(DWRITE_FACTORY_TYPE_SHARED, - __uuidof(IDWriteFactory2), - &factory); - return 0; -} diff --git a/config.tests/win/directwrite2/directwrite2.pro b/config.tests/win/directwrite2/directwrite2.pro deleted file mode 100644 index 5d6fe24a4b..0000000000 --- a/config.tests/win/directwrite2/directwrite2.pro +++ /dev/null @@ -1,3 +0,0 @@ -SOURCES = directwrite2.cpp -CONFIG -= qt -CONFIG += console diff --git a/config.tests/x11/xinput2/xinput2.cpp b/config.tests/x11/xinput2/xinput2.cpp deleted file mode 100644 index 4cdac72945..0000000000 --- a/config.tests/x11/xinput2/xinput2.cpp +++ /dev/null @@ -1,73 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests 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 -#include -#include - -#ifndef XInput_2_0 -# error "Missing XInput_2_0 #define" -#endif - -int main(int, char **) -{ - // need XGenericEventCookie for XInput2 to work - Display *dpy = 0; - XEvent xevent; - if (XGetEventData(dpy, &xevent.xcookie)) { - XFreeEventData(dpy, &xevent.xcookie); - } - - XIEvent *xievent; - xievent = 0; - - XIDeviceEvent *xideviceevent; - xideviceevent = 0; - - XIHierarchyEvent *xihierarchyevent; - xihierarchyevent = 0; - - int deviceid = 0; - int len = 0; - Atom *atoms = XIListProperties(dpy, deviceid, &len); - if (atoms) - XFree(atoms); - - return 0; -} diff --git a/config.tests/x11/xinput2/xinput2.pro b/config.tests/x11/xinput2/xinput2.pro deleted file mode 100644 index 4788f0e14b..0000000000 --- a/config.tests/x11/xinput2/xinput2.pro +++ /dev/null @@ -1,3 +0,0 @@ -CONFIG += x11 -CONFIG -= qt -SOURCES = xinput2.cpp diff --git a/config.tests/x11/xlib/xlib.cpp b/config.tests/x11/xlib/xlib.cpp deleted file mode 100644 index 6743847335..0000000000 --- a/config.tests/x11/xlib/xlib.cpp +++ /dev/null @@ -1,48 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests 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 - -int main(int, char **) -{ - Display *d = XOpenDisplay(NULL); - XCloseDisplay(d); - return 0; -} - diff --git a/config.tests/x11/xlib/xlib.pro b/config.tests/x11/xlib/xlib.pro deleted file mode 100644 index 658161ed9d..0000000000 --- a/config.tests/x11/xlib/xlib.pro +++ /dev/null @@ -1,3 +0,0 @@ -CONFIG += x11 -CONFIG -= qt -SOURCES = xlib.cpp diff --git a/configure.json b/configure.json index b7f767e2ec..80278b3b69 100644 --- a/configure.json +++ b/configure.json @@ -147,7 +147,14 @@ "libraries": { "zlib": { "label": "zlib", - "test": "unix/zlib", + "test": { + "include": "zlib.h", + "main": [ + "z_streamp stream = 0;", + "(void) zlibVersion();", + "(void) compress2(0, 0, 0, 0, 1); // compress2 was added in zlib version 1.0.8" + ] + }, "sources": [ { "libs": "-lzdll", "condition": "config.msvc" }, { "libs": "-lz", "condition": "!config.msvc" } @@ -155,7 +162,17 @@ }, "dbus": { "label": "D-Bus >= 1.2", - "test": "unix/dbus", + "test": { + "include": "dbus/dbus.h", + "main": "(void) dbus_bus_get_private(DBUS_BUS_SYSTEM, (DBusError *)NULL);", + "qmake": [ + "CONFIG += build_all", + "CONFIG(debug, debug|release): \\", + " LIBS += $$LIBS_DEBUG", + "else: \\", + " LIBS += $$LIBS_RELEASE" + ] + }, "sources": [ { "type": "pkgConfig", "args": "dbus-1 >= 1.2" }, { @@ -179,7 +196,10 @@ }, "libudev": { "label": "udev", - "test": "unix/libudev", + "test": { + "include": "libudev.h", + "main": "udev_unref(udev_new());" + }, "sources": [ { "type": "pkgConfig", "args": "libudev" }, "-ludev" @@ -241,12 +261,31 @@ "c++14": { "label": "C++14 support", "type": "compile", - "test": "common/c++14" + "test": { + "head": [ + "#if __cplusplus > 201103L", + "// Compiler claims to support C++14, trust it", + "#else", + "# error __cplusplus must be > 201103L (the value of C++11)", + "#endif" + ], + "qmake": "CONFIG += c++11 c++14" + } }, "c++1z": { "label": "C++1z support", "type": "compile", - "test": "common/c++1z" + "test": { + "head": [ + "#if __cplusplus > 201402L", + "// Compiler claims to support experimental C++1z, trust it", + "#else", + "# error __cplusplus must be > 201402L (the value for C++14)", + "#endif", + "#include // https://bugs.llvm.org//show_bug.cgi?id=33117" + ], + "qmake": "CONFIG += c++11 c++14 c++1z" + } }, "precompile_header": { "label": "precompiled header support", @@ -271,12 +310,38 @@ "reduce_exports": { "label": "symbol visibility support", "type": "compile", - "test": "unix/reduce_exports" + "test": { + "head": [ + "#if defined(__GNUC__)", + "__attribute((visibility(\"default\")))", + "#elif defined(__SUNPRO_CC)", + "__global", + "#else", + "# error GCC4+ or SunStudio 8+ are required to support ELF visibility", + "#endif" + ], + "qmake": [ + "TEMPLATE = lib", + "CONFIG += dll hide_symbols", + "isEmpty(QMAKE_CFLAGS_HIDESYMS): error(\"Nope\")" + ] + } }, "reduce_relocations": { "label": "-Bsymbolic-functions support", "type": "compile", - "test": "unix/reduce_relocs" + "test": { + "head": [ + "#if !(defined(__i386) || defined(__i386__) || defined(__x86_64) || defined(__x86_64__) || defined(__amd64))", + "# error Symbolic function binding on this architecture may be broken, disabling it (see QTBUG-36129).", + "#endif" + ], + "qmake": [ + "TEMPLATE = lib", + "CONFIG += dll bsymbolic_functions", + "isEmpty(QMAKE_LFLAGS_BSYMBOLIC_FUNC): error(\"Nope\")" + ] + } }, "build_parts": { "type": "buildParts" @@ -284,47 +349,150 @@ "separate_debug_info": { "label": "separate debug information support", "type": "compile", - "test": "unix/objcopy" + "test": { + "qmake": [ + "TARGET = objcopytest", + "load(resolve_target)", + "QMAKE_POST_LINK += \\", + " $$QMAKE_OBJCOPY --only-keep-debug $$QMAKE_RESOLVED_TARGET objcopytest.debug && \\", + " $$QMAKE_OBJCOPY --strip-debug $$QMAKE_RESOLVED_TARGET && \\", + " $$QMAKE_OBJCOPY --add-gnu-debuglink=objcopytest.debug $$QMAKE_RESOLVED_TARGET" + ] + } }, "sse2": { "label": "SSE2 instructions", "type": "compile", - "test": "common/sse2" + "test": { + "include": "emmintrin.h", + "main": [ + "__m128i a = _mm_setzero_si128();", + "_mm_maskmoveu_si128(a, _mm_setzero_si128(), 0);" + ], + "qmake": [ + "!defined(QMAKE_CFLAGS_SSE2, var): error(\"This compiler does not support SSE2\")", + "QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_SSE2" + ] + } }, "sse3": { "label": "SSE3 instructions", "type": "compile", - "test": "common/sse3" + "test": { + "include": "pmmintrin.h", + "main": [ + "__m128d a = _mm_set1_pd(6.28);", + "__m128d b = _mm_set1_pd(3.14);", + "__m128d result = _mm_addsub_pd(a, b);", + "(void) _mm_movedup_pd(result);" + ], + "qmake": [ + "!defined(QMAKE_CFLAGS_SSE3, var): error(\"This compiler does not support SSE3\")", + "QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_SSE3" + ] + } }, "ssse3": { "label": "SSSE3 instructions", "type": "compile", - "test": "common/ssse3" + "test": { + "include": "tmmintrin.h", + "main": [ + "__m128i a = _mm_set1_epi32(42);", + "_mm_abs_epi8(a);", + "(void) _mm_sign_epi16(a, _mm_set1_epi32(64));" + ], + "qmake": [ + "!defined(QMAKE_CFLAGS_SSSE3, var): error(\"This compiler does not support SSSE3\")", + "QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_SSSE3" + ] + } }, "sse4_1": { "label": "SSE4.1 instructions", "type": "compile", - "test": "common/sse4_1" + "test": { + "include": "smmintrin.h", + "main": [ + "__m128 a = _mm_setzero_ps();", + "_mm_ceil_ps(a);", + "__m128i result = _mm_mullo_epi32(_mm_set1_epi32(42), _mm_set1_epi32(64));", + "(void)result;" + ], + "qmake": [ + "!defined(QMAKE_CFLAGS_SSE4_1, var): error(\"This compiler does not support SSE4.1\")", + "QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_SSE4_1" + ] + } }, "sse4_2": { "label": "SSE4.2 instructions", "type": "compile", - "test": "common/sse4_2" + "test": { + "include": "nmmintrin.h", + "main": [ + "__m128i a = _mm_setzero_si128();", + "__m128i b = _mm_set1_epi32(42);", + "(void) _mm_cmpestrm(a, 16, b, 16, 0);" + ], + "qmake": [ + "!defined(QMAKE_CFLAGS_SSE4_2, var): error(\"This compiler does not support SSE4.2\")", + "QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_SSE4_2" + ] + } }, "f16c": { "label": "F16C instructions", "type": "compile", - "test": "common/f16c" + "test": { + "include": "immintrin.h", + "main": [ + "__m128i a = _mm_setzero_si128();", + "__m128 b = _mm_cvtph_ps(a);", + "__m256 b256 = _mm256_cvtph_ps(a);", + "(void) _mm_cvtps_ph(b, 0);", + "(void) _mm256_cvtps_ph(b256, 0);" + ], + "qmake": [ + "!defined(QMAKE_CFLAGS_F16C, var): error(\"This compiler does not support F16C\")", + "QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_F16C" + ] + } }, "avx": { "label": "AVX instructions", "type": "compile", - "test": "common/avx" + "test": { + "include": "immintrin.h", + "main": [ + "__m256d a = _mm256_setzero_pd();", + "__m256d b = _mm256_set1_pd(42.42);", + "(void) _mm256_add_pd(a, b);" + ], + "qmake": [ + "!defined(QMAKE_CFLAGS_AVX, var): error(\"This compiler does not support AVX\")", + "QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_AVX" + ] + } }, "avx2": { "label": "AVX2 instructions", "type": "compile", - "test": "common/avx2" + "test": { + "include": "immintrin.h", + "main": [ + "// AVX", + "_mm256_zeroall();", + "__m256i a = _mm256_setzero_si256();", + "// AVX2", + "__m256i b = _mm256_and_si256(a, a);", + "(void) _mm256_add_epi8(a, b);" + ], + "qmake": [ + "!defined(QMAKE_CFLAGS_AVX2, var): error(\"This compiler does not support AVX2\")", + "QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_AVX2" + ] + } }, "avx512f": { "label": "AVX512 F instructions", @@ -395,33 +563,58 @@ "type": "subarch", "subarch": "neon" }, - "posix_fallocate": { "label": "POSIX fallocate()", "type": "compile", - "test": "unix/posix_fallocate" + "test": { + "include": [ "fcntl.h", "unistd.h" ], + "main": "(void) posix_fallocate(0, 0, 0);" + } }, "alloca_stdlib_h": { "label": "alloca() in stdlib.h", "type": "compile", - "test": "common/alloca" + "test": { + "include": "stdlib.h", + "main": "alloca(1);" + } }, "alloca_h": { "label": "alloca() in alloca.h", "type": "compile", - "test": "common/alloca", - "args": "DEFINES+=USE_ALLOCA_H" + "test": { + "include": "alloca.h", + "tail": [ + "#ifdef __QNXNTO__", + "// extra include needed in QNX7 to define NULL for the alloca() macro", + "# include ", + "#endif" + ], + "main": "alloca(1);" + } }, "alloca_malloc_h": { "label": "alloca() in malloc.h", "type": "compile", - "test": "common/alloca", - "args": "DEFINES+=USE_MALLOC_H" + "test": { + "include": "malloc.h", + "main": "alloca(1);" + } }, "stack_protector": { "label": "stack protection", "type": "compile", - "test": "unix/stack-protector" + "test": { + "head": [ + "#ifdef __QNXNTO__", + "# include ", + "# if _NTO_VERSION < 700", + "# error stack-protector not used (by default) before QNX 7.0.0.", + "# endif", + "#endif" + ], + "qmake": "QMAKE_CXXFLAGS += -fstack-protector-strong" + } }, "incredibuild_xge": { "label": "IncrediBuild", diff --git a/mkspecs/features/qt_configure.prf b/mkspecs/features/qt_configure.prf index 4b2ba560fb..c3ea334dd8 100644 --- a/mkspecs/features/qt_configure.prf +++ b/mkspecs/features/qt_configure.prf @@ -733,7 +733,7 @@ defineTest(qtConfHandleLibrary) { } # if the library defines a test, use it to verify the source. - !isEmpty($${lpfx}.test) { + !isEmpty($${lpfx}.test)|!isEmpty($${lpfx}.test._KEYS_) { $${lpfx}.literal_args = $$qtConfLibraryArgs($$spfx) $$use_args $${lpfx}.host = $$eval($${spfx}.host) !qtConfTest_compile($$lpfx) { @@ -855,16 +855,58 @@ defineTest(qtConfTestPrepare_compile) { return(true) } +defineTest(qtConfPrepareCompileTestSource) { + test_dir = $$2 + + # Create source code + contents = "/* Generated by configure */" + # Custom code before includes + for (ent, $$qtConfScalarOrList($${1}.head)): \ + contents += $$ent + # Includes + for (ent, $$qtConfScalarOrList($${1}.include)): \ + contents += "$${LITERAL_HASH}include <$$ent>" + # Custom code after includes + for (ent, $$qtConfScalarOrList($${1}.tail)): \ + contents += $$ent + # And finally the custom code inside main() + contents += \ + "int main(int argc, char **argv)" \ + "{" \ + " (void)argc; (void)argv;" \ + " /* BEGIN TEST: */" + for (ent, $$qtConfScalarOrList($${1}.main)): \ + contents += " $$ent" + contents += \ + " /* END TEST */" \ + " return 0;" \ + "}" + write_file($$test_dir/main.cpp, contents)|error() + + # Create stub .pro file + contents = "SOURCES = main.cpp" + # Custom project code + for (ent, $$qtConfScalarOrList($${1}.qmake)): \ + contents += $$ent + write_file($$test_dir/$$basename(test_dir).pro, contents)|error() +} + defineTest(qtConfTest_compile) { test = $$eval($${1}.test) host = $$eval($${1}.host) isEmpty(host): host = false - test_dir = $$QMAKE_CONFIG_TESTS_DIR/$$test test_base_out_dir = $$OUT_PWD/$$basename(QMAKE_CONFIG_TESTS_DIR) - test_out_dir = $$test_base_out_dir/$$test - !isEmpty($${1}.pro): \ - test_dir = $$test_dir/$$eval($${1}.pro) + isEmpty(test) { + test_dir = $$test_base_out_dir/$$section(1, ".", -1) + test_out_dir = $$test_dir + qtConfPrepareCompileTestSource($${1}.test, $$test_dir) + } else { + test_dir = $$QMAKE_CONFIG_TESTS_DIR/$$test + test_out_dir = $$test_base_out_dir/$$test + !isEmpty($${1}.pro): \ + test_dir = $$test_dir/$$eval($${1}.pro) + } test_cmd_base = "$$QMAKE_CD $$system_quote($$system_path($$test_out_dir)) &&" qmake_args = $$qtConfPkgConfigEnv()$$system_quote($$system_path($$QMAKE_QMAKE)) diff --git a/src/corelib/configure.json b/src/corelib/configure.json index 67a1a2ad4b..5596280250 100644 --- a/src/corelib/configure.json +++ b/src/corelib/configure.json @@ -22,14 +22,26 @@ "libraries": { "doubleconversion": { "label": "DoubleConversion", - "test": "unix/doubleconversion", + "test": { + "include": "double-conversion/double-conversion.h", + "main": "(void) double_conversion::StringToDoubleConverter::NO_FLAGS;" + }, "sources": [ "-ldouble-conversion" ] }, "glib": { "label": "GLib", - "test": "unix/glib", + "test": { + "head": "typedef struct _GMainContext GMainContext;", + "include": "glib.h", + "main": [ + "g_thread_init(NULL);", + "(void) g_main_context_default();", + "(void) g_source_new(0, 0);", + "g_source_add_poll(NULL, NULL);" + ] + }, "sources": [ { "type": "pkgConfig", "args": "glib-2.0 gthread-2.0" } ] @@ -44,7 +56,22 @@ }, "icu": { "label": "ICU", - "test": "unix/icu", + "test": { + "include": [ "unicode/utypes.h", "unicode/ucol.h", "unicode/ustring.h" ], + "main": [ + "UErrorCode status = U_ZERO_ERROR;", + "UCollator *collator = ucol_open(\"ru_RU\", &status);", + "if (!U_FAILURE(status))", + " ucol_close(collator);" + ], + "qmake": [ + "CONFIG += build_all", + "CONFIG(debug, debug|release): \\", + " LIBS += $$LIBS_DEBUG", + "else: \\", + " LIBS += $$LIBS_RELEASE" + ] + }, "sources": [ { "builds": { @@ -62,7 +89,10 @@ }, "journald": { "label": "journald", - "test": "unix/journald", + "test": { + "include": [ "systemd/sd-journal.h", "syslog.h" ], + "main": "sd_journal_send(\"PRIORITY=%i\", LOG_INFO, NULL);" + }, "sources": [ { "type": "pkgConfig", "args": "libsystemd" }, { "type": "pkgConfig", "args": "libsystemd-journal" } @@ -70,7 +100,26 @@ }, "libatomic": { "label": "64 bit atomics", - "test": "common/atomic64", + "test": { + "include": [ "atomic", "cstdint" ], + "tail": [ + "void test(volatile std::atomic &a)", + "{", + " std::int64_t v = a.load(std::memory_order_acquire);", + " while (!a.compare_exchange_strong(v, v + 1,", + " std::memory_order_acq_rel,", + " std::memory_order_acquire)) {", + " v = a.exchange(v - 1);", + " }", + " a.store(v + 1, std::memory_order_release);", + "}" + ], + "main": [ + "void *ptr = (void*)0xffffffc0; // any random pointer", + "test(*reinterpret_cast *>(ptr));" + ], + "qmake": "CONFIG += c++11" + }, "sources": [ "", "-latomic" @@ -78,7 +127,10 @@ }, "libdl": { "label": "dlopen()", - "test": "unix/dlopen", + "test": { + "include": "dlfcn.h", + "main": "dlopen(0, 0);" + }, "sources": [ "", "-ldl" @@ -86,7 +138,10 @@ }, "librt": { "label": "clock_gettime()", - "test": "unix/clock-gettime", + "test": { + "include": [ "unistd.h", "time.h" ], + "main": "timespec ts; clock_gettime(CLOCK_REALTIME, &ts);" + }, "sources": [ "", "-lrt" @@ -94,21 +149,38 @@ }, "pcre2": { "label": "PCRE2", - "test": "unix/pcre2", + "test": { + "head": "#define PCRE2_CODE_UNIT_WIDTH 16", + "include": "pcre2.h", + "tail": [ + "#if (PCRE2_MAJOR < 10) || ((PCRE2_MAJOR == 10) && (PCRE2_MINOR < 20))", + "# error This PCRE version is not supported", + "#endif" + ] + }, "sources": [ "-lpcre2-16" ] }, "pps": { "label": "PPS", - "test": "unix/pps", + "test": { + "include": "sys/pps.h", + "main": [ + "pps_decoder_t decoder;", + "pps_decoder_initialize(&decoder, NULL);" + ] + }, "sources": [ "-lpps" ] }, "slog2": { "label": "slog2", - "test": "unix/slog2", + "test": { + "include": "slog2.h", + "main": "slog2_set_default_buffer((slog2_buffer_t)-1);" + }, "export": "", "sources": [ "-lslog2" @@ -120,23 +192,77 @@ "atomicfptr": { "label": "working std::atomic for function pointers", "type": "compile", - "test": "common/atomicfptr" + "test": { + "include": "atomic", + "tail": [ + "typedef void (*fptr)(int);", + "typedef std::atomic atomicfptr;", + "void testfunction(int) { }", + "void test(volatile atomicfptr &a)", + "{", + " fptr v = a.load(std::memory_order_acquire);", + " while (!a.compare_exchange_strong(v, &testfunction,", + " std::memory_order_acq_rel,", + " std::memory_order_acquire)) {", + " v = a.exchange(&testfunction);", + " }", + " a.store(&testfunction, std::memory_order_release);", + "}" + ], + "main": [ + "atomicfptr fptr(testfunction);", + "test(fptr);" + ], + "qmake": "CONFIG += c++11" + } }, "clock-monotonic": { "label": "POSIX monotonic clock", "type": "compile", - "test": "unix/clock-monotonic", + "test": { + "include": [ "unistd.h", "time.h" ], + "main": [ + "#if defined(_POSIX_MONOTONIC_CLOCK) && (_POSIX_MONOTONIC_CLOCK-0 >= 0)", + "timespec ts;", + "clock_gettime(CLOCK_MONOTONIC, &ts);", + "#else", + "# error Feature _POSIX_MONOTONIC_CLOCK not available", + "#endif" + ] + }, "use": "librt" }, "cloexec": { "label": "O_CLOEXEC", "type": "compile", - "test": "unix/cloexec" + "test": { + "head": "#define _GNU_SOURCE 1", + "include": [ "sys/types.h", "sys/socket.h", "fcntl.h", "unistd.h" ], + "main": [ + "int pipes[2];", + "(void) pipe2(pipes, O_CLOEXEC | O_NONBLOCK);", + "(void) fcntl(0, F_DUPFD_CLOEXEC, 0);", + "(void) dup3(0, 3, O_CLOEXEC);", + "#if defined(__NetBSD__)", + "(void) paccept(0, 0, 0, NULL, SOCK_CLOEXEC | SOCK_NONBLOCK);", + "#else", + "(void) accept4(0, 0, 0, SOCK_CLOEXEC | SOCK_NONBLOCK);", + "#endif" + ] + } }, "eventfd": { "label": "eventfd", "type": "compile", - "test": "unix/eventfd" + "test": { + "include": "sys/eventfd.h", + "main": [ + "eventfd_t value;", + "int fd = eventfd(0, EFD_CLOEXEC);", + "eventfd_read(fd, &value);", + "eventfd_write(fd, value);" + ] + } }, "posix-iconv": { "label": "POSIX iconv", @@ -151,37 +277,89 @@ "inotify": { "label": "inotify", "type": "compile", - "test": "unix/inotify" + "test": { + "include": "sys/inotify.h", + "main": [ + "inotify_init();", + "inotify_add_watch(0, \"foobar\", IN_ACCESS);", + "inotify_rm_watch(0, 1);" + ] + } }, "ipc_sysv": { "label": "SysV IPC", "type": "compile", - "test": "unix/ipc_sysv" + "test": { + "include": [ "sys/types.h", "sys/ipc.h", "sys/sem.h", "sys/shm.h", "fcntl.h" ], + "main": [ + "key_t unix_key = ftok(\"test\", 'Q');", + "semctl(semget(unix_key, 1, 0666 | IPC_CREAT | IPC_EXCL), 0, IPC_RMID, 0);", + "shmget(unix_key, 0, 0666 | IPC_CREAT | IPC_EXCL);", + "shmctl(0, 0, (struct shmid_ds *)(0));" + ] + } }, "ipc_posix": { "label": "POSIX IPC", "type": "compile", - "test": "unix/ipc_posix" + "test": { + "include": [ "sys/types.h", "sys/mman.h", "semaphore.h", "fcntl.h" ], + "main": [ + "sem_close(sem_open(\"test\", O_CREAT | O_EXCL, 0666, 0));", + "shm_open(\"test\", O_RDWR | O_CREAT | O_EXCL, 0666);", + "shm_unlink(\"test\");" + ], + "qmake": "linux: LIBS += -lpthread -lrt" + } }, "ppoll": { "label": "ppoll()", "type": "compile", - "test": "unix/ppoll" + "test": { + "include": [ "signal.h", "poll.h" ], + "main": [ + "struct pollfd pfd;", + "struct timespec ts;", + "sigset_t sig;", + "ppoll(&pfd, 1, &ts, &sig);" + ] + } }, "pollts": { "label": "pollts()", "type": "compile", - "test": "unix/pollts" + "test": { + "include": [ "poll.h", "signal.h", "time.h" ], + "main": [ + "struct pollfd pfd;", + "struct timespec ts;", + "sigset_t sig;", + "pollts(&pfd, 1, &ts, &sig);" + ] + } }, "poll": { "label": "poll()", "type": "compile", - "test": "unix/poll" + "test": { + "include": "poll.h", + "main": [ + "struct pollfd pfd;", + "poll(&pfd, 1, 0);" + ] + } }, "syslog": { "label": "syslog", "type": "compile", - "test": "unix/syslog" + "test": { + "include": "syslog.h", + "main": [ + "openlog(\"qt\", 0, LOG_USER);", + "syslog(LOG_INFO, \"configure\");", + "closelog();" + ] + } }, "xlocalescanprint": { "label": "xlocale.h (or equivalents)", diff --git a/src/gui/configure.json b/src/gui/configure.json index a51557e6cd..062171606e 100644 --- a/src/gui/configure.json +++ b/src/gui/configure.json @@ -66,14 +66,30 @@ "direct2d": { "label": "Direct 2D", "export": "", - "test": "qpa/direct2d", + "test": { + "include": [ "d3d11_1.h", "d2d1_1.h", "d2d1_1helper.h", "dxgi1_2.h", "wrl.h", "dwrite.h" ], + "tail": "using Microsoft::WRL::ComPtr;", + "main": [ + "ComPtr d2dFactory;", + "D2D1CreateFactory(D2D1_FACTORY_TYPE_SINGLE_THREADED, d2dFactory.ReleaseAndGetAddressOf());", + "ComPtr surface;", + "(void) surface;" + ] + }, "sources": [ "-ld2d1 -ldwrite -ld3d11" ] }, "directfb": { "label": "DirectFB", - "test": "qpa/directfb", + "test": { + "include": "directfb.h", + "tail": [ + "#ifdef __typeof__", + "# error DirectFB headers are unclean and cannot compile", + "#endif" + ] + }, "sources": [ { "type": "pkgConfig", "args": "directfb" } ] @@ -81,14 +97,30 @@ "directwrite": { "label": "DirectWrite", "export": "", - "test": "win/directwrite", + "test": { + "include": [ "dwrite.h", "d2d1.h" ], + "main": [ + "IDWriteFactory *factory = 0;", + "DWriteCreateFactory(DWRITE_FACTORY_TYPE_SHARED, __uuidof(IDWriteFactory),", + " (IUnknown **)(&factory));" + ] + }, "sources": [ "-ldwrite" ] }, "drm": { "label": "KMS", - "test": "qpa/kms", + "test": { + "include": [ "stdlib.h", "stdint.h" ], + "tail": [ + "extern \"C\" {", + "#include ", + "#include ", + "}" + ], + "main": "(void) drmModeGetCrtc(0, 0);" + }, "sources": [ { "type": "pkgConfig", "args": "libdrm" }, { "libs": "-ldrm", "condition": "!config.integrity" }, @@ -97,7 +129,13 @@ }, "egl": { "label": "EGL", - "test": "qpa/egl", + "test": { + "include": "EGL/egl.h", + "main": [ + "EGLint x = 0; EGLDisplay dpy = 0; EGLContext ctx = 0;", + "eglDestroyContext(dpy, ctx);" + ] + }, "sources": [ { "type": "pkgConfig", "args": "egl" }, { "type": "makeSpec", "spec": "EGL" } @@ -105,7 +143,18 @@ }, "freetype": { "label": "FreeType", - "test": "unix/freetype", + "test": { + "head": [ + "#include ", + "#include FT_FREETYPE_H", + "#if ((FREETYPE_MAJOR*10000 + FREETYPE_MINOR*100 + FREETYPE_PATCH) < 20200)", + "# error This version of freetype is too old.", + "#endif" + ], + "main": [ + "FT_Face face = 0;" + ] + }, "sources": [ { "type": "pkgConfig", "args": "freetype2" }, { "type": "freetype", "libs": "-lfreetype" } @@ -113,7 +162,23 @@ }, "fontconfig": { "label": "Fontconfig", - "test": "unix/fontconfig", + "test": { + "head": [ + "#include ", + "#include FT_FREETYPE_H", + "#include ", + "#ifndef FC_RGBA_UNKNOWN", + "# error This version of fontconfig is tool old, it is missing the FC_RGBA_UNKNOWN define", + "#endif", + "#if ((FREETYPE_MAJOR*10000 + FREETYPE_MINOR*100 + FREETYPE_PATCH) < 20110)", + "# error This version of freetype is too old.", + "#endif" + ], + "main": [ + "FT_Face face = 0;", + "FcPattern *pattern = 0;" + ] + }, "sources": [ { "type": "pkgConfig", "args": "fontconfig freetype2" }, { "type": "freetype", "libs": "-lfontconfig -lfreetype" } @@ -121,14 +186,37 @@ }, "gbm": { "label": "GBM", - "test": "qpa/gbm", + "test": { + "include": [ "stdlib.h", "stdint.h" ], + "tail": [ + "extern \"C\" {", + "#include ", + "}" + ], + "main": "gbm_surface *surface = 0;" + }, "sources": [ { "type": "pkgConfig", "args": "gbm" } ] }, "harfbuzz": { "label": "HarfBuzz", - "test": "unix/harfbuzz", + "test": { + "include": "harfbuzz/hb.h", + "tail": [ + "#if !HB_VERSION_ATLEAST(0, 9, 42)", + "# error This version of harfbuzz is too old.", + "#endif" + ], + "main": [ + "hb_buffer_t *buffer = hb_buffer_create();", + "const uint16_t string[] = { 'A', 'b', 'c' };", + "hb_buffer_add_utf16(buffer, string, 3, 0, 3);", + "hb_buffer_guess_segment_properties(buffer);", + "hb_buffer_set_flags(buffer, hb_buffer_flags_t(HB_BUFFER_FLAG_PRESERVE_DEFAULT_IGNORABLES));", + "hb_buffer_destroy(buffer);" + ] + }, "sources": [ "-lharfbuzz" ] @@ -136,35 +224,62 @@ "imf": { "label": "IMF", "export": "", - "test": "unix/qqnx_imf", + "test": { + "include": "imf/imf_client.h", + "main": "imf_client_init();" + }, "sources": [ "-linput_client" ] }, "lgmon": { "label": "lgmon", - "test": "unix/lgmon", + "test": { + "include": "lgmon.h", + "main": "lgmon_supported(getpid());" + }, "sources": [ "-llgmon" ] }, "libinput": { "label": "libinput", - "test": "unix/libinput", + "test": { + "include": "libinput.h", + "main": "libinput_udev_create_context(NULL, NULL, NULL);" + }, "sources": [ { "type": "pkgConfig", "args": "libinput" } ] }, "integrityhid": { "label": "integrityhid", - "test": "qpa/integrityhid", + "test": { + "include": [ "stdlib.h", "stdint.h", "device/hiddriver.h" ], + "main": [ + "HIDDriver *driver;", + "uintptr_t devicecontext;", + "uint32_t device_id;", + "gh_hid_enum_devices(driver, &device_id, &devicecontext);" + ] + }, "sources": [ { "libs": "-lhiddev -lusbhid -lusb" } ] }, "libjpeg": { "label": "libjpeg", - "test": "unix/libjpeg", + "test": { + "include": [ "sys/types.h", "stdio.h" ], + "tail": [ + "extern \"C\" {", + "#include ", + "}", + "", + "j_compress_ptr cinfo;" + ], + "main": "jpeg_create_compress(cinfo);" + }, "sources": [ { "libs": "-llibjpeg", "condition": "config.msvc" }, { "libs": "-ljpeg", "condition": "!config.msvc" } @@ -172,7 +287,10 @@ }, "libpng": { "label": "libpng", - "test": "unix/libpng", + "test": { + "include": "png.h", + "main": "(void) png_create_read_struct(PNG_LIBPNG_VER_STRING,0,0,0);" + }, "sources": [ { "type": "pkgConfig", "args": "libpng" }, { "libs": "-llibpng", "condition": "config.msvc" }, @@ -184,21 +302,50 @@ }, "mirclient": { "label": "Mir client libraries", - "test": "qpa/mirclient", + "test": { + "include": [ "mir_toolkit/mir_client_library.h", "ubuntu/application/lifecycle_delegate.h", "EGL/egl.h" ], + "tail": "static void surfaceCreateCallback(MirSurface*, void*) {}", + "main": [ + "u_application_lifecycle_delegate_new();", + "mir_surface_create(0, surfaceCreateCallback, 0);" + ] + }, "sources": [ { "type": "pkgConfig", "args": "egl mirclient ubuntu-platform-api libcontent-hub >= 0.2.0" } ] }, "mtdev": { "label": "mtdev", - "test": "unix/mtdev", + "test": { + "include": "mtdev.h", + "main": [ + "mtdev m;", + "mtdev_open(&m, 0);" + ] + }, "sources": [ { "type": "pkgConfig", "args": "mtdev" } ] }, "opengl": { "label": "Desktop OpenGL", - "test": "unix/opengldesktop", + "test": { + "head": [ + "#ifdef __APPLE__", + "# include ", + "#else", + "# define GL_GLEXT_PROTOTYPES", + "# include ", + "#endif" + ], + "main": [ + "glBegin(GL_TRIANGLES);", + " glVertex2f(20.0f, 10.0f);", + " glVertex2f(10.0f, 30.0f);", + " glVertex2f(20.0f, 50.0f);", + "glEnd();" + ] + }, "sources": [ { "type": "pkgConfig", "args": "gl", "condition": "!config.darwin" }, { "type": "makeSpec", "spec": "OPENGL" } @@ -206,7 +353,20 @@ }, "opengl_es2": { "label": "OpenGL ES 2.0", - "test": "unix/opengles2", + "test": { + "head": [ + "#ifdef __APPLE__", + "# include ", + "#else", + "# define GL_GLEXT_PROTOTYPES", + "# include ", + "#endif" + ], + "main": [ + "glUniform1f(1, GLfloat(1.0));", + "glClear(GL_COLOR_BUFFER_BIT);" + ] + }, "sources": [ { "type": "pkgConfig", "args": "glesv2", "condition": "!config.darwin" }, { "type": "makeSpec", "spec": "OPENGL_ES2" } @@ -214,7 +374,10 @@ }, "openvg": { "label": "OpenVG", - "test": "unix/openvg", + "test": { + "include": "VG/openvg.h", + "main": "VGint i = 2; vgFlush();" + }, "sources": [ { "type": "pkgConfig", "args": "vg" }, { "type": "makeSpec", "spec": "OPENVG" } @@ -222,14 +385,20 @@ }, "tslib": { "label": "tslib", - "test": "unix/tslib", + "test": { + "include": "tslib.h", + "main": "ts_open(\"foo\", 0);" + }, "sources": [ "-lts" ] }, "wayland_server": { "label": "Wayland Server", - "test": "qpa/wayland-server", + "test": { + "include": "wayland-server.h", + "main": "wl_display_create();" + }, "sources": [ { "type": "pkgConfig", "args": "wayland-server" } ] @@ -242,7 +411,15 @@ }, "xcb": { "label": "XCB >= 1.5 (core)", - "test": "qpa/xcb", + "test": { + "include": "xcb/xcb.h", + "main": [ + "int primaryScreen = 0;", + "(void)xcb_connect(\"\", &primaryScreen);", + "// This won't compile unless libxcb >= 1.5 which defines XCB_ATOM_PRIMARY.", + "int xcbAtomPrimary = XCB_ATOM_PRIMARY;" + ] + }, "sources": [ { "type": "pkgConfig", "args": "xcb >= 1.5" }, "-lxcb" @@ -250,7 +427,27 @@ }, "xcb_syslibs": { "label": "XCB (extensions)", - "test": "qpa/xcb-syslibs", + "test": { + "include": [ + "xcb/xcb.h", + "xcb/xfixes.h", + "xcb/xcb_image.h", + "xcb/xcb_keysyms.h", + "xcb/sync.h", + "xcb/randr.h", + "xcb/shm.h" + ], + "tail": [ + "// This workaround can be removed for xcb-icccm > 3.8", + "#define class class_name", + "#include ", + "#undef class" + ], + "main": [ + "int primaryScreen = 0;", + "(void) xcb_connect(\"\", &primaryScreen);" + ] + }, "sources": [ { "type": "pkgConfig", "args": "xcb xcb-shm xcb-sync xcb-xfixes xcb-randr xcb-image xcb-keysyms xcb-icccm xcb-shape" }, @@ -259,7 +456,13 @@ }, "xcb_xlib": { "label": "XCB Xlib", - "test": "qpa/xcb-xlib", + "test": { + "include": [ "xcb/xcb.h", "X11/Xlib.h", "X11/Xlib-xcb.h" ], + "main": [ + "Display *dpy = XOpenDisplay(\"\");", + "(void) XGetXCBConnection(dpy);" + ] + }, "sources": [ { "type": "pkgConfig", "args": "x11-xcb x11 xcb" }, "-lxcb -lX11 -lX11-xcb" @@ -267,7 +470,18 @@ }, "xcb_xkb": { "label": "XCB XKB >= 1.10", - "test": "qpa/xcb-xkb", + "test": { + "head": [ + "// xkb.h is using a variable called 'explicit', which is a reserved keyword in C++", + "#define explicit dont_use_cxx_explicit" + ], + "include": "xcb/xkb.h", + "tail": "#undef explicit", + "main": [ + "// This takes more arguments in xcb-xkb < 1.10.", + "xcb_xkb_get_kbd_by_name_unchecked(NULL, 0, 0, 0, 0);" + ] + }, "sources": [ { "type": "pkgConfig", "args": "xcb-xkb >= 1.10 xcb" }, "-lxcb-xkb -lxcb" @@ -275,7 +489,30 @@ }, "xcb_render": { "label": "XCB XRender", - "test": "qpa/xcb-render", + "test": { + "include": [ "xcb/xcb.h", "xcb/render.h" ], + "tail": [ + "// 'template' is used as a function argument name in xcb_renderutil.h", + "#define template template_param", + "// extern \"C\" is missing, too", + "extern \"C\" {", + "#include ", + "}", + "#undef template" + ], + "main": [ + "int primaryScreen = 0;", + "xcb_generic_error_t *error = 0;", + "xcb_connection_t *connection = xcb_connect(\"\", &primaryScreen);", + "xcb_render_query_pict_formats_cookie_t formatsCookie =", + " xcb_render_query_pict_formats(connection);", + "xcb_render_query_pict_formats_reply_t *formatsReply =", + " xcb_render_query_pict_formats_reply(", + " connection, formatsCookie, &error);", + "xcb_render_util_find_standard_format(", + " formatsReply, XCB_PICT_STANDARD_ARGB_32);" + ] + }, "sources": [ { "type": "pkgConfig", "args": "xcb-renderutil xcb-render xcb" }, "-lxcb-render-util -lxcb-render -lxcb" @@ -283,7 +520,17 @@ }, "xcb_glx": { "label": "XCB GLX", - "test": "qpa/xcb-glx", + "test": { + "include": [ "xcb/xcb.h", "xcb/glx.h" ], + "main": [ + "int primaryScreen = 0;", + "xcb_connection_t *connection = xcb_connect(\"\", &primaryScreen);", + "xcb_generic_error_t *error = 0;", + "xcb_glx_query_version_cookie_t xglx_query_cookie = xcb_glx_query_version(", + " connection, XCB_GLX_MAJOR_VERSION, XCB_GLX_MINOR_VERSION);", + "xcb_glx_query_version_reply(connection, xglx_query_cookie, &error);" + ] + }, "sources": [ { "type": "pkgConfig", "args": "xcb-glx xcb" }, "-lxcb-glx -lxcb" @@ -291,7 +538,28 @@ }, "xinput2": { "label": "Xinput2", - "test": "x11/xinput2", + "test": { + "include": [ "X11/Xlib.h", "X11/extensions/XInput2.h", "X11/extensions/Xge.h" ], + "tail": [ + "#ifndef XInput_2_0", + "# error Missing XInput_2_0 #define", + "#endif" + ], + "main": [ + "// need XGenericEventCookie for XInput2 to work", + "Display *dpy = 0;", + "XEvent xevent;", + "XIEvent *xievent = 0;", + "XIDeviceEvent *xideviceevent = 0;", + "XIHierarchyEvent *xihierarchyevent = 0;", + "int deviceid = 0;", + "int len = 0;", + "(void) XGetEventData(dpy, &xevent.xcookie);", + "XFreeEventData(dpy, &xevent.xcookie);", + "(void) XIListProperties(dpy, deviceid, &len);" + ], + "qmake": "CONFIG += x11" + }, "sources": [ { "type": "pkgConfig", "args": "xi" }, "-lXi" @@ -300,7 +568,10 @@ "xkbcommon": { "label": "xkbcommon", "export": "xkbcommon_evdev", - "test": "unix/xkbcommon", + "test": { + "include": [ "xkbcommon/xkbcommon.h", "xkbcommon/xkbcommon-keysyms.h", "xkbcommon/xkbcommon-names.h" ], + "main": "xkb_context_new(XKB_CONTEXT_NO_FLAGS);" + }, "sources": [ { "type": "pkgConfig", "args": "xkbcommon" } ] @@ -323,7 +594,15 @@ "directwrite2": { "label": "DirectWrite 2", "type": "compile", - "test": "win/directwrite2", + "test": { + "include": [ "dwrite_2.h", "d2d1.h" ], + "main": [ + "IUnknown *factory = 0;", + "(void)(size_t(DWRITE_E_NOCOLOR) + sizeof(IDWriteFontFace2));", + "DWriteCreateFactory(DWRITE_FACTORY_TYPE_SHARED, __uuidof(IDWriteFactory2),", + " &factory);" + ] + }, "use": "directwrite" }, "directx": { @@ -338,70 +617,180 @@ "egl-x11": { "label": "EGL on X11", "type": "compile", - "test": "qpa/egl-x11", + "test": { + "head": [ + "// Check if EGL is compatible with X. Some EGL implementations, typically on", + "// embedded devices, are not intended to be used together with X. EGL support", + "// has to be disabled in plugins like xcb in this case since the native display,", + "// window and pixmap types will be different than what an X-based platform", + "// plugin would expect." + ], + "include": [ "EGL/egl.h", "xcb/xcb.h", "X11/Xlib.h", "X11/Xlib-xcb.h" ], + "main": [ + "Display *dpy = EGL_DEFAULT_DISPLAY;", + "EGLNativeDisplayType egldpy = XOpenDisplay(\"\");", + "dpy = egldpy;", + "EGLNativeWindowType w = XCreateWindow(dpy, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);", + "XDestroyWindow(dpy, w);", + "XCloseDisplay(dpy);" + ] + }, "use": "egl xcb_xlib" }, "egl-brcm": { "label": "Broadcom EGL (Raspberry Pi)", "type": "compile", - "test": "qpa/eglfs-brcm", + "test": { + "include": [ "EGL/egl.h", "bcm_host.h" ], + "main": "vc_dispmanx_display_open(0);" + }, "use": "egl bcm_host" }, "egl-egldevice": { "label": "EGLDevice", "type": "compile", - "test": "qpa/eglfs-egldevice", + "test": { + "include": [ "EGL/egl.h", "EGL/eglext.h" ], + "main": [ + "EGLDeviceEXT device = 0;", + "EGLStreamKHR stream = 0;", + "EGLOutputLayerEXT layer = 0;", + "(void) EGL_DRM_CRTC_EXT;" + ] + }, "use": "egl" }, "egl-mali": { "label": "Mali EGL", "type": "compile", - "test": "qpa/eglfs-mali", + "test": { + "include": [ "EGL/fbdev_window.h", "EGL/egl.h", "GLES2/gl2.h" ], + "main": "fbdev_window *w = 0;" + }, "use": "egl" }, "egl-mali-2": { "label": "Mali 2 EGL", "type": "compile", - "test": "qpa/eglfs-mali-2", + "test": { + "include": [ "EGL/egl.h", "GLES2/gl2.h" ], + "main": "mali_native_window *w = 0;" + }, "use": "egl" }, "egl-viv": { "label": "i.Mx6 EGL", "type": "compile", - "test": "qpa/eglfs-viv", + "test": { + "include": [ "EGL/egl.h", "EGL/eglvivante.h" ], + "main": [ + "#ifdef __INTEGRITY", + "fbGetDisplay();", + "#else", + "// Do not rely on fbGetDisplay(), since the signature has changed over time.", + "// Stick to fbGetDisplayByIndex().", + "fbGetDisplayByIndex(0);", + "#endif" + ], + "qmake": [ + "DEFINES += EGL_API_FB=1", + "!integrity: DEFINES += LINUX=1" + ] + }, "use": "egl" }, "evdev": { "label": "evdev", "type": "compile", - "test": "unix/evdev" + "test": { + "head": [ + "#if defined(__FreeBSD__)", + "# include ", + "#else", + "# include ", + "# include ", + "#endif", + "enum {", + " e1 = ABS_PRESSURE,", + " e2 = ABS_X,", + " e3 = REL_X,", + " e4 = SYN_REPORT,", + "};" + ], + "main": [ + "input_event buf[32];", + "(void) buf;" + ] + } }, "integrityfb": { "label": "INTEGRITY framebuffer", "type": "compile", - "test": "qpa/integrityfb" + "test": { + "include": "device/fbdriver.h", + "main": "FBDriver *driver = 0;" + } }, "libinput_axis_api": { "label": "axis API in libinput", "type": "compile", - "test": "unix/libinput_axis_api", + "test": { + "include": "libinput.h", + "main": "libinput_event_pointer_has_axis(nullptr, LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL);" + }, "use": "libinput" }, "linuxfb": { "label": "LinuxFB", "type": "compile", - "test": "qpa/linuxfb" + "test": { + "include": [ "linux/fb.h", "sys/kd.h", "sys/ioctl.h" ], + "main": [ + "fb_fix_screeninfo finfo;", + "fb_var_screeninfo vinfo;", + "int fd = 3;", + "ioctl(fd, FBIOGET_FSCREENINFO, &finfo);", + "ioctl(fd, FBIOGET_VSCREENINFO, &vinfo);" + ] + } }, "opengles3": { "label": "OpenGL ES 3.0", "type": "compile", - "test": "unix/opengles3", + "test": { + "head": [ + "#ifdef __APPLE__", + "# include ", + "#else", + "# define GL_GLEXT_PROTOTYPES", + "# include ", + "#endif" + ], + "main": [ + "static GLfloat f[6];", + "glGetStringi(GL_EXTENSIONS, 0);", + "glReadBuffer(GL_COLOR_ATTACHMENT1);", + "glUniformMatrix2x3fv(0, 0, GL_FALSE, f);", + "glMapBufferRange(GL_ARRAY_BUFFER, 0, 0, GL_MAP_READ_BIT);" + ] + }, + "comment": [ + "The library is expected to be the same as in ES 2.0 (libGLESv2).", + "The difference is the header and the presence of the functions in", + "the library." + ], "use": "opengl_es2" }, "opengles31": { "label": "OpenGL ES 3.1", "type": "compile", - "test": "unix/opengles31", + "test": { + "include": "GLES3/gl31.h", + "main": [ + "glDispatchCompute(1, 1, 1);", + "glProgramUniform1i(0, 0, 0);" + ] + }, "use": "opengl_es2" }, "qpa_default_platform": { @@ -427,7 +816,14 @@ "xlib": { "label": "XLib", "type": "compile", - "test": "x11/xlib" + "test": { + "include": "X11/Xlib.h", + "main": [ + "Display *d = XOpenDisplay(NULL);", + "XCloseDisplay(d);" + ], + "qmake": "CONFIG += x11" + } } }, diff --git a/src/network/configure.json b/src/network/configure.json index d35dda99bc..c77004d4ba 100644 --- a/src/network/configure.json +++ b/src/network/configure.json @@ -38,7 +38,14 @@ }, "libproxy": { "label": "libproxy", - "test": "common/libproxy", + "test": { + "include": [ "proxy.h" ], + "main": [ + "pxProxyFactory *factory = px_proxy_factory_new();", + "px_proxy_factory_get_proxies(factory, \"http://qt-project.org\");", + "px_proxy_factory_free(factory);" + ] + }, "sources": [ "-lproxy" ] @@ -85,25 +92,66 @@ "getaddrinfo": { "label": "getaddrinfo()", "type": "compile", - "test": "unix/getaddrinfo", + "test": { + "head": [ + "#include ", + "#include ", + "#ifdef __MINGW32__", + "# include ", + "# include ", + "#else", + "# include ", + "# include ", + "# include ", + "#endif" + ], + "main": [ + "addrinfo *res = 0;", + "(void) getaddrinfo(\"foo\", 0, 0, &res);", + "freeaddrinfo(res);", + "gai_strerror(0);" + ] + }, "use": "network" }, "getifaddrs": { "label": "getifaddrs()", "type": "compile", - "test": "unix/getifaddrs", + "test": { + "include": [ "sys/types.h", "sys/socket.h", "net/if.h", "ifaddrs.h" ], + "main": [ + "ifaddrs *list;", + "getifaddrs(&list);", + "freeifaddrs(list);" + ] + }, "use": "network" }, "ipv6ifname": { "label": "IPv6 ifname", "type": "compile", - "test": "unix/ipv6ifname", + "test": { + "include": [ "sys/types.h", "sys/socket.h", "net/if.h" ], + "main": [ + "char buf[IFNAMSIZ];", + "if_nametoindex(\"eth0\");", + "if_indextoname(1, buf);" + ] + }, "use": "network" }, "sctp": { "label": "SCTP support", "type": "compile", - "test": "unix/sctp", + "test": { + "include": [ "sys/types.h", "sys/socket.h", "netinet/in.h", "netinet/sctp.h" ], + "main": [ + "sctp_initmsg sctpInitMsg;", + "socklen_t sctpInitMsgSize = sizeof(sctpInitMsg);", + "(void) socket(PF_INET, SOCK_STREAM, IPPROTO_SCTP);", + "(void) getsockopt(-1, SOL_SCTP, SCTP_INITMSG, &sctpInitMsg, &sctpInitMsgSize);" + ] + }, "use": "network" } }, diff --git a/src/plugins/sqldrivers/configure.json b/src/plugins/sqldrivers/configure.json index 5603ceb37b..234f880579 100644 --- a/src/plugins/sqldrivers/configure.json +++ b/src/plugins/sqldrivers/configure.json @@ -39,7 +39,9 @@ "libraries": { "db2": { "label": "DB2 (IBM)", - "test": "unix/db2", + "test": { + "include": [ "sqlcli.h", "sqlcli1.h" ] + }, "sources": [ { "libs": "-ldb2cli", "condition": "config.win32" }, { "libs": "-ldb2", "condition": "!config.win32" } @@ -47,7 +49,9 @@ }, "ibase": { "label": "InterBase", - "test": "unix/ibase", + "test": { + "include": "ibase.h" + }, "sources": [ { "libs": "-lgds32_ms", "condition": "config.win32" }, { "libs": "-lgds", "condition": "!config.win32" } @@ -55,7 +59,15 @@ }, "mysql": { "label": "MySQL", - "test": "unix/mysql", + "test": { + "head": [ + "#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(WIN64) || defined(_WIN64) || defined(__WIN64__)", + "# include ", + "#endif" + ], + "include": "mysql.h", + "main": "mysql_get_client_version();" + }, "sources": [ { "type": "mysqlConfig", "query": "--libs_r", "cleanlibs": true }, { "type": "mysqlConfig", "query": "--libs", "cleanlibs": true }, @@ -68,7 +80,13 @@ }, "psql": { "label": "PostgreSQL", - "test": "unix/psql", + "test": { + "include": "libpq-fe.h", + "main": [ + "PQescapeBytea(0, 0, 0);", + "PQunescapeBytea(0, 0);" + ] + }, "sources": [ { "type": "pkgConfig", "args": "libpq" }, { "type": "psqlConfig" }, @@ -78,7 +96,9 @@ }, "tds": { "label": "TDS (Sybase)", - "test": "unix/tds", + "test": { + "include": [ "sybfront.h", "sybdb.h" ] + }, "sources": [ { "type": "sybaseEnv", "libs": "-lNTWDBLIB", "condition": "config.win32" }, { "type": "sybaseEnv", "libs": "-lsybdb", "condition": "!config.win32" } @@ -86,7 +106,9 @@ }, "oci": { "label": "OCI (Oracle)", - "test": "unix/oci", + "test": { + "include": "oci.h" + }, "sources": [ { "libs": "-loci", "condition": "config.win32" }, { "libs": "-lclntsh", "condition": "!config.win32" } @@ -94,7 +116,18 @@ }, "odbc": { "label": "ODBC", - "test": "unix/odbc", + "test": { + "head": [ + "#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(WIN64) || defined(_WIN64) || defined(__WIN64__)", + "# include ", + "#endif" + ], + "include": [ "sql.h", "sqlext.h" ], + "main": [ + "SQLHANDLE env;", + "SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, &env);" + ] + }, "sources": [ { "libs": "-lodbc32", "condition": "config.win32" }, { "libs": "-liodbc", "condition": "config.darwin" }, @@ -103,7 +136,9 @@ }, "sqlite2": { "label": "SQLite (version 2)", - "test": "unix/sqlite2", + "test": { + "include": "sqlite.h" + }, "sources": [ "-lsqlite" ] @@ -111,7 +146,10 @@ "sqlite3": { "label": "SQLite (version 3)", "export": "sqlite", - "test": "unix/sqlite", + "test": { + "include": "sqlite3.h", + "main": "sqlite3_open_v2(0, 0, 0, 0);" + }, "sources": [ { "type": "pkgConfig", "args": "sqlite3" }, "-lsqlite3" diff --git a/src/printsupport/configure.json b/src/printsupport/configure.json index ad38281145..e8cec22c09 100644 --- a/src/printsupport/configure.json +++ b/src/printsupport/configure.json @@ -16,7 +16,10 @@ "libraries": { "cups": { "label": "CUPS", - "test": "unix/cups", + "test": { + "include": "cups/cups.h", + "main": "cupsGetNamedDest(CUPS_HTTP_DEFAULT, NULL, NULL); // CUPS 1.4 test" + }, "sources": [ "-lcups" ] -- cgit v1.2.3 From b0060d1056d6d1752d91652261de97db909c7862 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 31 Jul 2017 12:51:38 +0200 Subject: configure: un-namespace remaining non-inline configure tests only few tests remain, and many of these were mis-classified anyway. Change-Id: Ic3bc96928a0c79fe77b9ec10e6508d4822f18df2 Reviewed-by: Thiago Macieira --- config.tests/atomicfptr/icc2016_mac.diff | 18 +++ config.tests/atomicfptr/qnx66.txt | 3 + config.tests/avx512/avx512.cpp | 103 ++++++++++++++ config.tests/avx512/avx512.pro | 10 ++ config.tests/common/atomicfptr/icc2016_mac.diff | 18 --- config.tests/common/atomicfptr/qnx66.txt | 3 - config.tests/common/avx512/avx512.cpp | 103 -------------- config.tests/common/avx512/avx512.pro | 10 -- config.tests/common/verifyspec/verifyspec.cpp | 1 - config.tests/common/verifyspec/verifyspec.pro | 37 ----- config.tests/common/xlocalescanprint/qglobal.h | 43 ------ .../common/xlocalescanprint/xlocalescanprint.cpp | 62 --------- .../common/xlocalescanprint/xlocalescanprint.pro | 3 - config.tests/corewlan/corewlan.pro | 2 + config.tests/corewlan/corewlantest.mm | 47 +++++++ config.tests/gnu-libiconv/gnu-libiconv.cpp | 54 ++++++++ config.tests/gnu-libiconv/gnu-libiconv.pro | 2 + config.tests/iconv/iconv.cpp | 54 ++++++++ config.tests/iconv/iconv.pro | 3 + config.tests/mac/corewlan/corewlan.pro | 2 - config.tests/mac/corewlan/corewlantest.mm | 47 ------- config.tests/openssl/openssl.cpp | 54 ++++++++ config.tests/openssl/openssl.pro | 2 + config.tests/stl/stl.pro | 2 + config.tests/stl/stltest.cpp | 149 +++++++++++++++++++++ config.tests/sun-libiconv/sun-libiconv.pro | 2 + config.tests/unix/gnu-libiconv/gnu-libiconv.cpp | 54 -------- config.tests/unix/gnu-libiconv/gnu-libiconv.pro | 2 - config.tests/unix/iconv/iconv.cpp | 54 -------- config.tests/unix/iconv/iconv.pro | 3 - config.tests/unix/openssl/openssl.cpp | 54 -------- config.tests/unix/openssl/openssl.pro | 2 - config.tests/unix/stl/stl.pro | 2 - config.tests/unix/stl/stltest.cpp | 149 --------------------- config.tests/unix/sun-libiconv/sun-libiconv.pro | 2 - config.tests/verifyspec/verifyspec.cpp | 1 + config.tests/verifyspec/verifyspec.pro | 37 +++++ config.tests/xlocalescanprint/qglobal.h | 43 ++++++ config.tests/xlocalescanprint/xlocalescanprint.cpp | 62 +++++++++ config.tests/xlocalescanprint/xlocalescanprint.pro | 3 + configure.json | 22 +-- src/corelib/configure.json | 10 +- src/network/configure.json | 6 +- 43 files changed, 670 insertions(+), 670 deletions(-) create mode 100644 config.tests/atomicfptr/icc2016_mac.diff create mode 100644 config.tests/atomicfptr/qnx66.txt create mode 100644 config.tests/avx512/avx512.cpp create mode 100644 config.tests/avx512/avx512.pro delete mode 100644 config.tests/common/atomicfptr/icc2016_mac.diff delete mode 100644 config.tests/common/atomicfptr/qnx66.txt delete mode 100644 config.tests/common/avx512/avx512.cpp delete mode 100644 config.tests/common/avx512/avx512.pro delete mode 100644 config.tests/common/verifyspec/verifyspec.cpp delete mode 100644 config.tests/common/verifyspec/verifyspec.pro delete mode 100644 config.tests/common/xlocalescanprint/qglobal.h delete mode 100644 config.tests/common/xlocalescanprint/xlocalescanprint.cpp delete mode 100644 config.tests/common/xlocalescanprint/xlocalescanprint.pro create mode 100644 config.tests/corewlan/corewlan.pro create mode 100644 config.tests/corewlan/corewlantest.mm create mode 100644 config.tests/gnu-libiconv/gnu-libiconv.cpp create mode 100644 config.tests/gnu-libiconv/gnu-libiconv.pro create mode 100644 config.tests/iconv/iconv.cpp create mode 100644 config.tests/iconv/iconv.pro delete mode 100644 config.tests/mac/corewlan/corewlan.pro delete mode 100644 config.tests/mac/corewlan/corewlantest.mm create mode 100644 config.tests/openssl/openssl.cpp create mode 100644 config.tests/openssl/openssl.pro create mode 100644 config.tests/stl/stl.pro create mode 100644 config.tests/stl/stltest.cpp create mode 100644 config.tests/sun-libiconv/sun-libiconv.pro delete mode 100644 config.tests/unix/gnu-libiconv/gnu-libiconv.cpp delete mode 100644 config.tests/unix/gnu-libiconv/gnu-libiconv.pro delete mode 100644 config.tests/unix/iconv/iconv.cpp delete mode 100644 config.tests/unix/iconv/iconv.pro delete mode 100644 config.tests/unix/openssl/openssl.cpp delete mode 100644 config.tests/unix/openssl/openssl.pro delete mode 100644 config.tests/unix/stl/stl.pro delete mode 100644 config.tests/unix/stl/stltest.cpp delete mode 100644 config.tests/unix/sun-libiconv/sun-libiconv.pro create mode 100644 config.tests/verifyspec/verifyspec.cpp create mode 100644 config.tests/verifyspec/verifyspec.pro create mode 100644 config.tests/xlocalescanprint/qglobal.h create mode 100644 config.tests/xlocalescanprint/xlocalescanprint.cpp create mode 100644 config.tests/xlocalescanprint/xlocalescanprint.pro diff --git a/config.tests/atomicfptr/icc2016_mac.diff b/config.tests/atomicfptr/icc2016_mac.diff new file mode 100644 index 0000000000..5de3b6e19a --- /dev/null +++ b/config.tests/atomicfptr/icc2016_mac.diff @@ -0,0 +1,18 @@ +Patch for fixing std::atomic support for function pointers for the Intel +Composer XE 2016 (compiler version 16.0). + +To apply: + cd /opt/intel/compilers_and_libraries_2016/mac/include + sudo patch -p1 < /path-to-this-file/icc2016_mac.diff + +--- include/stdatomic.h.orig 2015-08-28 15:05:13.000000000 -0700 ++++ include/stdatomic.h 2015-08-28 15:19:25.000000000 -0700 +@@ -451,7 +451,7 @@ + } + _STRONG_INLINE atomic() _DEFAULTED + _STRONG_INLINE _CONSTEXPR atomic(T* _Ptr) +- : atomic_address(_Ptr) ++ : atomic_address((void*)_Ptr) + { + } + _STRONG_INLINE T* operator+=(ptrdiff_t _V) volatile diff --git a/config.tests/atomicfptr/qnx66.txt b/config.tests/atomicfptr/qnx66.txt new file mode 100644 index 0000000000..b4ea9d65b5 --- /dev/null +++ b/config.tests/atomicfptr/qnx66.txt @@ -0,0 +1,3 @@ +Patch is available from QNX. Please see + +http://www.qnx.com/download/feature.html?programid=27555 diff --git a/config.tests/avx512/avx512.cpp b/config.tests/avx512/avx512.cpp new file mode 100644 index 0000000000..ca1a5d1357 --- /dev/null +++ b/config.tests/avx512/avx512.cpp @@ -0,0 +1,103 @@ +/**************************************************************************** +** +** Copyright (C) 2016 Intel Corporation. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the configuration 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 + +#ifndef AVX512WANT +# error ".pro file must define AVX512WANT macro to the AVX-512 feature to be tested" +#endif + +// The following checks if __AVXx__ is defined, where x is the value in +// AVX512WANT +#define HAS2(x) __AVX512 ## x ## __ +#define HAS(x) HAS2(x) +#if !HAS(AVX512WANT) +# error "Feature not supported" +#endif + +int main(int, char**argv) +{ + /* AVX512 Foundation */ + __m512i i; + __m512d d; + __m512 f; + __mmask16 m = ~1; + i = _mm512_maskz_loadu_epi32(0, argv); + d = _mm512_loadu_pd((double *)argv + 64); + f = _mm512_loadu_ps((float *)argv + 128); + +#ifdef __AVX512ER__ + /* AVX512 Exponential and Reciprocal */ + f = _mm512_exp2a23_round_ps(f, 8); +#endif +#ifdef __AVX512CD__ + /* AVX512 Conflict Detection */ + i = _mm512_maskz_conflict_epi32(m, i); +#endif +#ifdef __AVX512PF__ + /* AVX512 Prefetch */ + _mm512_mask_prefetch_i64scatter_pd(argv, 0xf, i, 2, 2); +#endif +#ifdef __AVX512DQ__ + /* AVX512 Doubleword and Quadword support */ + m = _mm512_movepi32_mask(i); +#endif +#ifdef __AVX512BW__ + /* AVX512 Byte and Word support */ + i = _mm512_mask_loadu_epi8(i, m, argv - 8); +#endif +#ifdef __AVX512VL__ + /* AVX512 Vector Length */ + __m256i i2 = _mm256_maskz_loadu_epi32(0, argv); + _mm256_mask_storeu_epi32(argv + 1, m, i2); +#endif +#ifdef __AVX512IFMA__ + /* AVX512 Integer Fused Multiply-Add */ + i = _mm512_madd52lo_epu64(i, i, i); +#endif +#ifdef __AVX512VBMI__ + /* AVX512 Vector Byte Manipulation Instructions */ + i = _mm512_permutexvar_epi8(i, i); +#endif + + _mm512_mask_storeu_epi64(argv, m, i); + _mm512_mask_storeu_ps(argv + 64, m, f); + _mm512_mask_storeu_pd(argv + 128, m, d); + return 0; +} diff --git a/config.tests/avx512/avx512.pro b/config.tests/avx512/avx512.pro new file mode 100644 index 0000000000..1edf5e5432 --- /dev/null +++ b/config.tests/avx512/avx512.pro @@ -0,0 +1,10 @@ +SOURCES = avx512.cpp + +!defined(AVX512, "var"): error("You must set the AVX512 variable!") + +varname = QMAKE_CFLAGS_AVX512$$AVX512 +value = $$eval($$varname) +!defined($$varname, "var"): error("This compiler does not support AVX512") + +QMAKE_CXXFLAGS += $$value +DEFINES += AVX512WANT=$$AVX512 diff --git a/config.tests/common/atomicfptr/icc2016_mac.diff b/config.tests/common/atomicfptr/icc2016_mac.diff deleted file mode 100644 index 5de3b6e19a..0000000000 --- a/config.tests/common/atomicfptr/icc2016_mac.diff +++ /dev/null @@ -1,18 +0,0 @@ -Patch for fixing std::atomic support for function pointers for the Intel -Composer XE 2016 (compiler version 16.0). - -To apply: - cd /opt/intel/compilers_and_libraries_2016/mac/include - sudo patch -p1 < /path-to-this-file/icc2016_mac.diff - ---- include/stdatomic.h.orig 2015-08-28 15:05:13.000000000 -0700 -+++ include/stdatomic.h 2015-08-28 15:19:25.000000000 -0700 -@@ -451,7 +451,7 @@ - } - _STRONG_INLINE atomic() _DEFAULTED - _STRONG_INLINE _CONSTEXPR atomic(T* _Ptr) -- : atomic_address(_Ptr) -+ : atomic_address((void*)_Ptr) - { - } - _STRONG_INLINE T* operator+=(ptrdiff_t _V) volatile diff --git a/config.tests/common/atomicfptr/qnx66.txt b/config.tests/common/atomicfptr/qnx66.txt deleted file mode 100644 index b4ea9d65b5..0000000000 --- a/config.tests/common/atomicfptr/qnx66.txt +++ /dev/null @@ -1,3 +0,0 @@ -Patch is available from QNX. Please see - -http://www.qnx.com/download/feature.html?programid=27555 diff --git a/config.tests/common/avx512/avx512.cpp b/config.tests/common/avx512/avx512.cpp deleted file mode 100644 index ca1a5d1357..0000000000 --- a/config.tests/common/avx512/avx512.cpp +++ /dev/null @@ -1,103 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 Intel Corporation. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the configuration 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 - -#ifndef AVX512WANT -# error ".pro file must define AVX512WANT macro to the AVX-512 feature to be tested" -#endif - -// The following checks if __AVXx__ is defined, where x is the value in -// AVX512WANT -#define HAS2(x) __AVX512 ## x ## __ -#define HAS(x) HAS2(x) -#if !HAS(AVX512WANT) -# error "Feature not supported" -#endif - -int main(int, char**argv) -{ - /* AVX512 Foundation */ - __m512i i; - __m512d d; - __m512 f; - __mmask16 m = ~1; - i = _mm512_maskz_loadu_epi32(0, argv); - d = _mm512_loadu_pd((double *)argv + 64); - f = _mm512_loadu_ps((float *)argv + 128); - -#ifdef __AVX512ER__ - /* AVX512 Exponential and Reciprocal */ - f = _mm512_exp2a23_round_ps(f, 8); -#endif -#ifdef __AVX512CD__ - /* AVX512 Conflict Detection */ - i = _mm512_maskz_conflict_epi32(m, i); -#endif -#ifdef __AVX512PF__ - /* AVX512 Prefetch */ - _mm512_mask_prefetch_i64scatter_pd(argv, 0xf, i, 2, 2); -#endif -#ifdef __AVX512DQ__ - /* AVX512 Doubleword and Quadword support */ - m = _mm512_movepi32_mask(i); -#endif -#ifdef __AVX512BW__ - /* AVX512 Byte and Word support */ - i = _mm512_mask_loadu_epi8(i, m, argv - 8); -#endif -#ifdef __AVX512VL__ - /* AVX512 Vector Length */ - __m256i i2 = _mm256_maskz_loadu_epi32(0, argv); - _mm256_mask_storeu_epi32(argv + 1, m, i2); -#endif -#ifdef __AVX512IFMA__ - /* AVX512 Integer Fused Multiply-Add */ - i = _mm512_madd52lo_epu64(i, i, i); -#endif -#ifdef __AVX512VBMI__ - /* AVX512 Vector Byte Manipulation Instructions */ - i = _mm512_permutexvar_epi8(i, i); -#endif - - _mm512_mask_storeu_epi64(argv, m, i); - _mm512_mask_storeu_ps(argv + 64, m, f); - _mm512_mask_storeu_pd(argv + 128, m, d); - return 0; -} diff --git a/config.tests/common/avx512/avx512.pro b/config.tests/common/avx512/avx512.pro deleted file mode 100644 index 1edf5e5432..0000000000 --- a/config.tests/common/avx512/avx512.pro +++ /dev/null @@ -1,10 +0,0 @@ -SOURCES = avx512.cpp - -!defined(AVX512, "var"): error("You must set the AVX512 variable!") - -varname = QMAKE_CFLAGS_AVX512$$AVX512 -value = $$eval($$varname) -!defined($$varname, "var"): error("This compiler does not support AVX512") - -QMAKE_CXXFLAGS += $$value -DEFINES += AVX512WANT=$$AVX512 diff --git a/config.tests/common/verifyspec/verifyspec.cpp b/config.tests/common/verifyspec/verifyspec.cpp deleted file mode 100644 index bd5560bf02..0000000000 --- a/config.tests/common/verifyspec/verifyspec.cpp +++ /dev/null @@ -1 +0,0 @@ -int main(int, char **) {} diff --git a/config.tests/common/verifyspec/verifyspec.pro b/config.tests/common/verifyspec/verifyspec.pro deleted file mode 100644 index 11a280e4ce..0000000000 --- a/config.tests/common/verifyspec/verifyspec.pro +++ /dev/null @@ -1,37 +0,0 @@ -SOURCES = verifyspec.cpp - -# Provide a function to be used by mkspecs -defineTest(deviceSanityCheckCompiler) { - equals(QMAKE_HOST.os, Windows): \ - sfx = .exe - else: \ - sfx = - - # Build the compiler filename using the first value in QMAKE_CXX in order to - # support tools like ccache, which give QMAKE_CXX values of the form: - # ccache - compiler = $$first(QMAKE_CXX)$$sfx - - # Check if the binary exists with an absolute path. Do this check - # before the CROSS_COMPILE empty check below to allow the mkspec - # to derive the compiler path from other device options. - exists($$compiler): return() - - # Check for possible reasons of failure - # check if CROSS_COMPILE device-option is set - isEmpty(CROSS_COMPILE): \ - error("CROSS_COMPILE needs to be set via -device-option CROSS_COMPILE=") - - # Check if QMAKE_CXX points to an executable. - ensurePathEnv() - for (dir, QMAKE_PATH_ENV) { - exists($$dir/$${compiler}): \ - return() - } - - # QMAKE_CXX does not point to a compiler. - error("Compiler $$QMAKE_CXX not found. Check the value of CROSS_COMPILE -device-option") -} - -defined(qtConfSanitizeMkspec, test): \ - qtConfSanitizeMkspec() diff --git a/config.tests/common/xlocalescanprint/qglobal.h b/config.tests/common/xlocalescanprint/qglobal.h deleted file mode 100644 index 98de822847..0000000000 --- a/config.tests/common/xlocalescanprint/qglobal.h +++ /dev/null @@ -1,43 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests 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$ -** -****************************************************************************/ - -#ifndef QGLOBAL_H -#define QGLOBAL_H - -#endif diff --git a/config.tests/common/xlocalescanprint/xlocalescanprint.cpp b/config.tests/common/xlocalescanprint/xlocalescanprint.cpp deleted file mode 100644 index 2f1f28f74e..0000000000 --- a/config.tests/common/xlocalescanprint/xlocalescanprint.cpp +++ /dev/null @@ -1,62 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests 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$ -** -****************************************************************************/ - -#define QT_BEGIN_NAMESPACE -#define QT_END_NAMESPACE - -#ifdef _MSVC_VER -#define Q_CC_MSVC _MSVC_VER -#endif - -#define QT_NO_DOUBLECONVERSION - -#include "../../../src/corelib/tools/qdoublescanprint_p.h" - -int main(int argc, char **argv) -{ -#ifdef _MSVC_VER - _locale_t invalidLocale = NULL; -#else - locale_t invalidLocale = NULL; -#endif - double a = 3.4; - qDoubleSnprintf(argv[0], 1, invalidLocale, "invalid format", a); - qDoubleSscanf(argv[0], invalidLocale, "invalid format", &a, &argc); - return 0; -} diff --git a/config.tests/common/xlocalescanprint/xlocalescanprint.pro b/config.tests/common/xlocalescanprint/xlocalescanprint.pro deleted file mode 100644 index a37a01f227..0000000000 --- a/config.tests/common/xlocalescanprint/xlocalescanprint.pro +++ /dev/null @@ -1,3 +0,0 @@ -SOURCES = xlocalescanprint.cpp -CONFIG -= qt -CONFIG += console diff --git a/config.tests/corewlan/corewlan.pro b/config.tests/corewlan/corewlan.pro new file mode 100644 index 0000000000..97e864f476 --- /dev/null +++ b/config.tests/corewlan/corewlan.pro @@ -0,0 +1,2 @@ +OBJECTIVE_SOURCES = corewlantest.mm +CONFIG -= qt diff --git a/config.tests/corewlan/corewlantest.mm b/config.tests/corewlan/corewlantest.mm new file mode 100644 index 0000000000..73b4d0d145 --- /dev/null +++ b/config.tests/corewlan/corewlantest.mm @@ -0,0 +1,47 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the config.tests 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 +#include + +int main() +{ + [CWInterface interfaceWithName:@"en2"]; + return 0; +} diff --git a/config.tests/gnu-libiconv/gnu-libiconv.cpp b/config.tests/gnu-libiconv/gnu-libiconv.cpp new file mode 100644 index 0000000000..fe4b87b923 --- /dev/null +++ b/config.tests/gnu-libiconv/gnu-libiconv.cpp @@ -0,0 +1,54 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the config.tests 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 + +int main(int, char **) +{ + iconv_t x = iconv_open("", ""); + + const char *inp; + char *outp; + size_t inbytes, outbytes; + iconv(x, &inp, &inbytes, &outp, &outbytes); + + iconv_close(x); + + return 0; +} diff --git a/config.tests/gnu-libiconv/gnu-libiconv.pro b/config.tests/gnu-libiconv/gnu-libiconv.pro new file mode 100644 index 0000000000..4008f882eb --- /dev/null +++ b/config.tests/gnu-libiconv/gnu-libiconv.pro @@ -0,0 +1,2 @@ +SOURCES = gnu-libiconv.cpp +CONFIG -= qt dylib diff --git a/config.tests/iconv/iconv.cpp b/config.tests/iconv/iconv.cpp new file mode 100644 index 0000000000..be4236436f --- /dev/null +++ b/config.tests/iconv/iconv.cpp @@ -0,0 +1,54 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the config.tests 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 + +int main(int, char **) +{ + iconv_t x = iconv_open("", ""); + + char *inp; + char *outp; + size_t inbytes, outbytes; + iconv(x, &inp, &inbytes, &outp, &outbytes); + + iconv_close(x); + + return 0; +} diff --git a/config.tests/iconv/iconv.pro b/config.tests/iconv/iconv.pro new file mode 100644 index 0000000000..65273ccc94 --- /dev/null +++ b/config.tests/iconv/iconv.pro @@ -0,0 +1,3 @@ +SOURCES = iconv.cpp +CONFIG -= qt dylib +mac|mingw|openbsd|qnx|haiku:LIBS += -liconv diff --git a/config.tests/mac/corewlan/corewlan.pro b/config.tests/mac/corewlan/corewlan.pro deleted file mode 100644 index 97e864f476..0000000000 --- a/config.tests/mac/corewlan/corewlan.pro +++ /dev/null @@ -1,2 +0,0 @@ -OBJECTIVE_SOURCES = corewlantest.mm -CONFIG -= qt diff --git a/config.tests/mac/corewlan/corewlantest.mm b/config.tests/mac/corewlan/corewlantest.mm deleted file mode 100644 index 73b4d0d145..0000000000 --- a/config.tests/mac/corewlan/corewlantest.mm +++ /dev/null @@ -1,47 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests 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 -#include - -int main() -{ - [CWInterface interfaceWithName:@"en2"]; - return 0; -} diff --git a/config.tests/openssl/openssl.cpp b/config.tests/openssl/openssl.cpp new file mode 100644 index 0000000000..d33b62389c --- /dev/null +++ b/config.tests/openssl/openssl.cpp @@ -0,0 +1,54 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the config.tests 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 + +#if !defined(OPENSSL_VERSION_NUMBER) || OPENSSL_VERSION_NUMBER-0 < 0x0090700fL +# error "OpenSSL >= 0.9.7 is required" +#endif + +#include + +#if OPENSSL_VERSION_NUMBER-0 >= 0x10002000L && !defined(OPENSSL_NO_EC) && !defined(SSL_CTRL_SET_CURVES) +# error "OpenSSL was reported as >= 1.0.2 but is missing required features, possibly it's libressl which is unsupported" +#endif + +int main() +{ +} diff --git a/config.tests/openssl/openssl.pro b/config.tests/openssl/openssl.pro new file mode 100644 index 0000000000..a023aee4aa --- /dev/null +++ b/config.tests/openssl/openssl.pro @@ -0,0 +1,2 @@ +SOURCES = openssl.cpp +CONFIG -= x11 qt diff --git a/config.tests/stl/stl.pro b/config.tests/stl/stl.pro new file mode 100644 index 0000000000..7303e8d31c --- /dev/null +++ b/config.tests/stl/stl.pro @@ -0,0 +1,2 @@ +SOURCES = stltest.cpp +CONFIG -= qt dylib diff --git a/config.tests/stl/stltest.cpp b/config.tests/stl/stltest.cpp new file mode 100644 index 0000000000..a7a36ba0d3 --- /dev/null +++ b/config.tests/stl/stltest.cpp @@ -0,0 +1,149 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the config.tests 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$ +** +****************************************************************************/ + +/* Sample program for configure to test STL support on target +platforms. We are mainly concerned with being able to instantiate +templates for common STL container classes. +*/ + +#include +#include +#include +#include +#include +#include + +// something mean to see if the compiler and C++ standard lib are good enough +template +class DummyClass +{ + // everything in std namespace ? + typedef std::bidirectional_iterator_tag i; + typedef std::ptrdiff_t d; + // typename implemented ? + typedef typename std::map::iterator MyIterator; +}; + +// extracted from QVector's strict iterator +template +class DummyIterator +{ + typedef DummyIterator iterator; +public: + T *i; + typedef std::random_access_iterator_tag iterator_category; + typedef std::ptrdiff_t difference_type; + typedef T value_type; + typedef T *pointer; + typedef T &reference; + + inline DummyIterator() : i(0) {} + inline DummyIterator(T *n) : i(n) {} + inline DummyIterator(const DummyIterator &o): i(o.i){} + inline T &operator*() const { return *i; } + inline T *operator->() const { return i; } + inline T &operator[](int j) const { return *(i + j); } + inline bool operator==(const DummyIterator &o) const { return i == o.i; } + inline bool operator!=(const DummyIterator &o) const { return i != o.i; } + inline bool operator<(const DummyIterator& other) const { return i < other.i; } + inline bool operator<=(const DummyIterator& other) const { return i <= other.i; } + inline bool operator>(const DummyIterator& other) const { return i > other.i; } + inline bool operator>=(const DummyIterator& other) const { return i >= other.i; } + inline DummyIterator &operator++() { ++i; return *this; } + inline DummyIterator operator++(int) { T *n = i; ++i; return n; } + inline DummyIterator &operator--() { i--; return *this; } + inline DummyIterator operator--(int) { T *n = i; i--; return n; } + inline DummyIterator &operator+=(int j) { i+=j; return *this; } + inline DummyIterator &operator-=(int j) { i-=j; return *this; } + inline DummyIterator operator+(int j) const { return DummyIterator(i+j); } + inline DummyIterator operator-(int j) const { return DummyIterator(i-j); } + inline int operator-(DummyIterator j) const { return i - j.i; } +}; + +int main() +{ + std::vector v1; + v1.push_back( 0 ); + v1.push_back( 1 ); + v1.push_back( 2 ); + v1.push_back( 3 ); + v1.push_back( 4 ); + int v1size = v1.size(); + v1size = 0; + int v1capacity = v1.capacity(); + v1capacity = 0; + + std::vector::iterator v1it = std::find( v1.begin(), v1.end(), 99 ); + bool v1notfound = (v1it == v1.end()); + v1notfound = false; + + v1it = std::find( v1.begin(), v1.end(), 3 ); + bool v1found = (v1it != v1.end()); + v1found = false; + + std::vector v2; + std::copy( v1.begin(), v1it, std::back_inserter( v2 ) ); + int v2size = v2.size(); + v2size = 0; + + std::map m1; + m1.insert( std::make_pair( 1, 2.0 ) ); + m1.insert( std::make_pair( 3, 2.0 ) ); + m1.insert( std::make_pair( 5, 2.0 ) ); + m1.insert( std::make_pair( 7, 2.0 ) ); + int m1size = m1.size(); + m1size = 0; + std::map::iterator m1it = m1.begin(); + for ( ; m1it != m1.end(); ++m1it ) { + int first = (*m1it).first; + first = 0; + double second = (*m1it).second; + second = 0.0; + } + std::map< int, double > m2( m1 ); + int m2size = m2.size(); + m2size = 0; + + DummyIterator it1, it2; + int n = std::distance(it1, it2); + std::advance(it1, 3); + + return 0; +} + diff --git a/config.tests/sun-libiconv/sun-libiconv.pro b/config.tests/sun-libiconv/sun-libiconv.pro new file mode 100644 index 0000000000..923afc7dd2 --- /dev/null +++ b/config.tests/sun-libiconv/sun-libiconv.pro @@ -0,0 +1,2 @@ +SOURCES = ../gnu-libiconv/gnu-libiconv.cpp +CONFIG -= qt dylib diff --git a/config.tests/unix/gnu-libiconv/gnu-libiconv.cpp b/config.tests/unix/gnu-libiconv/gnu-libiconv.cpp deleted file mode 100644 index fe4b87b923..0000000000 --- a/config.tests/unix/gnu-libiconv/gnu-libiconv.cpp +++ /dev/null @@ -1,54 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests 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 - -int main(int, char **) -{ - iconv_t x = iconv_open("", ""); - - const char *inp; - char *outp; - size_t inbytes, outbytes; - iconv(x, &inp, &inbytes, &outp, &outbytes); - - iconv_close(x); - - return 0; -} diff --git a/config.tests/unix/gnu-libiconv/gnu-libiconv.pro b/config.tests/unix/gnu-libiconv/gnu-libiconv.pro deleted file mode 100644 index 4008f882eb..0000000000 --- a/config.tests/unix/gnu-libiconv/gnu-libiconv.pro +++ /dev/null @@ -1,2 +0,0 @@ -SOURCES = gnu-libiconv.cpp -CONFIG -= qt dylib diff --git a/config.tests/unix/iconv/iconv.cpp b/config.tests/unix/iconv/iconv.cpp deleted file mode 100644 index be4236436f..0000000000 --- a/config.tests/unix/iconv/iconv.cpp +++ /dev/null @@ -1,54 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests 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 - -int main(int, char **) -{ - iconv_t x = iconv_open("", ""); - - char *inp; - char *outp; - size_t inbytes, outbytes; - iconv(x, &inp, &inbytes, &outp, &outbytes); - - iconv_close(x); - - return 0; -} diff --git a/config.tests/unix/iconv/iconv.pro b/config.tests/unix/iconv/iconv.pro deleted file mode 100644 index 65273ccc94..0000000000 --- a/config.tests/unix/iconv/iconv.pro +++ /dev/null @@ -1,3 +0,0 @@ -SOURCES = iconv.cpp -CONFIG -= qt dylib -mac|mingw|openbsd|qnx|haiku:LIBS += -liconv diff --git a/config.tests/unix/openssl/openssl.cpp b/config.tests/unix/openssl/openssl.cpp deleted file mode 100644 index d33b62389c..0000000000 --- a/config.tests/unix/openssl/openssl.cpp +++ /dev/null @@ -1,54 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests 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 - -#if !defined(OPENSSL_VERSION_NUMBER) || OPENSSL_VERSION_NUMBER-0 < 0x0090700fL -# error "OpenSSL >= 0.9.7 is required" -#endif - -#include - -#if OPENSSL_VERSION_NUMBER-0 >= 0x10002000L && !defined(OPENSSL_NO_EC) && !defined(SSL_CTRL_SET_CURVES) -# error "OpenSSL was reported as >= 1.0.2 but is missing required features, possibly it's libressl which is unsupported" -#endif - -int main() -{ -} diff --git a/config.tests/unix/openssl/openssl.pro b/config.tests/unix/openssl/openssl.pro deleted file mode 100644 index a023aee4aa..0000000000 --- a/config.tests/unix/openssl/openssl.pro +++ /dev/null @@ -1,2 +0,0 @@ -SOURCES = openssl.cpp -CONFIG -= x11 qt diff --git a/config.tests/unix/stl/stl.pro b/config.tests/unix/stl/stl.pro deleted file mode 100644 index 7303e8d31c..0000000000 --- a/config.tests/unix/stl/stl.pro +++ /dev/null @@ -1,2 +0,0 @@ -SOURCES = stltest.cpp -CONFIG -= qt dylib diff --git a/config.tests/unix/stl/stltest.cpp b/config.tests/unix/stl/stltest.cpp deleted file mode 100644 index a7a36ba0d3..0000000000 --- a/config.tests/unix/stl/stltest.cpp +++ /dev/null @@ -1,149 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests 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$ -** -****************************************************************************/ - -/* Sample program for configure to test STL support on target -platforms. We are mainly concerned with being able to instantiate -templates for common STL container classes. -*/ - -#include -#include -#include -#include -#include -#include - -// something mean to see if the compiler and C++ standard lib are good enough -template -class DummyClass -{ - // everything in std namespace ? - typedef std::bidirectional_iterator_tag i; - typedef std::ptrdiff_t d; - // typename implemented ? - typedef typename std::map::iterator MyIterator; -}; - -// extracted from QVector's strict iterator -template -class DummyIterator -{ - typedef DummyIterator iterator; -public: - T *i; - typedef std::random_access_iterator_tag iterator_category; - typedef std::ptrdiff_t difference_type; - typedef T value_type; - typedef T *pointer; - typedef T &reference; - - inline DummyIterator() : i(0) {} - inline DummyIterator(T *n) : i(n) {} - inline DummyIterator(const DummyIterator &o): i(o.i){} - inline T &operator*() const { return *i; } - inline T *operator->() const { return i; } - inline T &operator[](int j) const { return *(i + j); } - inline bool operator==(const DummyIterator &o) const { return i == o.i; } - inline bool operator!=(const DummyIterator &o) const { return i != o.i; } - inline bool operator<(const DummyIterator& other) const { return i < other.i; } - inline bool operator<=(const DummyIterator& other) const { return i <= other.i; } - inline bool operator>(const DummyIterator& other) const { return i > other.i; } - inline bool operator>=(const DummyIterator& other) const { return i >= other.i; } - inline DummyIterator &operator++() { ++i; return *this; } - inline DummyIterator operator++(int) { T *n = i; ++i; return n; } - inline DummyIterator &operator--() { i--; return *this; } - inline DummyIterator operator--(int) { T *n = i; i--; return n; } - inline DummyIterator &operator+=(int j) { i+=j; return *this; } - inline DummyIterator &operator-=(int j) { i-=j; return *this; } - inline DummyIterator operator+(int j) const { return DummyIterator(i+j); } - inline DummyIterator operator-(int j) const { return DummyIterator(i-j); } - inline int operator-(DummyIterator j) const { return i - j.i; } -}; - -int main() -{ - std::vector v1; - v1.push_back( 0 ); - v1.push_back( 1 ); - v1.push_back( 2 ); - v1.push_back( 3 ); - v1.push_back( 4 ); - int v1size = v1.size(); - v1size = 0; - int v1capacity = v1.capacity(); - v1capacity = 0; - - std::vector::iterator v1it = std::find( v1.begin(), v1.end(), 99 ); - bool v1notfound = (v1it == v1.end()); - v1notfound = false; - - v1it = std::find( v1.begin(), v1.end(), 3 ); - bool v1found = (v1it != v1.end()); - v1found = false; - - std::vector v2; - std::copy( v1.begin(), v1it, std::back_inserter( v2 ) ); - int v2size = v2.size(); - v2size = 0; - - std::map m1; - m1.insert( std::make_pair( 1, 2.0 ) ); - m1.insert( std::make_pair( 3, 2.0 ) ); - m1.insert( std::make_pair( 5, 2.0 ) ); - m1.insert( std::make_pair( 7, 2.0 ) ); - int m1size = m1.size(); - m1size = 0; - std::map::iterator m1it = m1.begin(); - for ( ; m1it != m1.end(); ++m1it ) { - int first = (*m1it).first; - first = 0; - double second = (*m1it).second; - second = 0.0; - } - std::map< int, double > m2( m1 ); - int m2size = m2.size(); - m2size = 0; - - DummyIterator it1, it2; - int n = std::distance(it1, it2); - std::advance(it1, 3); - - return 0; -} - diff --git a/config.tests/unix/sun-libiconv/sun-libiconv.pro b/config.tests/unix/sun-libiconv/sun-libiconv.pro deleted file mode 100644 index 923afc7dd2..0000000000 --- a/config.tests/unix/sun-libiconv/sun-libiconv.pro +++ /dev/null @@ -1,2 +0,0 @@ -SOURCES = ../gnu-libiconv/gnu-libiconv.cpp -CONFIG -= qt dylib diff --git a/config.tests/verifyspec/verifyspec.cpp b/config.tests/verifyspec/verifyspec.cpp new file mode 100644 index 0000000000..bd5560bf02 --- /dev/null +++ b/config.tests/verifyspec/verifyspec.cpp @@ -0,0 +1 @@ +int main(int, char **) {} diff --git a/config.tests/verifyspec/verifyspec.pro b/config.tests/verifyspec/verifyspec.pro new file mode 100644 index 0000000000..11a280e4ce --- /dev/null +++ b/config.tests/verifyspec/verifyspec.pro @@ -0,0 +1,37 @@ +SOURCES = verifyspec.cpp + +# Provide a function to be used by mkspecs +defineTest(deviceSanityCheckCompiler) { + equals(QMAKE_HOST.os, Windows): \ + sfx = .exe + else: \ + sfx = + + # Build the compiler filename using the first value in QMAKE_CXX in order to + # support tools like ccache, which give QMAKE_CXX values of the form: + # ccache + compiler = $$first(QMAKE_CXX)$$sfx + + # Check if the binary exists with an absolute path. Do this check + # before the CROSS_COMPILE empty check below to allow the mkspec + # to derive the compiler path from other device options. + exists($$compiler): return() + + # Check for possible reasons of failure + # check if CROSS_COMPILE device-option is set + isEmpty(CROSS_COMPILE): \ + error("CROSS_COMPILE needs to be set via -device-option CROSS_COMPILE=") + + # Check if QMAKE_CXX points to an executable. + ensurePathEnv() + for (dir, QMAKE_PATH_ENV) { + exists($$dir/$${compiler}): \ + return() + } + + # QMAKE_CXX does not point to a compiler. + error("Compiler $$QMAKE_CXX not found. Check the value of CROSS_COMPILE -device-option") +} + +defined(qtConfSanitizeMkspec, test): \ + qtConfSanitizeMkspec() diff --git a/config.tests/xlocalescanprint/qglobal.h b/config.tests/xlocalescanprint/qglobal.h new file mode 100644 index 0000000000..98de822847 --- /dev/null +++ b/config.tests/xlocalescanprint/qglobal.h @@ -0,0 +1,43 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the config.tests 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$ +** +****************************************************************************/ + +#ifndef QGLOBAL_H +#define QGLOBAL_H + +#endif diff --git a/config.tests/xlocalescanprint/xlocalescanprint.cpp b/config.tests/xlocalescanprint/xlocalescanprint.cpp new file mode 100644 index 0000000000..2f1f28f74e --- /dev/null +++ b/config.tests/xlocalescanprint/xlocalescanprint.cpp @@ -0,0 +1,62 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the config.tests 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$ +** +****************************************************************************/ + +#define QT_BEGIN_NAMESPACE +#define QT_END_NAMESPACE + +#ifdef _MSVC_VER +#define Q_CC_MSVC _MSVC_VER +#endif + +#define QT_NO_DOUBLECONVERSION + +#include "../../../src/corelib/tools/qdoublescanprint_p.h" + +int main(int argc, char **argv) +{ +#ifdef _MSVC_VER + _locale_t invalidLocale = NULL; +#else + locale_t invalidLocale = NULL; +#endif + double a = 3.4; + qDoubleSnprintf(argv[0], 1, invalidLocale, "invalid format", a); + qDoubleSscanf(argv[0], invalidLocale, "invalid format", &a, &argc); + return 0; +} diff --git a/config.tests/xlocalescanprint/xlocalescanprint.pro b/config.tests/xlocalescanprint/xlocalescanprint.pro new file mode 100644 index 0000000000..a37a01f227 --- /dev/null +++ b/config.tests/xlocalescanprint/xlocalescanprint.pro @@ -0,0 +1,3 @@ +SOURCES = xlocalescanprint.cpp +CONFIG -= qt +CONFIG += console diff --git a/configure.json b/configure.json index 80278b3b69..6221c9803a 100644 --- a/configure.json +++ b/configure.json @@ -229,7 +229,7 @@ "verifyspec": { "label": "valid makespec", "type": "verifySpec", - "test": "common/verifyspec" + "test": "verifyspec" }, "architecture": { "label": "target architecture", @@ -256,7 +256,7 @@ "stl": { "label": "STL compatibility", "type": "compile", - "test": "unix/stl" + "test": "stl" }, "c++14": { "label": "C++14 support", @@ -497,55 +497,55 @@ "avx512f": { "label": "AVX512 F instructions", "type": "compile", - "test": "common/avx512", + "test": "avx512", "args": "AVX512=F" }, "avx512er": { "label": "AVX512 ER instructions", "type": "compile", - "test": "common/avx512", + "test": "avx512", "args": "AVX512=ER" }, "avx512cd": { "label": "AVX512 CD instructions", "type": "compile", - "test": "common/avx512", + "test": "avx512", "args": "AVX512=CD" }, "avx512pf": { "label": "AVX512 PF instructions", "type": "compile", - "test": "common/avx512", + "test": "avx512", "args": "AVX512=PF" }, "avx512dq": { "label": "AVX512 DQ instructions", "type": "compile", - "test": "common/avx512", + "test": "avx512", "args": "AVX512=DQ" }, "avx512bw": { "label": "AVX512 BW instructions", "type": "compile", - "test": "common/avx512", + "test": "avx512", "args": "AVX512=BW" }, "avx512vl": { "label": "AVX512 VL instructions", "type": "compile", - "test": "common/avx512", + "test": "avx512", "args": "AVX512=VL" }, "avx512ifma": { "label": "AVX512 IFMA instructions", "type": "compile", - "test": "common/avx512", + "test": "avx512", "args": "AVX512=IFMA" }, "avx512vbmi": { "label": "AVX512 VBMI instructions", "type": "compile", - "test": "common/avx512", + "test": "avx512", "args": "AVX512=VBMI" }, "mips_dsp": { diff --git a/src/corelib/configure.json b/src/corelib/configure.json index 5596280250..91f7bb4fd6 100644 --- a/src/corelib/configure.json +++ b/src/corelib/configure.json @@ -49,7 +49,7 @@ "gnu_iconv": { "label": "GNU libiconv", "export": "iconv", - "test": "unix/gnu-libiconv", + "test": "gnu-libiconv", "sources": [ "-liconv" ] @@ -267,12 +267,12 @@ "posix-iconv": { "label": "POSIX iconv", "type": "compile", - "test": "unix/iconv" + "test": "iconv" }, "sun-iconv": { "label": "SUN libiconv", "type": "compile", - "test": "unix/sun-libiconv" + "test": "sun-libiconv" }, "inotify": { "label": "inotify", @@ -364,7 +364,7 @@ "xlocalescanprint": { "label": "xlocale.h (or equivalents)", "type": "compile", - "test": "common/xlocalescanprint" + "test": "xlocalescanprint" } }, @@ -774,7 +774,7 @@ You need to use libdouble-conversion for double/string conversion." "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" + qtbase/config.tests/atomicfptr" } ], diff --git a/src/network/configure.json b/src/network/configure.json index c77004d4ba..6e7ce25051 100644 --- a/src/network/configure.json +++ b/src/network/configure.json @@ -25,7 +25,7 @@ "corewlan": { "label": "CoreWLan", "export": "", - "test": "mac/corewlan", + "test": "corewlan", "sources": [ "-framework CoreWLAN -framework Foundation" ] @@ -53,7 +53,7 @@ "openssl_headers": { "label": "OpenSSL Headers", "export": "openssl", - "test": "unix/openssl", + "test": "openssl", "sources": [ { "comment": "placeholder for OPENSSL_PATH", @@ -63,7 +63,7 @@ }, "openssl": { "label": "OpenSSL", - "test": "unix/openssl", + "test": "openssl", "sources": [ { "type": "openssl" }, { -- cgit v1.2.3 From 71e36a42f2e4f46f11524264b880b6a18bc247d2 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 31 Jul 2017 13:03:14 +0200 Subject: configure: clean up projects of remaining non-inline tests remove redundant and wholly ineffective CONFIG manipulations. Change-Id: I3836369a0eb32abfe985c7619c0f7c8037ad82e2 Reviewed-by: Thiago Macieira --- config.tests/corewlan/corewlan.pro | 1 - config.tests/gnu-libiconv/gnu-libiconv.pro | 1 - config.tests/iconv/iconv.pro | 1 - config.tests/openssl/openssl.pro | 1 - config.tests/stl/stl.pro | 1 - config.tests/sun-libiconv/sun-libiconv.pro | 1 - config.tests/xlocalescanprint/xlocalescanprint.pro | 2 -- 7 files changed, 8 deletions(-) diff --git a/config.tests/corewlan/corewlan.pro b/config.tests/corewlan/corewlan.pro index 97e864f476..c19f0be4fd 100644 --- a/config.tests/corewlan/corewlan.pro +++ b/config.tests/corewlan/corewlan.pro @@ -1,2 +1 @@ OBJECTIVE_SOURCES = corewlantest.mm -CONFIG -= qt diff --git a/config.tests/gnu-libiconv/gnu-libiconv.pro b/config.tests/gnu-libiconv/gnu-libiconv.pro index 4008f882eb..e4e020cffb 100644 --- a/config.tests/gnu-libiconv/gnu-libiconv.pro +++ b/config.tests/gnu-libiconv/gnu-libiconv.pro @@ -1,2 +1 @@ SOURCES = gnu-libiconv.cpp -CONFIG -= qt dylib diff --git a/config.tests/iconv/iconv.pro b/config.tests/iconv/iconv.pro index 65273ccc94..70af0d2eb2 100644 --- a/config.tests/iconv/iconv.pro +++ b/config.tests/iconv/iconv.pro @@ -1,3 +1,2 @@ SOURCES = iconv.cpp -CONFIG -= qt dylib mac|mingw|openbsd|qnx|haiku:LIBS += -liconv diff --git a/config.tests/openssl/openssl.pro b/config.tests/openssl/openssl.pro index a023aee4aa..f0ee5e2b0c 100644 --- a/config.tests/openssl/openssl.pro +++ b/config.tests/openssl/openssl.pro @@ -1,2 +1 @@ SOURCES = openssl.cpp -CONFIG -= x11 qt diff --git a/config.tests/stl/stl.pro b/config.tests/stl/stl.pro index 7303e8d31c..91f29a232c 100644 --- a/config.tests/stl/stl.pro +++ b/config.tests/stl/stl.pro @@ -1,2 +1 @@ SOURCES = stltest.cpp -CONFIG -= qt dylib diff --git a/config.tests/sun-libiconv/sun-libiconv.pro b/config.tests/sun-libiconv/sun-libiconv.pro index 923afc7dd2..d0881b732a 100644 --- a/config.tests/sun-libiconv/sun-libiconv.pro +++ b/config.tests/sun-libiconv/sun-libiconv.pro @@ -1,2 +1 @@ SOURCES = ../gnu-libiconv/gnu-libiconv.cpp -CONFIG -= qt dylib diff --git a/config.tests/xlocalescanprint/xlocalescanprint.pro b/config.tests/xlocalescanprint/xlocalescanprint.pro index a37a01f227..3748d2a728 100644 --- a/config.tests/xlocalescanprint/xlocalescanprint.pro +++ b/config.tests/xlocalescanprint/xlocalescanprint.pro @@ -1,3 +1 @@ SOURCES = xlocalescanprint.cpp -CONFIG -= qt -CONFIG += console -- cgit v1.2.3 From a96656a8fb6a3c1fc7765659efff28f807fd0deb Mon Sep 17 00:00:00 2001 From: Oliver Wolff Date: Fri, 28 Jul 2017 09:02:50 +0200 Subject: ANGLE: Fix build for newer MinGW versions Availability of D3D11_QUERY_DATA_TIMESTAMP_DISJOINT depends on the used MinGW version so that the check for MINGW is not sufficient. The newly added configure test can be used for every toolset. Task-number: QTBUG-57916 Change-Id: Ia9cb48f3e673841101a93cbc8ea23aff9547f639 Reviewed-by: Oswald Buddenhagen Reviewed-by: Kai Koehne --- .../win/angle_d3d11_qdtd/angle_d3d11_qdtd.cpp | 47 ++++++++++++++++++++++ .../win/angle_d3d11_qdtd/angle_d3d11_qdtd.pro | 3 ++ .../src/libANGLE/renderer/d3d/d3d11/Query11.cpp | 2 +- ...GLE_D3D11_QDTD_AVAILABLE-to-check-struct-.patch | 32 +++++++++++++++ src/angle/src/common/gles_common.pri | 5 +++ src/gui/configure.json | 10 +++++ 6 files changed, 98 insertions(+), 1 deletion(-) create mode 100644 config.tests/win/angle_d3d11_qdtd/angle_d3d11_qdtd.cpp create mode 100644 config.tests/win/angle_d3d11_qdtd/angle_d3d11_qdtd.pro create mode 100644 src/angle/patches/0015-ANGLE-Use-ANGLE_D3D11_QDTD_AVAILABLE-to-check-struct-.patch diff --git a/config.tests/win/angle_d3d11_qdtd/angle_d3d11_qdtd.cpp b/config.tests/win/angle_d3d11_qdtd/angle_d3d11_qdtd.cpp new file mode 100644 index 0000000000..2dde2914a2 --- /dev/null +++ b/config.tests/win/angle_d3d11_qdtd/angle_d3d11_qdtd.cpp @@ -0,0 +1,47 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the config.tests 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 + +int main(int, char**) +{ + D3D11_QUERY_DATA_TIMESTAMP_DISJOINT qdtd; + (void)qdtd; + return 0; +} diff --git a/config.tests/win/angle_d3d11_qdtd/angle_d3d11_qdtd.pro b/config.tests/win/angle_d3d11_qdtd/angle_d3d11_qdtd.pro new file mode 100644 index 0000000000..f1e530ab6e --- /dev/null +++ b/config.tests/win/angle_d3d11_qdtd/angle_d3d11_qdtd.pro @@ -0,0 +1,3 @@ +SOURCES = angle_d3d11_qdtd.cpp +CONFIG -= qt +CONFIG += console diff --git a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/Query11.cpp b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/Query11.cpp index 972c289412..0a79b26df0 100644 --- a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/Query11.cpp +++ b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/Query11.cpp @@ -20,7 +20,7 @@ typedef struct D3D11_QUERY_DATA_SO_STATISTICS { } D3D11_QUERY_DATA_SO_STATISTICS; #endif // ANGLE_MINGW32_COMPAT -#ifdef __MINGW32__ +#ifndef ANGLE_D3D11_QDTD_AVAILABLE typedef struct D3D11_QUERY_DATA_TIMESTAMP_DISJOINT { UINT64 Frequency; BOOL Disjoint; diff --git a/src/angle/patches/0015-ANGLE-Use-ANGLE_D3D11_QDTD_AVAILABLE-to-check-struct-.patch b/src/angle/patches/0015-ANGLE-Use-ANGLE_D3D11_QDTD_AVAILABLE-to-check-struct-.patch new file mode 100644 index 0000000000..9809fefd9d --- /dev/null +++ b/src/angle/patches/0015-ANGLE-Use-ANGLE_D3D11_QDTD_AVAILABLE-to-check-struct-.patch @@ -0,0 +1,32 @@ +From 640361e72369d612270c6e59126019c917e33c9a Mon Sep 17 00:00:00 2001 +From: Oliver Wolff +Date: Fri, 28 Jul 2017 09:02:50 +0200 +Subject: [PATCH] ANGLE: Use ANGLE_D3D11_QDTD_AVAILABLE to check struct's + availability + +Checking mingw when defining the structure is not enough, as it is +available in recent versions of MinGW. The define that is used is set +depending on a configure test which works independently of the used +toolchain. + +Change-Id: Ia9cb48f3e673841101a93cbc8ea23aff9547f639 +--- + src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/Query11.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/Query11.cpp b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/Query11.cpp +index 972c289..97c65e1 100644 +--- a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/Query11.cpp ++++ b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/Query11.cpp +@@ -20,7 +20,7 @@ typedef struct D3D11_QUERY_DATA_SO_STATISTICS { + } D3D11_QUERY_DATA_SO_STATISTICS; + #endif // ANGLE_MINGW32_COMPAT + +-#ifdef __MINGW32__ ++#ifndef ANGLE_D3D11_QDTD_AVAILABLE + typedef struct D3D11_QUERY_DATA_TIMESTAMP_DISJOINT { + UINT64 Frequency; + BOOL Disjoint; +-- +2.10.2.windows.1 + diff --git a/src/angle/src/common/gles_common.pri b/src/angle/src/common/gles_common.pri index 7b2e4c71b0..ea4fb03aae 100644 --- a/src/angle/src/common/gles_common.pri +++ b/src/angle/src/common/gles_common.pri @@ -23,6 +23,11 @@ for(libname, STATICLIBS) { DEFINES += LIBANGLE_IMPLEMENTATION LIBGLESV2_IMPLEMENTATION GL_APICALL= GL_GLEXT_PROTOTYPES= EGLAPI= !winrt: DEFINES += ANGLE_ENABLE_D3D9 ANGLE_SKIP_DXGI_1_2_CHECK +QT_FOR_CONFIG += gui-private +include($$OUT_PWD/../../../gui/qtgui-config.pri) + +qtConfig(angle_d3d11_qdtd): DEFINES += ANGLE_D3D11_QDTD_AVAILABLE + HEADERS += \ $$ANGLE_DIR/src/common/mathutil.h \ $$ANGLE_DIR/src/common/blocklayout.h \ diff --git a/src/gui/configure.json b/src/gui/configure.json index 062171606e..6fdeefe14a 100644 --- a/src/gui/configure.json +++ b/src/gui/configure.json @@ -591,6 +591,11 @@ }, "tests": { + "angle_d3d11_qdtd": { + "label": "D3D11_QUERY_DATA_TIMESTAMP_DISJOINT", + "type": "compile", + "test": "win/angle_d3d11_qdtd" + }, "directwrite2": { "label": "DirectWrite 2", "type": "compile", @@ -842,6 +847,11 @@ { "type": "define", "name": "QT_OPENGL_ES_2_ANGLE" } ] }, + "angle_d3d11_qdtd": { + "label": "D3D11_QUERY_DATA_TIMESTAMP_DISJOINT", + "condition": "features.angle && tests.angle_d3d11_qdtd", + "output": [ "privateFeature" ] + }, "combined-angle-lib": { "label": "Combined ANGLE Library", "autoDetect": false, -- cgit v1.2.3