From d5ac97e36fb35761576f25c84372d5c477189a0f Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Thu, 2 Jun 2016 11:22:32 +0200 Subject: Fix font-weight regression Do not override the requested font-weight. This was a wrong rewrite of a now redundant if-statement. Change-Id: I20a745cac02d896fdeaa853f20c6b6647084fceb Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/gui/text/qfontdatabase.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/gui/text/qfontdatabase.cpp b/src/gui/text/qfontdatabase.cpp index c4b849878c..7b88a73c61 100644 --- a/src/gui/text/qfontdatabase.cpp +++ b/src/gui/text/qfontdatabase.cpp @@ -2730,7 +2730,6 @@ void QFontDatabase::load(const QFontPrivate *d, int script) } if (req.pointSize < 0) req.pointSize = req.pixelSize*72.0/d->dpi; - req.weight = QFont::Normal; if (req.stretch == 0) req.stretch = 100; -- cgit v1.2.3 From f8b5142e3068d210393e7e4544c2e63577a313ac Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 2 Jun 2016 10:46:36 -0300 Subject: Fix race condition in tst_QDBusConnection::pendingCallWhenDisconnected MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The test sent a message and hoped that the "delete server" would cause the server object in the QDBusConnectionManager thread be deleted before it could receive and process the message. That's racy, because on some CI machines, it did and then sent back an error reply indicating the object sought was not found. Instead, let's use a child process that we can kill to make it exit at the right time. I've chosen to use dbus-daemon itself, because that lets us test the actual conditions that triggered the original bug: the daemon getting killed during a desktop session shutdown on Linux. Change-Id: I87e17314d8b24ae983b1fffd1454483aea87c921 Reviewed-by: Tony Sarajärvi --- .../dbus/qdbusconnection/tst_qdbusconnection.cpp | 39 +++++++++++++++++----- 1 file changed, 30 insertions(+), 9 deletions(-) diff --git a/tests/auto/dbus/qdbusconnection/tst_qdbusconnection.cpp b/tests/auto/dbus/qdbusconnection/tst_qdbusconnection.cpp index 9b16cf74a5..8dc94d3e07 100644 --- a/tests/auto/dbus/qdbusconnection/tst_qdbusconnection.cpp +++ b/tests/auto/dbus/qdbusconnection/tst_qdbusconnection.cpp @@ -40,6 +40,11 @@ #include #include +#ifdef Q_OS_UNIX +# include +# include +#endif + void MyObject::method(const QDBusMessage &msg) { path = msg.path(); @@ -1357,23 +1362,39 @@ void tst_QDBusConnection::callVirtualObjectLocal() void tst_QDBusConnection::pendingCallWhenDisconnected() { +#ifdef QT_NO_PROCESS + QSKIP("Test requires QProcess"); +#else if (!QCoreApplication::instance()) QSKIP("Test requires a QCoreApplication"); - QDBusServer *server = new QDBusServer; - QDBusConnection con = QDBusConnection::connectToPeer(server->address(), "disconnect"); - QTestEventLoop::instance().enterLoop(2); - QVERIFY(con.isConnected()); - QDBusMessage message = QDBusMessage::createMethodCall("", "/", QString(), "method"); - QDBusPendingCall reply = con.asyncCall(message); + QProcess daemon; + daemon.start("dbus-daemon", QStringList() << "--session" << "--nofork" << "--print-address"); + QVERIFY2(daemon.waitForReadyRead(2000), + "Daemon didn't print its address in time; error: \"" + daemon.errorString().toLocal8Bit() + + "\"; stderr:\n" + daemon.readAllStandardError()); - delete server; + QString address = QString::fromLocal8Bit(daemon.readAll().trimmed()); + QDBusConnection con = QDBusConnection::connectToBus(address, "disconnect"); + QVERIFY2(con.isConnected(), (con.lastError().name() + ": " + con.lastError().message()).toLocal8Bit()); - QTestEventLoop::instance().enterLoop(2); + // confirm we're connected and we're alone in this bus + QCOMPARE(con.baseService(), QString(":1.0")); + + // kill the bus + daemon.terminate(); + daemon.waitForFinished(); + + // send something, which we should get an error with + QDBusMessage message = QDBusMessage::createMethodCall("org.freedesktop.DBus", "/", QString(), "ListNames"); + QDBusPendingCall reply = con.asyncCall(message); + + reply.waitForFinished(); QVERIFY(!con.isConnected()); QVERIFY(reply.isFinished()); QVERIFY(reply.isError()); - QVERIFY(reply.error().type() == QDBusError::Disconnected); + QCOMPARE(reply.error().type(), QDBusError::Disconnected); +#endif } QString MyObject::path; -- cgit v1.2.3 From 62091be85ccfc0d967c73b881d9134a75cb939c9 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Wed, 25 May 2016 17:20:23 +0200 Subject: Fix zero-as-null-pointer-constant in wayland compositor api This gets included by Qt Wayland and will cause warnings there. Change-Id: I3bb470d42ace4e6195d33019f81fa72f3006fc7f Reviewed-by: Alex Blasche Reviewed-by: Joerg Bornemann --- src/gui/kernel/qwindowsysteminterface.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/kernel/qwindowsysteminterface.h b/src/gui/kernel/qwindowsysteminterface.h index 20d560f82e..69c850ad3e 100644 --- a/src/gui/kernel/qwindowsysteminterface.h +++ b/src/gui/kernel/qwindowsysteminterface.h @@ -110,7 +110,7 @@ public: static void handleWheelEvent(QWindow *w, ulong timestamp, const QPointF & local, const QPointF & global, int d, Qt::Orientation o, Qt::KeyboardModifiers mods = Qt::NoModifier); struct TouchPoint { - TouchPoint() : id(0), pressure(0), state(Qt::TouchPointStationary), flags(0) { } + TouchPoint() : id(0), pressure(0), state(Qt::TouchPointStationary) { } int id; // for application use QPointF normalPosition; // touch device coordinates, (0 to 1, 0 to 1) QRectF area; // the touched area, centered at position in screen coordinates @@ -132,7 +132,7 @@ public: // rect is relative to parent static void handleGeometryChange(QWindow *w, const QRect &newRect, const QRect &oldRect = QRect()); - static void handleCloseEvent(QWindow *w, bool *accepted = 0); + static void handleCloseEvent(QWindow *w, bool *accepted = Q_NULLPTR); static void handleEnterEvent(QWindow *w, const QPointF &local = QPointF(), const QPointF& global = QPointF()); static void handleLeaveEvent(QWindow *w); static void handleEnterLeaveEvent(QWindow *enter, QWindow *leave, const QPointF &local = QPointF(), const QPointF& global = QPointF()); -- cgit v1.2.3 From ca434d0c209c692441e775528e657a1ba9c4648d Mon Sep 17 00:00:00 2001 From: Hannah von Reth Date: Fri, 29 Apr 2016 12:42:37 +0200 Subject: Enable testStyleOptionInit for all styles and fix affected styles. Change-Id: I7cb759445342ecb58d5187ddd4a22e41fdea084a Reviewed-by: Marc Mutz --- src/widgets/styles/qfusionstyle.cpp | 3 +-- src/widgets/styles/qgtkstyle.cpp | 7 ++----- src/widgets/styles/qmacstyle_mac.mm | 4 +--- src/widgets/styles/qwindowscestyle.cpp | 6 ++---- src/widgets/styles/qwindowsmobilestyle.cpp | 13 ++++--------- src/widgets/styles/qwindowsstyle.cpp | 3 +-- src/widgets/styles/qwindowsxpstyle.cpp | 3 +-- tests/auto/widgets/styles/qstyle/tst_qstyle.cpp | 9 +++------ 8 files changed, 15 insertions(+), 33 deletions(-) diff --git a/src/widgets/styles/qfusionstyle.cpp b/src/widgets/styles/qfusionstyle.cpp index 5978140f6c..e9e1f349c5 100644 --- a/src/widgets/styles/qfusionstyle.cpp +++ b/src/widgets/styles/qfusionstyle.cpp @@ -2385,8 +2385,7 @@ void QFusionStyle::drawComplexControl(ComplexControl control, const QStyleOption if (!titleBar->icon.isNull()) { titleBar->icon.paint(painter, iconRect); } else { - QStyleOption tool(0); - tool.palette = titleBar->palette; + QStyleOption tool = *titleBar; QPixmap pm = proxy()->standardIcon(SP_TitleBarMenuButton, &tool, widget).pixmap(16, 16); tool.rect = iconRect; painter->save(); diff --git a/src/widgets/styles/qgtkstyle.cpp b/src/widgets/styles/qgtkstyle.cpp index 7ed0dce91d..8597e7c20c 100644 --- a/src/widgets/styles/qgtkstyle.cpp +++ b/src/widgets/styles/qgtkstyle.cpp @@ -1765,8 +1765,7 @@ void QGtkStyle::drawComplexControl(ComplexControl control, const QStyleOptionCom if (!titleBar->icon.isNull()) { titleBar->icon.paint(painter, iconRect); } else { - QStyleOption tool(0); - tool.palette = titleBar->palette; + QStyleOption tool = *titleBar; QPixmap pm = proxy()->standardIcon(SP_TitleBarMenuButton, &tool, widget).pixmap(16, 16); tool.rect = iconRect; painter->save(); @@ -2071,9 +2070,7 @@ void QGtkStyle::drawComplexControl(ComplexControl control, const QStyleOptionCom mflags |= State_MouseOver; } - QStyleOption tool(0); - - tool.palette = toolbutton->palette; + QStyleOption tool = *toolbutton; if (toolbutton->subControls & SC_ToolButton) { if (bflags & (State_Sunken | State_On | State_Raised | State_MouseOver)) { diff --git a/src/widgets/styles/qmacstyle_mac.mm b/src/widgets/styles/qmacstyle_mac.mm index 9f241b6e67..18ba2f45f5 100644 --- a/src/widgets/styles/qmacstyle_mac.mm +++ b/src/widgets/styles/qmacstyle_mac.mm @@ -5978,12 +5978,10 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex #ifndef QT_NO_ACCESSIBILITY if (QStyleHelper::hasAncestor(opt->styleObject, QAccessible::ToolBar)) { if (tb->subControls & SC_ToolButtonMenu) { - QStyleOption arrowOpt(0); + QStyleOption arrowOpt = *tb; arrowOpt.rect = proxy()->subControlRect(cc, tb, SC_ToolButtonMenu, widget); arrowOpt.rect.setY(arrowOpt.rect.y() + arrowOpt.rect.height() / 2); arrowOpt.rect.setHeight(arrowOpt.rect.height() / 2); - arrowOpt.state = tb->state; - arrowOpt.palette = tb->palette; proxy()->drawPrimitive(PE_IndicatorArrowDown, &arrowOpt, p, widget); } else if ((tb->features & QStyleOptionToolButton::HasMenu) && (tb->toolButtonStyle != Qt::ToolButtonTextOnly && !tb->icon.isNull())) { diff --git a/src/widgets/styles/qwindowscestyle.cpp b/src/widgets/styles/qwindowscestyle.cpp index e26925807f..4817bfde3e 100644 --- a/src/widgets/styles/qwindowscestyle.cpp +++ b/src/widgets/styles/qwindowscestyle.cpp @@ -1437,8 +1437,7 @@ void QWindowsCEStyle::drawComplexControl(ComplexControl control, const QStyleOpt if (toolbutton->activeSubControls & SC_ToolButtonMenu) mflags |= State_Sunken; - QStyleOption tool(0); - tool.palette = toolbutton->palette; + QStyleOption tool = *toolbutton; if (toolbutton->subControls & SC_ToolButton) { tool.rect = button; tool.state = bflags; @@ -1620,9 +1619,8 @@ void QWindowsCEStyle::drawComplexControl(ComplexControl control, const QStyleOpt if (cmb->activeSubControls == SC_ComboBoxArrow) flags |= State_Sunken; - QStyleOption arrowOpt(0); + QStyleOption arrowOpt = *cmb; arrowOpt.rect = ar; - arrowOpt.palette = cmb->palette; arrowOpt.state = flags; drawPrimitive(PE_IndicatorArrowDown, &arrowOpt, painter, widget); } diff --git a/src/widgets/styles/qwindowsmobilestyle.cpp b/src/widgets/styles/qwindowsmobilestyle.cpp index e34c2dfe00..b91e647c4b 100644 --- a/src/widgets/styles/qwindowsmobilestyle.cpp +++ b/src/widgets/styles/qwindowsmobilestyle.cpp @@ -6105,8 +6105,7 @@ void QWindowsMobileStyle::drawComplexControl(ComplexControl control, const QStyl buttonFlags |= State_Sunken; if (toolbutton->activeSubControls & SC_ToolButtonMenu) menuFlags |= State_On; - QStyleOption tool(0); - tool.palette = toolbutton->palette; + QStyleOption tool = *toolbutton; if (toolbutton->subControls & SC_ToolButton) { tool.rect = button; tool.state = buttonFlags; @@ -6115,14 +6114,11 @@ void QWindowsMobileStyle::drawComplexControl(ComplexControl control, const QStyl if (toolbutton->subControls & SC_ToolButtonMenu) { tool.rect = menuarea; tool.state = buttonFlags & State_Enabled; - QStyleOption toolMenu(0); - toolMenu = *toolbutton; + QStyleOption toolMenu = *toolbutton; toolMenu.state = menuFlags; if (buttonFlags & State_Sunken) proxy()->drawPrimitive(PE_PanelButtonTool, &toolMenu, painter, widget); - QStyleOption arrowOpt(0); - arrowOpt.rect = tool.rect; - arrowOpt.palette = tool.palette; + QStyleOption arrowOpt = toolMenu; State flags = State_None; if (menuFlags & State_Enabled) flags |= State_Enabled; @@ -6244,9 +6240,8 @@ void QWindowsMobileStyle::drawComplexControl(ComplexControl control, const QStyl flags |= State_Enabled; if (option->state & State_On) flags |= State_Sunken; - QStyleOption arrowOpt(0); + QStyleOption arrowOpt = *cmb; arrowOpt.rect = ar; - arrowOpt.palette = cmb->palette; arrowOpt.state = flags; proxy()->drawPrimitive(PrimitiveElement(PE_IndicatorArrowDownBig), &arrowOpt, painter, widget); if (cmb->subControls & SC_ComboBoxEditField) { diff --git a/src/widgets/styles/qwindowsstyle.cpp b/src/widgets/styles/qwindowsstyle.cpp index ab3c8df256..536ef2d49a 100644 --- a/src/widgets/styles/qwindowsstyle.cpp +++ b/src/widgets/styles/qwindowsstyle.cpp @@ -2164,9 +2164,8 @@ void QWindowsStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComp if (sunkenArrow) flags |= State_Sunken; - QStyleOption arrowOpt(0); + QStyleOption arrowOpt = *cmb; arrowOpt.rect = ar.adjusted(1, 1, -1, -1); - arrowOpt.palette = cmb->palette; arrowOpt.state = flags; proxy()->drawPrimitive(PE_IndicatorArrowDown, &arrowOpt, p, widget); } diff --git a/src/widgets/styles/qwindowsxpstyle.cpp b/src/widgets/styles/qwindowsxpstyle.cpp index e9415f4292..a850787af0 100644 --- a/src/widgets/styles/qwindowsxpstyle.cpp +++ b/src/widgets/styles/qwindowsxpstyle.cpp @@ -3044,8 +3044,7 @@ void QWindowsXPStyle::drawComplexControl(ComplexControl cc, const QStyleOptionCo } } - QStyleOption tool(0); - tool.palette = toolbutton->palette; + QStyleOption tool = *toolbutton; if (toolbutton->subControls & SC_ToolButton) { if (flags & (State_Sunken | State_On | State_Raised) || !autoRaise) { if (toolbutton->features & QStyleOptionToolButton::MenuButtonPopup && autoRaise) { diff --git a/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp b/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp index 46b6fcca82..361a7e7ed4 100644 --- a/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp +++ b/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp @@ -949,17 +949,14 @@ private: void tst_QStyle::testStyleOptionInit() { QStringList keys = QStyleFactory::keys(); - QVector styles; - styles.reserve(keys.size() + 1); - - styles << new QCommonStyle(); + keys.prepend(QString()); // QCommonStyle marker - Q_FOREACH (QStyle *style, styles) { + Q_FOREACH (const QString &key, keys) { + QStyle* style = key.isEmpty() ? new QCommonStyle : QStyleFactory::create(key); TestStyleOptionInitProxy testStyle; testStyle.setBaseStyle(style); testAllFunctions(style); QVERIFY(!testStyle.invalidOptionsDetected); - delete style; } } -- cgit v1.2.3 From 15a76e571926b94de74caa536975327949a14fd7 Mon Sep 17 00:00:00 2001 From: Giuseppe D'Angelo Date: Wed, 4 May 2016 19:46:50 +0200 Subject: QLineEdit: move to the beginning when receiving a MoveToStartOfLine The code dealing with shortcut overrides omitted this value from the checks. If the user had a shortcut installed with a key sequence matching MoveToStartOfLine, then that would result in the line edit not moving the cursor at the beginning of the line (unlike other similar sequences). Change-Id: If2e780068b3139390c79285d2205cc89285ba8b5 Task-number: QTBUG-52796 Reviewed-by: Friedemann Kleint Reviewed-by: Alex Blasche --- src/widgets/widgets/qwidgetlinecontrol.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/widgets/widgets/qwidgetlinecontrol.cpp b/src/widgets/widgets/qwidgetlinecontrol.cpp index 918b6e8c81..daf9f00c46 100644 --- a/src/widgets/widgets/qwidgetlinecontrol.cpp +++ b/src/widgets/widgets/qwidgetlinecontrol.cpp @@ -1533,6 +1533,7 @@ void QWidgetLineControl::processShortcutOverrideEvent(QKeyEvent *ke) || ke == QKeySequence::Undo || ke == QKeySequence::MoveToNextWord || ke == QKeySequence::MoveToPreviousWord + || ke == QKeySequence::MoveToStartOfLine || ke == QKeySequence::MoveToEndOfLine || ke == QKeySequence::MoveToStartOfDocument || ke == QKeySequence::MoveToEndOfDocument -- cgit v1.2.3 From ae0a2fe0410a9574c51d278f8993adaad4f06a33 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 6 Jun 2016 16:17:57 +0200 Subject: Rewrite test tst_QDir::cdBelowRoot() to be data-driven. Limit the macro #ifdefery and allow for more test cases. Task-number: QTBUG-53712 Change-Id: I2c185efc7c3b8fcd0217d2021bd98ab6044b5aee Reviewed-by: Joerg Bornemann --- tests/auto/corelib/io/qdir/tst_qdir.cpp | 63 ++++++++++++++++++--------------- 1 file changed, 35 insertions(+), 28 deletions(-) diff --git a/tests/auto/corelib/io/qdir/tst_qdir.cpp b/tests/auto/corelib/io/qdir/tst_qdir.cpp index ad49678245..90c5a4d907 100644 --- a/tests/auto/corelib/io/qdir/tst_qdir.cpp +++ b/tests/auto/corelib/io/qdir/tst_qdir.cpp @@ -213,6 +213,7 @@ private slots: void cdNonreadable(); + void cdBelowRoot_data(); void cdBelowRoot(); private: @@ -2264,31 +2265,37 @@ void tst_QDir::cdNonreadable() #endif } +void tst_QDir::cdBelowRoot_data() +{ + QTest::addColumn("rootPath"); + QTest::addColumn("cdInto"); + QTest::addColumn("targetPath"); + +#if defined(Q_OS_ANDROID) + QTest::newRow("android") << "/" << "system" << "/system"; +#elif defined(Q_OS_UNIX) + QTest::newRow("unix") << "/" << "tmp" << "/tmp"; +#elif defined(Q_OS_WINRT) + QTest::newRow("winrt") << QDir::rootPath() << QDir::rootPath() << QDir::rootPath(); +#else // Windows+CE + const QString systemDrive = QString::fromLocal8Bit(qgetenv("SystemDrive")) + QLatin1Char('/'); + const QString systemRoot = QString::fromLocal8Bit(qgetenv("SystemRoot")); + QTest::newRow("windows-drive") + << systemDrive << systemRoot.mid(3) << QDir::cleanPath(systemRoot); +#endif // Windows +} + void tst_QDir::cdBelowRoot() { -#if defined (Q_OS_ANDROID) -#define ROOT QString("/") -#define DIR QString("/system") -#define CD_INTO "system" -#elif defined (Q_OS_UNIX) -#define ROOT QString("/") -#define DIR QString("/tmp") -#define CD_INTO "tmp" -#elif defined (Q_OS_WINRT) -#define ROOT QDir::rootPath() -#define DIR QDir::rootPath() -#define CD_INTO QDir::rootPath() -#else -#define ROOT QString::fromLocal8Bit(qgetenv("SystemDrive"))+"/" -#define DIR QString::fromLocal8Bit(qgetenv("SystemRoot")).replace('\\', '/') -#define CD_INTO QString::fromLocal8Bit(qgetenv("SystemRoot")).mid(3) -#endif + QFETCH(QString, rootPath); + QFETCH(QString, cdInto); + QFETCH(QString, targetPath); - QDir root(ROOT); - QVERIFY(!root.cd("..")); - QCOMPARE(root.path(), ROOT); - QVERIFY(root.cd(CD_INTO)); - QCOMPARE(root.path(), DIR); + QDir root(rootPath); + QVERIFY2(!root.cd(".."), qPrintable(root.absolutePath())); + QCOMPARE(root.path(), rootPath); + QVERIFY(root.cd(cdInto)); + QCOMPARE(root.path(), targetPath); #ifdef Q_OS_UNIX if (::getuid() == 0) QSKIP("Running this test as root doesn't make sense"); @@ -2296,13 +2303,13 @@ void tst_QDir::cdBelowRoot() #ifdef Q_OS_WINRT QSKIP("WinRT has no concept of system root"); #endif - QDir dir(DIR); - QVERIFY(!dir.cd("../..")); - QCOMPARE(dir.path(), DIR); - QVERIFY(!dir.cd("../abs/../..")); - QCOMPARE(dir.path(), DIR); + QDir dir(targetPath); + QVERIFY2(!dir.cd("../.."), qPrintable(dir.absolutePath())); + QCOMPARE(dir.path(), targetPath); + QVERIFY2(!dir.cd("../abs/../.."), qPrintable(dir.absolutePath())); + QCOMPARE(dir.path(), targetPath); QVERIFY(dir.cd("..")); - QCOMPARE(dir.path(), ROOT); + QCOMPARE(dir.path(), rootPath); } QTEST_MAIN(tst_QDir) -- cgit v1.2.3 From df3f685826d0baf8b68e9a01ee44749abbac8ecf Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 7 Jun 2016 11:18:00 +0200 Subject: tst_QFileSystemModel: Remove Win32LongFileName(). Modern SSD drives no longer have short file names enabled, causing the test to fail. Task-number: QTBUG-29403 Change-Id: I2e9866d8f8a6ed3df9d2dc6630b8cfa47ade0728 Reviewed-by: Joerg Bornemann --- .../dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp b/tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp index b27943f071..af92f0735d 100644 --- a/tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp +++ b/tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp @@ -109,10 +109,6 @@ private slots: void caseSensitivity(); -#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) - void Win32LongFileName(); -#endif - void drives_data(); void drives(); void dirsBeforeFiles(); @@ -932,20 +928,6 @@ void tst_QFileSystemModel::caseSensitivity() } } -#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) -void tst_QFileSystemModel::Win32LongFileName() -{ - QString tmp = flatDirTestPath; - QStringList files; - files << "aaaaaaaaaa" << "bbbbbbbbbb" << "cccccccccc"; - QVERIFY(createFiles(tmp, files)); - QModelIndex root = model->setRootPath(tmp); - QTRY_VERIFY(model->index(tmp + QLatin1String("/aaaaaa~1")).isValid()); - QTRY_VERIFY(model->index(tmp + QLatin1String("/bbbbbb~1")).isValid()); - QTRY_VERIFY(model->index(tmp + QLatin1String("/cccccc~1")).isValid()); -} -#endif - void tst_QFileSystemModel::drives_data() { QTest::addColumn("path"); -- cgit v1.2.3 From 8339b557e48c17104c0ef2214130c2c0ade068b2 Mon Sep 17 00:00:00 2001 From: Ralf Nolden Date: Tue, 7 Jun 2016 15:00:46 +0200 Subject: NetBSD: simplify mkspec and match supported OS versions (6.x-7.x) By using common/gcc-base-unix.conf and common/g++-unix.conf most of the mkspec details can go, leaving us with a minimized qmake.conf. Change the default X11 location to point to /usr/X11R7 after NetBSD switched to X.org in Release 5.0 by default. Also change the default location for addon software on NetBSD, it uses pkgsrc as its ports system which installs to /usr/pkg by default (the default value for $LOCALBASE of pkgsrc on NetBSD), see https://www.netbsd.org/docs/pkgsrc/using.html chapter 4.1. These default values mirror the current state of NetBSD usage to get the prerequisites to compile Qt with a minimum amount of configure parameters. Tested with NetBSD 7.0 using gcc 4.8.4-nb2 (system compiler) Change-Id: Ic50757af9f070c0383c7356302e7e7686f031740 Reviewed-by: Thiago Macieira --- mkspecs/netbsd-g++/qmake.conf | 55 +++++++------------------------------------ 1 file changed, 9 insertions(+), 46 deletions(-) diff --git a/mkspecs/netbsd-g++/qmake.conf b/mkspecs/netbsd-g++/qmake.conf index b470c9d08a..ddd82326af 100644 --- a/mkspecs/netbsd-g++/qmake.conf +++ b/mkspecs/netbsd-g++/qmake.conf @@ -6,58 +6,21 @@ MAKEFILE_GENERATOR = UNIX QMAKE_PLATFORM = netbsd bsd include(../common/unix.conf) +include(../common/gcc-base-unix.conf) +include(../common/g++-unix.conf) -QMAKE_COMPILER = gcc - -QMAKE_CC = gcc -QMAKE_LEX = flex -QMAKE_LEXFLAGS = -QMAKE_YACC = yacc -QMAKE_YACCFLAGS = -d -QMAKE_CFLAGS = -pipe -QMAKE_CFLAGS_DEPS = -M -QMAKE_CFLAGS_WARN_ON = -Wall -W -QMAKE_CFLAGS_WARN_OFF = -w -QMAKE_CFLAGS_RELEASE = -O2 -QMAKE_CFLAGS_DEBUG = -g -QMAKE_CFLAGS_SHLIB = -fPIC -QMAKE_CFLAGS_STATIC_LIB = $$QMAKE_CFLAGS_SHLIB -QMAKE_CFLAGS_YACC = -Wno-unused -Wno-parentheses QMAKE_CFLAGS_THREAD = -pthread -QMAKE_CXX = g++ -QMAKE_CXXFLAGS = $$QMAKE_CFLAGS -QMAKE_CXXFLAGS_DEPS = $$QMAKE_CFLAGS_DEPS -QMAKE_CXXFLAGS_WARN_ON = $$QMAKE_CFLAGS_WARN_ON -QMAKE_CXXFLAGS_WARN_OFF = $$QMAKE_CFLAGS_WARN_OFF -QMAKE_CXXFLAGS_RELEASE = $$QMAKE_CFLAGS_RELEASE -QMAKE_CXXFLAGS_DEBUG = $$QMAKE_CFLAGS_DEBUG -QMAKE_CXXFLAGS_SHLIB = $$QMAKE_CFLAGS_SHLIB -QMAKE_CXXFLAGS_STATIC_LIB = $$QMAKE_CFLAGS_STATIC_LIB -QMAKE_CXXFLAGS_YACC = $$QMAKE_CFLAGS_YACC QMAKE_CXXFLAGS_THREAD = $$QMAKE_CFLAGS_THREAD -QMAKE_INCDIR = /usr/local/include -QMAKE_LIBDIR = /usr/local/lib -QMAKE_INCDIR_X11 = /usr/X11R6/include -QMAKE_LIBDIR_X11 = /usr/X11R6/lib -QMAKE_INCDIR_OPENGL = /usr/X11R6/include -QMAKE_LIBDIR_OPENGL = /usr/X11R6/lib +QMAKE_INCDIR = /usr/pkg/include +QMAKE_LIBDIR = /usr/pkg/lib +QMAKE_INCDIR_X11 = /usr/X11R7/include +QMAKE_LIBDIR_X11 = /usr/X11R7/lib +QMAKE_INCDIR_OPENGL = /usr/X11R7/include +QMAKE_LIBDIR_OPENGL = /usr/X11R7/lib -QMAKE_LINK = g++ -QMAKE_LINK_SHLIB = g++ -QMAKE_LINK_C = gcc -QMAKE_LINK_C_SHLIB = gcc -QMAKE_LINK_SHLIB_CMD = $$QMAKE_LINK_SHLIB $$QMAKE_LFLAGS_SHLIB $(LFLAGS) $$QMAKE_LFLAGS -o $(TARGETD) $(OBJECTS) $(OBJMOC) $(LIBS) -QMAKE_LFLAGS = -QMAKE_LFLAGS_RELEASE = -QMAKE_LFLAGS_DEBUG = -QMAKE_LFLAGS_SHLIB = -shared -QMAKE_LFLAGS_PLUGIN = $$QMAKE_LFLAGS_SHLIB -QMAKE_LFLAGS_SONAME = -Wl,-soname, QMAKE_LFLAGS_THREAD = -pthread -QMAKE_LFLAGS_NOUNDEF = -Wl,-no_unresolved -QMAKE_LFLAGS_RPATH = -Wl,-rpath, QMAKE_LIBS = QMAKE_LIBS_DYNLOAD = @@ -69,6 +32,6 @@ QMAKE_LIBS_THREAD = QMAKE_AR = ar cqs QMAKE_OBJCOPY = objcopy QMAKE_NM = nm -P -QMAKE_RANLIB = ranlib +QMAKE_RANLIB = load(qt_config) -- cgit v1.2.3 From 1b22aeda5bfac43ac37d835adb60eeb3cc01aab6 Mon Sep 17 00:00:00 2001 From: Ralf Nolden Date: Tue, 7 Jun 2016 14:51:11 +0200 Subject: OpenBSD: simplify mkspec and match ports By using commmon/gcc-base-unix.conf and common/g++-unix.conf most of the contents of the qmake.conf for OpenBSD can go. The QMAKE_LFLAGS_UNDEF are reset because the linker can't handle environ in libraries, which is only added to libc in OpenBSD 6 (http://www.openbsd.org/faq/current.html) even when explicitly adding -lc to QMAKE_LIBS. See http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20151102/309783.html for similar questions on using -Wl,-z,defs instead. Change-Id: I6c725fb3bc7ae63270912b07f230a480c9157dfd Reviewed-by: Oswald Buddenhagen Reviewed-by: Thiago Macieira --- mkspecs/openbsd-g++/qmake.conf | 47 +++++------------------------------------- 1 file changed, 5 insertions(+), 42 deletions(-) diff --git a/mkspecs/openbsd-g++/qmake.conf b/mkspecs/openbsd-g++/qmake.conf index 6a66f086ed..9b280891df 100644 --- a/mkspecs/openbsd-g++/qmake.conf +++ b/mkspecs/openbsd-g++/qmake.conf @@ -6,35 +6,11 @@ MAKEFILE_GENERATOR = UNIX QMAKE_PLATFORM = openbsd bsd include(../common/unix.conf) +include(../common/gcc-base-unix.conf) +include(../common/g++-unix.conf) -QMAKE_COMPILER = gcc - -QMAKE_CC = gcc -QMAKE_LEX = flex -QMAKE_LEXFLAGS = -QMAKE_YACC = yacc -QMAKE_YACCFLAGS = -d -QMAKE_CFLAGS = -pipe -QMAKE_CFLAGS_DEPS = -M -QMAKE_CFLAGS_WARN_ON = -Wall -W -QMAKE_CFLAGS_WARN_OFF = -w -QMAKE_CFLAGS_RELEASE = -O2 -QMAKE_CFLAGS_DEBUG = -g -QMAKE_CFLAGS_SHLIB = -fPIC -QMAKE_CFLAGS_STATIC_LIB = $$QMAKE_CFLAGS_SHLIB -QMAKE_CFLAGS_YACC = -Wno-unused -Wno-parentheses QMAKE_CFLAGS_THREAD = -pthread -QMAKE_CXX = g++ -QMAKE_CXXFLAGS = $$QMAKE_CFLAGS -QMAKE_CXXFLAGS_DEPS = $$QMAKE_CFLAGS_DEPS -QMAKE_CXXFLAGS_WARN_ON = $$QMAKE_CFLAGS_WARN_ON -QMAKE_CXXFLAGS_WARN_OFF = $$QMAKE_CFLAGS_WARN_OFF -QMAKE_CXXFLAGS_RELEASE = $$QMAKE_CFLAGS_RELEASE -QMAKE_CXXFLAGS_DEBUG = $$QMAKE_CFLAGS_DEBUG -QMAKE_CXXFLAGS_SHLIB = $$QMAKE_CFLAGS_SHLIB -QMAKE_CXXFLAGS_STATIC_LIB = $$QMAKE_CFLAGS_STATIC_LIB -QMAKE_CXXFLAGS_YACC = $$QMAKE_CFLAGS_YACC QMAKE_CXXFLAGS_THREAD = $$QMAKE_CFLAGS_THREAD QMAKE_INCDIR = /usr/local/include @@ -44,21 +20,8 @@ QMAKE_LIBDIR_X11 = /usr/X11R6/lib QMAKE_INCDIR_OPENGL = /usr/X11R6/include QMAKE_LIBDIR_OPENGL = /usr/X11R6/lib -QMAKE_LINK = g++ -QMAKE_LINK_SHLIB = g++ -QMAKE_LINK_C = gcc -QMAKE_LINK_C_SHLIB = gcc -QMAKE_LINK_SHLIB_CMD = $$QMAKE_LINK_SHLIB $(LFLAGS) \ - $$QMAKE_CFLAGS_SHLIB $$QMAKE_LFLAGS \ - -o $(TARGETD) $(OBJECTS) $(OBJMOC) $(LIBS) -QMAKE_LFLAGS = -QMAKE_LFLAGS_RELEASE = -QMAKE_LFLAGS_DEBUG = -QMAKE_LFLAGS_SHLIB = -shared -QMAKE_LFLAGS_PLUGIN = $$QMAKE_LFLAGS_SHLIB -QMAKE_LFLAGS_SONAME = -Wl,-soname, QMAKE_LFLAGS_THREAD = -pthread -QMAKE_LFLAGS_NOUNDEF = -Wl,-no_unresolved +QMAKE_LFLAGS_NOUNDEF = QMAKE_LIBS = QMAKE_LIBS_DYNLOAD = @@ -67,9 +30,9 @@ QMAKE_LIBS_X11 = -lXext -lX11 -lm QMAKE_LIBS_OPENGL = -lGL QMAKE_LIBS_THREAD = -QMAKE_AR = ar q +QMAKE_AR = ar cqs QMAKE_OBJCOPY = objcopy QMAKE_NM = nm -P -QMAKE_RANLIB = ranlib +QMAKE_RANLIB = load(qt_config) -- cgit v1.2.3 From 4ea95609ccd9694dac466cae689412024c87e56e Mon Sep 17 00:00:00 2001 From: Ralf Nolden Date: Tue, 7 Jun 2016 11:02:10 +0200 Subject: FreeBSD: remove -D_THREAD_SAFE from pthread usage On FreeBSD, the gcc manpages until Release 5.1 mentioned using the -D_THREAD_SAFE define when using -pthread. This has been obsoleted and the gcc manpages from Release 5.2 onwards have this removed. Now we finally remove this historic relic here, too. Change-Id: I00a5b688c56f46b938c0806fb44b72d5afe5079e Reviewed-by: Oswald Buddenhagen Reviewed-by: Thiago Macieira --- mkspecs/freebsd-clang/qmake.conf | 2 +- mkspecs/freebsd-g++/qmake.conf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mkspecs/freebsd-clang/qmake.conf b/mkspecs/freebsd-clang/qmake.conf index 7f18bbb721..0d6401f2f5 100644 --- a/mkspecs/freebsd-clang/qmake.conf +++ b/mkspecs/freebsd-clang/qmake.conf @@ -7,7 +7,7 @@ QMAKE_PLATFORM = freebsd bsd include(../common/unix.conf) -QMAKE_CFLAGS_THREAD = -pthread -D_THREAD_SAFE +QMAKE_CFLAGS_THREAD = -pthread QMAKE_CXXFLAGS_THREAD = $$QMAKE_CFLAGS_THREAD diff --git a/mkspecs/freebsd-g++/qmake.conf b/mkspecs/freebsd-g++/qmake.conf index 282b6bdfa7..56529389f6 100644 --- a/mkspecs/freebsd-g++/qmake.conf +++ b/mkspecs/freebsd-g++/qmake.conf @@ -7,7 +7,7 @@ QMAKE_PLATFORM = freebsd bsd include(../common/unix.conf) -QMAKE_CFLAGS_THREAD = -pthread -D_THREAD_SAFE +QMAKE_CFLAGS_THREAD = -pthread QMAKE_CXXFLAGS_THREAD = $$QMAKE_CFLAGS_THREAD -- cgit v1.2.3 From 37ef6b4968b93859df0af13b228b4abb3a0ef2c1 Mon Sep 17 00:00:00 2001 From: Ralf Nolden Date: Mon, 6 Jun 2016 12:00:11 +0200 Subject: OpenBSD: use clock_gettime() provided by OS The use of clock_gettime() is limited to systems having _POSIX_TIMERS defined, however OpenBSD implements clock_gettime() but does not have the posix define. Enable using clock_gettime() on OpenBSD as well. Change-Id: I785954fe61b42b15755ca625a766c9a95179ae8d Reviewed-by: Thiago Macieira --- config.tests/unix/clock-gettime/clock-gettime.cpp | 2 +- src/concurrent/qtconcurrentiteratekernel.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config.tests/unix/clock-gettime/clock-gettime.cpp b/config.tests/unix/clock-gettime/clock-gettime.cpp index 4ba05f70f5..a49359d24c 100644 --- a/config.tests/unix/clock-gettime/clock-gettime.cpp +++ b/config.tests/unix/clock-gettime/clock-gettime.cpp @@ -36,7 +36,7 @@ int main(int, char **) { -#if defined(_POSIX_TIMERS) && (_POSIX_TIMERS > 0) +#if (defined(_POSIX_TIMERS) && (_POSIX_TIMERS > 0)) || defined(__OpenBSD__) timespec ts; clock_gettime(CLOCK_REALTIME, &ts); #else diff --git a/src/concurrent/qtconcurrentiteratekernel.cpp b/src/concurrent/qtconcurrentiteratekernel.cpp index 3b9b186b39..1925f71c8b 100644 --- a/src/concurrent/qtconcurrentiteratekernel.cpp +++ b/src/concurrent/qtconcurrentiteratekernel.cpp @@ -71,7 +71,7 @@ static qint64 getticks() static qint64 getticks() { -#if defined(_POSIX_TIMERS) && (_POSIX_TIMERS > 0) +#if (defined(_POSIX_TIMERS) && (_POSIX_TIMERS > 0)) || defined(Q_OS_OPENBSD) clockid_t clockId; #ifndef _POSIX_THREAD_CPUTIME -- cgit v1.2.3 From 6db053139ef1dfedd1bcec613be9f691bc8d9470 Mon Sep 17 00:00:00 2001 From: Ralf Nolden Date: Sun, 5 Jun 2016 21:41:02 +0200 Subject: Delete unsupported/freebsd-g++-46 mkspec The freebsd-g++46 mkspec was intended to specifically use gcc 4.6 from FreeBSD ports collection. However, the ports collection moves its "standard" gcc version and uses symlinks to the standard commands (e.g. gcc -> gcc48) on installing gcc. The current gcc in ports is 4.8.5, so the mkspec is not useful at all. Change-Id: I041325d05c7dc3f47f4a774d6f46ba24a601bf3e Reviewed-by: Thiago Macieira --- mkspecs/unsupported/freebsd-g++46/qmake.conf | 44 ----------------------- mkspecs/unsupported/freebsd-g++46/qplatformdefs.h | 34 ------------------ 2 files changed, 78 deletions(-) delete mode 100644 mkspecs/unsupported/freebsd-g++46/qmake.conf delete mode 100644 mkspecs/unsupported/freebsd-g++46/qplatformdefs.h diff --git a/mkspecs/unsupported/freebsd-g++46/qmake.conf b/mkspecs/unsupported/freebsd-g++46/qmake.conf deleted file mode 100644 index 11041dee3d..0000000000 --- a/mkspecs/unsupported/freebsd-g++46/qmake.conf +++ /dev/null @@ -1,44 +0,0 @@ -# -# qmake configuration for freebsd-g++46 (using g++46 from ports/lang/gcc) -# - -MAKEFILE_GENERATOR = UNIX -QMAKE_PLATFORM = freebsd bsd - -include(../../common/unix.conf) - -QMAKE_CFLAGS_THREAD = -pthread -D_THREAD_SAFE - -QMAKE_CXXFLAGS_THREAD = $$QMAKE_CFLAGS_THREAD - -# Addon software goes into /usr/local on the BSDs, by default we will look there -QMAKE_INCDIR = /usr/local/include -QMAKE_LIBDIR = /usr/local/lib - -QMAKE_LFLAGS_THREAD = -pthread - -QMAKE_LIBS = -QMAKE_LIBS_DYNLOAD = -QMAKE_LIBS_EXECINFO = -lexecinfo -QMAKE_LIBS_X11 = -lXext -lX11 -lm -QMAKE_LIBS_OPENGL = -lGL -QMAKE_LIBS_THREAD = - -QMAKE_AR = ar cqs -QMAKE_OBJCOPY = objcopy -QMAKE_NM = nm -P -QMAKE_RANLIB = - -include(../../common/gcc-base-unix.conf) -include(../../common/g++-unix.conf) - -# Redefined here because g++-base.conf sets QMAKE_CC and QMAKE_CXX -# to gcc and g++, respectively. -QMAKE_CC = gcc46 -QMAKE_CXX = g++46 -QMAKE_LINK_C = $$QMAKE_CC -QMAKE_LINK_C_SHLIB = $$QMAKE_CC -QMAKE_LINK = $$QMAKE_CXX -QMAKE_LINK_SHLIB = $$QMAKE_CXX - -load(qt_config) diff --git a/mkspecs/unsupported/freebsd-g++46/qplatformdefs.h b/mkspecs/unsupported/freebsd-g++46/qplatformdefs.h deleted file mode 100644 index b52be38b4e..0000000000 --- a/mkspecs/unsupported/freebsd-g++46/qplatformdefs.h +++ /dev/null @@ -1,34 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the qmake spec of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL21$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://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 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "../../freebsd-clang/qplatformdefs.h" -- cgit v1.2.3 From a914003c8286c5145f437723d8d280cc854d4275 Mon Sep 17 00:00:00 2001 From: Ralf Nolden Date: Sun, 5 Jun 2016 21:19:17 +0200 Subject: Remove OpenBSD _POSIX_THREAD_SAFE_FUNCTIONS undefine The qplatformdefs.h for OpenBSD included an undefine of _POSIX_THREAD_SAFE_FUNCTIONS because of (at the time) missing implementations of the required _r() functions. After checking these functions http://www.unix.org/whitepapers/reentrant.html against the OpenBSD man pages http://man.openbsd.org/OpenBSD-4.4/cat3/getpwuid_r.0 they are all complete with OpenBSD 4.4 released in 2008. As OpenBSD only supports the current and the last release before (5.8 and 5.9 now), it is safe to assume that this undefine can go away now for sure. Change-Id: I341bcae77d1bd7249ac3fdeaefce9c5eb595eca7 Reviewed-by: Thiago Macieira --- mkspecs/openbsd-g++/qplatformdefs.h | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/mkspecs/openbsd-g++/qplatformdefs.h b/mkspecs/openbsd-g++/qplatformdefs.h index 4ec9c6bb2f..bd6996c242 100644 --- a/mkspecs/openbsd-g++/qplatformdefs.h +++ b/mkspecs/openbsd-g++/qplatformdefs.h @@ -80,21 +80,6 @@ #define QT_SNPRINTF ::snprintf #define QT_VSNPRINTF ::vsnprintf -// 1003.1c-1995 says on page 38 (2.9.3, paragraph 3) that if _POSIX_THREADS -// is defined, then _POSIX_THREAD_SAFE_FUNCTIONS must also be defined. -// However this looks like a well-known typo (reversed dependency). -// -// On the other hand _POSIX_THREAD_SAFE_FUNCTIONS should be defined only -// if the Thread-Safe Functions option is implemented. OpenBSD does not -// support all of the required _r() interfaces, especially getpwuid_r(), -// which means it should not define _POSIX_THREAD_SAFE_FUNCTIONS. -// -// Since OpenBSD does define _POSIX_THREAD_SAFE_FUNCTIONS, we have to -// undefine it behind its back. -#ifdef _POSIX_THREAD_SAFE_FUNCTIONS -#undef _POSIX_THREAD_SAFE_FUNCTIONS -#endif - // Older OpenBSD versions may still use the a.out format instead of ELF. #ifndef __ELF__ #define QT_AOUT_UNDERSCORE -- cgit v1.2.3 From 76810e1495b65a09e9abd6164639e0caf34d61b8 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Fri, 20 May 2016 14:52:18 +0200 Subject: xcb: Disable GLX pbuffers with Chromium in VMs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I474e4a4ce424a92b46381eb26aeda811ed059819 Task-number: QTCREATORBUG-16252 Task-number: QTCREATORBUG-14937 Reviewed-by: Błażej Szczygieł Reviewed-by: Gatis Paeglis --- .../platforms/xcb/gl_integrations/xcb_glx/qxcbglxintegration.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxintegration.cpp b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxintegration.cpp index a3a8aa259b..55d0ff38b7 100644 --- a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxintegration.cpp +++ b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxintegration.cpp @@ -201,8 +201,10 @@ QPlatformOffscreenSurface *QXcbGlxIntegration::createPlatformOffscreenSurface(QO display = static_cast(m_connection->xlib_display()); #endif const char *glxvendor = glXGetClientString(display, GLX_VENDOR); - if (glxvendor && !strcmp(glxvendor, "ATI")) - glxPbufferUsable = false; + if (glxvendor) { + if (!strcmp(glxvendor, "ATI") || !strcmp(glxvendor, "Chromium")) + glxPbufferUsable = false; + } } if (glxPbufferUsable) return new QGLXPbuffer(surface); -- cgit v1.2.3 From f9c60038bf098015172998c2a216dd02672cd96b Mon Sep 17 00:00:00 2001 From: Alejandro Exojo Date: Sun, 8 May 2016 17:34:26 +0200 Subject: Fix QVariantAnimation documentation Since 5.0, this class is not abstract. Only the documentation of updateCurrentValue was updated at that time. Fix the class reference and the mentions of the class being abstract in the Animation Framework overview. Change-Id: I8ef9accb0b870dc8eb75bfc74361c7f2ad8d1d8b Reviewed-by: Venugopal Shivashankar Reviewed-by: Frederik Gladhorn --- src/corelib/animation/qvariantanimation.cpp | 6 ++---- src/corelib/doc/src/animation.qdoc | 11 ++++++----- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/corelib/animation/qvariantanimation.cpp b/src/corelib/animation/qvariantanimation.cpp index 1322b8c810..d2545bfb88 100644 --- a/src/corelib/animation/qvariantanimation.cpp +++ b/src/corelib/animation/qvariantanimation.cpp @@ -48,15 +48,13 @@ QT_BEGIN_NAMESPACE \class QVariantAnimation \inmodule QtCore \ingroup animation - \brief The QVariantAnimation class provides an abstract base class for animations. + \brief The QVariantAnimation class provides a base class for animations. \since 4.6 This class is part of \l{The Animation Framework}. It serves as a base class for property and item animations, with functions for shared functionality. - QVariantAnimation cannot be used directly as it is an abstract - class; it has a pure virtual method called updateCurrentValue(). The class performs interpolation over \l{QVariant}s, but leaves using the interpolated values to its subclasses. Currently, Qt provides QPropertyAnimation, which @@ -69,7 +67,7 @@ QT_BEGIN_NAMESPACE start the animation. QVariantAnimation will interpolate the property of the target object and emit valueChanged(). To react to a change in the current value you have to reimplement the - updateCurrentValue() virtual function. + updateCurrentValue() virtual function or connect to said signal. It is also possible to set values at specified steps situated between the start and end value. The interpolation will then diff --git a/src/corelib/doc/src/animation.qdoc b/src/corelib/doc/src/animation.qdoc index e5e67cf503..304eb9d112 100644 --- a/src/corelib/doc/src/animation.qdoc +++ b/src/corelib/doc/src/animation.qdoc @@ -118,11 +118,12 @@ \section1 Animating Qt Properties - As mentioned in the previous section, the QPropertyAnimation class - can interpolate over Qt properties. It is this class that should - be used for animation of values; in fact, its superclass, - QVariantAnimation, is an abstract class, and cannot be used - directly. + As mentioned in the previous section, the QPropertyAnimation class can + interpolate over Qt properties. It is often this class that should be used + for animation of values; in fact, its superclass, QVariantAnimation, has an + empty implementation of \l{QAbstractAnimation::}{updateCurrentValue()}, and + does not change any value unless we change it ourselves on the + \l{QVariantAnimation::valueChanged()}{valueChanged signal}. A major reason we chose to animate Qt properties is that it presents us with freedom to animate already existing classes in -- cgit v1.2.3 From 862fa24179505ef725ff78bb64bdabd54bd00c95 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Fri, 20 May 2016 23:56:19 +0200 Subject: Optimize QJsonObject::operator== The old code iterated through one QJsonObject and looked up the key in the other, comparing the values. It had linearithmic complexity, and created one QString 'key' per element. Since the entries in a QJsonObject are lexicographically ordered, we can, however, just walk through the two objects in lock-step and compare corresponding entries (at the same index) with each other. Doing so saves O(N) QString creations and QJsonObject::value() calls, and makes operator== linear in the number of elements. Change-Id: Ib46ee0c1008b7f114454e282b6bd2bfcdbe59e2a Reviewed-by: Thiago Macieira Reviewed-by: Lars Knoll --- src/corelib/json/qjson_p.h | 2 ++ src/corelib/json/qjsonobject.cpp | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/corelib/json/qjson_p.h b/src/corelib/json/qjson_p.h index c52a37ba2b..b7de24d165 100644 --- a/src/corelib/json/qjson_p.h +++ b/src/corelib/json/qjson_p.h @@ -670,6 +670,8 @@ public: bool operator >=(const Entry &other) const; }; +inline bool operator!=(const Entry &lhs, const Entry &rhs) { return !(lhs == rhs); } + inline bool Entry::operator >=(const QString &key) const { if (value.latinKey) diff --git a/src/corelib/json/qjsonobject.cpp b/src/corelib/json/qjsonobject.cpp index b83c8dd19a..f5fd76eac0 100644 --- a/src/corelib/json/qjsonobject.cpp +++ b/src/corelib/json/qjsonobject.cpp @@ -545,8 +545,8 @@ bool QJsonObject::operator==(const QJsonObject &other) const for (uint i = 0; i < o->length; ++i) { QJsonPrivate::Entry *e = o->entryAt(i); - QJsonValue v(d, o, e->value); - if (other.value(e->key()) != v) + QJsonPrivate::Entry *oe = other.o->entryAt(i); + if (*e != *oe || QJsonValue(d, o, e->value) != QJsonValue(other.d, other.o, oe->value)) return false; } -- cgit v1.2.3 From 5f3a262a7377c33383594d4ab52e66b987316d70 Mon Sep 17 00:00:00 2001 From: Martin Porcelli Date: Tue, 1 Mar 2016 12:10:04 -0800 Subject: QSslSocket: Data is sent after a certificate is downloaded on Windows. QSslSocket was not transmitting existing data after finishing its handshake if it had to download a certificate on Windows. Task-number: QTBUG-48816 Change-Id: Ie35b5f4ca0f6c3c40fe2394166eb31f9f72dac55 Reviewed-by: Timur Pocheptsov Reviewed-by: Edward Welbourne Reviewed-by: Richard J. Moore --- src/network/ssl/qsslsocket_openssl.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/network/ssl/qsslsocket_openssl.cpp b/src/network/ssl/qsslsocket_openssl.cpp index 9df0c693ab..57cedf2c22 100644 --- a/src/network/ssl/qsslsocket_openssl.cpp +++ b/src/network/ssl/qsslsocket_openssl.cpp @@ -1368,8 +1368,12 @@ void QSslSocketBackendPrivate::_q_caRootLoaded(QSslCertificate cert, QSslCertifi if (plainSocket) plainSocket->resume(); paused = false; - if (checkSslErrors() && ssl) + if (checkSslErrors() && ssl) { + bool willClose = (autoStartHandshake && pendingClose); continueHandshake(); + if (!willClose) + transmit(); + } } class QWindowsCaRootFetcherThread : public QThread -- cgit v1.2.3 From 4fb2b7411994852b742f944eba9d71d7d851aca5 Mon Sep 17 00:00:00 2001 From: Ralf Nolden Date: Sun, 5 Jun 2016 20:12:28 +0200 Subject: Remove a.out defines in OpenBSD and NetBSD mkspec OpenBSD made the switch from a.out to ELF with release 3.4, published 2003, see http://www.openbsd.org/34.html. In preparation to cleaning up the mkspecs for OpenBSD, remove the a.out defines as only recent versions of OpenBSD (5.8 onward) will be supported. NetBSD switched from a.out to ELF file format with release 1.5, see https://www.netbsd.org/releases/formal-1.5/NetBSD-1.5.html in the year 2000. Remove the defines for older a.out systems now as we are at release 7.0 and only 6.0 onwards releases are currently supported anyway. While cleaning up, remove the old comments for QT_SOCKLEN_T values of outdated OpenBSD and NetBSD releases as well. Change-Id: I8519eab7bcd4af19c0e9f628657878f32b2bd602 Reviewed-by: Thiago Macieira --- mkspecs/netbsd-g++/qplatformdefs.h | 9 --------- mkspecs/openbsd-g++/qplatformdefs.h | 9 --------- 2 files changed, 18 deletions(-) diff --git a/mkspecs/netbsd-g++/qplatformdefs.h b/mkspecs/netbsd-g++/qplatformdefs.h index b6639b97c2..bcba448e2c 100644 --- a/mkspecs/netbsd-g++/qplatformdefs.h +++ b/mkspecs/netbsd-g++/qplatformdefs.h @@ -72,16 +72,7 @@ #undef QT_OPEN_LARGEFILE #define QT_OPEN_LARGEFILE 0 -// QT_SOCKLEN_T -// NetBSD 1.0 - 1.3.3 int -// NetBSD 1.4 - 1.5 socklen_t - #define QT_SNPRINTF ::snprintf #define QT_VSNPRINTF ::vsnprintf -// Older NetBSD versions may still use the a.out format instead of ELF. -#ifndef __ELF__ -#define QT_AOUT_UNDERSCORE -#endif - #endif // QPLATFORMDEFS_H diff --git a/mkspecs/openbsd-g++/qplatformdefs.h b/mkspecs/openbsd-g++/qplatformdefs.h index bd6996c242..5776654121 100644 --- a/mkspecs/openbsd-g++/qplatformdefs.h +++ b/mkspecs/openbsd-g++/qplatformdefs.h @@ -73,16 +73,7 @@ #undef QT_OPEN_LARGEFILE #define QT_OPEN_LARGEFILE 0 -// QT_SOCKLEN_T -// OpenBSD 2.2 - 2.4 int -// OpenBSD 2.5 - 2.8 socklen_t - #define QT_SNPRINTF ::snprintf #define QT_VSNPRINTF ::vsnprintf -// Older OpenBSD versions may still use the a.out format instead of ELF. -#ifndef __ELF__ -#define QT_AOUT_UNDERSCORE -#endif - #endif // QPLATFORMDEFS_H -- cgit v1.2.3 From 5a15545ee274a9caa33014755a3fdb7022c7ea8c Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Wed, 8 Jun 2016 10:01:51 +0200 Subject: QDebug: fix streaming of QChars MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Commit 9ef3ff30 introduced a new function, putUcs4(), to output QChar, char16_t, char32_t as a, possibly escaped, character literal, but got the order of stream modifiers wrong. Instead of applying the field width to the 'ucs' streaming, it applied it to the prefix '\u'. The same problem exists for the pad char, leading to the result '00\ue4' for a QChar containing ä (LATIN SMALL LETTER A WITH DIAERESIS) Fix by reordering the elements streamed so that the prefixes come last. Added a test. Change-Id: I6eaa0586501b9e780aaa3bb5dcec0e5c2f86a219 Reviewed-by: Thiago Macieira --- src/corelib/io/qdebug.cpp | 9 ++++----- tests/auto/corelib/io/qdebug/tst_qdebug.cpp | 6 +++--- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/corelib/io/qdebug.cpp b/src/corelib/io/qdebug.cpp index 81af96b96b..a1d7d9806d 100644 --- a/src/corelib/io/qdebug.cpp +++ b/src/corelib/io/qdebug.cpp @@ -160,16 +160,15 @@ void QDebug::putUcs4(uint ucs4) { maybeQuote('\''); if (ucs4 < 0x20) { - stream->ts << hex << "\\x" << ucs4 << reset; + stream->ts << "\\x" << hex << ucs4 << reset; } else if (ucs4 < 0x80) { stream->ts << char(ucs4); } else { - stream->ts << hex << qSetPadChar(QLatin1Char('0')); if (ucs4 < 0x10000) - stream->ts << qSetFieldWidth(4) << "\\u"; + stream->ts << "\\u" << qSetFieldWidth(4); else - stream->ts << qSetFieldWidth(8) << "\\U"; - stream->ts << ucs4 << reset; + stream->ts << "\\U" << qSetFieldWidth(8); + stream->ts << hex << qSetPadChar(QLatin1Char('0')) << ucs4 << reset; } maybeQuote('\''); } diff --git a/tests/auto/corelib/io/qdebug/tst_qdebug.cpp b/tests/auto/corelib/io/qdebug/tst_qdebug.cpp index db2805ebf0..0c04c5058b 100644 --- a/tests/auto/corelib/io/qdebug/tst_qdebug.cpp +++ b/tests/auto/corelib/io/qdebug/tst_qdebug.cpp @@ -363,14 +363,14 @@ void tst_QDebug::qDebugQChar() const MessageHandlerSetter mhs(myMessageHandler); { QDebug d = qDebug(); - d << QChar('f'); - d.nospace().noquote() << QChar('o') << QChar('o'); + d << QChar('f') << QChar(QLatin1Char('\xE4')); // f, ä + d.nospace().noquote() << QChar('o') << QChar('o') << QChar(QLatin1Char('\xC4')); // o, o, Ä } #ifndef QT_NO_MESSAGELOGCONTEXT file = __FILE__; line = __LINE__ - 5; function = Q_FUNC_INFO; #endif QCOMPARE(s_msgType, QtDebugMsg); - QCOMPARE(s_msg, QString::fromLatin1("'f' oo")); + QCOMPARE(s_msg, QString::fromLatin1("'f' '\\u00e4' oo\\u00c4")); QCOMPARE(QString::fromLatin1(s_file), file); QCOMPARE(s_line, line); QCOMPARE(QString::fromLatin1(s_function), function); -- cgit v1.2.3 From 767319a5aac2462df84431917b3724f884091036 Mon Sep 17 00:00:00 2001 From: Luca Bellonda Date: Wed, 1 Jun 2016 00:06:13 +0200 Subject: Add support for 8bit encodings not ASCII compatible in QXMLStreamWriter. When using a 8 bit encoding to write a file, a test discovers if the encoding is really ASCII compatible by examining a letter and one of the XML reserved characters. EBCDIC, in the current base, was not well handled. [ChangeLog][QtCore][QXmlStreamWriter] Fixed a bug that prevented the generation of valid XML files when using encoding with 8 bit per character but not ASCII compatible. QXMLStreamWriter generated XML markup using always ASCII in this case. Change-Id: I9c86a122dd91b2290d50c358638442f99777d4ae Reviewed-by: Thiago Macieira --- src/corelib/xml/qxmlstream.cpp | 12 ++++--- .../auto/corelib/xml/qxmlstream/tst_qxmlstream.cpp | 39 ++++++++++++++++++++++ 2 files changed, 47 insertions(+), 4 deletions(-) diff --git a/src/corelib/xml/qxmlstream.cpp b/src/corelib/xml/qxmlstream.cpp index 64a130e45a..a235145669 100644 --- a/src/corelib/xml/qxmlstream.cpp +++ b/src/corelib/xml/qxmlstream.cpp @@ -3019,10 +3019,14 @@ void QXmlStreamWriterPrivate::checkIfASCIICompatibleCodec() { #ifndef QT_NO_TEXTCODEC Q_ASSERT(encoder); - // assumes ASCII-compatibility for all 8-bit encodings - QChar space = QLatin1Char(' '); - const QByteArray bytes = encoder->fromUnicode(&space, 1); - isCodecASCIICompatible = (bytes.count() == 1); + // test ASCII-compatibility using the letter 'a' + QChar letterA = QLatin1Char('a'); + const QByteArray bytesA = encoder->fromUnicode(&letterA, 1); + const bool isCodecASCIICompatibleA = (bytesA.count() == 1) && (bytesA[0] == 0x61) ; + QChar letterLess = QLatin1Char('<'); + const QByteArray bytesLess = encoder->fromUnicode(&letterLess, 1); + const bool isCodecASCIICompatibleLess = (bytesLess.count() == 1) && (bytesLess[0] == 0x3C) ; + isCodecASCIICompatible = isCodecASCIICompatibleA && isCodecASCIICompatibleLess ; #else isCodecASCIICompatible = true; #endif diff --git a/tests/auto/corelib/xml/qxmlstream/tst_qxmlstream.cpp b/tests/auto/corelib/xml/qxmlstream/tst_qxmlstream.cpp index 1da29ac3bd..b0fd1187f5 100644 --- a/tests/auto/corelib/xml/qxmlstream/tst_qxmlstream.cpp +++ b/tests/auto/corelib/xml/qxmlstream/tst_qxmlstream.cpp @@ -561,6 +561,7 @@ private slots: void checkCommentIndentation() const; void checkCommentIndentation_data() const; void crashInXmlStreamReader() const; + void write8bitCodec() const; void hasError() const; private: @@ -1578,5 +1579,43 @@ void tst_QXmlStream::hasError() const } +void tst_QXmlStream::write8bitCodec() const +{ + QBuffer outBuffer; + QVERIFY(outBuffer.open(QIODevice::WriteOnly)); + QXmlStreamWriter writer(&outBuffer); + writer.setAutoFormatting(false); + + QTextCodec *codec = QTextCodec::codecForName("IBM500"); + if (!codec) { + QSKIP("Encoding IBM500 not available."); + } + writer.setCodec(codec); + + writer.writeStartDocument(); + writer.writeStartElement("root"); + writer.writeAttribute("attrib", "1"); + writer.writeEndElement(); + writer.writeEndDocument(); + outBuffer.close(); + + // test 8 bit encoding + QByteArray values = outBuffer.data(); + QVERIFY(values.size() > 1); + // check '<' + QCOMPARE(values[0] & 0x00FF, 0x4c); + // check '?' + QCOMPARE(values[1] & 0x00FF, 0x6F); + + // convert the start of the XML + const QString expected = (""); + QTextDecoder *decoder = codec->makeDecoder(); + QVERIFY(decoder); + QString decodedText = decoder->toUnicode(values); + delete decoder; + QVERIFY(decodedText.startsWith(expected)); +} + + #include "tst_qxmlstream.moc" // vim: et:ts=4:sw=4:sts=4 -- cgit v1.2.3 From 4762fabce16c611f12542a48b0dd31b3cec8e530 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C5=82a=C5=BCej=20Szczygie=C5=82?= Date: Thu, 14 Apr 2016 13:20:23 +0200 Subject: xcb: Fix transient parent and "Qt::Window" flag Don't set transient parent property when Qt::Window flag is set. Delete transient parent property if a window doesn't have a transient parent. Force setting standard window flags for Qt::Window only if there are no other flags. Amends 98c10a02c5b77e023471ad6993dc66b013889cfb Task-number: QTBUG-52550 Change-Id: I68ee715b632487e9dd0e7ffbbfc0c2cdd0f0e151 Reviewed-by: Dmitry Shachnev Reviewed-by: Shawn Rutledge --- src/plugins/platforms/xcb/qxcbwindow.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp index 429ba8df71..0c2f0d7c4d 100644 --- a/src/plugins/platforms/xcb/qxcbwindow.cpp +++ b/src/plugins/platforms/xcb/qxcbwindow.cpp @@ -821,9 +821,9 @@ void QXcbWindow::show() propagateSizeHints(); // update WM_TRANSIENT_FOR - const QWindow *tp = window()->transientParent(); - if (isTransient(window()) || tp != 0) { - xcb_window_t transientXcbParent = 0; + xcb_window_t transientXcbParent = 0; + if (isTransient(window())) { + const QWindow *tp = window()->transientParent(); if (tp && tp->handle()) transientXcbParent = static_cast(tp->handle())->winId(); // Default to client leader if there is no transient parent, else modal dialogs can @@ -836,6 +836,8 @@ void QXcbWindow::show() 1, &transientXcbParent)); } } + if (!transientXcbParent) + Q_XCB_CALL(xcb_delete_property(xcb_connection(), m_window, XCB_ATOM_WM_TRANSIENT_FOR)); // update _MOTIF_WM_HINTS updateMotifWmHintsBeforeMap(); @@ -1195,9 +1197,11 @@ void QXcbWindow::setMotifWindowFlags(Qt::WindowFlags flags) mwmhints.flags |= MWM_HINTS_DECORATIONS; bool customize = flags & Qt::CustomizeWindowHint; - if (type == Qt::Window && !customize) - flags |= Qt::WindowSystemMenuHint | Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint; - + if (type == Qt::Window && !customize) { + const Qt::WindowFlags defaultFlags = Qt::WindowSystemMenuHint | Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint; + if (!(flags & defaultFlags)) + flags |= defaultFlags; + } if (!(flags & Qt::FramelessWindowHint) && !(customize && !(flags & Qt::WindowTitleHint))) { mwmhints.decorations |= MWM_DECOR_BORDER; mwmhints.decorations |= MWM_DECOR_RESIZEH; -- cgit v1.2.3 From afa0e9bf6a53d20dbb9820c7fce1bb67de0e616f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C5=82a=C5=BCej=20Szczygie=C5=82?= Date: Wed, 4 May 2016 18:24:48 +0200 Subject: QtWidgets: Open submenus also on left mouse button press MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch allows to open submenus also on left mouse button press. Previously submenus could be opened only on right mouse button press as ContextMenu event which was inconvenient especially for long submenu popup timeout. Task-number: QTBUG-53054 Change-Id: I1bd78ed4436f738c8838f7f4687ffebb94b66725 Reviewed-by: Félix Bourbonnais Reviewed-by: Gabriel de Dietrich Reviewed-by: Shawn Rutledge --- src/widgets/widgets/qmenu.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/widgets/widgets/qmenu.cpp b/src/widgets/widgets/qmenu.cpp index 744fecb3f3..184dd42fe6 100644 --- a/src/widgets/widgets/qmenu.cpp +++ b/src/widgets/widgets/qmenu.cpp @@ -2697,10 +2697,15 @@ QMenu::event(QEvent *e) return true; } } break; - case QEvent::ContextMenu: - if (d->delayState.timer.isActive()) { - d->delayState.stop(); - internalDelayedPopup(); + case QEvent::MouseButtonPress: + case QEvent::ContextMenu: { + bool canPopup = true; + if (e->type() == QEvent::MouseButtonPress) + canPopup = (static_cast(e)->button() == Qt::LeftButton); + if (canPopup && d->delayState.timer.isActive()) { + d->delayState.stop(); + internalDelayedPopup(); + } } break; case QEvent::Resize: { -- cgit v1.2.3 From 36ffe18f05594c6bacddb90a13d3dc727875b629 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 8 Jun 2016 08:47:58 +0200 Subject: Re-enable tst_QDir on Windows. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Partially revert f3939d943ed132eaf3daead797d961c3ffbc31a5. Change-Id: I67e4d8973bc18d9cd77750c6379221d34e9484b3 Reviewed-by: Jędrzej Nowacki --- tests/auto/corelib/io/qdir/qdir.pro | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/auto/corelib/io/qdir/qdir.pro b/tests/auto/corelib/io/qdir/qdir.pro index 65cfd3faa9..9cbc491800 100644 --- a/tests/auto/corelib/io/qdir/qdir.pro +++ b/tests/auto/corelib/io/qdir/qdir.pro @@ -13,5 +13,3 @@ DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 android:!android-no-sdk { RESOURCES += android_testdata.qrc } - -win32: CONFIG += insignificant_test # Crashes on Windows in release builds -- cgit v1.2.3 From 19def3d8f14c42a930e1f7bb9d6c1a0872ea59b8 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 8 Jun 2016 13:37:50 +0200 Subject: Revert "Insignifify qdiriterator test" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit b373d183de4249c938935ff357c50c415b69f247. The crashes in release mode cannot be locally reproduced. Change-Id: I38ff5e9e045cff0e94e24ca07fb6e18e88b677c7 Reviewed-by: Jędrzej Nowacki --- tests/auto/corelib/io/qdiriterator/qdiriterator.pro | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/auto/corelib/io/qdiriterator/qdiriterator.pro b/tests/auto/corelib/io/qdiriterator/qdiriterator.pro index 51bfcb36a5..ade9b66afe 100644 --- a/tests/auto/corelib/io/qdiriterator/qdiriterator.pro +++ b/tests/auto/corelib/io/qdiriterator/qdiriterator.pro @@ -9,5 +9,3 @@ contains(CONFIG, builtin_testdata): DEFINES += BUILTIN_TESTDATA wince*mips*|wincewm50smart-msvc200*: DEFINES += WINCE_BROKEN_ITERATE=1 DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 - -win32: CONFIG += insignificant_test # Crashes on Windows in release builds -- cgit v1.2.3 From 6c0783d1073d67e16381ca2812b57f4626bd75f1 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 8 Jun 2016 13:33:12 +0200 Subject: Revert "Insignifify qfileinfo on Windows, like QDir". MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 55655abfaf1fbe09af2eedfde413e862bc6c85e2. The crashes in release mode cannot be locally reproduced. Change-Id: I4e7b1defbeac5d5512b2fa82a367d2e04e3c37a4 Reviewed-by: Jędrzej Nowacki --- tests/auto/corelib/io/qfileinfo/qfileinfo.pro | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/auto/corelib/io/qfileinfo/qfileinfo.pro b/tests/auto/corelib/io/qfileinfo/qfileinfo.pro index 571637be37..de99447404 100644 --- a/tests/auto/corelib/io/qfileinfo/qfileinfo.pro +++ b/tests/auto/corelib/io/qfileinfo/qfileinfo.pro @@ -7,5 +7,3 @@ RESOURCES += qfileinfo.qrc \ win32:!wince:!winrt:LIBS += -ladvapi32 -lnetapi32 DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 - -win32: CONFIG += insignificant_test # Crashes on Windows in release builds -- cgit v1.2.3 From bd4344a0bd5cb15abc2742c9c380afc635e2049f Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Thu, 2 Jun 2016 16:56:31 +0200 Subject: Fix qplugin autotest on Windows Since Qt 5.0.0 we never built the test plugins on Windows, because we checked for the existence of QtCore[d]4.dll, and the actual test does not complain if it cannot find any plugins. Use the right conditions to check for debug/release Qt builds on Windows. Use subdirs dependencies on every platform and then actually pass the right variable to SUBDIRS. Clean up the pro file while we're at it. Change-Id: I099f30afd445fbf43dc5677d256ffe55b27639b3 Reviewed-by: Simon Hausmann --- tests/auto/corelib/plugin/qplugin/qplugin.pro | 35 +++++++++------------------ 1 file changed, 12 insertions(+), 23 deletions(-) diff --git a/tests/auto/corelib/plugin/qplugin/qplugin.pro b/tests/auto/corelib/plugin/qplugin/qplugin.pro index e8840a0fb2..5283c2d52b 100644 --- a/tests/auto/corelib/plugin/qplugin/qplugin.pro +++ b/tests/auto/corelib/plugin/qplugin/qplugin.pro @@ -1,28 +1,17 @@ -QT = core TEMPLATE = subdirs +TESTPLUGINS = + win32 { - exists($$[QT_INSTALL_LIBS/get]/QtCore4.dll) { - SUBDIRS = releaseplugin - } - exists($$[QT_INSTALL_LIBS/get]/QtCored4.dll) { - SUBDIRS += debugplugin - } -} -mac { - CONFIG(debug, debug|release): { - SUBDIRS += debugplugin - tst_qplugin_pro.depends += debugplugin - } - CONFIG(release, debug|release): { - SUBDIRS += releaseplugin - tst_qplugin_pro.depends += releaseplugin - } + contains(QT_CONFIG, debug): TESTPLUGINS += debugplugin + contains(QT_CONFIG, release): TESTPLUGINS += releaseplugin +} else:osx { + CONFIG(debug, debug|release): TESTPLUGINS += debugplugin + CONFIG(release, debug|release): TESTPLUGINS += releaseplugin +} else { + TESTPLUGINS = debugplugin releaseplugin } -!win32:!mac:{ - SUBDIRS = debugplugin releaseplugin - tst_qplugin_pro.depends += debugplugin releaseplugin -} -SUBDIRS += tst_qplugin.pro +SUBDIRS += main $$TESTPLUGINS +main.file = tst_qplugin.pro +main.depends = $$TESTPLUGINS -CONFIG += parallel_test -- cgit v1.2.3 From 751143724a98d467509b7e5711a8d47dff97b7ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Wed, 1 Jun 2016 13:29:19 +0200 Subject: uikit: Call base class implementation of rotation callbacks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Apple documentation explicitly says that you should call super when implementing these methods. Change-Id: I584bb140a4a5bde88927b379ab19158a78c6fea9 Reviewed-by: Jake Petroules Reviewed-by: Tor Arne Vestbø --- src/plugins/platforms/ios/qiosviewcontroller.mm | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/plugins/platforms/ios/qiosviewcontroller.mm b/src/plugins/platforms/ios/qiosviewcontroller.mm index 94d894bba7..ed76161b87 100644 --- a/src/plugins/platforms/ios/qiosviewcontroller.mm +++ b/src/plugins/platforms/ios/qiosviewcontroller.mm @@ -324,17 +324,16 @@ - (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)orientation duration:(NSTimeInterval)duration { - Q_UNUSED(orientation); - Q_UNUSED(duration); - self.changingOrientation = YES; + + [super willRotateToInterfaceOrientation:orientation duration:duration]; } - (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)orientation { - Q_UNUSED(orientation); - self.changingOrientation = NO; + + [super didRotateFromInterfaceOrientation:orientation]; } - (void)willChangeStatusBarFrame:(NSNotification*)notification -- cgit v1.2.3 From 196d55ba5c8d169d120f17ca1db3d85ea1e5b4dd Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 9 Jun 2016 10:33:23 +0200 Subject: Output region in debug operator of QPaintEvent. This helps to analzye flicker/painting issues. Change-Id: I18e04598013c013386c3d019ff3098b1accec3f7 Reviewed-by: Alexandru Croitor Reviewed-by: Shawn Rutledge --- src/gui/kernel/qevent.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp index 9281744692..43da81e8a6 100644 --- a/src/gui/kernel/qevent.cpp +++ b/src/gui/kernel/qevent.cpp @@ -3842,6 +3842,9 @@ QDebug operator<<(QDebug dbg, const QEvent *e) case QEvent::Expose: dbg << "QExposeEvent(" << static_cast(e)->region() << ')'; break; + case QEvent::Paint: + dbg << "QPaintEvent(" << static_cast(e)->region() << ')'; + break; case QEvent::MouseButtonPress: case QEvent::MouseMove: case QEvent::MouseButtonRelease: -- cgit v1.2.3 From e005e99005d83e89ef2499320306c46a14965e7a Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 23 May 2016 18:07:22 +0200 Subject: fix ios device&simulator builds again the assumption stated in b67a0836d is actually invalid - configure sets build_all without debug_and_release there. debug_and_release does actually imply build_all, though. to make things less confusing, don't let configure inject iphonesimulator_and_iphoneos into all projects, but handle it like debug_and_release instead. Change-Id: Ib7acdc63308a538862fc603428f81aba60bca08e Reviewed-by: Jake Petroules --- configure | 3 +-- mkspecs/features/qml_plugin.prf | 4 +++- mkspecs/features/qt_helper_lib.prf | 4 +++- mkspecs/features/qt_module.prf | 4 +++- mkspecs/features/qt_plugin.prf | 4 +++- mkspecs/macx-ios-clang/features/default_pre.prf | 4 ++-- mkspecs/macx-ios-clang/features/sdk.prf | 4 ++-- 7 files changed, 17 insertions(+), 10 deletions(-) diff --git a/configure b/configure index be89b22291..8f6c380133 100755 --- a/configure +++ b/configure @@ -3422,8 +3422,7 @@ if [ "$XPLATFORM_IOS" = "yes" ]; then # If the user passes -sdk on the command line we build a SDK-specific Qt build. # Otherwise we build a joined simulator and device build, which is the default. if [ -z "$OPT_MAC_SDK" ]; then - QT_CONFIG="$QT_CONFIG build_all" - QTCONFIG_CONFIG="$QTCONFIG_CONFIG iphonesimulator_and_iphoneos" + QT_CONFIG="$QT_CONFIG build_all simulator_and_device" fi fi diff --git a/mkspecs/features/qml_plugin.prf b/mkspecs/features/qml_plugin.prf index 158bddf60c..9661da9e8d 100644 --- a/mkspecs/features/qml_plugin.prf +++ b/mkspecs/features/qml_plugin.prf @@ -15,7 +15,9 @@ TEMPLATE = lib CONFIG += plugin if(win32|mac):!macx-xcode { - contains(QT_CONFIG, debug_and_release): CONFIG += debug_and_release build_all + contains(QT_CONFIG, simulator_and_device): CONFIG += iphonesimulator_and_iphoneos + contains(QT_CONFIG, debug_and_release): CONFIG += debug_and_release + contains(QT_CONFIG, build_all): CONFIG += build_all } CONFIG += relative_qt_rpath # Qt's QML plugins should be relocatable diff --git a/mkspecs/features/qt_helper_lib.prf b/mkspecs/features/qt_helper_lib.prf index 3393154436..8e61316aa6 100644 --- a/mkspecs/features/qt_helper_lib.prf +++ b/mkspecs/features/qt_helper_lib.prf @@ -18,7 +18,9 @@ QT = # In case qt is re-added. CONFIG -= warning_clean # Don't presume 3rd party code to be clean load(qt_common) -contains(QT_CONFIG, debug_and_release): CONFIG += debug_and_release build_all +contains(QT_CONFIG, simulator_and_device): CONFIG += iphonesimulator_and_iphoneos +contains(QT_CONFIG, debug_and_release): CONFIG += debug_and_release +contains(QT_CONFIG, build_all): CONFIG += build_all DESTDIR = $$MODULE_BASE_OUTDIR/lib DLLDESTDIR = $$MODULE_BASE_OUTDIR/bin diff --git a/mkspecs/features/qt_module.prf b/mkspecs/features/qt_module.prf index 5bd5101cdc..22e2dd5ea2 100644 --- a/mkspecs/features/qt_module.prf +++ b/mkspecs/features/qt_module.prf @@ -89,7 +89,9 @@ INCLUDEPATH *= $$eval(QT.$${MODULE}.includes) $$eval(QT.$${MODULE}_private.inclu # If Qt was configured with -debug-and-release then build the module the same way # - unless this is a host library !host_build:if(win32|mac):!macx-xcode { - contains(QT_CONFIG, debug_and_release): CONFIG += debug_and_release build_all + contains(QT_CONFIG, simulator_and_device): CONFIG += iphonesimulator_and_iphoneos + contains(QT_CONFIG, debug_and_release): CONFIG += debug_and_release + contains(QT_CONFIG, build_all): CONFIG += build_all } QMAKE_LFLAGS += $$QMAKE_LFLAGS_NOUNDEF diff --git a/mkspecs/features/qt_plugin.prf b/mkspecs/features/qt_plugin.prf index 176159eff1..3cf6c7349c 100644 --- a/mkspecs/features/qt_plugin.prf +++ b/mkspecs/features/qt_plugin.prf @@ -26,7 +26,9 @@ win32:CONFIG(shared, static|shared) { tool_plugin { !build_pass:contains(QT_CONFIG, debug_and_release): CONFIG += release } else:if(win32|mac):!macx-xcode { - contains(QT_CONFIG, debug_and_release): CONFIG += debug_and_release build_all + contains(QT_CONFIG, simulator_and_device): CONFIG += iphonesimulator_and_iphoneos + contains(QT_CONFIG, debug_and_release): CONFIG += debug_and_release + contains(QT_CONFIG, build_all): CONFIG += build_all } CONFIG += relative_qt_rpath # Qt's plugins should be relocatable diff --git a/mkspecs/macx-ios-clang/features/default_pre.prf b/mkspecs/macx-ios-clang/features/default_pre.prf index dfede454b5..b5c41cf43e 100644 --- a/mkspecs/macx-ios-clang/features/default_pre.prf +++ b/mkspecs/macx-ios-clang/features/default_pre.prf @@ -2,14 +2,14 @@ load(default_pre) # In case Qt was built for a specific SDK -!iphonesimulator_and_iphoneos:contains(QMAKE_MAC_SDK, ^iphonesimulator.*): \ +!contains(QT_CONFIG, simulator_and_device):contains(QMAKE_MAC_SDK, ^iphonesimulator.*): \ CONFIG += iphonesimulator # Check for supported Xcode versions lessThan(QMAKE_XCODE_VERSION, "4.3"): \ error("This mkspec requires Xcode 4.3 or later") -iphonesimulator_and_iphoneos:iphonesimulator { +build_pass:iphonesimulator { # For a iphonesimulator_and_iphoneos build all the config tests # are based on the iPhoneOS ARM SDK, but we know that the simulator # is i386 and that we support SSE/SSE2. diff --git a/mkspecs/macx-ios-clang/features/sdk.prf b/mkspecs/macx-ios-clang/features/sdk.prf index 32fcbb7289..4d148f22fb 100644 --- a/mkspecs/macx-ios-clang/features/sdk.prf +++ b/mkspecs/macx-ios-clang/features/sdk.prf @@ -1,12 +1,12 @@ # In case the user sets the SDK manually contains(QMAKE_MAC_SDK, ^iphonesimulator.*) { - iphonesimulator_and_iphoneos: \ + contains(QT_CONFIG, simulator_and_device): \ error("iOS simulator is handled automatically for iphonesimulator_and_iphoneos") CONFIG += iphonesimulator } -iphonesimulator_and_iphoneos:iphonesimulator: \ +build_pass:iphonesimulator: \ QMAKE_MAC_SDK ~= s,^iphoneos,iphonesimulator, load(sdk) -- cgit v1.2.3 From fa8d16d4762d0107308dce85acc9879e272ab8dd Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Mon, 6 Jun 2016 12:25:44 +0200 Subject: Fix QWidgetBackingStore::isDirty() for render-to-texture widgets The backing store would not report itself dirty if only render-to- texture widgets were dirty. This caused QOpenGLWidgets not be repainted after being remapped if they marked themselves dirty while unmapped. Task-number: QTBUG-50818 Task-number: QTBUG-51815 Change-Id: If43f7cbb6f4d44831b4c21b89f884d6bcaebf87c Reviewed-by: Laszlo Agocs --- src/widgets/kernel/qwidgetbackingstore_p.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/widgets/kernel/qwidgetbackingstore_p.h b/src/widgets/kernel/qwidgetbackingstore_p.h index 564dc7f245..5da2d51586 100644 --- a/src/widgets/kernel/qwidgetbackingstore_p.h +++ b/src/widgets/kernel/qwidgetbackingstore_p.h @@ -110,7 +110,7 @@ public: inline bool isDirty() const { - return !(dirtyWidgets.isEmpty() && dirty.isEmpty() && !fullUpdatePending); + return !(dirtyWidgets.isEmpty() && dirty.isEmpty() && !fullUpdatePending && dirtyRenderToTextureWidgets.isEmpty()); } // ### Qt 4.6: Merge into a template function (after MSVC isn't supported anymore). -- cgit v1.2.3 From ea86f736404bab170ebfd75af6ee0f594e10f0f7 Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Wed, 8 Jun 2016 16:14:04 +0200 Subject: Mention extension in QFileInfo's suffix-related documentation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This makes it easier for users to find out how to get a file's extension when browsing docs. Change-Id: I08a1b620dea5432462133324824fae85754b9a09 Task-number: QTBUG-53380 Reviewed-by: Topi Reiniö --- src/corelib/io/qfileinfo.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/corelib/io/qfileinfo.cpp b/src/corelib/io/qfileinfo.cpp index dd194594c9..cb1ce6fd65 100644 --- a/src/corelib/io/qfileinfo.cpp +++ b/src/corelib/io/qfileinfo.cpp @@ -814,7 +814,7 @@ QString QFileInfo::completeBaseName() const } /*! - Returns the complete suffix of the file. + Returns the complete suffix (extension) of the file. The complete suffix consists of all characters in the file after (but not including) the first '.'. @@ -833,7 +833,7 @@ QString QFileInfo::completeSuffix() const } /*! - Returns the suffix of the file. + Returns the suffix (extension) of the file. The suffix consists of all characters in the file after (but not including) the last '.'. -- cgit v1.2.3 From 67ca72796e23269451795baf9adde02a184a7b9e Mon Sep 17 00:00:00 2001 From: Nico Rieck Date: Wed, 24 Feb 2016 21:46:10 +0100 Subject: Paint small progressbars correctly on Vista+ The animated glow always has a length of 120 but was previously drawn with the clipping rect of the bar's actual size. For sizes smaller than 120 the native theme part would be clipped and the black gradient would show. Change-Id: Id81e39c405ef81ae08af0f64249568016944bdf1 Task-number: QTBUG-51266 Reviewed-by: Friedemann Kleint Reviewed-by: Alessandro Portale --- src/widgets/styles/qwindowsvistastyle.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/widgets/styles/qwindowsvistastyle.cpp b/src/widgets/styles/qwindowsvistastyle.cpp index 971fb1be7c..2ce54fe207 100644 --- a/src/widgets/styles/qwindowsvistastyle.cpp +++ b/src/widgets/styles/qwindowsvistastyle.cpp @@ -1059,7 +1059,7 @@ void QWindowsVistaStyle::drawControl(ControlElement element, const QStyleOption QPainter imagePainter(&image); theme.painter = &imagePainter; theme.partId = vertical ? PP_FILLVERT : PP_FILL; - theme.rect = QRect(QPoint(0,0), theme.rect.size()); + theme.rect = QRect(QPoint(0,0), animRect.size()); QLinearGradient alphaGradient(0, 0, vertical ? 0 : image.width(), vertical ? image.height() : 0); alphaGradient.setColorAt(0, QColor(0, 0, 0, 0)); -- cgit v1.2.3