diff --git a/.gitignore b/.gitignore index d7d38f265b0..f48b330e1a4 100644 --- a/.gitignore +++ b/.gitignore @@ -30,6 +30,8 @@ pcviewer.cfg *.a *.la *.core +*.d +*.dylib *.moc *.o *.obj diff --git a/LICENSE.LGPL b/LICENSE.LGPL index 3788d79e24e..538df6989d8 100644 --- a/LICENSE.LGPL +++ b/LICENSE.LGPL @@ -1,6 +1,6 @@ GNU LESSER GENERAL PUBLIC LICENSE - The Qt Toolkit is Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). + The Qt Toolkit is Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). Contact: http://www.qt-project.org/legal You may use, distribute and copy the Qt GUI Toolkit under the terms of diff --git a/config.tests/unix/bsymbolic_functions.test b/config.tests/unix/bsymbolic_functions.test index d495e56befc..4d66ee6de02 100755 --- a/config.tests/unix/bsymbolic_functions.test +++ b/config.tests/unix/bsymbolic_functions.test @@ -6,6 +6,10 @@ VERBOSE=$2 cat >>bsymbolic_functions.c << EOF +#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; } EOF diff --git a/configure b/configure index 96273193a6a..52588c39d25 100755 --- a/configure +++ b/configure @@ -2766,203 +2766,25 @@ if [ "$COMMERCIAL_USER" = "ask" ]; then done fi -CFG_RTOS_ENABLED=yes -EditionString=Commercial if [ -f "$relpath"/LICENSE.PREVIEW.COMMERCIAL ] && [ $COMMERCIAL_USER = "yes" ]; then # Commercial preview release Licensee="Preview" Edition="Preview" - LicenseType="Technology Preview" + EditionString="Technology Preview" elif [ $COMMERCIAL_USER = "yes" ]; then - # one of commercial editions - - # read in the license file - [ -z "$LICENSE_FILE" ] && LICENSE_FILE="$QT_LICENSE_FILE" - [ -z "$LICENSE_FILE" ] && LICENSE_FILE="$HOME/.qt-license" - if [ -f "$LICENSE_FILE" ]; then - tr -d '\r' <"$LICENSE_FILE" >"${LICENSE_FILE}.tmp" - diff "${LICENSE_FILE}.tmp" "${LICENSE_FILE}" >/dev/null 2>&1 || LICENSE_FILE="${LICENSE_FILE}.tmp" - . "$LICENSE_FILE" >/dev/null 2>&1 - if [ -z "$LicenseKeyExt" ]; then - echo - echo "You are using an old license file." - echo - echo "Please install the license file supplied by Digia," - echo "or install the Qt Open Source Edition if you intend to" - echo "develop free software." - exit 1 - fi - if [ -z "$Licensee" ]; then - echo - echo "Invalid license key. Please check the license key." + if test -x "$relpath/bin/licheck"; then + LicheckOutput=`$relpath/bin/licheck $relpath $outpath $PLATFORM $XPLATFORM` + if [ $? -ne 0 ]; then exit 1 + else + eval "$LicheckOutput" fi else - if [ -z "$LicenseKeyExt" ]; then - echo - echo $ECHO_N "Please enter your license key: $ECHO_C" - read LicenseKeyExt - Licensee="Unknown user" - fi - fi - - # Key verification - echo "$LicenseKeyExt" | grep ".....*-....*-....*-....*-.....*-.....*-...." >/dev/null 2>&1 \ - && LicenseValid="yes" \ - || LicenseValid="no" - if [ "$LicenseValid" != "yes" ]; then echo - echo "Invalid license key. Please check the license key." - exit 1 - fi - ProductCode=`echo $LicenseKeyExt | cut -f 1 -d - | cut -b 1` - PlatformCode=`echo $LicenseKeyExt | cut -f 2 -d -` - LicenseTypeCode=`echo $LicenseKeyExt | cut -f 3 -d -` - LicenseFeatureCode=`echo $LicenseKeyExt | cut -f 4 -d - | cut -b 1` - - # determine which edition we are licensed to use - case "$LicenseTypeCode" in - F4M) - LicenseType="Commercial" - case $ProductCode in - F) - Edition="Universal" - ;; - B) - Edition="FullFramework" - EditionString="Full Framework" - ;; - L) - Edition="GUIFramework" - EditionString="GUI Framework" - ;; - esac - ;; - Z4M|R4M|Q4M) - LicenseType="Evaluation" - QMakeVar add DEFINES QT_EVAL - case $ProductCode in - B) - Edition="Evaluation" - ;; - esac - ;; - esac - if [ -z "$LicenseType" -o -z "$Edition" ]; then - echo - echo "Invalid license key. Please check the license key." - exit 1 - fi - - # verify that we are licensed to use Qt on this platform - LICENSE_EXTENSION= - case "$PlatformCode" in - *L) - CFG_RTOS_ENABLED=yes - PlatformCode=`echo "$PlatformCode" | sed 'h;y/8NPQRTZ/UCWX9M7/;x;G;s/\(.\)....\(.\)./\1\2/'` - ;; - *) - CFG_RTOS_ENABLED=no - PlatformCode=`echo "$PlatformCode" | sed 's/.$//'` - ;; - esac - ### EMBEDDED_QPA logic missing ### - case "$PlatformCode,$XPLATFORM_MAC" in - X9,* | XC,* | XU,* | XW,* | XM,*) - # Qt All-OS - LICENSE_EXTENSION="-ALLOS" - ;; - 8M,* | KM,* | S9,* | SC,* | SM,* | SU,* | SW,* | X9,* | XC,* | XU,* | XW,*) - # Qt for Embedded Linux - LICENSE_EXTENSION="-EMBEDDED" - ;; - 6M,* | N7,* | N9,* | NX,*) - # Embedded no-deploy - LICENSE_EXTENSION="-EMBEDDED" - ;; - FM,* | LM,yes | ZM,no) - # Desktop - LICENSE_EXTENSION="-DESKTOP" - ;; - *) - Platform=Linux/X11 - [ "$XPLATFORM_MAC" = "yes" ] && Platform='Mac OS X' - echo - echo "You are not licensed for the $Platform platform." - echo - echo "Please use the contact form at http://qt.digia.com/contact-us" - echo "to upgrade your license to include the $Platform platform, or install" - echo "the Qt Open Source Edition if you intend to develop free software." - exit 1 - ;; - esac - - if test -r "$relpath/.LICENSE"; then - # Generic, non-final license - LICENSE_EXTENSION="" - line=`sed 'y/a-z/A-Z/;q' "$relpath"/.LICENSE` - case "$line" in - *BETA*) - Edition=Beta - ;; - *TECHNOLOGY?PREVIEW*) - Edition=Preview - ;; - *EVALUATION*) - Edition=Evaluation - ;; - *) - echo >&2 "Invalid license files; cannot continue" - exit 1 - ;; - esac - Licensee="$Edition" - EditionString="$Edition" - fi - - case "$LicenseFeatureCode" in - B|G|L|Y) - # US - case "$LicenseType" in - Commercial) - cp -f "$relpath/.LICENSE${LICENSE_EXTENSION}-US" "$outpath/LICENSE" - ;; - Evaluation) - cp -f "$relpath/.LICENSE-EVALUATION-US" "$outpath/LICENSE" - ;; - esac - ;; - 2|4|5|F) - # non-US - case "$LicenseType" in - Commercial) - cp -f "$relpath/.LICENSE${LICENSE_EXTENSION}" "$outpath/LICENSE" - ;; - Evaluation) - cp -f "$relpath/.LICENSE-EVALUATION" "$outpath/LICENSE" - ;; - esac - ;; - *) - echo - echo "Invalid license key. Please check the license key." - exit 1 - ;; - esac - case "$LicenseFeatureCode" in - 4|B|F|Y) - CFG_RTOS_ENABLED=yes - ;; - 2|5|G|L) - CFG_RTOS_ENABLED=no - ;; - esac - if [ '!' -f "$outpath/LICENSE" ]; then - echo "The LICENSE, LICENSE.GPL LICENSE.LGPL file shipped with" - echo "this software has disappeared." - echo - echo "Sorry, you are not licensed to use this software." - echo "Try re-installing." + echo "Error: This is the Open Source version of Qt." + echo "If you want to use Enterprise features of Qt," + echo "use the contact form at http://qt.digia.com/contact-us" + echo "to purchase a license." echo exit 1 fi @@ -2972,22 +2794,11 @@ elif [ $COMMERCIAL_USER = "no" ]; then Edition="OpenSource" EditionString="Open Source" fi -echo -echo "This is the Qt ${EditionString} Edition." -echo -if [ "$CFG_RTOS_ENABLED" = "no" ]; then - case `basename "$XPLATFORM"` in - qnx-* | vxworks-*) - echo "" - echo "You are not licensed for Qt for `basename $XPLATFORM`." - echo "" - echo "Please use the contact form at http://qt.digia.com/contact-us" - echo "to upgrade your license to include this platform, or install" - echo "the Qt Open Source Edition if you intend to develop free software." - exit 1 - ;; - esac +if [ "$Edition" = "OpenSource" ] || [ "$Edition" = "Preview" ]; then + echo + echo "This is the Qt ${EditionString} Edition." + echo fi if [ "$Edition" = "OpenSource" ]; then @@ -3003,7 +2814,7 @@ if [ "$Edition" = "OpenSource" ]; then fi echo if [ "$OPT_CONFIRM_LICENSE" = "yes" ]; then - echo "You have already accepted the terms of the $LicenseType license." + echo "You have already accepted the terms of the $EditionString license." acceptance=yes else if [ -f "$relpath/LICENSE.GPL" ]; then @@ -3034,7 +2845,7 @@ elif [ "$Edition" = "Preview" ]; then while true; do if [ "$OPT_CONFIRM_LICENSE" = "yes" ]; then - echo "You have already accepted the terms of the $LicenseType license." + echo "You have already accepted the terms of the $EditionString license." acceptance=yes else echo "You are licensed to use this software under the terms of" @@ -3058,77 +2869,6 @@ elif [ "$Edition" = "Preview" ]; then more "$relpath/LICENSE.PREVIEW.COMMERCIAL" fi done -elif [ "$Edition" != "OpenSource" ]; then - if [ -n "$ExpiryDate" ]; then - ExpiryDate=`echo $ExpiryDate | sed -e 's,-,,g' | tr -d '\n\r'` - [ -z "$ExpiryDate" ] && ExpiryDate="0" - Today=`date +%Y%m%d` - if [ "$Today" -gt "$ExpiryDate" ]; then - case "$LicenseType" in - Commercial|Academic|Educational) - echo - echo "WARNING WARNING WARNING WARNING" - echo - echo " Your support and upgrade period has expired." - echo - echo " You may continue to use your last licensed release" - echo " of Qt under the terms of your existing license" - echo " agreement. But you are not entitled to technical" - echo " support, nor are you entitled to use any more recent" - echo " Qt releases." - echo - echo " Please use the contact form at http://qt.digia.com/contact-us" - echo " to renew your support and upgrades for this license." - echo - echo "WARNING WARNING WARNING WARNING" - echo - sleep 3 - ;; - Evaluation|*) - echo - echo "NOTICE NOTICE NOTICE NOTICE" - echo - echo " Your Evaluation license has expired." - echo - echo " You are no longer licensed to use this software. Please" - echo " use the contact form at http://qt.digia.com/contact-us to" - echo " purchase license, or install the Qt Open Source Edition" - echo " if you intend to develop free software." - echo - echo "NOTICE NOTICE NOTICE NOTICE" - echo - exit 1 - ;; - esac - fi - fi - TheLicense=`head -n 1 "$outpath/LICENSE"` - while true; do - if [ "$OPT_CONFIRM_LICENSE" = "yes" ]; then - echo "You have already accepted the terms of the $TheLicense." - acceptance=yes - else - echo "You are licensed to use this software under the terms of" - echo "the $TheLicense." - echo - echo "Type '?' to view the $TheLicense." - echo "Type 'yes' to accept this license offer." - echo "Type 'no' to decline this license offer." - echo - echo $ECHO_N "Do you accept the terms of the $TheLicense? $ECHO_C" - read acceptance - fi - echo - if [ "$acceptance" = "yes" ]; then - break - elif [ "$acceptance" = "no" ]; then - echo "You are not licensed to use this software." - echo - exit 1 - else [ "$acceptance" = "?" ] - more "$outpath/LICENSE" - fi - done fi #------------------------------------------------------------------------------- @@ -3851,22 +3591,6 @@ else chmod -w "$outpath/src/corelib/global/qconfig.cpp" fi -# ----------------------------------------------------------------------------- -if [ "$LicenseType" = "Evaluation" ]; then - EVALKEY=qt_qevalkey=$LicenseKeyExt -elif echo "$DEFINES" | grep QT_EVAL >/dev/null 2>&1; then - EVALKEY=qt_qevalkey= -fi - -if [ -n "$EVALKEY" ]; then - rm -f "$outpath/src/corelib/global/qconfig_eval.cpp" - cat > "$outpath/src/corelib/global/qconfig_eval.cpp" <>"$outpath/src/corelib/global/qconfig.h.new" <>"$outpath/src/corelib/global/qconfig.h.new" [ '!' -z "$LicenseKeyExt" ] && echo "#define QT_PRODUCT_LICENSEKEY \"$LicenseKeyExt\"" >>"$outpath/src/corelib/global/qconfig.h.new" diff --git a/doc/global/config.qdocconf b/doc/global/config.qdocconf index 2b3ca1d6ba3..8629b89e7e4 100644 --- a/doc/global/config.qdocconf +++ b/doc/global/config.qdocconf @@ -3,7 +3,7 @@ dita.metadata.default.author = Qt Project dita.metadata.default.permissions = all dita.metadata.default.publisher = Qt Project -dita.metadata.default.copyryear = 2013 +dita.metadata.default.copyryear = 2014 dita.metadata.default.copyrholder = Digia Plc dita.metadata.default.audience = programmer diff --git a/doc/global/html-footer.qdocconf b/doc/global/html-footer.qdocconf index c53eb2f5999..a77950ff994 100644 --- a/doc/global/html-footer.qdocconf +++ b/doc/global/html-footer.qdocconf @@ -8,7 +8,7 @@ HTML.footer = \ "\n" \ "
\n" \ "

\n" \ - " © 2013 Digia Plc and/or its\n" \ + " © 2014 Digia Plc and/or its\n" \ " subsidiaries. Documentation contributions included herein are the copyrights of\n" \ " their respective owners.
" \ " The documentation provided herein is licensed under the terms of the" \ diff --git a/examples/dbus/doc/src/remotecontrolledcar.qdoc b/examples/dbus/doc/src/remotecontrolledcar.qdoc deleted file mode 100644 index b3b81ebba95..00000000000 --- a/examples/dbus/doc/src/remotecontrolledcar.qdoc +++ /dev/null @@ -1,31 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:FDL$ -** 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 Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Free Documentation License Usage -** Alternatively, this file may be used under the terms of the GNU Free -** Documentation License version 1.3 as published by the Free Software -** Foundation and appearing in the file included in the packaging of -** this file. Please review the following information to ensure -** the GNU Free Documentation License version 1.3 requirements -** will be met: http://www.gnu.org/copyleft/fdl.html. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/*! - \example remotecontrolledcar - \title D-Bus Remote Controlled Car Example -*/ diff --git a/doc/src/images/localfortuneclient-example.png b/examples/ipc/doc/images/localfortuneclient-example.png similarity index 100% rename from doc/src/images/localfortuneclient-example.png rename to examples/ipc/doc/images/localfortuneclient-example.png diff --git a/doc/src/images/localfortuneserver-example.png b/examples/ipc/doc/images/localfortuneserver-example.png similarity index 100% rename from doc/src/images/localfortuneserver-example.png rename to examples/ipc/doc/images/localfortuneserver-example.png diff --git a/doc/src/images/sharedmemory-example_1.png b/examples/ipc/doc/images/sharedmemory-example_1.png similarity index 100% rename from doc/src/images/sharedmemory-example_1.png rename to examples/ipc/doc/images/sharedmemory-example_1.png diff --git a/doc/src/images/sharedmemory-example_2.png b/examples/ipc/doc/images/sharedmemory-example_2.png similarity index 100% rename from doc/src/images/sharedmemory-example_2.png rename to examples/ipc/doc/images/sharedmemory-example_2.png diff --git a/doc/src/examples/localfortuneclient.qdoc b/examples/ipc/doc/src/localfortuneclient.qdoc similarity index 94% rename from doc/src/examples/localfortuneclient.qdoc rename to examples/ipc/doc/src/localfortuneclient.qdoc index ec1306b10aa..a68f4bad0cc 100644 --- a/doc/src/examples/localfortuneclient.qdoc +++ b/examples/ipc/doc/src/localfortuneclient.qdoc @@ -26,14 +26,14 @@ ****************************************************************************/ /*! - \example ipc/localfortuneclient + \example localfortuneclient \title Local Fortune Client Example \ingroup examples-ipc \brief Demonstrates using QLocalSocket for a simple local service client. The Local Fortune Client example shows how to create a client for a simple local service using QLocalSocket. It is intended to be run alongside the - \l{ipc/localfortuneserver}{Local Fortune Server} example. + \l{Local Fortune Server Example}. \image localfortuneclient-example.png Screenshot of the Local Fortune Client example diff --git a/doc/src/examples/localfortuneserver.qdoc b/examples/ipc/doc/src/localfortuneserver.qdoc similarity index 94% rename from doc/src/examples/localfortuneserver.qdoc rename to examples/ipc/doc/src/localfortuneserver.qdoc index d9828d4145c..13f7f3ca744 100644 --- a/doc/src/examples/localfortuneserver.qdoc +++ b/examples/ipc/doc/src/localfortuneserver.qdoc @@ -26,14 +26,14 @@ ****************************************************************************/ /*! - \example ipc/localfortuneserver + \example localfortuneserver \title Local Fortune Server Example \ingroup examples-ipc \brief Demonstrates using QLocalServer and QLocalSocket for serving a simple local service. The Local Fortune Server example shows how to create a server for a simple local service. It is intended to be run alongside the - \l{ipc/localfortuneclient}{Local Fortune Client} example + \l{Local Fortune Client Example} \image localfortuneserver-example.png Screenshot of the Local Fortune Server example */ diff --git a/doc/src/examples/sharedmemory.qdoc b/examples/ipc/doc/src/sharedmemory.qdoc similarity index 94% rename from doc/src/examples/sharedmemory.qdoc rename to examples/ipc/doc/src/sharedmemory.qdoc index e8c3f00f260..b9f0c86d44f 100644 --- a/doc/src/examples/sharedmemory.qdoc +++ b/examples/ipc/doc/src/sharedmemory.qdoc @@ -26,7 +26,7 @@ ****************************************************************************/ /*! - \example ipc/sharedmemory + \example sharedmemory \title Shared Memory Example \ingroup examples-ipc \brief Demonstrates doing inter-process communication using shared memory with @@ -40,7 +40,7 @@ dialog is displayed and then control is passed to the application in the standard way. - \snippet examples/ipc/sharedmemory/main.cpp 0 + \snippet sharedmemory/main.cpp 0 Two instances of class Dialog appear. @@ -51,12 +51,12 @@ loadFromFile() and loadFromMemory() that correspond to the two buttons on the dialog. - \snippet examples/ipc/sharedmemory/dialog.h 0 + \snippet sharedmemory/dialog.h 0 The constructor builds the user interface widgets and connects the clicked() signal of each button to the corresponding slot function. - \snippet examples/ipc/sharedmemory/dialog.cpp 0 + \snippet sharedmemory/dialog.cpp 0 Note that "QSharedMemoryExample" is passed to the \l {QSharedMemory} {QSharedMemory()} constructor to be used as the key. This will be @@ -69,7 +69,7 @@ that segment is detached from the process, so we can be assured of starting off the example correctly. - \snippet examples/ipc/sharedmemory/dialog.cpp 1 + \snippet sharedmemory/dialog.cpp 1 The user is then asked to select an image file using QFileDialog::getOpenFileName(). The selected file is loaded into a @@ -85,7 +85,7 @@ to the image data, which we then use to do a memcopy() from the QBuffer into the shared memory segment. - \snippet examples/ipc/sharedmemory/dialog.cpp 2 + \snippet sharedmemory/dialog.cpp 2 Note that we \l {QSharedMemory::} {lock()} the shared memory segment before we copy into it, and we \l {QSharedMemory::} {unlock()} it @@ -117,7 +117,7 @@ then streams the data into a QImage and \l {QSharedMemory::unlock()} {unlocks} the segment. - \snippet examples/ipc/sharedmemory/dialog.cpp 3 + \snippet sharedmemory/dialog.cpp 3 In this case, the function does \l {QSharedMemory::} {detach()} from the segment, because now we are effectively finished using diff --git a/examples/threads/README b/examples/threads/README index c5427ea9a99..6c208445649 100644 --- a/examples/threads/README +++ b/examples/threads/README @@ -1,9 +1,7 @@ -Qt 4 makes it easier than ever to write multithreaded applications. More -classes have been made usable from non-GUI threads, and the signals and slots -mechanism can now be used to communicate between threads. +This folder contains examples for the use of the threading-related classes +in Qt Core. For examples using the higher-level Qt Concurrent module, +check out the "qtconcurrent" folder instead. -Additionally, it is now possible to move objects between threads. - - -Documentation for these examples can be found via the Examples -link in the main Qt documentation. +Documentation for examples can be found via the Examples and Tutorials link +in the main Qt documentation. The examples and their documentation can also +be opened from the Examples tab of Qt Creator's Welcome mode. diff --git a/examples/widgets/gestures/imagegestures/imagewidget.cpp b/examples/widgets/gestures/imagegestures/imagewidget.cpp index aad40afc266..57c2af4502d 100644 --- a/examples/widgets/gestures/imagegestures/imagewidget.cpp +++ b/examples/widgets/gestures/imagegestures/imagewidget.cpp @@ -1,7 +1,7 @@ /**************************************************************************** ** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of the examples of the Qt Toolkit. @@ -43,6 +43,8 @@ #include +Q_LOGGING_CATEGORY(lcExample, "qt.examples.imagegestures") + //! [constructor] ImageWidget::ImageWidget(QWidget *parent) : QWidget(parent), @@ -55,15 +57,17 @@ ImageWidget::ImageWidget(QWidget *parent) { setMinimumSize(QSize(100,100)); - -//! [enable gestures] - grabGesture(Qt::PanGesture); - grabGesture(Qt::PinchGesture); - grabGesture(Qt::SwipeGesture); -//! [enable gestures] } //! [constructor] +void ImageWidget::grabGestures(const QList &gestures) +{ + //! [enable gestures] + foreach (Qt::GestureType gesture, gestures) + grabGesture(gesture); + //! [enable gestures] +} + //! [event handler] bool ImageWidget::event(QEvent *event) { @@ -77,10 +81,10 @@ void ImageWidget::paintEvent(QPaintEvent*) { QPainter p(this); - float iw = currentImage.width(); - float ih = currentImage.height(); - float wh = height(); - float ww = width(); + const qreal iw = currentImage.width(); + const qreal ih = currentImage.height(); + const qreal wh = height(); + const qreal ww = width(); p.translate(ww/2, wh/2); p.translate(horizontalOffset, verticalOffset); @@ -98,11 +102,13 @@ void ImageWidget::mouseDoubleClickEvent(QMouseEvent *) verticalOffset = 0; horizontalOffset = 0; update(); + qCDebug(lcExample) << "reset on mouse double click"; } //! [gesture event handler] bool ImageWidget::gestureEvent(QGestureEvent *event) { + qCDebug(lcExample) << "gestureEvent():" << event->gestures().size(); if (QGesture *swipe = event->gesture(Qt::SwipeGesture)) swipeTriggered(static_cast(swipe)); else if (QGesture *pan = event->gesture(Qt::PanGesture)) @@ -126,6 +132,7 @@ void ImageWidget::panTriggered(QPanGesture *gesture) } #endif QPointF delta = gesture->delta(); + qCDebug(lcExample) << "panTriggered():" << delta; horizontalOffset += delta.x(); verticalOffset += delta.y(); update(); @@ -135,13 +142,16 @@ void ImageWidget::pinchTriggered(QPinchGesture *gesture) { QPinchGesture::ChangeFlags changeFlags = gesture->changeFlags(); if (changeFlags & QPinchGesture::RotationAngleChanged) { - qreal value = gesture->property("rotationAngle").toReal(); - qreal lastValue = gesture->property("lastRotationAngle").toReal(); - rotationAngle += value - lastValue; + const qreal value = gesture->property("rotationAngle").toReal(); + const qreal lastValue = gesture->property("lastRotationAngle").toReal(); + const qreal rotationAngleDelta = value - lastValue; + rotationAngle += rotationAngleDelta; + qCDebug(lcExample) << "pinchTriggered(): rotation by" << rotationAngleDelta << rotationAngle; } if (changeFlags & QPinchGesture::ScaleFactorChanged) { qreal value = gesture->property("scaleFactor").toReal(); currentStepScaleFactor = value; + qCDebug(lcExample) << "pinchTriggered(): " << currentStepScaleFactor; } if (gesture->state() == Qt::GestureFinished) { scaleFactor *= currentStepScaleFactor; @@ -155,10 +165,13 @@ void ImageWidget::swipeTriggered(QSwipeGesture *gesture) { if (gesture->state() == Qt::GestureFinished) { if (gesture->horizontalDirection() == QSwipeGesture::Left - || gesture->verticalDirection() == QSwipeGesture::Up) + || gesture->verticalDirection() == QSwipeGesture::Up) { + qCDebug(lcExample) << "swipeTriggered(): swipe to previous"; goPrevImage(); - else + } else { + qCDebug(lcExample) << "swipeTriggered(): swipe to next"; goNextImage(); + } update(); } } @@ -184,17 +197,22 @@ void ImageWidget::openDirectory(const QString &path) QImage ImageWidget::loadImage(const QString &fileName) { + qDebug() << position << files << fileName; QImageReader reader(fileName); + qCDebug(lcExample) << "loading" << QDir::toNativeSeparators(fileName) << position << '/' << files.size(); if (!reader.canRead()) { - qDebug() << fileName << ": can't load image"; + qCWarning(lcExample) << QDir::toNativeSeparators(fileName) << ": can't load image"; return QImage(); } QImage image; if (!reader.read(&image)) { - qDebug() << fileName << ": corrupted image"; + qCWarning(lcExample) << QDir::toNativeSeparators(fileName) << ": corrupted image: " << reader.errorString(); return QImage(); } + const QSize maximumSize(2000, 2000); // Reduce in case someone has large photo images. + if (image.size().width() > maximumSize.width() || image.height() > maximumSize.height()) + image = image.scaled(maximumSize, Qt::KeepAspectRatio, Qt::SmoothTransformation); return image; } @@ -238,7 +256,7 @@ void ImageWidget::goToImage(int index) return; if (index < 0 || index >= files.size()) { - qDebug() << "goToImage: invalid index: " << index; + qCWarning(lcExample) << "goToImage: invalid index: " << index; return; } diff --git a/examples/widgets/gestures/imagegestures/imagewidget.h b/examples/widgets/gestures/imagegestures/imagewidget.h index 7aaf554117e..d061935fe00 100644 --- a/examples/widgets/gestures/imagegestures/imagewidget.h +++ b/examples/widgets/gestures/imagegestures/imagewidget.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of the examples of the Qt Toolkit. @@ -52,6 +52,8 @@ class QPinchGesture; class QSwipeGesture; QT_END_NAMESPACE +Q_DECLARE_LOGGING_CATEGORY(lcExample) + //! [class definition begin] class ImageWidget : public QWidget { @@ -60,6 +62,7 @@ class ImageWidget : public QWidget public: ImageWidget(QWidget *parent = 0); void openDirectory(const QString &path); + void grabGestures(const QList &gestures); protected: bool event(QEvent *event); @@ -88,11 +91,11 @@ private: QImage prevImage, nextImage; QImage currentImage; - float horizontalOffset; - float verticalOffset; - float rotationAngle; - float scaleFactor; - float currentStepScaleFactor; + qreal horizontalOffset; + qreal verticalOffset; + qreal rotationAngle; + qreal scaleFactor; + qreal currentStepScaleFactor; //! [class definition end] }; //! [class definition end] diff --git a/examples/widgets/gestures/imagegestures/main.cpp b/examples/widgets/gestures/imagegestures/main.cpp index aec32149f00..80f275bd5f4 100644 --- a/examples/widgets/gestures/imagegestures/main.cpp +++ b/examples/widgets/gestures/imagegestures/main.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of the examples of the Qt Toolkit. @@ -42,17 +42,86 @@ #include "mainwidget.h" +static void showHelp(QCommandLineParser &parser, const QString errorMessage = QString()) +{ + QString text; + QTextStream str(&text); + str << ""; + if (!errorMessage.isEmpty()) + str << "

" << errorMessage << "

"; + str << "
" << parser.helpText() << "
"; + QMessageBox box(errorMessage.isEmpty() ? QMessageBox::Information : QMessageBox::Warning, + QGuiApplication::applicationDisplayName(), text, + QMessageBox::Ok); + box.setTextInteractionFlags(Qt::TextBrowserInteraction); + box.exec(); +} + int main(int argc, char *argv[]) { QApplication app(argc, argv); + QCoreApplication::setApplicationVersion(QT_VERSION_STR); + QCoreApplication::setApplicationName(QStringLiteral("imagegestures")); + QGuiApplication::setApplicationDisplayName(QStringLiteral("Image Gestures Example")); + + QCommandLineParser commandLineParser; + const QCommandLineOption disablePanOption("no-pan", "Disable pan gesture"); + commandLineParser.addOption(disablePanOption); + const QCommandLineOption disablePinchOption("no-pinch", "Disable pinch gesture"); + commandLineParser.addOption(disablePinchOption); + const QCommandLineOption disableSwipeOption("no-swipe", "Disable swipe gesture"); + commandLineParser.addOption(disableSwipeOption); + const QCommandLineOption helpOption = commandLineParser.addHelpOption(); + commandLineParser.addPositionalArgument(QStringLiteral("Directory"), + QStringLiteral("Directory to display")); + + const QString description = QGuiApplication::applicationDisplayName() + + QLatin1String("\n\nEnable \"debug\" on the logging category \"qt.examples.imagegestures\" in order to\n" + "in order to obtain verbose information about Qt's gesture event processing,\n" + "for example by setting the environment variables QT_LOGGING_RULES to\n" + "qt.examples.imagegestures.debug=true\n"); + commandLineParser.setApplicationDescription(description); + + if (!commandLineParser.parse(QCoreApplication::arguments())) { + showHelp(commandLineParser, commandLineParser.errorText()); + return -1; + } + if (commandLineParser.isSet(helpOption)) { + showHelp(commandLineParser); + return 0; + } + + QStringList arguments = commandLineParser.positionalArguments(); + if (!arguments.isEmpty() && !QFileInfo(arguments.front()).isDir()) { + showHelp(commandLineParser, + QLatin1Char('"') + QDir::toNativeSeparators(arguments.front()) + + QStringLiteral("\" is not a directory.")); + return -1; + } + + QList gestures; + if (!commandLineParser.isSet(disablePanOption)) + gestures << Qt::PanGesture; + if (!commandLineParser.isSet(disablePinchOption)) + gestures << Qt::PinchGesture; + if (!commandLineParser.isSet(disableSwipeOption)) + gestures << Qt::SwipeGesture; MainWidget w; + w.grabGestures(gestures); w.show(); - if (QApplication::arguments().size() > 1) - w.openDirectory(QApplication::arguments().at(1)); - else - w.openDirectory(QFileDialog::getExistingDirectory(0, "Select image folder")); + if (arguments.isEmpty()) { + const QStringList picturesLocations = QStandardPaths::standardLocations(QStandardPaths::PicturesLocation); + const QString directory = + QFileDialog::getExistingDirectory(&w, "Select image folder", + picturesLocations.isEmpty() ? QString() : picturesLocations.front()); + if (directory.isEmpty()) + return 0; + arguments.append(directory); + } + + w.openDirectory(arguments.front()); return app.exec(); } diff --git a/examples/widgets/gestures/imagegestures/mainwidget.cpp b/examples/widgets/gestures/imagegestures/mainwidget.cpp index 105cdf184ec..74c2cc5bb12 100644 --- a/examples/widgets/gestures/imagegestures/mainwidget.cpp +++ b/examples/widgets/gestures/imagegestures/mainwidget.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of the examples of the Qt Toolkit. @@ -41,15 +41,28 @@ #include "imagewidget.h" #include "mainwidget.h" +#include +#include +#include + MainWidget::MainWidget(QWidget *parent) : QMainWindow(parent) + , imageWidget(new ImageWidget(this)) { - resize(400, 300); - imageWidget = new ImageWidget(this); setCentralWidget(imageWidget); + const QRect screenGeometry = QGuiApplication::primaryScreen()->availableGeometry(); + QRect geometry(QPoint(0, 0), QSize(screenGeometry.width() * 3 / 4, screenGeometry.height() * 3 / 4)); + geometry.moveCenter(screenGeometry.center()); + setGeometry(geometry); } void MainWidget::openDirectory(const QString &path) { + setWindowTitle(QDir::toNativeSeparators(path)); imageWidget->openDirectory(path); } + +void MainWidget::grabGestures(const QList &gestures) +{ + imageWidget->grabGestures(gestures); +} diff --git a/examples/widgets/gestures/imagegestures/mainwidget.h b/examples/widgets/gestures/imagegestures/mainwidget.h index 5135466fdef..79ed3a087ac 100644 --- a/examples/widgets/gestures/imagegestures/mainwidget.h +++ b/examples/widgets/gestures/imagegestures/mainwidget.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of the examples of the Qt Toolkit. @@ -51,6 +51,7 @@ class MainWidget : public QMainWindow public: MainWidget(QWidget *parent = 0); + void grabGestures(const QList &gestures); public slots: void openDirectory(const QString &path); diff --git a/mkspecs/features/qt_targets.prf b/mkspecs/features/qt_targets.prf index ce064375008..02bf20b2223 100644 --- a/mkspecs/features/qt_targets.prf +++ b/mkspecs/features/qt_targets.prf @@ -1,4 +1,4 @@ QMAKE_TARGET_COMPANY = Digia Plc and/or its subsidiary(-ies) QMAKE_TARGET_PRODUCT = Qt5 QMAKE_TARGET_DESCRIPTION = C++ application development framework. -QMAKE_TARGET_COPYRIGHT = Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +QMAKE_TARGET_COPYRIGHT = Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). diff --git a/mkspecs/features/winrt/font_deployment.prf b/mkspecs/features/winrt/font_deployment.prf new file mode 100644 index 00000000000..36db5b7cace --- /dev/null +++ b/mkspecs/features/winrt/font_deployment.prf @@ -0,0 +1,60 @@ +# Provide default fonts for windows phone +# The DEFAULTFONTS variable indicates, whether the default set of fonts is +# used for deployment. The check below won't work after the fonts are added +# so this helper variable is added and used for the user warning check later. +!defined(FONTS, var):winphone { + FONTS = \ + $$[QT_HOST_PREFIX/src]/lib/fonts/DejaVuSans.ttf \ + $$[QT_HOST_PREFIX/src]/lib/fonts/DejaVuSans-Bold.ttf \ + $$[QT_HOST_PREFIX/src]/lib/fonts/DejaVuSans-BoldOblique.ttf \ + $$[QT_HOST_PREFIX/src]/lib/fonts/DejaVuSansMono.ttf \ + $$[QT_HOST_PREFIX/src]/lib/fonts/DejaVuSansMono-Bold.ttf \ + $$[QT_HOST_PREFIX/src]/lib/fonts/DejaVuSansMono-BoldOblique.ttf \ + $$[QT_HOST_PREFIX/src]/lib/fonts/DejaVuSansMono-Oblique.ttf \ + $$[QT_HOST_PREFIX/src]/lib/fonts/DejaVuSans-Oblique.ttf \ + $$[QT_HOST_PREFIX/src]/lib/fonts/DejaVuSerif.ttf \ + $$[QT_HOST_PREFIX/src]/lib/fonts/DejaVuSerif-Bold.ttf \ + $$[QT_HOST_PREFIX/src]/lib/fonts/DejaVuSerif-BoldOblique.ttf \ + $$[QT_HOST_PREFIX/src]/lib/fonts/DejaVuSerif-Oblique.ttf + DEFAULTFONTS = +} + +if(build_pass:equals(TEMPLATE, "app"))| \ +if(!build_pass:equals(TEMPLATE, "vcapp")) { + defined(DEFAULTFONTS, var) { + message(Default fonts will automatically be deployed with your application. \ + To avoid automatic deployment unset the \"FONTS\" variable (\"FONTS =\") in your .pro file. \ + You can also customize which fonts are deployed by setting the \"FONTS\" variable.) + } + + contains(TEMPLATE, "vc.*") { + BUILD_DIR = $$OUT_PWD + } else { + load(resolve_target) + BUILD_DIR = $$dirname(QMAKE_RESOLVED_TARGET) + } + + for (FONT, FONTS) { + font_$${FONT}.input = $$FONT + font_$${FONT}.output = $$BUILD_DIR/fonts/$$basename(FONT) + font_$${FONT}.CONFIG = verbatim + QMAKE_SUBSTITUTES += font_$${FONT} + } + + !isEmpty(FONTS):equals(TEMPLATE, "app") { + fonts.files = $$BUILD_DIR/fonts/* + isEmpty($$target.path) { + fonts.path = $$OUT_PWD/fonts + } else { + fonts.path = $$target.path/fonts + } + + INSTALLS += fonts + } +} + +!isEmpty(FONTS):winphone:equals(TEMPLATE, "vcapp"):build_pass { + fonts.files = $$OUT_PWD/fonts/* + fonts.path = fonts + DEPLOYMENT += fonts +} diff --git a/mkspecs/features/winrt/package_manifest.prf b/mkspecs/features/winrt/package_manifest.prf index a959bc5480e..fda4fb5e8fc 100644 --- a/mkspecs/features/winrt/package_manifest.prf +++ b/mkspecs/features/winrt/package_manifest.prf @@ -28,6 +28,7 @@ # WINRT_MANIFEST.iconic_tile_icon: Image file for the "iconic" tile template icon. Default provided by the mkspec. # WINRT_MANIFEST.iconic_tile_small: Image file for the small "iconic" tile template logo. Default provided by the mkspec. # WINRT_MANIFEST.capabilities: Specifies capabilities to add to the capability list. +# WINRT_MANIFEST.capabilities_device: Specifies device capabilities to add to the capability list. (location, webcam...) # WINRT_MANIFEST.dependencies: Specifies dependencies required by the package. # The manifest is generated for each build pass for normal apps, and only once for vcapps. @@ -95,10 +96,14 @@ # Capabilities are given as a string list and may change with the configuration (network, sensors, etc.) WINRT_MANIFEST.capabilities = $$unique(WINRT_MANIFEST.capabilities) - !isEmpty(WINRT_MANIFEST.capabilities)|winphone { + WINRT_MANIFEST.capabilities_device = $$unique(WINRT_MANIFEST.capabilities_device) + + !isEmpty(WINRT_MANIFEST.capabilities)|!isEmpty(WINRT_MANIFEST.capabilities_device)|winphone { MANIFEST_CAPABILITIES += "" for(CAPABILITY, WINRT_MANIFEST.capabilities): \ MANIFEST_CAPABILITIES += " " + !winphone:for(CAPABILITY, WINRT_MANIFEST.capabilities_device): \ + MANIFEST_CAPABILITIES += " " MANIFEST_CAPABILITIES += "" WINRT_MANIFEST.capabilities = $$join(MANIFEST_CAPABILITIES, $$INDENT, $$INDENT) diff --git a/mkspecs/winphone-arm-msvc2012/qmake.conf b/mkspecs/winphone-arm-msvc2012/qmake.conf index 72961c320dd..ce95fdf0b99 100644 --- a/mkspecs/winphone-arm-msvc2012/qmake.conf +++ b/mkspecs/winphone-arm-msvc2012/qmake.conf @@ -7,6 +7,7 @@ include(../common/winrt_winphone/qmake.conf) QMAKE_COMPILER_DEFINES += _MSC_VER=1700 QMAKE_PLATFORM = winphone $$QMAKE_PLATFORM +CONFIG += font_deployment DEFINES += WINAPI_FAMILY=WINAPI_FAMILY_PHONE_APP ARM __ARM__ __arm__ QMAKE_LFLAGS += /MACHINE:ARM diff --git a/mkspecs/winphone-x86-msvc2012/qmake.conf b/mkspecs/winphone-x86-msvc2012/qmake.conf index f7838d187a3..ff3d714bc52 100644 --- a/mkspecs/winphone-x86-msvc2012/qmake.conf +++ b/mkspecs/winphone-x86-msvc2012/qmake.conf @@ -7,6 +7,7 @@ include(../common/winrt_winphone/qmake.conf) QMAKE_COMPILER_DEFINES += _MSC_VER=1700 QMAKE_PLATFORM = winphone $$QMAKE_PLATFORM +CONFIG += font_deployment DEFINES += WINAPI_FAMILY=WINAPI_FAMILY_PHONE_APP X86 __X86__ __x86__ QMAKE_LFLAGS += /MACHINE:X86 diff --git a/qmake/doc/src/qmake-manual.qdoc b/qmake/doc/src/qmake-manual.qdoc index 01313b405f2..c1739982dcd 100644 --- a/qmake/doc/src/qmake-manual.qdoc +++ b/qmake/doc/src/qmake-manual.qdoc @@ -2382,6 +2382,118 @@ See also \l{#DEPENDPATH}{DEPENDPATH}. + \target WINRT_MANIFEST + \section1 WINRT_MANIFEST + + Specifies parameters to be passed to the application manifest on \l{Qt for WinRT}{Windows + Runtime}. The allowed values are: + + \table + \header + \li Member + \li Description + \row + \li architecture + \li The target architecture. Defaults to \c VCPROJ_ARCH. + \row + \li arguments + \li Allows arguments to be passed to the executable. + \row + \li author + \li Package author. Defaults to \c{Default package author}. + This option is only available for Windows Phone. + \row + \li background + \li Tile background color. Defaults to \c{green}. + \row + \li capabilities + \li Specifies capabilities to add to the capability list. + \row + \li capabilities_device + \li Specifies device capabilities to add to the capability list + (location, webcam, and so on). This option is not available on Windows Phone. + \row + \li dependencies + \li Specifies dependencies required by the package. + \row + \li description + \li Package description. Defaults to \c{Default package description}. + \row + \li foreground + \li Tile foreground (text) color. Defaults to \c{light}. + This option is only available for Windows Store apps on Windows 8 and Windows RT. + \row + \li genre + \li Package genre. Defaults to \c{apps.normal}. + This option is only available for Windows Phone. + \row + \li iconic_tile_icon + \li Image file for the \c{iconic} tile template icon. Default provided by + the mkspec. + \row + \li iconic_tile_small + \li Image file for the small \c{iconic} tile template logo. Default provided + by the mkspec. + \row + \li identity + \li The unique ID of the app. Defaults to reusing the existing generated + manifest's UUID, or generates a new UUID if none is present. + \row + \li logo_large + \li Large logo image file. Default provided by the mkspec. + \row + \li logo_medium + \li Medium logo image file. Default provided by the mkspec. + \row + \li logo_small + \li Small logo image file. Default provided by the mkspec. + \row + \li logo_store + \li Logo image file for Windows Store. Default provided by the mkspec. + \row + \li name + \li The name of the package as displayed to the user. Defaults to TARGET. + \row + \li publisher + \li Display name of the publisher. Defaults to \c{Default publisher display name}. + \row + \li publisher_id + \li On Windows 8 or Windows RT, the publisher's distinguished name (default: \c{CN=MyCN}). + On Windows Phone, the publisher's UUID (default: invalid UUID string). + \row + \li splash_screen + \li Splash screen image file. Default provided by the mkspec. + \row + \li target + \li The name of the target (.exe). Defaults to TARGET. + \row + \li version + \li The version number of the package. Defaults to \c{1.0.0.0}. + \endtable + + You can use any combination of those values. + + For example: + + \code + WINRT_MANIFEST.publisher = MyCompany + WINRT_MANIFEST.logo_store = someImage.png + winphone { + WINRT_MANIFEST.capabilities += ID_CAP_LOCATION ID_CAP_NETWORKING + } else { + WINRT_MANIFEST.capabilities += internetClient + WINRT_MANIFEST.device_capabilities += location + } + \endcode + + Additionally, an input manifest file can be specified by using WINRT_MANIFEST. + + For example: + + \code + WINRT_MANIFEST = someManifest.xml.in + \endcode + \target YACCSOURCES \section1 YACCSOURCES diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp index fe8d289a7c0..bad4eb54561 100644 --- a/qmake/generators/makefile.cpp +++ b/qmake/generators/makefile.cpp @@ -3299,7 +3299,7 @@ MakefileGenerator::writePkgConfigFile() pkgConfiglibName = "-framework " + bundle + " "; } else { pkgConfiglibDir = "-L${libdir}"; - pkgConfiglibName = "-l" + fileInfo(fname).completeBaseName(); + pkgConfiglibName = "-l" + unescapeFilePath(project->first("QMAKE_ORIG_TARGET")); if (project->isActiveConfig("shared")) pkgConfiglibName += project->first("TARGET_VERSION_EXT").toQString(); } diff --git a/src/3rdparty/angle/src/libEGL/main.cpp b/src/3rdparty/angle/src/libEGL/main.cpp index e972691a4f9..4cdf5f03628 100644 --- a/src/3rdparty/angle/src/libEGL/main.cpp +++ b/src/3rdparty/angle/src/libEGL/main.cpp @@ -69,6 +69,8 @@ void DeallocateCurrent() } +#ifndef QT_OPENGL_ES_2_ANGLE_STATIC + extern "C" BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, LPVOID reserved) { switch (reason) @@ -124,6 +126,8 @@ extern "C" BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, LPVOID reserved return TRUE; } +#endif // !QT_OPENGL_ES_2_ANGLE_STATIC + namespace egl { diff --git a/src/3rdparty/angle/src/libGLESv2/main.cpp b/src/3rdparty/angle/src/libGLESv2/main.cpp index 95f4b8de1c8..e52799438d8 100644 --- a/src/3rdparty/angle/src/libGLESv2/main.cpp +++ b/src/3rdparty/angle/src/libGLESv2/main.cpp @@ -66,6 +66,8 @@ void DeallocateCurrent() } +#ifndef QT_OPENGL_ES_2_ANGLE_STATIC + extern "C" BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, LPVOID reserved) { switch (reason) @@ -107,6 +109,8 @@ extern "C" BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, LPVOID reserved return TRUE; } +#endif // !QT_OPENGL_ES_2_ANGLE_STATIC + namespace gl { diff --git a/src/3rdparty/sqlite/sqlite3.c b/src/3rdparty/sqlite/sqlite3.c index a2e37dd48ee..f8a10149bc7 100644 --- a/src/3rdparty/sqlite/sqlite3.c +++ b/src/3rdparty/sqlite/sqlite3.c @@ -1,6 +1,6 @@ /****************************************************************************** ** This file is an amalgamation of many separate C source files from SQLite -** version 3.8.4.1. By combining all the individual C code files into this +** version 3.8.4.2. By combining all the individual C code files into this ** single large file, the entire code can be compiled as a single translation ** unit. This allows many compilers to do optimizations that would not be ** possible if the files were compiled separately. Performance improvements @@ -222,9 +222,9 @@ extern "C" { ** [sqlite3_libversion_number()], [sqlite3_sourceid()], ** [sqlite_version()] and [sqlite_source_id()]. */ -#define SQLITE_VERSION "3.8.4.1" +#define SQLITE_VERSION "3.8.4.2" #define SQLITE_VERSION_NUMBER 3008004 -#define SQLITE_SOURCE_ID "2014-03-11 15:27:36 018d317b1257ce68a92908b05c9c7cf1494050d0" +#define SQLITE_SOURCE_ID "2014-03-26 18:51:19 02ea166372bdb2ef9d8dfbb05e78a97609673a8e" /* ** CAPI3REF: Run-Time Library Version Numbers @@ -64786,6 +64786,7 @@ SQLITE_PRIVATE int sqlite3VdbeRecordCompare( }else{ idx1 = getVarint32(aKey1, szHdr1); d1 = szHdr1; + if( d1>(unsigned)nKey1 ) return 1; /* Corruption */ i = 0; } diff --git a/src/3rdparty/sqlite/sqlite3.h b/src/3rdparty/sqlite/sqlite3.h index 1f19ada4cbf..d0d676afaef 100644 --- a/src/3rdparty/sqlite/sqlite3.h +++ b/src/3rdparty/sqlite/sqlite3.h @@ -107,9 +107,9 @@ extern "C" { ** [sqlite3_libversion_number()], [sqlite3_sourceid()], ** [sqlite_version()] and [sqlite_source_id()]. */ -#define SQLITE_VERSION "3.8.4.1" +#define SQLITE_VERSION "3.8.4.2" #define SQLITE_VERSION_NUMBER 3008004 -#define SQLITE_SOURCE_ID "2014-03-11 15:27:36 018d317b1257ce68a92908b05c9c7cf1494050d0" +#define SQLITE_SOURCE_ID "2014-03-26 18:51:19 02ea166372bdb2ef9d8dfbb05e78a97609673a8e" /* ** CAPI3REF: Run-Time Library Version Numbers diff --git a/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java b/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java index ea8e5cd44c3..e62b5dab825 100644 --- a/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java +++ b/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java @@ -120,7 +120,7 @@ public class QtActivityDelegate private boolean m_keyboardIsVisible = false; public boolean m_backKeyPressedSent = false; - + private long m_showHideTimeStamp = System.nanoTime(); public void setFullScreen(boolean enterFullScreen) { @@ -201,12 +201,18 @@ public class QtActivityDelegate private final int ApplicationInactive = 0x2; private final int ApplicationActive = 0x4; - public void setKeyboardVisibility(boolean visibility) + + public boolean setKeyboardVisibility(boolean visibility, long timeStamp) { + if (m_showHideTimeStamp > timeStamp) + return false; + m_showHideTimeStamp = timeStamp; + if (m_keyboardIsVisible == visibility) - return; + return false; m_keyboardIsVisible = visibility; QtNative.keyboardVisibilityChanged(m_keyboardIsVisible); + return true; } public void resetSoftwareKeyboard() { @@ -304,11 +310,11 @@ public class QtActivityDelegate QtNativeInputConnection.updateCursorPosition(); //FALLTHROUGH case InputMethodManager.RESULT_UNCHANGED_SHOWN: - setKeyboardVisibility(true); + setKeyboardVisibility(true, System.nanoTime()); break; case InputMethodManager.RESULT_HIDDEN: case InputMethodManager.RESULT_UNCHANGED_HIDDEN: - setKeyboardVisibility(false); + setKeyboardVisibility(false, System.nanoTime()); break; } } @@ -331,11 +337,11 @@ public class QtActivityDelegate switch (resultCode) { case InputMethodManager.RESULT_SHOWN: case InputMethodManager.RESULT_UNCHANGED_SHOWN: - setKeyboardVisibility(true); + setKeyboardVisibility(true, System.nanoTime()); break; case InputMethodManager.RESULT_HIDDEN: case InputMethodManager.RESULT_UNCHANGED_HIDDEN: - setKeyboardVisibility(false); + setKeyboardVisibility(false, System.nanoTime()); break; } } @@ -827,7 +833,7 @@ public class QtActivityDelegate if (keyCode == KeyEvent.KEYCODE_BACK && !m_backKeyPressedSent) { hideSoftwareKeyboard(); - setKeyboardVisibility(false); + setKeyboardVisibility(false, System.nanoTime()); return true; } diff --git a/src/android/jar/src/org/qtproject/qt5/android/QtInputConnection.java b/src/android/jar/src/org/qtproject/qt5/android/QtInputConnection.java index 5e6e227c2b1..6de66fe5121 100644 --- a/src/android/jar/src/org/qtproject/qt5/android/QtInputConnection.java +++ b/src/android/jar/src/org/qtproject/qt5/android/QtInputConnection.java @@ -61,6 +61,8 @@ class QtExtractedText class QtNativeInputConnection { + static native boolean beginBatchEdit(); + static native boolean endBatchEdit(); static native boolean commitText(String text, int newCursorPosition); static native boolean commitCompletion(String text, int position); static native boolean deleteSurroundingText(int leftLength, int rightLength); @@ -82,18 +84,11 @@ class QtNativeInputConnection } class HideKeyboardRunnable implements Runnable { - private QtInputConnection m_connection; - HideKeyboardRunnable(QtInputConnection connection) - { - m_connection = connection; - } + private long m_hideTimeStamp = System.nanoTime(); @Override public void run() { - if (m_connection.getInputState() == QtInputConnection.InputStates.Hiding) { - QtNative.activityDelegate().setKeyboardVisibility(false); - m_connection.reset(); - } + QtNative.activityDelegate().setKeyboardVisibility(false, m_hideTimeStamp); } } @@ -107,34 +102,14 @@ public class QtInputConnection extends BaseInputConnection private static final int ID_SWITCH_INPUT_METHOD = android.R.id.switchInputMethod; private static final int ID_ADD_TO_DICTIONARY = android.R.id.addToDictionary; - - enum InputStates { Visible, FinishComposing, Hiding }; - private QtEditText m_view = null; - private InputStates m_inputState = InputStates.Visible; - - public void reset() - { - m_inputState = InputStates.Visible; - } - - public InputStates getInputState() - { - return m_inputState; - } private void setClosing(boolean closing) { - if (closing && m_inputState == InputStates.Hiding) - return; - - if (closing && m_view.getActivityDelegate().isSoftwareKeyboardVisible()) { - m_view.postDelayed(new HideKeyboardRunnable(this), 100); - m_inputState = InputStates.Hiding; + if (closing) { + m_view.postDelayed(new HideKeyboardRunnable(), 100); } else { - if (m_inputState == InputStates.Hiding) - QtNative.activityDelegate().setKeyboardVisibility(true); - m_inputState = closing ? InputStates.FinishComposing : InputStates.Visible; + QtNative.activityDelegate().setKeyboardVisibility(true, System.nanoTime()); } } @@ -148,14 +123,14 @@ public class QtInputConnection extends BaseInputConnection public boolean beginBatchEdit() { setClosing(false); - return true; + return QtNativeInputConnection.beginBatchEdit(); } @Override public boolean endBatchEdit() { -// setClosing(false); - return true; + setClosing(false); + return QtNativeInputConnection.endBatchEdit(); } @Override diff --git a/src/android/java/AndroidManifest.xml b/src/android/java/AndroidManifest.xml index 3209ab58ace..8e551ba7acf 100644 --- a/src/android/java/AndroidManifest.xml +++ b/src/android/java/AndroidManifest.xml @@ -4,7 +4,8 @@ + android:screenOrientation="unspecified" + android:launchMode="singleTop"> diff --git a/src/android/java/res/values/libs.xml b/src/android/java/res/values/libs.xml index 797e6bb8c45..664ab0abecc 100644 --- a/src/android/java/res/values/libs.xml +++ b/src/android/java/res/values/libs.xml @@ -1,7 +1,7 @@ - https://download.qt-project.org/ministro/android/qt5/qt-5.2 + https://download.qt-project.org/ministro/android/qt5/qt-5.3