From fb85af439715ff5ec141473b5c1d8f9744aca19d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Trond=20Kjern=C3=A5sen?= Date: Fri, 2 Oct 2009 13:56:53 +0200 Subject: Renamed the values in the Qt::TileRule enum. Stretch, Repeat and Round are too generic. Renamed to StretchTile, RepeatTile and RoundTile. Reviewed-by: Gunnar --- src/corelib/global/qnamespace.h | 6 +++--- src/corelib/global/qnamespace.qdoc | 22 +++++++++++----------- src/gui/painting/qdrawutil.cpp | 36 ++++++++++++++++++------------------ src/gui/painting/qdrawutil.h | 18 +++++++++--------- src/gui/styles/qstylesheetstyle.cpp | 2 +- 5 files changed, 42 insertions(+), 42 deletions(-) diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h index a440606..9d76dcc 100644 --- a/src/corelib/global/qnamespace.h +++ b/src/corelib/global/qnamespace.h @@ -194,9 +194,9 @@ public: }; enum TileRule { - Stretch, - Repeat, - Round + StretchTile, + RepeatTile, + RoundTile }; // Text formatting flags for QPainter::drawText and QLabel. diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc index 9106fa8..482beed 100644 --- a/src/corelib/global/qnamespace.qdoc +++ b/src/corelib/global/qnamespace.qdoc @@ -612,7 +612,7 @@ */ /*! - \enum Qt::CoordinateSystem + \enum Qt::CoordinateSystem \value DeviceCoordinates \value LogicalCoordinates */ @@ -1220,7 +1220,7 @@ touch device will be sent as mouse events. \value WA_TouchPadAcceptSingleTouchEvents Allows touchpad single - touch events to be sent to the widget. + touch events to be sent to the widget. \value WA_DontUseStandardGestures Disables standard gestures on Qt widgets. @@ -1241,7 +1241,7 @@ \omitvalue WA_PendingUpdate \omitvalue WA_LaidOut \omitvalue WA_GrabbedShortcut - \omitvalue WA_DontShowOnScreen + \omitvalue WA_DontShowOnScreen \omitvalue WA_InvalidSize \omitvalue WA_ForceUpdatesDisabled \omitvalue WA_NoX11EventCompression @@ -1259,7 +1259,7 @@ /*! \typedef Qt::HANDLE Platform-specific handle type for system objects. This is - equivalent to \c{void *} on Mac OS X and embedded Linux, + equivalent to \c{void *} on Mac OS X and embedded Linux, and to \c{unsigned long} on X11. On Windows it is the DWORD returned by the Win32 function getCurrentThreadId(). @@ -2762,13 +2762,13 @@ This enum describes how to repeat or stretch the parts of an image when drawing. - \value Stretch Scale the image to fit to the available area. + \value StretchTile Scale the image to fit to the available area. - \value Repeat Tile the image until there is no more space. May crop - the last image. + \value RepeatTile Repeat the image until there is no more space. May + crop the last image. - \value Round Like Repeat, but scales the images down to ensure that - the last image is not cropped. + \value RoundTile Similar to Repeat, but scales the image down to + ensure that the last tile is not cropped. */ /*! @@ -2812,13 +2812,13 @@ \value NavigationModeNone Only the touch screen is used. \value NavigationModeKeypadTabOrder Qt::Key_Up and Qt::Key_Down are used to change focus. \value NavigationModeKeypadDirectional Qt::Key_Up, Qt::Key_Down, Qt::Key_Left and Qt::Key_Right are used to change focus. - \value NavigationModeCursorAuto The mouse cursor is used to change focus, + \value NavigationModeCursorAuto The mouse cursor is used to change focus, it is displayed only on non touchscreen devices. The keypad is used to implement a virtual cursor, unless the device has an analog mouse type of input device (e.g. touchpad). This is the recommended setting for an application such as a web browser that needs pointer control on both touch and non-touch devices. - \value NavigationModeCursorForceVisible The mouse cursor is used to change focus, + \value NavigationModeCursorForceVisible The mouse cursor is used to change focus, it is displayed regardless of device type. The keypad is used to implement a virtual cursor, unless the device has an analog mouse type of input device (e.g. touchpad) diff --git a/src/gui/painting/qdrawutil.cpp b/src/gui/painting/qdrawutil.cpp index 716300e..ac3796a 100644 --- a/src/gui/painting/qdrawutil.cpp +++ b/src/gui/painting/qdrawutil.cpp @@ -1225,7 +1225,7 @@ void qDrawBorderPixmap(QPainter *painter, const QRect &targetRect, const QMargin // horizontal edges switch (rules.horizontal) { - case Qt::Stretch: + case Qt::StretchTile: if (targetMargins.top() > 0 && sourceMargins.top() > 0) { // top const QRect targetTopRect(targetCenterLeft, targetTop, targetCenterWidth, targetMargins.top()); const QRect sourceTopRect(sourceCenterLeft, sourceTop, sourceCenterWidth, sourceMargins.top()); @@ -1237,7 +1237,7 @@ void qDrawBorderPixmap(QPainter *painter, const QRect &targetRect, const QMargin qDrawPixmap(painter, targetBottomRect, pixmap, sourceBottomRect); } break; - case Qt::Repeat: + case Qt::RepeatTile: if (targetMargins.top() > 0 && sourceMargins.top() > 0) { // top const QRect targetTopRect(targetCenterLeft, targetTop, targetCenterWidth, targetMargins.top()); const QRect sourceTopRect(sourceCenterLeft, sourceTop, sourceCenterWidth, sourceMargins.top()); @@ -1249,7 +1249,7 @@ void qDrawBorderPixmap(QPainter *painter, const QRect &targetRect, const QMargin qDrawHorizontallyRepeatedPixmap(painter, targetBottomRect, pixmap, sourceBottomRect); } break; - case Qt::Round: + case Qt::RoundTile: if (targetMargins.top() > 0 && sourceMargins.top() > 0) { // top const QRect targetTopRect(targetCenterLeft, targetTop, targetCenterWidth, targetMargins.top()); const QRect sourceTopRect(sourceCenterLeft, sourceTop, sourceCenterWidth, sourceMargins.top()); @@ -1265,7 +1265,7 @@ void qDrawBorderPixmap(QPainter *painter, const QRect &targetRect, const QMargin // vertical edges switch (rules.vertical) { - case Qt::Stretch: + case Qt::StretchTile: if (targetMargins.left() > 0 && sourceMargins.left() > 0) { // left const QRect targetLeftRect(targetLeft, targetCenterTop, targetMargins.left(), targetCenterHeight); const QRect sourceLeftRect(sourceLeft, sourceCenterTop, sourceMargins.left(), sourceCenterHeight); @@ -1277,7 +1277,7 @@ void qDrawBorderPixmap(QPainter *painter, const QRect &targetRect, const QMargin qDrawPixmap(painter, targetRightRect, pixmap, sourceRightRect); } break; - case Qt::Repeat: + case Qt::RepeatTile: if (targetMargins.left() > 0 && sourceMargins.left() > 0) { // left const QRect targetLeftRect(targetLeft, targetCenterTop, targetMargins.left(), targetCenterHeight); const QRect sourceLeftRect(sourceLeft, sourceCenterTop, sourceMargins.left(), sourceCenterHeight); @@ -1289,7 +1289,7 @@ void qDrawBorderPixmap(QPainter *painter, const QRect &targetRect, const QMargin qDrawVerticallyRepeatedPixmap(painter, targetRightRect, pixmap, sourceRightRect); } break; - case Qt::Round: + case Qt::RoundTile: if (targetMargins.left() > 0 && sourceMargins.left() > 0) { // left const QRect targetLeftRect(targetLeft, targetCenterTop, targetMargins.left(), targetCenterHeight); const QRect sourceLeftRect(sourceLeft, sourceCenterTop, sourceMargins.left(), sourceCenterHeight); @@ -1308,41 +1308,41 @@ void qDrawBorderPixmap(QPainter *painter, const QRect &targetRect, const QMargin const QRect targetCenterRect(targetCenterLeft, targetCenterTop, targetCenterWidth, targetCenterHeight); const QRect sourceCenterRect(sourceCenterLeft, sourceCenterTop, sourceCenterWidth, sourceCenterHeight); switch (rules.horizontal) { - case Qt::Stretch: + case Qt::StretchTile: switch (rules.vertical) { - case Qt::Stretch: // stretch stretch + case Qt::StretchTile: // stretch stretch qDrawPixmap(painter, targetCenterRect, pixmap, sourceCenterRect); break; - case Qt::Repeat: // stretch repeat + case Qt::RepeatTile: // stretch repeat qVerticalRepeat(painter, targetCenterRect, pixmap, sourceCenterRect, qDrawPixmap); break; - case Qt::Round: // stretch round + case Qt::RoundTile: // stretch round qVerticalRound(painter, targetCenterRect, pixmap, sourceCenterRect, qDrawPixmap); break; } break; - case Qt::Repeat: + case Qt::RepeatTile: switch (rules.vertical) { - case Qt::Stretch: // repeat stretch + case Qt::StretchTile: // repeat stretch qHorizontalRepeat(painter, targetCenterRect, pixmap, sourceCenterRect, qDrawPixmap); break; - case Qt::Repeat: // repeat repeat + case Qt::RepeatTile: // repeat repeat qVerticalRepeat(painter, targetCenterRect, pixmap, sourceCenterRect, qDrawHorizontallyRepeatedPixmap); break; - case Qt::Round: // repeat round + case Qt::RoundTile: // repeat round qVerticalRound(painter, targetCenterRect, pixmap, sourceCenterRect, qDrawHorizontallyRepeatedPixmap); break; } break; - case Qt::Round: + case Qt::RoundTile: switch (rules.vertical) { - case Qt::Stretch: // round stretch + case Qt::StretchTile: // round stretch qHorizontalRound(painter, targetCenterRect, pixmap, sourceCenterRect, qDrawPixmap); break; - case Qt::Repeat: // round repeat + case Qt::RepeatTile: // round repeat qHorizontalRound(painter, targetCenterRect, pixmap, sourceCenterRect, qDrawVerticallyRepeatedPixmap); break; - case Qt::Round: // round round + case Qt::RoundTile: // round round qHorizontalRound(painter, targetCenterRect, pixmap, sourceCenterRect, qDrawVerticallyRoundedPixmap); break; } diff --git a/src/gui/painting/qdrawutil.h b/src/gui/painting/qdrawutil.h index 3a2dd0e..22a57e9 100644 --- a/src/gui/painting/qdrawutil.h +++ b/src/gui/painting/qdrawutil.h @@ -137,22 +137,22 @@ struct QTileRules { inline QTileRules(Qt::TileRule horizontalRule, Qt::TileRule verticalRule) : horizontal(horizontalRule), vertical(verticalRule) {} - inline QTileRules(Qt::TileRule rule = Qt::Stretch) + inline QTileRules(Qt::TileRule rule = Qt::StretchTile) : horizontal(rule), vertical(rule) {} Qt::TileRule horizontal; Qt::TileRule vertical; }; -Q_GUI_EXPORT void qDrawBorderPixmap(QPainter *painter, - const QRect &targetRect, - const QMargins &targetMargins, +Q_GUI_EXPORT void qDrawBorderPixmap(QPainter *painter, + const QRect &targetRect, + const QMargins &targetMargins, const QPixmap &pixmap, - const QRect &sourceRect, - const QMargins &sourceMargins, + const QRect &sourceRect, + const QMargins &sourceMargins, const QTileRules &rules = QTileRules()); -inline void qDrawBorderPixmap(QPainter *painter, - const QRect &target, - const QMargins &margins, +inline void qDrawBorderPixmap(QPainter *painter, + const QRect &target, + const QMargins &margins, const QPixmap &pixmap) { qDrawBorderPixmap(painter, target, margins, pixmap, pixmap.rect(), margins); diff --git a/src/gui/styles/qstylesheetstyle.cpp b/src/gui/styles/qstylesheetstyle.cpp index 0f3a88b..707b05e 100644 --- a/src/gui/styles/qstylesheetstyle.cpp +++ b/src/gui/styles/qstylesheetstyle.cpp @@ -1126,7 +1126,7 @@ void QRenderRule::fixupBorder(int nativeWidth) void QRenderRule::drawBorderImage(QPainter *p, const QRect& rect) { static const Qt::TileRule tileMode2TileRule[] = { - Qt::Stretch, Qt::Round, Qt::Stretch, Qt::Repeat, Qt::Stretch }; + Qt::StretchTile, Qt::RoundTile, Qt::StretchTile, Qt::RepeatTile, Qt::StretchTile }; const QStyleSheetBorderImageData *borderImageData = border()->borderImage(); const int *targetBorders = border()->borders; -- cgit v0.12 From 1f4e378ca0f9c63bb99a92f3e98b104a0baa408a Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Fri, 2 Oct 2009 13:54:29 +0200 Subject: Mac: update/small fix to 45f095b8970dc3c1b6f6e97fa2323654ba848288 It turns out that we need to let singleStep keep its value in qtextedit so that pushing the up/down buttons on the slider works as they should. Moreover, overriding the behaviour in abstract slider also makes QGraphicsView work out of the box. Also added in the test fix suggested by Olivier. --- src/gui/widgets/qabstractslider.cpp | 21 ++++++++++++++------- src/gui/widgets/qtextedit.cpp | 5 ----- tests/auto/qtableview/tst_qtableview.cpp | 9 ++++++++- 3 files changed, 22 insertions(+), 13 deletions(-) diff --git a/src/gui/widgets/qabstractslider.cpp b/src/gui/widgets/qabstractslider.cpp index c3289b4..28f3be3 100644 --- a/src/gui/widgets/qabstractslider.cpp +++ b/src/gui/widgets/qabstractslider.cpp @@ -693,13 +693,8 @@ void QAbstractSlider::wheelEvent(QWheelEvent * e) if (e->orientation() != d->orientation && !rect().contains(e->pos())) return; - int step = qMin(QApplication::wheelScrollLines() * d->singleStep, d->pageStep); - if ((e->modifiers() & Qt::ControlModifier) || (e->modifiers() & Qt::ShiftModifier)) - step = d->pageStep; - - qreal currentOffset = qreal(e->delta()) * step / 120; + qreal currentOffset = qreal(e->delta()) / 120; d->offset_accumulated += d->invertedControls ? -currentOffset : currentOffset; - if (int(d->offset_accumulated) == 0) { // QAbstractSlider works on integer values. So if the accumulated // offset is less than +/- 1, we need to wait until we get more @@ -708,8 +703,20 @@ void QAbstractSlider::wheelEvent(QWheelEvent * e) return; } + // Calculate the number of steps to scroll (per 15 degrees of rotate): +#ifdef Q_OS_MAC + // On mac, since mouse wheel scrolling is accelerated and + // fine tuned by the OS, we skip applying acceleration: + int stepsToScroll = int(d->offset_accumulated); +#else + int step = qMin(QApplication::wheelScrollLines() * d->singleStep, d->pageStep); + if ((e->modifiers() & Qt::ControlModifier) || (e->modifiers() & Qt::ShiftModifier)) + step = d->pageStep; + int stepsToScroll = step * int(d->offset_accumulated); +#endif + int prevValue = d->value; - d->position = d->overflowSafeAdd(int(d->offset_accumulated)); // value will be updated by triggerAction() + d->position = d->overflowSafeAdd(stepsToScroll); // value will be updated by triggerAction() triggerAction(SliderMove); if (prevValue == d->value) { diff --git a/src/gui/widgets/qtextedit.cpp b/src/gui/widgets/qtextedit.cpp index 3fe9bb4..dc78fd5 100644 --- a/src/gui/widgets/qtextedit.cpp +++ b/src/gui/widgets/qtextedit.cpp @@ -174,13 +174,8 @@ void QTextEditPrivate::init(const QString &html) if (!html.isEmpty()) control->setHtml(html); -#ifdef Q_OS_MAC - hbar->setSingleStep(1); - vbar->setSingleStep(1); -#else hbar->setSingleStep(20); vbar->setSingleStep(20); -#endif viewport->setBackgroundRole(QPalette::Base); q->setAcceptDrops(true); diff --git a/tests/auto/qtableview/tst_qtableview.cpp b/tests/auto/qtableview/tst_qtableview.cpp index 03f4966..09e1e87 100644 --- a/tests/auto/qtableview/tst_qtableview.cpp +++ b/tests/auto/qtableview/tst_qtableview.cpp @@ -3201,9 +3201,17 @@ void tst_QTableView::mouseWheel_data() QTest::newRow("scroll down per item") << int(QAbstractItemView::ScrollPerItem) << -120 << 10 + qApp->wheelScrollLines() << 10 + qApp->wheelScrollLines(); +#ifdef Q_WS_MAC + // On Mac, we always scroll one pixel per 120 delta (rather than multiplying with + // singleStep) since wheel events are accelerated by the OS. + QTest::newRow("scroll down per pixel") + << int(QAbstractItemView::ScrollPerPixel) << -120 + << 10 + qApp->wheelScrollLines() << 10 + qApp->wheelScrollLines(); +#else QTest::newRow("scroll down per pixel") << int(QAbstractItemView::ScrollPerPixel) << -120 << 10 + qApp->wheelScrollLines() * 89 << 10 + qApp->wheelScrollLines() * 28; +#endif } void tst_QTableView::mouseWheel() @@ -3230,7 +3238,6 @@ void tst_QTableView::mouseWheel() view.horizontalScrollBar()->setValue(10); view.verticalScrollBar()->setValue(10); - qDebug() << "delta" << delta << view.viewport()->geometry(); QPoint pos = view.viewport()->geometry().center(); QWheelEvent verticalEvent(pos, delta, 0, 0, Qt::Vertical); QWheelEvent horizontalEvent(pos, delta, 0, 0, Qt::Horizontal); -- cgit v0.12 From 64111efde9795c51cda7aa0b63d2b4b597aa139c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Fri, 2 Oct 2009 13:31:23 +0200 Subject: renaming ppc mkspec to powerpc Reviewed-by:paul --- configure | 5 +--- mkspecs/qws/linux-powerpc-g++/qmake.conf | 20 +++++++++++++ mkspecs/qws/linux-powerpc-g++/qplatformdefs.h | 42 +++++++++++++++++++++++++++ mkspecs/qws/linux-ppc-g++/qmake.conf | 20 ------------- mkspecs/qws/linux-ppc-g++/qplatformdefs.h | 42 --------------------------- 5 files changed, 63 insertions(+), 66 deletions(-) create mode 100644 mkspecs/qws/linux-powerpc-g++/qmake.conf create mode 100644 mkspecs/qws/linux-powerpc-g++/qplatformdefs.h delete mode 100644 mkspecs/qws/linux-ppc-g++/qmake.conf delete mode 100644 mkspecs/qws/linux-ppc-g++/qplatformdefs.h diff --git a/configure b/configure index 8ef8ad0..ea50b37 100755 --- a/configure +++ b/configure @@ -2330,9 +2330,6 @@ if [ "$CFG_EMBEDDED" != "no" ]; then *86_64) CFG_EMBEDDED=x86_64 ;; - *ppc) - CFG_EMBEDDED=ppc - ;; *) CFG_EMBEDDED=generic ;; @@ -2762,7 +2759,7 @@ if [ "$PLATFORM" != "$XPLATFORM" -a "$CFG_EMBEDDED" != "no" ]; then ipaq|sharp) CFG_ARCH=arm ;; - dm7000|ppc) + dm7000) CFG_ARCH=powerpc ;; dm800) diff --git a/mkspecs/qws/linux-powerpc-g++/qmake.conf b/mkspecs/qws/linux-powerpc-g++/qmake.conf new file mode 100644 index 0000000..e1926b4 --- /dev/null +++ b/mkspecs/qws/linux-powerpc-g++/qmake.conf @@ -0,0 +1,20 @@ +# +# qmake configuration for building with g++ +# + +include(../../common/g++.conf) +include(../../common/linux.conf) +include(../../common/qws.conf) + +# modifications to g++.conf +QMAKE_CC = powerpc-linux-gcc +QMAKE_CXX = powerpc-linux-g++ +QMAKE_LINK = powerpc-linux-g++ +QMAKE_LINK_SHLIB = powerpc-linux-g++ + +# modifications to linux.conf +QMAKE_AR = powerpc-linux-ar cqs +QMAKE_OBJCOPY = powerpc-linux-objcopy +QMAKE_STRIP = powerpc-linux-strip + +load(qt_config) diff --git a/mkspecs/qws/linux-powerpc-g++/qplatformdefs.h b/mkspecs/qws/linux-powerpc-g++/qplatformdefs.h new file mode 100644 index 0000000..60e0f5e --- /dev/null +++ b/mkspecs/qws/linux-powerpc-g++/qplatformdefs.h @@ -0,0 +1,42 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the qmake spec of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "../../linux-g++/qplatformdefs.h" diff --git a/mkspecs/qws/linux-ppc-g++/qmake.conf b/mkspecs/qws/linux-ppc-g++/qmake.conf deleted file mode 100644 index e1926b4..0000000 --- a/mkspecs/qws/linux-ppc-g++/qmake.conf +++ /dev/null @@ -1,20 +0,0 @@ -# -# qmake configuration for building with g++ -# - -include(../../common/g++.conf) -include(../../common/linux.conf) -include(../../common/qws.conf) - -# modifications to g++.conf -QMAKE_CC = powerpc-linux-gcc -QMAKE_CXX = powerpc-linux-g++ -QMAKE_LINK = powerpc-linux-g++ -QMAKE_LINK_SHLIB = powerpc-linux-g++ - -# modifications to linux.conf -QMAKE_AR = powerpc-linux-ar cqs -QMAKE_OBJCOPY = powerpc-linux-objcopy -QMAKE_STRIP = powerpc-linux-strip - -load(qt_config) diff --git a/mkspecs/qws/linux-ppc-g++/qplatformdefs.h b/mkspecs/qws/linux-ppc-g++/qplatformdefs.h deleted file mode 100644 index 60e0f5e..0000000 --- a/mkspecs/qws/linux-ppc-g++/qplatformdefs.h +++ /dev/null @@ -1,42 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the qmake spec of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "../../linux-g++/qplatformdefs.h" -- cgit v0.12 From 0e498bdf15e38cc0700fa03c5e20e25559186971 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Fri, 2 Oct 2009 14:00:08 +0200 Subject: Doc: Fixed license header. Reviewed-by: Trust Me --- doc/src/diagrams/programs/standard_views.py | 40 +++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/doc/src/diagrams/programs/standard_views.py b/doc/src/diagrams/programs/standard_views.py index f1d69f6..5581387 100644 --- a/doc/src/diagrams/programs/standard_views.py +++ b/doc/src/diagrams/programs/standard_views.py @@ -1,4 +1,44 @@ #!/usr/bin/env python +############################################################################# +## +## Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +## All rights reserved. +## Contact: Nokia Corporation (qt-info@nokia.com) +## +## This file is part of the test suite of the Qt Toolkit. +## +## $QT_BEGIN_LICENSE:LGPL$ +## No Commercial Usage +## This file contains pre-release code and may not be distributed. +## You may use this file in accordance with the terms and conditions +## contained in the Technology Preview License Agreement accompanying +## this package. +## +## 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 as published by the Free Software +## Foundation and appearing in the file LICENSE.LGPL included in the +## packaging of this file. Please review the following information to +## ensure the GNU Lesser General Public License version 2.1 requirements +## will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +## +## In addition, as a special exception, Nokia gives you certain additional +## rights. These rights are described in the Nokia Qt LGPL Exception +## version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +## +## If you have questions regarding the use of this file, please contact +## Nokia at qt-info@nokia.com. +## +## +## +## +## +## +## +## +## $QT_END_LICENSE$ +## +############################################################################# import sys from PyQt4.QtCore import QDir, Qt -- cgit v0.12 From 4f0f9f106d1e3e7d08280efbf7d4a2ff3552a361 Mon Sep 17 00:00:00 2001 From: Paul Olav Tvete Date: Fri, 2 Oct 2009 14:29:41 +0200 Subject: Stabilize the SyntheticEnterLeave tests. Reset the mouse position to a known state at the start, instead of depending on what the previous test did. Reviewed-by: Jeremy --- tests/auto/qwidget/tst_qwidget.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/auto/qwidget/tst_qwidget.cpp b/tests/auto/qwidget/tst_qwidget.cpp index a9033ba..e31d621 100644 --- a/tests/auto/qwidget/tst_qwidget.cpp +++ b/tests/auto/qwidget/tst_qwidget.cpp @@ -8892,6 +8892,8 @@ void tst_QWidget::syntheticEnterLeave() int numLeaveEvents; }; + QCursor::setPos(QPoint(0,0)); + MyWidget window; window.setWindowFlags(Qt::WindowStaysOnTopHint); window.resize(200, 200); @@ -9009,6 +9011,8 @@ void tst_QWidget::taskQTBUG_4055_sendSyntheticEnterLeave() int numEnterEvents, numMouseMoveEvents; }; + QCursor::setPos(QPoint(0,0)); + SELParent parent; parent.resize(200, 200); SELChild child(&parent); -- cgit v0.12 From 2bfff24add67c1e5e0b1273a4b0399d9d94316c1 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Fri, 2 Oct 2009 14:04:43 +0200 Subject: doc: Fixed numerous qdoc errors. --- doc/src/frameworks-technologies/gestures.qdoc | 2 -- doc/src/qt-resources.qdoc | 1 + examples/gestures/imageviewer/imagewidget.cpp | 2 +- src/3rdparty/webkit/WebKit/qt/Api/qwebview.cpp | 2 ++ src/3rdparty/webkit/WebKit/qt/Api/qwebview.h | 1 + src/corelib/global/qnamespace.qdoc | 6 ------ src/gui/image/qpixmap_s60.cpp | 4 ++-- src/testlib/qtestcase.cpp | 4 ++-- tools/qdoc3/test/qt-inc.qdocconf | 1 + 9 files changed, 10 insertions(+), 13 deletions(-) diff --git a/doc/src/frameworks-technologies/gestures.qdoc b/doc/src/frameworks-technologies/gestures.qdoc index 1e3cc47..158a273 100644 --- a/doc/src/frameworks-technologies/gestures.qdoc +++ b/doc/src/frameworks-technologies/gestures.qdoc @@ -102,8 +102,6 @@ \snippet examples/gestures/imageviewer/imagewidget.cpp swipe slot start - \snippet examples/gestures/imageviewer/imagewidget.cpp swipe slot finish - Here, we examine the direction in which the user swiped the widget and modify its contents accordingly. diff --git a/doc/src/qt-resources.qdoc b/doc/src/qt-resources.qdoc index a7dffe4..3b31660 100644 --- a/doc/src/qt-resources.qdoc +++ b/doc/src/qt-resources.qdoc @@ -41,5 +41,6 @@ /*! \page qt-resources.html + \title Not Used \image gradient.png */ diff --git a/examples/gestures/imageviewer/imagewidget.cpp b/examples/gestures/imageviewer/imagewidget.cpp index 2be6cc5..3489b5b 100644 --- a/examples/gestures/imageviewer/imagewidget.cpp +++ b/examples/gestures/imageviewer/imagewidget.cpp @@ -145,7 +145,7 @@ void ImageWidget::swipeTriggered() goNextImage(); update(); } -//! [swipe slot finish] +//! [swipe slot start] void ImageWidget::resizeEvent(QResizeEvent*) { diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebview.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebview.cpp index c7515ab..3c5f89f 100644 --- a/src/3rdparty/webkit/WebKit/qt/Api/qwebview.cpp +++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebview.cpp @@ -650,6 +650,7 @@ qreal QWebView::textSizeMultiplier() const return page()->mainFrame()->textSizeMultiplier(); } +#if !defined(Q_OS_SYMBIAN) /*! \property QWebView::renderHints \since 4.6 @@ -661,6 +662,7 @@ qreal QWebView::textSizeMultiplier() const \sa QPainter::renderHints() */ +#endif QPainter::RenderHints QWebView::renderHints() const { return d->renderHints; diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebview.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebview.h index 0f2649d..15b5836 100644 --- a/src/3rdparty/webkit/WebKit/qt/Api/qwebview.h +++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebview.h @@ -53,6 +53,7 @@ class QWEBKIT_EXPORT QWebView : public QWidget { // FIXME: temporary work around for elftran issue that it couldn't find the QPainter::staticMetaObject // symbol from Qt lib; it should be reverted after the right symbol is exported. +// remember to revert the qdoc \property comment as well. // See bug: http://qt.nokia.com/developer/task-tracker/index_html?method=entry&id=258893 #if !defined(Q_OS_SYMBIAN) Q_PROPERTY(QPainter::RenderHints renderHints READ renderHints WRITE setRenderHints) diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc index 482beed..6f0b0ee 100644 --- a/src/corelib/global/qnamespace.qdoc +++ b/src/corelib/global/qnamespace.qdoc @@ -612,12 +612,6 @@ */ /*! - \enum Qt::CoordinateSystem - \value DeviceCoordinates - \value LogicalCoordinates - */ - -/*! \enum Qt::CaseSensitivity \value CaseInsensitive diff --git a/src/gui/image/qpixmap_s60.cpp b/src/gui/image/qpixmap_s60.cpp index 4938442..326dd10 100644 --- a/src/gui/image/qpixmap_s60.cpp +++ b/src/gui/image/qpixmap_s60.cpp @@ -64,7 +64,7 @@ const uchar qt_pixmap_bit_mask[] = { 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80 }; -/*! +/* \class QSymbianFbsClient \since 4.6 \internal @@ -145,7 +145,7 @@ void QSymbianFbsHeapLock::relock() qt_symbianFbsClient()->lockHeap(); } -/*! +/* \class QSymbianBitmapDataAccess \since 4.6 \internal diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp index eb4dee1..9dea6dc 100644 --- a/src/testlib/qtestcase.cpp +++ b/src/testlib/qtestcase.cpp @@ -734,12 +734,12 @@ QT_BEGIN_NAMESPACE \sa QTest::qSleep() */ -/*! \fn void QTest::qWaitForWindowShown(QWidget *window) +/*! \fn bool QTest::qWaitForWindowShown(QWidget *window) \since 4.6 Waits until the \a window is shown in the screen. This is mainly useful for asynchronous systems like X11, where a window will be mapped to screen some - time after being asked to show itself on the screen. + time after being asked to show itself on the screen. Returns true. Example: \snippet doc/src/snippets/code/src_qtestlib_qtestcase.cpp 24 diff --git a/tools/qdoc3/test/qt-inc.qdocconf b/tools/qdoc3/test/qt-inc.qdocconf index 48a0d27..2ff5682 100644 --- a/tools/qdoc3/test/qt-inc.qdocconf +++ b/tools/qdoc3/test/qt-inc.qdocconf @@ -115,6 +115,7 @@ Cpp.ignoredirectives = Q_DECLARE_HANDLE \ Q_ENUMS \ Q_FLAGS \ Q_INTERFACES \ + Q_OS_SYMBIAN \ __attribute__ HTML.stylesheets = $QTDIR/util/qdoc3/test/classic.css -- cgit v0.12 From a841c496bb7ca54fef01f9785e0d91991172b182 Mon Sep 17 00:00:00 2001 From: "Bradley T. Hughes" Date: Fri, 2 Oct 2009 15:01:48 +0200 Subject: Use multimedia timers on Windows for timers less than 16ms According to http://msdn.microsoft.com/en-us/library/ms725496(VS.85).aspx, the system time resolution is 10-16ms, so we should use multimedia timers for anything less than 16ms (the worst case). --- src/corelib/kernel/qeventdispatcher_win.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/kernel/qeventdispatcher_win.cpp b/src/corelib/kernel/qeventdispatcher_win.cpp index 0474bf3..aae351c 100644 --- a/src/corelib/kernel/qeventdispatcher_win.cpp +++ b/src/corelib/kernel/qeventdispatcher_win.cpp @@ -539,7 +539,7 @@ void QEventDispatcherWin32Private::registerTimer(WinTimerInfo *t) int ok = 0; - if (t->interval > 10 || !t->interval || !qtimeSetEvent) { + if (t->interval > 15 || !t->interval || !qtimeSetEvent) { ok = 1; if (!t->interval) // optimization for single-shot-zero-timer QCoreApplication::postEvent(q, new QZeroTimerEvent(t->timerId)); -- cgit v0.12 From c206ea53ebac0436bad0c00c1e340f23efb3aa16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sami=20Meril=C3=A4?= Date: Fri, 2 Oct 2009 16:15:56 +0300 Subject: Filedialog impossible to use with keypad navigation QFileDialog contains own internal derived classes for line edit and list view. Unfortunately, these classes do not handle keypad navigation correctly - they just accept the navigation key events, causing the navigation to halt. Added support for QFileDialogListView, QFileDialogTreeView and private filedialog class QFileDialogPrivate to handle and possibly ignore keypad navigaion key events. Additionally, added support to keypad navigation to ignore empty widgets. This allows keypad navigation not to go invisible when empty widgets are tried to be navigated into. Task-number: QT-643 Reviewed-by: Alessandro Portale --- src/gui/dialogs/qfiledialog.cpp | 22 +++++++++++++++++++++- src/gui/kernel/qwidget.cpp | 10 +++++++--- 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/src/gui/dialogs/qfiledialog.cpp b/src/gui/dialogs/qfiledialog.cpp index 297c900..eb5fed0 100644 --- a/src/gui/dialogs/qfiledialog.cpp +++ b/src/gui/dialogs/qfiledialog.cpp @@ -3022,6 +3022,12 @@ bool QFileDialogPrivate::itemViewKeyboardEvent(QKeyEvent *event) { case Qt::Key_Escape: q->hide(); return true; +#ifdef QT_KEYPAD_NAVIGATION + case Qt::Key_Down: + case Qt::Key_Up: + return (QApplication::navigationMode() != Qt::NavigationModeKeypadTabOrder + && QApplication::navigationMode() != Qt::NavigationModeKeypadDirectional); +#endif default: break; } @@ -3142,7 +3148,17 @@ void QFileDialogListView::keyPressEvent(QKeyEvent *e) if (!d_ptr->itemViewKeyboardEvent(e)) { QListView::keyPressEvent(e); } +#ifdef QT_KEYPAD_NAVIGATION + if ((QApplication::navigationMode() == Qt::NavigationModeKeypadTabOrder + || QApplication::navigationMode() == Qt::NavigationModeKeypadDirectional) + && !hasEditFocus()) { + e->ignore(); + } else { + e->accept(); + } +#else e->accept(); +#endif } QFileDialogTreeView::QFileDialogTreeView(QWidget *parent) : QTreeView(parent) @@ -3189,7 +3205,11 @@ void QFileDialogLineEdit::keyPressEvent(QKeyEvent *e) { int key = e->key(); QLineEdit::keyPressEvent(e); - if (key != Qt::Key_Escape) + if (key != Qt::Key_Escape +#ifdef QT_KEYPAD_NAVIGATION + && QApplication::navigationMode() == Qt::NavigationModeNone +#endif + ) e->accept(); if (hideOnEsc && (key == Qt::Key_Escape || key == Qt::Key_Return || key == Qt::Key_Enter)) { e->accept(); diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index 0b75b06..3cfbb09 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -11444,11 +11444,15 @@ QWidget *QWidgetPrivate::widgetInNavigationDirection(Direction direction) QWidget *targetWidget = 0; int shortestDistance = INT_MAX; foreach(QWidget *targetCandidate, QApplication::allWidgets()) { - - if (targetCandidate->focusProxy()) //skip if focus proxy set - continue; const QRect targetCandidateRect = targetCandidate->rect().translated(targetCandidate->mapToGlobal(QPoint())); + + // For focus proxies, the child widget handling the focus can have keypad navigation focus, + // but the owner of the proxy cannot. + // Additionally, empty widgets should be ignored. + if (targetCandidate->focusProxy() || targetCandidateRect.isEmpty()) + continue; + if ( targetCandidate != sourceWidget && targetCandidate->focusPolicy() & Qt::TabFocus && !(direction == DirectionNorth && targetCandidateRect.bottom() > sourceRect.top()) -- cgit v0.12