From: Liang Qi Date: Wed, 26 Aug 2015 18:06:57 +0000 (+0200) Subject: Merge remote-tracking branch 'origin/5.5' into 5.6 X-Git-Tag: v5.5.90+alpha1~18^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=afab1546a7665bac2a8d7a6452e6aea46bfd2127;p=platform%2Fupstream%2Fqtbase.git Merge remote-tracking branch 'origin/5.5' into 5.6 Conflicts: qmake/doc/snippets/code/doc_src_qmake-manual.pro qmake/doc/src/qmake-manual.qdoc src/corelib/io/qstorageinfo_unix.cpp src/corelib/tools/qbytearray.cpp src/widgets/kernel/qwidgetwindow.cpp tests/auto/corelib/io/qprocess/tst_qprocess.cpp tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp tests/auto/network/access/qnetworkreply/BLACKLIST Change-Id: I9efcd7e1cce1c394eed425c43aa6fce7d2edf31c --- afab1546a7665bac2a8d7a6452e6aea46bfd2127 diff --cc qmake/doc/snippets/code/doc_src_qmake-manual.pro index 7609a98111,43de125446..6fa3ca085d --- a/qmake/doc/snippets/code/doc_src_qmake-manual.pro +++ b/qmake/doc/snippets/code/doc_src_qmake-manual.pro @@@ -974,6 -989,8 +974,12 @@@ VERSION_PE_HEADER = 1. #! [185] #! [186] +RC_DEFINES += USE_MY_STUFF +#! [186] + ++#! [187] + win32-g++:contains(QMAKE_HOST.arch, x86_64):{ + message("Host is 64bit") + ... + } -#! [186] ++#! [187] diff --cc qmake/doc/src/qmake-manual.qdoc index 14697425c0,a2afeaf765..d54dc9569a --- a/qmake/doc/src/qmake-manual.qdoc +++ b/qmake/doc/src/qmake-manual.qdoc @@@ -1714,6 -1739,25 +1714,25 @@@ See \l{Creating Frameworks} for more information about creating frameworks. + \target QMAKE_HOST + \section1 QMAKE_HOST + + Provides information about the host machine running qmake. + For example, you can retrieve the host machine architecture from + \c{QMAKE_HOST.arch}. + + \table + \header \li Keys \li Values + \row \li .arch \li Host architecture + \row \li .os \li Host OS + \row \li .cpu_count \li Number of available cpus + \row \li .name \li Host computer name + \row \li .version \li Host OS version number + \row \li .version_string \li Host OS version string + \endtable + - \snippet code/doc_src_qmake-manual.pro 186 ++ \snippet code/doc_src_qmake-manual.pro 187 + \target QMAKE_INCDIR \section1 QMAKE_INCDIR diff --cc qmake/generators/unix/unixmake2.cpp index 6fb2e7d0a1,e4973157cd..05a090b23a --- a/qmake/generators/unix/unixmake2.cpp +++ b/qmake/generators/unix/unixmake2.cpp @@@ -839,9 -840,11 +839,11 @@@ UnixMakefileGenerator::writeMakeParts(Q bundleIdentifier.chop(4); if (bundleIdentifier.endsWith(".framework")) bundleIdentifier.chop(10); + // replace invalid bundle id characters + bundleIdentifier.replace('_', '-'); commonSedArgs << "-e \"s,@BUNDLEIDENTIFIER@," << bundleIdentifier << ",g\" "; - if (isApp) { + if (!isFramework) { QString icon = fileFixify(var("ICON")); t << "@$(DEL_FILE) " << info_plist_out << "\n\t" << "@sed "; diff --cc src/corelib/global/qnamespace.qdoc index a912e65d30,c6098007d1..a7da751da4 --- a/src/corelib/global/qnamespace.qdoc +++ b/src/corelib/global/qnamespace.qdoc @@@ -2655,9 -2604,8 +2655,10 @@@ This enables automatic management of the state of parent items in QTreeWidget (checked if all children are checked, unchecked if all children are unchecked, or partially checked if only some children are checked). + \value ItemIsTristate \e{This enum value is deprecated.} Use Qt::ItemIsAutoTristate + instead. \value ItemNeverHasChildren The item never has child items. + This is used for optimization purposes only. \value ItemIsUserTristate The user can cycle through three separate states. This value has been added in Qt 5.5. diff --cc src/corelib/io/qstorageinfo_unix.cpp index 83c52dbf2c,bf1e6ce245..54a2855239 --- a/src/corelib/io/qstorageinfo_unix.cpp +++ b/src/corelib/io/qstorageinfo_unix.cpp @@@ -507,10 -506,9 +507,10 @@@ void QStorageInfoPrivate::retrieveVolum valid = true; ready = true; - bytesTotal = statfs_buf.f_blocks * statfs_buf.f_bsize; - bytesFree = statfs_buf.f_bfree * statfs_buf.f_bsize; - bytesAvailable = statfs_buf.f_bavail * statfs_buf.f_bsize; + bytesTotal = statfs_buf.f_blocks * statfs_buf.f_frsize; + bytesFree = statfs_buf.f_bfree * statfs_buf.f_frsize; + bytesAvailable = statfs_buf.f_bavail * statfs_buf.f_frsize; + blockSize = statfs_buf.f_bsize; #if defined(Q_OS_ANDROID) || defined (Q_OS_BSD4) #if defined(_STATFS_F_FLAGS) readOnly = (statfs_buf.f_flags & ST_RDONLY) != 0; diff --cc src/gui/painting/qimagescale.cpp index 7b6a71737d,2f85e90c49..33dccc5374 --- a/src/gui/painting/qimagescale.cpp +++ b/src/gui/painting/qimagescale.cpp @@@ -302,10 -309,13 +302,13 @@@ static void qt_qimageScaleAARGBA_up_xy( dptr++; } } else { - for (int x = dxx; x < end; x++) { + for (int x = 0; x < dw; x++) { const unsigned int *pix = sptr + xpoints[x]; const int xap = xapoints[x]; - *dptr = INTERPOLATE_PIXEL_256(pix[0], 256 - xap, pix[1], xap); + if (xap > 0) + *dptr = INTERPOLATE_PIXEL_256(pix[0], 256 - xap, pix[1], xap); + else + *dptr = pix[0]; dptr++; } } diff --cc src/platformsupport/eglconvenience/qeglplatformcontext.cpp index 8929a038e0,5bee29afef..905f7695bb --- a/src/platformsupport/eglconvenience/qeglplatformcontext.cpp +++ b/src/platformsupport/eglconvenience/qeglplatformcontext.cpp @@@ -241,11 -240,10 +241,12 @@@ void QEGLPlatformContext::adopt(const Q void QEGLPlatformContext::initialize() { - updateFormatFromGL(); + if (m_eglContext != EGL_NO_CONTEXT) + updateFormatFromGL(); } +// Base implementation for pbuffers. Subclasses will handle the specialized cases for +// platforms without pbuffers. EGLSurface QEGLPlatformContext::createTemporaryOffscreenSurface() { // Make the context current to ensure the GL version query works. This needs a surface too. diff --cc src/plugins/platforms/ios/qiostextresponder.mm index e2c61e1161,be9c3b9e27..e4917593db --- a/src/plugins/platforms/ios/qiostextresponder.mm +++ b/src/plugins/platforms/ios/qiostextresponder.mm @@@ -678,13 -696,9 +718,10 @@@ return; if ([text isEqualToString:@"\n"]) { - QKeyEvent press(QEvent::KeyPress, Qt::Key_Return, Qt::NoModifier); - QKeyEvent release(QEvent::KeyRelease, Qt::Key_Return, Qt::NoModifier); - [self sendEventToFocusObject:press]; - [self sendEventToFocusObject:release]; + [self sendKeyPressRelease:Qt::Key_Return modifiers:Qt::NoModifier]; - if (self.returnKeyType == UIReturnKeyDone) + if (self.returnKeyType == UIReturnKeyDone || self.returnKeyType == UIReturnKeyGo + || self.returnKeyType == UIReturnKeySend || self.returnKeyType == UIReturnKeySearch) [self resignFirstResponder]; return; diff --cc src/widgets/kernel/qwidgetwindow.cpp index 58436a7d92,24ef7de1cf..deaac4e263 --- a/src/widgets/kernel/qwidgetwindow.cpp +++ b/src/widgets/kernel/qwidgetwindow.cpp @@@ -445,11 -445,11 +445,11 @@@ void QWidgetWindow::handleMouseEvent(QM receiver = popupChild; if (receiver != popup) widgetPos = receiver->mapFromGlobal(event->globalPos()); - QWidget *alien = m_widget->childAt(m_widget->mapFromGlobal(event->globalPos())); + QWidget *alien = receiver->childAt(receiver->mapFromGlobal(event->globalPos())); - QMouseEvent e(event->type(), widgetPos, event->windowPos(), event->screenPos(), event->button(), event->buttons(), event->modifiers()); - QGuiApplicationPrivate::setMouseEventSource(&e, QGuiApplicationPrivate::mouseEventSource(event)); + QMouseEvent e(event->type(), widgetPos, event->windowPos(), event->screenPos(), + event->button(), event->buttons(), event->modifiers(), event->source()); e.setTimestamp(event->timestamp()); - QApplicationPrivate::sendMouseEvent(receiver, &e, alien, m_widget, &qt_button_down, qt_last_mouse_receiver); + QApplicationPrivate::sendMouseEvent(receiver, &e, alien, receiver->window(), &qt_button_down, qt_last_mouse_receiver); qt_last_mouse_receiver = receiver; } else { // close disabled popups when a mouse button is pressed or released diff --cc src/widgets/widgets/qlineedit_p.h index 57055757eb,5a22285149..b47866b827 --- a/src/widgets/widgets/qlineedit_p.h +++ b/src/widgets/widgets/qlineedit_p.h @@@ -225,11 -228,17 +228,18 @@@ private int lastTextSize; mutable QSize m_iconSize; }; +Q_DECLARE_TYPEINFO(QLineEditPrivate::SideWidgetEntry, Q_PRIMITIVE_TYPE); + static bool isSideWidgetVisible(const QLineEditPrivate::SideWidgetEntry &e) + { + return e.widget->isVisible(); + } + inline int QLineEditPrivate::effectiveLeftTextMargin() const { - return leftTextMargin + leftSideWidgetList().size() * (QLineEditIconButton::IconMargin + iconSize().width()); + return leftTextMargin + (QLineEditIconButton::IconMargin + iconSize().width()) + * int(std::count_if(leftSideWidgetList().constBegin(), leftSideWidgetList().constEnd(), + isSideWidgetVisible)); } inline int QLineEditPrivate::effectiveRightTextMargin() const diff --cc tests/auto/corelib/io/qprocess/tst_qprocess.cpp index 0d4c53a7a9,0995f764b7..caefc3fc21 --- a/tests/auto/corelib/io/qprocess/tst_qprocess.cpp +++ b/tests/auto/corelib/io/qprocess/tst_qprocess.cpp @@@ -1970,22 -2004,7 +1975,6 @@@ void tst_QProcess::setStandardOutputFil << true; } - #ifndef Q_OS_WINCE - void tst_QProcess::setStandardOutputFile2() - { - static const char testdata[] = "Test data."; - - QProcess process; - process.setStandardOutputFile(QProcess::nullDevice()); - process.start("testProcessEcho2/testProcessEcho2"); - process.write(testdata, sizeof testdata); - QPROCESS_VERIFY(process,waitForFinished()); - QCOMPARE(process.bytesAvailable(), Q_INT64_C(0)); - - QVERIFY(!QFileInfo(QProcess::nullDevice()).isFile()); - } - #endif - -//----------------------------------------------------------------------------- void tst_QProcess::setStandardOutputFile() { static const char data[] = "Original data. "; @@@ -2034,8 -2053,43 +2023,42 @@@ QCOMPARE(all.size(), expectedsize); } + + void tst_QProcess::setStandardOutputFileNullDevice() + { + static const char testdata[] = "Test data."; + + QProcess process; + process.setStandardOutputFile(QProcess::nullDevice()); + process.start("testProcessEcho2/testProcessEcho2"); + process.write(testdata, sizeof testdata); + QPROCESS_VERIFY(process,waitForFinished()); + QCOMPARE(process.bytesAvailable(), Q_INT64_C(0)); + + QVERIFY(!QFileInfo(QProcess::nullDevice()).isFile()); + } + + void tst_QProcess::setStandardOutputFileAndWaitForBytesWritten() + { + static const char testdata[] = "Test data."; + + QFile file("data"); + QProcess process; + process.setStandardOutputFile(file.fileName()); + process.start("testProcessEcho2/testProcessEcho2"); + process.write(testdata, sizeof testdata); + process.waitForBytesWritten(); + QPROCESS_VERIFY(process, waitForFinished()); + + // open the file again and verify the data + QVERIFY(file.open(QIODevice::ReadOnly)); + QByteArray all = file.readAll(); + file.close(); + + QCOMPARE(all, QByteArray::fromRawData(testdata, sizeof testdata - 1)); + } #endif -//----------------------------------------------------------------------------- #ifndef Q_OS_WINCE // Reading and writing to a process is not supported on Qt/CE void tst_QProcess::setStandardOutputProcess_data() diff --cc tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp index 12abaf47c5,8bc90d917e..dd04849f87 --- a/tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp +++ b/tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp @@@ -35,9 -35,10 +35,11 @@@ #include "qstandardpaths.h" +#include #include #include + #include + #include #include #include #include @@@ -117,24 -119,24 +120,25 @@@ tst_QMimeDatabase::tst_QMimeDatabase( void tst_QMimeDatabase::initTestCase() { + QStandardPaths::setTestModeEnabled(true); + m_localMimeDir = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + "/mime"; + if (QDir(m_localMimeDir).exists()) { + QVERIFY2(QDir(m_localMimeDir).removeRecursively(), qPrintable(m_localMimeDir + ": " + qt_error_string())); + } + QString errorMessage; + + #ifdef USE_XDG_DATA_DIRS + // Create a temporary "global" XDG data dir for later use + // It will initially contain a copy of freedesktop.org.xml - QVERIFY(m_temporaryDir.isValid()); + QVERIFY2(m_temporaryDir.isValid(), + ("Could not create temporary subdir: " + m_temporaryDir.errorString()).toUtf8()); - - // Create a "global" and a "local" XDG data dir, right here. - // The local dir will be empty initially, while the global dir will contain a copy of freedesktop.org.xml - const QDir here = QDir(m_temporaryDir.path()); - m_globalXdgDir = m_temporaryDir.path() + QStringLiteral("/global"); - m_localXdgDir = m_temporaryDir.path() + QStringLiteral("/local"); - const QString globalPackageDir = m_globalXdgDir + QStringLiteral("/mime/packages"); - QVERIFY(here.mkpath(globalPackageDir) && here.mkpath(m_localXdgDir)); + QVERIFY(here.mkpath(globalPackageDir)); qputenv("XDG_DATA_DIRS", QFile::encodeName(m_globalXdgDir)); - qputenv("XDG_DATA_HOME", QFile::encodeName(m_localXdgDir)); - qDebug() << "\nLocal XDG_DATA_HOME: " << m_localXdgDir - << "\nGlobal XDG_DATA_DIRS: " << m_globalXdgDir; + qDebug() << "\nGlobal XDG_DATA_DIRS: " << m_globalXdgDir; const QString freeDesktopXml = QStringLiteral("freedesktop.org.xml"); const QString xmlFileName = QLatin1String(RESOURCE_PREFIX) + freeDesktopXml;