From 0963768ba79b6304c27c9ea293c71824e77a64ef Mon Sep 17 00:00:00 2001 From: Jens Bache-Wiig Date: Thu, 3 Sep 2009 16:42:47 +0200 Subject: Make itemviews use gradient selection on Vista by default We postponed this in 4.3 when the vista style was introduced since a lot of microsoft apps still used the legacy style and microsoft did not enable it by default. It has been reported as bugs a few times and it seems increasingly odd that we are not using the more modern look and feel when we can. Instead of only enabling it for QTreeView, we now only disable it for QTableView as the look still cannot be used to span vertical cells. Task-number: QTBUG-3746 Reviewed-by: prasanth --- src/gui/styles/qwindowsvistastyle.cpp | 22 ++++++++-------------- src/gui/styles/qwindowsvistastyle_p.h | 1 + 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/src/gui/styles/qwindowsvistastyle.cpp b/src/gui/styles/qwindowsvistastyle.cpp index b062a3f..6cb8b40 100644 --- a/src/gui/styles/qwindowsvistastyle.cpp +++ b/src/gui/styles/qwindowsvistastyle.cpp @@ -731,14 +731,11 @@ void QWindowsVistaStyle::drawPrimitive(PrimitiveElement element, const QStyleOpt { const QStyleOptionViewItemV4 *vopt; const QAbstractItemView *view = qobject_cast(widget); - bool newStyle = false; + bool newStyle = true; + + if (qobject_cast(widget)) + newStyle = false; - if (const QListView *listview = qobject_cast(widget)) { - if (listview->viewMode() == QListView::IconMode) - newStyle = true; - } else if (qobject_cast(widget)) { - newStyle = true; - } if (newStyle && view && (vopt = qstyleoption_cast(option))) { bool selected = vopt->state & QStyle::State_Selected; bool hover = vopt->state & QStyle::State_MouseOver; @@ -1496,14 +1493,11 @@ void QWindowsVistaStyle::drawControl(ControlElement element, const QStyleOption { const QStyleOptionViewItemV4 *vopt; const QAbstractItemView *view = qobject_cast(widget); - bool newStyle = false; + bool newStyle = true; + + if (qobject_cast(widget)) + newStyle = false; - if (const QListView *listview = qobject_cast(widget)) { - if (listview->viewMode() == QListView::IconMode) - newStyle = true; - } else if (qobject_cast(widget)) { - newStyle = true; - } if (newStyle && view && (vopt = qstyleoption_cast(option))) { /* // We cannot currently get the correct selection color for "explorer style" views diff --git a/src/gui/styles/qwindowsvistastyle_p.h b/src/gui/styles/qwindowsvistastyle_p.h index d4170aa..e9bbb77 100644 --- a/src/gui/styles/qwindowsvistastyle_p.h +++ b/src/gui/styles/qwindowsvistastyle_p.h @@ -84,6 +84,7 @@ #include #include #include +#include #include #include -- cgit v0.12 From 4cc9fcac3ef66987b95a5589f10f3a0d82a778f4 Mon Sep 17 00:00:00 2001 From: Jens Bache-Wiig Date: Fri, 4 Sep 2009 17:16:18 +0200 Subject: Fix duplicate key events from extended media keys on Windows We handle WM_APPCOMMAND to generate keyEvents separate from normal key events. However when we already have virtual key mappings for the same keys the events got delivered twice. Hence we have now removed WM_APPCOMMAND handling for all such keys. Task-number: QTBUG-4124 Reviewed-by: prasanth --- src/gui/kernel/qapplication_win.cpp | 61 ------------------------------------- 1 file changed, 61 deletions(-) diff --git a/src/gui/kernel/qapplication_win.cpp b/src/gui/kernel/qapplication_win.cpp index 6ecd535..eb9e276 100644 --- a/src/gui/kernel/qapplication_win.cpp +++ b/src/gui/kernel/qapplication_win.cpp @@ -1752,79 +1752,18 @@ LRESULT CALLBACK QtWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam case APPCOMMAND_BASS_UP: key = Qt::Key_BassUp; break; - case APPCOMMAND_BROWSER_BACKWARD: - key = Qt::Key_Back; - break; - case APPCOMMAND_BROWSER_FAVORITES: - key = Qt::Key_Favorites; - break; - case APPCOMMAND_BROWSER_FORWARD: - key = Qt::Key_Forward; - break; - case APPCOMMAND_BROWSER_HOME: - key = Qt::Key_HomePage; - break; - case APPCOMMAND_BROWSER_REFRESH: - key = Qt::Key_Refresh; - break; - case APPCOMMAND_BROWSER_SEARCH: - key = Qt::Key_Search; - break; - case APPCOMMAND_BROWSER_STOP: - key = Qt::Key_Stop; - break; - case APPCOMMAND_LAUNCH_APP1: - key = Qt::Key_Launch0; - break; - case APPCOMMAND_LAUNCH_APP2: - key = Qt::Key_Launch1; - break; - case APPCOMMAND_LAUNCH_MAIL: - key = Qt::Key_LaunchMail; - break; - case APPCOMMAND_LAUNCH_MEDIA_SELECT: - key = Qt::Key_LaunchMedia; - break; - case APPCOMMAND_MEDIA_NEXTTRACK: - key = Qt::Key_MediaNext; - break; - case APPCOMMAND_MEDIA_PLAY_PAUSE: - key = Qt::Key_MediaPlay; - break; - case APPCOMMAND_MEDIA_PREVIOUSTRACK: - key = Qt::Key_MediaPrevious; - break; - case APPCOMMAND_MEDIA_STOP: - key = Qt::Key_MediaStop; - break; case APPCOMMAND_TREBLE_DOWN: key = Qt::Key_TrebleDown; break; case APPCOMMAND_TREBLE_UP: key = Qt::Key_TrebleUp; break; - case APPCOMMAND_VOLUME_DOWN: - key = Qt::Key_VolumeDown; - break; - case APPCOMMAND_VOLUME_MUTE: - key = Qt::Key_VolumeMute; - break; - case APPCOMMAND_VOLUME_UP: - key = Qt::Key_VolumeUp; - break; - // Commands new in Windows XP case APPCOMMAND_HELP: key = Qt::Key_Help; break; case APPCOMMAND_FIND: key = Qt::Key_Search; break; - case APPCOMMAND_PRINT: - key = Qt::Key_Print; - break; - case APPCOMMAND_MEDIA_PLAY: - key = Qt::Key_MediaPlay; - break; default: break; } -- cgit v0.12 From c5c58c2368f71c5d0067c9389c8ad04c41b66db5 Mon Sep 17 00:00:00 2001 From: Jens Bache-Wiig Date: Wed, 9 Sep 2009 15:09:34 +0200 Subject: Fix regression in Command link button font size Since vista style polish sets the font on polish, the check for WA_SetFont will succeed, hence we never set the actual font. I replaced the check with a full resolve. However since the resolve would clear the resolve_mask, from the widget font it has to be restored manually so that QPainter:setFont can resolve it later. Task-number: QTBUG-4646 Reviewed-by: trond --- src/gui/text/qfont.h | 1 + src/gui/widgets/qcommandlinkbutton.cpp | 27 +++++++++++++++++++-------- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/src/gui/text/qfont.h b/src/gui/text/qfont.h index ef91983..d73e1c4 100644 --- a/src/gui/text/qfont.h +++ b/src/gui/text/qfont.h @@ -309,6 +309,7 @@ private: friend class QPicturePaintEngine; friend class QPainterReplayer; friend class QPaintBufferEngine; + friend class QCommandLinkButtonPrivate; #ifndef QT_NO_DATASTREAM friend Q_GUI_EXPORT QDataStream &operator<<(QDataStream &, const QFont &); diff --git a/src/gui/widgets/qcommandlinkbutton.cpp b/src/gui/widgets/qcommandlinkbutton.cpp index e64f687..9adf280 100644 --- a/src/gui/widgets/qcommandlinkbutton.cpp +++ b/src/gui/widgets/qcommandlinkbutton.cpp @@ -140,23 +140,34 @@ QFont QCommandLinkButtonPrivate::titleFont() const Q_Q(const QCommandLinkButton); QFont font = q->font(); if (usingVistaStyle()) { - if (!q->testAttribute(Qt::WA_SetFont)) - font.setPointSizeF(12.0); + font.setPointSizeF(12.0); } else { font.setBold(true); - if (!q->testAttribute(Qt::WA_SetFont)) - font.setPointSizeF(9.0); + font.setPointSizeF(9.0); } - return font; + + // Note the font will be resolved against + // QPainters font, so we need to restore the mask + int resolve_mask = font.resolve_mask; + QFont modifiedFont = q->font().resolve(font); + modifiedFont.detach(); + modifiedFont.resolve_mask = resolve_mask; + return modifiedFont; } QFont QCommandLinkButtonPrivate::descriptionFont() const { Q_Q(const QCommandLinkButton); QFont font = q->font(); - if (!q->testAttribute(Qt::WA_SetFont)) - font.setPointSizeF(9.0); - return font; + font.setPointSizeF(9.0); + + // Note the font will be resolved against + // QPainters font, so we need to restore the mask + int resolve_mask = font.resolve_mask; + QFont modifiedFont = q->font().resolve(font); + modifiedFont.detach(); + modifiedFont.resolve_mask = resolve_mask; + return modifiedFont; } QRect QCommandLinkButtonPrivate::titleRect() const -- cgit v0.12 From cf8dcda1316198f2e54195cf7b7137c7ae05f91b Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Wed, 30 Sep 2009 14:46:40 +0200 Subject: Stabilize graphicsview test --- tests/auto/qgraphicsview/tst_qgraphicsview.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/auto/qgraphicsview/tst_qgraphicsview.cpp b/tests/auto/qgraphicsview/tst_qgraphicsview.cpp index 0c27079..78fb4f3 100644 --- a/tests/auto/qgraphicsview/tst_qgraphicsview.cpp +++ b/tests/auto/qgraphicsview/tst_qgraphicsview.cpp @@ -3160,11 +3160,12 @@ void tst_QGraphicsView::moveItemWhileScrolling() if (!adjustForAntialiasing) view.setOptimizationFlag(QGraphicsView::DontAdjustForAntialiasing); view.resize(200, 200); + view.painted = false; view.show(); QTest::qWaitForWindowShown(&view); + QApplication::processEvents(); QTRY_VERIFY(view.painted); view.painted = false; - view.lastPaintedRegion = QRegion(); view.horizontalScrollBar()->setValue(view.horizontalScrollBar()->value() + 10); view.rect->moveBy(0, 10); @@ -3366,6 +3367,7 @@ void tst_QGraphicsView::render() view.painted = false; view.show(); QTest::qWaitForWindowShown(&view); + QApplication::processEvents(); QTRY_VERIFY(view.painted > 0); RenderTester *r1 = new RenderTester(QRectF(0, 0, 50, 50)); -- cgit v0.12 From 0986dab7c77fced09ddb4400b20d3939f4ba1002 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Wed, 30 Sep 2009 14:47:15 +0200 Subject: Add more debug information to the QPrinterInfo test Reviewed-by: Paul --- tests/auto/qprinterinfo/tst_qprinterinfo.cpp | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/tests/auto/qprinterinfo/tst_qprinterinfo.cpp b/tests/auto/qprinterinfo/tst_qprinterinfo.cpp index e397b76..2fa7515 100644 --- a/tests/auto/qprinterinfo/tst_qprinterinfo.cpp +++ b/tests/auto/qprinterinfo/tst_qprinterinfo.cpp @@ -101,6 +101,8 @@ void tst_QPrinterInfo::macFixNameFormat(QString *printerName) #ifdef Q_WS_MAC printerName->replace(QLatin1String("___"), QLatin1String(" @ ")); printerName->replace(QLatin1String("_"), QLatin1String(".")); +#else + Q_UNUSED(printerName); #endif } @@ -282,16 +284,17 @@ void tst_QPrinterInfo::testForPrinters() QCOMPARE(printers.size(), sysPrinters.size()); + QHash qtPrinters; + + for (int j = 0; j < printers.size(); ++j) { + qtPrinters.insert(printers.at(j).printerName(), !printers.at(j).isNull()); + } + for (int i = 0; i < sysPrinters.size(); ++i) { - bool found = false; - for (int j = 0; j < printers.size(); ++j) { - if (sysPrinters.at(i) == printers.at(j).printerName()) { - QVERIFY(!printers.at(j).isNull()); - found = true; - break; - } + if (!qtPrinters.value(sysPrinters.at(i))) { + qDebug() << "Avaliable printers: " << qtPrinters; + QFAIL(qPrintable(QString("Printer '%1' reported by system, but not reported by Qt").arg(sysPrinters.at(i)))); } - if (!found) QFAIL("Printer reported by system, but not reported by Qt"); } #else QSKIP("Test doesn't work on non-Unix", SkipAll); -- cgit v0.12 From a93d0d1f970689991dd113d696e922854ff9ec6a Mon Sep 17 00:00:00 2001 From: axis Date: Tue, 29 Sep 2009 12:53:32 +0200 Subject: Revert "Switched to asynchronous focus handling on Symbian." This reverts commit b6377f43410b14125a66ffd02acde69cfb6e455e. The asynchronous handling caused too many headaches with input methods, which expect the focus status to be updated immediately. This may break the test case that was originally fixed by this patch (I cannot find out which one at the moment), but that will have to be solved in a different way. Conflicts: src/corelib/kernel/qcoreevent.cpp src/corelib/kernel/qcoreevent.h src/gui/kernel/qwidget.cpp src/gui/kernel/qwidget_p.h src/gui/kernel/qwidget_s60.cpp --- src/corelib/kernel/qcoreevent.cpp | 1 - src/corelib/kernel/qcoreevent.h | 4 +--- src/gui/kernel/qapplication_s60.cpp | 18 ++++++++++++++++-- src/gui/kernel/qwidget.cpp | 6 ------ src/gui/kernel/qwidget_p.h | 3 --- src/gui/kernel/qwidget_s60.cpp | 28 ---------------------------- tests/auto/qwidget/tst_qwidget.cpp | 9 --------- 7 files changed, 17 insertions(+), 52 deletions(-) diff --git a/src/corelib/kernel/qcoreevent.cpp b/src/corelib/kernel/qcoreevent.cpp index 185c305..3bef0d4 100644 --- a/src/corelib/kernel/qcoreevent.cpp +++ b/src/corelib/kernel/qcoreevent.cpp @@ -270,7 +270,6 @@ QT_BEGIN_NAMESPACE \omitvalue NetworkReplyUpdated \omitvalue FutureCallOut \omitvalue CocoaRequestModal - \omitvalue SymbianDeferredFocusChanged \omitvalue UpdateSoftKeys \omitvalue NativeGesture */ diff --git a/src/corelib/kernel/qcoreevent.h b/src/corelib/kernel/qcoreevent.h index bc96918..be25b41 100644 --- a/src/corelib/kernel/qcoreevent.h +++ b/src/corelib/kernel/qcoreevent.h @@ -281,9 +281,7 @@ public: RequestSoftwareInputPanel = 199, CloseSoftwareInputPanel = 200, - SymbianDeferredFocusChanged = 201, // Internal for generating asynchronous focus events on Symbian - - UpdateSoftKeys = 202, // Internal for compressing soft key updates + UpdateSoftKeys = 201, // Internal for compressing soft key updates // 512 reserved for Qt Jambi's MetaCall event // 513 reserved for Qt Jambi's DeleteOnMainThread event diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp index 0650f6c..498b1e7 100644 --- a/src/gui/kernel/qapplication_s60.cpp +++ b/src/gui/kernel/qapplication_s60.cpp @@ -845,8 +845,22 @@ void QSymbianControl::FocusChanged(TDrawNow /* aDrawNow */) || (qwidget->windowType() & Qt::Popup) == Qt::Popup) return; - QEvent *deferredFocusEvent = new QEvent(QEvent::SymbianDeferredFocusChanged); - QApplication::postEvent(qwidget, deferredFocusEvent); + if (IsFocused()) { + QApplication::setActiveWindow(qwidget); +#ifdef Q_WS_S60 + // If widget is fullscreen, hide status pane and button container + // otherwise show them. + CEikStatusPane* statusPane = S60->statusPane(); + CEikButtonGroupContainer* buttonGroup = S60->buttonGroupContainer(); + bool isFullscreen = qwidget->windowState() & Qt::WindowFullScreen; + if (statusPane && (statusPane->IsVisible() == isFullscreen)) + statusPane->MakeVisible(!isFullscreen); + if (buttonGroup && (buttonGroup->IsVisible() == isFullscreen)) + buttonGroup->MakeVisible(!isFullscreen); +#endif + } else { + QApplication::setActiveWindow(0); + } } void QSymbianControl::HandleResourceChange(int resourceType) diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index 08fe5b9..45b0dac 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -8336,12 +8336,6 @@ bool QWidget::event(QEvent *event) (void) QApplication::sendEvent(this, &mouseEvent); break; } - case QEvent::SymbianDeferredFocusChanged: { -#ifdef Q_OS_SYMBIAN - d->handleSymbianDeferredFocusChanged(); -#endif - break; - } #ifndef QT_NO_PROPERTIES case QEvent::DynamicPropertyChange: { const QByteArray &propName = static_cast(event)->propertyName(); diff --git a/src/gui/kernel/qwidget_p.h b/src/gui/kernel/qwidget_p.h index 296c5b1..15f316d 100644 --- a/src/gui/kernel/qwidget_p.h +++ b/src/gui/kernel/qwidget_p.h @@ -286,9 +286,6 @@ public: QPalette naturalWidgetPalette(uint inheritedMask) const; void setMask_sys(const QRegion &); -#ifdef Q_OS_SYMBIAN - void handleSymbianDeferredFocusChanged(); -#endif void raise_sys(); void lower_sys(); diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp index 6b5e9b7..f64263b 100644 --- a/src/gui/kernel/qwidget_s60.cpp +++ b/src/gui/kernel/qwidget_s60.cpp @@ -367,34 +367,6 @@ void QWidgetPrivate::setFocus_sys() q->effectiveWinId()->SetFocus(true); } -void QWidgetPrivate::handleSymbianDeferredFocusChanged() -{ - Q_Q(QWidget); - WId control = q->internalWinId(); - if (!control) { - // This could happen if the widget was reparented, while the focuschange - // was in the event queue. - return; - } - - if (control->IsFocused()) { - QApplication::setActiveWindow(q); -#ifdef Q_WS_S60 - // If widget is fullscreen, hide status pane and button container - // otherwise show them. - CEikStatusPane* statusPane = S60->statusPane(); - CEikButtonGroupContainer* buttonGroup = S60->buttonGroupContainer(); - bool isFullscreen = q->windowState() & Qt::WindowFullScreen; - if (statusPane && (statusPane->IsVisible() == isFullscreen)) - statusPane->MakeVisible(!isFullscreen); - if (buttonGroup && (buttonGroup->IsVisible() == isFullscreen)) - buttonGroup->MakeVisible(!isFullscreen); -#endif - } else { - QApplication::setActiveWindow(0); - } -} - void QWidgetPrivate::raise_sys() { Q_Q(QWidget); diff --git a/tests/auto/qwidget/tst_qwidget.cpp b/tests/auto/qwidget/tst_qwidget.cpp index 4cf9e8f..3918eff 100644 --- a/tests/auto/qwidget/tst_qwidget.cpp +++ b/tests/auto/qwidget/tst_qwidget.cpp @@ -6151,9 +6151,6 @@ void tst_QWidget::compatibilityChildInsertedEvents() EventRecorder::EventList() << qMakePair(&widget, QEvent::PolishRequest) << qMakePair(&widget, QEvent::Type(QEvent::User + 1)) -#ifdef Q_OS_SYMBIAN - << qMakePair(&widget, QEvent::SymbianDeferredFocusChanged) -#endif #if defined(Q_WS_X11) || defined(Q_WS_WIN) || defined(Q_WS_QWS) || defined(Q_WS_S60) << qMakePair(&widget, QEvent::UpdateRequest) #endif @@ -6249,9 +6246,6 @@ void tst_QWidget::compatibilityChildInsertedEvents() << qMakePair(&widget, QEvent::PolishRequest) << qMakePair(&widget, QEvent::Type(QEvent::User + 1)) << qMakePair(&widget, QEvent::Type(QEvent::User + 2)) -#ifdef Q_OS_SYMBIAN - << qMakePair(&widget, QEvent::SymbianDeferredFocusChanged) -#endif #if defined(Q_WS_X11) || defined(Q_WS_WIN) || defined(Q_WS_QWS) || defined(Q_WS_S60) << qMakePair(&widget, QEvent::UpdateRequest) #endif @@ -6347,9 +6341,6 @@ void tst_QWidget::compatibilityChildInsertedEvents() << qMakePair(&widget, QEvent::PolishRequest) << qMakePair(&widget, QEvent::Type(QEvent::User + 1)) << qMakePair(&widget, QEvent::Type(QEvent::User + 2)) -#ifdef Q_OS_SYMBIAN - << qMakePair(&widget, QEvent::SymbianDeferredFocusChanged) -#endif #if defined(Q_WS_X11) || defined(Q_WS_WIN) || defined(Q_WS_QWS) || defined(Q_WS_S60) << qMakePair(&widget, QEvent::UpdateRequest) #endif -- cgit v0.12 From 3fa5162526a2d0dba0abd00c52f44ac93f9d78f3 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Wed, 30 Sep 2009 15:25:28 +0200 Subject: Prospective solaris-g++-sparc build fix g++ on sparc appears to have problems inlining functions when Qt is compiled in debug. ("sorry: unimplemented blah blah") We're not entirely sure, but we suspect that removing -g might help avoid this compiler bug. Reviewed-by: Kent Hansen --- src/script/script.pro | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/script/script.pro b/src/script/script.pro index 659aa26..008c556 100644 --- a/src/script/script.pro +++ b/src/script/script.pro @@ -62,6 +62,11 @@ DEFINES += WTF_USE_JAVASCRIPTCORE_BINDINGS=1 WTF_CHANGES=1 DEFINES += NDEBUG +solaris-g++:isEqual(QT_ARCH,sparc) { + CONFIG -= separate_debug_info + CONFIG += no_debug_info +} + # Avoid JSC C API functions being exported. DEFINES += JS_EXPORT="" JS_EXPORTDATA="" -- cgit v0.12 From c3cce20dd24ee110d4a8b434ea0623fd8c07ed68 Mon Sep 17 00:00:00 2001 From: axis Date: Wed, 30 Sep 2009 10:27:15 +0200 Subject: Helped out the Symbian compiler to avoid build error. RevBy: Trust me --- tests/auto/qwidget/tst_qwidget.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/auto/qwidget/tst_qwidget.cpp b/tests/auto/qwidget/tst_qwidget.cpp index 3918eff..8860924 100644 --- a/tests/auto/qwidget/tst_qwidget.cpp +++ b/tests/auto/qwidget/tst_qwidget.cpp @@ -5500,14 +5500,14 @@ void tst_QWidget::multipleToplevelFocusCheck() w1.activateWindow(); QApplication::setActiveWindow(&w1); QApplication::processEvents(); - QTRY_COMPARE(QApplication::activeWindow(), &w1); + QTRY_COMPARE(QApplication::activeWindow(), static_cast(&w1)); QTest::mouseDClick(&w1, Qt::LeftButton); QTRY_COMPARE(QApplication::focusWidget(), static_cast(w1.edit)); w2.activateWindow(); QApplication::setActiveWindow(&w2); QApplication::processEvents(); - QTRY_COMPARE(QApplication::activeWindow(), &w2); + QTRY_COMPARE(QApplication::activeWindow(), static_cast(&w2)); QTest::mouseClick(&w2, Qt::LeftButton); #ifdef Q_WS_QWS QEXPECT_FAIL("", "embedded toplevels take focus anyway", Continue); @@ -5520,14 +5520,14 @@ void tst_QWidget::multipleToplevelFocusCheck() w1.activateWindow(); QApplication::setActiveWindow(&w1); QApplication::processEvents(); - QTRY_COMPARE(QApplication::activeWindow(), &w1); + QTRY_COMPARE(QApplication::activeWindow(), static_cast(&w1)); QTest::mouseDClick(&w1, Qt::LeftButton); QTRY_COMPARE(QApplication::focusWidget(), static_cast(w1.edit)); w2.activateWindow(); QApplication::setActiveWindow(&w2); QApplication::processEvents(); - QTRY_COMPARE(QApplication::activeWindow(), &w2); + QTRY_COMPARE(QApplication::activeWindow(), static_cast(&w2)); QTest::mouseClick(&w2, Qt::LeftButton); QTRY_COMPARE(QApplication::focusWidget(), (QWidget *)0); } -- cgit v0.12 From 0728fa73b83e7f29990eae2520f0994e413264c2 Mon Sep 17 00:00:00 2001 From: axis Date: Wed, 30 Sep 2009 11:21:41 +0200 Subject: Avoided qt3support constructor (S60 port doesn't have it). RevBy: Paul Olav Tvete --- tests/auto/qwidget/tst_qwidget.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/auto/qwidget/tst_qwidget.cpp b/tests/auto/qwidget/tst_qwidget.cpp index 8860924..309b818 100644 --- a/tests/auto/qwidget/tst_qwidget.cpp +++ b/tests/auto/qwidget/tst_qwidget.cpp @@ -9146,7 +9146,7 @@ void tst_QWidget::destroyBackingStore() void tst_QWidget::rectOutsideCoordinatesLimit_task144779() { QApplication::setOverrideCursor(Qt::BlankCursor); //keep the cursor out of screen grabs - QWidget main(0,0,Qt::FramelessWindowHint); //don't get confused by the size of the window frame + QWidget main(0,Qt::FramelessWindowHint); //don't get confused by the size of the window frame QPalette palette; palette.setColor(QPalette::Window, Qt::red); main.setPalette(palette); -- cgit v0.12 From 8c4b3937511c8e960f9c03f1c711005aef49d982 Mon Sep 17 00:00:00 2001 From: axis Date: Wed, 30 Sep 2009 11:34:55 +0200 Subject: Fixed some uncommon codepaths to compile. RevBy: Trust me --- src/corelib/io/qfsfileengine_unix.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/corelib/io/qfsfileengine_unix.cpp b/src/corelib/io/qfsfileengine_unix.cpp index 4ec5772..114da3b 100644 --- a/src/corelib/io/qfsfileengine_unix.cpp +++ b/src/corelib/io/qfsfileengine_unix.cpp @@ -595,7 +595,7 @@ QString QFSFileEngine::rootPath() return QDir::cleanPath(QDir::fromNativeSeparators(qt_TDesC2QString(symbianPath))); # else # warning No fallback implementation of QFSFileEngine::rootPath() - return QLatin1String(); + return QString(); # endif #else return QLatin1String("/"); @@ -614,7 +614,7 @@ QString QFSFileEngine::tempPath() QT_MKDIR(QFile::encodeName(temp), 0777); # else # warning No fallback implementation of QFSFileEngine::tempPath() - return QString(); + QString temp; # endif #else QString temp = QFile::decodeName(qgetenv("TMPDIR")); -- cgit v0.12 From 5dadf715a40189c94235e8445dc79f0270b0a87e Mon Sep 17 00:00:00 2001 From: axis Date: Wed, 30 Sep 2009 11:41:09 +0200 Subject: Fixed some focus issues on Symbian. There are really two bugs that are fixed in this commit: - SetFocus() in Symbian does not automatically clear focus on the previously focused control, so we have to remember that control and clear it ourselves. - Symbian assumes that it is always the control at the top of the control stack that should have focus, and if this isn't the case, focus may or may not work depending on whether Symbian has had a chance to reset the focus or not. Therefore, whenever we change focus on a control, we have to also readd that control to the top of the stack, to ensure that it stays focused. RevBy: Janne Anttila --- src/gui/kernel/qapplication_s60.cpp | 35 ++++++++++++++++++++++++++++++++--- src/gui/kernel/qt_s60_p.h | 5 +++++ src/gui/kernel/qwidget_s60.cpp | 36 +++++++++++++++++++++--------------- 3 files changed, 58 insertions(+), 18 deletions(-) diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp index 498b1e7..1e78079 100644 --- a/src/gui/kernel/qapplication_s60.cpp +++ b/src/gui/kernel/qapplication_s60.cpp @@ -91,6 +91,8 @@ extern QDesktopWidget *qt_desktopWidget; // qapplication.cpp QWidget *qt_button_down = 0; // widget got last button-down +QSymbianControl *QSymbianControl::lastFocusedControl = 0; + QS60Data* qGlobalS60Data() { return qt_s60Data(); @@ -337,6 +339,7 @@ QSymbianControl::~QSymbianControl() { if (S60->curWin == this) S60->curWin = 0; + setFocusSafely(false); S60->appUi()->RemoveFromStack(this); delete m_longTapDetector; } @@ -845,8 +848,8 @@ void QSymbianControl::FocusChanged(TDrawNow /* aDrawNow */) || (qwidget->windowType() & Qt::Popup) == Qt::Popup) return; - if (IsFocused()) { - QApplication::setActiveWindow(qwidget); + if (IsFocused() && IsVisible()) { + QApplication::setActiveWindow(qwidget->window()); #ifdef Q_WS_S60 // If widget is fullscreen, hide status pane and button container // otherwise show them. @@ -858,9 +861,10 @@ void QSymbianControl::FocusChanged(TDrawNow /* aDrawNow */) if (buttonGroup && (buttonGroup->IsVisible() == isFullscreen)) buttonGroup->MakeVisible(!isFullscreen); #endif - } else { + } else if (QApplication::activeWindow() == qwidget->window()) { QApplication::setActiveWindow(0); } + // else { We don't touch the active window unless we were explicitly activated or deactivated } } void QSymbianControl::HandleResourceChange(int resourceType) @@ -904,6 +908,31 @@ TTypeUid::Ptr QSymbianControl::MopSupplyObject(TTypeUid id) return CCoeControl::MopSupplyObject(id); } +void QSymbianControl::setFocusSafely(bool focus) +{ + // The stack hack in here is very unfortunate, but it is the only way to ensure proper + // focus in Symbian. If this is not executed, the control which happens to be on + // the top of the stack may randomly be assigned focus by Symbian, for example + // when creating new windows (specifically in CCoeAppUi::HandleStackChanged()). + if (focus) { + S60->appUi()->RemoveFromStack(this); + // Symbian doesn't automatically remove focus from the last focused control, so we need to + // remember it and clear focus ourselves. + if (lastFocusedControl && lastFocusedControl != this) + lastFocusedControl->SetFocus(false); + QT_TRAP_THROWING(S60->appUi()->AddToStackL(this, + ECoeStackPriorityDefault + 1, ECoeStackFlagStandard)); // Note the + 1 + lastFocusedControl = this; + this->SetFocus(true); + } else { + S60->appUi()->RemoveFromStack(this); + QT_TRAP_THROWING(S60->appUi()->AddToStackL(this, + ECoeStackPriorityDefault, ECoeStackFlagStandard)); + lastFocusedControl = 0; + this->SetFocus(false); + } +} + /*! \typedef QApplication::QS60MainApplicationFactory diff --git a/src/gui/kernel/qt_s60_p.h b/src/gui/kernel/qt_s60_p.h index 0d48634..92e695f 100644 --- a/src/gui/kernel/qt_s60_p.h +++ b/src/gui/kernel/qt_s60_p.h @@ -157,6 +157,8 @@ public: void setIgnoreFocusChanged(bool enabled) { m_ignoreFocusChanged = enabled; } void CancelLongTapTimer(); + void setFocusSafely(bool focus); + protected: void Draw(const TRect& aRect) const; void SizeChanged(); @@ -174,6 +176,9 @@ private: #endif private: + static QSymbianControl *lastFocusedControl; + +private: QWidget *qwidget; bool m_ignoreFocusChanged; QLongTapTimer* m_longTapDetector; diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp index f64263b..699f778 100644 --- a/src/gui/kernel/qwidget_s60.cpp +++ b/src/gui/kernel/qwidget_s60.cpp @@ -251,7 +251,10 @@ void QWidgetPrivate::create_sys(WId window, bool /* initializeWindow */, bool de } else { stackingFlags = ECoeStackFlagStandard; } + control->MakeVisible(false); QT_TRAP_THROWING(control->ControlEnv()->AppUi()->AddToStackL(control, ECoeStackPriorityDefault, stackingFlags)); + // Avoid keyboard focus to a hidden window. + control->setFocusSafely(false); QTLWExtra *topExtra = topData(); topExtra->rwindow = control->DrawableWindow(); @@ -284,7 +287,10 @@ void QWidgetPrivate::create_sys(WId window, bool /* initializeWindow */, bool de } else { stackingFlags = ECoeStackFlagStandard; } + control->MakeVisible(false); QT_TRAP_THROWING(control->ControlEnv()->AppUi()->AddToStackL(control, ECoeStackPriorityDefault, stackingFlags)); + // Avoid keyboard focus to a hidden window. + control->setFocusSafely(false); WId parentw = parentWidget->effectiveWinId(); QT_TRAP_THROWING(control->SetContainerWindowL(*parentw)); @@ -323,13 +329,13 @@ void QWidgetPrivate::show_sys() if (q->isWindow() && q->internalWinId()) { - WId id = q->internalWinId(); + QSymbianControl *id = static_cast(q->internalWinId()); if (!extra->topextra->activated) { QT_TRAP_THROWING(id->ActivateL()); extra->topextra->activated = 1; } id->MakeVisible(true); - id->SetFocus(true); + id->setFocusSafely(true); // Force setting of the icon after window is made visible, // this is needed even WA_SetWindowIcon is not set, as in that case we need @@ -345,10 +351,10 @@ void QWidgetPrivate::hide_sys() Q_Q(QWidget); Q_ASSERT(q->testAttribute(Qt::WA_WState_Created)); deactivateWidgetCleanup(); - WId id = q->internalWinId(); + QSymbianControl *id = static_cast(q->internalWinId()); if (q->isWindow() && id) { if (id->IsFocused()) // Avoid unnecessary calls to FocusChanged() - id->SetFocus(false); + id->setFocusSafely(false); id->MakeVisible(false); if (QWidgetBackingStore *bs = maybeBackingStore()) bs->releaseBuffer(); @@ -364,7 +370,7 @@ void QWidgetPrivate::setFocus_sys() Q_Q(QWidget); if (q->testAttribute(Qt::WA_WState_Created) && q->window()->windowType() != Qt::Popup) if (!q->effectiveWinId()->IsFocused()) // Avoid unnecessry calls to FocusChanged() - q->effectiveWinId()->SetFocus(true); + static_cast(q->effectiveWinId())->setFocusSafely(true); } void QWidgetPrivate::raise_sys() @@ -447,7 +453,7 @@ void QWidgetPrivate::setParent_sys(QWidget *parent, Qt::WindowFlags f) if (q->testAttribute(Qt::WA_DropSiteRegistered)) q->setAttribute(Qt::WA_DropSiteRegistered, false); - WId old_winid = wasCreated ? data.winid : 0; + QSymbianControl *old_winid = static_cast(wasCreated ? data.winid : 0); if ((q->windowType() == Qt::Desktop)) old_winid = 0; setWinId(0); @@ -457,7 +463,7 @@ void QWidgetPrivate::setParent_sys(QWidget *parent, Qt::WindowFlags f) if (wasCreated && old_winid) { old_winid->MakeVisible(false); if (old_winid->IsFocused()) // Avoid unnecessary calls to FocusChanged() - old_winid->SetFocus(false); + old_winid->setFocusSafely(false); old_winid->SetParent(0); } @@ -974,17 +980,17 @@ void QWidget::setWindowState(Qt::WindowStates newstate) if ((oldstate & Qt::WindowMinimized) != (newstate & Qt::WindowMinimized)) { if (newstate & Qt::WindowMinimized) { if (isVisible()) { - WId id = effectiveWinId(); + QSymbianControl *id = static_cast(effectiveWinId()); if (id->IsFocused()) // Avoid unnecessary calls to FocusChanged() - id->SetFocus(false); + id->setFocusSafely(false); id->MakeVisible(false); } } else { if (isVisible()) { - WId id = effectiveWinId(); + QSymbianControl *id = static_cast(effectiveWinId()); id->MakeVisible(true); if (!id->IsFocused()) // Avoid unnecessary calls to FocusChanged() - id->SetFocus(true); + id->setFocusSafely(true); } const QRect normalGeometry = geometry(); const QRect r = top->normalGeometry; @@ -1011,7 +1017,7 @@ void QWidget::destroy(bool destroyWindow, bool destroySubWindows) if (!isWindow() && parentWidget()) parentWidget()->d_func()->invalidateBuffer(geometry()); d->deactivateWidgetCleanup(); - WId id = internalWinId(); + QSymbianControl *id = static_cast(internalWinId()); if (testAttribute(Qt::WA_WState_Created)) { #ifndef QT_NO_IM @@ -1039,7 +1045,7 @@ void QWidget::destroy(bool destroyWindow, bool destroySubWindows) } if (destroyWindow && !(windowType() == Qt::Desktop) && id) { if (id->IsFocused()) // Avoid unnecessry calls to FocusChanged() - id->SetFocus(false); + id->setFocusSafely(false); id->ControlEnv()->AppUi()->RemoveFromStack(id); // Hack to activate window under destroyed one. With this activation @@ -1148,8 +1154,8 @@ void QWidget::activateWindow() QWidget *tlw = window(); if (tlw->isVisible()) { window()->createWinId(); - WId id = tlw->internalWinId(); - id->SetFocus(true); + QSymbianControl *id = static_cast(tlw->internalWinId()); + id->setFocusSafely(true); } } -- cgit v0.12 From fa3cda0324324f595d0d1231027443673b7c05ea Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Wed, 30 Sep 2009 15:57:35 +0200 Subject: Stabilize more test on X11 Each times the test are run, pulse show different failures. --- tests/auto/qbuttongroup/tst_qbuttongroup.cpp | 3 +- tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp | 8 +- .../tst_qgraphicsproxywidget.cpp | 4 +- tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp | 192 +++++++++++---------- tests/auto/qstatusbar/tst_qstatusbar.cpp | 9 +- tests/auto/qwindowsurface/tst_qwindowsurface.cpp | 2 +- 6 files changed, 108 insertions(+), 110 deletions(-) diff --git a/tests/auto/qbuttongroup/tst_qbuttongroup.cpp b/tests/auto/qbuttongroup/tst_qbuttongroup.cpp index 502c2d1..11c1f47 100644 --- a/tests/auto/qbuttongroup/tst_qbuttongroup.cpp +++ b/tests/auto/qbuttongroup/tst_qbuttongroup.cpp @@ -173,10 +173,11 @@ void tst_QButtonGroup::arrowKeyNavigation() dlg.show(); qApp->setActiveWindow(&dlg); + QTest::qWaitForWindowShown(&dlg); bt1.setFocus(); - QVERIFY(bt1.hasFocus()); + QTRY_VERIFY(bt1.hasFocus()); QTest::keyClick(&bt1, Qt::Key_Right); QVERIFY(pb.hasFocus()); diff --git a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp index ef9fe9e..bbf19f2 100644 --- a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp +++ b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp @@ -2925,10 +2925,8 @@ void tst_QGraphicsItem::hoverEventsGenerateRepaints() QGraphicsScene scene; QGraphicsView view(&scene); view.show(); -#ifdef Q_WS_X11 - qt_x11_wait_for_window_manager(&view); -#endif - QTest::qWait(20); + QTest::qWaitForWindowShown(&view); + QTest::qWait(100); EventTester *tester = new EventTester; scene.addItem(tester); @@ -4637,7 +4635,7 @@ void tst_QGraphicsItem::paint() qApp->processEvents(); //First show one paint - QVERIFY(tester2.painted == 1); + QTRY_COMPARE(tester2.painted, 1); //nominal case, update call paint tester2.update(); diff --git a/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp b/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp index 5c0073c..6e60516 100644 --- a/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp +++ b/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp @@ -1491,9 +1491,7 @@ void tst_QGraphicsProxyWidget::scrollUpdate() View view(&scene); view.show(); -#ifdef Q_WS_X11 - qt_x11_wait_for_window_manager(&view); -#endif + QTest::qWaitForWindowShown(&view); QTRY_VERIFY(view.npaints >= 1); QTest::qWait(20); widget->paintEventRegion = QRegion(); diff --git a/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp b/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp index 07d7cce..864076f 100644 --- a/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp +++ b/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp @@ -1702,9 +1702,8 @@ void tst_QGraphicsScene::hoverEvents_parentChild() view.rotate(10); view.scale(1.7, 1.7); view.show(); -#ifdef Q_WS_X11 - qt_x11_wait_for_window_manager(&view); -#endif + QTest::qWaitForWindowShown(&view); + QTest::qWait(50); QGraphicsSceneMouseEvent mouseEvent(QEvent::GraphicsSceneMouseMove); mouseEvent.setScenePos(QPointF(-1000, -1000)); @@ -3060,52 +3059,53 @@ void tst_QGraphicsScene::tabFocus_sceneWithFocusableItems() widget.show(); qApp->setActiveWindow(&widget); widget.activateWindow(); - QTest::qWait(125); + QTest::qWaitForWindowShown(&widget); + QApplication::processEvents(); dial1->setFocus(); - QVERIFY(dial1->hasFocus()); + QTRY_VERIFY(dial1->hasFocus()); QTest::keyPress(QApplication::focusWidget(), Qt::Key_Tab); - QTest::qWait(125); - QVERIFY(view->hasFocus()); + QApplication::processEvents(); + QTRY_VERIFY(view->hasFocus()); QVERIFY(view->viewport()->hasFocus()); QVERIFY(scene.hasFocus()); QVERIFY(item->hasFocus()); QTest::keyPress(QApplication::focusWidget(), Qt::Key_Tab); - QTest::qWait(125); - QVERIFY(dial2->hasFocus()); + QApplication::processEvents(); + QTRY_VERIFY(dial2->hasFocus()); QTest::keyPress(QApplication::focusWidget(), Qt::Key_Backtab); - QTest::qWait(125); - QVERIFY(view->hasFocus()); - QVERIFY(view->viewport()->hasFocus()); - QVERIFY(scene.hasFocus()); - QVERIFY(item->hasFocus()); + QApplication::processEvents(); + QTRY_VERIFY(view->hasFocus()); + QTRY_VERIFY(view->viewport()->hasFocus()); + QTRY_VERIFY(scene.hasFocus()); + QTRY_VERIFY(item->hasFocus()); QTest::keyPress(QApplication::focusWidget(), Qt::Key_Backtab); - QTest::qWait(125); - QVERIFY(dial1->hasFocus()); + QApplication::processEvents(); + QTRY_VERIFY(dial1->hasFocus()); // If the item requests input focus, it can only ensure that the scene // sets focus on itself, but the scene cannot request focus from any view. item->setFocus(); - QTest::qWait(125); - QVERIFY(!view->hasFocus()); + QApplication::processEvents(); + QTRY_VERIFY(!view->hasFocus()); QVERIFY(!view->viewport()->hasFocus()); - QVERIFY(scene.hasFocus()); + QTRY_VERIFY(scene.hasFocus()); QVERIFY(item->hasFocus()); view->setFocus(); - QTest::qWait(125); - QVERIFY(view->hasFocus()); - QVERIFY(view->viewport()->hasFocus()); - QVERIFY(scene.hasFocus()); - QVERIFY(item->hasFocus()); + QApplication::processEvents(); + QTRY_VERIFY(view->hasFocus()); + QTRY_VERIFY(view->viewport()->hasFocus()); + QTRY_VERIFY(scene.hasFocus()); + QTRY_VERIFY(item->hasFocus()); // Check that everyone loses focus when the widget is hidden. widget.hide(); - QTest::qWait(125); - QVERIFY(!view->hasFocus()); + QTest::qWait(15); + QTRY_VERIFY(!view->hasFocus()); QVERIFY(!view->viewport()->hasFocus()); QVERIFY(!scene.hasFocus()); QVERIFY(!item->hasFocus()); @@ -3114,8 +3114,8 @@ void tst_QGraphicsScene::tabFocus_sceneWithFocusableItems() widget.show(); qApp->setActiveWindow(&widget); widget.activateWindow(); - QTest::qWait(125); - QVERIFY(view->hasFocus()); + QTest::qWaitForWindowShown(&widget); + QTRY_VERIFY(view->hasFocus()); QVERIFY(view->viewport()->hasFocus()); QVERIFY(scene.hasFocus()); QVERIFY(item->hasFocus()); @@ -3193,47 +3193,48 @@ void tst_QGraphicsScene::tabFocus_sceneWithFocusWidgets() widget.show(); qApp->setActiveWindow(&widget); widget.activateWindow(); - QTest::qWait(125); + QTest::qWaitForWindowShown(&widget); + QApplication::processEvents(); dial1->setFocus(); - QVERIFY(dial1->hasFocus()); + QTRY_VERIFY(dial1->hasFocus()); QTest::keyPress(QApplication::focusWidget(), Qt::Key_Tab); - QTest::qWait(125); - QVERIFY(view->hasFocus()); - QVERIFY(view->viewport()->hasFocus()); - QVERIFY(scene.hasFocus()); + QApplication::processEvents(); + QTRY_VERIFY(view->hasFocus()); + QTRY_VERIFY(view->viewport()->hasFocus()); + QTRY_VERIFY(scene.hasFocus()); QCOMPARE(widget1->tabs, 0); QVERIFY(widget1->hasFocus()); QTest::keyPress(QApplication::focusWidget(), Qt::Key_Tab); - QTest::qWait(125); - QCOMPARE(widget1->tabs, 1); - QVERIFY(widget2->hasFocus()); + QApplication::processEvents(); + QTRY_COMPARE(widget1->tabs, 1); + QTRY_VERIFY(widget2->hasFocus()); QTest::keyPress(QApplication::focusWidget(), Qt::Key_Tab); - QTest::qWait(125); - QCOMPARE(widget2->tabs, 1); - QVERIFY(dial2->hasFocus()); + QApplication::processEvents(); + QTRY_COMPARE(widget2->tabs, 1); + QTRY_VERIFY(dial2->hasFocus()); QTest::keyPress(QApplication::focusWidget(), Qt::Key_Backtab); - QTest::qWait(125); - QVERIFY(widget2->hasFocus()); + QApplication::processEvents(); + QTRY_VERIFY(widget2->hasFocus()); QTest::keyPress(QApplication::focusWidget(), Qt::Key_Backtab); - QTest::qWait(125); - QCOMPARE(widget2->backTabs, 1); - QVERIFY(widget1->hasFocus()); + QApplication::processEvents(); + QTRY_COMPARE(widget2->backTabs, 1); + QTRY_VERIFY(widget1->hasFocus()); QTest::keyPress(QApplication::focusWidget(), Qt::Key_Backtab); - QTest::qWait(125); - QCOMPARE(widget1->backTabs, 1); - QVERIFY(dial1->hasFocus()); + QApplication::processEvents(); + QTRY_COMPARE(widget1->backTabs, 1); + QTRY_VERIFY(dial1->hasFocus()); widget1->setFocus(); view->viewport()->setFocus(); widget.hide(); - QTest::qWait(125); + QTest::qWait(15); widget.show(); qApp->setActiveWindow(&widget); widget.activateWindow(); - QTest::qWait(125); - QVERIFY(widget1->hasFocus()); + QTest::qWaitForWindowShown(&widget); + QTRY_VERIFY(widget1->hasFocus()); } void tst_QGraphicsScene::tabFocus_sceneWithNestedFocusWidgets() @@ -3276,10 +3277,10 @@ void tst_QGraphicsScene::tabFocus_sceneWithNestedFocusWidgets() widget.show(); qApp->setActiveWindow(&widget); widget.activateWindow(); - QTest::qWait(125); + QTest::qWaitForWindowShown(&widget); dial1->setFocus(); - QVERIFY(dial1->hasFocus()); + QTRY_VERIFY(dial1->hasFocus()); EventSpy focusInSpy_1(widget1, QEvent::FocusIn); EventSpy focusOutSpy_1(widget1, QEvent::FocusOut); @@ -3291,78 +3292,79 @@ void tst_QGraphicsScene::tabFocus_sceneWithNestedFocusWidgets() EventSpy focusOutSpy_2(widget2, QEvent::FocusOut); QTest::keyPress(QApplication::focusWidget(), Qt::Key_Tab); - QTest::qWait(125); - QVERIFY(widget1->hasFocus()); + QApplication::processEvents(); + QTRY_VERIFY(widget1->hasFocus()); QCOMPARE(focusInSpy_1.count(), 1); QTest::keyPress(QApplication::focusWidget(), Qt::Key_Tab); - QTest::qWait(125); - QVERIFY(!widget1->hasFocus()); + QApplication::processEvents(); + QTRY_VERIFY(!widget1->hasFocus()); QVERIFY(widget1_1->hasFocus()); QCOMPARE(focusOutSpy_1.count(), 1); QCOMPARE(focusInSpy_1_1.count(), 1); QTest::keyPress(QApplication::focusWidget(), Qt::Key_Tab); - QTest::qWait(125); - QVERIFY(!widget1_1->hasFocus()); + QApplication::processEvents(); + QTRY_VERIFY(!widget1_1->hasFocus()); QVERIFY(widget1_2->hasFocus()); QCOMPARE(focusOutSpy_1_1.count(), 1); QCOMPARE(focusInSpy_1_2.count(), 1); QTest::keyPress(QApplication::focusWidget(), Qt::Key_Tab); - QTest::qWait(125); - QVERIFY(!widget1_2->hasFocus()); + QApplication::processEvents(); + QTRY_VERIFY(!widget1_2->hasFocus()); QVERIFY(widget2->hasFocus()); QCOMPARE(focusOutSpy_1_2.count(), 1); QCOMPARE(focusInSpy_2.count(), 1); QTest::keyPress(QApplication::focusWidget(), Qt::Key_Tab); - QTest::qWait(125); - QVERIFY(!widget2->hasFocus()); + QApplication::processEvents(); + QTRY_VERIFY(!widget2->hasFocus()); QVERIFY(dial2->hasFocus()); QCOMPARE(focusOutSpy_2.count(), 1); QTest::keyPress(QApplication::focusWidget(), Qt::Key_Backtab); - QTest::qWait(125); - QVERIFY(widget2->hasFocus()); + QApplication::processEvents(); + QTRY_VERIFY(widget2->hasFocus()); QCOMPARE(focusInSpy_2.count(), 2); QTest::keyPress(QApplication::focusWidget(), Qt::Key_Backtab); - QTest::qWait(125); - QVERIFY(!widget2->hasFocus()); - QVERIFY(widget1_2->hasFocus()); + QApplication::processEvents(); + QTRY_VERIFY(!widget2->hasFocus()); + QTRY_VERIFY(widget1_2->hasFocus()); QCOMPARE(focusOutSpy_2.count(), 2); QCOMPARE(focusInSpy_1_2.count(), 2); QTest::keyPress(QApplication::focusWidget(), Qt::Key_Backtab); - QTest::qWait(125); - QVERIFY(!widget1_2->hasFocus()); - QVERIFY(widget1_1->hasFocus()); + QApplication::processEvents(); + QTRY_VERIFY(!widget1_2->hasFocus()); + QTRY_VERIFY(widget1_1->hasFocus()); QCOMPARE(focusOutSpy_1_2.count(), 2); QCOMPARE(focusInSpy_1_1.count(), 2); QTest::keyPress(QApplication::focusWidget(), Qt::Key_Backtab); - QTest::qWait(125); - QVERIFY(!widget1_1->hasFocus()); - QVERIFY(widget1->hasFocus()); + QApplication::processEvents(); + QTRY_VERIFY(!widget1_1->hasFocus()); + QTRY_VERIFY(widget1->hasFocus()); QCOMPARE(focusOutSpy_1_1.count(), 2); QCOMPARE(focusInSpy_1.count(), 2); QTest::keyPress(QApplication::focusWidget(), Qt::Key_Backtab); - QTest::qWait(125); - QVERIFY(!widget1->hasFocus()); - QVERIFY(dial1->hasFocus()); + QApplication::processEvents(); + QTRY_VERIFY(!widget1->hasFocus()); + QTRY_VERIFY(dial1->hasFocus()); QCOMPARE(focusOutSpy_1.count(), 2); widget1->setFocus(); view->viewport()->setFocus(); widget.hide(); - QTest::qWait(125); + QTest::qWait(12); widget.show(); qApp->setActiveWindow(&widget); widget.activateWindow(); - QTest::qWait(125); - QVERIFY(widget1->hasFocus()); + QTest::qWaitForWindowShown(&widget); + QApplication::processEvents(); + QTRY_VERIFY(widget1->hasFocus()); } void tst_QGraphicsScene::style() @@ -3454,10 +3456,10 @@ void tst_QGraphicsScene::task139782_containsItemBoundingRect() void tst_QGraphicsScene::task176178_itemIndexMethodBreaksSceneRect() { - QGraphicsScene scene; - scene.setItemIndexMethod(QGraphicsScene::NoIndex); - QGraphicsRectItem *rect = new QGraphicsRectItem; - rect->setRect(0,0,100,100); + QGraphicsScene scene; + scene.setItemIndexMethod(QGraphicsScene::NoIndex); + QGraphicsRectItem *rect = new QGraphicsRectItem; + rect->setRect(0,0,100,100); scene.addItem(rect); QCOMPARE(scene.sceneRect(), rect->rect()); } @@ -3518,7 +3520,7 @@ void tst_QGraphicsScene::sorting_data() void tst_QGraphicsScene::sorting() { QFETCH(bool, cache); - + QGraphicsScene scene; scene.setSortCacheEnabled(cache); @@ -3552,15 +3554,15 @@ void tst_QGraphicsScene::sorting() c_2_1_1->setPos(-16, 16); c_2_2->setPos(-16, 28); c_2_2->setZValue(1); - - c_1->setFlag(QGraphicsItem::ItemIsMovable); - c_1_1->setFlag(QGraphicsItem::ItemIsMovable); - c_1_1_1->setFlag(QGraphicsItem::ItemIsMovable); - c_1_2->setFlag(QGraphicsItem::ItemIsMovable); - c_2->setFlag(QGraphicsItem::ItemIsMovable); - c_2_1->setFlag(QGraphicsItem::ItemIsMovable); - c_2_1_1->setFlag(QGraphicsItem::ItemIsMovable); - c_2_2->setFlag(QGraphicsItem::ItemIsMovable); + + c_1->setFlag(QGraphicsItem::ItemIsMovable); + c_1_1->setFlag(QGraphicsItem::ItemIsMovable); + c_1_1_1->setFlag(QGraphicsItem::ItemIsMovable); + c_1_2->setFlag(QGraphicsItem::ItemIsMovable); + c_2->setFlag(QGraphicsItem::ItemIsMovable); + c_2_1->setFlag(QGraphicsItem::ItemIsMovable); + c_2_1_1->setFlag(QGraphicsItem::ItemIsMovable); + c_2_2->setFlag(QGraphicsItem::ItemIsMovable); t_1->setData(0, "t_1"); c_1->setData(0, "c_1"); @@ -3585,7 +3587,7 @@ void tst_QGraphicsScene::sorting() foreach (QGraphicsItem *item, scene.items(32, 31, 4, 55)) qDebug() << "\t" << item->data(0).toString(); qDebug() << "}"; - + QCOMPARE(scene.items(32, 31, 4, 55), QList() << c_1_2 << c_1_1_1 << c_1 << t_1); diff --git a/tests/auto/qstatusbar/tst_qstatusbar.cpp b/tests/auto/qstatusbar/tst_qstatusbar.cpp index 3727882..9774559 100644 --- a/tests/auto/qstatusbar/tst_qstatusbar.cpp +++ b/tests/auto/qstatusbar/tst_qstatusbar.cpp @@ -48,6 +48,8 @@ #include #include +#include "../../shared/util.h" + //TESTED_CLASS= //TESTED_FILES= @@ -177,7 +179,7 @@ void tst_QStatusBar::setSizeGripEnabled() qt_x11_wait_for_window_manager(&mainWindow); #endif - QVERIFY(statusBar->isVisible()); + QTRY_VERIFY(statusBar->isVisible()); QPointer sizeGrip = qFindChild(statusBar); QVERIFY(sizeGrip); QVERIFY(sizeGrip->isVisible()); @@ -223,11 +225,8 @@ void tst_QStatusBar::setSizeGripEnabled() qApp->processEvents(); mainWindow.showNormal(); -#ifdef Q_WS_X11 - qt_x11_wait_for_window_manager(&mainWindow); -#endif qApp->processEvents(); - QVERIFY(sizeGrip->isVisible()); + QTRY_VERIFY(sizeGrip->isVisible()); } void tst_QStatusBar::task194017_hiddenWidget() diff --git a/tests/auto/qwindowsurface/tst_qwindowsurface.cpp b/tests/auto/qwindowsurface/tst_qwindowsurface.cpp index 0a6b7ad..e96bcf9 100644 --- a/tests/auto/qwindowsurface/tst_qwindowsurface.cpp +++ b/tests/auto/qwindowsurface/tst_qwindowsurface.cpp @@ -230,7 +230,7 @@ void tst_QWindowSurface::grabWidget() parentWidget.show(); QTest::qWaitForWindowShown(&parentWidget); - QTest::qWait(120); + QTest::qWait(220); QPixmap parentPixmap = parentWidget.windowSurface()->grabWidget(&parentWidget); QPixmap childPixmap = childWidget.windowSurface()->grabWidget(&childWidget); -- cgit v0.12 From 68f709fb180af94af259a9afb873b9548c97c0fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Abecasis?= Date: Wed, 30 Sep 2009 16:05:23 +0200 Subject: Moving some QVFB stuff out of the configure script and into .pro files Reviewed-by: Paul Olav Tvete --- configure | 10 ---------- tools/qvfb/qvfb.pro | 11 ++++++----- tools/qvfb/translations/translations.pro | 12 ++++++------ 3 files changed, 12 insertions(+), 21 deletions(-) diff --git a/configure b/configure index f89da70..e86d008 100755 --- a/configure +++ b/configure @@ -2232,16 +2232,6 @@ if [ "$OPT_SHADOW" = "yes" ]; then ln -s "$relpath/tools/porting/src/q3porting.xml" "$outpath/tools/porting/src" fi -# symlink files from src/gui/embedded neccessary to build qvfb -if [ "$CFG_DEV" = "yes" ]; then - mkdir -p "$outpath/tools/qvfb" - for f in qvfbhdr.h qlock_p.h qlock.cpp qwssignalhandler_p.h qwssignalhandler.cpp; do - dest="${outpath}/tools/qvfb/${f}" - rm -f "$dest" - ln -s "${relpath}/src/gui/embedded/${f}" "${dest}" - done -fi - # symlink fonts to be able to run application from build directory if [ "$PLATFORM_QWS" = "yes" ] && [ ! -e "${outpath}/lib/fonts" ]; then if [ "$PLATFORM" = "$XPLATFORM" ]; then diff --git a/tools/qvfb/qvfb.pro b/tools/qvfb/qvfb.pro index 247337a..dde7e8d 100644 --- a/tools/qvfb/qvfb.pro +++ b/tools/qvfb/qvfb.pro @@ -9,6 +9,7 @@ target.path=$$[QT_INSTALL_BINS] INSTALLS += target DEPENDPATH = ../../include +INCLUDEPATH += ../../src/gui/embedded FORMS = config.ui HEADERS = qvfb.h \ @@ -19,9 +20,9 @@ HEADERS = qvfb.h \ qvfbprotocol.h \ qvfbshmem.h \ qvfbmmap.h \ - qvfbhdr.h \ - qlock_p.h \ - qwssignalhandler_p.h + ../../src/gui/embedded/qvfbhdr.h \ + ../../src/gui/embedded/qlock_p.h \ + ../../src/gui/embedded/qwssignalhandler_p.h SOURCES = qvfb.cpp \ qvfbview.cpp \ @@ -31,8 +32,8 @@ SOURCES = qvfb.cpp \ qvfbprotocol.cpp \ qvfbshmem.cpp \ qvfbmmap.cpp \ - qlock.cpp \ - qwssignalhandler.cpp + ../../src/gui/embedded/qlock.cpp \ + ../../src/gui/embedded/qwssignalhandler.cpp include($$QT_SOURCE_TREE/tools/shared/deviceskin/deviceskin.pri) diff --git a/tools/qvfb/translations/translations.pro b/tools/qvfb/translations/translations.pro index f667bb8..17579f7 100644 --- a/tools/qvfb/translations/translations.pro +++ b/tools/qvfb/translations/translations.pro @@ -9,10 +9,10 @@ HEADERS = ../qvfb.h \ ../qvfbprotocol.h \ ../qvfbshmem.h \ ../qvfbmmap.h \ - ../qvfbhdr.h \ - ../qlock_p.h \ - ../qwssignalhandler_p.h \ - ../../shared/deviceskin/deviceskin.cpp + ../../../src/gui/embedded/qvfbhdr.h \ + ../../../src/gui/embedded/qlock_p.h \ + ../../../src/gui/embedded/qwssignalhandler_p.h \ + ../../shared/deviceskin/deviceskin.h SOURCES = ../qvfb.cpp \ ../qvfbview.cpp \ @@ -22,8 +22,8 @@ SOURCES = ../qvfb.cpp \ ../qvfbprotocol.cpp \ ../qvfbshmem.cpp \ ../qvfbmmap.cpp \ - ../qlock.cpp \ - ../qwssignalhandler.cpp \ + ../../../src/gui/embedded/qlock.cpp \ + ../../../src/gui/embedded/qwssignalhandler.cpp \ ../../shared/deviceskin/deviceskin.cpp TRANSLATIONS=$$[QT_INSTALL_TRANSLATIONS]/qvfb_pl.ts \ -- cgit v0.12 From 28c61efdd823cb5fa93f4ab2ef3109bb01c56ed5 Mon Sep 17 00:00:00 2001 From: Janne Koskinen Date: Wed, 30 Sep 2009 16:23:23 +0200 Subject: Make it possible to debug JSC in the Symbian emulator. Cherry-picked-by: Simon Hausmann http://trac.webkit.org/changeset/48928 This is not a perfect fix, it requires more fine tuning. But this makes it possible again to debug in the emulator, which is more important in order to be able to fix other run-time issues. --- src/3rdparty/javascriptcore/JavaScriptCore/runtime/Collector.h | 2 +- src/3rdparty/webkit/JavaScriptCore/runtime/Collector.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Collector.h b/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Collector.h index 1a55bb5..0ecff19 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Collector.h +++ b/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Collector.h @@ -181,7 +181,7 @@ namespace JSC { #endif template<> struct CellSize { static const size_t m_value = 64; }; -#if PLATFORM(WINCE) +#if PLATFORM(WINCE) || PLATFORM(SYMBIAN) const size_t BLOCK_SIZE = 64 * 1024; // 64k #else const size_t BLOCK_SIZE = 64 * 4096; // 256k diff --git a/src/3rdparty/webkit/JavaScriptCore/runtime/Collector.h b/src/3rdparty/webkit/JavaScriptCore/runtime/Collector.h index 1a55bb5..0ecff19 100644 --- a/src/3rdparty/webkit/JavaScriptCore/runtime/Collector.h +++ b/src/3rdparty/webkit/JavaScriptCore/runtime/Collector.h @@ -181,7 +181,7 @@ namespace JSC { #endif template<> struct CellSize { static const size_t m_value = 64; }; -#if PLATFORM(WINCE) +#if PLATFORM(WINCE) || PLATFORM(SYMBIAN) const size_t BLOCK_SIZE = 64 * 1024; // 64k #else const size_t BLOCK_SIZE = 64 * 4096; // 256k -- cgit v0.12 From c7689f394df5fa5526e51017bf132048d3a4aa96 Mon Sep 17 00:00:00 2001 From: ninerider Date: Wed, 30 Sep 2009 16:36:54 +0200 Subject: Remap return key to select key for windows mobile. The select key code is interpreted in the code but the device deliver the key code for return. The changes will be replaced by a more elaborate scheme in forthcoming versions. Reviewed-by: Thomas Hartmann --- src/gui/kernel/qkeymapper_win.cpp | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/src/gui/kernel/qkeymapper_win.cpp b/src/gui/kernel/qkeymapper_win.cpp index 402d88e..10958f3 100644 --- a/src/gui/kernel/qkeymapper_win.cpp +++ b/src/gui/kernel/qkeymapper_win.cpp @@ -433,6 +433,23 @@ static const Qt::KeyboardModifiers ModsTbl[] = { Qt::NoModifier, // Fall-back to raw Key_* }; +/** + Remap return or action key to select key for windows mobile. +*/ +inline int winceKeyBend(int keyCode) +{ +#ifdef Q_OS_WINCE_WM + // remap return or action key to select key for windows mobile. + // will be changed to a table remapping function in the next version (4.6/7). + if (keyCode == 13) + return Qt::Key_Select; + else + return KeyTbl[keyCode]; +#else + return KeyTbl[keyCode]; +#endif +} + #if defined(Q_OS_WINCE) // Use the KeyTbl to resolve a Qt::Key out of the virtual keys. // In case it is not resolvable, continue using the virtual key itself. @@ -472,7 +489,7 @@ static inline int toKeyOrUnicode(int vk, int scancode, unsigned char *kbdBuffer, // Qt::Key_*'s are not encoded below 0x20, so try again, and DEL keys (0x7f) is encoded with a // proper Qt::Key_ code if (code < 0x20 || code == 0x7f) // Handles res==0 too - code = KeyTbl[vk]; + code = winceKeyBend(vk); if (isDeadkey) *isDeadkey = (res == -1); @@ -482,7 +499,7 @@ static inline int toKeyOrUnicode(int vk, int scancode, unsigned char *kbdBuffer, Q_GUI_EXPORT int qt_translateKeyCode(int vk) { - int code = (vk < 0 || vk > 255) ? 0 : KeyTbl[vk]; + int code = winceKeyBend((vk < 0 || vk > 255) ? 0 : vk); return code == Qt::Key_unknown ? 0 : code; } @@ -689,7 +706,7 @@ void QKeyMapperPrivate::updatePossibleKeyCodes(unsigned char *kbdBuffer, quint32 keyLayout[vk_key]->qtKey[7] = toKeyOrUnicode(vk_key, scancode, buffer, &isDeadKey); keyLayout[vk_key]->deadkeys |= isDeadKey ? 0x80 : 0; // Add a fall back key for layouts which don't do composition and show non-latin1 characters - int fallbackKey = KeyTbl[vk_key]; + int fallbackKey = winceKeyBend(vk_key); if (!fallbackKey || fallbackKey == Qt::Key_unknown) { fallbackKey = 0; if (vk_key != keyLayout[vk_key]->qtKey[0] && vk_key < 0x5B && vk_key > 0x2F) @@ -898,7 +915,7 @@ bool QKeyMapperPrivate::translateKeyEvent(QWidget *widget, const MSG &msg, bool // ..also if we're typing numbers on the keypad, while holding down the Alt modifier. int code = 0; if (isNumpad && (nModifiers & AltAny)) { - code = KeyTbl[msg.wParam]; + code = winceKeyBend(msg.wParam); } else if (!isDeadKey) { unsigned char kbdBuffer[256]; // Will hold the complete keyboard state GetKeyboardState(kbdBuffer); -- cgit v0.12 From 76b8df83645c66c15d58bf12d7ffa3ea944ecb07 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Wed, 30 Sep 2009 16:35:12 +0200 Subject: Make sure to process the events in QTest::qWaitForWindowShown on X11 qt_x11_wait_for_window_manager doesn't necesserly process the events Reviewed-by: Denis --- src/testlib/qtestsystem.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/testlib/qtestsystem.h b/src/testlib/qtestsystem.h index a9a2193..e8b8359 100644 --- a/src/testlib/qtestsystem.h +++ b/src/testlib/qtestsystem.h @@ -75,6 +75,7 @@ namespace QTest { #if defined(Q_WS_X11) qt_x11_wait_for_window_manager(window); + QApplication::processEvents(); #elif defined(Q_WS_QWS) Q_UNUSED(window); qWait(100); -- cgit v0.12 From 5022e56d71237292138cc8c912a467049c538445 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Wed, 30 Sep 2009 16:39:57 +0200 Subject: Compilation fix for tests thas doesn't include qapplication.h --- src/testlib/qtestsystem.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/testlib/qtestsystem.h b/src/testlib/qtestsystem.h index e8b8359..8caec76 100644 --- a/src/testlib/qtestsystem.h +++ b/src/testlib/qtestsystem.h @@ -75,7 +75,7 @@ namespace QTest { #if defined(Q_WS_X11) qt_x11_wait_for_window_manager(window); - QApplication::processEvents(); + QCoreApplication::processEvents(); #elif defined(Q_WS_QWS) Q_UNUSED(window); qWait(100); -- cgit v0.12 From 2bb2a8a184b0e0f1816822e244cf9bd8e122a16a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Nilsen?= Date: Tue, 29 Sep 2009 14:04:06 +0200 Subject: Readd QGraphicsBloomEffect. This effect was removed in 1c9a28ea64cc53e61a64644dc5a4ff121b475bc5, but has now been readded on request from a couple of customers. Andreas also agreed we should provide this effect. Reviewed-by: Andreas --- doc/src/images/graphicseffect-bloom.png | Bin 0 -> 79982 bytes doc/src/images/graphicseffect-effects.png | Bin 395669 -> 486123 bytes src/gui/effects/qgraphicseffect.cpp | 178 ++++++++++++++++++++++++++++++ src/gui/effects/qgraphicseffect.h | 34 ++++++ src/gui/effects/qgraphicseffect_p.h | 12 ++ 5 files changed, 224 insertions(+) create mode 100644 doc/src/images/graphicseffect-bloom.png diff --git a/doc/src/images/graphicseffect-bloom.png b/doc/src/images/graphicseffect-bloom.png new file mode 100644 index 0000000..dace7eb Binary files /dev/null and b/doc/src/images/graphicseffect-bloom.png differ diff --git a/doc/src/images/graphicseffect-effects.png b/doc/src/images/graphicseffect-effects.png index 3709014..609bef9 100644 Binary files a/doc/src/images/graphicseffect-effects.png and b/doc/src/images/graphicseffect-effects.png differ diff --git a/src/gui/effects/qgraphicseffect.cpp b/src/gui/effects/qgraphicseffect.cpp index eee9bbf..474af53 100644 --- a/src/gui/effects/qgraphicseffect.cpp +++ b/src/gui/effects/qgraphicseffect.cpp @@ -67,6 +67,7 @@ \o QGraphicsOpacityEffect - renders the item with an opacity \o QGraphicsPixelizeEffect - pixelizes the item with any pixel size \o QGraphicsGrayscaleEffect - renders the item in shades of gray + \o QGraphicsBloomEffect - applies a blooming / glowing effect \endlist \img graphicseffect-effects.png @@ -1305,5 +1306,182 @@ void QGraphicsOpacityEffect::draw(QPainter *painter, QGraphicsEffectSource *sour painter->restore(); } +/*! + \class QGraphicsBloomEffect + \brief The QGraphicsBloomEffect class provides a bloom/glow effect. + \since 4.6 + + A bloom/glow effect adds fringes of light around bright areas in the source. + + \img graphicseffect-bloom.png + + \sa QGraphicsDropShadowEffect, QGraphicsBlurEffect, QGraphicsPixelizeEffect, + QGraphicsGrayscaleEffect, QGraphicsColorizeEffect +*/ + +/*! + Constructs a new QGraphicsBloomEffect instance. + The \a parent parameter is passed to QGraphicsEffect's constructor. +*/ +QGraphicsBloomEffect::QGraphicsBloomEffect(QObject *parent) + : QGraphicsEffect(*new QGraphicsBloomEffectPrivate, parent) +{ + Q_D(QGraphicsBloomEffect); + for (int i = 0; i < 256; ++i) + d->colorTable[i] = qMin(i + d->brightness, 255); +} + +/*! + Destroys the effect. +*/ +QGraphicsBloomEffect::~QGraphicsBloomEffect() +{ +} + +/*! + \reimp +*/ +QRectF QGraphicsBloomEffect::boundingRectFor(const QRectF &rect) const +{ + Q_D(const QGraphicsBloomEffect); + const qreal delta = d->blurFilter.radius() * 2; + return rect.adjusted(-delta, -delta, delta, delta); +} + +/*! + \property QGraphicsBloomEffect::blurRadius + \brief the blur radius in pixels of the effect. + + Using a smaller radius results in a sharper appearance, whereas a bigger + radius results in a more blurred appearance. + + By default, the blur radius is 5 pixels. + + \sa strength(), brightness() +*/ +int QGraphicsBloomEffect::blurRadius() const +{ + Q_D(const QGraphicsBloomEffect); + return d->blurFilter.radius(); +} + +void QGraphicsBloomEffect::setBlurRadius(int radius) +{ + Q_D(QGraphicsBloomEffect); + if (d->blurFilter.radius() == radius) + return; + + d->blurFilter.setRadius(radius); + updateBoundingRect(); + emit blurRadiusChanged(radius); +} + +/*! + \property QGraphicsBloomEffect::brightness + \brief the brightness of the glow. + + The value should be in the range of 0 to 255, where 0 is dark + and 255 is bright. + + By default, the brightness is 70. + + \sa strength(), blurRadius() +*/ +int QGraphicsBloomEffect::brightness() const +{ + Q_D(const QGraphicsBloomEffect); + return d->brightness; +} + +void QGraphicsBloomEffect::setBrightness(int brightness) +{ + Q_D(QGraphicsBloomEffect); + brightness = qBound(0, brightness, 255); + if (d->brightness == brightness) + return; + + d->brightness = brightness; + for (int i = 0; i < 256; ++i) + d->colorTable[i] = qMin(i + brightness, 255); + + update(); + emit brightnessChanged(brightness); +} + +/*! + \property QGraphicsBloomEffect::strength + \brief the strength of the effect. + + A strength 0.0 equals to no effect, while 1.0 means maximum glow. + + By default, the strength is 0.7. +*/ +qreal QGraphicsBloomEffect::strength() const +{ + Q_D(const QGraphicsBloomEffect); + return d->strength; +} + +void QGraphicsBloomEffect::setStrength(qreal strength) +{ + Q_D(QGraphicsBloomEffect); + strength = qBound(qreal(0.0), strength, qreal(1.0)); + if (qFuzzyCompare(d->strength, strength)) + return; + + d->strength = strength; + update(); + emit strengthChanged(strength); +} + +/*! + \reimp +*/ +void QGraphicsBloomEffect::draw(QPainter *painter, QGraphicsEffectSource *source) +{ + Q_D(QGraphicsBloomEffect); + if (d->strength < 0.001) { + source->draw(painter); + return; + } + + const Qt::CoordinateSystem system = source->isPixmap() + ? Qt::LogicalCoordinates : Qt::DeviceCoordinates; + QPoint offset; + QPixmap pixmap = source->pixmap(system, &offset); + QImage result = pixmap.toImage().convertToFormat(QImage::Format_ARGB32_Premultiplied); + + // Blur. + QPainter blurPainter(&pixmap); + d->blurFilter.draw(&blurPainter, QPointF(), pixmap); + blurPainter.end(); + + // Brighten. + QImage overlay = pixmap.toImage().convertToFormat(QImage::Format_ARGB32); + const int numBits = overlay.width() * overlay.height(); + QRgb *bits = reinterpret_cast(overlay.bits()); + for (int i = 0; i < numBits; ++i) { + const QRgb bit = bits[i]; + bits[i] = qRgba(d->colorTable[qRed(bit)], d->colorTable[qGreen(bit)], + d->colorTable[qBlue(bit)], qAlpha(bit)); + } + + // Composite. + QPainter compPainter(&result); + compPainter.setCompositionMode(QPainter::CompositionMode_Overlay); + compPainter.setOpacity(d->strength); + compPainter.drawImage(0, 0, overlay); + compPainter.end(); + + if (system == Qt::DeviceCoordinates) { + QTransform restoreTransform = painter->worldTransform(); + painter->setWorldTransform(QTransform()); + painter->drawImage(offset, result); + painter->setWorldTransform(restoreTransform); + } else { + painter->drawImage(offset, result); + } +} + QT_END_NAMESPACE diff --git a/src/gui/effects/qgraphicseffect.h b/src/gui/effects/qgraphicseffect.h index c256381..c2bb9b0 100644 --- a/src/gui/effects/qgraphicseffect.h +++ b/src/gui/effects/qgraphicseffect.h @@ -339,6 +339,40 @@ private: Q_DISABLE_COPY(QGraphicsOpacityEffect) }; +class QGraphicsBloomEffectPrivate; +class Q_GUI_EXPORT QGraphicsBloomEffect: public QGraphicsEffect +{ + Q_OBJECT + Q_PROPERTY(int blurRadius READ blurRadius WRITE setBlurRadius NOTIFY blurRadiusChanged) + Q_PROPERTY(int brightness READ brightness WRITE setBrightness NOTIFY brightnessChanged) + Q_PROPERTY(qreal strength READ strength WRITE setStrength NOTIFY strengthChanged) +public: + QGraphicsBloomEffect(QObject *parent = 0); + ~QGraphicsBloomEffect(); + + QRectF boundingRectFor(const QRectF &rect) const; + int blurRadius() const; + int brightness() const; + qreal strength() const; + +public Q_SLOTS: + void setBlurRadius(int blurRadius); + void setBrightness(int brightness); + void setStrength(qreal strength); + +Q_SIGNALS: + void blurRadiusChanged(int blurRadius); + void brightnessChanged(int brightness); + void strengthChanged(qreal strength); + +protected: + void draw(QPainter *painter, QGraphicsEffectSource *source); + +private: + Q_DECLARE_PRIVATE(QGraphicsBloomEffect) + Q_DISABLE_COPY(QGraphicsBloomEffect) +}; + QT_END_NAMESPACE QT_END_HEADER diff --git a/src/gui/effects/qgraphicseffect_p.h b/src/gui/effects/qgraphicseffect_p.h index e109790..96eda0e 100644 --- a/src/gui/effects/qgraphicseffect_p.h +++ b/src/gui/effects/qgraphicseffect_p.h @@ -185,6 +185,18 @@ public: uint hasOpacityMask : 1; }; +class QGraphicsBloomEffectPrivate : public QGraphicsEffectPrivate +{ + Q_DECLARE_PUBLIC(QGraphicsBlurEffect) +public: + QGraphicsBloomEffectPrivate() : brightness(70), strength(0.7) {} + + QPixmapBlurFilter blurFilter; + int colorTable[256]; + int brightness; + qreal strength; +}; + QT_END_NAMESPACE #endif // QGRAPHICSEFFECT_P_H -- cgit v0.12 From 53dd13e439932cb234fbfff9d0dcd97d67334329 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Nilsen?= Date: Wed, 30 Sep 2009 14:25:05 +0200 Subject: Add Qt::RenderHint to control rendering operations. We need a way to control various rendering operations. For example, whether quality is more important than performance, or the other way around. This change also replaces occurences of QPixmapFilter/QGraphicsEffect::BlurHint (introduced in 1a431e850893b6b162c833f4f148f090e2427dda) with Qt::RenderHint. Reviewed-by: Samuel --- src/corelib/global/qnamespace.h | 5 +++++ src/corelib/global/qnamespace.qdoc | 15 +++++++++++++++ src/gui/effects/qgraphicseffect.cpp | 36 +++++++++++------------------------- src/gui/effects/qgraphicseffect.h | 13 ++++--------- src/gui/image/qpixmapfilter.cpp | 8 ++++---- src/gui/image/qpixmapfilter_p.h | 9 ++------- src/opengl/qglpixmapfilter.cpp | 18 +++++++++--------- 7 files changed, 50 insertions(+), 54 deletions(-) diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h index 741c06f..473398b 100644 --- a/src/corelib/global/qnamespace.h +++ b/src/corelib/global/qnamespace.h @@ -1627,6 +1627,11 @@ public: NavigationModeCursorAuto, NavigationModeCursorForceVisible }; + + enum RenderHint { + QualityHint, + PerformanceHint + }; } #ifdef Q_MOC_RUN ; diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc index 40dd1d2..1833b96 100644 --- a/src/corelib/global/qnamespace.qdoc +++ b/src/corelib/global/qnamespace.qdoc @@ -2814,3 +2814,18 @@ \sa QApplication::setNavigationMode() \sa QApplication::navigationMode() */ + +/*! + \enum Qt::RenderHint + \since 4.6 + + This enum describes the possible hints that can be used to control various + rendering operations. + + \value QualityHint Indicates that rendering quality is the most important factor, + at the potential cost of lower performance. + + \value PerformanceHint Indicates that rendering performance is the most important factor, + at the potential cost of lower quality. +*/ + diff --git a/src/gui/effects/qgraphicseffect.cpp b/src/gui/effects/qgraphicseffect.cpp index 474af53..5fc61d7 100644 --- a/src/gui/effects/qgraphicseffect.cpp +++ b/src/gui/effects/qgraphicseffect.cpp @@ -796,7 +796,7 @@ QGraphicsBlurEffect::QGraphicsBlurEffect(QObject *parent) : QGraphicsEffect(*new QGraphicsBlurEffectPrivate, parent) { Q_D(QGraphicsBlurEffect); - d->filter->setBlurHint(QPixmapBlurFilter::PerformanceHint); + d->filter->setBlurHint(Qt::PerformanceHint); } /*! @@ -840,48 +840,34 @@ void QGraphicsBlurEffect::setBlurRadius(int radius) */ /*! - \enum QGraphicsBlurEffect::BlurHint - - \since 4.6 - - This enum describes the hint of a blur graphics effect. - - \value PerformanceHint Using this value hints that performance is the - most important factor, at the potential cost of lower quality. - - \value QualityHint Using this value hints that a higher quality blur is - preferred over a fast blur. -*/ - -/*! \property QGraphicsBlurEffect::blurHint \brief the blur hint of the effect. - Use the PerformanceHint blur hint to say that you want a faster blur, - and the QualityHint blur hint to say that you prefer a higher quality blur. + Use the Qt::PerformanceHint hint to say that you want a faster blur, + and the Qt::QualityHint hint to say that you prefer a higher quality blur. - When animating the blur radius it's recommended to use the PerformanceHint. + When animating the blur radius it's recommended to use Qt::PerformanceHint. - By default, the blur hint is PerformanceHint. + By default, the blur hint is Qt::PerformanceHint. */ -QGraphicsBlurEffect::BlurHint QGraphicsBlurEffect::blurHint() const +Qt::RenderHint QGraphicsBlurEffect::blurHint() const { Q_D(const QGraphicsBlurEffect); - return BlurHint(d->filter->blurHint()); + return d->filter->blurHint(); } -void QGraphicsBlurEffect::setBlurHint(QGraphicsBlurEffect::BlurHint hint) +void QGraphicsBlurEffect::setBlurHint(Qt::RenderHint hint) { Q_D(QGraphicsBlurEffect); - if (BlurHint(d->filter->blurHint()) == hint) + if (d->filter->blurHint() == hint) return; - d->filter->setBlurHint(QPixmapBlurFilter::BlurHint(hint)); + d->filter->setBlurHint(hint); emit blurHintChanged(hint); } /*! - \fn void QGraphicsBlurEffect::blurHintChanged(QGraphicsBlurEffect::BlurHint hint) + \fn void QGraphicsBlurEffect::blurHintChanged(Qt::RenderHint hint) This signal is emitted whenever the effect's blur hint changes. The \a hint parameter holds the effect's new blur hint. diff --git a/src/gui/effects/qgraphicseffect.h b/src/gui/effects/qgraphicseffect.h index c2bb9b0..a92ce13 100644 --- a/src/gui/effects/qgraphicseffect.h +++ b/src/gui/effects/qgraphicseffect.h @@ -224,27 +224,22 @@ class Q_GUI_EXPORT QGraphicsBlurEffect: public QGraphicsEffect { Q_OBJECT Q_PROPERTY(int blurRadius READ blurRadius WRITE setBlurRadius NOTIFY blurRadiusChanged) - Q_PROPERTY(BlurHint blurHint READ blurHint WRITE setBlurHint NOTIFY blurHintChanged) + Q_PROPERTY(Qt::RenderHint blurHint READ blurHint WRITE setBlurHint NOTIFY blurHintChanged) public: - enum BlurHint { - PerformanceHint, - QualityHint - }; - QGraphicsBlurEffect(QObject *parent = 0); ~QGraphicsBlurEffect(); QRectF boundingRectFor(const QRectF &rect) const; int blurRadius() const; - BlurHint blurHint() const; + Qt::RenderHint blurHint() const; public Q_SLOTS: void setBlurRadius(int blurRadius); - void setBlurHint(BlurHint blurHint); + void setBlurHint(Qt::RenderHint hint); Q_SIGNALS: void blurRadiusChanged(int blurRadius); - void blurHintChanged(BlurHint blurHint); + void blurHintChanged(Qt::RenderHint hint); protected: void draw(QPainter *painter, QGraphicsEffectSource *source); diff --git a/src/gui/image/qpixmapfilter.cpp b/src/gui/image/qpixmapfilter.cpp index ba9a1e2..749b8f3 100644 --- a/src/gui/image/qpixmapfilter.cpp +++ b/src/gui/image/qpixmapfilter.cpp @@ -504,10 +504,10 @@ void QPixmapConvolutionFilter::draw(QPainter *painter, const QPointF &p, const Q class QPixmapBlurFilterPrivate : public QPixmapFilterPrivate { public: - QPixmapBlurFilterPrivate() : radius(5), hint(QPixmapBlurFilter::PerformanceHint) {} + QPixmapBlurFilterPrivate() : radius(5), hint(Qt::PerformanceHint) {} int radius; - QPixmapBlurFilter::BlurHint hint; + Qt::RenderHint hint; }; @@ -561,7 +561,7 @@ int QPixmapBlurFilter::radius() const \internal */ -void QPixmapBlurFilter::setBlurHint(QPixmapBlurFilter::BlurHint hint) +void QPixmapBlurFilter::setBlurHint(Qt::RenderHint hint) { Q_D(QPixmapBlurFilter); d->hint = hint; @@ -572,7 +572,7 @@ void QPixmapBlurFilter::setBlurHint(QPixmapBlurFilter::BlurHint hint) \internal */ -QPixmapBlurFilter::BlurHint QPixmapBlurFilter::blurHint() const +Qt::RenderHint QPixmapBlurFilter::blurHint() const { Q_D(const QPixmapBlurFilter); return d->hint; diff --git a/src/gui/image/qpixmapfilter_p.h b/src/gui/image/qpixmapfilter_p.h index 92c8e56..8a2207a 100644 --- a/src/gui/image/qpixmapfilter_p.h +++ b/src/gui/image/qpixmapfilter_p.h @@ -126,19 +126,14 @@ class Q_GUI_EXPORT QPixmapBlurFilter : public QPixmapFilter Q_DECLARE_PRIVATE(QPixmapBlurFilter) public: - enum BlurHint { - PerformanceHint, - QualityHint - }; - QPixmapBlurFilter(QObject *parent = 0); ~QPixmapBlurFilter(); void setRadius(int radius); - void setBlurHint(BlurHint hint); + void setBlurHint(Qt::RenderHint hint); int radius() const; - BlurHint blurHint() const; + Qt::RenderHint blurHint() const; QRectF boundingRectFor(const QRectF &rect) const; void draw(QPainter *painter, const QPointF &dest, const QPixmap &src, const QRectF &srcRect = QRectF()) const; diff --git a/src/opengl/qglpixmapfilter.cpp b/src/opengl/qglpixmapfilter.cpp index 15714c2..1ae3866 100644 --- a/src/opengl/qglpixmapfilter.cpp +++ b/src/opengl/qglpixmapfilter.cpp @@ -100,7 +100,7 @@ private: class QGLPixmapBlurFilter : public QGLCustomShaderStage, public QGLPixmapFilter { public: - QGLPixmapBlurFilter(QPixmapBlurFilter::BlurHint hint); + QGLPixmapBlurFilter(Qt::RenderHint hint); void setUniforms(QGLShaderProgram *program); @@ -115,7 +115,7 @@ private: mutable bool m_haveCached; mutable int m_cachedRadius; - mutable QPixmapBlurFilter::BlurHint m_hint; + mutable Qt::RenderHint m_hint; }; extern QGLWidget *qt_gl_share_widget(); @@ -131,13 +131,13 @@ QPixmapFilter *QGL2PaintEngineEx::pixmapFilter(int type, const QPixmapFilter *pr case QPixmapFilter::BlurFilter: { const QPixmapBlurFilter *proto = static_cast(prototype); - if (proto->blurHint() == QPixmapBlurFilter::PerformanceHint || proto->radius() <= 5) { + if (proto->blurHint() == Qt::PerformanceHint || proto->radius() <= 5) { if (!d->fastBlurFilter) - d->fastBlurFilter.reset(new QGLPixmapBlurFilter(QPixmapBlurFilter::PerformanceHint)); + d->fastBlurFilter.reset(new QGLPixmapBlurFilter(Qt::PerformanceHint)); return d->fastBlurFilter.data(); } if (!d->blurFilter) - d->blurFilter.reset(new QGLPixmapBlurFilter(QPixmapBlurFilter::QualityHint)); + d->blurFilter.reset(new QGLPixmapBlurFilter(Qt::QualityHint)); return d->blurFilter.data(); } @@ -279,12 +279,12 @@ static const char *qt_gl_blur_filter_fast = " return color * (1.0 / float(samples));" "}"; -QGLPixmapBlurFilter::QGLPixmapBlurFilter(QPixmapBlurFilter::BlurHint hint) +QGLPixmapBlurFilter::QGLPixmapBlurFilter(Qt::RenderHint hint) : m_haveCached(false) , m_cachedRadius(5) , m_hint(hint) { - if (hint == PerformanceHint) { + if (hint == Qt::PerformanceHint) { QGLPixmapBlurFilter *filter = const_cast(this); filter->setSource(qt_gl_blur_filter_fast); m_haveCached = true; @@ -296,7 +296,7 @@ bool QGLPixmapBlurFilter::processGL(QPainter *painter, const QPointF &pos, const QGLPixmapBlurFilter *filter = const_cast(this); int radius = this->radius(); - if (!m_haveCached || (m_hint == QualityHint && radius != m_cachedRadius)) { + if (!m_haveCached || (m_hint == Qt::QualityHint && radius != m_cachedRadius)) { // Only regenerate the shader from source if parameters have changed. m_haveCached = true; m_cachedRadius = radius; @@ -358,7 +358,7 @@ bool QGLPixmapBlurFilter::processGL(QPainter *painter, const QPointF &pos, const void QGLPixmapBlurFilter::setUniforms(QGLShaderProgram *program) { - if (m_hint == QualityHint) { + if (m_hint == Qt::QualityHint) { if (m_horizontalBlur) program->setUniformValue("delta", 1.0 / m_textureSize.width(), 0.0); else -- cgit v0.12 From 7ca2f8ee15fbac8dce815678d7d63748d3187cb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Nilsen?= Date: Wed, 30 Sep 2009 14:57:08 +0200 Subject: Added QGraphicsBloomEffect::blurHint. This allows the user to control whether to use a fast dynamic blur or a static high quality blur. Reviewed-by: Samuel --- src/gui/effects/qgraphicseffect.cpp | 34 ++++++++++++++++++++++++++++++++++ src/gui/effects/qgraphicseffect.h | 4 ++++ 2 files changed, 38 insertions(+) diff --git a/src/gui/effects/qgraphicseffect.cpp b/src/gui/effects/qgraphicseffect.cpp index 5fc61d7..4a59301 100644 --- a/src/gui/effects/qgraphicseffect.cpp +++ b/src/gui/effects/qgraphicseffect.cpp @@ -1363,6 +1363,40 @@ void QGraphicsBloomEffect::setBlurRadius(int radius) } /*! + \property QGraphicsBloomEffect::blurHint + \brief the blur hint of the effect. + + Use the Qt::PerformanceHint hint to say that you want a faster blur, + and the Qt::QualityHint hint to say that you prefer a higher quality blur. + + When animating the blur radius it's recommended to use Qt::PerformanceHint. + + By default, the blur hint is Qt::PerformanceHint. +*/ +Qt::RenderHint QGraphicsBloomEffect::blurHint() const +{ + Q_D(const QGraphicsBloomEffect); + return d->blurFilter.blurHint(); +} + +void QGraphicsBloomEffect::setBlurHint(Qt::RenderHint hint) +{ + Q_D(QGraphicsBloomEffect); + if (d->blurFilter.blurHint() == hint) + return; + + d->blurFilter.setBlurHint(hint); + emit blurHintChanged(hint); +} + +/*! + \fn void QGraphicsBloomEffect::blurHintChanged(Qt::RenderHint hint) + + This signal is emitted whenever the effect's blur hint changes. + The \a hint parameter holds the effect's new blur hint. +*/ + +/*! \property QGraphicsBloomEffect::brightness \brief the brightness of the glow. diff --git a/src/gui/effects/qgraphicseffect.h b/src/gui/effects/qgraphicseffect.h index a92ce13..c5d3ede 100644 --- a/src/gui/effects/qgraphicseffect.h +++ b/src/gui/effects/qgraphicseffect.h @@ -339,6 +339,7 @@ class Q_GUI_EXPORT QGraphicsBloomEffect: public QGraphicsEffect { Q_OBJECT Q_PROPERTY(int blurRadius READ blurRadius WRITE setBlurRadius NOTIFY blurRadiusChanged) + Q_PROPERTY(Qt::RenderHint blurHint READ blurHint WRITE setBlurHint NOTIFY blurHintChanged) Q_PROPERTY(int brightness READ brightness WRITE setBrightness NOTIFY brightnessChanged) Q_PROPERTY(qreal strength READ strength WRITE setStrength NOTIFY strengthChanged) public: @@ -347,16 +348,19 @@ public: QRectF boundingRectFor(const QRectF &rect) const; int blurRadius() const; + Qt::RenderHint blurHint() const; int brightness() const; qreal strength() const; public Q_SLOTS: void setBlurRadius(int blurRadius); + void setBlurHint(Qt::RenderHint hint); void setBrightness(int brightness); void setStrength(qreal strength); Q_SIGNALS: void blurRadiusChanged(int blurRadius); + void blurHintChanged(Qt::RenderHint hint); void brightnessChanged(int brightness); void strengthChanged(qreal strength); -- cgit v0.12 From ad2a693584bd2892a568e3830b1c390d6e5f012a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Nilsen?= Date: Wed, 30 Sep 2009 15:12:46 +0200 Subject: Doc: Remaining pieces of the Graphics effect documentation. --- src/corelib/global/qnamespace.qdoc | 13 +++++++++++++ src/gui/effects/qgraphicseffect.cpp | 21 +++++++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc index 1833b96..684ebca 100644 --- a/src/corelib/global/qnamespace.qdoc +++ b/src/corelib/global/qnamespace.qdoc @@ -2776,6 +2776,19 @@ */ /*! + \enum Qt::CoordinateSystem + \since 4.6 + + This enum specifies the coordinate system. + + \value DeviceCoordinates Coordinates are relative to the upper-left corner + of the object's paint device. + + \value LogicalCoordinates Coordinates are relative to the upper-left corner + of the object. +*/ + +/*! \enum Qt::GestureState \since 4.6 diff --git a/src/gui/effects/qgraphicseffect.cpp b/src/gui/effects/qgraphicseffect.cpp index 4a59301..e971fd8 100644 --- a/src/gui/effects/qgraphicseffect.cpp +++ b/src/gui/effects/qgraphicseffect.cpp @@ -1363,6 +1363,13 @@ void QGraphicsBloomEffect::setBlurRadius(int radius) } /*! + \fn void QGraphicsBloomEffect::blurRadiusChanged(int blurRadius) + + This signal is emitted whenever the effect's blur radius changes. + The \a blurRadius parameter holds the effect's new blur radius. +*/ + +/*! \property QGraphicsBloomEffect::blurHint \brief the blur hint of the effect. @@ -1429,6 +1436,13 @@ void QGraphicsBloomEffect::setBrightness(int brightness) } /*! + \fn void QGraphicsBloomEffect::brightnessChanged(int brightness) + + This signal is emitted whenever the effect's brightness changes. + The \a brightness parameter holds the effect's new brightness. +*/ + +/*! \property QGraphicsBloomEffect::strength \brief the strength of the effect. @@ -1455,6 +1469,13 @@ void QGraphicsBloomEffect::setStrength(qreal strength) } /*! + \fn void QGraphicsBloomEffect::strengthChanged(qreal strength) + + This signal is emitted whenever the effect's strength changes. + The \a strength parameter holds the effect's new strength. +*/ + +/*! \reimp */ void QGraphicsBloomEffect::draw(QPainter *painter, QGraphicsEffectSource *source) -- cgit v0.12 From 571cb24e2c142b4089d1a263b9f3f97f5e211b51 Mon Sep 17 00:00:00 2001 From: Peter Hartmann Date: Wed, 30 Sep 2009 16:42:37 +0200 Subject: Revert "Google Chat example: state that SSL is required" This reverts commit 59623e45ee31892c9ef210f8d7e396ccb0fe31a5. A fix for the same problem had been pushed by Simon shortly before that one. --- examples/webkit/googlechat/main.cpp | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/examples/webkit/googlechat/main.cpp b/examples/webkit/googlechat/main.cpp index 9e235a9..fd08114 100644 --- a/examples/webkit/googlechat/main.cpp +++ b/examples/webkit/googlechat/main.cpp @@ -43,25 +43,10 @@ #include #include "googlechat.h" -#ifndef QT_NO_OPENSSL -#include -#endif - int main(int argc, char * argv[]) { QApplication app(argc, argv); -#ifndef QT_NO_OPENSSL - if (!QSslSocket::supportsSsl()) { -#endif - QMessageBox::information(0, "Google Talk client", - "Your system does not support SSL, " - "which is required to run this example."); - return -1; -#ifndef QT_NO_OPENSSL - } -#endif - QNetworkProxyFactory::setUseSystemConfigurationEnabled(true); GoogleChat *chat = new GoogleChat; -- cgit v0.12 From 6fb1e687310f3f70c2f0bd3f25e91b65e65cafd2 Mon Sep 17 00:00:00 2001 From: Peter Hartmann Date: Wed, 30 Sep 2009 16:51:27 +0200 Subject: Google Chat example: always bail out if SSL not available Reviewed-by: Simon Hausmann --- examples/webkit/googlechat/googlechat.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/webkit/googlechat/googlechat.cpp b/examples/webkit/googlechat/googlechat.cpp index af567d1..d2307d9 100644 --- a/examples/webkit/googlechat/googlechat.cpp +++ b/examples/webkit/googlechat/googlechat.cpp @@ -118,12 +118,12 @@ void GoogleChat::doLogin() { } void GoogleChat::initialPage(bool ok) { - if (ok) { - if (!QSslSocket::supportsSsl()) { - showError("This example requires SSL support."); - return; - } + if (!QSslSocket::supportsSsl()) { + showError("This example requires SSL support."); + return; + } + if (ok) { QString s1 = evalJS("document.getElementById('Email').name"); QString s2 = evalJS("document.getElementById('Passwd').name"); QString s3 = evalJS("document.getElementById('gaia_loginform').id"); -- cgit v0.12 From 3b8c67a07acd049035ac67c6ff981939f357473c Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Wed, 30 Sep 2009 17:03:59 +0200 Subject: Fix locale encoding in XLIFF files xlf uses xx-YY notation instead of xx_YY Reviewed-by: ossi --- tools/linguist/shared/xliff.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/tools/linguist/shared/xliff.cpp b/tools/linguist/shared/xliff.cpp index b0c7546..696c930 100644 --- a/tools/linguist/shared/xliff.cpp +++ b/tools/linguist/shared/xliff.cpp @@ -498,7 +498,9 @@ bool XLIFFHandler::startElement(const QString& namespaceURI, } else if (localName == QLatin1String("file")) { m_fileName = atts.value(QLatin1String("original")); m_language = atts.value(QLatin1String("target-language")); + m_language.replace(QLatin1Char('-'), QLatin1Char('_')); m_sourceLanguage = atts.value(QLatin1String("source-language")); + m_sourceLanguage.replace(QLatin1Char('-'), QLatin1Char('_')); } else if (localName == QLatin1String("group")) { if (atts.value(QLatin1String("restype")) == QLatin1String(restypeContext)) { m_context = atts.value(QLatin1String("resname")); @@ -768,14 +770,19 @@ bool saveXLIFF(const Translator &translator, QIODevice &dev, ConversionData &cd) << "\" xmlns:trolltech=\"" << TrollTsNamespaceURI << "\">\n"; ++indent; writeExtras(ts, indent, translator.extras(), drops); + QString sourceLanguageCode = translator.sourceLanguageCode(); + if (sourceLanguageCode.isEmpty() || sourceLanguageCode == QLatin1String("C")) + sourceLanguageCode = QLatin1String("en"); + else + sourceLanguageCode.replace(QLatin1Char('_'), QLatin1Char('-')); + QString languageCode = translator.languageCode(); + languageCode.replace(QLatin1Char('_'), QLatin1Char('-')); foreach (const QString &fn, fileOrder) { writeIndent(ts, indent); ts << "first()) << "\"" - << " source-language=\"" - << (translator.sourceLanguageCode().isEmpty() ? - QByteArray("en") : translator.sourceLanguageCode().toLatin1()) << "\"" - << " target-language=\"" << translator.languageCode() << "\"" + << " source-language=\"" << sourceLanguageCode.toLatin1() << "\"" + << " target-language=\"" << languageCode.toLatin1() << "\"" << ">\n"; ++indent; -- cgit v0.12 From 40909863e9eb17e0d0469ade608426dbbd08b43e Mon Sep 17 00:00:00 2001 From: Peter Hartmann Date: Tue, 29 Sep 2009 11:29:01 +0200 Subject: QDom: set the codec to UTF-8 if codec not present or unknown we were trying to get a codec even for unknown names. Now, we always set the codec to UTF8 if the field is not present or we do not know the codec. Reviewed-by: Paul --- src/xml/dom/qdom.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/xml/dom/qdom.cpp b/src/xml/dom/qdom.cpp index 3ae91d3..b06fbeb 100644 --- a/src/xml/dom/qdom.cpp +++ b/src/xml/dom/qdom.cpp @@ -6438,22 +6438,23 @@ void QDomDocumentPrivate::saveDocument(QTextStream& s, const int indent, QDomNod #ifndef QT_NO_TEXTCODEC const QDomNodePrivate* n = first; + QTextCodec *codec = 0; + if (n && n->isProcessingInstruction() && n->nodeName() == QLatin1String("xml")) { // we have an XML declaration QString data = n->nodeValue(); QRegExp encoding(QString::fromLatin1("encoding\\s*=\\s*((\"([^\"]*)\")|('([^']*)'))")); encoding.indexIn(data); QString enc = encoding.cap(3); - if (enc.isEmpty()) { - enc = encoding.cap(5); - } if (enc.isEmpty()) - s.setCodec(QTextCodec::codecForName("UTF-8")); - else - s.setCodec(QTextCodec::codecForName(enc.toLatin1().data())); - } else { - s.setCodec(QTextCodec::codecForName("UTF-8")); + enc = encoding.cap(5); + if (!enc.isEmpty()) + codec = QTextCodec::codecForName(enc.toLatin1().data()); } + if (!codec) + codec = QTextCodec::codecForName("UTF-8"); + if (codec) + s.setCodec(codec); #endif bool doc = false; -- cgit v0.12 From ea533924ddc8a1f4d0c2d400aacee98aff952a00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Abecasis?= Date: Wed, 30 Sep 2009 16:09:38 +0200 Subject: Cleaning up usage of examples/{examplebase,symbianpkgrules}.pri examplebase.pri was renamed to symbianpkgrules, but some project files were not updated to reflect the change. Since it doesn't make sense to have this in non-portable examples, the include is removed in those cases. Reviewed-by: Espen Riskedal --- examples/activeqt/activeqt.pro | 2 -- examples/activeqt/comapp/comapp.pro | 2 -- examples/activeqt/hierarchy/hierarchy.pro | 2 -- examples/activeqt/menus/menus.pro | 2 -- examples/activeqt/multiple/multiple.pro | 2 -- examples/activeqt/opengl/opengl.pro | 2 -- examples/activeqt/qutlook/qutlook.pro | 2 -- examples/activeqt/simple/simple.pro | 2 -- examples/activeqt/webbrowser/webbrowser.pro | 2 -- examples/activeqt/wrapper/wrapper.pro | 2 -- examples/qws/ahigl/ahigl.pro | 2 -- examples/qws/dbscreen/dbscreen.pro | 2 -- examples/qws/framebuffer/framebuffer.pro | 2 -- examples/qws/mousecalibration/mousecalibration.pro | 2 -- examples/qws/qws.pro | 2 -- examples/qws/svgalib/svgalib.pro | 2 -- examples/script/qsdbg/qsdbg.pro | 4 +--- 17 files changed, 1 insertion(+), 35 deletions(-) diff --git a/examples/activeqt/activeqt.pro b/examples/activeqt/activeqt.pro index db63104..262e1a1 100644 --- a/examples/activeqt/activeqt.pro +++ b/examples/activeqt/activeqt.pro @@ -18,5 +18,3 @@ target.path = $$[QT_INSTALL_EXAMPLES]/activeqt sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS activeqt.pro sources.path = $$[QT_INSTALL_EXAMPLES]/activeqt INSTALLS += target sources - -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) diff --git a/examples/activeqt/comapp/comapp.pro b/examples/activeqt/comapp/comapp.pro index 99b8933..84ce072 100644 --- a/examples/activeqt/comapp/comapp.pro +++ b/examples/activeqt/comapp/comapp.pro @@ -11,5 +11,3 @@ target.path = $$[QT_INSTALL_EXAMPLES]/activeqt/comapp sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS comapp.pro sources.path = $$[QT_INSTALL_EXAMPLES]/activeqt/comapp INSTALLS += target sources - -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) diff --git a/examples/activeqt/hierarchy/hierarchy.pro b/examples/activeqt/hierarchy/hierarchy.pro index cd1d754..abe5f1b 100644 --- a/examples/activeqt/hierarchy/hierarchy.pro +++ b/examples/activeqt/hierarchy/hierarchy.pro @@ -14,5 +14,3 @@ target.path = $$[QT_INSTALL_EXAMPLES]/activeqt/hierarchy sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS hierarchy.pro sources.path = $$[QT_INSTALL_EXAMPLES]/activeqt/hierarchy INSTALLS += target sources - -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) diff --git a/examples/activeqt/menus/menus.pro b/examples/activeqt/menus/menus.pro index f197833..c962b6b 100644 --- a/examples/activeqt/menus/menus.pro +++ b/examples/activeqt/menus/menus.pro @@ -12,5 +12,3 @@ target.path = $$[QT_INSTALL_EXAMPLES]/activeqt/menus sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS menus.pro sources.path = $$[QT_INSTALL_EXAMPLES]/activeqt/menus INSTALLS += target sources - -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) diff --git a/examples/activeqt/multiple/multiple.pro b/examples/activeqt/multiple/multiple.pro index 9c95921..7b86950 100644 --- a/examples/activeqt/multiple/multiple.pro +++ b/examples/activeqt/multiple/multiple.pro @@ -14,5 +14,3 @@ target.path = $$[QT_INSTALL_EXAMPLES]/activeqt/multiple sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS multiple.pro sources.path = $$[QT_INSTALL_EXAMPLES]/activeqt/multiple INSTALLS += target sources - -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) diff --git a/examples/activeqt/opengl/opengl.pro b/examples/activeqt/opengl/opengl.pro index 978bd66..8eb81be 100644 --- a/examples/activeqt/opengl/opengl.pro +++ b/examples/activeqt/opengl/opengl.pro @@ -17,5 +17,3 @@ target.path = $$[QT_INSTALL_EXAMPLES]/activeqt/opengl sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS opengl.pro sources.path = $$[QT_INSTALL_EXAMPLES]/activeqt/opengl INSTALLS += target sources - -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) diff --git a/examples/activeqt/qutlook/qutlook.pro b/examples/activeqt/qutlook/qutlook.pro index 0387735..c1154e0 100644 --- a/examples/activeqt/qutlook/qutlook.pro +++ b/examples/activeqt/qutlook/qutlook.pro @@ -21,5 +21,3 @@ target.path = $$[QT_INSTALL_EXAMPLES]/activeqt/qutlook sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS qutlook.pro sources.path = $$[QT_INSTALL_EXAMPLES]/activeqt/qutlook INSTALLS += target sources - -include($$QT_SOURCE_TREE/examples/examplebase.pri) diff --git a/examples/activeqt/simple/simple.pro b/examples/activeqt/simple/simple.pro index 243d06a..d0f2019 100644 --- a/examples/activeqt/simple/simple.pro +++ b/examples/activeqt/simple/simple.pro @@ -11,5 +11,3 @@ target.path = $$[QT_INSTALL_EXAMPLES]/activeqt/simple sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS simple.pro sources.path = $$[QT_INSTALL_EXAMPLES]/activeqt/simple INSTALLS += target sources - -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) diff --git a/examples/activeqt/webbrowser/webbrowser.pro b/examples/activeqt/webbrowser/webbrowser.pro index 13b1983..32eac71 100644 --- a/examples/activeqt/webbrowser/webbrowser.pro +++ b/examples/activeqt/webbrowser/webbrowser.pro @@ -15,5 +15,3 @@ target.path = $$[QT_INSTALL_EXAMPLES]/activeqt/webbrowser sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS webbrowser.pro sources.path = $$[QT_INSTALL_EXAMPLES]/activeqt/webbrowser INSTALLS += target sources - -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) diff --git a/examples/activeqt/wrapper/wrapper.pro b/examples/activeqt/wrapper/wrapper.pro index a207f2e..4eb6baf 100644 --- a/examples/activeqt/wrapper/wrapper.pro +++ b/examples/activeqt/wrapper/wrapper.pro @@ -13,5 +13,3 @@ target.path = $$[QT_INSTALL_EXAMPLES]/activeqt/wrapper sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS wrapper.pro sources.path = $$[QT_INSTALL_EXAMPLES]/activeqt/wrapper INSTALLS += target sources - -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) diff --git a/examples/qws/ahigl/ahigl.pro b/examples/qws/ahigl/ahigl.pro index c831335..1ee8e6e 100644 --- a/examples/qws/ahigl/ahigl.pro +++ b/examples/qws/ahigl/ahigl.pro @@ -7,8 +7,6 @@ TARGET = qahiglscreen target.path = $$[QT_INSTALL_PLUGINS]/gfxdrivers INSTALLS += target -include($$QT_SOURCE_TREE/examples/examplebase.pri) - HEADERS = qwindowsurface_ahigl_p.h \ qscreenahigl_qws.h diff --git a/examples/qws/dbscreen/dbscreen.pro b/examples/qws/dbscreen/dbscreen.pro index 86152ab..172a02a 100644 --- a/examples/qws/dbscreen/dbscreen.pro +++ b/examples/qws/dbscreen/dbscreen.pro @@ -5,8 +5,6 @@ TARGET = dbscreen target.path += $$[QT_INSTALL_PLUGINS]/gfxdrivers INSTALLS += target -include($$QT_SOURCE_TREE/examples/examplebase.pri) - HEADERS = dbscreen.h SOURCES = dbscreendriverplugin.cpp \ dbscreen.cpp diff --git a/examples/qws/framebuffer/framebuffer.pro b/examples/qws/framebuffer/framebuffer.pro index 3fd0975..f9fe850 100644 --- a/examples/qws/framebuffer/framebuffer.pro +++ b/examples/qws/framebuffer/framebuffer.pro @@ -9,5 +9,3 @@ target.path = $$[QT_INSTALL_EXAMPLES]/qws/framebuffer sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS framebuffer.pro sources.path = $$[QT_INSTALL_EXAMPLES]/qws/framebuffer INSTALLS += target sources - -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) diff --git a/examples/qws/mousecalibration/mousecalibration.pro b/examples/qws/mousecalibration/mousecalibration.pro index fc1c469..bd31853 100644 --- a/examples/qws/mousecalibration/mousecalibration.pro +++ b/examples/qws/mousecalibration/mousecalibration.pro @@ -9,5 +9,3 @@ target.path = $$[QT_INSTALL_EXAMPLES]/qws/mousecalibration sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS *.pro sources.path = $$[QT_INSTALL_EXAMPLES]/qws/mousecalibration INSTALLS += target sources - -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) diff --git a/examples/qws/qws.pro b/examples/qws/qws.pro index 48c59c1..95e1b44 100644 --- a/examples/qws/qws.pro +++ b/examples/qws/qws.pro @@ -7,5 +7,3 @@ SUBDIRS += mousecalibration simpledecoration sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS README *.pro sources.path = $$[QT_INSTALL_EXAMPLES]/qws INSTALLS += sources - -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) diff --git a/examples/qws/svgalib/svgalib.pro b/examples/qws/svgalib/svgalib.pro index 3ab5a19..8a47c1d 100644 --- a/examples/qws/svgalib/svgalib.pro +++ b/examples/qws/svgalib/svgalib.pro @@ -7,8 +7,6 @@ TARGET = svgalibscreen target.path = $$[QT_INSTALL_PLUGINS]/gfxdrivers INSTALLS += target -include($$QT_SOURCE_TREE/examples/examplebase.pri) - HEADERS = svgalibscreen.h \ svgalibpaintengine.h \ svgalibsurface.h \ diff --git a/examples/script/qsdbg/qsdbg.pro b/examples/script/qsdbg/qsdbg.pro index 77b55a2..424e0fb 100644 --- a/examples/script/qsdbg/qsdbg.pro +++ b/examples/script/qsdbg/qsdbg.pro @@ -16,6 +16,4 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS qsdbg.pro sources.path = $$[QT_INSTALL_EXAMPLES]/script/qsdbg INSTALLS += target sources -include($$QT_SOURCE_TREE/examples/examplebase.pri) - - +symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) -- cgit v0.12 From 71de0671ba5e57c7eb34a09d24e08c8926630e0f Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 18 Aug 2009 11:29:01 +0200 Subject: improve condition nesting compilers might or might not have been clever enough to optimize it. better safe than sorry. Reviewed-By: mariusSO --- src/corelib/io/qtextstream.cpp | 34 +++++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/src/corelib/io/qtextstream.cpp b/src/corelib/io/qtextstream.cpp index 5931267..eafc561 100644 --- a/src/corelib/io/qtextstream.cpp +++ b/src/corelib/io/qtextstream.cpp @@ -736,16 +736,28 @@ bool QTextStreamPrivate::scan(const QChar **ptr, int *length, int maxlen, TokenD const QChar ch = *chPtr++; ++totalSize; - if (delimiter == Space && ch.isSpace()) { - foundToken = true; - delimSize = 1; - } else if (delimiter == NotSpace && !ch.isSpace()) { - foundToken = true; - delimSize = 1; - } else if (delimiter == EndOfLine && ch == QLatin1Char('\n')) { - foundToken = true; - delimSize = (lastChar == QLatin1Char('\r')) ? 2 : 1; - consumeDelimiter = true; + switch (delimiter) { + case Space: + if (ch.isSpace()) { + foundToken = true; + delimSize = 1; + } + break; + case NotSpace: + if (!ch.isSpace()) { + foundToken = true; + delimSize = 1; + } + break; + case EndOfLine: + if (ch == QLatin1Char('\n')) { + foundToken = true; + delimSize = (lastChar == QLatin1Char('\r')) ? 2 : 1; + consumeDelimiter = true; + } + break; + default: + break; } lastChar = ch; @@ -769,7 +781,7 @@ bool QTextStreamPrivate::scan(const QChar **ptr, int *length, int maxlen, TokenD // if we find a '\r' at the end of the data when reading lines, // don't make it part of the line. - if (totalSize > 0 && !foundToken && delimiter == EndOfLine) { + if (delimiter == EndOfLine && totalSize > 0 && !foundToken) { if (((string && stringOffset + totalSize == string->size()) || (device && device->atEnd())) && lastChar == QLatin1Char('\r')) { consumeDelimiter = true; -- cgit v0.12 From 607df95ef6ca5c5a2632d3befbf604dfcfbed530 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 18 Aug 2009 11:34:03 +0200 Subject: optimize scan() lastChar needs to be set only when in line mode Reviewed-By: mariusSO --- src/corelib/io/qtextstream.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/corelib/io/qtextstream.cpp b/src/corelib/io/qtextstream.cpp index eafc561..415ba60 100644 --- a/src/corelib/io/qtextstream.cpp +++ b/src/corelib/io/qtextstream.cpp @@ -755,12 +755,11 @@ bool QTextStreamPrivate::scan(const QChar **ptr, int *length, int maxlen, TokenD delimSize = (lastChar == QLatin1Char('\r')) ? 2 : 1; consumeDelimiter = true; } + lastChar = ch; break; default: break; } - - lastChar = ch; } } while (!foundToken && (!maxlen || totalSize < maxlen) -- cgit v0.12 From 27b3784bf84ecd7c760b4d3ec47a657a1f3a0d40 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 18 Aug 2009 16:43:34 +0200 Subject: optimize read() and readAll() factor out a dedicated private::read() function based on private::scan(). this avoids making the latter even more complex in the process of optimizing it. Reviewed-By: mariusSO --- src/corelib/io/qtextstream.cpp | 44 +++++++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/src/corelib/io/qtextstream.cpp b/src/corelib/io/qtextstream.cpp index 415ba60..594718e 100644 --- a/src/corelib/io/qtextstream.cpp +++ b/src/corelib/io/qtextstream.cpp @@ -241,6 +241,7 @@ static const int QTEXTSTREAM_BUFFERSIZE = 16384; #include "private/qlocale_p.h" #include +#include #include #if defined QTEXTSTREAM_DEBUG @@ -375,10 +376,10 @@ public: enum TokenDelimiter { Space, NotSpace, - EndOfLine, - EndOfFile + EndOfLine }; + QString read(int maxlen); bool scan(const QChar **ptr, int *tokenLength, int maxlen, TokenDelimiter delimiter); inline const QChar *readPtr() const; @@ -704,6 +705,25 @@ bool QTextStreamPrivate::flushWriteBuffer() return flushed && bytesWritten == qint64(data.size()); } +QString QTextStreamPrivate::read(int maxlen) +{ + QString ret; + if (string) { + lastTokenSize = qMin(maxlen, string->size() - stringOffset); + ret = string->mid(stringOffset, lastTokenSize); + } else { + while (readBuffer.size() - readBufferOffset < maxlen && fillReadBuffer()) ; + lastTokenSize = qMin(maxlen, readBuffer.size() - readBufferOffset); + ret = readBuffer.mid(readBufferOffset, lastTokenSize); + } + consumeLastToken(); + +#if defined (QTEXTSTREAM_DEBUG) + qDebug("QTextStreamPrivate::read() maxlen = %d, token length = %d", maxlen, ret.length()); +#endif + return ret; +} + /*! \internal Scans no more than \a maxlen QChars in the current buffer for the @@ -757,8 +777,6 @@ bool QTextStreamPrivate::scan(const QChar **ptr, int *length, int maxlen, TokenD } lastChar = ch; break; - default: - break; } } } while (!foundToken @@ -1614,14 +1632,7 @@ QString QTextStream::readAll() Q_D(QTextStream); CHECK_VALID_STREAM(QString()); - const QChar *readPtr; - int length; - if (!d->scan(&readPtr, &length, /* maxlen = */ 0, QTextStreamPrivate::EndOfFile)) - return QString(); - - QString tmp = QString(readPtr, length); - d->consumeLastToken(); - return tmp; + return d->read(INT_MAX); } /*! @@ -1673,14 +1684,7 @@ QString QTextStream::read(qint64 maxlen) if (maxlen <= 0) return QString::fromLatin1(""); // empty, not null - const QChar *readPtr; - int length; - if (!d->scan(&readPtr, &length, int(maxlen), QTextStreamPrivate::EndOfFile)) - return QString(); - - QString tmp = QString(readPtr, length); - d->consumeLastToken(); - return tmp; + return d->read(int(maxlen)); } /*! \internal -- cgit v0.12 From 12eae101aa19fd7a4c7862188c16134ca51f3fd4 Mon Sep 17 00:00:00 2001 From: Peter Hartmann Date: Wed, 30 Sep 2009 17:13:21 +0200 Subject: Revert "Make the test fail, not crash for now. A task is already open to fix it." This reverts commit 21cfe5bf6550ae359d6bfa937b1308891954e9bb. The bug is fixed now. Reviewed-By: Alexis --- tests/auto/qdom/tst_qdom.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/auto/qdom/tst_qdom.cpp b/tests/auto/qdom/tst_qdom.cpp index 6987186..6637202 100644 --- a/tests/auto/qdom/tst_qdom.cpp +++ b/tests/auto/qdom/tst_qdom.cpp @@ -1908,8 +1908,7 @@ void tst_QDom::taskQTBUG4595_dontAssertWhenDocumentSpecifiesUnknownEncoding() co QDomDocument d; QVERIFY(d.setContent(xmlWithUnknownEncoding)); - //QString dontAssert = d.toString(); // this should not assert - QVERIFY2(false, "Line above crashes but we still want to run all tests."); + QString dontAssert = d.toString(); // this should not assert QVERIFY(true); } -- cgit v0.12 From 5e107b788caa416068c64349ed23f8d82cb26785 Mon Sep 17 00:00:00 2001 From: Thierry Bastian Date: Wed, 30 Sep 2009 17:47:01 +0200 Subject: Avoid warnings in the states example We now have the animations directly added to the transition --- examples/animation/states/main.cpp | 135 +++++++++++++++++-------------------- 1 file changed, 63 insertions(+), 72 deletions(-) diff --git a/examples/animation/states/main.cpp b/examples/animation/states/main.cpp index dafa8ad..85e28e1 100644 --- a/examples/animation/states/main.cpp +++ b/examples/animation/states/main.cpp @@ -194,83 +194,74 @@ int main(int argc, char *argv[]) state3->assignProperty(p5, "opacity", qreal(1)); state3->assignProperty(p6, "opacity", qreal(1)); - QParallelAnimationGroup animation1; - - QSequentialAnimationGroup *animation1SubGroup; - animation1SubGroup = new QSequentialAnimationGroup(&animation1); + QAbstractTransition *t1 = state1->addTransition(button, SIGNAL(clicked()), state2); + QSequentialAnimationGroup *animation1SubGroup = new QSequentialAnimationGroup; animation1SubGroup->addPause(250); animation1SubGroup->addAnimation(new QPropertyAnimation(box, "geometry")); + t1->addAnimation(animation1SubGroup); + t1->addAnimation(new QPropertyAnimation(widget, "geometry")); + t1->addAnimation(new QPropertyAnimation(p1, "geometry")); + t1->addAnimation(new QPropertyAnimation(p2, "geometry")); + t1->addAnimation(new QPropertyAnimation(p3, "geometry")); + t1->addAnimation(new QPropertyAnimation(p4, "geometry")); + t1->addAnimation(new QPropertyAnimation(p5, "geometry")); + t1->addAnimation(new QPropertyAnimation(p6, "geometry")); + t1->addAnimation(new QPropertyAnimation(p1, "rotation")); + t1->addAnimation(new QPropertyAnimation(p2, "rotation")); + t1->addAnimation(new QPropertyAnimation(p3, "rotation")); + t1->addAnimation(new QPropertyAnimation(p4, "rotation")); + t1->addAnimation(new QPropertyAnimation(p5, "rotation")); + t1->addAnimation(new QPropertyAnimation(p6, "rotation")); + t1->addAnimation(new QPropertyAnimation(p1, "opacity")); + t1->addAnimation(new QPropertyAnimation(p2, "opacity")); + t1->addAnimation(new QPropertyAnimation(p3, "opacity")); + t1->addAnimation(new QPropertyAnimation(p4, "opacity")); + t1->addAnimation(new QPropertyAnimation(p5, "opacity")); + t1->addAnimation(new QPropertyAnimation(p6, "opacity")); - animation1.addAnimation(new QPropertyAnimation(widget, "geometry")); - animation1.addAnimation(new QPropertyAnimation(p1, "geometry")); - animation1.addAnimation(new QPropertyAnimation(p2, "geometry")); - animation1.addAnimation(new QPropertyAnimation(p3, "geometry")); - animation1.addAnimation(new QPropertyAnimation(p4, "geometry")); - animation1.addAnimation(new QPropertyAnimation(p5, "geometry")); - animation1.addAnimation(new QPropertyAnimation(p6, "geometry")); - animation1.addAnimation(new QPropertyAnimation(p1, "rotation")); - animation1.addAnimation(new QPropertyAnimation(p2, "rotation")); - animation1.addAnimation(new QPropertyAnimation(p3, "rotation")); - animation1.addAnimation(new QPropertyAnimation(p4, "rotation")); - animation1.addAnimation(new QPropertyAnimation(p5, "rotation")); - animation1.addAnimation(new QPropertyAnimation(p6, "rotation")); - animation1.addAnimation(new QPropertyAnimation(p1, "opacity")); - animation1.addAnimation(new QPropertyAnimation(p2, "opacity")); - animation1.addAnimation(new QPropertyAnimation(p3, "opacity")); - animation1.addAnimation(new QPropertyAnimation(p4, "opacity")); - animation1.addAnimation(new QPropertyAnimation(p5, "opacity")); - animation1.addAnimation(new QPropertyAnimation(p6, "opacity")); - - QParallelAnimationGroup animation2; - animation2.addAnimation(new QPropertyAnimation(box, "geometry")); - animation2.addAnimation(new QPropertyAnimation(widget, "geometry")); - animation2.addAnimation(new QPropertyAnimation(p1, "geometry")); - animation2.addAnimation(new QPropertyAnimation(p2, "geometry")); - animation2.addAnimation(new QPropertyAnimation(p3, "geometry")); - animation2.addAnimation(new QPropertyAnimation(p4, "geometry")); - animation2.addAnimation(new QPropertyAnimation(p5, "geometry")); - animation2.addAnimation(new QPropertyAnimation(p6, "geometry")); - animation2.addAnimation(new QPropertyAnimation(p1, "rotation")); - animation2.addAnimation(new QPropertyAnimation(p2, "rotation")); - animation2.addAnimation(new QPropertyAnimation(p3, "rotation")); - animation2.addAnimation(new QPropertyAnimation(p4, "rotation")); - animation2.addAnimation(new QPropertyAnimation(p5, "rotation")); - animation2.addAnimation(new QPropertyAnimation(p6, "rotation")); - animation2.addAnimation(new QPropertyAnimation(p1, "opacity")); - animation2.addAnimation(new QPropertyAnimation(p2, "opacity")); - animation2.addAnimation(new QPropertyAnimation(p3, "opacity")); - animation2.addAnimation(new QPropertyAnimation(p4, "opacity")); - animation2.addAnimation(new QPropertyAnimation(p5, "opacity")); - animation2.addAnimation(new QPropertyAnimation(p6, "opacity")); - - QParallelAnimationGroup animation3; - animation3.addAnimation(new QPropertyAnimation(box, "geometry")); - animation3.addAnimation(new QPropertyAnimation(widget, "geometry")); - animation3.addAnimation(new QPropertyAnimation(p1, "geometry")); - animation3.addAnimation(new QPropertyAnimation(p2, "geometry")); - animation3.addAnimation(new QPropertyAnimation(p3, "geometry")); - animation3.addAnimation(new QPropertyAnimation(p4, "geometry")); - animation3.addAnimation(new QPropertyAnimation(p5, "geometry")); - animation3.addAnimation(new QPropertyAnimation(p6, "geometry")); - animation3.addAnimation(new QPropertyAnimation(p1, "rotation")); - animation3.addAnimation(new QPropertyAnimation(p2, "rotation")); - animation3.addAnimation(new QPropertyAnimation(p3, "rotation")); - animation3.addAnimation(new QPropertyAnimation(p4, "rotation")); - animation3.addAnimation(new QPropertyAnimation(p5, "rotation")); - animation3.addAnimation(new QPropertyAnimation(p6, "rotation")); - animation3.addAnimation(new QPropertyAnimation(p1, "opacity")); - animation3.addAnimation(new QPropertyAnimation(p2, "opacity")); - animation3.addAnimation(new QPropertyAnimation(p3, "opacity")); - animation3.addAnimation(new QPropertyAnimation(p4, "opacity")); - animation3.addAnimation(new QPropertyAnimation(p5, "opacity")); - animation3.addAnimation(new QPropertyAnimation(p6, "opacity")); - - QAbstractTransition *t1 = state1->addTransition(button, SIGNAL(clicked()), state2); - t1->addAnimation(&animation1); QAbstractTransition *t2 = state2->addTransition(button, SIGNAL(clicked()), state3); - t2->addAnimation(&animation2); + t2->addAnimation(new QPropertyAnimation(box, "geometry")); + t2->addAnimation(new QPropertyAnimation(widget, "geometry")); + t2->addAnimation(new QPropertyAnimation(p1, "geometry")); + t2->addAnimation(new QPropertyAnimation(p2, "geometry")); + t2->addAnimation(new QPropertyAnimation(p3, "geometry")); + t2->addAnimation(new QPropertyAnimation(p4, "geometry")); + t2->addAnimation(new QPropertyAnimation(p5, "geometry")); + t2->addAnimation(new QPropertyAnimation(p6, "geometry")); + t2->addAnimation(new QPropertyAnimation(p1, "rotation")); + t2->addAnimation(new QPropertyAnimation(p2, "rotation")); + t2->addAnimation(new QPropertyAnimation(p3, "rotation")); + t2->addAnimation(new QPropertyAnimation(p4, "rotation")); + t2->addAnimation(new QPropertyAnimation(p5, "rotation")); + t2->addAnimation(new QPropertyAnimation(p6, "rotation")); + t2->addAnimation(new QPropertyAnimation(p1, "opacity")); + t2->addAnimation(new QPropertyAnimation(p2, "opacity")); + t2->addAnimation(new QPropertyAnimation(p3, "opacity")); + t2->addAnimation(new QPropertyAnimation(p4, "opacity")); + t2->addAnimation(new QPropertyAnimation(p5, "opacity")); + t2->addAnimation(new QPropertyAnimation(p6, "opacity")); + QAbstractTransition *t3 = state3->addTransition(button, SIGNAL(clicked()), state1); - t3->addAnimation(&animation3); + t3->addAnimation(new QPropertyAnimation(box, "geometry")); + t3->addAnimation(new QPropertyAnimation(widget, "geometry")); + t3->addAnimation(new QPropertyAnimation(p1, "geometry")); + t3->addAnimation(new QPropertyAnimation(p2, "geometry")); + t3->addAnimation(new QPropertyAnimation(p3, "geometry")); + t3->addAnimation(new QPropertyAnimation(p4, "geometry")); + t3->addAnimation(new QPropertyAnimation(p5, "geometry")); + t3->addAnimation(new QPropertyAnimation(p6, "geometry")); + t3->addAnimation(new QPropertyAnimation(p1, "rotation")); + t3->addAnimation(new QPropertyAnimation(p2, "rotation")); + t3->addAnimation(new QPropertyAnimation(p3, "rotation")); + t3->addAnimation(new QPropertyAnimation(p4, "rotation")); + t3->addAnimation(new QPropertyAnimation(p5, "rotation")); + t3->addAnimation(new QPropertyAnimation(p6, "rotation")); + t3->addAnimation(new QPropertyAnimation(p1, "opacity")); + t3->addAnimation(new QPropertyAnimation(p2, "opacity")); + t3->addAnimation(new QPropertyAnimation(p3, "opacity")); + t3->addAnimation(new QPropertyAnimation(p4, "opacity")); + t3->addAnimation(new QPropertyAnimation(p5, "opacity")); + t3->addAnimation(new QPropertyAnimation(p6, "opacity")); machine.start(); -- cgit v0.12 From 1827669c08580ec309ac6e13c6684e6dbcf18ec4 Mon Sep 17 00:00:00 2001 From: Thierry Bastian Date: Wed, 30 Sep 2009 18:02:37 +0200 Subject: Simplify code of states example We're not using QGraphicsWidget any more --- examples/animation/states/main.cpp | 82 +++++++++++++++++++------------------- 1 file changed, 40 insertions(+), 42 deletions(-) diff --git a/examples/animation/states/main.cpp b/examples/animation/states/main.cpp index 85e28e1..f9d654a 100644 --- a/examples/animation/states/main.cpp +++ b/examples/animation/states/main.cpp @@ -41,13 +41,12 @@ #include -class Pixmap : public QGraphicsWidget +class Pixmap : public QGraphicsObject { Q_OBJECT public: - Pixmap(const QPixmap &pix) : QGraphicsWidget(), p(pix) + Pixmap(const QPixmap &pix) : QGraphicsObject(), p(pix) { - setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); } void paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *) @@ -55,10 +54,9 @@ public: painter->drawPixmap(QPointF(), p); } -protected: - QSizeF sizeHint(Qt::SizeHint, const QSizeF & = QSizeF()) + QRectF boundingRect() const { - return QSizeF(p.width(), p.height()); + return QRectF( QPointF(0, 0), p.size()); } private: @@ -133,12 +131,12 @@ int main(int argc, char *argv[]) state1->assignProperty(button, "text", "Switch to state 2"); state1->assignProperty(widget, "geometry", QRectF(0, 0, 400, 150)); state1->assignProperty(box, "geometry", QRect(-200, 150, 200, 150)); - state1->assignProperty(p1, "geometry", QRectF(68, 185, 64, 64)); - state1->assignProperty(p2, "geometry", QRectF(168, 185, 64, 64)); - state1->assignProperty(p3, "geometry", QRectF(268, 185, 64, 64)); - state1->assignProperty(p4, "geometry", QRectF(68-150, 48-150, 64, 64)); - state1->assignProperty(p5, "geometry", QRectF(168, 48-150, 64, 64)); - state1->assignProperty(p6, "geometry", QRectF(268+150, 48-150, 64, 64)); + state1->assignProperty(p1, "pos", QPointF(68, 185)); + state1->assignProperty(p2, "pos", QPointF(168, 185)); + state1->assignProperty(p3, "pos", QPointF(268, 185)); + state1->assignProperty(p4, "pos", QPointF(68-150, 48-150)); + state1->assignProperty(p5, "pos", QPointF(168, 48-150)); + state1->assignProperty(p6, "pos", QPointF(268+150, 48-150)); state1->assignProperty(p1, "rotation", qreal(0)); state1->assignProperty(p2, "rotation", qreal(0)); state1->assignProperty(p3, "rotation", qreal(0)); @@ -157,12 +155,12 @@ int main(int argc, char *argv[]) state2->assignProperty(button, "text", "Switch to state 3"); state2->assignProperty(widget, "geometry", QRectF(200, 150, 200, 150)); state2->assignProperty(box, "geometry", QRect(9, 150, 190, 150)); - state2->assignProperty(p1, "geometry", QRectF(68-150, 185+150, 64, 64)); - state2->assignProperty(p2, "geometry", QRectF(168, 185+150, 64, 64)); - state2->assignProperty(p3, "geometry", QRectF(268+150, 185+150, 64, 64)); - state2->assignProperty(p4, "geometry", QRectF(64, 48, 64, 64)); - state2->assignProperty(p5, "geometry", QRectF(168, 48, 64, 64)); - state2->assignProperty(p6, "geometry", QRectF(268, 48, 64, 64)); + state2->assignProperty(p1, "pos", QPointF(68-150, 185+150)); + state2->assignProperty(p2, "pos", QPointF(168, 185+150)); + state2->assignProperty(p3, "pos", QPointF(268+150, 185+150)); + state2->assignProperty(p4, "pos", QPointF(64, 48)); + state2->assignProperty(p5, "pos", QPointF(168, 48)); + state2->assignProperty(p6, "pos", QPointF(268, 48)); state2->assignProperty(p1, "rotation", qreal(-270)); state2->assignProperty(p2, "rotation", qreal(90)); state2->assignProperty(p3, "rotation", qreal(270)); @@ -179,12 +177,12 @@ int main(int argc, char *argv[]) // State 3 state3->assignProperty(button, "text", "Switch to state 1"); - state3->assignProperty(p1, "geometry", QRectF(0, 5, 64, 64)); - state3->assignProperty(p2, "geometry", QRectF(0, 5 + 64 + 5, 64, 64)); - state3->assignProperty(p3, "geometry", QRectF(5, 5 + (64 + 5) + 64, 64, 64)); - state3->assignProperty(p4, "geometry", QRectF(5 + 64 + 5, 5, 64, 64)); - state3->assignProperty(p5, "geometry", QRectF(5 + 64 + 5, 5 + 64 + 5, 64, 64)); - state3->assignProperty(p6, "geometry", QRectF(5 + 64 + 5, 5 + (64 + 5) + 64, 64, 64)); + state3->assignProperty(p1, "pos", QPointF(0, 5)); + state3->assignProperty(p2, "pos", QPointF(0, 5 + 64 + 5)); + state3->assignProperty(p3, "pos", QPointF(5, 5 + (64 + 5) + 64)); + state3->assignProperty(p4, "pos", QPointF(5 + 64 + 5, 5)); + state3->assignProperty(p5, "pos", QPointF(5 + 64 + 5, 5 + 64 + 5)); + state3->assignProperty(p6, "pos", QPointF(5 + 64 + 5, 5 + (64 + 5) + 64)); state3->assignProperty(widget, "geometry", QRectF(138, 5, 400 - 138, 200)); state3->assignProperty(box, "geometry", QRect(5, 205, 400, 90)); state3->assignProperty(p1, "opacity", qreal(1)); @@ -200,12 +198,12 @@ int main(int argc, char *argv[]) animation1SubGroup->addAnimation(new QPropertyAnimation(box, "geometry")); t1->addAnimation(animation1SubGroup); t1->addAnimation(new QPropertyAnimation(widget, "geometry")); - t1->addAnimation(new QPropertyAnimation(p1, "geometry")); - t1->addAnimation(new QPropertyAnimation(p2, "geometry")); - t1->addAnimation(new QPropertyAnimation(p3, "geometry")); - t1->addAnimation(new QPropertyAnimation(p4, "geometry")); - t1->addAnimation(new QPropertyAnimation(p5, "geometry")); - t1->addAnimation(new QPropertyAnimation(p6, "geometry")); + t1->addAnimation(new QPropertyAnimation(p1, "pos")); + t1->addAnimation(new QPropertyAnimation(p2, "pos")); + t1->addAnimation(new QPropertyAnimation(p3, "pos")); + t1->addAnimation(new QPropertyAnimation(p4, "pos")); + t1->addAnimation(new QPropertyAnimation(p5, "pos")); + t1->addAnimation(new QPropertyAnimation(p6, "pos")); t1->addAnimation(new QPropertyAnimation(p1, "rotation")); t1->addAnimation(new QPropertyAnimation(p2, "rotation")); t1->addAnimation(new QPropertyAnimation(p3, "rotation")); @@ -222,12 +220,12 @@ int main(int argc, char *argv[]) QAbstractTransition *t2 = state2->addTransition(button, SIGNAL(clicked()), state3); t2->addAnimation(new QPropertyAnimation(box, "geometry")); t2->addAnimation(new QPropertyAnimation(widget, "geometry")); - t2->addAnimation(new QPropertyAnimation(p1, "geometry")); - t2->addAnimation(new QPropertyAnimation(p2, "geometry")); - t2->addAnimation(new QPropertyAnimation(p3, "geometry")); - t2->addAnimation(new QPropertyAnimation(p4, "geometry")); - t2->addAnimation(new QPropertyAnimation(p5, "geometry")); - t2->addAnimation(new QPropertyAnimation(p6, "geometry")); + t2->addAnimation(new QPropertyAnimation(p1, "pos")); + t2->addAnimation(new QPropertyAnimation(p2, "pos")); + t2->addAnimation(new QPropertyAnimation(p3, "pos")); + t2->addAnimation(new QPropertyAnimation(p4, "pos")); + t2->addAnimation(new QPropertyAnimation(p5, "pos")); + t2->addAnimation(new QPropertyAnimation(p6, "pos")); t2->addAnimation(new QPropertyAnimation(p1, "rotation")); t2->addAnimation(new QPropertyAnimation(p2, "rotation")); t2->addAnimation(new QPropertyAnimation(p3, "rotation")); @@ -244,12 +242,12 @@ int main(int argc, char *argv[]) QAbstractTransition *t3 = state3->addTransition(button, SIGNAL(clicked()), state1); t3->addAnimation(new QPropertyAnimation(box, "geometry")); t3->addAnimation(new QPropertyAnimation(widget, "geometry")); - t3->addAnimation(new QPropertyAnimation(p1, "geometry")); - t3->addAnimation(new QPropertyAnimation(p2, "geometry")); - t3->addAnimation(new QPropertyAnimation(p3, "geometry")); - t3->addAnimation(new QPropertyAnimation(p4, "geometry")); - t3->addAnimation(new QPropertyAnimation(p5, "geometry")); - t3->addAnimation(new QPropertyAnimation(p6, "geometry")); + t3->addAnimation(new QPropertyAnimation(p1, "pos")); + t3->addAnimation(new QPropertyAnimation(p2, "pos")); + t3->addAnimation(new QPropertyAnimation(p3, "pos")); + t3->addAnimation(new QPropertyAnimation(p4, "pos")); + t3->addAnimation(new QPropertyAnimation(p5, "pos")); + t3->addAnimation(new QPropertyAnimation(p6, "pos")); t3->addAnimation(new QPropertyAnimation(p1, "rotation")); t3->addAnimation(new QPropertyAnimation(p2, "rotation")); t3->addAnimation(new QPropertyAnimation(p3, "rotation")); -- cgit v0.12 From e8fc662c4b5a0fa5da6f0d47e1dbb5b2640d7001 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Wed, 30 Sep 2009 19:38:46 +0200 Subject: Stabilize tests on X11 --- tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp | 2 +- tests/auto/qtreeview/tst_qtreeview.cpp | 4 +- tests/auto/qwidget/tst_qwidget.cpp | 44 +++++++++++----------- tests/auto/qwindowsurface/tst_qwindowsurface.cpp | 32 ++++++++++------ 4 files changed, 45 insertions(+), 37 deletions(-) diff --git a/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp b/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp index b6750ea..0b73733 100644 --- a/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp +++ b/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp @@ -1456,7 +1456,7 @@ void tst_QGraphicsWidget::verifyFocusChain() scene.addItem(w1_4); QTRY_VERIFY(w1_3->hasFocus()); QTest::qWait(25); - QVERIFY(compareFocusChain(view, QList() << w1_3 << w1_4)); + QTRY_VERIFY(compareFocusChain(view, QList() << w1_3 << w1_4)); QTest::keyPress(QApplication::focusWidget(), Qt::Key_Backtab); QTest::qWait(25); QTRY_VERIFY(lineEdit->hasFocus()); diff --git a/tests/auto/qtreeview/tst_qtreeview.cpp b/tests/auto/qtreeview/tst_qtreeview.cpp index 112bcc8..91b2cc5 100644 --- a/tests/auto/qtreeview/tst_qtreeview.cpp +++ b/tests/auto/qtreeview/tst_qtreeview.cpp @@ -3113,7 +3113,7 @@ void tst_QTreeView::task224091_appendColumns() treeView->show(); treeView->resize(50,50); - QTest::qWait(50); + QTest::qWaitForWindowShown(treeView); qApp->processEvents(); QList projlist; @@ -3125,7 +3125,7 @@ void tst_QTreeView::task224091_appendColumns() QTest::qWait(50); qApp->processEvents(); - QVERIFY(treeView->verticalScrollBar()->isVisible()); + QTRY_VERIFY(treeView->verticalScrollBar()->isVisible()); delete treeView; delete model; diff --git a/tests/auto/qwidget/tst_qwidget.cpp b/tests/auto/qwidget/tst_qwidget.cpp index 019887d..c08d601 100644 --- a/tests/auto/qwidget/tst_qwidget.cpp +++ b/tests/auto/qwidget/tst_qwidget.cpp @@ -3127,7 +3127,7 @@ void tst_QWidget::saveRestoreGeometry() geom = widget.geometry(); widget.setWindowState(widget.windowState() | Qt::WindowFullScreen); QTRY_VERIFY((widget.windowState() & Qt::WindowFullScreen)); - QTest::qWait(200); + QTest::qWait(500); QVERIFY(widget.restoreGeometry(savedGeometry)); QTest::qWait(120); QTRY_VERIFY(!(widget.windowState() & Qt::WindowFullScreen)); @@ -3137,55 +3137,55 @@ void tst_QWidget::saveRestoreGeometry() widget.setWindowState(widget.windowState() | Qt::WindowFullScreen); QTest::qWait(120); QTRY_VERIFY((widget.windowState() & Qt::WindowFullScreen)); - QTest::qWait(200); + QTest::qWait(400); savedGeometry = widget.saveGeometry(); geom = widget.geometry(); widget.setWindowState(widget.windowState() ^ Qt::WindowFullScreen); - QTest::qWait(20); + QTest::qWait(120); QTRY_VERIFY(!(widget.windowState() & Qt::WindowFullScreen)); - QTest::qWait(200); + QTest::qWait(400); QVERIFY(widget.restoreGeometry(savedGeometry)); - QTest::qWait(20); + QTest::qWait(120); QTRY_VERIFY((widget.windowState() & Qt::WindowFullScreen)); QTRY_COMPARE(widget.geometry(), geom); QVERIFY((widget.windowState() & Qt::WindowFullScreen)); widget.setWindowState(widget.windowState() ^ Qt::WindowFullScreen); - QTest::qWait(20); + QTest::qWait(120); QTRY_VERIFY(!(widget.windowState() & Qt::WindowFullScreen)); - QTest::qWait(20); + QTest::qWait(120); //Restore from Maximised widget.move(position); widget.resize(size); - QTest::qWait(20); + QTest::qWait(10); QTRY_COMPARE(widget.size(), size); - QTest::qWait(200); + QTest::qWait(400); savedGeometry = widget.saveGeometry(); geom = widget.geometry(); widget.setWindowState(widget.windowState() | Qt::WindowMaximized); - QTest::qWait(20); + QTest::qWait(120); QTRY_VERIFY((widget.windowState() & Qt::WindowMaximized)); QTRY_VERIFY(widget.geometry() != geom); - QTest::qWait(200); + QTest::qWait(400); QVERIFY(widget.restoreGeometry(savedGeometry)); - QTest::qWait(20); + QTest::qWait(120); QTRY_COMPARE(widget.geometry(), geom); QVERIFY(!(widget.windowState() & Qt::WindowMaximized)); //Restore to maximised widget.setWindowState(widget.windowState() | Qt::WindowMaximized); - QTest::qWait(20); + QTest::qWait(120); QTRY_VERIFY((widget.windowState() & Qt::WindowMaximized)); - QTest::qWait(200); + QTest::qWait(400); geom = widget.geometry(); savedGeometry = widget.saveGeometry(); widget.setWindowState(widget.windowState() ^ Qt::WindowMaximized); - QTest::qWait(20); + QTest::qWait(120); QTRY_VERIFY(!(widget.windowState() & Qt::WindowMaximized)); - QTest::qWait(200); + QTest::qWait(400); QVERIFY(widget.restoreGeometry(savedGeometry)); - QTest::qWait(20); + QTest::qWait(120); QTRY_VERIFY((widget.windowState() & Qt::WindowMaximized)); QTRY_COMPARE(widget.geometry(), geom); } @@ -8683,7 +8683,7 @@ void tst_QWidget::setClearAndResizeMask() QTRY_COMPARE(child.numPaintEvents, 1); #else // and ensure that we don't get any updates at all. - QCOMPARE(child.numPaintEvents, 0); + QTRY_COMPARE(child.numPaintEvents, 0); #endif QCOMPARE(topLevel.numPaintEvents, 0); @@ -8720,9 +8720,9 @@ void tst_QWidget::setClearAndResizeMask() QTest::qWait(200); #ifdef Q_WS_MAC // Mac always issues a full update when calling setMask, and we cannot force it to not do so. - QCOMPARE(resizeChild.paintedRegion, resizeChild.mask()); + QTRY_COMPARE(resizeChild.paintedRegion, resizeChild.mask()); #else - QCOMPARE(resizeChild.paintedRegion, QRegion()); + QTRY_COMPARE(resizeChild.paintedRegion, QRegion()); #endif resizeChild.paintedRegion = QRegion(); @@ -8731,9 +8731,9 @@ void tst_QWidget::setClearAndResizeMask() QTest::qWait(100); #ifdef Q_WS_MAC // Mac always issues a full update when calling setMask, and we cannot force it to not do so. - QCOMPARE(resizeChild.paintedRegion, resizeChild.mask()); + QTRY_COMPARE(resizeChild.paintedRegion, resizeChild.mask()); #else - QCOMPARE(resizeChild.paintedRegion, resizeChild.mask() - oldMask); + QTRY_COMPARE(resizeChild.paintedRegion, resizeChild.mask() - oldMask); #endif } diff --git a/tests/auto/qwindowsurface/tst_qwindowsurface.cpp b/tests/auto/qwindowsurface/tst_qwindowsurface.cpp index e96bcf9..2490a65 100644 --- a/tests/auto/qwindowsurface/tst_qwindowsurface.cpp +++ b/tests/auto/qwindowsurface/tst_qwindowsurface.cpp @@ -106,18 +106,26 @@ public: QRegion r; }; -#define VERIFY_COLOR(region, color) { \ - const QRegion r = QRegion(region); \ - for (int i = 0; i < r.rects().size(); ++i) { \ - const QRect rect = r.rects().at(i); \ - const QPixmap pixmap = QPixmap::grabWindow(QDesktopWidget().winId(), \ - rect.left(), rect.top(), \ - rect.width(), rect.height()); \ - QCOMPARE(pixmap.size(), rect.size()); \ - QPixmap expectedPixmap(pixmap); /* ensure equal formats */ \ - expectedPixmap.fill(color); \ - QCOMPARE(pixmap, expectedPixmap); \ - } \ +//from tst_qwidget.cpp +static void VERIFY_COLOR(const QRegion ®ion, const QColor &color) +{ + const QRegion r = QRegion(region); + for (int i = 0; i < r.rects().size(); ++i) { + const QRect rect = r.rects().at(i); + for (int t = 0; t < 5; t++) { + const QPixmap pixmap = QPixmap::grabWindow(QDesktopWidget().winId(), + rect.left(), rect.top(), + rect.width(), rect.height()); + QCOMPARE(pixmap.size(), rect.size()); + QPixmap expectedPixmap(pixmap); /* ensure equal formats */ + expectedPixmap.fill(color); + if (pixmap.toImage().pixel(0,0) != QColor(color).rgb() && t < 4 ) + { QTest::qWait(200); continue; } + QCOMPARE(pixmap.toImage().pixel(0,0), QColor(color).rgb()); + QCOMPARE(pixmap, expectedPixmap); + break; + } + } } void tst_QWindowSurface::getSetWindowSurface() -- cgit v0.12 From a73213cf5acdaabcd61245a6882e608b2337da3c Mon Sep 17 00:00:00 2001 From: Anders Bakken Date: Wed, 30 Sep 2009 11:07:55 -0700 Subject: Clean up releaseSurface in QDirectFBPaintDevice Instead of having to call unlockSurface/releaseSubSurface and releaseSurface to release the surface in QDirectFBWindowSurface make releaseSurface do all three things. Reviewed-by: Donald Carr --- src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.cpp | 1 + src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp | 11 ++++------- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.cpp index 46cf65b..cb4fb88 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.cpp @@ -209,6 +209,7 @@ void QDirectFBPaintDevice::releaseSubSurface() { Q_ASSERT(QDirectFBScreen::instance()); if (subSurface) { + unlockSurface(); screen->releaseDFBSurface(subSurface); subSurface = 0; } diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp index 19103cb..51afcc7 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp @@ -200,10 +200,6 @@ void QDirectFBWindowSurface::setGeometry(const QRect &rect) if (sizeChanged) { delete engine; engine = 0; - unlockSurface(); -#ifdef QT_DIRECTFB_SUBSURFACE - releaseSubSurface(); -#endif releaseSurface(); Q_ASSERT(!dfbSurface); } @@ -430,9 +426,10 @@ void QDirectFBWindowSurface::updateFormat() void QDirectFBWindowSurface::releaseSurface() { if (dfbSurface) { -#ifdef QT_NO_DIRECTFB_SUBSURFACE - if (lockFlgs) - unlockSurface(); +#ifdef QT_DIRECTFB_SUBSURFACE + releaseSubSurface(); +#else + unlockSurface(); #endif #ifdef QT_NO_DIRECTFB_WM Q_ASSERT(screen->primarySurface()); -- cgit v0.12 From ab4bd7df83519fee126c4dfba0ed923ecc0a0963 Mon Sep 17 00:00:00 2001 From: Anders Bakken Date: Wed, 30 Sep 2009 15:02:35 -0700 Subject: Make sure gccaps is properly initialized for dfbpe Reviewed-by: Noam Rosenthal --- src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp index a9ae72c..dd6b0d3 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp @@ -284,7 +284,9 @@ bool QDirectFBPaintEngine::begin(QPaintDevice *device) } d->prepare(d->dfbDevice); + gccaps = AllFeatures; d->setCompositionMode(state()->composition_mode); + return QRasterPaintEngine::begin(device); } -- cgit v0.12 From 533f71abae2ecf05a217e63e9695647eb9e9a3ca Mon Sep 17 00:00:00 2001 From: Anders Bakken Date: Wed, 30 Sep 2009 11:00:39 -0700 Subject: Fix a window opacity bug with DirectFB Initialize IDirectFBWindows with the correct capabilities/options when supporting top level transparency. Also, properly deal with runtime changes of top level transparency. Reviewed-by: Noam Rosenthal --- .../gfxdrivers/directfb/qdirectfbwindowsurface.cpp | 110 +++++++++++---------- .../gfxdrivers/directfb/qdirectfbwindowsurface.h | 2 + 2 files changed, 60 insertions(+), 52 deletions(-) diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp index 51afcc7..f33e820 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp @@ -81,18 +81,23 @@ QDirectFBWindowSurface::QDirectFBWindowSurface(DFBSurfaceFlipFlags flip, QDirect , flipFlags(flip) , boundingRectFlip(scr->directFBFlags() & QDirectFBScreen::BoundingRectFlip) { + SurfaceFlags flags = 0; + if (!widget || widget->window()->windowOpacity() == 0xff) + flags |= Opaque; #ifdef QT_NO_DIRECTFB_WM if (widget && widget->testAttribute(Qt::WA_PaintOnScreen)) { - setSurfaceFlags(Opaque | RegionReserved); + flags = RegionReserved; mode = Primary; } else { mode = Offscreen; - setSurfaceFlags(Opaque | Buffered); + flags = Buffered; } #else - setSurfaceFlags(Opaque | Buffered); + noSystemBackground = widget && widget->testAttribute(Qt::WA_NoSystemBackground); + if (noSystemBackground) + flags &= ~Opaque; #endif - + setSurfaceFlags(flags); #ifdef QT_DIRECTFB_TIMING frames = 0; timer.start(); @@ -135,6 +140,16 @@ void QDirectFBWindowSurface::createWindow(const QRect &rect) description.caps = DWCAPS_NODECORATION|DWCAPS_DOUBLEBUFFER; description.flags = DWDESC_CAPS|DWDESC_SURFACE_CAPS|DWDESC_PIXELFORMAT|DWDESC_HEIGHT|DWDESC_WIDTH|DWDESC_POSX|DWDESC_POSY; +#if (Q_DIRECTFB_VERSION >= 0x010200) + description.flags |= DWDESC_OPTIONS; +#endif + + if (noSystemBackground) { + description.caps |= DWCAPS_ALPHACHANNEL; +#if (Q_DIRECTFB_VERSION >= 0x010200) + description.options |= DWOP_ALPHACHANNEL; +#endif + } description.posx = rect.x(); description.posy = rect.y(); @@ -143,7 +158,7 @@ void QDirectFBWindowSurface::createWindow(const QRect &rect) description.surface_caps = DSCAPS_NONE; if (screen->directFBFlags() & QDirectFBScreen::VideoOnly) description.surface_caps |= DSCAPS_VIDEOONLY; - const QImage::Format format = screen->pixelFormat(); + const QImage::Format format = (noSystemBackground ? screen->alphaPixmapFormat() : screen->pixelFormat()); description.pixelformat = QDirectFBScreen::getSurfacePixelFormat(format); if (QDirectFBScreen::isPremultiplied(format)) description.surface_caps = DSCAPS_PREMULTIPLIED; @@ -153,9 +168,7 @@ void QDirectFBWindowSurface::createWindow(const QRect &rect) if (result != DFB_OK) DirectFBErrorFatal("QDirectFBWindowSurface::createWindow", result); - if (dfbSurface) - dfbSurface->Release(dfbSurface); - + Q_ASSERT(!dfbSurface); dfbWindow->GetSurface(dfbWindow, &dfbSurface); updateFormat(); } @@ -297,29 +310,20 @@ bool QDirectFBWindowSurface::move(const QPoint &moveBy) return true; } -// hw: XXX: copied from QWidgetPrivate::isOpaque() -inline bool isWidgetOpaque(const QWidget *w) +void QDirectFBWindowSurface::setOpaque(bool opaque) { - if (w->testAttribute(Qt::WA_OpaquePaintEvent) - || w->testAttribute(Qt::WA_PaintOnScreen)) - return true; - - const QPalette &pal = w->palette(); - - if (w->autoFillBackground()) { - const QBrush &autoFillBrush = pal.brush(w->backgroundRole()); - if (autoFillBrush.style() != Qt::NoBrush && autoFillBrush.isOpaque()) - return true; + SurfaceFlags flags = surfaceFlags(); + if (opaque != (flags & Opaque)) { + if (opaque) { + flags |= Opaque; + } else { + flags &= ~Opaque; + } + setSurfaceFlags(flags); } +} - if (!w->testAttribute(Qt::WA_NoSystemBackground)) { - const QBrush &windowBrush = w->palette().brush(QPalette::Window); - if (windowBrush.style() != Qt::NoBrush && windowBrush.isOpaque()) - return true; - } - return false; -} void QDirectFBWindowSurface::flush(QWidget *widget, const QRegion ®ion, const QPoint &offset) { @@ -331,37 +335,39 @@ void QDirectFBWindowSurface::flush(QWidget *widget, const QRegion ®ion, if (extra && extra->proxyWidget) return; - // hw: make sure opacity information is updated before compositing - const bool opaque = isWidgetOpaque(win); - if (opaque != isOpaque()) { - SurfaceFlags flags = surfaceFlags(); - if (opaque) { - flags |= Opaque; - } else { - flags &= ~Opaque; - } - setSurfaceFlags(flags); + const quint8 windowOpacity = quint8(win->windowOpacity() * 0xff); + const QRect windowGeometry = geometry(); +#ifdef QT_DIRECTFB_WM + const bool wasNoSystemBackground = noSystemBackground; + noSystemBackground = win->testAttribute(Qt::WA_NoSystemBackground); + quint8 currentOpacity; + Q_ASSERT(dfbWindow); + dfbWindow->GetOpacity(dfbWindow, ¤tOpacity); + if (currentOpacity != windowOpacity) { + dfbWindow->SetOpacity(dfbWindow, windowOpacity); } -#ifndef QT_NO_DIRECTFB_WM - const quint8 winOpacity = quint8(win->windowOpacity() * 255); - quint8 opacity; - - if (dfbWindow) { - dfbWindow->GetOpacity(dfbWindow, &opacity); - if (winOpacity != opacity) - dfbWindow->SetOpacity(dfbWindow, winOpacity); + setOpaque(noSystemBackground || windowOpacity != 0xff); + if (wasNoSystemBackground != noSystemBackground) { + releaseSurface(); + dfbWindow->Release(dfbWindow); + dfbWindow = 0; + createWindow(windowGeometry); + win->update(); + return; } -#endif - - const QRect windowGeometry = QDirectFBWindowSurface::geometry(); -#ifdef QT_NO_DIRECTFB_WM + screen->flipSurface(dfbSurface, flipFlags, region, offset); + if (noSystemBackground) { + dfbSurface->Clear(dfbSurface, 0, 0, 0, 0); + } +#else + setOpaque(windowOpacity != 0xff); if (mode == Offscreen) { screen->exposeRegion(region.translated(offset + geometry().topLeft()), 0); - - } else -#endif + } else { screen->flipSurface(dfbSurface, flipFlags, region, offset); + } +#endif #ifdef QT_DIRECTFB_TIMING enum { Secs = 3 }; diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.h b/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.h index 0dd3a3b..2f78179 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.h +++ b/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.h @@ -97,6 +97,7 @@ public: IDirectFBWindow *directFBWindow() const; #endif private: + void setOpaque(bool opaque); void updateFormat(); void releaseSurface(); QDirectFBWindowSurface *sibling; @@ -112,6 +113,7 @@ private: #endif DFBSurfaceFlipFlags flipFlags; + bool noSystemBackground; bool boundingRectFlip; #ifdef QT_DIRECTFB_TIMING int frames; -- cgit v0.12 From 69e8fd3359a72230d377513b0314e64b5b83b712 Mon Sep 17 00:00:00 2001 From: Rhys Weatherley Date: Thu, 1 Oct 2009 13:02:49 +1000 Subject: Make QGLFramebufferObject crash-proof if QGLContext destroyed first Sometimes it isn't possible to arrange for the QGLFramebufferObject to be destroyed before the QGLContext group in which it was created. Especially during application shutdown or in applications with multiple shared contexts. This change modifies QGLFramebufferObject to use QGLSharedResourceGuard, which ensures that when the last QGLContext in a sharing group is destroyed, any remaining FBO's will revert to !isValid(). It is now safe to destroy the context before the FBO, or the FBO before the context. Unit test included. Reviewed-by: Sarah Smith --- src/opengl/qglframebufferobject.cpp | 58 ++++++++++++++++++++++--------------- src/opengl/qglframebufferobject_p.h | 7 +++-- tests/auto/qgl/tst_qgl.cpp | 28 ++++++++++++++++++ 3 files changed, 67 insertions(+), 26 deletions(-) diff --git a/src/opengl/qglframebufferobject.cpp b/src/opengl/qglframebufferobject.cpp index c728902..3e54b35 100644 --- a/src/opengl/qglframebufferobject.cpp +++ b/src/opengl/qglframebufferobject.cpp @@ -64,7 +64,8 @@ QT_BEGIN_NAMESPACE extern QImage qt_gl_read_framebuffer(const QSize&, bool, bool); -#define QGL_FUNC_CONTEXT QGLContextGroup *ctx = d_ptr->ctx; +#define QGL_FUNC_CONTEXT const QGLContext *ctx = d_ptr->fbo_guard.context(); +#define QGL_FUNCP_CONTEXT const QGLContext *ctx = fbo_guard.context(); #ifndef QT_NO_DEBUG #define QT_RESET_GLERROR() \ @@ -317,7 +318,7 @@ void QGLFBOGLPaintDevice::setFBO(QGLFramebufferObject* f, QGLFramebufferObject::Attachment attachment) { fbo = f; - m_thisFBO = fbo->d_func()->fbo; // This shouldn't be needed + m_thisFBO = fbo->d_func()->fbo(); // This shouldn't be needed // The context that the fbo was created in may not have depth // and stencil buffers, but the fbo itself might. @@ -334,7 +335,7 @@ void QGLFBOGLPaintDevice::ensureActiveTarget() { QGLContext* ctx = const_cast(QGLContext::currentContext()); Q_ASSERT(ctx); - const GLuint fboId = fbo->d_func()->fbo; + const GLuint fboId = fbo->d_func()->fbo(); if (ctx->d_func()->current_fbo != fboId) { ctx->d_func()->current_fbo = fboId; glBindFramebuffer(GL_FRAMEBUFFER_EXT, fboId); @@ -359,6 +360,9 @@ void QGLFBOGLPaintDevice::endPaint() bool QGLFramebufferObjectPrivate::checkFramebufferStatus() const { + QGL_FUNCP_CONTEXT; + if (!ctx) + return false; // Context no longer exists. GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER_EXT); switch(status) { case GL_NO_ERROR: @@ -405,11 +409,11 @@ void QGLFramebufferObjectPrivate::init(QGLFramebufferObject *q, const QSize &sz, QGLFramebufferObject::Attachment attachment, GLenum texture_target, GLenum internal_format, GLint samples) { - QGLContext *currentContext = const_cast(QGLContext::currentContext()); - ctx = QGLContextPrivate::contextGroup(currentContext); + QGLContext *ctx = const_cast(QGLContext::currentContext()); + fbo_guard.setContext(ctx); bool ext_detected = (QGLExtensions::glExtensions & QGLExtensions::FramebufferObject); - if (!ext_detected || (ext_detected && !qt_resolve_framebufferobject_extensions(currentContext))) + if (!ext_detected || (ext_detected && !qt_resolve_framebufferobject_extensions(ctx))) return; size = sz; @@ -417,8 +421,10 @@ void QGLFramebufferObjectPrivate::init(QGLFramebufferObject *q, const QSize &sz, // texture dimensions QT_RESET_GLERROR(); // reset error state + GLuint fbo = 0; glGenFramebuffers(1, &fbo); glBindFramebuffer(GL_FRAMEBUFFER_EXT, fbo); + fbo_guard.setId(fbo); glDevice.setFBO(q, attachment); @@ -535,13 +541,14 @@ void QGLFramebufferObjectPrivate::init(QGLFramebufferObject *q, const QSize &sz, fbo_attachment = QGLFramebufferObject::NoAttachment; } - glBindFramebuffer(GL_FRAMEBUFFER_EXT, currentContext->d_ptr->current_fbo); + glBindFramebuffer(GL_FRAMEBUFFER_EXT, ctx->d_ptr->current_fbo); if (!valid) { if (color_buffer) glDeleteRenderbuffers(1, &color_buffer); else glDeleteTextures(1, &texture); glDeleteFramebuffers(1, &fbo); + fbo_guard.setId(0); } QT_CHECK_GLERROR(); @@ -810,19 +817,15 @@ QGLFramebufferObject::~QGLFramebufferObject() delete d->engine; - if (isValid()) { - const QGLContext *oldContext = QGLContext::currentContext(); - bool switchContext = !oldContext || QGLContextPrivate::contextGroup(oldContext) != ctx; - if (switchContext) - const_cast(ctx->context())->makeCurrent(); + if (isValid() && ctx) { + QGLShareContextScope scope(ctx); glDeleteTextures(1, &d->texture); if (d->color_buffer) glDeleteRenderbuffers(1, &d->color_buffer); if (d->depth_stencil_buffer) glDeleteRenderbuffers(1, &d->depth_stencil_buffer); - glDeleteFramebuffers(1, &d->fbo); - if (oldContext && switchContext) - const_cast(oldContext)->makeCurrent(); + GLuint fbo = d->fbo(); + glDeleteFramebuffers(1, &fbo); } } @@ -838,11 +841,16 @@ QGLFramebufferObject::~QGLFramebufferObject() The non-power of two limitation does not apply if the OpenGL version is 2.0 or higher, or if the GL_ARB_texture_non_power_of_two extension is present. + + The framebuffer can also become invalid if the QGLContext that + the framebuffer was created within is destroyed and there are + no other shared contexts that can take over ownership of the + framebuffer. */ bool QGLFramebufferObject::isValid() const { Q_D(const QGLFramebufferObject); - return d->valid; + return d->valid && d->fbo_guard.context(); } /*! @@ -867,15 +875,17 @@ bool QGLFramebufferObject::bind() return false; Q_D(QGLFramebufferObject); QGL_FUNC_CONTEXT; - glBindFramebuffer(GL_FRAMEBUFFER_EXT, d->fbo); + if (!ctx) + return false; // Context no longer exists. + glBindFramebuffer(GL_FRAMEBUFFER_EXT, d->fbo()); d->valid = d->checkFramebufferStatus(); const QGLContext *context = QGLContext::currentContext(); if (d->valid && context) { - Q_ASSERT(QGLContextPrivate::contextGroup(context) == ctx); + Q_ASSERT(QGLContextPrivate::contextGroup(context) == QGLContextPrivate::contextGroup(ctx)); // Save the previous setting to automatically restore in release(). - if (context->d_ptr->current_fbo != d->fbo) { + if (context->d_ptr->current_fbo != d->fbo()) { d->previous_fbo = context->d_ptr->current_fbo; - context->d_ptr->current_fbo = d->fbo; + context->d_ptr->current_fbo = d->fbo(); } } return d->valid; @@ -900,10 +910,12 @@ bool QGLFramebufferObject::release() return false; Q_D(QGLFramebufferObject); QGL_FUNC_CONTEXT; + if (!ctx) + return false; // Context no longer exists. const QGLContext *context = QGLContext::currentContext(); if (context) { - Q_ASSERT(QGLContextPrivate::contextGroup(context) == ctx); + Q_ASSERT(QGLContextPrivate::contextGroup(context) == QGLContextPrivate::contextGroup(ctx)); // Restore the previous setting for stacked framebuffer objects. if (d->previous_fbo != context->d_ptr->current_fbo) { context->d_ptr->current_fbo = d->previous_fbo; @@ -1144,7 +1156,7 @@ int QGLFramebufferObject::metric(PaintDeviceMetric metric) const GLuint QGLFramebufferObject::handle() const { Q_D(const QGLFramebufferObject); - return d->fbo; + return d->fbo(); } /*! \fn int QGLFramebufferObject::devType() const @@ -1175,7 +1187,7 @@ QGLFramebufferObject::Attachment QGLFramebufferObject::attachment() const bool QGLFramebufferObject::isBound() const { Q_D(const QGLFramebufferObject); - return QGLContext::currentContext()->d_ptr->current_fbo == d->fbo; + return QGLContext::currentContext()->d_ptr->current_fbo == d->fbo(); } /*! diff --git a/src/opengl/qglframebufferobject_p.h b/src/opengl/qglframebufferobject_p.h index f80209d..055a752 100644 --- a/src/opengl/qglframebufferobject_p.h +++ b/src/opengl/qglframebufferobject_p.h @@ -127,15 +127,15 @@ private: class QGLFramebufferObjectPrivate { public: - QGLFramebufferObjectPrivate() : depth_stencil_buffer(0), valid(false), ctx(0), previous_fbo(0), engine(0) {} + QGLFramebufferObjectPrivate() : fbo_guard(0), depth_stencil_buffer(0), valid(false), previous_fbo(0), engine(0) {} ~QGLFramebufferObjectPrivate() {} void init(QGLFramebufferObject *q, const QSize& sz, QGLFramebufferObject::Attachment attachment, GLenum internal_format, GLenum texture_target, GLint samples = 0); bool checkFramebufferStatus() const; + QGLSharedResourceGuard fbo_guard; GLuint texture; - GLuint fbo; GLuint depth_stencil_buffer; GLuint color_buffer; GLenum target; @@ -143,10 +143,11 @@ public: QGLFramebufferObjectFormat format; uint valid : 1; QGLFramebufferObject::Attachment fbo_attachment; - QGLContextGroup *ctx; // for Windows extension ptrs GLuint previous_fbo; mutable QPaintEngine *engine; QGLFBOGLPaintDevice glDevice; + + inline GLuint fbo() const { return fbo_guard.id(); } }; diff --git a/tests/auto/qgl/tst_qgl.cpp b/tests/auto/qgl/tst_qgl.cpp index 999d119..8027e9b 100644 --- a/tests/auto/qgl/tst_qgl.cpp +++ b/tests/auto/qgl/tst_qgl.cpp @@ -84,6 +84,7 @@ private slots: void testDontCrashOnDanglingResources(); void replaceClipping(); void clipTest(); + void destroyFBOAfterContext(); }; tst_QGL::tst_QGL() @@ -1720,6 +1721,33 @@ void tst_QGL::clipTest() QCOMPARE(widgetFB, reference); } +void tst_QGL::destroyFBOAfterContext() +{ + if (!QGLFramebufferObject::hasOpenGLFramebufferObjects()) + QSKIP("QGLFramebufferObject not supported on this platform", SkipSingle); + + QGLWidget *glw = new QGLWidget(); + glw->makeCurrent(); + + // No multisample with combined depth/stencil attachment: + QGLFramebufferObjectFormat fboFormat; + fboFormat.setAttachment(QGLFramebufferObject::CombinedDepthStencil); + + // Don't complicate things by using NPOT: + QGLFramebufferObject *fbo = new QGLFramebufferObject(256, 128, fboFormat); + + // The handle should be valid until the context is destroyed. + QVERIFY(fbo->handle() != 0); + QVERIFY(fbo->isValid()); + + delete glw; + + // The handle should now be zero. + QVERIFY(fbo->handle() == 0); + QVERIFY(!fbo->isValid()); + + delete fbo; +} QTEST_MAIN(tst_QGL) #include "tst_qgl.moc" -- cgit v0.12 From 9dc9084a2ede875495e078e6998476f2ae5ea4e5 Mon Sep 17 00:00:00 2001 From: Rhys Weatherley Date: Thu, 1 Oct 2009 14:26:34 +1000 Subject: Use QGLSharedResourceGuard to track contexts in the shader manager Reviewed-by: Sarah Smith --- src/opengl/gl2paintengineex/qglengineshadermanager.cpp | 8 ++++---- src/opengl/gl2paintengineex/qglengineshadermanager_p.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/opengl/gl2paintengineex/qglengineshadermanager.cpp b/src/opengl/gl2paintengineex/qglengineshadermanager.cpp index eceed06..fcb20b4 100644 --- a/src/opengl/gl2paintengineex/qglengineshadermanager.cpp +++ b/src/opengl/gl2paintengineex/qglengineshadermanager.cpp @@ -78,7 +78,7 @@ const char* QGLEngineSharedShaders::qglEngineShaderSourceCode[] = { }; QGLEngineSharedShaders::QGLEngineSharedShaders(const QGLContext* context) - : ctx(QGLContextPrivate::contextGroup(context)) + : ctxGuard(context) , blitShaderProg(0) , simpleShaderProg(0) { @@ -223,7 +223,7 @@ QGLShader *QGLEngineSharedShaders::compileNamedShader(ShaderName name, QGLShader return compiledShaders[name]; QByteArray source = qglEngineShaderSourceCode[name]; - QGLShader *newShader = new QGLShader(type, ctx->context(), this); + QGLShader *newShader = new QGLShader(type, ctxGuard.context(), this); newShader->compile(source); #if defined(QT_DEBUG) @@ -245,7 +245,7 @@ QGLShader *QGLEngineSharedShaders::compileCustomShader(QGLCustomShaderStage *sta if (newShader) return newShader; - newShader = new QGLShader(type, ctx->context(), this); + newShader = new QGLShader(type, ctxGuard.context(), this); newShader->compile(source); customShaderCache.insert(source, newShader); @@ -273,7 +273,7 @@ QGLEngineShaderProg *QGLEngineSharedShaders::findProgramInCache(const QGLEngineS QGLEngineShaderProg &cached = cachedPrograms.last(); // If the shader program's not found in the cache, create it now. - cached.program = new QGLShaderProgram(ctx->context(), this); + cached.program = new QGLShaderProgram(ctxGuard.context(), this); cached.program->addShader(cached.mainVertexShader); cached.program->addShader(cached.positionVertexShader); cached.program->addShader(cached.mainFragShader); diff --git a/src/opengl/gl2paintengineex/qglengineshadermanager_p.h b/src/opengl/gl2paintengineex/qglengineshadermanager_p.h index 47d9a2a..fbb6d9c 100644 --- a/src/opengl/gl2paintengineex/qglengineshadermanager_p.h +++ b/src/opengl/gl2paintengineex/qglengineshadermanager_p.h @@ -361,7 +361,7 @@ private slots: void shaderDestroyed(QObject *shader); private: - QGLContextGroup *ctx; + QGLSharedResourceGuard ctxGuard; QGLShaderProgram *blitShaderProg; QGLShaderProgram *simpleShaderProg; QList cachedPrograms; -- cgit v0.12 From 5da322990a5002d8c827578efad7b210716f1c15 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Thu, 1 Oct 2009 06:42:27 +0200 Subject: Revert "qmake - add error message if files for deployment are missing" This reverts commit aed3faca7dafdc697402cfc99dc5e9ad2fcbdd45. Using wildcards in the DEPLOYMENT variable like in tests/auto/qpixmap/qpixmap.pro was completely broken. Additional gimmick: replaced hand-crafted string chopping with QString::chop(1). --- qmake/generators/win32/msvc_vcproj.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/qmake/generators/win32/msvc_vcproj.cpp b/qmake/generators/win32/msvc_vcproj.cpp index 0fedbec..c8bb26d 100644 --- a/qmake/generators/win32/msvc_vcproj.cpp +++ b/qmake/generators/win32/msvc_vcproj.cpp @@ -1172,7 +1172,7 @@ void VcprojGenerator::initDeploymentTool() if (targetPath.isEmpty()) targetPath = QString("%CSIDL_PROGRAM_FILES%\\") + project->first("TARGET"); if (targetPath.endsWith("/") || targetPath.endsWith("\\")) - targetPath = targetPath.mid(0,targetPath.size()-1); + targetPath.chop(1); // Only deploy Qt libs for shared build if (!project->values("QMAKE_QT_DLL").isEmpty()) { @@ -1261,13 +1261,7 @@ void VcprojGenerator::initDeploymentTool() searchPath = info.absoluteFilePath(); } else { nameFilter = source.split('\\').last(); - if (source.contains('*')) { - source = source.split('*').first(); - info = QFileInfo(source); - } - searchPath = info.absolutePath(); - if (!info.exists()) - fprintf(stderr, "Deployment file is missing %s\n", source.toLatin1().constData()); + searchPath = info.absolutePath(); } int pathSize = searchPath.size(); -- cgit v0.12 From 059d40d3f918f658041ec20ba04f9d010cfc0fa7 Mon Sep 17 00:00:00 2001 From: Sarah Smith Date: Thu, 1 Oct 2009 15:49:32 +1000 Subject: Remove display lists and refactor ready for ES/ES2 port Display lists, and a few other features dont work in ES/ES2. Refaoctor to allow redo of lighting and other non-fixed-function pipeline features. Also use QAnimation* classes instead of timers, and correct a few minor bugs (flipped texture). Include new screenshot (old one manifested bug). Reviewed-by: Rhys Weatherley --- doc/src/images/pbuffers-example.png | Bin 203754 -> 192554 bytes examples/opengl/pbuffers/cube.cpp | 332 ++++++++++++++++++++++++++++++++++ examples/opengl/pbuffers/cube.h | 147 +++++++++++++++ examples/opengl/pbuffers/glwidget.cpp | 273 +++++++++++++--------------- examples/opengl/pbuffers/glwidget.h | 43 +++-- examples/opengl/pbuffers/main.cpp | 2 + examples/opengl/pbuffers/pbuffers.pro | 20 +- 7 files changed, 649 insertions(+), 168 deletions(-) create mode 100644 examples/opengl/pbuffers/cube.cpp create mode 100644 examples/opengl/pbuffers/cube.h diff --git a/doc/src/images/pbuffers-example.png b/doc/src/images/pbuffers-example.png index bafb05a..c34a6fd 100644 Binary files a/doc/src/images/pbuffers-example.png and b/doc/src/images/pbuffers-example.png differ diff --git a/examples/opengl/pbuffers/cube.cpp b/examples/opengl/pbuffers/cube.cpp new file mode 100644 index 0000000..0f6d15f --- /dev/null +++ b/examples/opengl/pbuffers/cube.cpp @@ -0,0 +1,332 @@ +/**************************************************************************** +** +** 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 examples 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 "cube.h" +#include "glwidget.h" + +#include +#include + +static const qreal FACE_SIZE = 0.4; + +static const qreal speeds[] = { 1.8f, 2.4f, 3.6f }; +static const qreal amplitudes[] = { 2.0f, 2.5f, 3.0f }; + +static inline void qSetColor(float colorVec[], QColor c) +{ + colorVec[0] = c.redF(); + colorVec[1] = c.greenF(); + colorVec[2] = c.blueF(); + colorVec[3] = c.alphaF(); +} + +int Geometry::append(const QVector3D &a, const QVector3D &n, const QVector2D &t) +{ + int v = vertices.count(); + vertices.append(a); + normals.append(n); + texCoords.append(t); + faces.append(v); + colors.append(QVector4D(0.6f, 0.6f, 0.6f, 1.0f)); + return v; +} + +void Geometry::addQuad(const QVector3D &a, const QVector3D &b, + const QVector3D &c, const QVector3D &d, + const QVector &tex) +{ + QVector3D norm = QVector3D::normal(a, b, c); + // append first triangle + int aref = append(a, norm, tex[0]); + append(b, norm, tex[1]); + int cref = append(c, norm, tex[2]); + // append second triangle + faces.append(aref); + faces.append(cref); + append(d, norm, tex[3]); +} + +void Geometry::loadArrays() const +{ + glEnableClientState(GL_VERTEX_ARRAY); + glEnableClientState(GL_NORMAL_ARRAY); + glEnableClientState(GL_TEXTURE_COORD_ARRAY); + glEnableClientState(GL_COLOR_ARRAY); + glVertexPointer(3, GL_FLOAT, 0, vertices.constData()); + glNormalPointer(GL_FLOAT, 0, normals.constData()); + glTexCoordPointer(2, GL_FLOAT, 0, texCoords.constData()); + glColorPointer(4, GL_FLOAT, 0, colors.constData()); +} + +void Geometry::setColors(int start, GLfloat colorArray[4][4]) +{ + int off = faces[start]; + for (int i = 0; i < 4; ++i) + colors[i + off] = QVector4D(colorArray[i][0], + colorArray[i][1], + colorArray[i][2], + colorArray[i][3]); +} + +Tile::Tile(const QVector3D &loc) + : location(loc) + , start(0) + , count(0) + , useFlatColor(false) + , geom(0) +{ + qSetColor(faceColor, QColor(Qt::darkGray)); +} + +void Tile::setColors(GLfloat colorArray[4][4]) +{ + useFlatColor = true; + geom->setColors(start, colorArray); +} + +static inline void qMultMatrix(const QMatrix4x4 &mat) +{ + if (sizeof(qreal) == sizeof(GLfloat)) + glMultMatrixf((GLfloat*)mat.constData()); +#ifndef QT_OPENGL_ES + else if (sizeof(qreal) == sizeof(GLdouble)) + glMultMatrixd((GLdouble*)mat.constData()); +#endif + else + { + GLfloat fmat[16]; + qreal const *r = mat.constData(); + for (int i = 0; i < 16; ++i) + fmat[i] = r[i]; + glMultMatrixf(fmat); + } +} + +void Tile::draw() const +{ + QMatrix4x4 mat; + mat.translate(location); + mat.rotate(orientation); + glMatrixMode(GL_MODELVIEW); + glPushMatrix(); + qMultMatrix(mat); + glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, faceColor); + glDrawElements(GL_TRIANGLES, count, GL_UNSIGNED_SHORT, geom->indices() + start); + glPopMatrix(); +} + +TileBuilder::TileBuilder(Geometry *g, qreal depth, qreal size) + : verts(4) + , tex(4) + , start(g->count()) + , count(0) + , geom(g) +{ + // front face - make a square with bottom-left at origin + verts[br].setX(size); + verts[tr].setX(size); + verts[tr].setY(size); + verts[tl].setY(size); + + // these vert numbers are good for the tex-coords + for (int i = 0; i < 4; ++i) + tex[i] = verts[i].toVector2D(); + + // now move verts half cube width across so cube is centered on origin + for (int i = 0; i < 4; ++i) + verts[i] -= QVector3D(size / 2.0f, size / 2.0f, -depth); + + // add the front face + g->addQuad(verts[bl], verts[br], verts[tr], verts[tl], tex); + + count = g->count() - start; +} + +void TileBuilder::initialize(Tile *tile) const +{ + tile->start = start; + tile->count = count; + tile->geom = geom; + qSetColor(tile->faceColor, color); +} + +Tile *TileBuilder::newTile(const QVector3D &loc) const +{ + Tile *tile = new Tile(loc); + initialize(tile); + return tile; +} + +Cube::Cube(const QVector3D &loc) + : Tile(loc) + , rot(0.0f) + , r(0), a(0) +{ +} + +Cube::~Cube() +{ +} + +void Cube::setAltitude(qreal a) +{ + if (location.y() != a) + { + location.setY(a); + emit changed(); + } +} + +void Cube::setRange(qreal r) +{ + if (location.x() != r) + { + location.setX(r); + emit changed(); + } +} + +void Cube::setRotation(qreal r) +{ + if (r != rot) + { + orientation = QQuaternion::fromAxisAndAngle(QVector3D(1.0f, 1.0f, 1.0f), r); + emit changed(); + } +} + +void Cube::removeBounce() +{ + delete a; + a = 0; + delete r; + r = 0; +} + +void Cube::startAnimation() +{ + if (r) + { + r->start(); + r->setCurrentTime(startx); + } + if (a) + a->start(); + if (rtn) + rtn->start(); +} + +void Cube::setAnimationPaused(bool paused) +{ + if (paused) + { + if (r) + r->pause(); + if (a) + a->pause(); + if (rtn) + rtn->pause(); + } + else + { + if (r) + r->resume(); + if (a) + a->resume(); + if (rtn) + rtn->resume(); + } +} + +CubeBuilder::CubeBuilder(Geometry *g, qreal depth, qreal size) + : TileBuilder(g, depth) + , ix(0) +{ + for (int i = 0; i < 4; ++i) + verts[i].setZ(size / 2.0f); + // back face - "extrude" verts down + QVector back(verts); + for (int i = 0; i < 4; ++i) + back[i].setZ(-size / 2.0f); + + // add the back face + g->addQuad(back[br], back[bl], back[tl], back[tr], tex); + + // add the sides + g->addQuad(back[bl], back[br], verts[br], verts[bl], tex); + g->addQuad(back[br], back[tr], verts[tr], verts[br], tex); + g->addQuad(back[tr], back[tl], verts[tl], verts[tr], tex); + g->addQuad(back[tl], back[bl], verts[bl], verts[tl], tex); + + count = g->count() - start; +} + +Cube *CubeBuilder::newCube(const QVector3D &loc) const +{ + Cube *c = new Cube(loc); + initialize(c); + qreal d = 4000.0f; + qreal d3 = d / 3.0f; + // Animate movement from left to right + c->r = new QPropertyAnimation(c, "range"); + c->r->setStartValue(-1.3f); + c->r->setEndValue(1.3f); + c->startx = ix * d3 * 3.0f; + c->r->setDuration(d * 4.0f); + c->r->setLoopCount(-1); + c->r->setEasingCurve(QEasingCurve(QEasingCurve::CosineCurve)); + // Animate movement from bottom to top + c->a = new QPropertyAnimation(c, "altitude"); + c->a->setEndValue(loc.y()); + c->a->setStartValue(loc.y() + amplitudes[ix]); + c->a->setDuration(d / speeds[ix]); + c->a->setLoopCount(-1); + c->a->setEasingCurve(QEasingCurve(QEasingCurve::CosineCurve)); + // Animate rotation + c->rtn = new QPropertyAnimation(c, "rotation"); + c->rtn->setStartValue(c->rot); + c->rtn->setEndValue(359.0f); + c->rtn->setDuration(d * 2.0f); + c->rtn->setLoopCount(-1); + c->rtn->setDuration(d / 2); + ix = (ix + 1) % 3; + return c; +} diff --git a/examples/opengl/pbuffers/cube.h b/examples/opengl/pbuffers/cube.h new file mode 100644 index 0000000..4f29b7d --- /dev/null +++ b/examples/opengl/pbuffers/cube.h @@ -0,0 +1,147 @@ +/**************************************************************************** +** +** 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 examples 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$ +** +****************************************************************************/ + +#ifndef CUBE_H +#define CUBE_H + +#include +#include +#include +#include +#include + +class QPropertyAnimation; + +class Geometry +{ +public: + void loadArrays() const; + void addQuad(const QVector3D &a, const QVector3D &b, + const QVector3D &c, const QVector3D &d, + const QVector &tex); + void setColors(int start, GLfloat colors[4][4]); + const GLushort *indices() const { return faces.constData(); } + int count() const { return faces.count(); } +private: + QVector faces; + QVector vertices; + QVector normals; + QVector texCoords; + QVector colors; + int append(const QVector3D &a, const QVector3D &n, const QVector2D &t); + void addTri(const QVector3D &a, const QVector3D &b, const QVector3D &c, const QVector3D &n); + friend class Tile; +}; + +class Tile +{ +public: + void draw() const; + void setColors(GLfloat[4][4]); +protected: + Tile(const QVector3D &loc = QVector3D()); + QVector3D location; + QQuaternion orientation; +private: + int start; + int count; + bool useFlatColor; + GLfloat faceColor[4]; + Geometry *geom; + friend class TileBuilder; +}; + +class TileBuilder +{ +public: + enum { bl, br, tr, tl }; + TileBuilder(Geometry *, qreal depth = 0.0f, qreal size = 1.0f); + Tile *newTile(const QVector3D &loc = QVector3D()) const; + void setColor(QColor c) { color = c; } +protected: + void initialize(Tile *) const; + QVector verts; + QVector tex; + int start; + int count; + Geometry *geom; + QColor color; +}; + +class Cube : public QObject, public Tile +{ + Q_OBJECT + Q_PROPERTY(qreal range READ range WRITE setRange); + Q_PROPERTY(qreal altitude READ altitude WRITE setAltitude); + Q_PROPERTY(qreal rotation READ rotation WRITE setRotation); +public: + Cube(const QVector3D &loc = QVector3D()); + ~Cube(); + qreal range() { return location.x(); } + void setRange(qreal r); + qreal altitude() { return location.y(); } + void setAltitude(qreal a); + qreal rotation() { return rot; } + void setRotation(qreal r); + void removeBounce(); + void startAnimation(); + void setAnimationPaused(bool paused); +signals: + void changed(); +private: + qreal rot; + QPropertyAnimation *r; + QPropertyAnimation *a; + QPropertyAnimation *rtn; + qreal startx; + friend class CubeBuilder; +}; + +class CubeBuilder : public TileBuilder +{ +public: + CubeBuilder(Geometry *, qreal depth = 0.0f, qreal size = 1.0f); + Cube *newCube(const QVector3D &loc = QVector3D()) const; +private: + mutable int ix; +}; + +#endif // CUBE_H diff --git a/examples/opengl/pbuffers/glwidget.cpp b/examples/opengl/pbuffers/glwidget.cpp index fbd5518..56ba65b 100644 --- a/examples/opengl/pbuffers/glwidget.cpp +++ b/examples/opengl/pbuffers/glwidget.cpp @@ -40,216 +40,187 @@ ****************************************************************************/ #include "glwidget.h" -#include - #include -static GLint cubeArray[][3] = { - {0, 0, 0}, {0, 1, 0}, {1, 1, 0}, {1, 0, 0}, - {0, 0, 1}, {1, 0, 1}, {1, 1, 1}, {0, 1, 1}, - {0, 0, 0}, {1, 0, 0}, {1, 0, 1}, {0, 0, 1}, - {0, 1, 0}, {0, 1, 1}, {1, 1, 1}, {1, 1, 0}, - {0, 1, 0}, {0, 0, 0}, {0, 0, 1}, {0, 1, 1}, - {1, 0, 0}, {1, 1, 0}, {1, 1, 1}, {1, 0, 1} -}; +#include "cube.h" -static GLint cubeTextureArray[][2] = { - {0, 0}, {1, 0}, {1, 1}, {0, 1}, - {0, 0}, {0, 1}, {1, 1}, {1, 0}, - {0, 0}, {1, 0}, {1, 1}, {0, 1}, - {1, 0}, {0, 0}, {0, 1}, {1, 1}, - {0, 0}, {1, 0}, {1, 1}, {0, 1}, - {1, 0}, {0, 0}, {0, 1}, {1, 1} -}; +#include -static GLint faceArray[][2] = { - {1, -1}, {1, 1}, {-1, 1}, {-1, -1} -}; +#ifndef GL_MULTISAMPLE +#define GL_MULTISAMPLE 0x809D +#endif -static GLubyte colorArray[][4] = { - {102, 176, 54, 255}, - {81, 141, 41, 255}, - {62, 108, 32, 255}, - {45, 79, 23, 255} +static GLfloat colorArray[][4] = { + {0.243f, 0.423f, 0.125f, 1.0f}, + {0.176f, 0.31f, 0.09f, 1.0f}, + {0.4f, 0.69f, 0.212f, 1.0f}, + {0.317f, 0.553f, 0.161f, 1.0f} }; GLWidget::GLWidget(QWidget *parent) - : QGLWidget(QGLFormat(QGL::SampleBuffers), parent) + : QGLWidget(QGLFormat(QGL::SampleBuffers), parent) + , geom(0) + , cube(0) { // create the pbuffer pbuffer = new QGLPixelBuffer(QSize(512, 512), format(), this); - timerId = startTimer(20); setWindowTitle(tr("OpenGL pbuffers")); + initializeGeometry(); } GLWidget::~GLWidget() { pbuffer->releaseFromDynamicTexture(); glDeleteTextures(1, &dynamicTexture); - glDeleteLists(pbufferList, 1); delete pbuffer; + + qDeleteAll(cubes); + qDeleteAll(tiles); + delete cube; } void GLWidget::initializeGL() { - glMatrixMode(GL_MODELVIEW); - - glEnable(GL_CULL_FACE); initCommon(); + glShadeModel(GL_SMOOTH); + glEnable(GL_LIGHTING); + glEnable(GL_LIGHT0); + static GLfloat lightPosition[4] = { 0.5, 5.0, 7.0, 1.0 }; + glLightfv(GL_LIGHT0, GL_POSITION, lightPosition); initPbuffer(); - - for (int i = 0; i < 3; ++i) { - yOffs[i] = 0.0f; - xInc[i] = 0.005f; - rot[i] = 0.0f; + cube->startAnimation(); + connect(cube, SIGNAL(changed()), this, SLOT(update())); + for (int i = 0; i < 3; ++i) + { + cubes[i]->startAnimation(); + connect(cubes[i], SIGNAL(changed()), this, SLOT(update())); } - xOffs[0]= 0.0f; - xOffs[1]= 0.5f; - xOffs[2]= 1.0f; - - cubeTexture = bindTexture(QImage(":res/cubelogo.png")); -} - -void GLWidget::resizeGL(int w, int h) -{ - glViewport(0, 0, w, h); - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - float aspect = w/(float)(h ? h : 1); - glFrustum(-aspect, aspect, -1, 1, 10, 100); - glTranslatef(-0.5f, -0.5f, -0.5f); - glTranslatef(0.0f, 0.0f, -15.0f); } void GLWidget::paintGL() { - // draw a spinning cube into the pbuffer.. pbuffer->makeCurrent(); - glBindTexture(GL_TEXTURE_2D, cubeTexture); - glCallList(pbufferList); - glFlush(); - - // rendering directly to a texture is not supported on X11 and - // some Windows implementations, unfortunately + drawPbuffer(); + // On direct render platforms, drawing onto the pbuffer context above + // automatically updates the dynamic texture. For cases where rendering + // directly to a texture is not supported, explicitly copy. if (!hasDynamicTextureUpdate) pbuffer->updateDynamicTexture(dynamicTexture); - - // ..and use the pbuffer contents as a texture when rendering the - // background and the bouncing cubes makeCurrent(); + + // Use the pbuffer as a texture to render the scene glBindTexture(GL_TEXTURE_2D, dynamicTexture); + + // set up to render the scene glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + glLoadIdentity(); + glTranslatef(0.0f, 0.0f, -10.0f); // draw the background - glMatrixMode(GL_MODELVIEW); glPushMatrix(); - glLoadIdentity(); - glMatrixMode(GL_PROJECTION); - glPushMatrix(); - glLoadIdentity(); - - glVertexPointer(2, GL_INT, 0, faceArray); - glTranslatef(-1.2f, -0.8f, 0.0f); - glScalef(0.2f, 0.2f, 0.2f); - for (int y = 0; y < 5; ++y) { - for (int x = 0; x < 5; ++x) { - glTranslatef(2.0f, 0, 0); - glColor4f(0.8f, 0.8f, 0.8f, 1.0f); - glDrawArrays(GL_QUADS, 0, 4); - } - glTranslatef(-10.0f, 2.0f, 0); - } - glVertexPointer(3, GL_INT, 0, cubeArray); - - glPopMatrix(); - glMatrixMode(GL_MODELVIEW); + glScalef(aspect, 1.0f, 1.0f); + for (int i = 0; i < tiles.count(); ++i) + tiles[i]->draw(); glPopMatrix(); // draw the bouncing cubes - drawCube(0, 0.0f, 1.5f, 2.5f, 1.5f); - drawCube(1, 1.0f, 2.0f, 2.5f, 2.0f); - drawCube(2, 2.0f, 3.5f, 2.5f, 2.5f); + for (int i = 0; i < cubes.count(); ++i) + cubes[i]->draw(); } -void GLWidget::drawCube(int i, GLfloat z, GLfloat rotation, GLfloat jmp, GLfloat amp) +void GLWidget::initializeGeometry() { - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - glTranslatef(xOffs[i], yOffs[i], z); - glTranslatef(0.5f, 0.5f, 0.5f); - GLfloat scale = 0.75 + i*(0.25f/2); - glScalef(scale, scale, scale); - glRotatef(rot[i], 1.0f, 1.0f, 1.0f); - glTranslatef(-0.5f, -0.5f, -0.5f); - - glColor4f(1.0f, 1.0f, 1.0f, 0.8f); - glDrawArrays(GL_QUADS, 0, 24); - - if (xOffs[i] > 1.0f || xOffs[i] < -1.0f) { - xInc[i] = -xInc[i]; - xOffs[i] = xOffs[i] > 1.0f ? 1.0f : -1.0f; - } - xOffs[i] += xInc[i]; - yOffs[i] = qAbs(cos((-3.141592f * jmp) * xOffs[i]) * amp) - 1; - rot[i] += rotation; + geom = new Geometry(); + CubeBuilder cBuilder(geom, 0.5); + cBuilder.setColor(QColor(255, 255, 255, 212)); + // build the 3 bouncing, spinning cubes + for (int i = 0; i < 3; ++i) + cubes.append(cBuilder.newCube(QVector3D((float)(i-1), -1.5f, 5 - i))); + + // build the spinning cube which goes in the dynamic texture + cube = cBuilder.newCube(); + cube->removeBounce(); + + // build the background tiles + TileBuilder tBuilder(geom); + tBuilder.setColor(QColor(Qt::white)); + for (int c = -2; c <= +2; ++c) + for (int r = -2; r <= +2; ++r) + tiles.append(tBuilder.newTile(QVector3D(c, r, 0))); + + // graded backdrop for the pbuffer scene + TileBuilder bBuilder(geom, 0.0f, 2.0f); + bBuilder.setColor(QColor(102, 176, 54, 210)); + backdrop = bBuilder.newTile(QVector3D(0.0f, 0.0f, -1.5f)); + backdrop->setColors(colorArray); } void GLWidget::initCommon() { - glEnableClientState(GL_VERTEX_ARRAY); - glEnableClientState(GL_TEXTURE_COORD_ARRAY); - glVertexPointer(3, GL_INT, 0, cubeArray); - glTexCoordPointer(2, GL_INT, 0, cubeTextureArray); - glColorPointer(4, GL_UNSIGNED_BYTE, 0, colorArray); + qglClearColor(QColor(Qt::darkGray)); + + glEnable(GL_DEPTH_TEST); + glEnable(GL_CULL_FACE); + glEnable(GL_MULTISAMPLE); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glEnable(GL_BLEND); + glEnable(GL_TEXTURE_2D); - glEnable(GL_DEPTH_TEST); - glClearColor(1.0f, 1.0f, 1.0f, 1.0f); + geom->loadArrays(); } -void GLWidget::initPbuffer() +void GLWidget::perspectiveProjection() { - // set up the pbuffer context - pbuffer->makeCurrent(); - initCommon(); - - glViewport(0, 0, pbuffer->size().width(), pbuffer->size().height()); glMatrixMode(GL_PROJECTION); glLoadIdentity(); - glOrtho(-1, 1, -1, 1, -99, 99); - glTranslatef(-0.5f, -0.5f, 0.0f); + glFrustum(-aspect, +aspect, -1.0, +1.0, 4.0, 15.0); glMatrixMode(GL_MODELVIEW); +} + +void GLWidget::orthographicProjection() +{ + glMatrixMode(GL_PROJECTION); glLoadIdentity(); + glOrtho(-1.0, +1.0, -1.0, +1.0, -90.0, +90.0); + glMatrixMode(GL_MODELVIEW); +} + +void GLWidget::resizeGL(int width, int height) +{ + glViewport(0, 0, width, height); + aspect = (qreal)width / (qreal)(height ? height : 1); + perspectiveProjection(); +} + +void GLWidget::drawPbuffer() +{ + orthographicProjection(); + + glClearColor(0.0f, 0.0f, 0.0f, 1.0f); + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + + glDisable(GL_TEXTURE_2D); + backdrop->draw(); + glEnable(GL_TEXTURE_2D); + + glBindTexture(GL_TEXTURE_2D, cubeTexture); + glDisable(GL_CULL_FACE); + cube->draw(); + glEnable(GL_CULL_FACE); + + glFlush(); +} + +void GLWidget::initPbuffer() +{ + pbuffer->makeCurrent(); + + cubeTexture = bindTexture(QImage(":res/cubelogo.png")); + + initCommon(); - pbufferList = glGenLists(1); - glNewList(pbufferList, GL_COMPILE); - { - glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT); - - // draw cube background - glPushMatrix(); - glLoadIdentity(); - glTranslatef(0.5f, 0.5f, -2.0f); - glDisable(GL_TEXTURE_2D); - glEnableClientState(GL_COLOR_ARRAY); - glVertexPointer(2, GL_INT, 0, faceArray); - glDrawArrays(GL_QUADS, 0, 4); - glVertexPointer(3, GL_INT, 0, cubeArray); - glDisableClientState(GL_COLOR_ARRAY); - glEnable(GL_TEXTURE_2D); - glPopMatrix(); - - // draw cube - glTranslatef(0.5f, 0.5f, 0.5f); - glRotatef(3.0f, 1.0f, 1.0f, 1.0f); - glTranslatef(-0.5f, -0.5f, -0.5f); - glColor4f(0.9f, 0.9f, 0.9f, 1.0f); - glDrawArrays(GL_QUADS, 0, 24); - } - glEndList(); // generate a texture that has the same size/format as the pbuffer dynamicTexture = pbuffer->generateDynamicTexture(); @@ -258,3 +229,9 @@ void GLWidget::initPbuffer() makeCurrent(); } +void GLWidget::setAnimationPaused(bool enable) +{ + cube->setAnimationPaused(enable); + for (int i = 0; i < 3; ++i) + cubes[i]->setAnimationPaused(enable); +} diff --git a/examples/opengl/pbuffers/glwidget.h b/examples/opengl/pbuffers/glwidget.h index 5b64b08..991e8b9 100644 --- a/examples/opengl/pbuffers/glwidget.h +++ b/examples/opengl/pbuffers/glwidget.h @@ -39,32 +39,49 @@ ** ****************************************************************************/ -#include +#ifndef GLWIDGET_H +#define GLWIDGET_H + +#include + +class Geometry; +class Cube; +class Tile; class GLWidget : public QGLWidget { public: - GLWidget(QWidget *parent); + GLWidget(QWidget *parent = 0); ~GLWidget(); + +protected: void initializeGL(); - void resizeGL(int w, int h); void paintGL(); - void timerEvent(QTimerEvent *) { update(); } - void mousePressEvent(QMouseEvent *) { killTimer(timerId); } - void mouseReleaseEvent(QMouseEvent *) { timerId = startTimer(20); } + void resizeGL(int width, int height); + void mousePressEvent(QMouseEvent *) { setAnimationPaused(true); } + void mouseReleaseEvent(QMouseEvent *) { setAnimationPaused(false); } - void drawCube(int i, GLfloat z, GLfloat ri, GLfloat jmp, GLfloat amp); - void initCommon(); +private: + void initializeGeometry(); void initPbuffer(); + void initCommon(); + void perspectiveProjection(); + void orthographicProjection(); + void drawPbuffer(); + void setAnimationPaused(bool enable); -private: - GLfloat rot[3], xOffs[3], yOffs[3], xInc[3]; - GLuint pbufferList; + qreal aspect; GLuint dynamicTexture; GLuint cubeTexture; - int timerId; bool hasDynamicTextureUpdate; - QGLPixelBuffer *pbuffer; + Geometry *geom; + Cube *cube; + Tile *backdrop; + QList cubes; + QList tiles; + }; +//! [3] +#endif diff --git a/examples/opengl/pbuffers/main.cpp b/examples/opengl/pbuffers/main.cpp index cb9e161..4efe9a8 100644 --- a/examples/opengl/pbuffers/main.cpp +++ b/examples/opengl/pbuffers/main.cpp @@ -41,6 +41,8 @@ #include #include +#include + #include "glwidget.h" int main(int argc, char **argv) diff --git a/examples/opengl/pbuffers/pbuffers.pro b/examples/opengl/pbuffers/pbuffers.pro index 4f7740e..1c21596 100644 --- a/examples/opengl/pbuffers/pbuffers.pro +++ b/examples/opengl/pbuffers/pbuffers.pro @@ -1,13 +1,19 @@ -HEADERS += glwidget.h -SOURCES += glwidget.cpp main.cpp +HEADERS += glwidget.h \ + cube.h +SOURCES += glwidget.cpp \ + main.cpp \ + cube.cpp RESOURCES += pbuffers.qrc - QT += opengl # install target.path = $$[QT_INSTALL_EXAMPLES]/opengl/pbuffers -sources.files = $$SOURCES $$HEADERS $$RESOURCES pbuffers.pro *.png +sources.files = $$SOURCES \ + $$HEADERS \ + $$RESOURCES \ + pbuffers.pro \ + *.png sources.path = $$[QT_INSTALL_EXAMPLES]/opengl/pbuffers -INSTALLS += target sources - -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) +INSTALLS += target \ + sources +symbian:include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) -- cgit v0.12 From 360d3c70fd4f29a800982c7b2cdbab761350cd16 Mon Sep 17 00:00:00 2001 From: Justin McPherson Date: Thu, 1 Oct 2009 16:19:22 +1000 Subject: Fix qwidget auto test failing to build on OSX/carbon. Reviewed-by: Sarah Smith --- tests/auto/qwidget/qwidget.pro | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/auto/qwidget/qwidget.pro b/tests/auto/qwidget/qwidget.pro index def28f5..61db2ee 100644 --- a/tests/auto/qwidget/qwidget.pro +++ b/tests/auto/qwidget/qwidget.pro @@ -10,8 +10,8 @@ aix-g++*:QMAKE_CXXFLAGS+=-fpermissive CONFIG += x11inc mac { -LIBS += -framework Security -framework AppKit -OBJECTIVE_SOURCES += tst_qwidget_mac_helpers.mm + LIBS += -framework Security -framework AppKit -framework Carbon + OBJECTIVE_SOURCES += tst_qwidget_mac_helpers.mm } symbian { -- cgit v0.12 From 9341ac7d2f04d6f36b6b23b654e3cb3db42ed027 Mon Sep 17 00:00:00 2001 From: Rhys Weatherley Date: Thu, 1 Oct 2009 16:36:05 +1000 Subject: Add unit tests for QGLShareRegister Reviewed-by: Sarah Smith --- src/opengl/qgl_p.h | 2 +- tests/auto/qgl/tst_qgl.cpp | 122 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 123 insertions(+), 1 deletion(-) diff --git a/src/opengl/qgl_p.h b/src/opengl/qgl_p.h index 2e8ac88..a113b0f 100644 --- a/src/opengl/qgl_p.h +++ b/src/opengl/qgl_p.h @@ -399,7 +399,7 @@ public: Q_DECLARE_OPERATORS_FOR_FLAGS(QGLExtensions::Extensions) -class QGLShareRegister +class Q_AUTOTEST_EXPORT QGLShareRegister { public: QGLShareRegister() {} diff --git a/tests/auto/qgl/tst_qgl.cpp b/tests/auto/qgl/tst_qgl.cpp index 8027e9b..a49f543 100644 --- a/tests/auto/qgl/tst_qgl.cpp +++ b/tests/auto/qgl/tst_qgl.cpp @@ -54,6 +54,10 @@ #include #include +#ifdef QT_BUILD_INTERNAL +#include +#endif + //TESTED_CLASS= //TESTED_FILES= @@ -85,6 +89,7 @@ private slots: void replaceClipping(); void clipTest(); void destroyFBOAfterContext(); + void shareRegister(); }; tst_QGL::tst_QGL() @@ -1749,5 +1754,122 @@ void tst_QGL::destroyFBOAfterContext() delete fbo; } +void tst_QGL::shareRegister() +{ +#ifdef QT_BUILD_INTERNAL + QGLShareRegister *shareReg = qgl_share_reg(); + QVERIFY(shareReg != 0); + + // Create a context. + QGLWidget *glw1 = new QGLWidget(); + glw1->makeCurrent(); + + // Nothing should be sharing with glw1's context yet. + QList list; + list = shareReg->shares(glw1->context()); + QCOMPARE(list.size(), 0); + + // Create a guard for the first context. + QGLSharedResourceGuard guard(glw1->context()); + QVERIFY(guard.id() == 0); + guard.setId(3); + QVERIFY(guard.id() == 3); + + // Create another context that shares with the first. + QGLWidget *glw2 = new QGLWidget(0, glw1); + if (!glw2->isSharing()) { + delete glw2; + delete glw1; + QSKIP("Context sharing is not supported", SkipSingle); + } + QVERIFY(glw1->context() != glw2->context()); + + // Guard should still be the same. + QVERIFY(guard.context() == glw1->context()); + QVERIFY(guard.id() == 3); + + // Now there are two items in the share lists. + list = shareReg->shares(glw1->context()); + QCOMPARE(list.size(), 2); + QVERIFY(list.contains(glw1->context())); + QVERIFY(list.contains(glw2->context())); + list = shareReg->shares(glw2->context()); + QCOMPARE(list.size(), 2); + QVERIFY(list.contains(glw1->context())); + QVERIFY(list.contains(glw2->context())); + + // Check the sharing relationships. + QVERIFY(shareReg->checkSharing(glw1->context(), glw1->context())); + QVERIFY(shareReg->checkSharing(glw2->context(), glw2->context())); + QVERIFY(shareReg->checkSharing(glw1->context(), glw2->context())); + QVERIFY(shareReg->checkSharing(glw2->context(), glw1->context())); + QVERIFY(!shareReg->checkSharing(0, glw2->context())); + QVERIFY(!shareReg->checkSharing(glw1->context(), 0)); + QVERIFY(!shareReg->checkSharing(0, 0)); + + // Create a third context, not sharing with the others. + QGLWidget *glw3 = new QGLWidget(); + + // Create a guard on the standalone context. + QGLSharedResourceGuard guard3(glw3->context()); + guard3.setId(5); + + // First two should still be sharing, but third is in its own list. + list = shareReg->shares(glw1->context()); + QCOMPARE(list.size(), 2); + QVERIFY(list.contains(glw1->context())); + QVERIFY(list.contains(glw2->context())); + list = shareReg->shares(glw2->context()); + QCOMPARE(list.size(), 2); + QVERIFY(list.contains(glw1->context())); + QVERIFY(list.contains(glw2->context())); + list = shareReg->shares(glw3->context()); + QCOMPARE(list.size(), 0); + + // Check the sharing relationships again. + QVERIFY(shareReg->checkSharing(glw1->context(), glw1->context())); + QVERIFY(shareReg->checkSharing(glw2->context(), glw2->context())); + QVERIFY(shareReg->checkSharing(glw1->context(), glw2->context())); + QVERIFY(shareReg->checkSharing(glw2->context(), glw1->context())); + QVERIFY(!shareReg->checkSharing(glw1->context(), glw3->context())); + QVERIFY(!shareReg->checkSharing(glw2->context(), glw3->context())); + QVERIFY(!shareReg->checkSharing(glw3->context(), glw1->context())); + QVERIFY(!shareReg->checkSharing(glw3->context(), glw2->context())); + QVERIFY(shareReg->checkSharing(glw3->context(), glw3->context())); + QVERIFY(!shareReg->checkSharing(0, glw2->context())); + QVERIFY(!shareReg->checkSharing(glw1->context(), 0)); + QVERIFY(!shareReg->checkSharing(0, glw3->context())); + QVERIFY(!shareReg->checkSharing(glw3->context(), 0)); + QVERIFY(!shareReg->checkSharing(0, 0)); + + // Shared guard should still be the same. + QVERIFY(guard.context() == glw1->context()); + QVERIFY(guard.id() == 3); + + // Delete the first context. + delete glw1; + + // Shared guard should now be the second context, with the id the same. + QVERIFY(guard.context() == glw2->context()); + QVERIFY(guard.id() == 3); + QVERIFY(guard3.context() == glw3->context()); + QVERIFY(guard3.id() == 5); + + // Re-check the share list for the second context (should be empty now). + list = shareReg->shares(glw2->context()); + QCOMPARE(list.size(), 0); + + // Clean up. + delete glw2; + delete glw3; + + // Guards should now be null and the id zero. + QVERIFY(guard.context() == 0); + QVERIFY(guard.id() == 0); + QVERIFY(guard3.context() == 0); + QVERIFY(guard3.id() == 0); +#endif +} + QTEST_MAIN(tst_QGL) #include "tst_qgl.moc" -- cgit v0.12 From f23ab31348bb6d3c6b7cb1ccf429ea932824e4e4 Mon Sep 17 00:00:00 2001 From: Rhys Weatherley Date: Thu, 1 Oct 2009 16:39:05 +1000 Subject: Compile fix for pbuffers under Linux Reviewed-by: Sarah Smith --- examples/opengl/pbuffers/cube.h | 2 +- examples/opengl/pbuffers/glwidget.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/opengl/pbuffers/cube.h b/examples/opengl/pbuffers/cube.h index 4f29b7d..1974f4f 100644 --- a/examples/opengl/pbuffers/cube.h +++ b/examples/opengl/pbuffers/cube.h @@ -42,7 +42,7 @@ #ifndef CUBE_H #define CUBE_H -#include +#include #include #include #include diff --git a/examples/opengl/pbuffers/glwidget.h b/examples/opengl/pbuffers/glwidget.h index 991e8b9..c019abe 100644 --- a/examples/opengl/pbuffers/glwidget.h +++ b/examples/opengl/pbuffers/glwidget.h @@ -47,6 +47,7 @@ class Geometry; class Cube; class Tile; +class QGLPixelBuffer; class GLWidget : public QGLWidget { -- cgit v0.12 From eb26efd476faa6e6986e62de12c24527a5476fd3 Mon Sep 17 00:00:00 2001 From: Dmytro Poplavskiy Date: Thu, 1 Oct 2009 16:49:23 +1000 Subject: Fixes: Phonon-gst: use correct URLs for different disk types. RevBy: Andrew den Exter Details: Phonon gstreamer backend used cdda:// URL and corresponding gst source element regardless of disk type. --- src/3rdparty/phonon/gstreamer/mediaobject.cpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/3rdparty/phonon/gstreamer/mediaobject.cpp b/src/3rdparty/phonon/gstreamer/mediaobject.cpp index 13f9734..71cd87f 100644 --- a/src/3rdparty/phonon/gstreamer/mediaobject.cpp +++ b/src/3rdparty/phonon/gstreamer/mediaobject.cpp @@ -904,8 +904,21 @@ void MediaObject::setSource(const MediaSource &source) case MediaSource::Disc: // CD tracks can be specified by setting the url in the following way uri=cdda:4 { - QUrl cdurl(QLatin1String("cdda://")); - if (createPipefromURL(cdurl)) + QUrl url; + switch (source.discType()) { + case Phonon::Cd: + url = QUrl(QLatin1String("cdda://")); + break; + case Phonon::Dvd: + url = QUrl(QLatin1String("dvd://")); + break; + case Phonon::Vcd: + url = QUrl(QLatin1String("vcd://")); + break; + default: + break; + } + if (!url.isEmpty() && createPipefromURL(url)) m_loading = true; else setError(tr("Could not open media source.")); -- cgit v0.12 From 58344e4fc4503e20c1eb0f8d97986bae5f1f4f71 Mon Sep 17 00:00:00 2001 From: Dmytro Poplavskiy Date: Thu, 1 Oct 2009 16:56:53 +1000 Subject: Fixes: Phonon-gst: Respect device MediaSource property. Task: QT-1027 RevBy: Andrew den Exter Details: All gst disk sources support setting device name with "device" property, otherwise the default device is used. --- src/3rdparty/phonon/gstreamer/mediaobject.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/3rdparty/phonon/gstreamer/mediaobject.cpp b/src/3rdparty/phonon/gstreamer/mediaobject.cpp index 71cd87f..5dcbd42 100644 --- a/src/3rdparty/phonon/gstreamer/mediaobject.cpp +++ b/src/3rdparty/phonon/gstreamer/mediaobject.cpp @@ -369,6 +369,11 @@ bool MediaObject::createPipefromURL(const QUrl &url) if (!m_datasource) return false; + // Set the device for MediaSource::Disc + QByteArray mediaDevice = QFile::encodeName(m_source.deviceName()); + if (!mediaDevice.isEmpty()) + g_object_set (m_datasource, "device", mediaDevice.constData(), (const char*)NULL); + // Link data source into pipeline gst_bin_add(GST_BIN(m_pipeline), m_datasource); if (!gst_element_link(m_datasource, m_decodebin)) { -- cgit v0.12 From a2376870b03d694bcc5b614c8f949e497a11b95c Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Thu, 1 Oct 2009 10:27:18 +0300 Subject: Made qpluginbase.pri include properly relative to s60pluginbase.pri Previously, include was relative to each version plugin's .pro file. Reviewed-by: axis --- src/plugins/s60/s60pluginbase.pri | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/s60/s60pluginbase.pri b/src/plugins/s60/s60pluginbase.pri index 29e8eb3..c1aa4ef 100644 --- a/src/plugins/s60/s60pluginbase.pri +++ b/src/plugins/s60/s60pluginbase.pri @@ -1,6 +1,6 @@ # Note: These version based 'plugins' are not an actual Qt plugins, # they are just regular runtime loaded libraries -include(../../qpluginbase.pri) +include(../qpluginbase.pri) CONFIG -= plugin -- cgit v0.12 From 871bdaff6d7ae05571830ae87d9de6ef4e2cdb9f Mon Sep 17 00:00:00 2001 From: Rhys Weatherley Date: Thu, 1 Oct 2009 17:52:09 +1000 Subject: QGLContext::areSharing() to check for GL share relationships Reviewed-by: Samuel --- src/opengl/qgl.cpp | 21 +++++++++++++------ src/opengl/qgl.h | 2 ++ src/opengl/qgl_p.h | 5 ++--- src/opengl/qglshaderprogram.cpp | 8 ++++---- src/opengl/qpaintengine_opengl.cpp | 10 ++++----- src/opengl/qpixmapdata_gl.cpp | 2 +- tests/auto/qgl/tst_qgl.cpp | 42 +++++++++++++++++++------------------- 7 files changed, 50 insertions(+), 40 deletions(-) diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp index 1276443..bfb004e 100644 --- a/src/opengl/qgl.cpp +++ b/src/opengl/qgl.cpp @@ -2254,7 +2254,7 @@ QGLTexture *QGLContextPrivate::textureCacheLookup(const qint64 key, GLenum targe Q_Q(QGLContext); QGLTexture *texture = QGLTextureCache::instance()->getTexture(key); if (texture && texture->target == target - && (texture->context == q || qgl_share_reg()->checkSharing(q, texture->context))) + && (texture->context == q || QGLContext::areSharing(q, texture->context))) { return texture; } @@ -2755,6 +2755,20 @@ void QGLContext::setDevice(QPaintDevice *pDev) */ /*! + Returns true if \a context1 and \a context2 are sharing their + GL resources such as textures, shader programs, etc; + otherwise returns false. + + \since 4.6 +*/ +bool QGLContext::areSharing(const QGLContext *context1, const QGLContext *context2) +{ + if (!context1 || !context2) + return false; + return context1->d_ptr->group == context2->d_ptr->group; +} + +/*! \fn bool QGLContext::deviceIsPixmap() const Returns true if the paint device of this context is a pixmap; @@ -4835,11 +4849,6 @@ Q_OPENGL_EXPORT const QString qt_gl_library_name() } #endif -bool QGLShareRegister::checkSharing(const QGLContext *context1, const QGLContext *context2) { - bool sharing = (context1 && context2 && context1->d_ptr->group == context2->d_ptr->group); - return sharing; -} - void QGLShareRegister::addShare(const QGLContext *context, const QGLContext *share) { Q_ASSERT(context && share); if (context->d_ptr->group == share->d_ptr->group) diff --git a/src/opengl/qgl.h b/src/opengl/qgl.h index 1776004..b1c1317 100644 --- a/src/opengl/qgl.h +++ b/src/opengl/qgl.h @@ -282,6 +282,8 @@ public: bool isSharing() const; void reset(); + static bool areSharing(const QGLContext *context1, const QGLContext *context2); + QGLFormat format() const; QGLFormat requestedFormat() const; void setFormat(const QGLFormat& format); diff --git a/src/opengl/qgl_p.h b/src/opengl/qgl_p.h index a113b0f..9b09c7c 100644 --- a/src/opengl/qgl_p.h +++ b/src/opengl/qgl_p.h @@ -405,7 +405,6 @@ public: QGLShareRegister() {} ~QGLShareRegister() { reg.clear(); } - bool checkSharing(const QGLContext *context1, const QGLContext *context2); void addShare(const QGLContext *context, const QGLContext *share); QList shares(const QGLContext *context); void removeShare(const QGLContext *context); @@ -436,7 +435,7 @@ public: QGLContext *current = const_cast(QGLContext::currentContext()); QGLContext *ctx = const_cast(context); Q_ASSERT(ctx); - bool switch_context = current != ctx && !qgl_share_reg()->checkSharing(current, ctx); + bool switch_context = current != ctx && !QGLContext::areSharing(current, ctx); if (switch_context) ctx->makeCurrent(); #if defined(Q_WS_X11) @@ -547,7 +546,7 @@ public: : m_oldContext(0) { QGLContext *currentContext = const_cast(QGLContext::currentContext()); - if (currentContext != ctx && !qgl_share_reg()->checkSharing(ctx, currentContext)) { + if (currentContext != ctx && !QGLContext::areSharing(ctx, currentContext)) { m_oldContext = currentContext; m_ctx = const_cast(ctx); m_ctx->makeCurrent(); diff --git a/src/opengl/qglshaderprogram.cpp b/src/opengl/qglshaderprogram.cpp index ebcd723..dfa6c40 100644 --- a/src/opengl/qglshaderprogram.cpp +++ b/src/opengl/qglshaderprogram.cpp @@ -349,7 +349,7 @@ QGLShader::QGLShader(QGLShader::ShaderType type, const QGLContext *context, QObj context = QGLContext::currentContext(); d = new QGLShaderPrivate(context, type); #ifndef QT_NO_DEBUG - if (context && !qgl_share_reg()->checkSharing(context, QGLContext::currentContext())) { + if (context && !QGLContext::areSharing(context, QGLContext::currentContext())) { qWarning("QGLShader::QGLShader: \'context\' must be the currect context or sharing with it."); return; } @@ -374,7 +374,7 @@ QGLShader::QGLShader context = QGLContext::currentContext(); d = new QGLShaderPrivate(context, type); #ifndef QT_NO_DEBUG - if (context && !qgl_share_reg()->checkSharing(context, QGLContext::currentContext())) { + if (context && !QGLContext::areSharing(context, QGLContext::currentContext())) { qWarning("QGLShader::QGLShader: \'context\' must be currect context or sharing with it."); return; } @@ -806,8 +806,8 @@ bool QGLShaderProgram::addShader(QGLShader *shader) if (d->shaders.contains(shader)) return true; // Already added to this shader program. if (d->programGuard.id() && shader) { - if (!qgl_share_reg()->checkSharing(shader->d->shaderGuard.context(), - d->programGuard.context())) { + if (!QGLContext::areSharing(shader->d->shaderGuard.context(), + d->programGuard.context())) { qWarning("QGLShaderProgram::addShader: Program and shader are not associated with same context."); return false; } diff --git a/src/opengl/qpaintengine_opengl.cpp b/src/opengl/qpaintengine_opengl.cpp index a904064..da490c0 100644 --- a/src/opengl/qpaintengine_opengl.cpp +++ b/src/opengl/qpaintengine_opengl.cpp @@ -338,7 +338,7 @@ void QGLOffscreen::initialize() int dim = qMax(2048, static_cast(qt_next_power_of_two(qMax(device->size().width(), device->size().height())))); - bool shared_context = qgl_share_reg()->checkSharing(device->context(), ctx); + bool shared_context = QGLContext::areSharing(device->context(), ctx); bool would_fail = last_failed_size.isValid() && (device->size().width() >= last_failed_size.width() || device->size().height() >= last_failed_size.height()); @@ -555,7 +555,7 @@ public: QList contexts = programs.uniqueKeys(); for (int i=0; icheckSharing(cx, ctx)) { + if (cx != ctx && QGLContext::areSharing(cx, ctx)) { QList progs = programs.values(cx); for (int k=0; kcheckSharing(buffer_ctx, ctx)) + if (buffer_ctx && !QGLContext::areSharing(buffer_ctx, ctx)) cleanCache(); buffer_ctx = ctx; @@ -1365,7 +1365,7 @@ bool QOpenGLPaintEngine::begin(QPaintDevice *pdev) #ifdef QT_OPENGL_ES d->max_texture_size = ctx->d_func()->maxTextureSize(); #else - bool shared_ctx = qgl_share_reg()->checkSharing(d->device->context(), d->shader_ctx); + bool shared_ctx = QGLContext::areSharing(d->device->context(), d->shader_ctx); if (shared_ctx) { d->max_texture_size = d->shader_ctx->d_func()->maxTextureSize(); @@ -4683,7 +4683,7 @@ void QGLGlyphCache::cacheGlyphs(QGLContext *context, const QTextItemInt &ti, QList contexts = qt_context_cache.keys(); for (int i=0; icheckSharing(context, ctx)) { + if (ctx != context && QGLContext::areSharing(context, ctx)) { context_key = ctx; dev_it = qt_context_cache.constFind(context_key); break; diff --git a/src/opengl/qpixmapdata_gl.cpp b/src/opengl/qpixmapdata_gl.cpp index 2331c6d..1ee3bbf 100644 --- a/src/opengl/qpixmapdata_gl.cpp +++ b/src/opengl/qpixmapdata_gl.cpp @@ -248,7 +248,7 @@ bool QGLPixmapData::isValidContext(const QGLContext *ctx) const return true; const QGLContext *share_ctx = qt_gl_share_widget()->context(); - return ctx == share_ctx || qgl_share_reg()->checkSharing(ctx, share_ctx); + return ctx == share_ctx || QGLContext::areSharing(ctx, share_ctx); } void QGLPixmapData::resize(int width, int height) diff --git a/tests/auto/qgl/tst_qgl.cpp b/tests/auto/qgl/tst_qgl.cpp index a49f543..f15b249 100644 --- a/tests/auto/qgl/tst_qgl.cpp +++ b/tests/auto/qgl/tst_qgl.cpp @@ -1799,13 +1799,13 @@ void tst_QGL::shareRegister() QVERIFY(list.contains(glw2->context())); // Check the sharing relationships. - QVERIFY(shareReg->checkSharing(glw1->context(), glw1->context())); - QVERIFY(shareReg->checkSharing(glw2->context(), glw2->context())); - QVERIFY(shareReg->checkSharing(glw1->context(), glw2->context())); - QVERIFY(shareReg->checkSharing(glw2->context(), glw1->context())); - QVERIFY(!shareReg->checkSharing(0, glw2->context())); - QVERIFY(!shareReg->checkSharing(glw1->context(), 0)); - QVERIFY(!shareReg->checkSharing(0, 0)); + QVERIFY(QGLContext::areSharing(glw1->context(), glw1->context())); + QVERIFY(QGLContext::areSharing(glw2->context(), glw2->context())); + QVERIFY(QGLContext::areSharing(glw1->context(), glw2->context())); + QVERIFY(QGLContext::areSharing(glw2->context(), glw1->context())); + QVERIFY(!QGLContext::areSharing(0, glw2->context())); + QVERIFY(!QGLContext::areSharing(glw1->context(), 0)); + QVERIFY(!QGLContext::areSharing(0, 0)); // Create a third context, not sharing with the others. QGLWidget *glw3 = new QGLWidget(); @@ -1827,20 +1827,20 @@ void tst_QGL::shareRegister() QCOMPARE(list.size(), 0); // Check the sharing relationships again. - QVERIFY(shareReg->checkSharing(glw1->context(), glw1->context())); - QVERIFY(shareReg->checkSharing(glw2->context(), glw2->context())); - QVERIFY(shareReg->checkSharing(glw1->context(), glw2->context())); - QVERIFY(shareReg->checkSharing(glw2->context(), glw1->context())); - QVERIFY(!shareReg->checkSharing(glw1->context(), glw3->context())); - QVERIFY(!shareReg->checkSharing(glw2->context(), glw3->context())); - QVERIFY(!shareReg->checkSharing(glw3->context(), glw1->context())); - QVERIFY(!shareReg->checkSharing(glw3->context(), glw2->context())); - QVERIFY(shareReg->checkSharing(glw3->context(), glw3->context())); - QVERIFY(!shareReg->checkSharing(0, glw2->context())); - QVERIFY(!shareReg->checkSharing(glw1->context(), 0)); - QVERIFY(!shareReg->checkSharing(0, glw3->context())); - QVERIFY(!shareReg->checkSharing(glw3->context(), 0)); - QVERIFY(!shareReg->checkSharing(0, 0)); + QVERIFY(QGLContext::areSharing(glw1->context(), glw1->context())); + QVERIFY(QGLContext::areSharing(glw2->context(), glw2->context())); + QVERIFY(QGLContext::areSharing(glw1->context(), glw2->context())); + QVERIFY(QGLContext::areSharing(glw2->context(), glw1->context())); + QVERIFY(!QGLContext::areSharing(glw1->context(), glw3->context())); + QVERIFY(!QGLContext::areSharing(glw2->context(), glw3->context())); + QVERIFY(!QGLContext::areSharing(glw3->context(), glw1->context())); + QVERIFY(!QGLContext::areSharing(glw3->context(), glw2->context())); + QVERIFY(QGLContext::areSharing(glw3->context(), glw3->context())); + QVERIFY(!QGLContext::areSharing(0, glw2->context())); + QVERIFY(!QGLContext::areSharing(glw1->context(), 0)); + QVERIFY(!QGLContext::areSharing(0, glw3->context())); + QVERIFY(!QGLContext::areSharing(glw3->context(), 0)); + QVERIFY(!QGLContext::areSharing(0, 0)); // Shared guard should still be the same. QVERIFY(guard.context() == glw1->context()); -- cgit v0.12 From 91b58202c089ea8f4e150717cee8dbc40b8f903c Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Thu, 1 Oct 2009 10:03:26 +0200 Subject: Stabilize tests on X11 --- tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp | 4 ++-- tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp | 3 ++- tests/auto/qmdiarea/tst_qmdiarea.cpp | 1 + tests/auto/qmdisubwindow/tst_qmdisubwindow.cpp | 1 + tests/auto/qmessagebox/tst_qmessagebox.cpp | 3 ++- tests/auto/qwidget/tst_qwidget.cpp | 2 +- 6 files changed, 9 insertions(+), 5 deletions(-) diff --git a/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp b/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp index 6e60516..00fae2f 100644 --- a/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp +++ b/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp @@ -1301,12 +1301,12 @@ void tst_QGraphicsProxyWidget::paintEvent() scene.addItem(&proxy); //make sure we flush all the paint events - QApplication::processEvents(); + QTest::qWait(70); QTRY_VERIFY(proxy.paintCount > 1); proxy.paintCount = 0; w->update(); - QApplication::processEvents(); + QTest::qWait(30); QTRY_COMPARE(proxy.paintCount, 1); //the widget should have been painted now } diff --git a/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp b/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp index 864076f..90477f0 100644 --- a/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp +++ b/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp @@ -1357,8 +1357,9 @@ void tst_QGraphicsScene::removeItem() QVERIFY(!hoverItem->isHovered); { - QTest::mouseMove(view.viewport(), view.mapFromScene(hoverItem->scenePos()), Qt::NoButton); QTest::qWait(250); + QTest::mouseMove(view.viewport(), view.mapFromScene(hoverItem->scenePos()), Qt::NoButton); + QTest::qWait(10); QMouseEvent moveEvent(QEvent::MouseMove, view.mapFromScene(hoverItem->scenePos()), Qt::NoButton, 0, 0); QApplication::sendEvent(view.viewport(), &moveEvent); } diff --git a/tests/auto/qmdiarea/tst_qmdiarea.cpp b/tests/auto/qmdiarea/tst_qmdiarea.cpp index b110114..725c31e 100644 --- a/tests/auto/qmdiarea/tst_qmdiarea.cpp +++ b/tests/auto/qmdiarea/tst_qmdiarea.cpp @@ -468,6 +468,7 @@ void tst_QMdiArea::subWindowActivated2() #ifdef Q_WS_X11 qt_x11_wait_for_window_manager(&mdiArea); #endif + QTest::qWait(100); QTRY_COMPARE(spy.count(), 5); QCOMPARE(mdiArea.activeSubWindow(), mdiArea.subWindowList().back()); diff --git a/tests/auto/qmdisubwindow/tst_qmdisubwindow.cpp b/tests/auto/qmdisubwindow/tst_qmdisubwindow.cpp index b897d8f..2d70bef 100644 --- a/tests/auto/qmdisubwindow/tst_qmdisubwindow.cpp +++ b/tests/auto/qmdisubwindow/tst_qmdisubwindow.cpp @@ -1065,6 +1065,7 @@ void tst_QMdiSubWindow::setSystemMenu() qApp->setLayoutDirection(Qt::RightToLeft); qApp->processEvents(); mainWindow.updateGeometry(); + QTest::qWait(150); subWindow->showSystemMenu(); QTest::qWait(250); diff --git a/tests/auto/qmessagebox/tst_qmessagebox.cpp b/tests/auto/qmessagebox/tst_qmessagebox.cpp index 5607fbd..12858d7 100644 --- a/tests/auto/qmessagebox/tst_qmessagebox.cpp +++ b/tests/auto/qmessagebox/tst_qmessagebox.cpp @@ -714,7 +714,8 @@ void tst_QMessageBox::setInformativeText() msgbox.setInformativeText(itext); msgbox.show(); QCOMPARE(msgbox.informativeText(), itext); - QVERIFY(msgbox.width() > 200); //verify it's big enough (task181688) + QVERIFY2(msgbox.width() > 200, //verify it's big enough (task181688) + qPrintable(QString("%1 > 200").arg(msgbox.width()))); } void tst_QMessageBox::iconPixmap() diff --git a/tests/auto/qwidget/tst_qwidget.cpp b/tests/auto/qwidget/tst_qwidget.cpp index c08d601..94e67a4 100644 --- a/tests/auto/qwidget/tst_qwidget.cpp +++ b/tests/auto/qwidget/tst_qwidget.cpp @@ -8196,7 +8196,7 @@ void tst_QWidget::moveInResizeEvent() testWidget.setGeometry(50, 50, 200, 200); testWidget.show(); QTest::qWaitForWindowShown(&testWidget); - QTest::qWait(10); + QTest::qWait(120); QRect expectedGeometry(100,100, 100, 100); QTRY_COMPARE(testWidget.geometry(), expectedGeometry); -- cgit v0.12 From 790583dc16a89ed77954c096aae52bf9f91aec09 Mon Sep 17 00:00:00 2001 From: "Bradley T. Hughes" Date: Thu, 1 Oct 2009 09:21:02 +0200 Subject: Add support for modality to QGraphicsItem panels. This add QGraphicsItem::setPanelModality(), panelModality(), isBlockedByModalPanel() and the QGraphicsItem::PanelModality enum (enumerators are either SceneModal, PanelModal, or NonModal, which mirror Qt::ApplicationModal, Qt::WindowModal, and Qt::NonModal). Reviewed-by: ahanssen Squashed commit of the following: commit a980a1b9c2972c676f3a70e8577d4eace54a25b3 Author: Bradley T. Hughes Date: Wed Sep 30 14:42:01 2009 +0200 Fix tst_QGraphicsItem::modality_hover() test failures As pointed out by Andreas, QGraphicsScenePrivate::dispatchHoverEvent() already has all the logic needed to correctly dispatch the hover events when changing modality. All we need to do is store the last known mouse position, and call dispatchHoverEvent() when entering, changing, and leaving the modal state. commit ba41633c96ece8da3a8bbf9c7491c15b14f83f76 Author: Bradley T. Hughes Date: Wed Sep 30 14:40:59 2009 +0200 Fix tst_QGraphicsItem::mixedModality() failure When changing modality from SceneModal to PanelModal, we may need to send WindowUnblocked events in addition to the WindowBlocked events. commit d1076e315de10b1b2fb7617ebaee552c14e49c8b Author: Bradley T. Hughes Date: Wed Sep 30 14:33:21 2009 +0200 Update the expected events counts in tst_QGraphicsItem::modality_hover() HoverEnter and HoverMove always come in pairs, and should do so when entering or leaving modality as well. This means though that changing modality can cause spurious HoverMove events (as seen in this test). commit a29b098e4c391651ef61dd4714a66b22654e4628 Author: Bradley T. Hughes Date: Wed Sep 30 14:20:25 2009 +0200 Update tst_QGraphicsItem::mixedModality() to do more detailed checking The test looks for unwanted WindowBlocked/WindowUnblocked events now, making it easier to spot where the failure comes from. commit c1ae96126ed01d0e662bddf38ff161e50a804b1c Author: Bradley T. Hughes Date: Tue Sep 29 12:17:17 2009 +0200 Documentation for QGraphicsItem::PanelModality Document the behavior of the QGraphicsItem::NonModal, PanelModal, and SceneModal enumerators. Corrected a qdoc error in the isBlockedByModalPanel() documentation commit 02fec999e660180ff65bbbf79c8085e582879ed1 Author: Bradley T. Hughes Date: Thu Sep 17 10:31:44 2009 +0200 Add bool QGraphicsItem::isBlockedByModalPanel() This function can be used to figure out 1) if an item is modally shadowed and 2) which panel is blocking the item in question. This will make it possible to implement window-manager like behavior of activating/highlighting/animating modal panels when the user tries to interact with a blocked item (this will most likely need to be done by reimplementing QGraphicsScene::event()). commit eab9a975dcd71b68135325d479374108bd7f3b2a Author: Bradley T. Hughes Date: Wed Sep 16 14:38:55 2009 +0200 Block key events to the focus item if it is blocked by a modal panel. We don't want the event to propagate either, just stop propagating once we reach an item that is blocked. commit 038b61a10bb837b353f988cb0d1665dd53656cdb Author: Bradley T. Hughes Date: Tue Sep 15 12:40:27 2009 +0200 Add a test for click-to-focus behavior in the presence of modality Clicking on a widget should neither give it focus nor set it as the sub-focus item. commit 3bb3662556efe8d76af5a56e65b1df7a9f4b476a Author: Bradley T. Hughes Date: Tue Sep 8 09:08:42 2009 +0200 Newly blocked QGraphicsItem panels should lose implicit grabs when modality is enabled. If an item has an implicit grab when blocked by a modal panel, this grab is lost and no mouse events are sent until the mouse is released and re- commit 3be51be3da36e782a5a1f282c552064d5d490a71 Author: Bradley T. Hughes Date: Thu Sep 3 13:39:14 2009 +0200 Support changing modality from PanelModal to SceneModal or vice-versa Don't leave modality first, and then re-enter... this sends unnecessary events. commit bb0aea559ba01a8bbb03c0370a247ab902f561f5 Author: Bradley T. Hughes Date: Wed Sep 2 16:58:23 2009 +0200 Fix hover event delivery in the presence of modal panels Panels that are modally shadowed should not get hover events. When entering and leaving the modal state, GraphicsSceneHoverEnter and GraphicsSceneHoverLeave event should be send to the widgets that become or are no longer blocked. Auto-test included. commit cad00b1d9da19565e2d7ea2d30d37eb45005b5ae Author: Bradley T. Hughes Date: Wed Sep 2 10:45:20 2009 +0200 Fix tst_QGraphicsItem::modality_hover() test Don't send hover events to items that are modally shadowed. commit ae15df331901110e19eb2037f37ff7f84cd7cd16 Author: Bradley T. Hughes Date: Wed Sep 2 10:44:14 2009 +0200 Enable the ItemIsPanel flag in the modality_hover() test Otherwise the modality settings are ignored. commit 1580f43c8feabc3a2bf9c1450e1a8916e8940a4c Author: Andreas Aardal Hanssen Date: Fri Aug 28 15:20:37 2009 +0200 More work on QGraphicsItem::PanelModality. Added many tests. commit ed2064ad2ec8bc06d62cf1e931b973d5d92c0563 Author: Bradley T. Hughes Date: Thu Aug 27 13:45:11 2009 +0200 Add support for modality to QGraphicsItem panels. This add QGraphicsItem::setPanelModality() and the QGraphicsItem::PanelModality enum (enumerators are either SceneModal, PanelModal, or NonModal, which mirror Qt::ApplicationModal, Qt::WindowModal, and Qt::NonModal). Reviewed-by: ahanssen --- src/gui/graphicsview/qgraphicsitem.cpp | 139 +++- src/gui/graphicsview/qgraphicsitem.h | 11 + src/gui/graphicsview/qgraphicsitem_p.h | 2 + src/gui/graphicsview/qgraphicsscene.cpp | 164 +++- src/gui/graphicsview/qgraphicsscene_p.h | 6 + tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp | 1017 +++++++++++++++++++++++- 6 files changed, 1314 insertions(+), 25 deletions(-) diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp index d7a7bd2..bc9c73f 100644 --- a/src/gui/graphicsview/qgraphicsitem.cpp +++ b/src/gui/graphicsview/qgraphicsitem.cpp @@ -564,6 +564,21 @@ supportsExtension() and setExtension(). */ +/*! + \enum QGraphicsItem::PanelModality + + This enum specifies the behavior of a modal panel. A modal panel + is one that blocks input to other panels. Note that items that + are children of a modal panel are not blocked. + + The values are: + \value NonModal The panel is not modal and does not block input to other panels. + \value PanelModal The panel is modal to a single item hierarchy and blocks input to its parent pane, all grandparent panels, and all siblings of its parent and grandparent panels. + \value SceneModal The window is modal to the entire scene and blocks input to all panels. + + \sa QGraphicsItem::setPanelModality(), QGraphicsItem::panelModality(), QGraphicsItem::ItemIsPanel +*/ + #include "qgraphicsitem.h" #ifndef QT_NO_GRAPHICSVIEW @@ -1649,6 +1664,16 @@ void QGraphicsItem::setFlags(GraphicsItemFlags flags) setFlag(ItemStacksBehindParent, d_ptr->z < qreal(0.0)); } + if ((d_ptr->panelModality != NonModal) + && d_ptr->scene + && (flags & ItemIsPanel) != (oldFlags & ItemIsPanel)) { + // update the panel's modal state + if (flags & ItemIsPanel) + d_ptr->scene->d_func()->enterModal(this); + else + d_ptr->scene->d_func()->leaveModal(this); + } + if (d_ptr->scene) { d_ptr->scene->d_func()->markDirty(this, QRectF(), /*invalidateChildren=*/true, @@ -1725,6 +1750,87 @@ void QGraphicsItem::setCacheMode(CacheMode mode, const QSize &logicalCacheSize) update(); } +/*! + \since 4.6 + + Returns the modality for this item. +*/ +QGraphicsItem::PanelModality QGraphicsItem::panelModality() const +{ + return d_ptr->panelModality; +} + +/*! + \since 4.6 + + Sets the modality for this item to \a panelModality. + + Changing the modality of a visible item takes effect immediately. +*/ +void QGraphicsItem::setPanelModality(PanelModality panelModality) +{ + if (d_ptr->panelModality == panelModality) + return; + + PanelModality previousModality = d_ptr->panelModality; + bool enterLeaveModal = (isPanel() && d_ptr->scene && isVisible()); + if (enterLeaveModal && panelModality == NonModal) + d_ptr->scene->d_func()->leaveModal(this); + d_ptr->panelModality = panelModality; + if (enterLeaveModal && d_ptr->panelModality != NonModal) + d_ptr->scene->d_func()->enterModal(this, previousModality); +} + +/*! + \since 4.6 + + Returns true if this item is blocked by a modal panel, false otherwise. If \a blockingPanel is + non-zero, \a blockingPanel will be set to the modal panel that is blocking this item. If this + item is not blocked, \a blockingPanel will not be set by this function. + + This function always returns false for items not in a scene. + + \sa panelModality() setPanelModality() PanelModality +*/ +bool QGraphicsItem::isBlockedByModalPanel(QGraphicsItem **blockingPanel) const +{ + if (!d_ptr->scene) + return false; + + + QGraphicsItem *dummy = 0; + if (!blockingPanel) + blockingPanel = &dummy; + + QGraphicsScenePrivate *scene_d = d_ptr->scene->d_func(); + if (scene_d->modalPanels.isEmpty()) + return false; + + // ### + if (!scene_d->popupWidgets.isEmpty() && scene_d->popupWidgets.first() == this) + return false; + + for (int i = 0; i < scene_d->modalPanels.count(); ++i) { + QGraphicsItem *modalPanel = scene_d->modalPanels.at(i); + if (modalPanel->panelModality() == QGraphicsItem::SceneModal) { + // Scene modal panels block all non-descendents. + if (modalPanel != this && !modalPanel->isAncestorOf(this)) { + *blockingPanel = modalPanel; + return true; + } + } else { + // Window modal panels block ancestors and siblings/cousins. + if (modalPanel != this + && !modalPanel->isAncestorOf(this) + && commonAncestorItem(modalPanel)) { + *blockingPanel = modalPanel; + return true; + } + } + } + return false; +} + #ifndef QT_NO_TOOLTIP /*! Returns the item's tool tip, or an empty QString if no tool tip has been @@ -1934,6 +2040,8 @@ void QGraphicsItemPrivate::setVisibleHelper(bool newVisible, bool explicitly, bo q->ungrabMouse(); if (scene->d_func()->keyboardGrabberItems.contains(q)) q->ungrabKeyboard(); + if (q->isPanel() && panelModality != QGraphicsItem::NonModal) + scene->d_func()->leaveModal(q_ptr); } if (q_ptr->hasFocus() && scene) { // Hiding the closest non-panel ancestor of the focus item @@ -1955,10 +2063,15 @@ void QGraphicsItemPrivate::setVisibleHelper(bool newVisible, bool explicitly, bo } else { geometryChanged = 1; paintedViewBoundingRectsNeedRepaint = 1; - if (isWidget && scene) { - QGraphicsWidget *widget = static_cast(q_ptr); - if (widget->windowType() == Qt::Popup) - scene->d_func()->addPopup(widget); + if (scene) { + if (isWidget) { + QGraphicsWidget *widget = static_cast(q_ptr); + if (widget->windowType() == Qt::Popup) + scene->d_func()->addPopup(widget); + } + if (q->isPanel() && panelModality != QGraphicsItem::NonModal) { + scene->d_func()->enterModal(q_ptr); + } } } @@ -2781,7 +2894,7 @@ bool QGraphicsItem::hasFocus() const the preferred focus item for its subtree of items, should it later become visible. - As a result of calling this function, this item will receive a + As a result of calling this function, this item will receive a \l{focusInEvent()}{focus in event} with \a focusReason. If another item already has focus, that item will first receive a \l{focusOutEvent()} {focus out event} indicating that it has lost input focus. @@ -3299,7 +3412,7 @@ QMatrix QGraphicsItem::matrix() const The transformation matrix is combined with the item's rotation(), scale() and transformations() into a combined transformations for the item. - + The default transformation matrix is an identity matrix. \sa setTransform(), sceneTransform() @@ -3780,7 +3893,7 @@ void QGraphicsItem::setMatrix(const QMatrix &matrix, bool combine) // Update and set the new transformation. d_ptr->setTransformHelper(newTransform); - + // Send post-notification. itemChange(ItemTransformHasChanged, qVariantFromValue(newTransform)); } @@ -3914,7 +4027,7 @@ void QGraphicsItem::scale(qreal sx, qreal sy) /*! \obsolete - Use + Use \code setTransform(QTransform().shear(sh, sv), true); @@ -3936,7 +4049,7 @@ void QGraphicsItem::shear(qreal sh, qreal sv) Use setPos() or setTransformOriginPoint() instead. For identical behavior, use - + \code setTransform(QTransform::fromTranslate(dx, dy), true); \endcode @@ -4446,7 +4559,7 @@ bool QGraphicsItem::collidesWithItem(const QGraphicsItem *other, Qt::ItemSelecti Note that this function checks whether the item's shape or bounding rectangle (depending on \a mode) is contained within \a path, and not whether \a path is contained within the items shape - or bounding rectangle. + or bounding rectangle. \sa collidesWithItem(), contains(), shape() */ @@ -6595,7 +6708,7 @@ void QGraphicsItem::mousePressEvent(QGraphicsSceneMouseEvent *event) if (d_ptr->isWidget) { // Qt::Popup closes when you click outside. QGraphicsWidget *w = static_cast(this); - if (w->windowFlags() & Qt::Popup) { + if ((w->windowFlags() & Qt::Popup) == Qt::Popup) { event->accept(); if (!w->rect().contains(event->pos())) w->close(); @@ -7020,7 +7133,7 @@ void QGraphicsItem::prepareGeometryChange() // if someone is connected to the changed signal or the scene has no views. // Note that this has to be done *after* markDirty to ensure that // _q_processDirtyItems is called before _q_emitUpdated. - if (scenePrivate->isSignalConnected(scenePrivate->changedSignalIndex) + if (scenePrivate->isSignalConnected(scenePrivate->changedSignalIndex) || scenePrivate->views.isEmpty()) { if (d_ptr->hasTranslateOnlySceneTransform()) { d_ptr->scene->update(boundingRect().translated(d_ptr->sceneTransform.dx(), @@ -10524,7 +10637,7 @@ QPixmap QGraphicsItemEffectSourcePrivate::pixmap(Qt::CoordinateSystem system, QP effectRect.setRight(deviceWidth - 1); if (bottom + 1 > deviceHeight) effectRect.setBottom(deviceHeight -1); - + } if (effectRect.isEmpty()) diff --git a/src/gui/graphicsview/qgraphicsitem.h b/src/gui/graphicsview/qgraphicsitem.h index 99d2e12..e6e324a 100644 --- a/src/gui/graphicsview/qgraphicsitem.h +++ b/src/gui/graphicsview/qgraphicsitem.h @@ -146,6 +146,13 @@ public: DeviceCoordinateCache }; + enum PanelModality + { + NonModal, + PanelModal, + SceneModal + }; + QGraphicsItem(QGraphicsItem *parent = 0 #ifndef Q_QDOC // ### obsolete argument @@ -183,6 +190,10 @@ public: CacheMode cacheMode() const; void setCacheMode(CacheMode mode, const QSize &cacheSize = QSize()); + PanelModality panelModality() const; + void setPanelModality(PanelModality panelModality); + bool isBlockedByModalPanel(QGraphicsItem **blockingPanel = 0) const; + #ifndef QT_NO_TOOLTIP QString toolTip() const; void setToolTip(const QString &toolTip); diff --git a/src/gui/graphicsview/qgraphicsitem_p.h b/src/gui/graphicsview/qgraphicsitem_p.h index 3feccdc..51bfea1 100644 --- a/src/gui/graphicsview/qgraphicsitem_p.h +++ b/src/gui/graphicsview/qgraphicsitem_p.h @@ -131,6 +131,7 @@ public: subFocusItem(0), focusScopeItem(0), imHints(Qt::ImhNone), + panelModality(QGraphicsItem::NonModal), acceptedMouseButtons(0x1f), visible(1), explicitlyHidden(0), @@ -448,6 +449,7 @@ public: QGraphicsItem *subFocusItem; QGraphicsItem *focusScopeItem; Qt::InputMethodHints imHints; + QGraphicsItem::PanelModality panelModality; // Packed 32 bits quint32 acceptedMouseButtons : 5; diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp index 4b74b67..0acef0b 100644 --- a/src/gui/graphicsview/qgraphicsscene.cpp +++ b/src/gui/graphicsview/qgraphicsscene.cpp @@ -565,6 +565,9 @@ void QGraphicsScenePrivate::removeItemHelper(QGraphicsItem *item) q->removeItem(item->d_ptr->children.at(i)); } + if (item->isPanel() && item->isVisible() && item->panelModality() != QGraphicsItem::NonModal) + leaveModal(item); + // Reset the mouse grabber and focus item data. if (mouseGrabberItems.contains(item)) ungrabMouse(item, /* item is dying */ item->d_ptr->inDestructor); @@ -1111,6 +1114,9 @@ void QGraphicsScenePrivate::sendMouseEvent(QGraphicsSceneMouseEvent *mouseEvent) } QGraphicsItem *item = mouseGrabberItems.last(); + if (item->isBlockedByModalPanel()) + return; + for (int i = 0x1; i <= 0x10; i <<= 1) { Qt::MouseButton button = Qt::MouseButton(i); mouseEvent->setButtonDownPos(button, mouseGrabberButtonDownPos.value(button, item->d_ptr->genericMapFromScene(mouseEvent->scenePos(), mouseEvent->widget()))); @@ -1134,6 +1140,8 @@ void QGraphicsScenePrivate::mousePressEventHandler(QGraphicsSceneMouseEvent *mou // Deliver to any existing mouse grabber. if (!mouseGrabberItems.isEmpty()) { + if (mouseGrabberItems.last()->isBlockedByModalPanel()) + return; // The event is ignored by default, but we disregard the event's // accepted state after delivery; the mouse is grabbed, after all. sendMouseEvent(mouseEvent); @@ -1151,12 +1159,22 @@ void QGraphicsScenePrivate::mousePressEventHandler(QGraphicsSceneMouseEvent *mou // Update window activation. QGraphicsItem *topItem = cachedItemsUnderMouse.value(0); QGraphicsWidget *newActiveWindow = topItem ? topItem->window() : 0; + if (newActiveWindow && newActiveWindow->isBlockedByModalPanel(&topItem)) { + // pass activation to the blocking modal window + newActiveWindow = topItem ? topItem->window() : 0; + } + if (newActiveWindow != q->activeWindow()) q->setActiveWindow(newActiveWindow); // Set focus on the topmost enabled item that can take focus. bool setFocus = false; foreach (QGraphicsItem *item, cachedItemsUnderMouse) { + if (item->isBlockedByModalPanel()) { + // Make sure we don't clear focus. + setFocus = true; + break; + } if (item->isEnabled() && ((item->flags() & QGraphicsItem::ItemIsFocusable) && item->d_ptr->mouseSetsFocus)) { if (!item->isWidget() || ((QGraphicsWidget *)item)->focusPolicy() & Qt::ClickFocus) { setFocus = true; @@ -1165,12 +1183,27 @@ void QGraphicsScenePrivate::mousePressEventHandler(QGraphicsSceneMouseEvent *mou break; } } + if (item->isPanel()) + break; + } + + // Check for scene modality. + bool sceneModality = false; + for (int i = 0; i < modalPanels.size(); ++i) { + if (modalPanels.at(i)->panelModality() == QGraphicsItem::SceneModal) { + sceneModality = true; + break; + } } // If nobody could take focus, clear it. - if (!stickyFocus && !setFocus) + if (!stickyFocus && !setFocus && !sceneModality) q->setFocusItem(0, Qt::MouseFocusReason); + // Any item will do. + if (sceneModality && cachedItemsUnderMouse.isEmpty()) + cachedItemsUnderMouse << modalPanels.first(); + // Find a mouse grabber by sending mouse press events to all mouse grabber // candidates one at a time, until the event is accepted. It's accepted by // default, so the receiver has to explicitly ignore it for it to pass @@ -1181,6 +1214,10 @@ void QGraphicsScenePrivate::mousePressEventHandler(QGraphicsSceneMouseEvent *mou continue; } + // Check if this item is blocked by a modal panel and deliver the mouse event to the + // blocking panel instead of this item if blocked. + (void) item->isBlockedByModalPanel(&item); + grabMouse(item, /* implicit = */ true); mouseEvent->accept(); @@ -2403,6 +2440,8 @@ void QGraphicsScene::addItem(QGraphicsItem *item) d->selectedItems << item; if (item->isWidget() && item->isVisible() && static_cast(item)->windowType() == Qt::Popup) d->addPopup(static_cast(item)); + if (item->isPanel() && item->isVisible() && item->panelModality() != QGraphicsItem::NonModal) + d->enterModal(item); // Update creation order focus chain. Make sure to leave the widget's // internal tab order intact. @@ -3205,8 +3244,12 @@ bool QGraphicsScene::event(QEvent *event) } return false; case QEvent::GraphicsSceneMouseMove: - mouseMoveEvent(static_cast(event)); + { + QGraphicsSceneMouseEvent *mouseEvent = static_cast(event); + d->lastSceneMousePos = mouseEvent->scenePos(); + mouseMoveEvent(mouseEvent); break; + } case QEvent::GraphicsSceneMousePress: mousePressEvent(static_cast(event)); break; @@ -3228,8 +3271,12 @@ bool QGraphicsScene::event(QEvent *event) case QEvent::GraphicsSceneHoverEnter: case QEvent::GraphicsSceneHoverLeave: case QEvent::GraphicsSceneHoverMove: - d->dispatchHoverEvent(static_cast(event)); + { + QGraphicsSceneHoverEvent *hoverEvent = static_cast(event); + d->lastSceneMousePos = hoverEvent->scenePos(); + d->dispatchHoverEvent(hoverEvent); break; + } case QEvent::Leave: d->leaveScene(); break; @@ -3599,8 +3646,10 @@ void QGraphicsScene::helpEvent(QGraphicsSceneHelpEvent *helpEvent) bool QGraphicsScenePrivate::itemAcceptsHoverEvents_helper(const QGraphicsItem *item) const { - return item->acceptHoverEvents() - || (item->isWidget() && static_cast(item)->d_func()->hasDecoration()); + return (!item->isBlockedByModalPanel() && + (item->acceptHoverEvents() + || (item->isWidget() + && static_cast(item)->d_func()->hasDecoration()))); } /*! @@ -3674,7 +3723,9 @@ bool QGraphicsScenePrivate::dispatchHoverEvent(QGraphicsSceneHoverEvent *hoverEv } // Generate a move event for the item itself - if (item && !hoverItems.isEmpty() && item == hoverItems.last()) { + if (item + && !hoverItems.isEmpty() + && item == hoverItems.last()) { sendHoverEvent(QEvent::GraphicsSceneHoverMove, item, hoverEvent); return true; } @@ -3708,8 +3759,7 @@ void QGraphicsScenePrivate::leaveScene() while (!hoverItems.isEmpty()) { QGraphicsItem *lastItem = hoverItems.takeLast(); - if (lastItem->acceptHoverEvents() - || (lastItem->isWidget() && static_cast(lastItem)->d_func()->hasDecoration())) + if (itemAcceptsHoverEvents_helper(lastItem)) sendHoverEvent(QEvent::GraphicsSceneHoverLeave, lastItem, &hoverEvent); } } @@ -3736,6 +3786,8 @@ void QGraphicsScene::keyPressEvent(QKeyEvent *keyEvent) keyEvent->accept(); // Send it; QGraphicsItem::keyPressEvent ignores it. If the event // is filtered out, stop propagating it. + if (p->isBlockedByModalPanel()) + break; if (!d->sendEvent(p, keyEvent)) break; } while (!keyEvent->isAccepted() && !p->isPanel() && (p = p->parentItem())); @@ -3766,6 +3818,8 @@ void QGraphicsScene::keyReleaseEvent(QKeyEvent *keyEvent) keyEvent->accept(); // Send it; QGraphicsItem::keyPressEvent ignores it. If the event // is filtered out, stop propagating it. + if (p->isBlockedByModalPanel()) + break; if (!d->sendEvent(p, keyEvent)) break; } while (!keyEvent->isAccepted() && !p->isPanel() && (p = p->parentItem())); @@ -5420,6 +5474,8 @@ void QGraphicsScenePrivate::touchEventHandler(QTouchEvent *sceneTouchEvent) for (; it != end; ++it) { QGraphicsItem *item = it.key(); + (void) item->isBlockedByModalPanel(&item); + // determine event type from the state mask QEvent::Type eventType; switch (it.value().first) { @@ -5493,6 +5549,8 @@ bool QGraphicsScenePrivate::sendTouchBeginEvent(QGraphicsItem *origin, QTouchEve break; } } + if (item->isPanel()) + break; } // If nobody could take focus, clear it. @@ -5518,6 +5576,8 @@ bool QGraphicsScenePrivate::sendTouchBeginEvent(QGraphicsItem *origin, QTouchEve } break; } + if (item->isPanel()) + break; } touchEvent->setAccepted(eventAccepted); @@ -5536,6 +5596,94 @@ void QGraphicsScenePrivate::updateInputMethodSensitivityInViews() views.at(i)->d_func()->updateInputMethodSensitivity(); } +void QGraphicsScenePrivate::enterModal(QGraphicsItem *panel, QGraphicsItem::PanelModality previousModality) +{ + Q_Q(QGraphicsScene); + Q_ASSERT(panel && panel->isPanel()); + + QGraphicsItem::PanelModality panelModality = panel->d_ptr->panelModality; + if (previousModality != QGraphicsItem::NonModal) { + // the panel is changing from one modality type to another... temporarily set it back so + // that blockedPanels is populated correctly + panel->d_ptr->panelModality = previousModality; + } + + QSet blockedPanels; + QList items = q->items(); // ### store panels separately + for (int i = 0; i < items.count(); ++i) { + QGraphicsItem *item = items.at(i); + if (item->isPanel() && item->isBlockedByModalPanel()) + blockedPanels.insert(item); + } + // blockedPanels contains all currently blocked panels + + if (previousModality != QGraphicsItem::NonModal) { + // reset the modality to the proper value, since we changed it above + panel->d_ptr->panelModality = panelModality; + // remove this panel so that it will be reinserted at the front of the stack + modalPanels.removeAll(panel); + } + + modalPanels.prepend(panel); + + if (!hoverItems.isEmpty()) { + // send GraphicsSceneHoverLeave events to newly blocked hoverItems + QGraphicsSceneHoverEvent hoverEvent; + hoverEvent.setScenePos(lastSceneMousePos); + dispatchHoverEvent(&hoverEvent); + } + + if (!mouseGrabberItems.isEmpty() && lastMouseGrabberItemHasImplicitMouseGrab) { + QGraphicsItem *item = mouseGrabberItems.last(); + if (item->isBlockedByModalPanel()) + ungrabMouse(item, /*itemIsDying =*/ false); + } + + QEvent windowBlockedEvent(QEvent::WindowBlocked); + QEvent windowUnblockedEvent(QEvent::WindowUnblocked); + for (int i = 0; i < items.count(); ++i) { + QGraphicsItem *item = items.at(i); + if (item->isPanel()) { + if (!blockedPanels.contains(item) && item->isBlockedByModalPanel()) { + // send QEvent::WindowBlocked to newly blocked panels + sendEvent(item, &windowBlockedEvent); + } else if (blockedPanels.contains(item) && !item->isBlockedByModalPanel()) { + // send QEvent::WindowUnblocked to unblocked panels when downgrading + // a panel from SceneModal to PanelModal + sendEvent(item, &windowUnblockedEvent); + } + } + } +} + +void QGraphicsScenePrivate::leaveModal(QGraphicsItem *panel) +{ + Q_Q(QGraphicsScene); + Q_ASSERT(panel && panel->isPanel()); + + QSet blockedPanels; + QList items = q->items(); // ### same as above + for (int i = 0; i < items.count(); ++i) { + QGraphicsItem *item = items.at(i); + if (item->isPanel() && item->isBlockedByModalPanel()) + blockedPanels.insert(item); + } + + modalPanels.removeAll(panel); + + QEvent e(QEvent::WindowUnblocked); + for (int i = 0; i < items.count(); ++i) { + QGraphicsItem *item = items.at(i); + if (item->isPanel() && blockedPanels.contains(item) && !item->isBlockedByModalPanel()) + sendEvent(item, &e); + } + + // send GraphicsSceneHoverEnter events to newly unblocked items + QGraphicsSceneHoverEvent hoverEvent; + hoverEvent.setScenePos(lastSceneMousePos); + dispatchHoverEvent(&hoverEvent); +} + QT_END_NAMESPACE #include "moc_qgraphicsscene.cpp" diff --git a/src/gui/graphicsview/qgraphicsscene_p.h b/src/gui/graphicsview/qgraphicsscene_p.h index 46917ce..5000860 100644 --- a/src/gui/graphicsview/qgraphicsscene_p.h +++ b/src/gui/graphicsview/qgraphicsscene_p.h @@ -160,6 +160,7 @@ public: Qt::DropAction lastDropAction; QList cachedItemsUnderMouse; QList hoverItems; + QPointF lastSceneMousePos; bool allItemsIgnoreHoverEvents; bool allItemsUseDefaultCursor; void enableMouseTrackingOnViews(); @@ -282,6 +283,11 @@ public: void enableTouchEventsOnViews(); void updateInputMethodSensitivityInViews(); + + QList modalPanels; + void enterModal(QGraphicsItem *item, + QGraphicsItem::PanelModality panelModality = QGraphicsItem::NonModal); + void leaveModal(QGraphicsItem *item); }; // QRectF::intersects() returns false always if either the source or target diff --git a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp index bbf19f2..20dc0a4 100644 --- a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp +++ b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp @@ -80,6 +80,57 @@ Q_DECLARE_METATYPE(QRectF) #define Q_CHECK_PAINTEVENTS #endif +static void sendMousePress(QGraphicsScene *scene, const QPointF &point, Qt::MouseButton button = Qt::LeftButton) +{ + QGraphicsSceneMouseEvent event(QEvent::GraphicsSceneMousePress); + event.setScenePos(point); + event.setButton(button); + event.setButtons(button); + QApplication::sendEvent(scene, &event); +} + +static void sendMouseMove(QGraphicsScene *scene, const QPointF &point, + Qt::MouseButton button = Qt::NoButton, Qt::MouseButtons buttons = 0) +{ + QGraphicsSceneMouseEvent event(QEvent::GraphicsSceneMouseMove); + event.setScenePos(point); + event.setButton(button); + event.setButtons(button); + QApplication::sendEvent(scene, &event); +} + +static void sendMouseRelease(QGraphicsScene *scene, const QPointF &point, Qt::MouseButton button = Qt::LeftButton) +{ + QGraphicsSceneMouseEvent event(QEvent::GraphicsSceneMouseRelease); + event.setScenePos(point); + event.setButton(button); + QApplication::sendEvent(scene, &event); +} + +static void sendMouseClick(QGraphicsScene *scene, const QPointF &point, Qt::MouseButton button = Qt::LeftButton) +{ + sendMousePress(scene, point, button); + sendMouseRelease(scene, point, button); +} + +static void sendKeyPress(QGraphicsScene *scene, Qt::Key key) +{ + QKeyEvent keyEvent(QEvent::KeyPress, key, Qt::NoModifier); + QApplication::sendEvent(scene, &keyEvent); +} + +static void sendKeyRelease(QGraphicsScene *scene, Qt::Key key) +{ + QKeyEvent keyEvent(QEvent::KeyRelease, key, Qt::NoModifier); + QApplication::sendEvent(scene, &keyEvent); +} + +static void sendKeyClick(QGraphicsScene *scene, Qt::Key key) +{ + sendKeyPress(scene, key); + sendKeyRelease(scene, key); +} + class EventSpy : public QGraphicsWidget { Q_OBJECT @@ -120,6 +171,39 @@ protected: QEvent::Type spied; }; +class EventSpy2 : public QGraphicsWidget +{ + Q_OBJECT +public: + EventSpy2(QObject *watched) + { + watched->installEventFilter(this); + } + + EventSpy2(QGraphicsScene *scene, QGraphicsItem *watched) + { + scene->addItem(this); + watched->installSceneEventFilter(this); + } + + QMap counts; + +protected: + bool eventFilter(QObject *watched, QEvent *event) + { + Q_UNUSED(watched); + ++counts[event->type()]; + return false; + } + + bool sceneEventFilter(QGraphicsItem *watched, QEvent *event) + { + Q_UNUSED(watched); + ++counts[event->type()]; + return false; + } +}; + class EventTester : public QGraphicsItem { public: @@ -296,6 +380,13 @@ private slots: void ensureDirtySceneTransform(); void focusScope(); void stackBefore(); + void sceneModality(); + void panelModality(); + void mixedModality(); + void modality_hover(); + void modality_mouseGrabber(); + void modality_clickFocus(); + void modality_keyEvents(); // task specific tests below me void task141694_textItemEnsureVisible(); @@ -4668,11 +4759,11 @@ public: { QGraphicsRectItem::paint(painter, option, widget); if (harakiri == 0) { - // delete unsupported since 4.5 - /* + // delete unsupported since 4.5 + /* dead = 1; - delete this; - */ + delete this; + */ } } @@ -8483,5 +8574,923 @@ void tst_QGraphicsItem::QTBUG_4233_updateCachedWithSceneRect() QCOMPARE(tester->repaints, 2); } +void tst_QGraphicsItem::sceneModality() +{ + // 1) Test mouse events (delivery/propagation/redirection) + // 2) Test hover events (incl. leave on block, enter on unblock) + // 3) Test cursor stuff (incl. unset on block, set on unblock) + // 4) Test clickfocus + // 5) Test grab/ungrab events (possibly ungrab on block, regrab on unblock) + // 6) ### modality for non-panels is unsupported for now + QGraphicsScene scene; + + QGraphicsRectItem *bottomItem = scene.addRect(-150, -100, 300, 200); + bottomItem->setFlag(QGraphicsItem::ItemIsFocusable); + bottomItem->setBrush(Qt::yellow); + + QGraphicsRectItem *leftParent = scene.addRect(-50, -50, 100, 100); + leftParent->setFlag(QGraphicsItem::ItemIsPanel); + leftParent->setBrush(Qt::blue); + + QGraphicsRectItem *leftChild = scene.addRect(-25, -25, 50, 50); + leftChild->setFlag(QGraphicsItem::ItemIsPanel); + leftChild->setBrush(Qt::green); + leftChild->setParentItem(leftParent); + + QGraphicsRectItem *rightParent = scene.addRect(-50, -50, 100, 100); + rightParent->setFlag(QGraphicsItem::ItemIsPanel); + rightParent->setBrush(Qt::red); + QGraphicsRectItem *rightChild = scene.addRect(-25, -25, 50, 50); + rightChild->setFlag(QGraphicsItem::ItemIsPanel); + rightChild->setBrush(Qt::gray); + rightChild->setParentItem(rightParent); + + leftParent->setPos(-75, 0); + rightParent->setPos(75, 0); + + bottomItem->setData(0, "bottomItem"); + leftParent->setData(0, "leftParent"); + leftChild->setData(0, "leftChild"); + rightParent->setData(0, "rightParent"); + rightChild->setData(0, "rightChild"); + + scene.setSceneRect(scene.itemsBoundingRect().adjusted(-50, -50, 50, 50)); + + EventSpy2 leftParentSpy(&scene, leftParent); + EventSpy2 leftChildSpy(&scene, leftChild); + EventSpy2 rightParentSpy(&scene, rightParent); + EventSpy2 rightChildSpy(&scene, rightChild); + EventSpy2 bottomItemSpy(&scene, bottomItem); + + // Scene modality, also test multiple scene modal items + leftChild->setPanelModality(QGraphicsItem::SceneModal); + QCOMPARE(leftChildSpy.counts[QEvent::WindowBlocked], 0); + QCOMPARE(leftParentSpy.counts[QEvent::WindowBlocked], 1); + QCOMPARE(rightParentSpy.counts[QEvent::WindowBlocked], 1); + QCOMPARE(rightChildSpy.counts[QEvent::WindowBlocked], 1); + QCOMPARE(bottomItemSpy.counts[QEvent::WindowBlocked], 0); // not a panel + + // Click inside left child + sendMouseClick(&scene, leftChild->scenePos(), Qt::LeftButton); + QCOMPARE(leftChildSpy.counts[QEvent::GraphicsSceneMousePress], 1); + QCOMPARE(leftChildSpy.counts[QEvent::GraphicsSceneMouseRelease], 0); // no grab + QCOMPARE(leftParentSpy.counts[QEvent::GraphicsSceneMousePress], 0); // blocked + QCOMPARE(rightParentSpy.counts[QEvent::GraphicsSceneMousePress], 0); // blocked + QCOMPARE(rightChildSpy.counts[QEvent::GraphicsSceneMousePress], 0); // blocked + QCOMPARE(bottomItemSpy.counts[QEvent::GraphicsSceneMousePress], 0); // blocked + + // Click on left parent, event goes to modal child + sendMouseClick(&scene, leftParent->sceneBoundingRect().topLeft() + QPointF(5, 5), Qt::LeftButton); + QCOMPARE(leftChildSpy.counts[QEvent::GraphicsSceneMousePress], 2); + QCOMPARE(leftChildSpy.counts[QEvent::GraphicsSceneMouseRelease], 0); // no grab + QCOMPARE(leftParentSpy.counts[QEvent::GraphicsSceneMousePress], 0); // blocked + QCOMPARE(rightParentSpy.counts[QEvent::GraphicsSceneMousePress], 0); // blocked + QCOMPARE(rightChildSpy.counts[QEvent::GraphicsSceneMousePress], 0); // blocked + QCOMPARE(bottomItemSpy.counts[QEvent::GraphicsSceneMousePress], 0); // blocked + + // Click on all other items and outside the items + sendMouseClick(&scene, rightParent->sceneBoundingRect().topLeft() + QPointF(5, 5), Qt::LeftButton); + QCOMPARE(leftChildSpy.counts[QEvent::GraphicsSceneMousePress], 3); + sendMouseClick(&scene, rightChild->scenePos(), Qt::LeftButton); + QCOMPARE(leftChildSpy.counts[QEvent::GraphicsSceneMousePress], 4); + sendMouseClick(&scene, bottomItem->scenePos(), Qt::LeftButton); + QCOMPARE(leftChildSpy.counts[QEvent::GraphicsSceneMousePress], 5); + sendMouseClick(&scene, QPointF(10000, 10000), Qt::LeftButton); + QCOMPARE(leftChildSpy.counts[QEvent::GraphicsSceneMousePress], 6); + QCOMPARE(leftChildSpy.counts[QEvent::GraphicsSceneMouseRelease], 0); // no grab + QCOMPARE(leftParentSpy.counts[QEvent::GraphicsSceneMousePress], 0); // blocked + QCOMPARE(rightParentSpy.counts[QEvent::GraphicsSceneMousePress], 0); // blocked + QCOMPARE(rightChildSpy.counts[QEvent::GraphicsSceneMousePress], 0); // blocked + QCOMPARE(bottomItemSpy.counts[QEvent::GraphicsSceneMousePress], 0); // blocked + + leftChildSpy.counts.clear(); + rightChildSpy.counts.clear(); + leftParentSpy.counts.clear(); + rightParentSpy.counts.clear(); + bottomItemSpy.counts.clear(); + + leftChild->setPanelModality(QGraphicsItem::NonModal); + QCOMPARE(leftChildSpy.counts[QEvent::WindowUnblocked], 0); + QCOMPARE(rightChildSpy.counts[QEvent::WindowUnblocked], 1); + QCOMPARE(leftParentSpy.counts[QEvent::WindowUnblocked], 1); + QCOMPARE(rightParentSpy.counts[QEvent::WindowUnblocked], 1); + QCOMPARE(bottomItemSpy.counts[QEvent::WindowUnblocked], 0); + + // Left parent enters scene modality. + leftParent->setPanelModality(QGraphicsItem::SceneModal); + QCOMPARE(leftChildSpy.counts[QEvent::WindowBlocked], 0); + QCOMPARE(rightChildSpy.counts[QEvent::WindowBlocked], 1); + QCOMPARE(leftParentSpy.counts[QEvent::WindowBlocked], 0); + QCOMPARE(rightParentSpy.counts[QEvent::WindowBlocked], 1); + QCOMPARE(bottomItemSpy.counts[QEvent::WindowBlocked], 0); + + // Click inside left child. + sendMouseClick(&scene, leftChild->scenePos(), Qt::LeftButton); + QCOMPARE(leftChildSpy.counts[QEvent::GraphicsSceneMousePress], 1); + QCOMPARE(leftChildSpy.counts[QEvent::GraphicsSceneMouseRelease], 0); + QCOMPARE(leftParentSpy.counts[QEvent::GraphicsSceneMousePress], 0); // panel stops propagation + QCOMPARE(rightParentSpy.counts[QEvent::GraphicsSceneMousePress], 0); + QCOMPARE(rightChildSpy.counts[QEvent::GraphicsSceneMousePress], 0); // blocked + QCOMPARE(bottomItemSpy.counts[QEvent::GraphicsSceneMousePress], 0); // blocked + + // Click on left parent. + sendMouseClick(&scene, leftParent->sceneBoundingRect().topLeft() + QPointF(5, 5), Qt::LeftButton); + QCOMPARE(leftChildSpy.counts[QEvent::GraphicsSceneMousePress], 1); + QCOMPARE(leftChildSpy.counts[QEvent::GraphicsSceneMouseRelease], 0); + QCOMPARE(leftParentSpy.counts[QEvent::GraphicsSceneMousePress], 1); + QCOMPARE(rightParentSpy.counts[QEvent::GraphicsSceneMousePress], 0); + QCOMPARE(rightChildSpy.counts[QEvent::GraphicsSceneMousePress], 0); + QCOMPARE(bottomItemSpy.counts[QEvent::GraphicsSceneMousePress], 0); + + // Click on all other items and outside the items + sendMouseClick(&scene, rightParent->sceneBoundingRect().topLeft() + QPointF(5, 5), Qt::LeftButton); + QCOMPARE(leftParentSpy.counts[QEvent::GraphicsSceneMousePress], 2); + sendMouseClick(&scene, rightChild->scenePos(), Qt::LeftButton); + QCOMPARE(leftParentSpy.counts[QEvent::GraphicsSceneMousePress], 3); + sendMouseClick(&scene, bottomItem->scenePos(), Qt::LeftButton); + QCOMPARE(leftParentSpy.counts[QEvent::GraphicsSceneMousePress], 4); + sendMouseClick(&scene, QPointF(10000, 10000), Qt::LeftButton); + QCOMPARE(leftParentSpy.counts[QEvent::GraphicsSceneMousePress], 5); + QCOMPARE(leftParentSpy.counts[QEvent::GraphicsSceneMouseRelease], 0); + QCOMPARE(leftChildSpy.counts[QEvent::GraphicsSceneMousePress], 1); + QCOMPARE(rightParentSpy.counts[QEvent::GraphicsSceneMousePress], 0); + QCOMPARE(rightChildSpy.counts[QEvent::GraphicsSceneMousePress], 0); + QCOMPARE(bottomItemSpy.counts[QEvent::GraphicsSceneMousePress], 0); + + leftChildSpy.counts.clear(); + rightChildSpy.counts.clear(); + leftParentSpy.counts.clear(); + rightParentSpy.counts.clear(); + bottomItemSpy.counts.clear(); + + // Now both left parent and child are scene modal. Left parent is blocked. + leftChild->setPanelModality(QGraphicsItem::SceneModal); + QCOMPARE(leftChildSpy.counts[QEvent::WindowBlocked], 0); + QCOMPARE(rightChildSpy.counts[QEvent::WindowBlocked], 0); + QCOMPARE(leftParentSpy.counts[QEvent::WindowBlocked], 1); + QCOMPARE(rightParentSpy.counts[QEvent::WindowBlocked], 0); + QCOMPARE(bottomItemSpy.counts[QEvent::WindowBlocked], 0); + + // Click inside left child + sendMouseClick(&scene, leftChild->scenePos(), Qt::LeftButton); + QCOMPARE(leftChildSpy.counts[QEvent::GraphicsSceneMousePress], 1); + QCOMPARE(leftChildSpy.counts[QEvent::GraphicsSceneMouseRelease], 0); // no grab + QCOMPARE(leftParentSpy.counts[QEvent::GraphicsSceneMousePress], 0); // blocked + QCOMPARE(rightParentSpy.counts[QEvent::GraphicsSceneMousePress], 0); // blocked + QCOMPARE(rightChildSpy.counts[QEvent::GraphicsSceneMousePress], 0); // blocked + QCOMPARE(bottomItemSpy.counts[QEvent::GraphicsSceneMousePress], 0); // blocked + + // Click on left parent, event goes to modal child + sendMouseClick(&scene, leftParent->sceneBoundingRect().topLeft() + QPointF(5, 5), Qt::LeftButton); + QCOMPARE(leftChildSpy.counts[QEvent::GraphicsSceneMousePress], 2); + QCOMPARE(leftChildSpy.counts[QEvent::GraphicsSceneMouseRelease], 0); // no grab + QCOMPARE(leftParentSpy.counts[QEvent::GraphicsSceneMousePress], 0); // blocked + QCOMPARE(rightParentSpy.counts[QEvent::GraphicsSceneMousePress], 0); // blocked + QCOMPARE(rightChildSpy.counts[QEvent::GraphicsSceneMousePress], 0); // blocked + QCOMPARE(bottomItemSpy.counts[QEvent::GraphicsSceneMousePress], 0); // blocked + + // Click on all other items and outside the items + sendMouseClick(&scene, rightParent->sceneBoundingRect().topLeft() + QPointF(5, 5), Qt::LeftButton); + QCOMPARE(leftChildSpy.counts[QEvent::GraphicsSceneMousePress], 3); + sendMouseClick(&scene, rightChild->scenePos(), Qt::LeftButton); + QCOMPARE(leftChildSpy.counts[QEvent::GraphicsSceneMousePress], 4); + sendMouseClick(&scene, bottomItem->scenePos(), Qt::LeftButton); + QCOMPARE(leftChildSpy.counts[QEvent::GraphicsSceneMousePress], 5); + sendMouseClick(&scene, QPointF(10000, 10000), Qt::LeftButton); + QCOMPARE(leftChildSpy.counts[QEvent::GraphicsSceneMousePress], 6); + QCOMPARE(leftChildSpy.counts[QEvent::GraphicsSceneMouseRelease], 0); // no grab + QCOMPARE(leftParentSpy.counts[QEvent::GraphicsSceneMousePress], 0); // blocked + QCOMPARE(rightParentSpy.counts[QEvent::GraphicsSceneMousePress], 0); // blocked + QCOMPARE(rightChildSpy.counts[QEvent::GraphicsSceneMousePress], 0); // blocked + QCOMPARE(bottomItemSpy.counts[QEvent::GraphicsSceneMousePress], 0); // blocked + + leftChildSpy.counts.clear(); + rightChildSpy.counts.clear(); + leftParentSpy.counts.clear(); + rightParentSpy.counts.clear(); + bottomItemSpy.counts.clear(); + + // Right child enters scene modality, only left child is blocked. + rightChild->setPanelModality(QGraphicsItem::SceneModal); + QCOMPARE(leftChildSpy.counts[QEvent::WindowBlocked], 1); + QCOMPARE(rightChildSpy.counts[QEvent::WindowBlocked], 0); + QCOMPARE(leftParentSpy.counts[QEvent::WindowBlocked], 0); + QCOMPARE(rightParentSpy.counts[QEvent::WindowBlocked], 0); + QCOMPARE(bottomItemSpy.counts[QEvent::WindowBlocked], 0); +} + +void tst_QGraphicsItem::panelModality() +{ + // 1) Test mouse events (delivery/propagation/redirection) + // 2) Test hover events (incl. leave on block, enter on unblock) + // 3) Test cursor stuff (incl. unset on block, set on unblock) + // 4) Test clickfocus + // 5) Test grab/ungrab events (possibly ungrab on block, regrab on unblock) + // 6) ### modality for non-panels is unsupported for now + QGraphicsScene scene; + + QGraphicsRectItem *bottomItem = scene.addRect(-150, -100, 300, 200); + bottomItem->setFlag(QGraphicsItem::ItemIsFocusable); + bottomItem->setBrush(Qt::yellow); + + QGraphicsRectItem *leftParent = scene.addRect(-50, -50, 100, 100); + leftParent->setFlag(QGraphicsItem::ItemIsPanel); + leftParent->setBrush(Qt::blue); + + QGraphicsRectItem *leftChild = scene.addRect(-25, -25, 50, 50); + leftChild->setFlag(QGraphicsItem::ItemIsPanel); + leftChild->setBrush(Qt::green); + leftChild->setParentItem(leftParent); + + QGraphicsRectItem *rightParent = scene.addRect(-50, -50, 100, 100); + rightParent->setFlag(QGraphicsItem::ItemIsPanel); + rightParent->setBrush(Qt::red); + QGraphicsRectItem *rightChild = scene.addRect(-25, -25, 50, 50); + rightChild->setFlag(QGraphicsItem::ItemIsPanel); + rightChild->setBrush(Qt::gray); + rightChild->setParentItem(rightParent); + + leftParent->setPos(-75, 0); + rightParent->setPos(75, 0); + + bottomItem->setData(0, "bottomItem"); + leftParent->setData(0, "leftParent"); + leftChild->setData(0, "leftChild"); + rightParent->setData(0, "rightParent"); + rightChild->setData(0, "rightChild"); + + scene.setSceneRect(scene.itemsBoundingRect().adjusted(-50, -50, 50, 50)); + + EventSpy2 leftParentSpy(&scene, leftParent); + EventSpy2 leftChildSpy(&scene, leftChild); + EventSpy2 rightParentSpy(&scene, rightParent); + EventSpy2 rightChildSpy(&scene, rightChild); + EventSpy2 bottomItemSpy(&scene, bottomItem); + + // Left Child enters panel modality, only left parent is blocked. + leftChild->setPanelModality(QGraphicsItem::PanelModal); + QCOMPARE(leftChildSpy.counts[QEvent::WindowBlocked], 0); + QCOMPARE(rightChildSpy.counts[QEvent::WindowBlocked], 0); + QCOMPARE(leftParentSpy.counts[QEvent::WindowBlocked], 1); + QCOMPARE(rightParentSpy.counts[QEvent::WindowBlocked], 0); + QCOMPARE(bottomItemSpy.counts[QEvent::WindowBlocked], 0); + + leftChild->setPanelModality(QGraphicsItem::NonModal); + leftChildSpy.counts.clear(); + rightChildSpy.counts.clear(); + leftParentSpy.counts.clear(); + rightParentSpy.counts.clear(); + bottomItemSpy.counts.clear(); + + // Left parent enter panel modality, nothing is blocked. + leftParent->setPanelModality(QGraphicsItem::PanelModal); + QCOMPARE(leftChildSpy.counts[QEvent::WindowBlocked], 0); + QCOMPARE(rightChildSpy.counts[QEvent::WindowBlocked], 0); + QCOMPARE(leftParentSpy.counts[QEvent::WindowBlocked], 0); + QCOMPARE(rightParentSpy.counts[QEvent::WindowBlocked], 0); + QCOMPARE(bottomItemSpy.counts[QEvent::WindowBlocked], 0); + + // Left child enters panel modality, left parent is blocked again. + leftChild->setPanelModality(QGraphicsItem::PanelModal); + QCOMPARE(leftChildSpy.counts[QEvent::WindowBlocked], 0); + QCOMPARE(rightChildSpy.counts[QEvent::WindowBlocked], 0); + QCOMPARE(leftParentSpy.counts[QEvent::WindowBlocked], 1); + QCOMPARE(rightParentSpy.counts[QEvent::WindowBlocked], 0); + QCOMPARE(bottomItemSpy.counts[QEvent::WindowBlocked], 0); + + leftChildSpy.counts.clear(); + rightChildSpy.counts.clear(); + leftParentSpy.counts.clear(); + rightParentSpy.counts.clear(); + bottomItemSpy.counts.clear(); + + leftChild->setPanelModality(QGraphicsItem::NonModal); + QCOMPARE(leftParentSpy.counts[QEvent::WindowUnblocked], 1); + leftParent->setPanelModality(QGraphicsItem::NonModal); + QCOMPARE(leftChildSpy.counts[QEvent::WindowUnblocked], 0); + QCOMPARE(rightChildSpy.counts[QEvent::WindowUnblocked], 0); + QCOMPARE(leftParentSpy.counts[QEvent::WindowUnblocked], 1); + QCOMPARE(rightParentSpy.counts[QEvent::WindowUnblocked], 0); + QCOMPARE(bottomItemSpy.counts[QEvent::WindowUnblocked], 0); + + leftChildSpy.counts.clear(); + rightChildSpy.counts.clear(); + leftParentSpy.counts.clear(); + rightParentSpy.counts.clear(); + bottomItemSpy.counts.clear(); + + // Left and right child enter panel modality, both parents are blocked. + rightChild->setPanelModality(QGraphicsItem::PanelModal); + QCOMPARE(leftParentSpy.counts[QEvent::WindowBlocked], 0); + QCOMPARE(rightParentSpy.counts[QEvent::WindowBlocked], 1); + leftChild->setPanelModality(QGraphicsItem::PanelModal); + QCOMPARE(leftParentSpy.counts[QEvent::WindowBlocked], 1); + QCOMPARE(rightParentSpy.counts[QEvent::WindowBlocked], 1); +} + +void tst_QGraphicsItem::mixedModality() +{ + // 1) Test mouse events (delivery/propagation/redirection) + // 2) Test hover events (incl. leave on block, enter on unblock) + // 3) Test cursor stuff (incl. unset on block, set on unblock) + // 4) Test clickfocus + // 5) Test grab/ungrab events (possibly ungrab on block, regrab on unblock) + // 6) ### modality for non-panels is unsupported for now + QGraphicsScene scene; + + QGraphicsRectItem *bottomItem = scene.addRect(-150, -100, 300, 200); + bottomItem->setFlag(QGraphicsItem::ItemIsFocusable); + bottomItem->setBrush(Qt::yellow); + + QGraphicsRectItem *leftParent = scene.addRect(-50, -50, 100, 100); + leftParent->setFlag(QGraphicsItem::ItemIsPanel); + leftParent->setBrush(Qt::blue); + + QGraphicsRectItem *leftChild = scene.addRect(-25, -25, 50, 50); + leftChild->setFlag(QGraphicsItem::ItemIsPanel); + leftChild->setBrush(Qt::green); + leftChild->setParentItem(leftParent); + + QGraphicsRectItem *rightParent = scene.addRect(-50, -50, 100, 100); + rightParent->setFlag(QGraphicsItem::ItemIsPanel); + rightParent->setBrush(Qt::red); + QGraphicsRectItem *rightChild = scene.addRect(-25, -25, 50, 50); + rightChild->setFlag(QGraphicsItem::ItemIsPanel); + rightChild->setBrush(Qt::gray); + rightChild->setParentItem(rightParent); + + leftParent->setPos(-75, 0); + rightParent->setPos(75, 0); + + bottomItem->setData(0, "bottomItem"); + leftParent->setData(0, "leftParent"); + leftChild->setData(0, "leftChild"); + rightParent->setData(0, "rightParent"); + rightChild->setData(0, "rightChild"); + + scene.setSceneRect(scene.itemsBoundingRect().adjusted(-50, -50, 50, 50)); + + EventSpy2 leftParentSpy(&scene, leftParent); + EventSpy2 leftChildSpy(&scene, leftChild); + EventSpy2 rightParentSpy(&scene, rightParent); + EventSpy2 rightChildSpy(&scene, rightChild); + EventSpy2 bottomItemSpy(&scene, bottomItem); + + // Left Child enters panel modality, only left parent is blocked. + leftChild->setPanelModality(QGraphicsItem::PanelModal); + QCOMPARE(leftChildSpy.counts[QEvent::WindowBlocked], 0); + QCOMPARE(rightChildSpy.counts[QEvent::WindowBlocked], 0); + QCOMPARE(leftParentSpy.counts[QEvent::WindowBlocked], 1); + QCOMPARE(rightParentSpy.counts[QEvent::WindowBlocked], 0); + + // Left parent enters scene modality, which blocks everything except the child. + leftParent->setPanelModality(QGraphicsItem::SceneModal); + QCOMPARE(leftChildSpy.counts[QEvent::WindowBlocked], 0); + QCOMPARE(leftChildSpy.counts[QEvent::WindowUnblocked], 0); + QCOMPARE(rightChildSpy.counts[QEvent::WindowBlocked], 1); + QCOMPARE(rightChildSpy.counts[QEvent::WindowUnblocked], 0); + QCOMPARE(leftParentSpy.counts[QEvent::WindowBlocked], 1); + QCOMPARE(leftParentSpy.counts[QEvent::WindowUnblocked], 0); + QCOMPARE(rightParentSpy.counts[QEvent::WindowBlocked], 1); + QCOMPARE(rightParentSpy.counts[QEvent::WindowUnblocked], 0); + + // Right child enters panel modality (changes nothing). + rightChild->setPanelModality(QGraphicsItem::PanelModal); + QCOMPARE(leftChildSpy.counts[QEvent::WindowBlocked], 0); + QCOMPARE(leftChildSpy.counts[QEvent::WindowUnblocked], 0); + QCOMPARE(rightChildSpy.counts[QEvent::WindowBlocked], 1); + QCOMPARE(rightChildSpy.counts[QEvent::WindowUnblocked], 0); + QCOMPARE(leftParentSpy.counts[QEvent::WindowBlocked], 1); + QCOMPARE(leftParentSpy.counts[QEvent::WindowUnblocked], 0); + QCOMPARE(rightParentSpy.counts[QEvent::WindowBlocked], 1); + QCOMPARE(rightParentSpy.counts[QEvent::WindowUnblocked], 0); + + // Left parent leaves modality. Right child is unblocked. + leftParent->setPanelModality(QGraphicsItem::NonModal); + QCOMPARE(leftChildSpy.counts[QEvent::WindowBlocked], 0); + QCOMPARE(leftChildSpy.counts[QEvent::WindowUnblocked], 0); + QCOMPARE(rightChildSpy.counts[QEvent::WindowBlocked], 1); + QCOMPARE(rightChildSpy.counts[QEvent::WindowUnblocked], 1); + QCOMPARE(leftParentSpy.counts[QEvent::WindowBlocked], 1); + QCOMPARE(leftParentSpy.counts[QEvent::WindowUnblocked], 0); + QCOMPARE(rightParentSpy.counts[QEvent::WindowBlocked], 1); + QCOMPARE(rightParentSpy.counts[QEvent::WindowUnblocked], 0); + + // Right child "upgrades" its modality to scene modal. Left child is blocked. + // Right parent is unaffected. + rightChild->setPanelModality(QGraphicsItem::SceneModal); + QCOMPARE(leftChildSpy.counts[QEvent::WindowBlocked], 1); + QCOMPARE(leftChildSpy.counts[QEvent::WindowUnblocked], 0); + QCOMPARE(rightChildSpy.counts[QEvent::WindowBlocked], 1); + QCOMPARE(rightChildSpy.counts[QEvent::WindowUnblocked], 1); + QCOMPARE(leftParentSpy.counts[QEvent::WindowBlocked], 1); + QCOMPARE(leftParentSpy.counts[QEvent::WindowUnblocked], 0); + QCOMPARE(rightParentSpy.counts[QEvent::WindowBlocked], 1); + QCOMPARE(rightParentSpy.counts[QEvent::WindowUnblocked], 0); + + // "downgrade" right child back to panel modal, left child is unblocked + rightChild->setPanelModality(QGraphicsItem::PanelModal); + QCOMPARE(leftChildSpy.counts[QEvent::WindowBlocked], 1); + QCOMPARE(leftChildSpy.counts[QEvent::WindowUnblocked], 1); + QCOMPARE(rightChildSpy.counts[QEvent::WindowBlocked], 1); + QCOMPARE(rightChildSpy.counts[QEvent::WindowUnblocked], 1); + QCOMPARE(leftParentSpy.counts[QEvent::WindowBlocked], 1); + QCOMPARE(leftParentSpy.counts[QEvent::WindowUnblocked], 0); + QCOMPARE(rightParentSpy.counts[QEvent::WindowBlocked], 1); + QCOMPARE(rightParentSpy.counts[QEvent::WindowUnblocked], 0); +} + +void tst_QGraphicsItem::modality_hover() +{ + QGraphicsScene scene; + QGraphicsRectItem *rect1 = scene.addRect(-50, -50, 100, 100); + rect1->setFlag(QGraphicsItem::ItemIsPanel); + rect1->setAcceptHoverEvents(true); + rect1->setData(0, "rect1"); + + QGraphicsRectItem *rect2 = scene.addRect(-50, -50, 100, 100); + rect2->setParentItem(rect1); + rect2->setFlag(QGraphicsItem::ItemIsPanel); + rect2->setAcceptHoverEvents(true); + rect2->setPos(50, 50); + rect2->setPanelModality(QGraphicsItem::SceneModal); + rect2->setData(0, "rect2"); + + EventSpy2 rect1Spy(&scene, rect1); + EventSpy2 rect2Spy(&scene, rect2); + + sendMouseMove(&scene, QPointF(-25, -25)); + + QCOMPARE(rect1Spy.counts[QEvent::GraphicsSceneHoverEnter], 0); + QCOMPARE(rect1Spy.counts[QEvent::GraphicsSceneHoverMove], 0); + QCOMPARE(rect1Spy.counts[QEvent::GraphicsSceneHoverLeave], 0); + + sendMouseMove(&scene, QPointF(75, 75)); + + QCOMPARE(rect1Spy.counts[QEvent::GraphicsSceneHoverEnter], 0); + QCOMPARE(rect1Spy.counts[QEvent::GraphicsSceneHoverMove], 0); + QCOMPARE(rect1Spy.counts[QEvent::GraphicsSceneHoverLeave], 0); + QCOMPARE(rect2Spy.counts[QEvent::GraphicsSceneHoverEnter], 1); + QCOMPARE(rect2Spy.counts[QEvent::GraphicsSceneHoverMove], 1); + QCOMPARE(rect2Spy.counts[QEvent::GraphicsSceneHoverLeave], 0); + + sendMouseMove(&scene, QPointF(-25, -25)); + + QCOMPARE(rect2Spy.counts[QEvent::GraphicsSceneHoverLeave], 1); + QCOMPARE(rect1Spy.counts[QEvent::GraphicsSceneHoverEnter], 0); + QCOMPARE(rect1Spy.counts[QEvent::GraphicsSceneHoverMove], 0); + QCOMPARE(rect1Spy.counts[QEvent::GraphicsSceneHoverLeave], 0); + + rect2->setPanelModality(QGraphicsItem::NonModal); + + QCOMPARE(rect1Spy.counts[QEvent::GraphicsSceneHoverEnter], 1); + QCOMPARE(rect1Spy.counts[QEvent::GraphicsSceneHoverMove], 1); + + sendMouseMove(&scene, QPointF(75, 75)); + + QCOMPARE(rect2Spy.counts[QEvent::GraphicsSceneHoverEnter], 2); + QCOMPARE(rect2Spy.counts[QEvent::GraphicsSceneHoverMove], 2); + + rect2->setPanelModality(QGraphicsItem::SceneModal); + + QCOMPARE(rect1Spy.counts[QEvent::GraphicsSceneHoverLeave], 1); + QCOMPARE(rect2Spy.counts[QEvent::GraphicsSceneHoverEnter], 2); + // changing modality causes a spurious GraphicsSceneHoveMove, even though the mouse didn't + // actually move + QCOMPARE(rect2Spy.counts[QEvent::GraphicsSceneHoverMove], 3); + + sendMouseMove(&scene, QPointF(-25, -25)); + + QCOMPARE(rect2Spy.counts[QEvent::GraphicsSceneHoverLeave], 2); + QCOMPARE(rect1Spy.counts[QEvent::GraphicsSceneHoverEnter], 1); + QCOMPARE(rect1Spy.counts[QEvent::GraphicsSceneHoverMove], 1); + QCOMPARE(rect1Spy.counts[QEvent::GraphicsSceneHoverLeave], 1); + + rect2->setPanelModality(QGraphicsItem::PanelModal); + + QCOMPARE(rect1Spy.counts[QEvent::GraphicsSceneHoverEnter], 1); + QCOMPARE(rect1Spy.counts[QEvent::GraphicsSceneHoverMove], 1); + QCOMPARE(rect1Spy.counts[QEvent::GraphicsSceneHoverLeave], 1); + QCOMPARE(rect2Spy.counts[QEvent::GraphicsSceneHoverEnter], 2); + QCOMPARE(rect2Spy.counts[QEvent::GraphicsSceneHoverMove], 3); + QCOMPARE(rect2Spy.counts[QEvent::GraphicsSceneHoverLeave], 2); + + rect2->setPanelModality(QGraphicsItem::NonModal); + + QCOMPARE(rect1Spy.counts[QEvent::GraphicsSceneHoverEnter], 2); + QCOMPARE(rect1Spy.counts[QEvent::GraphicsSceneHoverMove], 2); + QCOMPARE(rect2Spy.counts[QEvent::GraphicsSceneHoverEnter], 2); + QCOMPARE(rect2Spy.counts[QEvent::GraphicsSceneHoverMove], 3); + QCOMPARE(rect2Spy.counts[QEvent::GraphicsSceneHoverLeave], 2); +} + +void tst_QGraphicsItem::modality_mouseGrabber() +{ + QGraphicsScene scene; + QGraphicsRectItem *rect1 = scene.addRect(-50, -50, 100, 100); + rect1->setFlag(QGraphicsItem::ItemIsPanel); + rect1->setFlag(QGraphicsItem::ItemIsMovable); + rect1->setData(0, "rect1"); + + QGraphicsRectItem *rect2 = scene.addRect(-50, -50, 100, 100); + rect2->setParentItem(rect1); + rect2->setFlag(QGraphicsItem::ItemIsPanel); + rect2->setFlag(QGraphicsItem::ItemIsMovable); + rect2->setPos(50, 50); + rect2->setData(0, "rect2"); + + EventSpy2 rect1Spy(&scene, rect1); + EventSpy2 rect2Spy(&scene, rect2); + + { + // pressing mouse on rect1 starts implicit grab + sendMousePress(&scene, QPoint(-25, -25)); + QCOMPARE(rect1Spy.counts[QEvent::GrabMouse], 1); + QCOMPARE(rect1Spy.counts[QEvent::GraphicsSceneMousePress], 1); + QCOMPARE(rect1Spy.counts[QEvent::UngrabMouse], 0); + QCOMPARE(rect2Spy.counts[QEvent::GrabMouse], 0); + QCOMPARE(rect2Spy.counts[QEvent::UngrabMouse], 0); + QCOMPARE(scene.mouseGrabberItem(), (QGraphicsItem *) rect1); + + // grab lost when rect1 is modally shadowed + rect2->setPanelModality(QGraphicsItem::SceneModal); + QCOMPARE(rect1Spy.counts[QEvent::GrabMouse], 1); + QCOMPARE(rect1Spy.counts[QEvent::UngrabMouse], 1); + QCOMPARE(rect2Spy.counts[QEvent::GrabMouse], 0); + QCOMPARE(rect2Spy.counts[QEvent::UngrabMouse], 0); + QCOMPARE(scene.mouseGrabberItem(), (QGraphicsItem *) 0); + + // releasing goes nowhere + sendMouseRelease(&scene, QPoint(-25, -25)); + QCOMPARE(rect1Spy.counts[QEvent::GrabMouse], 1); + QCOMPARE(rect1Spy.counts[QEvent::GraphicsSceneMouseRelease], 0); + QCOMPARE(rect1Spy.counts[QEvent::UngrabMouse], 1); + QCOMPARE(rect2Spy.counts[QEvent::GrabMouse], 0); + QCOMPARE(rect2Spy.counts[QEvent::GraphicsSceneMouseRelease], 0); + QCOMPARE(rect2Spy.counts[QEvent::UngrabMouse], 0); + QCOMPARE(scene.mouseGrabberItem(), (QGraphicsItem *) 0); + + // pressing mouse on rect1 starts implicit grab on rect2 (since it is modal) + sendMouseClick(&scene, QPoint(-25, -25)); + QCOMPARE(rect1Spy.counts[QEvent::GrabMouse], 1); + QCOMPARE(rect1Spy.counts[QEvent::GraphicsSceneMousePress], 1); + QCOMPARE(rect1Spy.counts[QEvent::GraphicsSceneMouseRelease], 0); + QCOMPARE(rect1Spy.counts[QEvent::UngrabMouse], 1); + QCOMPARE(rect2Spy.counts[QEvent::GrabMouse], 1); + QCOMPARE(rect2Spy.counts[QEvent::GraphicsSceneMousePress], 1); + QCOMPARE(rect2Spy.counts[QEvent::GraphicsSceneMouseRelease], 1); + QCOMPARE(rect2Spy.counts[QEvent::UngrabMouse], 1); + + rect2->setPanelModality(QGraphicsItem::NonModal); + + // pressing mouse on rect1 starts implicit grab + sendMousePress(&scene, QPoint(-25, -25)); + QCOMPARE(rect1Spy.counts[QEvent::GrabMouse], 2); + QCOMPARE(rect1Spy.counts[QEvent::GraphicsSceneMousePress], 2); + QCOMPARE(rect1Spy.counts[QEvent::UngrabMouse], 1); + QCOMPARE(rect2Spy.counts[QEvent::GrabMouse], 1); + QCOMPARE(rect2Spy.counts[QEvent::UngrabMouse], 1); + QCOMPARE(scene.mouseGrabberItem(), (QGraphicsItem *) rect1); + + // grab lost to rect2 when rect1 is modally shadowed + rect2->setPanelModality(QGraphicsItem::SceneModal); + QCOMPARE(rect1Spy.counts[QEvent::GrabMouse], 2); + QCOMPARE(rect1Spy.counts[QEvent::UngrabMouse], 2); + QCOMPARE(rect2Spy.counts[QEvent::GrabMouse], 1); + QCOMPARE(rect2Spy.counts[QEvent::UngrabMouse], 1); + QCOMPARE(scene.mouseGrabberItem(), (QGraphicsItem *) 0); + + // rect1 does *not* re-grab when rect2 is no longer modal + rect2->setPanelModality(QGraphicsItem::NonModal); + QCOMPARE(rect1Spy.counts[QEvent::GrabMouse], 2); + QCOMPARE(rect1Spy.counts[QEvent::UngrabMouse], 2); + QCOMPARE(rect2Spy.counts[QEvent::GrabMouse], 1); + QCOMPARE(rect2Spy.counts[QEvent::UngrabMouse], 1); + QCOMPARE(scene.mouseGrabberItem(), (QGraphicsItem *) 0); + + // release goes nowhere + sendMouseRelease(&scene, QPoint(-25, -25)); + QCOMPARE(rect1Spy.counts[QEvent::GrabMouse], 2); + QCOMPARE(rect1Spy.counts[QEvent::GraphicsSceneMouseRelease], 0); + QCOMPARE(rect1Spy.counts[QEvent::UngrabMouse], 2); + QCOMPARE(rect2Spy.counts[QEvent::GrabMouse], 1); + QCOMPARE(rect2Spy.counts[QEvent::UngrabMouse], 1); + QCOMPARE(scene.mouseGrabberItem(), (QGraphicsItem *) 0); + } + { + // repeat the test using PanelModal + rect2->setPanelModality(QGraphicsItem::NonModal); + rect1Spy.counts.clear(); + rect2Spy.counts.clear(); + + // pressing mouse on rect1 starts implicit grab + sendMousePress(&scene, QPoint(-25, -25)); + QCOMPARE(rect1Spy.counts[QEvent::GrabMouse], 1); + QCOMPARE(rect1Spy.counts[QEvent::GraphicsSceneMousePress], 1); + QCOMPARE(rect1Spy.counts[QEvent::UngrabMouse], 0); + QCOMPARE(rect2Spy.counts[QEvent::GrabMouse], 0); + QCOMPARE(rect2Spy.counts[QEvent::UngrabMouse], 0); + QCOMPARE(scene.mouseGrabberItem(), (QGraphicsItem *) rect1); + + // grab lost when rect1 is modally shadowed + rect2->setPanelModality(QGraphicsItem::PanelModal); + QCOMPARE(rect1Spy.counts[QEvent::GrabMouse], 1); + QCOMPARE(rect1Spy.counts[QEvent::UngrabMouse], 1); + QCOMPARE(rect2Spy.counts[QEvent::GrabMouse], 0); + QCOMPARE(rect2Spy.counts[QEvent::UngrabMouse], 0); + QCOMPARE(scene.mouseGrabberItem(), (QGraphicsItem *) 0); + + // releasing goes nowhere + sendMouseRelease(&scene, QPoint(-25, -25)); + QCOMPARE(rect1Spy.counts[QEvent::GrabMouse], 1); + QCOMPARE(rect1Spy.counts[QEvent::GraphicsSceneMouseRelease], 0); + QCOMPARE(rect1Spy.counts[QEvent::UngrabMouse], 1); + QCOMPARE(rect2Spy.counts[QEvent::GrabMouse], 0); + QCOMPARE(rect2Spy.counts[QEvent::GraphicsSceneMouseRelease], 0); + QCOMPARE(rect2Spy.counts[QEvent::UngrabMouse], 0); + QCOMPARE(scene.mouseGrabberItem(), (QGraphicsItem *) 0); + + // pressing mouse on rect1 starts implicit grab on rect2 (since it is modal) + sendMouseClick(&scene, QPoint(-25, -25)); + QCOMPARE(rect1Spy.counts[QEvent::GrabMouse], 1); + QCOMPARE(rect1Spy.counts[QEvent::GraphicsSceneMousePress], 1); + QCOMPARE(rect1Spy.counts[QEvent::GraphicsSceneMouseRelease], 0); + QCOMPARE(rect1Spy.counts[QEvent::UngrabMouse], 1); + QCOMPARE(rect2Spy.counts[QEvent::GrabMouse], 1); + QCOMPARE(rect2Spy.counts[QEvent::GraphicsSceneMousePress], 1); + QCOMPARE(rect2Spy.counts[QEvent::GraphicsSceneMouseRelease], 1); + QCOMPARE(rect2Spy.counts[QEvent::UngrabMouse], 1); + + rect2->setPanelModality(QGraphicsItem::NonModal); + + // pressing mouse on rect1 starts implicit grab + sendMousePress(&scene, QPoint(-25, -25)); + QCOMPARE(rect1Spy.counts[QEvent::GrabMouse], 2); + QCOMPARE(rect1Spy.counts[QEvent::GraphicsSceneMousePress], 2); + QCOMPARE(rect1Spy.counts[QEvent::UngrabMouse], 1); + QCOMPARE(rect2Spy.counts[QEvent::GrabMouse], 1); + QCOMPARE(rect2Spy.counts[QEvent::UngrabMouse], 1); + QCOMPARE(scene.mouseGrabberItem(), (QGraphicsItem *) rect1); + + // grab lost to rect2 when rect1 is modally shadowed + rect2->setPanelModality(QGraphicsItem::PanelModal); + QCOMPARE(rect1Spy.counts[QEvent::GrabMouse], 2); + QCOMPARE(rect1Spy.counts[QEvent::UngrabMouse], 2); + QCOMPARE(rect2Spy.counts[QEvent::GrabMouse], 1); + QCOMPARE(rect2Spy.counts[QEvent::UngrabMouse], 1); + QCOMPARE(scene.mouseGrabberItem(), (QGraphicsItem *) 0); + + // rect1 does *not* re-grab when rect2 is no longer modal + rect2->setPanelModality(QGraphicsItem::NonModal); + QCOMPARE(rect1Spy.counts[QEvent::GrabMouse], 2); + QCOMPARE(rect1Spy.counts[QEvent::UngrabMouse], 2); + QCOMPARE(rect2Spy.counts[QEvent::GrabMouse], 1); + QCOMPARE(rect2Spy.counts[QEvent::UngrabMouse], 1); + QCOMPARE(scene.mouseGrabberItem(), (QGraphicsItem *) 0); + + // release goes nowhere + sendMouseRelease(&scene, QPoint(-25, -25)); + QCOMPARE(rect1Spy.counts[QEvent::GrabMouse], 2); + QCOMPARE(rect1Spy.counts[QEvent::GraphicsSceneMouseRelease], 0); + QCOMPARE(rect1Spy.counts[QEvent::UngrabMouse], 2); + QCOMPARE(rect2Spy.counts[QEvent::GrabMouse], 1); + QCOMPARE(rect2Spy.counts[QEvent::UngrabMouse], 1); + QCOMPARE(scene.mouseGrabberItem(), (QGraphicsItem *) 0); + } + + { + // repeat the PanelModal tests, but this time the mouse events will be on a non-modal item, + // meaning normal grabbing should work + rect2->setPanelModality(QGraphicsItem::NonModal); + rect1Spy.counts.clear(); + rect2Spy.counts.clear(); + + QGraphicsRectItem *rect3 = scene.addRect(-50, -50, 100, 100); + rect3->setFlag(QGraphicsItem::ItemIsPanel); + rect3->setFlag(QGraphicsItem::ItemIsMovable); + rect3->setPos(150, 50); + rect3->setData(0, "rect3"); + + EventSpy2 rect3Spy(&scene, rect3); + + // pressing mouse on rect3 starts implicit grab + sendMousePress(&scene, QPoint(150, 50)); + QCOMPARE(rect1Spy.counts[QEvent::GrabMouse], 0); + QCOMPARE(rect1Spy.counts[QEvent::UngrabMouse], 0); + QCOMPARE(rect2Spy.counts[QEvent::GrabMouse], 0); + QCOMPARE(rect2Spy.counts[QEvent::UngrabMouse], 0); + QCOMPARE(rect3Spy.counts[QEvent::GrabMouse], 1); + QCOMPARE(rect3Spy.counts[QEvent::GraphicsSceneMousePress], 1); + QCOMPARE(rect3Spy.counts[QEvent::UngrabMouse], 0); + QCOMPARE(scene.mouseGrabberItem(), (QGraphicsItem *) rect3); + + // grab is *not* lost when rect1 is modally shadowed by rect2 + rect2->setPanelModality(QGraphicsItem::PanelModal); + QCOMPARE(rect1Spy.counts[QEvent::GrabMouse], 0); + QCOMPARE(rect1Spy.counts[QEvent::UngrabMouse], 0); + QCOMPARE(rect2Spy.counts[QEvent::GrabMouse], 0); + QCOMPARE(rect2Spy.counts[QEvent::UngrabMouse], 0); + QCOMPARE(rect3Spy.counts[QEvent::GrabMouse], 1); + QCOMPARE(rect3Spy.counts[QEvent::UngrabMouse], 0); + QCOMPARE(scene.mouseGrabberItem(), (QGraphicsItem *) rect3); + + // releasing goes to rect3 + sendMouseRelease(&scene, QPoint(150, 50)); + QCOMPARE(rect1Spy.counts[QEvent::GrabMouse], 0); + QCOMPARE(rect1Spy.counts[QEvent::UngrabMouse], 0); + QCOMPARE(rect2Spy.counts[QEvent::GrabMouse], 0); + QCOMPARE(rect2Spy.counts[QEvent::UngrabMouse], 0); + QCOMPARE(rect3Spy.counts[QEvent::GrabMouse], 1); + QCOMPARE(rect3Spy.counts[QEvent::GraphicsSceneMouseRelease], 1); + QCOMPARE(rect3Spy.counts[QEvent::UngrabMouse], 1); + QCOMPARE(scene.mouseGrabberItem(), (QGraphicsItem *) 0); + + rect2->setPanelModality(QGraphicsItem::NonModal); + + // pressing mouse on rect3 starts implicit grab + sendMousePress(&scene, QPoint(150, 50)); + QCOMPARE(rect1Spy.counts[QEvent::GrabMouse], 0); + QCOMPARE(rect1Spy.counts[QEvent::UngrabMouse], 0); + QCOMPARE(rect2Spy.counts[QEvent::GrabMouse], 0); + QCOMPARE(rect2Spy.counts[QEvent::UngrabMouse], 0); + QCOMPARE(rect3Spy.counts[QEvent::GrabMouse], 2); + QCOMPARE(rect3Spy.counts[QEvent::UngrabMouse], 1); + QCOMPARE(scene.mouseGrabberItem(), (QGraphicsItem *) rect3); + + // grab is not lost + rect2->setPanelModality(QGraphicsItem::PanelModal); + QCOMPARE(rect1Spy.counts[QEvent::GrabMouse], 0); + QCOMPARE(rect1Spy.counts[QEvent::UngrabMouse], 0); + QCOMPARE(rect2Spy.counts[QEvent::GrabMouse], 0); + QCOMPARE(rect2Spy.counts[QEvent::UngrabMouse], 0); + QCOMPARE(rect3Spy.counts[QEvent::GrabMouse], 2); + QCOMPARE(rect3Spy.counts[QEvent::UngrabMouse], 1); + QCOMPARE(scene.mouseGrabberItem(), (QGraphicsItem *) rect3); + + // grab stays on rect3 + rect2->setPanelModality(QGraphicsItem::NonModal); + QCOMPARE(rect1Spy.counts[QEvent::GrabMouse], 0); + QCOMPARE(rect1Spy.counts[QEvent::UngrabMouse], 0); + QCOMPARE(rect2Spy.counts[QEvent::GrabMouse], 0); + QCOMPARE(rect2Spy.counts[QEvent::UngrabMouse], 0); + QCOMPARE(rect3Spy.counts[QEvent::GrabMouse], 2); + QCOMPARE(rect3Spy.counts[QEvent::UngrabMouse], 1); + QCOMPARE(scene.mouseGrabberItem(), (QGraphicsItem *) rect3); + + // release goes to rect3 + sendMouseRelease(&scene, QPoint(150, 50)); + QCOMPARE(rect1Spy.counts[QEvent::GrabMouse], 0); + QCOMPARE(rect1Spy.counts[QEvent::UngrabMouse], 0); + QCOMPARE(rect2Spy.counts[QEvent::GrabMouse], 0); + QCOMPARE(rect2Spy.counts[QEvent::UngrabMouse], 0); + QCOMPARE(rect3Spy.counts[QEvent::GrabMouse], 2); + QCOMPARE(rect3Spy.counts[QEvent::UngrabMouse], 2); + QCOMPARE(scene.mouseGrabberItem(), (QGraphicsItem *) 0); + } +} + +void tst_QGraphicsItem::modality_clickFocus() +{ + QGraphicsScene scene; + QGraphicsRectItem *rect1 = scene.addRect(-50, -50, 100, 100); + rect1->setFlag(QGraphicsItem::ItemIsPanel); + rect1->setFlag(QGraphicsItem::ItemIsFocusable); + rect1->setData(0, "rect1"); + + QGraphicsRectItem *rect2 = scene.addRect(-50, -50, 100, 100); + rect2->setParentItem(rect1); + rect2->setFlag(QGraphicsItem::ItemIsPanel); + rect2->setFlag(QGraphicsItem::ItemIsFocusable); + rect2->setPos(50, 50); + rect2->setData(0, "rect2"); + + QEvent windowActivateEvent(QEvent::WindowActivate); + QApplication::sendEvent(&scene, &windowActivateEvent); + + EventSpy2 rect1Spy(&scene, rect1); + EventSpy2 rect2Spy(&scene, rect2); + + // activate rect1, it should not get focus + rect1->setActive(true); + QCOMPARE(scene.focusItem(), (QGraphicsItem *) 0); + + // focus stays unset when rect2 becomes modal + rect2->setPanelModality(QGraphicsItem::SceneModal); + QCOMPARE(scene.focusItem(), (QGraphicsItem *) 0); + QCOMPARE(rect1Spy.counts[QEvent::FocusIn], 0); + QCOMPARE(rect1Spy.counts[QEvent::FocusOut], 0); + QCOMPARE(rect2Spy.counts[QEvent::FocusIn], 0); + QCOMPARE(rect2Spy.counts[QEvent::FocusOut], 0); + + // clicking on rect1 should not set it's focus item + sendMouseClick(&scene, QPointF(-25, -25)); + QCOMPARE(rect1->focusItem(), (QGraphicsItem *) 0); + QCOMPARE(rect1Spy.counts[QEvent::FocusIn], 0); + QCOMPARE(rect1Spy.counts[QEvent::FocusOut], 0); + QCOMPARE(rect2Spy.counts[QEvent::FocusIn], 0); + QCOMPARE(rect2Spy.counts[QEvent::FocusOut], 0); + + // clicking on rect2 gives it focus + rect2->setActive(true); + sendMouseClick(&scene, QPointF(75, 75)); + QCOMPARE(scene.focusItem(), (QGraphicsItem *) rect2); + QCOMPARE(rect1Spy.counts[QEvent::FocusIn], 0); + QCOMPARE(rect1Spy.counts[QEvent::FocusOut], 0); + QCOMPARE(rect2Spy.counts[QEvent::FocusIn], 1); + QCOMPARE(rect2Spy.counts[QEvent::FocusOut], 0); + + // clicking on rect1 does *not* give it focus + rect1->setActive(true); + sendMouseClick(&scene, QPointF(-25, -25)); + QCOMPARE(scene.focusItem(), (QGraphicsItem *) 0); + QCOMPARE(rect1Spy.counts[QEvent::FocusIn], 0); + QCOMPARE(rect1Spy.counts[QEvent::FocusOut], 0); + QCOMPARE(rect2Spy.counts[QEvent::FocusIn], 1); + QCOMPARE(rect2Spy.counts[QEvent::FocusOut], 1); + + // focus doesn't change when leaving modality either + rect2->setPanelModality(QGraphicsItem::NonModal); + QCOMPARE(scene.focusItem(), (QGraphicsItem *) 0); + QCOMPARE(rect1Spy.counts[QEvent::FocusIn], 0); + QCOMPARE(rect1Spy.counts[QEvent::FocusOut], 0); + QCOMPARE(rect2Spy.counts[QEvent::FocusIn], 1); + QCOMPARE(rect2Spy.counts[QEvent::FocusOut], 1); + + // click on rect1, it should get focus now + sendMouseClick(&scene, QPointF(-25, -25)); + QCOMPARE(scene.focusItem(), (QGraphicsItem *) rect1); + QCOMPARE(rect1Spy.counts[QEvent::FocusIn], 1); + QCOMPARE(rect1Spy.counts[QEvent::FocusOut], 0); + QCOMPARE(rect2Spy.counts[QEvent::FocusIn], 1); + QCOMPARE(rect2Spy.counts[QEvent::FocusOut], 1); +} + +void tst_QGraphicsItem::modality_keyEvents() +{ + QGraphicsScene scene; + QGraphicsRectItem *rect1 = scene.addRect(-50, -50, 100, 100); + rect1->setFlag(QGraphicsItem::ItemIsPanel); + rect1->setFlag(QGraphicsItem::ItemIsFocusable); + rect1->setData(0, "rect1"); + + QGraphicsRectItem *rect1child = scene.addRect(-10, -10, 20, 20); + rect1child->setParentItem(rect1); + rect1child->setFlag(QGraphicsItem::ItemIsFocusable); + rect1child->setData(0, "rect1child1"); + + QGraphicsRectItem *rect2 = scene.addRect(-50, -50, 100, 100); + rect2->setParentItem(rect1); + rect2->setFlag(QGraphicsItem::ItemIsPanel); + rect2->setFlag(QGraphicsItem::ItemIsFocusable); + rect2->setPos(50, 50); + rect2->setData(0, "rect2"); + + QGraphicsRectItem *rect2child = scene.addRect(-10, -10, 20, 20); + rect2child->setParentItem(rect2); + rect2child->setFlag(QGraphicsItem::ItemIsFocusable); + rect2child->setData(0, "rect2child1"); + + QEvent windowActivateEvent(QEvent::WindowActivate); + QApplication::sendEvent(&scene, &windowActivateEvent); + + EventSpy2 rect1Spy(&scene, rect1); + EventSpy2 rect1childSpy(&scene, rect1child); + EventSpy2 rect2Spy(&scene, rect2); + EventSpy2 rect2childSpy(&scene, rect2child); + + // activate rect1 and give it rect1child focus + rect1->setActive(true); + rect1child->setFocus(); + QCOMPARE(scene.focusItem(), (QGraphicsItem *) rect1child); + + // focus stays on rect1child when rect2 becomes modal + rect2->setPanelModality(QGraphicsItem::SceneModal); + QCOMPARE(scene.focusItem(), (QGraphicsItem *) rect1child); + + // but key events to rect1child should be neither delivered nor propagated + sendKeyClick(&scene, Qt::Key_A); + sendKeyClick(&scene, Qt::Key_S); + sendKeyClick(&scene, Qt::Key_D); + sendKeyClick(&scene, Qt::Key_F); + QCOMPARE(rect1childSpy.counts[QEvent::KeyPress], 0); + QCOMPARE(rect1childSpy.counts[QEvent::KeyRelease], 0); + QCOMPARE(rect1Spy.counts[QEvent::KeyPress], 0); + QCOMPARE(rect1Spy.counts[QEvent::KeyRelease], 0); + + // change to panel modality, rect1child1 keeps focus + rect2->setPanelModality(QGraphicsItem::PanelModal); + QCOMPARE(scene.focusItem(), (QGraphicsItem *) rect1child); + + // still no key events + sendKeyClick(&scene, Qt::Key_J); + sendKeyClick(&scene, Qt::Key_K); + sendKeyClick(&scene, Qt::Key_L); + sendKeyClick(&scene, Qt::Key_Semicolon); + QCOMPARE(rect1childSpy.counts[QEvent::KeyPress], 0); + QCOMPARE(rect1childSpy.counts[QEvent::KeyRelease], 0); + QCOMPARE(rect1Spy.counts[QEvent::KeyPress], 0); + QCOMPARE(rect1Spy.counts[QEvent::KeyRelease], 0); +} + QTEST_MAIN(tst_QGraphicsItem) #include "tst_qgraphicsitem.moc" -- cgit v0.12 From 9c0b1db38f7ad8b6b0d51410033854be72146e74 Mon Sep 17 00:00:00 2001 From: Tom Cooksey Date: Thu, 1 Oct 2009 08:54:02 +0200 Subject: Split EGL config selection & surface creation into seperate functions This is needed to implement render-to-pixmap on x11/EGL, which will also need to create an EGL surface for pixmaps. --- src/gui/image/qpixmap_x11_p.h | 2 + src/gui/image/qpixmapdata_p.h | 1 + src/opengl/qgl_x11egl.cpp | 175 ++++++++++++++++++++++++------------------ 3 files changed, 105 insertions(+), 73 deletions(-) diff --git a/src/gui/image/qpixmap_x11_p.h b/src/gui/image/qpixmap_x11_p.h index ed8678d..e34e690 100644 --- a/src/gui/image/qpixmap_x11_p.h +++ b/src/gui/image/qpixmap_x11_p.h @@ -100,6 +100,8 @@ private: friend class QX11WindowSurface; friend class QRasterWindowSurface; friend class QGLContextPrivate; // Needs to access xinfo, gl_surface & flags + friend class QEglContext; // Needs gl_surface + friend bool qt_createEGLSurfaceForPixmap(QPixmapData*, bool); // Needs gl_surface void release(); diff --git a/src/gui/image/qpixmapdata_p.h b/src/gui/image/qpixmapdata_p.h index 3e85236..c26fba3 100644 --- a/src/gui/image/qpixmapdata_p.h +++ b/src/gui/image/qpixmapdata_p.h @@ -134,6 +134,7 @@ private: friend class QS60PixmapData; friend class QGLTextureCache; //Needs to check the reference count friend class QExplicitlySharedDataPointer; + friend bool qt_createEGLSurfaceForPixmap(QPixmapData*, bool); // Needs to set is_cached QAtomicInt ref; int detach_no; diff --git a/src/opengl/qgl_x11egl.cpp b/src/opengl/qgl_x11egl.cpp index 67f391b..d4bf4da 100644 --- a/src/opengl/qgl_x11egl.cpp +++ b/src/opengl/qgl_x11egl.cpp @@ -408,6 +408,103 @@ void QGLWidgetPrivate::recreateEglSurface(bool force) } } +// Selects which configs should be used +EGLConfig Q_OPENGL_EXPORT qt_chooseEGLConfigForPixmap(bool hasAlpha, bool readOnly) +{ + // Cache the configs we select as they wont change: + static EGLConfig roPixmapRGBConfig = 0; + static EGLConfig roPixmapRGBAConfig = 0; + static EGLConfig rwPixmapRGBConfig = 0; + static EGLConfig rwPixmapRGBAConfig = 0; + + EGLConfig* targetConfig; + + if (hasAlpha) { + if (readOnly) + targetConfig = &roPixmapRGBAConfig; + else + targetConfig = &rwPixmapRGBAConfig; + } + else { + if (readOnly) + targetConfig = &roPixmapRGBConfig; + else + targetConfig = &rwPixmapRGBConfig; + } + + if (*targetConfig == 0) { + QEglProperties configAttribs; + configAttribs.setValue(EGL_SURFACE_TYPE, EGL_PIXMAP_BIT); + configAttribs.setRenderableType(QEgl::OpenGL); + if (hasAlpha) + configAttribs.setValue(EGL_BIND_TO_TEXTURE_RGBA, EGL_TRUE); + else + configAttribs.setValue(EGL_BIND_TO_TEXTURE_RGB, EGL_TRUE); + + // If this is going to be a render target, it needs to have a depth, stencil & sample buffer + if (!readOnly) { + configAttribs.setValue(EGL_DEPTH_SIZE, 1); + configAttribs.setValue(EGL_STENCIL_SIZE, 1); + configAttribs.setValue(EGL_SAMPLE_BUFFERS, 1); + } + + EGLint configCount = 0; + do { + eglChooseConfig(QEglContext::defaultDisplay(0), configAttribs.properties(), targetConfig, 1, &configCount); + if (configCount > 0) { + // Got one + qDebug() << "Found an" << (hasAlpha ? "ARGB" : "RGB") << (readOnly ? "readonly" : "target" ) + << "config (" << int(*targetConfig) << ") to create a pixmap surface:"; + +// QEglProperties configProps(*targetConfig); +// qDebug() << configProps.toString(); + break; + } + qWarning("choosePixmapConfig() - No suitible config found, reducing requirements"); + } while (configAttribs.reduceConfiguration()); + } + + if (*targetConfig == 0) + qWarning("choosePixmapConfig() - Couldn't find a suitable config"); + + return *targetConfig; +} + +bool Q_OPENGL_EXPORT qt_createEGLSurfaceForPixmap(QPixmapData* pmd, bool readOnly) +{ + Q_ASSERT(pmd->classId() == QPixmapData::X11Class); + QX11PixmapData* pixmapData = static_cast(pmd); + + bool hasAlpha = pixmapData->hasAlphaChannel(); + + EGLConfig pixmapConfig = qt_chooseEGLConfigForPixmap(hasAlpha, readOnly); + + QEglProperties pixmapAttribs; + + // If the pixmap can't be bound to a texture, it's pretty useless + pixmapAttribs.setValue(EGL_TEXTURE_TARGET, EGL_TEXTURE_2D); + if (hasAlpha) + pixmapAttribs.setValue(EGL_TEXTURE_FORMAT, EGL_TEXTURE_RGBA); + else + pixmapAttribs.setValue(EGL_TEXTURE_FORMAT, EGL_TEXTURE_RGB); + + EGLSurface pixmapSurface; + pixmapSurface = eglCreatePixmapSurface(QEglContext::defaultDisplay(0), + pixmapConfig, + (EGLNativePixmapType) pixmapData->handle(), + pixmapAttribs.properties()); + if (pixmapSurface == EGL_NO_SURFACE) { + qWarning("Failed to create a pixmap surface using config %d", (int)pixmapConfig); + return false; + } + + Q_ASSERT(sizeof(Qt::HANDLE) >= sizeof(EGLSurface)); // Just to make totally sure! + pixmapData->gl_surface = (Qt::HANDLE)pixmapSurface; + pixmapData->is_cached = true; // Make sure the cleanup hook gets called + + return true; +} + QGLTexture *QGLContextPrivate::bindTextureFromNativePixmap(QPixmapData* pd, const qint64 key, QGLContext::BindOptions options) @@ -449,82 +546,14 @@ QGLTexture *QGLContextPrivate::bindTextureFromNativePixmap(QPixmapData* pd, cons destroyGlSurfaceForPixmap(pixmapData); } - EGLint pixmapAttribs[] = { - EGL_TEXTURE_TARGET, EGL_TEXTURE_2D, - EGL_TEXTURE_FORMAT, hasAlpha ? EGL_TEXTURE_RGBA : EGL_TEXTURE_RGB, - EGL_NONE - }; - Q_ASSERT(sizeof(Qt::HANDLE) >= sizeof(EGLSurface)); // Just to make totally sure! - if (pixmapData->gl_surface == 0) - pixmapData->gl_surface = (Qt::HANDLE)EGL_NO_SURFACE; - EGLSurface pixmapSurface = (EGLSurface)pixmapData->gl_surface; - static EGLConfig pixmapRGBConfig = 0; - static EGLConfig pixmapRGBAConfig = 0; - - // Check to see if we need to find a config - if ((hasAlpha && !pixmapRGBAConfig) || (!hasAlpha && !pixmapRGBConfig) ) { - const EGLint configAttribs[] = { - EGL_SURFACE_TYPE, EGL_PIXMAP_BIT, - EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, - EGL_DEPTH_SIZE, 0, - hasAlpha ? EGL_BIND_TO_TEXTURE_RGBA : EGL_BIND_TO_TEXTURE_RGB, EGL_TRUE, - EGL_NONE - }; - - EGLint configCount = 0; - eglChooseConfig(eglContext->display(), configAttribs, 0, 256, &configCount); - if (configCount == 0) { - haveTFP = false; - qWarning("bindTextureFromNativePixmap() - Couldn't find a suitable config"); - return 0; - } - - EGLConfig *configList = new EGLConfig[configCount]; - eglChooseConfig(eglContext->display(), configAttribs, configList, configCount, &configCount); - Q_ASSERT(configCount); - - // Try to create a pixmap surface for each config until one works - for (int i = 0; i < configCount; ++i) { - pixmapSurface = eglCreatePixmapSurface(eglContext->display(), configList[i], - (EGLNativePixmapType) pixmapData->handle(), - pixmapAttribs); - if (pixmapSurface != EGL_NO_SURFACE) { - // Got one! - qDebug() << "Found an" << (hasAlpha ? "ARGB" : "RGB") - << "config (" << int(configList[i]) << ") to create a pixmap surface"; - if (hasAlpha) - pixmapRGBAConfig = configList[i]; - else - pixmapRGBConfig = configList[i]; - pixmapData->gl_surface = (Qt::HANDLE)pixmapSurface; - break; - } - } - delete configList; - - if ((hasAlpha && !pixmapRGBAConfig) || (!hasAlpha && !pixmapRGBConfig) ) { - qDebug("Couldn't create a pixmap surface with any of the provided configs"); - haveTFP = false; - return 0; - } - } - - if (pixmapSurface == EGL_NO_SURFACE) { - pixmapSurface = eglCreatePixmapSurface(eglContext->display(), - hasAlpha? pixmapRGBAConfig : pixmapRGBConfig, - (EGLNativePixmapType) pixmapData->handle(), - pixmapAttribs); - if (pixmapSurface == EGL_NO_SURFACE) { - qWarning("Failed to create a pixmap surface using config %d", - (int)(hasAlpha? pixmapRGBAConfig : pixmapRGBConfig)); + if (pixmapData->gl_surface == 0) { + bool success = qt_createEGLSurfaceForPixmap(pixmapData, true); + if (!success) { haveTFP = false; return 0; } - pixmapData->gl_surface = (Qt::HANDLE)pixmapSurface; } - // Make sure the cleanup hook gets called so we can delete the glx pixmap - pixmapData->is_cached = true; Q_ASSERT(pixmapData->gl_surface); GLuint textureId; @@ -534,10 +563,10 @@ QGLTexture *QGLContextPrivate::bindTextureFromNativePixmap(QPixmapData* pd, cons // bind the egl pixmap surface to a texture EGLBoolean success; - success = eglBindTexImage(eglContext->display(), pixmapSurface, EGL_BACK_BUFFER); + success = eglBindTexImage(eglContext->display(), (EGLSurface)pixmapData->gl_surface, EGL_BACK_BUFFER); if (success == EGL_FALSE) { qWarning() << "eglBindTexImage() failed:" << eglContext->errorString(eglGetError()); - eglDestroySurface(eglContext->display(), pixmapSurface); + eglDestroySurface(eglContext->display(), (EGLSurface)pixmapData->gl_surface); pixmapData->gl_surface = (Qt::HANDLE)EGL_NO_SURFACE; haveTFP = false; return 0; -- cgit v0.12 From d6cb9ed0b44118c7f9045559a300ea14985f0103 Mon Sep 17 00:00:00 2001 From: Thierry Bastian Date: Wed, 30 Sep 2009 15:55:29 +0200 Subject: Fix warnings on mingw Reviewed-by: trust me --- src/gui/kernel/qsoftkeymanager.cpp | 1 + src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp | 1 + src/svg/qsvghandler.cpp | 2 ++ src/xmlpatterns/functions/qsequencefns_p.h | 4 ++-- 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/gui/kernel/qsoftkeymanager.cpp b/src/gui/kernel/qsoftkeymanager.cpp index 45695d9..265f971 100644 --- a/src/gui/kernel/qsoftkeymanager.cpp +++ b/src/gui/kernel/qsoftkeymanager.cpp @@ -121,6 +121,7 @@ QAction *QSoftKeyManager::createAction(StandardSoftKey standardKey, QWidget *act softKeyRole = QAction::PositiveSoftKey; break; case CancelSoftKey: + default: softKeyRole = QAction::NegativeSoftKey; break; } diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp index 7e45fd9..f612bc0 100644 --- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp +++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp @@ -1452,6 +1452,7 @@ bool QGL2PaintEngineEx::begin(QPaintDevice *pdev) #if !defined(QT_OPENGL_ES_2) bool success = qt_resolve_version_2_0_functions(d->ctx); Q_ASSERT(success); + Q_UNUSED(success); #endif d->shaderManager = new QGLEngineShaderManager(d->ctx); diff --git a/src/svg/qsvghandler.cpp b/src/svg/qsvghandler.cpp index a6e4855..6d2a0f9 100644 --- a/src/svg/qsvghandler.cpp +++ b/src/svg/qsvghandler.cpp @@ -3551,6 +3551,8 @@ void QSvgHandler::parse() case QXmlStreamReader::ProcessingInstruction: processingInstruction(xml->processingInstructionTarget().toString(), xml->processingInstructionData().toString()); break; + default: + break; } } resolveGradients(m_doc); diff --git a/src/xmlpatterns/functions/qsequencefns_p.h b/src/xmlpatterns/functions/qsequencefns_p.h index a9a1765..e406b95 100644 --- a/src/xmlpatterns/functions/qsequencefns_p.h +++ b/src/xmlpatterns/functions/qsequencefns_p.h @@ -148,8 +148,8 @@ namespace QPatternist { // RVCT doesn't like using template parameter in trinary operator when the trinary operator result is // passed directly into another constructor. - bool tempAssert = (Id == IDExistsFN || Id == IDEmptyFN); - Q_ASSERT(tempAssert); + Q_ASSERT(Id == IDExistsFN || Id == IDEmptyFN); + const Expression::Ptr me(FunctionCall::compress(context)); -- cgit v0.12 From e58293b3b0cb4664efca10229ae2e6556185e8a7 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Thu, 1 Oct 2009 10:32:08 +0200 Subject: Compilation with pedantic or when QtCore is not specified in the include path Note that i also removed the #error since the enum is already updated in master Reviewed-by: Gabi --- src/corelib/io/qdatastream.h | 6 +----- src/gui/s60framework/qs60mainappui.h | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/corelib/io/qdatastream.h b/src/corelib/io/qdatastream.h index 6e83204..7cf22f2 100644 --- a/src/corelib/io/qdatastream.h +++ b/src/corelib/io/qdatastream.h @@ -84,11 +84,7 @@ public: Qt_4_3 = 9, Qt_4_4 = 10, Qt_4_5 = 11, - Qt_4_6 = 12, -#if QT_VERSION >= 0x040700 -#error Add the datastream version for this Qt version - Qt_4_7 = Qt_4_6 -#endif + Qt_4_6 = 12 }; enum ByteOrder { diff --git a/src/gui/s60framework/qs60mainappui.h b/src/gui/s60framework/qs60mainappui.h index c2c6ef2..321d8d6 100644 --- a/src/gui/s60framework/qs60mainappui.h +++ b/src/gui/s60framework/qs60mainappui.h @@ -42,7 +42,7 @@ #ifndef QS60MAINAPPUI_H #define QS60MAINAPPUI_H -#include +#include #ifdef Q_WS_S60 -- cgit v0.12 From 9c34f75dedddea2e84432dc6f173389a1814d0f9 Mon Sep 17 00:00:00 2001 From: Alexis Menard Date: Thu, 1 Oct 2009 10:37:44 +0200 Subject: Make this test pass on Windows. Calling rm on . remove the dir on Windows. Reviewed-by:TrustMe --- tests/auto/qfilesystemmodel/tst_qfilesystemmodel.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/auto/qfilesystemmodel/tst_qfilesystemmodel.cpp b/tests/auto/qfilesystemmodel/tst_qfilesystemmodel.cpp index ea9304d..2cc2558 100644 --- a/tests/auto/qfilesystemmodel/tst_qfilesystemmodel.cpp +++ b/tests/auto/qfilesystemmodel/tst_qfilesystemmodel.cpp @@ -806,7 +806,10 @@ void tst_QFileSystemModel::sort() QDir dir(QDir::tempPath()); dir.mkdir("sortTemp"); dir.cd("sortTemp"); - QDirIterator it(dir); + QTRY_VERIFY(dir.exists()); + + //To be sure we clean the dir if it was there before + QDirIterator it(dir.absolutePath(), QDir::NoDotAndDotDot); while(it.hasNext()) { it.next(); -- cgit v0.12 From f289576105f2c560d23d91d4078b832bbd19dc70 Mon Sep 17 00:00:00 2001 From: Peter Hartmann Date: Thu, 1 Oct 2009 10:37:15 +0200 Subject: Threaded Fortune server example: fix displayed IP listen to the first non-local IPv4 address found, as in commit 5e3775ae4c5263a25e63868e8a3f16244e4dde02 Reviewed-by: Aleksandar Babic --- examples/network/fortuneserver/server.cpp | 2 +- examples/network/threadedfortuneserver/dialog.cpp | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/examples/network/fortuneserver/server.cpp b/examples/network/fortuneserver/server.cpp index 016fa78..52b7d61 100644 --- a/examples/network/fortuneserver/server.cpp +++ b/examples/network/fortuneserver/server.cpp @@ -74,7 +74,7 @@ Server::Server(QWidget *parent) // if we did not find one, use IPv4 localhost if (ipAddress.isEmpty()) ipAddress = QHostAddress(QHostAddress::LocalHost).toString(); - statusLabel->setText(tr("The server is running on\nIP: \n%1 port:\n%2\n" + statusLabel->setText(tr("The server is running on\n\nIP: %1\nport: %2\n\n" "Run the Fortune Client example now.") .arg(ipAddress).arg(tcpServer->serverPort())); //! [1] diff --git a/examples/network/threadedfortuneserver/dialog.cpp b/examples/network/threadedfortuneserver/dialog.cpp index 51ae0d3..b1ea395 100644 --- a/examples/network/threadedfortuneserver/dialog.cpp +++ b/examples/network/threadedfortuneserver/dialog.cpp @@ -62,9 +62,20 @@ Dialog::Dialog(QWidget *parent) return; } - statusLabel->setText(tr("The server is running on port %1.\n" + QString ipAddress; + QList ipAddressesList = QNetworkInterface::allAddresses(); + // use the first non-localhost IPv4 address + for (int i = 0; i < ipAddressesList.size(); ++i) { + if (ipAddressesList.at(i) != QHostAddress::LocalHost && + ipAddressesList.at(i).toIPv4Address()) + ipAddress = ipAddressesList.at(i).toString(); + } + // if we did not find one, use IPv4 localhost + if (ipAddress.isEmpty()) + ipAddress = QHostAddress(QHostAddress::LocalHost).toString(); + statusLabel->setText(tr("The server is running on\n\nIP: %1\nport: %2\n\n" "Run the Fortune Client example now.") - .arg(server.serverPort())); + .arg(ipAddress).arg(server.serverPort())); connect(quitButton, SIGNAL(clicked()), this, SLOT(close())); -- cgit v0.12 From 9a5442b732592f2ed474e705b7ea29776d96a83b Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Thu, 1 Oct 2009 10:38:35 +0200 Subject: Compile if QtCore is not in the include path when one includes --- src/gui/s60framework/qs60maindocument.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/s60framework/qs60maindocument.h b/src/gui/s60framework/qs60maindocument.h index 366d311..1327349 100644 --- a/src/gui/s60framework/qs60maindocument.h +++ b/src/gui/s60framework/qs60maindocument.h @@ -42,7 +42,7 @@ #ifndef QS60MAINDOCUMENT_H #define QS60MAINDOCUMENT_H -#include +#include #ifdef Q_WS_S60 -- cgit v0.12 From f0183775d1575a4537bed8c10e9c757ffa66fe03 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Thu, 1 Oct 2009 10:43:09 +0200 Subject: Fix the compilerwarning test on GCC Don't issue this warning: comparing floating point with == or != is unsafe There is many of them and the Qt code is correct (it has to be fast comparison to know if fast code path must be taken) Reviewed-by: Jeremy --- tests/auto/compilerwarnings/tst_compilerwarnings.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/auto/compilerwarnings/tst_compilerwarnings.cpp b/tests/auto/compilerwarnings/tst_compilerwarnings.cpp index 907aade..0be5cb0 100644 --- a/tests/auto/compilerwarnings/tst_compilerwarnings.cpp +++ b/tests/auto/compilerwarnings/tst_compilerwarnings.cpp @@ -179,7 +179,6 @@ void tst_CompilerWarnings::warnings() << "-Wno-long-long" << "-Wshadow" << "-Wpacked" << "-Wunreachable-code" << "-Wundef" << "-Wchar-subscripts" << "-Wformat-nonliteral" << "-Wformat-security" << "-Wcast-align" - << "-Wfloat-equal" << "-o" << tmpFile << tmpSourceFile; #elif defined(Q_CC_XLC) -- cgit v0.12 From fafd16474aee5bbf47ee37e1ba739f3b3ceb9c33 Mon Sep 17 00:00:00 2001 From: Jani Hautakangas Date: Thu, 1 Oct 2009 11:30:20 +0300 Subject: Fix for Symbian window activation/focus problem. When dialog is shown on top of a top level window, the focus does not get back to top level window when dialog is closed. This is a fix for that. Reviewed-by: Shane Kearns --- src/gui/kernel/qwidget_s60.cpp | 59 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp index 05db8ca..6ba693c 100644 --- a/src/gui/kernel/qwidget_s60.cpp +++ b/src/gui/kernel/qwidget_s60.cpp @@ -490,6 +490,65 @@ void QWidgetPrivate::setFocus_sys() static_cast(q->effectiveWinId())->setFocusSafely(true); } +void QWidgetPrivate::handleSymbianDeferredFocusChanged() +{ + Q_Q(QWidget); + WId control = q->internalWinId(); + + if (!control) { + // This could happen if the widget was reparented, while the focuschange + // was in the event queue. + return; + } + + if (control->IsFocused()) { + QApplication::setActiveWindow(q); +#ifdef Q_WS_S60 + // If widget is fullscreen, hide status pane and button container + // otherwise show them. + CEikStatusPane* statusPane = S60->statusPane(); + CEikButtonGroupContainer* buttonGroup = S60->buttonGroupContainer(); + bool isFullscreen = q->windowState() & Qt::WindowFullScreen; + if (statusPane && (statusPane->IsVisible() == isFullscreen)) + statusPane->MakeVisible(!isFullscreen); + if (buttonGroup && (buttonGroup->IsVisible() == isFullscreen)) + buttonGroup->MakeVisible(!isFullscreen); +#endif + } else { + + QWidget *nextActiveWindow = 0; + + if (q->isWindow()) { + + // Try to activate possible parent window first. + QWidget *parent = q->parentWidget(); + if(parent + && parent->isWindow() + && parent->isVisible() + && !parent->isActiveWindow()) { + + nextActiveWindow = parent; + } else { + // Activate next possible top level window. + QWidgetList topLevelWidgets = QApplication::topLevelWidgets(); + for (int i = 0; i < topLevelWidgets.size(); ++i) { + QWidget *w = topLevelWidgets.at(i); + if (w != q && w->isVisible() && !w->isActiveWindow()) { + nextActiveWindow = w; + break; + } + } + } + + if (nextActiveWindow) + nextActiveWindow->activateWindow(); + } + + QApplication::setActiveWindow(nextActiveWindow); + } +>>>>>>> Fix for Symbian window activation/focus problem.:src/gui/kernel/qwidget_s60.cpp +} + void QWidgetPrivate::raise_sys() { Q_Q(QWidget); -- cgit v0.12 From c7e91e208642d3ddea5d69142c978310b289ba88 Mon Sep 17 00:00:00 2001 From: Jani Hautakangas Date: Thu, 1 Oct 2009 12:23:11 +0300 Subject: Revert "Fix for Symbian window activation/focus problem." This reverts commit fafd16474aee5bbf47ee37e1ba739f3b3ceb9c33. --- src/gui/kernel/qwidget_s60.cpp | 59 ------------------------------------------ 1 file changed, 59 deletions(-) diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp index 6ba693c..05db8ca 100644 --- a/src/gui/kernel/qwidget_s60.cpp +++ b/src/gui/kernel/qwidget_s60.cpp @@ -490,65 +490,6 @@ void QWidgetPrivate::setFocus_sys() static_cast(q->effectiveWinId())->setFocusSafely(true); } -void QWidgetPrivate::handleSymbianDeferredFocusChanged() -{ - Q_Q(QWidget); - WId control = q->internalWinId(); - - if (!control) { - // This could happen if the widget was reparented, while the focuschange - // was in the event queue. - return; - } - - if (control->IsFocused()) { - QApplication::setActiveWindow(q); -#ifdef Q_WS_S60 - // If widget is fullscreen, hide status pane and button container - // otherwise show them. - CEikStatusPane* statusPane = S60->statusPane(); - CEikButtonGroupContainer* buttonGroup = S60->buttonGroupContainer(); - bool isFullscreen = q->windowState() & Qt::WindowFullScreen; - if (statusPane && (statusPane->IsVisible() == isFullscreen)) - statusPane->MakeVisible(!isFullscreen); - if (buttonGroup && (buttonGroup->IsVisible() == isFullscreen)) - buttonGroup->MakeVisible(!isFullscreen); -#endif - } else { - - QWidget *nextActiveWindow = 0; - - if (q->isWindow()) { - - // Try to activate possible parent window first. - QWidget *parent = q->parentWidget(); - if(parent - && parent->isWindow() - && parent->isVisible() - && !parent->isActiveWindow()) { - - nextActiveWindow = parent; - } else { - // Activate next possible top level window. - QWidgetList topLevelWidgets = QApplication::topLevelWidgets(); - for (int i = 0; i < topLevelWidgets.size(); ++i) { - QWidget *w = topLevelWidgets.at(i); - if (w != q && w->isVisible() && !w->isActiveWindow()) { - nextActiveWindow = w; - break; - } - } - } - - if (nextActiveWindow) - nextActiveWindow->activateWindow(); - } - - QApplication::setActiveWindow(nextActiveWindow); - } ->>>>>>> Fix for Symbian window activation/focus problem.:src/gui/kernel/qwidget_s60.cpp -} - void QWidgetPrivate::raise_sys() { Q_Q(QWidget); -- cgit v0.12 From 686cf8fdaf7fa762a125443fb6ed7913ce2fb93b Mon Sep 17 00:00:00 2001 From: Frans Englich Date: Thu, 1 Oct 2009 11:14:55 +0200 Subject: Silence compiler warning. --- src/xmlpatterns/type/qanytype.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/xmlpatterns/type/qanytype.cpp b/src/xmlpatterns/type/qanytype.cpp index cb9ef37..8966220 100644 --- a/src/xmlpatterns/type/qanytype.cpp +++ b/src/xmlpatterns/type/qanytype.cpp @@ -69,7 +69,7 @@ QXmlName AnyType::name(const NamePool::Ptr &np) const return np->allocateQName(StandardNamespaces::xs, QLatin1String("anyType")); } -QString AnyType::displayName(const NamePool::Ptr &np) const +QString AnyType::displayName(const NamePool::Ptr &) const { /* A bit faster than calling name()->displayName() */ return QLatin1String("xs:anyType"); -- cgit v0.12 From 4b3e0adec89e2d0ce4024d764e7856a077302e28 Mon Sep 17 00:00:00 2001 From: Frans Englich Date: Thu, 1 Oct 2009 11:16:20 +0200 Subject: Fix translation strings. This change cleans up schema translation comments by having customary copy editing for sentences: starts with a capital letter and ends with a full stop. Pointed out by Friedemann. Reviewed-by: Friedemann Kleint --- src/xmlpatterns/schema/qxsdparticlechecker.cpp | 28 +-- src/xmlpatterns/schema/qxsdschemachecker.cpp | 206 ++++++++++----------- src/xmlpatterns/schema/qxsdschemahelper.cpp | 26 +-- src/xmlpatterns/schema/qxsdschemaparser.cpp | 148 +++++++-------- src/xmlpatterns/schema/qxsdschemaresolver.cpp | 72 +++---- src/xmlpatterns/schema/qxsdtypechecker.cpp | 118 ++++++------ .../schema/qxsdvalidatinginstancereader.cpp | 100 +++++----- 7 files changed, 349 insertions(+), 349 deletions(-) diff --git a/src/xmlpatterns/schema/qxsdparticlechecker.cpp b/src/xmlpatterns/schema/qxsdparticlechecker.cpp index 64e995e..3fdfb33 100644 --- a/src/xmlpatterns/schema/qxsdparticlechecker.cpp +++ b/src/xmlpatterns/schema/qxsdparticlechecker.cpp @@ -162,7 +162,7 @@ static bool derivedTermValid(const XsdTerm::Ptr &baseTerm, const XsdTerm::Ptr &d // check that an empty particle can not be derived from a non-empty particle if (derivedParticle && baseParticle) { if (XsdSchemaHelper::isParticleEmptiable(derivedParticle) && !XsdSchemaHelper::isParticleEmptiable(baseParticle)) { - errorMsg = QtXmlPatterns::tr("empty particle cannot be derived from non-empty particle"); + errorMsg = QtXmlPatterns::tr("Empty particle cannot be derived from non-empty particle."); return false; } } @@ -177,33 +177,33 @@ static bool derivedTermValid(const XsdTerm::Ptr &baseTerm, const XsdTerm::Ptr &d // check names are equal if (element->name(namePool) != derivedElement->name(namePool)) { - errorMsg = QtXmlPatterns::tr("derived particle is missing element %1").arg(formatKeyword(element->displayName(namePool))); + errorMsg = QtXmlPatterns::tr("Derived particle is missing element %1.").arg(formatKeyword(element->displayName(namePool))); return false; } // check value constraints are equal (if available) if (element->valueConstraint() && element->valueConstraint()->variety() == XsdElement::ValueConstraint::Fixed) { if (!derivedElement->valueConstraint()) { - errorMsg = QtXmlPatterns::tr("derived element %1 is missing value constraint as defined in base particle").arg(formatKeyword(derivedElement->displayName(namePool))); + errorMsg = QtXmlPatterns::tr("Derived element %1 is missing value constraint as defined in base particle.").arg(formatKeyword(derivedElement->displayName(namePool))); return false; } if (derivedElement->valueConstraint()->variety() != XsdElement::ValueConstraint::Fixed) { - errorMsg = QtXmlPatterns::tr("derived element %1 has weaker value constraint than base particle").arg(formatKeyword(derivedElement->displayName(namePool))); + errorMsg = QtXmlPatterns::tr("Derived element %1 has weaker value constraint than base particle.").arg(formatKeyword(derivedElement->displayName(namePool))); return false; } const QSourceLocation dummyLocation(QUrl(QLatin1String("http://dummy.org")), 1, 1); const XsdTypeChecker checker(context, QVector(), dummyLocation); if (!checker.valuesAreEqual(element->valueConstraint()->value(), derivedElement->valueConstraint()->value(), derivedElement->type())) { - errorMsg = QtXmlPatterns::tr("fixed value constraint of element %1 differs from value constraint in base particle").arg(formatKeyword(derivedElement->displayName(namePool))); + errorMsg = QtXmlPatterns::tr("Fixed value constraint of element %1 differs from value constraint in base particle.").arg(formatKeyword(derivedElement->displayName(namePool))); return false; } } // check that a derived element can not be nillable if the base element is not nillable if (!element->isNillable() && derivedElement->isNillable()) { - errorMsg = QtXmlPatterns::tr("derived element %1 cannot be nillable as base element is not nillable").arg(formatKeyword(derivedElement->displayName(namePool))); + errorMsg = QtXmlPatterns::tr("Derived element %1 cannot be nillable as base element is not nillable.").arg(formatKeyword(derivedElement->displayName(namePool))); return false; } @@ -213,7 +213,7 @@ static bool derivedTermValid(const XsdTerm::Ptr &baseTerm, const XsdTerm::Ptr &d if (((baseConstraints & XsdElement::RestrictionConstraint) && !(derivedConstraints & XsdElement::RestrictionConstraint)) || ((baseConstraints & XsdElement::ExtensionConstraint) && !(derivedConstraints & XsdElement::ExtensionConstraint)) || ((baseConstraints & XsdElement::SubstitutionConstraint) && !(derivedConstraints & XsdElement::SubstitutionConstraint))) { - errorMsg = QtXmlPatterns::tr("block constraints of derived element %1 must not be more weaker than in the base element").arg(formatKeyword(derivedElement->displayName(namePool))); + errorMsg = QtXmlPatterns::tr("Block constraints of derived element %1 must not be more weaker than in the base element.").arg(formatKeyword(derivedElement->displayName(namePool))); return false; } @@ -224,12 +224,12 @@ static bool derivedTermValid(const XsdTerm::Ptr &baseTerm, const XsdTerm::Ptr &d // check that the type of the derived element can validly derived from the type of the base element if (derivedElement->type()->isSimpleType()) { if (!XsdSchemaHelper::isSimpleDerivationOk(derivedElement->type(), element->type(), SchemaType::DerivationConstraints())) { - errorMsg = QtXmlPatterns::tr("simple type of derived element %1 cannot be validly derived from base element").arg(formatKeyword(derivedElement->displayName(namePool))); + errorMsg = QtXmlPatterns::tr("Simple type of derived element %1 cannot be validly derived from base element.").arg(formatKeyword(derivedElement->displayName(namePool))); return false; } } else if (derivedElement->type()->isComplexType()) { if (!XsdSchemaHelper::isComplexDerivationOk(derivedElement->type(), element->type(), SchemaType::DerivationConstraints())) { - errorMsg = QtXmlPatterns::tr("complex type of derived element %1 cannot be validly derived from base element").arg(formatKeyword(derivedElement->displayName(namePool))); + errorMsg = QtXmlPatterns::tr("Complex type of derived element %1 cannot be validly derived from base element.").arg(formatKeyword(derivedElement->displayName(namePool))); return false; } } @@ -253,7 +253,7 @@ static bool derivedTermValid(const XsdTerm::Ptr &baseTerm, const XsdTerm::Ptr &d return true; } else if (derivedTerm->isWildcard()) { // derive a wildcard from an element is not allowed - errorMsg = QtXmlPatterns::tr("element %1 is missing in derived particle").arg(formatKeyword(element->displayName(namePool))); + errorMsg = QtXmlPatterns::tr("Element %1 is missing in derived particle.").arg(formatKeyword(element->displayName(namePool))); return false; } } else if (baseTerm->isWildcard()) { @@ -271,7 +271,7 @@ static bool derivedTermValid(const XsdTerm::Ptr &baseTerm, const XsdTerm::Ptr &d // check that name of the element is allowed by the wildcards namespace constraint if (!XsdSchemaHelper::wildcardAllowsExpandedName(name, wildcard, namePool)) { - errorMsg = QtXmlPatterns::tr("element %1 does not match namespace constraint of wildcard in base particle").arg(formatKeyword(derivedElement->displayName(namePool))); + errorMsg = QtXmlPatterns::tr("Element %1 does not match namespace constraint of wildcard in base particle.").arg(formatKeyword(derivedElement->displayName(namePool))); return false; } @@ -282,12 +282,12 @@ static bool derivedTermValid(const XsdTerm::Ptr &baseTerm, const XsdTerm::Ptr &d // check that the derived wildcard is a valid subset of the base wildcard if (!XsdSchemaHelper::isWildcardSubset(derivedWildcard, wildcard)) { - errorMsg = QtXmlPatterns::tr("wildcard in derived particle is not a valid subset of wildcard in base particle"); + errorMsg = QtXmlPatterns::tr("Wildcard in derived particle is not a valid subset of wildcard in base particle."); return false; } if (!XsdSchemaHelper::checkWildcardProcessContents(wildcard, derivedWildcard)) { - errorMsg = QtXmlPatterns::tr("processContent of wildcard in derived particle is weaker than wildcard in base particle"); + errorMsg = QtXmlPatterns::tr("processContent of wildcard in derived particle is weaker than wildcard in base particle."); return false; } } @@ -527,7 +527,7 @@ bool XsdParticleChecker::subsumes(const XsdParticle::Ptr &particle, const XsdPar if (processedSet.at(i).second == it.key() && (baseStates.value(processedSet.at(i).first) != XsdStateMachine::EndState && baseStates.value(processedSet.at(i).first) != XsdStateMachine::StartEndState)) { - errorMsg = QtXmlPatterns::tr("derived particle allows content that is not allowed in the base particle"); + errorMsg = QtXmlPatterns::tr("Derived particle allows content that is not allowed in the base particle."); return false; } } diff --git a/src/xmlpatterns/schema/qxsdschemachecker.cpp b/src/xmlpatterns/schema/qxsdschemachecker.cpp index fc62ebb..dde72f5 100644 --- a/src/xmlpatterns/schema/qxsdschemachecker.cpp +++ b/src/xmlpatterns/schema/qxsdschemachecker.cpp @@ -224,12 +224,12 @@ void XsdSchemaChecker::checkBasicCircularInheritances() if (wxsTypeMatches(type, type->wxsSuperType(), visitedTypes, conflictingType)) { if (conflictingType) - m_context->error(QtXmlPatterns::tr("%1 has inheritance loop in its base type %2") + m_context->error(QtXmlPatterns::tr("%1 has inheritance loop in its base type %2.") .arg(formatType(m_namePool, type)) .arg(formatType(m_namePool, conflictingType)), XsdSchemaContext::XSDError, location); else - m_context->error(QtXmlPatterns::tr("circular inheritance of base type %1").arg(formatType(m_namePool, type)), XsdSchemaContext::XSDError, location); + m_context->error(QtXmlPatterns::tr("Circular inheritance of base type %1.").arg(formatType(m_namePool, type)), XsdSchemaContext::XSDError, location); return; } @@ -253,7 +253,7 @@ void XsdSchemaChecker::checkCircularInheritances() // check normal base type inheritance QSet visitedTypes; if (matchesType(type, type->wxsSuperType(), visitedTypes)) { - m_context->error(QtXmlPatterns::tr("circular inheritance of base type %1").arg(formatType(m_namePool, type)), XsdSchemaContext::XSDError, location); + m_context->error(QtXmlPatterns::tr("Circular inheritance of base type %1.").arg(formatType(m_namePool, type)), XsdSchemaContext::XSDError, location); return; } @@ -264,7 +264,7 @@ void XsdSchemaChecker::checkCircularInheritances() const XsdSimpleType::List memberTypes = simpleType->memberTypes(); for (int j = 0; j < memberTypes.count(); ++j) { if (hasCircularUnionInheritance(simpleType, memberTypes.at(j), m_namePool)) { - m_context->error(QtXmlPatterns::tr("circular inheritance of union %1").arg(formatType(m_namePool, type)), XsdSchemaContext::XSDError, location); + m_context->error(QtXmlPatterns::tr("Circular inheritance of union %1.").arg(formatType(m_namePool, type)), XsdSchemaContext::XSDError, location); return; } } @@ -289,12 +289,12 @@ void XsdSchemaChecker::checkInheritanceRestrictions() const SchemaType::Ptr baseType = type->wxsSuperType(); if (baseType->isDefinedBySchema()) { if ((type->derivationMethod() == SchemaType::DerivationRestriction) && (baseType->derivationConstraints() & SchemaType::RestrictionConstraint)) { - m_context->error(QtXmlPatterns::tr("%1 is not allowed to derive from %2 by restriction as the latter defines it as final") + m_context->error(QtXmlPatterns::tr("%1 is not allowed to derive from %2 by restriction as the latter defines it as final.") .arg(formatType(m_namePool, type)) .arg(formatType(m_namePool, baseType)), XsdSchemaContext::XSDError, location); return; } else if ((type->derivationMethod() == SchemaType::DerivationExtension) && (baseType->derivationConstraints() & SchemaType::ExtensionConstraint)) { - m_context->error(QtXmlPatterns::tr("%1 is not allowed to derive from %2 by extension as the latter defines it as final") + m_context->error(QtXmlPatterns::tr("%1 is not allowed to derive from %2 by extension as the latter defines it as final.") .arg(formatType(m_namePool, type)) .arg(formatType(m_namePool, baseType)), XsdSchemaContext::XSDError, location); return; @@ -325,7 +325,7 @@ void XsdSchemaChecker::checkBasicSimpleTypeConstraints() const SchemaType::Ptr baseType = simpleType->wxsSuperType(); if (baseType->isComplexType() && (simpleType->name(m_namePool) != BuiltinTypes::xsAnySimpleType->name(m_namePool))) { - m_context->error(QtXmlPatterns::tr("base type of simple type %1 cannot be complex type %2") + m_context->error(QtXmlPatterns::tr("Base type of simple type %1 cannot be complex type %2.") .arg(formatType(m_namePool, simpleType)) .arg(formatType(m_namePool, baseType)), XsdSchemaContext::XSDError, location); @@ -334,7 +334,7 @@ void XsdSchemaChecker::checkBasicSimpleTypeConstraints() if (baseType == BuiltinTypes::xsAnyType) { if (type->name(m_namePool) != BuiltinTypes::xsAnySimpleType->name(m_namePool)) { - m_context->error(QtXmlPatterns::tr("simple type %1 cannot have direct base type %2") + m_context->error(QtXmlPatterns::tr("Simple type %1 cannot have direct base type %2.") .arg(formatType(m_namePool, simpleType)) .arg(formatType(m_namePool, BuiltinTypes::xsAnyType)), XsdSchemaContext::XSDError, location); @@ -367,7 +367,7 @@ void XsdSchemaChecker::checkSimpleTypeConstraints() // check that no user defined type has xs:AnySimpleType as base type (except xs:AnyAtomicType) if (simpleType->wxsSuperType()->name(m_namePool) == BuiltinTypes::xsAnySimpleType->name(m_namePool)) { if (simpleType->name(m_namePool) != BuiltinTypes::xsAnyAtomicType->name(m_namePool)) { - m_context->error(QtXmlPatterns::tr("simple type %1 is not allowed to have base type %2") + m_context->error(QtXmlPatterns::tr("Simple type %1 is not allowed to have base type %2.") .arg(formatType(m_namePool, simpleType)) .arg(formatType(m_namePool, simpleType->wxsSuperType())), XsdSchemaContext::XSDError, location); @@ -376,7 +376,7 @@ void XsdSchemaChecker::checkSimpleTypeConstraints() } // check that no user defined type has xs:AnyAtomicType as base type if (simpleType->wxsSuperType()->name(m_namePool) == BuiltinTypes::xsAnyAtomicType->name(m_namePool)) { - m_context->error(QtXmlPatterns::tr("simple type %1 is not allowed to have base type %2") + m_context->error(QtXmlPatterns::tr("Simple type %1 is not allowed to have base type %2.") .arg(formatType(m_namePool, simpleType)) .arg(formatType(m_namePool, simpleType->wxsSuperType())), XsdSchemaContext::XSDError, location); @@ -388,13 +388,13 @@ void XsdSchemaChecker::checkSimpleTypeConstraints() if (simpleType->category() == XsdSimpleType::SimpleTypeAtomic) { // 1.1 if ((simpleType->wxsSuperType()->category() != XsdSimpleType::SimpleTypeAtomic) && (simpleType->name(m_namePool) != BuiltinTypes::xsAnyAtomicType->name(m_namePool))) { - m_context->error(QtXmlPatterns::tr("simple type %1 can only have simple atomic type as base type") + m_context->error(QtXmlPatterns::tr("Simple type %1 can only have simple atomic type as base type.") .arg(formatType(m_namePool, simpleType)), XsdSchemaContext::XSDError, location); } // 1.2 if (simpleType->wxsSuperType()->derivationConstraints() & SchemaType::RestrictionConstraint) { - m_context->error(QtXmlPatterns::tr("simple type %1 cannot derive from %2 as the latter defines restriction as final") + m_context->error(QtXmlPatterns::tr("Simple type %1 cannot derive from %2 as the latter defines restriction as final.") .arg(formatType(m_namePool, simpleType->wxsSuperType())) .arg(formatType(m_namePool, simpleType)), XsdSchemaContext::XSDError, location); @@ -407,7 +407,7 @@ void XsdSchemaChecker::checkSimpleTypeConstraints() // 2.1 or @see http://www.w3.org/TR/xmlschema-2/#cos-list-of-atomic if (itemType->category() != SchemaType::SimpleTypeAtomic && itemType->category() != SchemaType::SimpleTypeUnion) { - m_context->error(QtXmlPatterns::tr("variety of item type of %1 must be either atomic or union").arg(formatType(m_namePool, simpleType)), XsdSchemaContext::XSDError, location); + m_context->error(QtXmlPatterns::tr("Variety of item type of %1 must be either atomic or union.").arg(formatType(m_namePool, simpleType)), XsdSchemaContext::XSDError, location); return; } @@ -417,7 +417,7 @@ void XsdSchemaChecker::checkSimpleTypeConstraints() const AnySimpleType::List memberTypes = simpleItemType->memberTypes(); for (int j = 0; j < memberTypes.count(); ++j) { if (memberTypes.at(j)->category() != SchemaType::SimpleTypeAtomic) { - m_context->error(QtXmlPatterns::tr("variety of member types of %1 must be atomic").arg(formatType(m_namePool, simpleItemType)), XsdSchemaContext::XSDError, location); + m_context->error(QtXmlPatterns::tr("Variety of member types of %1 must be atomic.").arg(formatType(m_namePool, simpleItemType)), XsdSchemaContext::XSDError, location); return; } } @@ -430,7 +430,7 @@ void XsdSchemaChecker::checkSimpleTypeConstraints() // 2.2.1.1 if (simpleItemType->derivationConstraints() & XsdSimpleType::ListConstraint) { - m_context->error(QtXmlPatterns::tr("%1 is not allowed to derive from %2 by list as the latter defines it as final") + m_context->error(QtXmlPatterns::tr("%1 is not allowed to derive from %2 by list as the latter defines it as final.") .arg(formatType(m_namePool, simpleType)) .arg(formatType(m_namePool, simpleItemType)), XsdSchemaContext::XSDError, location); return; @@ -450,7 +450,7 @@ void XsdSchemaChecker::checkSimpleTypeConstraints() } if (invalidFacetFound) { - m_context->error(QtXmlPatterns::tr("simple type %1 is only allowed to have %2 facet") + m_context->error(QtXmlPatterns::tr("Simple type %1 is only allowed to have %2 facet.") .arg(formatType(m_namePool, simpleType)) .arg(formatKeyword("whiteSpace")), XsdSchemaContext::XSDError, location); @@ -460,19 +460,19 @@ void XsdSchemaChecker::checkSimpleTypeConstraints() } else { // 2.2.2 // 2.2.2.1 if (simpleType->wxsSuperType()->category() != XsdSimpleType::SimpleTypeList) { - m_context->error(QtXmlPatterns::tr("base type of simple type %1 must have variety of type list").arg(formatType(m_namePool, simpleType)), XsdSchemaContext::XSDError, location); + m_context->error(QtXmlPatterns::tr("Base type of simple type %1 must have variety of type list.").arg(formatType(m_namePool, simpleType)), XsdSchemaContext::XSDError, location); return; } // 2.2.2.2 if (simpleType->wxsSuperType()->derivationConstraints() & SchemaType::RestrictionConstraint) { - m_context->error(QtXmlPatterns::tr("base type of simple type %1 has defined derivation by restriction as final").arg(formatType(m_namePool, simpleType)), XsdSchemaContext::XSDError, location); + m_context->error(QtXmlPatterns::tr("Base type of simple type %1 has defined derivation by restriction as final.").arg(formatType(m_namePool, simpleType)), XsdSchemaContext::XSDError, location); return; } // 2.2.2.3 if (!XsdSchemaHelper::isSimpleDerivationOk(itemType, XsdSimpleType::Ptr(simpleType->wxsSuperType())->itemType(), SchemaType::DerivationConstraints())) { - m_context->error(QtXmlPatterns::tr("item type of base type does not match item type of %1").arg(formatType(m_namePool, simpleType)), XsdSchemaContext::XSDError, location); + m_context->error(QtXmlPatterns::tr("Item type of base type does not match item type of %1.").arg(formatType(m_namePool, simpleType)), XsdSchemaContext::XSDError, location); return; } @@ -498,7 +498,7 @@ void XsdSchemaChecker::checkSimpleTypeConstraints() } if (invalidFacetFound) { - m_context->error(QtXmlPatterns::tr("simple type %1 contains not allowed facet type %2") + m_context->error(QtXmlPatterns::tr("Simple type %1 contains not allowed facet type %2.") .arg(formatType(m_namePool, simpleType)) .arg(formatKeyword(XsdFacet::typeName(invalidFacetType))), XsdSchemaContext::XSDError, location); @@ -519,7 +519,7 @@ void XsdSchemaChecker::checkSimpleTypeConstraints() const AnySimpleType::Ptr memberType = memberTypes.at(i); if (memberType->derivationConstraints() & XsdSimpleType::UnionConstraint) { - m_context->error(QtXmlPatterns::tr("%1 is not allowed to derive from %2 by union as the latter defines it as final") + m_context->error(QtXmlPatterns::tr("%1 is not allowed to derive from %2 by union as the latter defines it as final.") .arg(formatType(m_namePool, simpleType)) .arg(formatType(m_namePool, memberType)), XsdSchemaContext::XSDError, location); return; @@ -528,7 +528,7 @@ void XsdSchemaChecker::checkSimpleTypeConstraints() // 3.3.1.2 if (!simpleType->facets().isEmpty()) { - m_context->error(QtXmlPatterns::tr("%1 is not allowed to have any facets") + m_context->error(QtXmlPatterns::tr("%1 is not allowed to have any facets.") .arg(formatType(m_namePool, simpleType)), XsdSchemaContext::XSDError, location); return; @@ -536,7 +536,7 @@ void XsdSchemaChecker::checkSimpleTypeConstraints() } else { // 3.1.2.1 if (simpleType->wxsSuperType()->category() != SchemaType::SimpleTypeUnion) { - m_context->error(QtXmlPatterns::tr("base type %1 of simple type %2 must have variety of union") + m_context->error(QtXmlPatterns::tr("Base type %1 of simple type %2 must have variety of union.") .arg(formatType(m_namePool, simpleType->wxsSuperType())) .arg(formatType(m_namePool, simpleType)), XsdSchemaContext::XSDError, location); @@ -545,7 +545,7 @@ void XsdSchemaChecker::checkSimpleTypeConstraints() // 3.1.2.2 if (simpleType->wxsSuperType()->derivationConstraints() & SchemaType::DerivationRestriction) { - m_context->error(QtXmlPatterns::tr("base type %1 of simple type %2 is not allowed to have restriction in %3 attribute") + m_context->error(QtXmlPatterns::tr("Base type %1 of simple type %2 is not allowed to have restriction in %3 attribute.") .arg(formatType(m_namePool, simpleType->wxsSuperType())) .arg(formatType(m_namePool, simpleType)) .arg(formatAttribute("final")), @@ -563,7 +563,7 @@ void XsdSchemaChecker::checkSimpleTypeConstraints() const AnySimpleType::Ptr baseMemberType = baseMemberTypes.at(i); if (!XsdSchemaHelper::isSimpleDerivationOk(memberType, baseMemberType, SchemaType::DerivationConstraints())) { - m_context->error(QtXmlPatterns::tr("member type %1 cannot be derived from member type %2 of %3's base type %4") + m_context->error(QtXmlPatterns::tr("Member type %1 cannot be derived from member type %2 of %3's base type %4.") .arg(formatType(m_namePool, memberType)) .arg(formatType(m_namePool, baseMemberType)) .arg(formatType(m_namePool, simpleType)) @@ -591,7 +591,7 @@ void XsdSchemaChecker::checkSimpleTypeConstraints() } if (invalidFacetFound) { - m_context->error(QtXmlPatterns::tr("simple type %1 contains not allowed facet type %2") + m_context->error(QtXmlPatterns::tr("Simple type %1 contains not allowed facet type %2.") .arg(formatType(m_namePool, simpleType)) .arg(formatKeyword(XsdFacet::typeName(invalidFacetType))), XsdSchemaContext::XSDError, location); @@ -628,7 +628,7 @@ void XsdSchemaChecker::checkBasicComplexTypeConstraints() // @see http://www.w3.org/TR/xmlschema11-1/#ct-props-correct 2) if (baseType->isSimpleType() && (complexType->derivationMethod() != XsdComplexType::DerivationExtension)) { - m_context->error(QtXmlPatterns::tr("derivation method of %1 must be extension because the base type %2 is a simple type") + m_context->error(QtXmlPatterns::tr("Derivation method of %1 must be extension because the base type %2 is a simple type.") .arg(formatType(m_namePool, complexType)) .arg(formatType(m_namePool, baseType)), XsdSchemaContext::XSDError, location); @@ -658,7 +658,7 @@ void XsdSchemaChecker::checkComplexTypeConstraints() if (complexType->contentType()->particle()) { XsdElement::Ptr duplicatedElement; if (XsdParticleChecker::hasDuplicatedElements(complexType->contentType()->particle(), m_namePool, duplicatedElement)) { - m_context->error(QtXmlPatterns::tr("complex type %1 has duplicated element %2 in its content model") + m_context->error(QtXmlPatterns::tr("Complex type %1 has duplicated element %2 in its content model.") .arg(formatType(m_namePool, complexType)) .arg(formatKeyword(duplicatedElement->displayName(m_namePool))), XsdSchemaContext::XSDError, location); @@ -666,7 +666,7 @@ void XsdSchemaChecker::checkComplexTypeConstraints() } if (!XsdParticleChecker::isUPAConform(complexType->contentType()->particle(), m_namePool)) { - m_context->error(QtXmlPatterns::tr("complex type %1 has non-deterministic content") + m_context->error(QtXmlPatterns::tr("Complex type %1 has non-deterministic content.") .arg(formatType(m_namePool, complexType)), XsdSchemaContext::XSDError, location); return; @@ -687,7 +687,7 @@ void XsdSchemaChecker::checkComplexTypeConstraints() QString errorMsg; if (!XsdSchemaHelper::isValidAttributeUsesExtension(complexType->attributeUses(), complexBaseType->attributeUses(), complexType->attributeWildcard(), complexBaseType->attributeWildcard(), m_context, errorMsg)) { - m_context->error(QtXmlPatterns::tr("attributes of complex type %1 are not a valid extension of the attributes of base type %2: %3") + m_context->error(QtXmlPatterns::tr("Attributes of complex type %1 are not a valid extension of the attributes of base type %2: %3.") .arg(formatType(m_namePool, complexType)) .arg(formatType(m_namePool, baseType)) .arg(errorMsg), @@ -724,7 +724,7 @@ void XsdSchemaChecker::checkComplexTypeConstraints() // 1.5 WTF?!? if (!validContentType) { - m_context->error(QtXmlPatterns::tr("content model of complex type %1 is not a valid extension of content model of %2") + m_context->error(QtXmlPatterns::tr("Content model of complex type %1 is not a valid extension of content model of %2.") .arg(formatType(m_namePool, complexType)) .arg(formatType(m_namePool, complexBaseType)), XsdSchemaContext::XSDError, location); @@ -734,14 +734,14 @@ void XsdSchemaChecker::checkComplexTypeConstraints() } else if (baseType->isSimpleType()) { // 2.1 if (complexType->contentType()->variety() != XsdComplexType::ContentType::Simple) { - m_context->error(QtXmlPatterns::tr("complex type %1 must have simple content") + m_context->error(QtXmlPatterns::tr("Complex type %1 must have simple content.") .arg(formatType(m_namePool, complexType)), XsdSchemaContext::XSDError, location); return; } if (complexType->contentType()->simpleType() != baseType) { - m_context->error(QtXmlPatterns::tr("complex type %1 must have the same simple type as its base class %2") + m_context->error(QtXmlPatterns::tr("Complex type %1 must have the same simple type as its base class %2.") .arg(formatType(m_namePool, complexType)) .arg(formatType(m_namePool, baseType)), XsdSchemaContext::XSDError, location); @@ -808,7 +808,7 @@ void XsdSchemaChecker::checkComplexTypeConstraints() } if (!derivationOk) { - m_context->error(QtXmlPatterns::tr("complex type %1 cannot be derived from base type %2%3") + m_context->error(QtXmlPatterns::tr("Complex type %1 cannot be derived from base type %2%3.") .arg(formatType(m_namePool, complexType)) .arg(formatType(m_namePool, baseType)) .arg(errorMsg.isEmpty() ? QString() : QLatin1String(": ") + errorMsg), @@ -822,7 +822,7 @@ void XsdSchemaChecker::checkComplexTypeConstraints() QString errorMsg; if (!XsdSchemaHelper::isValidAttributeUsesRestriction(complexType->attributeUses(), complexBaseType->attributeUses(), complexType->attributeWildcard(), complexBaseType->attributeWildcard(), m_context, errorMsg)) { - m_context->error(QtXmlPatterns::tr("attributes of complex type %1 are not a valid restriction from the attributes of base type %2: %3") + m_context->error(QtXmlPatterns::tr("Attributes of complex type %1 are not a valid restriction from the attributes of base type %2: %3.") .arg(formatType(m_namePool, complexType)) .arg(formatType(m_namePool, baseType)) .arg(errorMsg), @@ -836,7 +836,7 @@ void XsdSchemaChecker::checkComplexTypeConstraints() // built in complex type xs:AnyType if (complexType->contentType()->variety() == XsdComplexType::ContentType::Simple) { if (baseType->name(m_namePool) == BuiltinTypes::xsAnyType->name(m_namePool)) { - m_context->error(QtXmlPatterns::tr("complex type %1 with simple content cannot be derived from complex base type %2") + m_context->error(QtXmlPatterns::tr("Complex type %1 with simple content cannot be derived from complex base type %2.") .arg(formatType(m_namePool, complexType)) .arg(formatType(m_namePool, baseType)), XsdSchemaContext::XSDError, location); @@ -871,7 +871,7 @@ void XsdSchemaChecker::checkSimpleDerivationRestrictions() const AnySimpleType::Ptr itemType = simpleType->itemType(); if (itemType->isComplexType()) { - m_context->error(QtXmlPatterns::tr("item type of simple type %1 cannot be a complex type") + m_context->error(QtXmlPatterns::tr("Item type of simple type %1 cannot be a complex type.") .arg(formatType(m_namePool, simpleType)), XsdSchemaContext::XSDError, location); return; @@ -881,7 +881,7 @@ void XsdSchemaChecker::checkSimpleDerivationRestrictions() if (itemType->isSimpleType() && itemType->isDefinedBySchema()) { const XsdSimpleType::Ptr simpleItemType = itemType; if (simpleItemType->derivationConstraints() & XsdSimpleType::ListConstraint) { - m_context->error(QtXmlPatterns::tr("%1 is not allowed to derive from %2 by list as the latter defines it as final") + m_context->error(QtXmlPatterns::tr("%1 is not allowed to derive from %2 by list as the latter defines it as final.") .arg(formatType(m_namePool, simpleType)) .arg(formatType(m_namePool, simpleItemType)), XsdSchemaContext::XSDError, location); @@ -891,7 +891,7 @@ void XsdSchemaChecker::checkSimpleDerivationRestrictions() // @see http://www.w3.org/TR/xmlschema-2/#cos-list-of-atomic if (itemType->category() != SchemaType::SimpleTypeAtomic && itemType->category() != SchemaType::SimpleTypeUnion) { - m_context->error(QtXmlPatterns::tr("variety of item type of %1 must be either atomic or union").arg(formatType(m_namePool, simpleType)), XsdSchemaContext::XSDError, location); + m_context->error(QtXmlPatterns::tr("Variety of item type of %1 must be either atomic or union.").arg(formatType(m_namePool, simpleType)), XsdSchemaContext::XSDError, location); return; } @@ -900,7 +900,7 @@ void XsdSchemaChecker::checkSimpleDerivationRestrictions() const AnySimpleType::List memberTypes = simpleItemType->memberTypes(); for (int j = 0; j < memberTypes.count(); ++j) { if (memberTypes.at(j)->category() != SchemaType::SimpleTypeAtomic) { - m_context->error(QtXmlPatterns::tr("variety of member types of %1 must be atomic").arg(formatType(m_namePool, simpleItemType)), XsdSchemaContext::XSDError, location); + m_context->error(QtXmlPatterns::tr("Variety of member types of %1 must be atomic.").arg(formatType(m_namePool, simpleItemType)), XsdSchemaContext::XSDError, location); return; } } @@ -915,7 +915,7 @@ void XsdSchemaChecker::checkSimpleDerivationRestrictions() const AnySimpleType::Ptr memberType = memberTypes.at(i); if (memberType->isComplexType()) { - m_context->error(QtXmlPatterns::tr("member type of simple type %1 cannot be a complex type") + m_context->error(QtXmlPatterns::tr("Member type of simple type %1 cannot be a complex type.") .arg(formatType(m_namePool, simpleType)), XsdSchemaContext::XSDError, location); return; @@ -923,7 +923,7 @@ void XsdSchemaChecker::checkSimpleDerivationRestrictions() // @see http://www.w3.org/TR/xmlschema-2/#cos-no-circular-unions if (simpleType->name(m_namePool) == memberType->name(m_namePool)) { - m_context->error(QtXmlPatterns::tr("%1 is not allowed to have a member type with the same name as itself") + m_context->error(QtXmlPatterns::tr("%1 is not allowed to have a member type with the same name as itself.") .arg(formatType(m_namePool, simpleType)), XsdSchemaContext::XSDError, location); return; @@ -932,7 +932,7 @@ void XsdSchemaChecker::checkSimpleDerivationRestrictions() if (memberType->isSimpleType() && memberType->isDefinedBySchema()) { const XsdSimpleType::Ptr simpleMemberType = memberType; if (simpleMemberType->derivationConstraints() & XsdSimpleType::UnionConstraint) { - m_context->error(QtXmlPatterns::tr("%1 is not allowed to derive from %2 by union as the latter defines it as final") + m_context->error(QtXmlPatterns::tr("%1 is not allowed to derive from %2 by union as the latter defines it as final.") .arg(formatType(m_namePool, simpleType)) .arg(formatType(m_namePool, simpleMemberType)), XsdSchemaContext::XSDError, location); @@ -1006,7 +1006,7 @@ void XsdSchemaChecker::checkConstrainingFacets(const XsdFacet::Hash &facets, con } if ((minLengthValue->toInteger() > lengthValue->toInteger()) || !foundSuperMinimumLength) { - m_context->error(QtXmlPatterns::tr("%1 facet collides with %2 facet") + m_context->error(QtXmlPatterns::tr("%1 facet collides with %2 facet.") .arg(formatKeyword("length")) .arg(formatKeyword("minLength")), XsdSchemaContext::XSDError, sourceLocation(simpleType)); @@ -1035,7 +1035,7 @@ void XsdSchemaChecker::checkConstrainingFacets(const XsdFacet::Hash &facets, con } if ((maxLengthValue->toInteger() < lengthValue->toInteger()) || !foundSuperMaximumLength) { - m_context->error(QtXmlPatterns::tr("%1 facet collides with %2 facet") + m_context->error(QtXmlPatterns::tr("%1 facet collides with %2 facet.") .arg(formatKeyword("length")) .arg(formatKeyword("maxLength")), XsdSchemaContext::XSDError, sourceLocation(simpleType)); @@ -1049,7 +1049,7 @@ void XsdSchemaChecker::checkConstrainingFacets(const XsdFacet::Hash &facets, con if (baseFacets.contains(XsdFacet::Length)) { const DerivedInteger::Ptr baseValue = baseFacets.value(XsdFacet::Length)->value(); if (lengthValue->toInteger() != baseValue->toInteger()) { - m_context->error(QtXmlPatterns::tr("%1 facet must have the same value as %2 facet of base type") + m_context->error(QtXmlPatterns::tr("%1 facet must have the same value as %2 facet of base type.") .arg(formatKeyword("length")) .arg(formatKeyword("length")), XsdSchemaContext::XSDError, sourceLocation(simpleType)); @@ -1069,7 +1069,7 @@ void XsdSchemaChecker::checkConstrainingFacets(const XsdFacet::Hash &facets, con // @see http://www.w3.org/TR/xmlschema-2/#minLength-less-than-equal-to-maxLength if (maxLengthValue->toInteger() < minLengthValue->toInteger()) { - m_context->error(QtXmlPatterns::tr("%1 facet collides with %2 facet") + m_context->error(QtXmlPatterns::tr("%1 facet collides with %2 facet.") .arg(formatKeyword("minLength")) .arg(formatKeyword("maxLength")), XsdSchemaContext::XSDError, sourceLocation(simpleType)); @@ -1086,7 +1086,7 @@ void XsdSchemaChecker::checkConstrainingFacets(const XsdFacet::Hash &facets, con if (baseFacets.contains(XsdFacet::MinimumLength)) { const DerivedInteger::Ptr baseValue = baseFacets.value(XsdFacet::MinimumLength)->value(); if (minLengthValue->toInteger() < baseValue->toInteger()) { - m_context->error(QtXmlPatterns::tr("%1 facet must be equal or greater than %2 facet of base type") + m_context->error(QtXmlPatterns::tr("%1 facet must be equal or greater than %2 facet of base type.") .arg(formatKeyword("minLength")) .arg(formatKeyword("minLength")), XsdSchemaContext::XSDError, sourceLocation(simpleType)); @@ -1105,7 +1105,7 @@ void XsdSchemaChecker::checkConstrainingFacets(const XsdFacet::Hash &facets, con if (baseFacets.contains(XsdFacet::MaximumLength)) { const DerivedInteger::Ptr baseValue(baseFacets.value(XsdFacet::MaximumLength)->value()); if (maxLengthValue->toInteger() > baseValue->toInteger()) { - m_context->error(QtXmlPatterns::tr("%1 facet must be less than or equal to %2 facet of base type") + m_context->error(QtXmlPatterns::tr("%1 facet must be less than or equal to %2 facet of base type.") .arg(formatKeyword("maxLength")) .arg(formatKeyword("maxLength")), XsdSchemaContext::XSDError, sourceLocation(simpleType)); @@ -1126,7 +1126,7 @@ void XsdSchemaChecker::checkConstrainingFacets(const XsdFacet::Hash &facets, con const DerivedString::Ptr value = multiValue.at(i); const QRegExp exp = PatternPlatform::parsePattern(value->stringValue(), m_context, &reflection); if (!exp.isValid()) { - m_context->error(QtXmlPatterns::tr("%1 facet contains invalid regular expression").arg(formatKeyword("pattern")), XsdSchemaContext::XSDError, sourceLocation(simpleType)); + m_context->error(QtXmlPatterns::tr("%1 facet contains invalid regular expression").arg(formatKeyword("pattern.")), XsdSchemaContext::XSDError, sourceLocation(simpleType)); return; } } @@ -1141,7 +1141,7 @@ void XsdSchemaChecker::checkConstrainingFacets(const XsdFacet::Hash &facets, con for (int k = 0; k < notationNames.count(); ++k) { const QNameValue::Ptr notationName = notationNames.at(k); if (!m_schema->notation(notationName->qName())) { - m_context->error(QtXmlPatterns::tr("unknown notation %1 used in %2 facet") + m_context->error(QtXmlPatterns::tr("Unknown notation %1 used in %2 facet.") .arg(formatKeyword(m_namePool, notationName->qName())) .arg(formatKeyword("enumeration")), XsdSchemaContext::XSDError, sourceLocation(simpleType)); @@ -1161,7 +1161,7 @@ void XsdSchemaChecker::checkConstrainingFacets(const XsdFacet::Hash &facets, con QString errorMsg; if (!checker.isValidString(actualValue, baseType, errorMsg)) { - m_context->error(QtXmlPatterns::tr("%1 facet contains invalid value %2: %3") + m_context->error(QtXmlPatterns::tr("%1 facet contains invalid value %2: %3.") .arg(formatKeyword("enumeration")) .arg(formatData(stringValue)) .arg(errorMsg), @@ -1183,7 +1183,7 @@ void XsdSchemaChecker::checkConstrainingFacets(const XsdFacet::Hash &facets, con const QString baseValue = DerivedString::Ptr(baseFacets.value(XsdFacet::WhiteSpace)->value())->stringValue(); if (value == XsdSchemaToken::toString(XsdSchemaToken::Replace) || value == XsdSchemaToken::toString(XsdSchemaToken::Preserve)) { if (baseValue == XsdSchemaToken::toString(XsdSchemaToken::Collapse)) { - m_context->error(QtXmlPatterns::tr("%1 facet cannot be %2 or %3 if %4 facet of base type is %5") + m_context->error(QtXmlPatterns::tr("%1 facet cannot be %2 or %3 if %4 facet of base type is %5.") .arg(formatKeyword("whiteSpace")) .arg(formatData("replace")) .arg(formatData("preserve")) @@ -1194,7 +1194,7 @@ void XsdSchemaChecker::checkConstrainingFacets(const XsdFacet::Hash &facets, con } } if (value == XsdSchemaToken::toString(XsdSchemaToken::Preserve) && baseValue == XsdSchemaToken::toString(XsdSchemaToken::Replace)) { - m_context->error(QtXmlPatterns::tr("%1 facet cannot be %2 if %3 facet of base type is %4") + m_context->error(QtXmlPatterns::tr("%1 facet cannot be %2 if %3 facet of base type is %4.") .arg(formatKeyword("whiteSpace")) .arg(formatData("preserve")) .arg(formatKeyword("whiteSpace")) @@ -1214,7 +1214,7 @@ void XsdSchemaChecker::checkConstrainingFacets(const XsdFacet::Hash &facets, con if (comparableBaseType) { if (XsdSchemaHelper::constructAndCompare(minFacet->value(), AtomicComparator::OperatorGreaterThan, maxFacet->value(), comparableBaseType, m_context, &reflection)) { - m_context->error(QtXmlPatterns::tr("%1 facet must be less than or equal to %2 facet") + m_context->error(QtXmlPatterns::tr("%1 facet must be less than or equal to %2 facet.") .arg(formatKeyword("minInclusive")) .arg(formatKeyword("maxInclusive")), XsdSchemaContext::XSDError, sourceLocation(simpleType)); @@ -1230,7 +1230,7 @@ void XsdSchemaChecker::checkConstrainingFacets(const XsdFacet::Hash &facets, con const XsdFacet::Ptr baseFacet = baseFacets.value(XsdFacet::MaximumInclusive); if (comparableBaseType) { if (XsdSchemaHelper::constructAndCompare(maxFacet->value(), AtomicComparator::OperatorGreaterThan, baseFacet->value(), comparableBaseType, m_context, &reflection)) { - m_context->error(QtXmlPatterns::tr("%1 facet must be less than or equal to %2 facet of base type") + m_context->error(QtXmlPatterns::tr("%1 facet must be less than or equal to %2 facet of base type.") .arg(formatKeyword("maxInclusive")) .arg(formatKeyword("maxInclusive")), XsdSchemaContext::XSDError, sourceLocation(simpleType)); @@ -1242,7 +1242,7 @@ void XsdSchemaChecker::checkConstrainingFacets(const XsdFacet::Hash &facets, con const XsdFacet::Ptr baseFacet = baseFacets.value(XsdFacet::MaximumExclusive); if (comparableBaseType) { if (XsdSchemaHelper::constructAndCompare(maxFacet->value(), AtomicComparator::OperatorGreaterOrEqual, baseFacet->value(), comparableBaseType, m_context, &reflection)) { - m_context->error(QtXmlPatterns::tr("%1 facet must be less than %2 facet of base type") + m_context->error(QtXmlPatterns::tr("%1 facet must be less than %2 facet of base type.") .arg(formatKeyword("maxInclusive")) .arg(formatKeyword("maxExclusive")), XsdSchemaContext::XSDError, sourceLocation(simpleType)); @@ -1257,7 +1257,7 @@ void XsdSchemaChecker::checkConstrainingFacets(const XsdFacet::Hash &facets, con // @see http://www.w3.org/TR/xmlschema-2/#maxInclusive-maxExclusive if (facets.contains(XsdFacet::MaximumInclusive)) { - m_context->error(QtXmlPatterns::tr("%1 facet and %2 facet cannot appear together") + m_context->error(QtXmlPatterns::tr("%1 facet and %2 facet cannot appear together.") .arg(formatKeyword("maxExclusive")) .arg(formatKeyword("maxInclusive")), XsdSchemaContext::XSDError, sourceLocation(simpleType)); @@ -1269,7 +1269,7 @@ void XsdSchemaChecker::checkConstrainingFacets(const XsdFacet::Hash &facets, con const XsdFacet::Ptr minFacet = facets.value(XsdFacet::MinimumExclusive); if (comparableBaseType) { if (XsdSchemaHelper::constructAndCompare(minFacet->value(), AtomicComparator::OperatorGreaterThan, maxFacet->value(), comparableBaseType, m_context, &reflection)) { - m_context->error(QtXmlPatterns::tr("%1 facet must be less than or equal to %2 facet") + m_context->error(QtXmlPatterns::tr("%1 facet must be less than or equal to %2 facet.") .arg(formatKeyword("minExclusive")) .arg(formatKeyword("maxExclusive")), XsdSchemaContext::XSDError, sourceLocation(simpleType)); @@ -1285,7 +1285,7 @@ void XsdSchemaChecker::checkConstrainingFacets(const XsdFacet::Hash &facets, con const XsdFacet::Ptr baseFacet = baseFacets.value(XsdFacet::MaximumExclusive); if (comparableBaseType) { if (XsdSchemaHelper::constructAndCompare(maxFacet->value(), AtomicComparator::OperatorGreaterThan, baseFacet->value(), comparableBaseType, m_context, &reflection)) { - m_context->error(QtXmlPatterns::tr("%1 facet must be less than or equal to %2 facet of base type") + m_context->error(QtXmlPatterns::tr("%1 facet must be less than or equal to %2 facet of base type.") .arg(formatKeyword("maxExclusive")) .arg(formatKeyword("maxExclusive")), XsdSchemaContext::XSDError, sourceLocation(simpleType)); @@ -1297,7 +1297,7 @@ void XsdSchemaChecker::checkConstrainingFacets(const XsdFacet::Hash &facets, con const XsdFacet::Ptr baseFacet = baseFacets.value(XsdFacet::MaximumInclusive); if (comparableBaseType) { if (XsdSchemaHelper::constructAndCompare(maxFacet->value(), AtomicComparator::OperatorGreaterThan, baseFacet->value(), comparableBaseType, m_context, &reflection)) { - m_context->error(QtXmlPatterns::tr("%1 facet must be less than or equal to %2 facet of base type") + m_context->error(QtXmlPatterns::tr("%1 facet must be less than or equal to %2 facet of base type.") .arg(formatKeyword("maxExclusive")) .arg(formatKeyword("maxInclusive")), XsdSchemaContext::XSDError, sourceLocation(simpleType)); @@ -1309,7 +1309,7 @@ void XsdSchemaChecker::checkConstrainingFacets(const XsdFacet::Hash &facets, con const XsdFacet::Ptr baseFacet = baseFacets.value(XsdFacet::MinimumInclusive); if (comparableBaseType) { if (XsdSchemaHelper::constructAndCompare(maxFacet->value(), AtomicComparator::OperatorLessOrEqual, baseFacet->value(), comparableBaseType, m_context, &reflection)) { - m_context->error(QtXmlPatterns::tr("%1 facet must be greater than %2 facet of base type") + m_context->error(QtXmlPatterns::tr("%1 facet must be greater than %2 facet of base type.") .arg(formatKeyword("maxExclusive")) .arg(formatKeyword("minInclusive")), XsdSchemaContext::XSDError, sourceLocation(simpleType)); @@ -1321,7 +1321,7 @@ void XsdSchemaChecker::checkConstrainingFacets(const XsdFacet::Hash &facets, con const XsdFacet::Ptr baseFacet = baseFacets.value(XsdFacet::MinimumExclusive); if (comparableBaseType) { if (XsdSchemaHelper::constructAndCompare(maxFacet->value(), AtomicComparator::OperatorLessOrEqual, baseFacet->value(), comparableBaseType, m_context, &reflection)) { - m_context->error(QtXmlPatterns::tr("%1 facet must be greater than %2 facet of base type") + m_context->error(QtXmlPatterns::tr("%1 facet must be greater than %2 facet of base type.") .arg(formatKeyword("maxExclusive")) .arg(formatKeyword("minExclusive")), XsdSchemaContext::XSDError, sourceLocation(simpleType)); @@ -1336,7 +1336,7 @@ void XsdSchemaChecker::checkConstrainingFacets(const XsdFacet::Hash &facets, con // @see http://www.w3.org/TR/xmlschema-2/#minInclusive-minExclusive if (facets.contains(XsdFacet::MinimumInclusive)) { - m_context->error(QtXmlPatterns::tr("%1 facet and %2 facet cannot appear together") + m_context->error(QtXmlPatterns::tr("%1 facet and %2 facet cannot appear together.") .arg(formatKeyword("minExclusive")) .arg(formatKeyword("minInclusive")), XsdSchemaContext::XSDError, sourceLocation(simpleType)); @@ -1348,7 +1348,7 @@ void XsdSchemaChecker::checkConstrainingFacets(const XsdFacet::Hash &facets, con const XsdFacet::Ptr maxFacet = facets.value(XsdFacet::MaximumInclusive); if (comparableBaseType) { if (XsdSchemaHelper::constructAndCompare(minFacet->value(), AtomicComparator::OperatorGreaterOrEqual, maxFacet->value(), comparableBaseType, m_context, &reflection)) { - m_context->error(QtXmlPatterns::tr("%1 facet must be less than %2 facet") + m_context->error(QtXmlPatterns::tr("%1 facet must be less than %2 facet.") .arg(formatKeyword("minExclusive")) .arg(formatKeyword("maxInclusive")), XsdSchemaContext::XSDError, sourceLocation(simpleType)); @@ -1364,7 +1364,7 @@ void XsdSchemaChecker::checkConstrainingFacets(const XsdFacet::Hash &facets, con const XsdFacet::Ptr baseFacet = baseFacets.value(XsdFacet::MinimumExclusive); if (comparableBaseType) { if (XsdSchemaHelper::constructAndCompare(minFacet->value(), AtomicComparator::OperatorLessThan, baseFacet->value(), comparableBaseType, m_context, &reflection)) { - m_context->error(QtXmlPatterns::tr("%1 facet must be greater than or equal to %2 facet of base type") + m_context->error(QtXmlPatterns::tr("%1 facet must be greater than or equal to %2 facet of base type.") .arg(formatKeyword("minExclusive")) .arg(formatKeyword("minExclusive")), XsdSchemaContext::XSDError, sourceLocation(simpleType)); @@ -1376,7 +1376,7 @@ void XsdSchemaChecker::checkConstrainingFacets(const XsdFacet::Hash &facets, con const XsdFacet::Ptr baseFacet = baseFacets.value(XsdFacet::MaximumExclusive); if (comparableBaseType) { if (XsdSchemaHelper::constructAndCompare(minFacet->value(), AtomicComparator::OperatorGreaterOrEqual, baseFacet->value(), comparableBaseType, m_context, &reflection)) { - m_context->error(QtXmlPatterns::tr("%1 facet must be less than %2 facet of base type") + m_context->error(QtXmlPatterns::tr("%1 facet must be less than %2 facet of base type.") .arg(formatKeyword("minExclusive")) .arg(formatKeyword("maxExclusive")), XsdSchemaContext::XSDError, sourceLocation(simpleType)); @@ -1388,7 +1388,7 @@ void XsdSchemaChecker::checkConstrainingFacets(const XsdFacet::Hash &facets, con const XsdFacet::Ptr baseFacet = baseFacets.value(XsdFacet::MaximumInclusive); if (comparableBaseType) { if (XsdSchemaHelper::constructAndCompare(minFacet->value(), AtomicComparator::OperatorGreaterThan, baseFacet->value(), comparableBaseType, m_context, &reflection)) { - m_context->error(QtXmlPatterns::tr("%1 facet must be less than or equal to %2 facet of base type") + m_context->error(QtXmlPatterns::tr("%1 facet must be less than or equal to %2 facet of base type.") .arg(formatKeyword("minExclusive")) .arg(formatKeyword("maxInclusive")), XsdSchemaContext::XSDError, sourceLocation(simpleType)); @@ -1406,7 +1406,7 @@ void XsdSchemaChecker::checkConstrainingFacets(const XsdFacet::Hash &facets, con const XsdFacet::Ptr maxFacet = facets.value(XsdFacet::MaximumExclusive); if (comparableBaseType) { if (XsdSchemaHelper::constructAndCompare(minFacet->value(), AtomicComparator::OperatorGreaterOrEqual, maxFacet->value(), comparableBaseType, m_context, &reflection)) { - m_context->error(QtXmlPatterns::tr("%1 facet must be less than %2 facet") + m_context->error(QtXmlPatterns::tr("%1 facet must be less than %2 facet.") .arg(formatKeyword("minInclusive")) .arg(formatKeyword("maxExclusive")), XsdSchemaContext::XSDError, sourceLocation(simpleType)); @@ -1422,7 +1422,7 @@ void XsdSchemaChecker::checkConstrainingFacets(const XsdFacet::Hash &facets, con const XsdFacet::Ptr baseFacet = baseFacets.value(XsdFacet::MinimumInclusive); if (comparableBaseType) { if (XsdSchemaHelper::constructAndCompare(minFacet->value(), AtomicComparator::OperatorLessThan, baseFacet->value(), comparableBaseType, m_context, &reflection)) { - m_context->error(QtXmlPatterns::tr("%1 facet must be greater than or equal to %2 facet of base type") + m_context->error(QtXmlPatterns::tr("%1 facet must be greater than or equal to %2 facet of base type.") .arg(formatKeyword("minInclusive")) .arg(formatKeyword("minInclusive")), XsdSchemaContext::XSDError, sourceLocation(simpleType)); @@ -1434,7 +1434,7 @@ void XsdSchemaChecker::checkConstrainingFacets(const XsdFacet::Hash &facets, con const XsdFacet::Ptr baseFacet = baseFacets.value(XsdFacet::MinimumExclusive); if (comparableBaseType) { if (XsdSchemaHelper::constructAndCompare(minFacet->value(), AtomicComparator::OperatorLessOrEqual, baseFacet->value(), comparableBaseType, m_context, &reflection)) { - m_context->error(QtXmlPatterns::tr("%1 facet must be greater than %2 facet of base type") + m_context->error(QtXmlPatterns::tr("%1 facet must be greater than %2 facet of base type.") .arg(formatKeyword("minInclusive")) .arg(formatKeyword("minExclusive")), XsdSchemaContext::XSDError, sourceLocation(simpleType)); @@ -1446,7 +1446,7 @@ void XsdSchemaChecker::checkConstrainingFacets(const XsdFacet::Hash &facets, con const XsdFacet::Ptr baseFacet = baseFacets.value(XsdFacet::MaximumInclusive); if (comparableBaseType) { if (XsdSchemaHelper::constructAndCompare(minFacet->value(), AtomicComparator::OperatorGreaterThan, baseFacet->value(), comparableBaseType, m_context, &reflection)) { - m_context->error(QtXmlPatterns::tr("%1 facet must be less than or equal to %2 facet of base type") + m_context->error(QtXmlPatterns::tr("%1 facet must be less than or equal to %2 facet of base type.") .arg(formatKeyword("minInclusive")) .arg(formatKeyword("maxInclusive")), XsdSchemaContext::XSDError, sourceLocation(simpleType)); @@ -1458,7 +1458,7 @@ void XsdSchemaChecker::checkConstrainingFacets(const XsdFacet::Hash &facets, con const XsdFacet::Ptr baseFacet = baseFacets.value(XsdFacet::MaximumExclusive); if (comparableBaseType) { if (XsdSchemaHelper::constructAndCompare(minFacet->value(), AtomicComparator::OperatorGreaterOrEqual, baseFacet->value(), comparableBaseType, m_context, &reflection)) { - m_context->error(QtXmlPatterns::tr("%1 facet must be less than %2 facet of base type") + m_context->error(QtXmlPatterns::tr("%1 facet must be less than %2 facet of base type.") .arg(formatKeyword("minInclusive")) .arg(formatKeyword("maxExclusive")), XsdSchemaContext::XSDError, sourceLocation(simpleType)); @@ -1480,7 +1480,7 @@ void XsdSchemaChecker::checkConstrainingFacets(const XsdFacet::Hash &facets, con const DerivedInteger::Ptr baseValue = baseFacet->value(); if (totalDigitsValue->toInteger() > baseValue->toInteger()) { - m_context->error(QtXmlPatterns::tr("%1 facet must be less than or equal to %2 facet of base type") + m_context->error(QtXmlPatterns::tr("%1 facet must be less than or equal to %2 facet of base type.") .arg(formatKeyword("totalDigits")) .arg(formatKeyword("totalDigits")), XsdSchemaContext::XSDError, sourceLocation(simpleType)); @@ -1499,7 +1499,7 @@ void XsdSchemaChecker::checkConstrainingFacets(const XsdFacet::Hash &facets, con const DerivedInteger::Ptr totalDigitsValue = totalDigitsFacet->value(); if (fractionDigitsValue->toInteger() > totalDigitsValue->toInteger()) { - m_context->error(QtXmlPatterns::tr("%1 facet must be less than or equal to %2 facet") + m_context->error(QtXmlPatterns::tr("%1 facet must be less than or equal to %2 facet.") .arg(formatKeyword("fractionDigits")) .arg(formatKeyword("totalDigits")), XsdSchemaContext::XSDError, sourceLocation(simpleType)); @@ -1515,7 +1515,7 @@ void XsdSchemaChecker::checkConstrainingFacets(const XsdFacet::Hash &facets, con const DerivedInteger::Ptr baseValue = baseFacet->value(); if (fractionDigitsValue->toInteger() > baseValue->toInteger()) { - m_context->error(QtXmlPatterns::tr("%1 facet must be less than or equal to %2 facet of base type") + m_context->error(QtXmlPatterns::tr("%1 facet must be less than or equal to %2 facet of base type.") .arg(formatKeyword("fractionDigits")) .arg(formatKeyword("fractionDigits")), XsdSchemaContext::XSDError, sourceLocation(simpleType)); @@ -1535,7 +1535,7 @@ void XsdSchemaChecker::checkConstrainingFacets(const XsdFacet::Hash &facets, con QSet availableFacets = facets.keys().toSet(); if (!availableFacets.subtract(allowedFacets).isEmpty()) { - m_context->error(QtXmlPatterns::tr("simple type contains not allowed facet %1") + m_context->error(QtXmlPatterns::tr("Simple type contains not allowed facet %1.") .arg(formatKeyword(XsdFacet::typeName(availableFacets.toList().first()))), XsdSchemaContext::XSDError, sourceLocation(simpleType)); return; @@ -1547,7 +1547,7 @@ void XsdSchemaChecker::checkConstrainingFacets(const XsdFacet::Hash &facets, con facets.contains(XsdFacet::MaximumExclusive) || facets.contains(XsdFacet::MinimumExclusive) || facets.contains(XsdFacet::TotalDigits) || facets.contains(XsdFacet::FractionDigits)) { - m_context->error(QtXmlPatterns::tr("%1, %2, %3, %4, %5 and %6 facets are not allowed when derived by list") + m_context->error(QtXmlPatterns::tr("%1, %2, %3, %4, %5 and %6 facets are not allowed when derived by list.") .arg(formatKeyword("maxInclusive")) .arg(formatKeyword("maxExclusive")) .arg(formatKeyword("minInclusive")) @@ -1563,7 +1563,7 @@ void XsdSchemaChecker::checkConstrainingFacets(const XsdFacet::Hash &facets, con facets.contains(XsdFacet::MinimumLength) || facets.contains(XsdFacet::MaximumLength) || facets.contains(XsdFacet::Length) || facets.contains(XsdFacet::WhiteSpace)) { - m_context->error(QtXmlPatterns::tr("only %1 and %2 facets are allowed when derived by union") + m_context->error(QtXmlPatterns::tr("Only %1 and %2 facets are allowed when derived by union.") .arg(formatKeyword("pattern")) .arg(formatKeyword("enumeration")), XsdSchemaContext::XSDError, sourceLocation(simpleType)); @@ -1586,7 +1586,7 @@ void XsdSchemaChecker::checkConstrainingFacets(const XsdFacet::Hash &facets, con const DerivedString::Ptr stringValue = facet->value(); const AtomicValue::Ptr value = ValueFactory::fromLexical(stringValue->stringValue(), baseType, m_context, &reflection); if (value->hasError()) { - m_context->error(QtXmlPatterns::tr("%1 contains %2 facet with invalid data: %3") + m_context->error(QtXmlPatterns::tr("%1 contains %2 facet with invalid data: %3.") .arg(formatType(m_namePool, simpleType)) .arg(formatKeyword(XsdFacet::typeName(facet->type()))) .arg(formatData(stringValue->stringValue())), @@ -1602,7 +1602,7 @@ void XsdSchemaChecker::checkConstrainingFacets(const XsdFacet::Hash &facets, con const QString stringValue = DerivedString::Ptr(multiValue.at(j))->stringValue(); const AtomicValue::Ptr value = ValueFactory::fromLexical(stringValue, baseType, m_context, &reflection); if (value->hasError()) { - m_context->error(QtXmlPatterns::tr("%1 contains %2 facet with invalid data: %3") + m_context->error(QtXmlPatterns::tr("%1 contains %2 facet with invalid data: %3.") .arg(formatType(m_namePool, simpleType)) .arg(formatKeyword(XsdFacet::typeName(XsdFacet::Enumeration))) .arg(formatData(stringValue)), @@ -1626,7 +1626,7 @@ void XsdSchemaChecker::checkDuplicatedAttributeUses() // @see http://www.w3.org/TR/xmlschema11-1/#ct-props-correct 4) XsdAttribute::Ptr conflictingAttribute; if (hasDuplicatedAttributeUses(uses, conflictingAttribute)) { - m_context->error(QtXmlPatterns::tr("attribute group %1 contains attribute %2 twice") + m_context->error(QtXmlPatterns::tr("Attribute group %1 contains attribute %2 twice.") .arg(formatKeyword(attributeGroup->displayName(m_namePool))) .arg(formatKeyword(conflictingAttribute->displayName(m_namePool))), XsdSchemaContext::XSDError, sourceLocation(attributeGroup)); @@ -1635,7 +1635,7 @@ void XsdSchemaChecker::checkDuplicatedAttributeUses() // @see http://www.w3.org/TR/xmlschema11-1/#ct-props-correct 5) if (hasMultipleIDAttributeUses(uses)) { - m_context->error(QtXmlPatterns::tr("attribute group %1 contains two different attributes that both have types derived from %2") + m_context->error(QtXmlPatterns::tr("Attribute group %1 contains two different attributes that both have types derived from %2.") .arg(formatKeyword(attributeGroup->displayName(m_namePool))) .arg(formatType(m_namePool, BuiltinTypes::xsID)), XsdSchemaContext::XSDError, sourceLocation(attributeGroup)); @@ -1643,7 +1643,7 @@ void XsdSchemaChecker::checkDuplicatedAttributeUses() } if (hasConstraintIDAttributeUse(uses, conflictingAttribute)) { - m_context->error(QtXmlPatterns::tr("attribute group %1 contains attribute %2 that has value constraint but type that inherits from %3") + m_context->error(QtXmlPatterns::tr("Attribute group %1 contains attribute %2 that has value constraint but type that inherits from %3.") .arg(formatKeyword(attributeGroup->displayName(m_namePool))) .arg(formatKeyword(conflictingAttribute->displayName(m_namePool))) .arg(formatType(m_namePool, BuiltinTypes::xsID)), @@ -1666,7 +1666,7 @@ void XsdSchemaChecker::checkDuplicatedAttributeUses() // @see http://www.w3.org/TR/xmlschema11-1/#ct-props-correct 4) XsdAttribute::Ptr conflictingAttribute; if (hasDuplicatedAttributeUses(attributeUses, conflictingAttribute)) { - m_context->error(QtXmlPatterns::tr("complex type %1 contains attribute %2 twice") + m_context->error(QtXmlPatterns::tr("Complex type %1 contains attribute %2 twice.") .arg(formatType(m_namePool, complexType)) .arg(formatKeyword(conflictingAttribute->displayName(m_namePool))), XsdSchemaContext::XSDError, sourceLocation(complexType)); @@ -1675,7 +1675,7 @@ void XsdSchemaChecker::checkDuplicatedAttributeUses() // @see http://www.w3.org/TR/xmlschema11-1/#ct-props-correct 5) if (hasMultipleIDAttributeUses(attributeUses)) { - m_context->error(QtXmlPatterns::tr("complex type %1 contains two different attributes that both have types derived from %2") + m_context->error(QtXmlPatterns::tr("Complex type %1 contains two different attributes that both have types derived from %2.") .arg(formatType(m_namePool, complexType)) .arg(formatType(m_namePool, BuiltinTypes::xsID)), XsdSchemaContext::XSDError, sourceLocation(complexType)); @@ -1683,7 +1683,7 @@ void XsdSchemaChecker::checkDuplicatedAttributeUses() } if (hasConstraintIDAttributeUse(attributeUses, conflictingAttribute)) { - m_context->error(QtXmlPatterns::tr("complex type %1 contains attribute %2 that has value constraint but type that inherits from %3") + m_context->error(QtXmlPatterns::tr("Complex type %1 contains attribute %2 that has value constraint but type that inherits from %3.") .arg(formatType(m_namePool, complexType)) .arg(formatKeyword(conflictingAttribute->displayName(m_namePool))) .arg(formatType(m_namePool, BuiltinTypes::xsID)), @@ -1726,14 +1726,14 @@ void XsdSchemaChecker::checkElementConstraints() targetType = XsdSimpleType::Ptr(simpleType)->primitiveType(); } } else if (complexType->contentType()->variety() != XsdComplexType::ContentType::Mixed) { - m_context->error(QtXmlPatterns::tr("element %1 is not allowed to have a value constraint if its base type is complex") + m_context->error(QtXmlPatterns::tr("Element %1 is not allowed to have a value constraint if its base type is complex.") .arg(formatKeyword(element->displayName(m_namePool))), XsdSchemaContext::XSDError, sourceLocation(element)); return; } } if ((targetType == BuiltinTypes::xsID) || BuiltinTypes::xsID->wxsTypeMatches(type)) { - m_context->error(QtXmlPatterns::tr("element %1 is not allowed to have a value constraint if its type is derived from %2") + m_context->error(QtXmlPatterns::tr("Element %1 is not allowed to have a value constraint if its type is derived from %2.") .arg(formatKeyword(element->displayName(m_namePool))) .arg(formatType(m_namePool, BuiltinTypes::xsID)), XsdSchemaContext::XSDError, sourceLocation(element)); @@ -1743,7 +1743,7 @@ void XsdSchemaChecker::checkElementConstraints() if (type->isSimpleType()) { QString errorMsg; if (!isValidValue(element->valueConstraint()->value(), type, errorMsg)) { - m_context->error(QtXmlPatterns::tr("value constraint of element %1 is not of elements type: %2") + m_context->error(QtXmlPatterns::tr("Value constraint of element %1 is not of elements type: %2.") .arg(formatKeyword(element->displayName(m_namePool))) .arg(errorMsg), XsdSchemaContext::XSDError, sourceLocation(element)); @@ -1754,7 +1754,7 @@ void XsdSchemaChecker::checkElementConstraints() if (complexType->contentType()->variety() == XsdComplexType::ContentType::Simple) { QString errorMsg; if (!isValidValue(element->valueConstraint()->value(), complexType->contentType()->simpleType(), errorMsg)) { - m_context->error(QtXmlPatterns::tr("value constraint of element %1 is not of elements type: %2") + m_context->error(QtXmlPatterns::tr("Value constraint of element %1 is not of elements type: %2.") .arg(formatKeyword(element->displayName(m_namePool))) .arg(errorMsg), XsdSchemaContext::XSDError, sourceLocation(element)); @@ -1767,7 +1767,7 @@ void XsdSchemaChecker::checkElementConstraints() if (!element->substitutionGroupAffiliations().isEmpty()) { // 3 if (!element->scope() || element->scope()->variety() != XsdElement::Scope::Global) { - m_context->error(QtXmlPatterns::tr("element %1 is not allowed to have substitution group affiliation as it is no global element").arg(formatKeyword(element->displayName(m_namePool))), + m_context->error(QtXmlPatterns::tr("Element %1 is not allowed to have substitution group affiliation as it is no global element.").arg(formatKeyword(element->displayName(m_namePool))), XsdSchemaContext::XSDError, sourceLocation(element)); return; } @@ -1795,7 +1795,7 @@ void XsdSchemaChecker::checkElementConstraints() } if (!derivationOk) { - m_context->error(QtXmlPatterns::tr("type of element %1 cannot be derived from type of substitution group affiliation").arg(formatKeyword(element->displayName(m_namePool))), + m_context->error(QtXmlPatterns::tr("Type of element %1 cannot be derived from type of substitution group affiliation.").arg(formatKeyword(element->displayName(m_namePool))), XsdSchemaContext::XSDError, sourceLocation(element)); return; } @@ -1836,7 +1836,7 @@ void XsdSchemaChecker::checkAttributeConstraints() QString errorMsg; if (!isValidValue(attribute->valueConstraint()->value(), attribute->type(), errorMsg)) { - m_context->error(QtXmlPatterns::tr("value constraint of attribute %1 is not of attributes type: %2") + m_context->error(QtXmlPatterns::tr("Value constraint of attribute %1 is not of attributes type: %2.") .arg(formatKeyword(attribute->displayName(m_namePool))) .arg(errorMsg), XsdSchemaContext::XSDError, sourceLocation(attribute)); @@ -1845,7 +1845,7 @@ void XsdSchemaChecker::checkAttributeConstraints() } if (BuiltinTypes::xsID->wxsTypeMatches(attribute->type())) { - m_context->error(QtXmlPatterns::tr("attribute %1 has value constraint but has type derived from %2") + m_context->error(QtXmlPatterns::tr("Attribute %1 has value constraint but has type derived from %2.") .arg(formatKeyword(attribute->displayName(m_namePool))) .arg(formatType(m_namePool, BuiltinTypes::xsID)), XsdSchemaContext::XSDError, sourceLocation(attribute)); @@ -1901,7 +1901,7 @@ void XsdSchemaChecker::checkAttributeUseConstraints() if (baseAttributeUse->useType() == XsdAttributeUse::RequiredUse) { if (attributeUse->useType() == XsdAttributeUse::OptionalUse || attributeUse->useType() == XsdAttributeUse::ProhibitedUse) { - m_context->error(QtXmlPatterns::tr("%1 attribute in derived complex type must be %2 like in base type") + m_context->error(QtXmlPatterns::tr("%1 attribute in derived complex type must be %2 like in base type.") .arg(formatAttribute("use")) .arg(formatData("required")), XsdSchemaContext::XSDError, sourceLocation(complexType)); @@ -1912,7 +1912,7 @@ void XsdSchemaChecker::checkAttributeUseConstraints() if (baseAttributeUse->valueConstraint()) { if (baseAttributeUse->valueConstraint()->variety() == XsdAttributeUse::ValueConstraint::Fixed) { if (!attributeUse->valueConstraint()) { - m_context->error(QtXmlPatterns::tr("attribute %1 in derived complex type must have %2 value constraint like in base type") + m_context->error(QtXmlPatterns::tr("Attribute %1 in derived complex type must have %2 value constraint like in base type.") .arg(formatKeyword(attributeUse->attribute()->displayName(m_namePool))) .arg(formatData("fixed")), XsdSchemaContext::XSDError, sourceLocation(complexType)); @@ -1921,14 +1921,14 @@ void XsdSchemaChecker::checkAttributeUseConstraints() if (attributeUse->valueConstraint()->variety() == XsdAttributeUse::ValueConstraint::Fixed) { const XsdTypeChecker checker(m_context, QVector(), sourceLocation(complexType)); if (!checker.valuesAreEqual(attributeUse->valueConstraint()->value(), baseAttributeUse->valueConstraint()->value(), attributeUse->attribute()->type())) { - m_context->error(QtXmlPatterns::tr("attribute %1 in derived complex type must have the same %2 value constraint like in base type") + m_context->error(QtXmlPatterns::tr("Attribute %1 in derived complex type must have the same %2 value constraint like in base type.") .arg(formatKeyword(attributeUse->attribute()->displayName(m_namePool))) .arg(formatData("fixed")), XsdSchemaContext::XSDError, sourceLocation(complexType)); return; } } else { - m_context->error(QtXmlPatterns::tr("attribute %1 in derived complex type must have %2 value constraint") + m_context->error(QtXmlPatterns::tr("Attribute %1 in derived complex type must have %2 value constraint.") .arg(formatKeyword(attributeUse->attribute()->displayName(m_namePool))) .arg(formatData("fixed")), XsdSchemaContext::XSDError, sourceLocation(complexType)); @@ -1946,7 +1946,7 @@ void XsdSchemaChecker::checkAttributeUseConstraints() const XsdWildcard::Ptr derivedWildcard(complexType->attributeWildcard()); if (baseWildcard && derivedWildcard) { if (!XsdSchemaHelper::checkWildcardProcessContents(baseWildcard, derivedWildcard)) { - m_context->error(QtXmlPatterns::tr("processContent of base wildcard must be weaker than derived wildcard"), XsdSchemaContext::XSDError, sourceLocation(complexType)); + m_context->error(QtXmlPatterns::tr("processContent of base wildcard must be weaker than derived wildcard."), XsdSchemaContext::XSDError, sourceLocation(complexType)); return; } } @@ -1985,7 +1985,7 @@ void XsdSchemaChecker::checkElementDuplicates(const XsdParticle::Ptr &particle, if (elementMap.contains(element->name(m_namePool))) { if (element->type() != elementMap.value(element->name(m_namePool))) { - m_context->error(QtXmlPatterns::tr("element %1 exists twice with different types") + m_context->error(QtXmlPatterns::tr("Element %1 exists twice with different types.") .arg(formatKeyword(element->displayName(m_namePool))), XsdSchemaContext::XSDError, sourceLocation(element)); return; @@ -2000,7 +2000,7 @@ void XsdSchemaChecker::checkElementDuplicates(const XsdParticle::Ptr &particle, const XsdElement::Ptr substElement = substElements.at(i); if (elementMap.contains(substElement->name(m_namePool))) { if (substElement->type() != elementMap.value(substElement->name(m_namePool))) { - m_context->error(QtXmlPatterns::tr("element %1 exists twice with different types") + m_context->error(QtXmlPatterns::tr("Element %1 exists twice with different types.") .arg(formatKeyword(substElement->displayName(m_namePool))), XsdSchemaContext::XSDError, sourceLocation(element)); return; @@ -2028,7 +2028,7 @@ void XsdSchemaChecker::checkElementDuplicates(const XsdParticle::Ptr &particle, } if (error) { - m_context->error(QtXmlPatterns::tr("particle contains non-deterministic wildcards"), XsdSchemaContext::XSDError, sourceLocation(wildcard)); + m_context->error(QtXmlPatterns::tr("Particle contains non-deterministic wildcards."), XsdSchemaContext::XSDError, sourceLocation(wildcard)); return; } else { wildcardMap.insert(wildcard->namespaceConstraint()->variety(), wildcard); diff --git a/src/xmlpatterns/schema/qxsdschemahelper.cpp b/src/xmlpatterns/schema/qxsdschemahelper.cpp index 3173498..a56f3ef 100644 --- a/src/xmlpatterns/schema/qxsdschemahelper.cpp +++ b/src/xmlpatterns/schema/qxsdschemahelper.cpp @@ -688,13 +688,13 @@ bool XsdSchemaHelper::isValidAttributeUsesRestriction(const XsdAttributeUse::Lis // 2.1.1 if (baseAttributeUse->isRequired() == true && derivedAttributeUse->isRequired() == false) { - errorMsg = QtXmlPatterns::tr("base attribute %1 is required but derived attribute is not").arg(formatAttribute(baseAttributeUse->attribute()->displayName(namePool))); + errorMsg = QtXmlPatterns::tr("Base attribute %1 is required but derived attribute is not.").arg(formatAttribute(baseAttributeUse->attribute()->displayName(namePool))); return false; } // 2.1.2 if (!isSimpleDerivationOk(derivedAttributeUse->attribute()->type(), baseAttributeUse->attribute()->type(), SchemaType::DerivationConstraints())) { - errorMsg = QtXmlPatterns::tr("type of derived attribute %1 cannot be validly derived from type of base attribute").arg(formatAttribute(derivedAttributeUse->attribute()->displayName(namePool))); + errorMsg = QtXmlPatterns::tr("Type of derived attribute %1 cannot be validly derived from type of base attribute.").arg(formatAttribute(derivedAttributeUse->attribute()->displayName(namePool))); return false; } @@ -722,12 +722,12 @@ bool XsdSchemaHelper::isValidAttributeUsesRestriction(const XsdAttributeUse::Lis } if (!ok) { - errorMsg = QtXmlPatterns::tr("value constraint of derived attribute %1 does not match value constraint of base attribute").arg(formatAttribute(derivedAttributeUse->attribute()->displayName(namePool))); + errorMsg = QtXmlPatterns::tr("Value constraint of derived attribute %1 does not match value constraint of base attribute.").arg(formatAttribute(derivedAttributeUse->attribute()->displayName(namePool))); return false; } } else { if (!wildcard) { - errorMsg = QtXmlPatterns::tr("derived attribute %1 does not exists in the base definition").arg(formatAttribute(derivedAttributeUse->attribute()->displayName(namePool))); + errorMsg = QtXmlPatterns::tr("Derived attribute %1 does not exists in the base definition.").arg(formatAttribute(derivedAttributeUse->attribute()->displayName(namePool))); return false; } @@ -738,7 +738,7 @@ bool XsdSchemaHelper::isValidAttributeUsesRestriction(const XsdAttributeUse::Lis name.setNamespaceURI(namePool->allocateNamespace(XsdWildcard::absentNamespace())); if (!wildcardAllowsExpandedName(name, wildcard, namePool)) { - errorMsg = QtXmlPatterns::tr("derived attribute %1 does not match the wildcard in the base definition").arg(formatAttribute(derivedAttributeUse->attribute()->displayName(namePool))); + errorMsg = QtXmlPatterns::tr("Derived attribute %1 does not match the wildcard in the base definition.").arg(formatAttribute(derivedAttributeUse->attribute()->displayName(namePool))); return false; } } @@ -751,11 +751,11 @@ bool XsdSchemaHelper::isValidAttributeUsesRestriction(const XsdAttributeUse::Lis if (baseAttributeUse->isRequired()) { if (derivedAttributeUsesLookup.contains(baseAttributeUse->attribute()->name(namePool))) { if (!derivedAttributeUsesLookup.value(baseAttributeUse->attribute()->name(namePool))->isRequired()) { - errorMsg = QtXmlPatterns::tr("base attribute %1 is required but derived attribute is not").arg(formatAttribute(baseAttributeUse->attribute()->displayName(namePool))); + errorMsg = QtXmlPatterns::tr("Base attribute %1 is required but derived attribute is not.").arg(formatAttribute(baseAttributeUse->attribute()->displayName(namePool))); return false; } } else { - errorMsg = QtXmlPatterns::tr("base attribute %1 is required but missing in derived definition").arg(formatAttribute(baseAttributeUse->attribute()->displayName(namePool))); + errorMsg = QtXmlPatterns::tr("Base attribute %1 is required but missing in derived definition.").arg(formatAttribute(baseAttributeUse->attribute()->displayName(namePool))); return false; } } @@ -764,17 +764,17 @@ bool XsdSchemaHelper::isValidAttributeUsesRestriction(const XsdAttributeUse::Lis // 4 if (derivedWildcard) { if (!wildcard) { - errorMsg = QtXmlPatterns::tr("derived definition contains an %1 element that does not exists in the base definition").arg(formatElement("anyAttribute")); + errorMsg = QtXmlPatterns::tr("Derived definition contains an %1 element that does not exists in the base definition").arg(formatElement("anyAttribute.")); return false; } if (!isWildcardSubset(derivedWildcard, wildcard)) { - errorMsg = QtXmlPatterns::tr("derived wildcard is not a subset of the base wildcard"); + errorMsg = QtXmlPatterns::tr("Derived wildcard is not a subset of the base wildcard."); return false; } if (!checkWildcardProcessContents(wildcard, derivedWildcard)) { - errorMsg = QtXmlPatterns::tr("%1 of derived wildcard is not a valid restriction of %2 of base wildcard").arg(formatKeyword("processContents")).arg(formatKeyword("processContents")); + errorMsg = QtXmlPatterns::tr("%1 of derived wildcard is not a valid restriction of %2 of base wildcard").arg(formatKeyword("processContents")).arg(formatKeyword("processContents.")); return false; } } @@ -797,12 +797,12 @@ bool XsdSchemaHelper::isValidAttributeUsesExtension(const XsdAttributeUse::List for (int i = 0; i < attributeUses.count(); ++i) { const QXmlName attributeName = attributeUses.at(i)->attribute()->name(namePool); if (!lookupHash.contains(attributeName)) { - errorMsg = QtXmlPatterns::tr("attribute %1 from base type is missing in derived type").arg(formatKeyword(namePool->displayName(attributeName))); + errorMsg = QtXmlPatterns::tr("Attribute %1 from base type is missing in derived type.").arg(formatKeyword(namePool->displayName(attributeName))); return false; } if (lookupHash.value(attributeName)->type() != attributeUses.at(i)->attribute()->type()) { - errorMsg = QtXmlPatterns::tr("type of derived attribute %1 differs from type of base attribute").arg(formatKeyword(namePool->displayName(attributeName))); + errorMsg = QtXmlPatterns::tr("Type of derived attribute %1 differs from type of base attribute.").arg(formatKeyword(namePool->displayName(attributeName))); return false; } } @@ -810,7 +810,7 @@ bool XsdSchemaHelper::isValidAttributeUsesExtension(const XsdAttributeUse::List // 1.3 if (wildcard) { if (!derivedWildcard) { - errorMsg = QtXmlPatterns::tr("base definition contains an %1 element that is missing in the derived definition").arg(formatElement("anyAttribute")); + errorMsg = QtXmlPatterns::tr("Base definition contains an %1 element that is missing in the derived definition").arg(formatElement("anyAttribute.")); return false; } } diff --git a/src/xmlpatterns/schema/qxsdschemaparser.cpp b/src/xmlpatterns/schema/qxsdschemaparser.cpp index 19a8425..8f7b6af 100644 --- a/src/xmlpatterns/schema/qxsdschemaparser.cpp +++ b/src/xmlpatterns/schema/qxsdschemaparser.cpp @@ -166,7 +166,7 @@ class TagValidationHandler for (int i = 0; i < tokens.count(); ++i) elementNames.append(formatElement(XsdSchemaToken::toString(tokens.at(i)))); - m_parser->error(QtXmlPatterns::tr("can not process unknown element %1, expected elements are: %2") + m_parser->error(QtXmlPatterns::tr("Can not process unknown element %1, expected elements are: %2.") .arg(formatElement(m_parser->name().toString())) .arg(elementNames.join(QLatin1String(", ")))); return; @@ -179,7 +179,7 @@ class TagValidationHandler for (int i = 0; i < tokens.count(); ++i) elementNames.append(formatElement(XsdSchemaToken::toString(tokens.at(i)))); - m_parser->error(QtXmlPatterns::tr("element %1 is not allowed in this scope, possible elements are: %2") + m_parser->error(QtXmlPatterns::tr("Element %1 is not allowed in this scope, possible elements are: %2.") .arg(formatElement(XsdSchemaToken::toString(token))) .arg(elementNames.join(QLatin1String(", ")))); return; @@ -195,7 +195,7 @@ class TagValidationHandler for (int i = 0; i < tokens.count(); ++i) elementNames.append(formatElement(XsdSchemaToken::toString(tokens.at(i)))); - m_parser->error(QtXmlPatterns::tr("child element is missing in that scope, possible child elements are: %1") + m_parser->error(QtXmlPatterns::tr("Child element is missing in that scope, possible child elements are: %1.") .arg(elementNames.join(QLatin1String(", ")))); } } @@ -322,7 +322,7 @@ bool XsdSchemaParser::parse(ParserType parserType) if (isSchemaTag(XsdSchemaToken::Schema, token, namespaceToken)) { parseSchema(parserType); } else { - error(QtXmlPatterns::tr("document is not a XML schema")); + error(QtXmlPatterns::tr("Document is not a XML schema.")); } } } @@ -344,13 +344,13 @@ void XsdSchemaParser::error(const QString &msg) void XsdSchemaParser::attributeContentError(const char *attributeName, const char *elementName, const QString &value, const SchemaType::Ptr &type) { if (type) { - error(QtXmlPatterns::tr("%1 attribute of %2 element contains invalid content: {%3} is not a value of type %4") + error(QtXmlPatterns::tr("%1 attribute of %2 element contains invalid content: {%3} is not a value of type %4.") .arg(formatAttribute(attributeName)) .arg(formatElement(elementName)) .arg(formatData(value)) .arg(formatType(m_namePool, type))); } else { - error(QtXmlPatterns::tr("%1 attribute of %2 element contains invalid content: {%3}") + error(QtXmlPatterns::tr("%1 attribute of %2 element contains invalid content: {%3}.") .arg(formatAttribute(attributeName)) .arg(formatElement(elementName)) .arg(formatData(value))); @@ -376,7 +376,7 @@ void XsdSchemaParser::parseSchema(ParserType parserType) const QString targetNamespace = readNamespaceAttribute(QString::fromLatin1("targetNamespace"), "schema"); if (m_targetNamespace != targetNamespace) { - error(QtXmlPatterns::tr("target namespace %1 of included schema is different from the target namespace %2 as defined by the including schema") + error(QtXmlPatterns::tr("Target namespace %1 of included schema is different from the target namespace %2 as defined by the including schema.") .arg(formatURI(targetNamespace)).arg(formatURI(m_targetNamespace))); return; } @@ -390,7 +390,7 @@ void XsdSchemaParser::parseSchema(ParserType parserType) } if (m_targetNamespace != targetNamespace) { - error(QtXmlPatterns::tr("target namespace %1 of imported schema is different from the target namespace %2 as defined by the importing schema") + error(QtXmlPatterns::tr("Target namespace %1 of imported schema is different from the target namespace %2 as defined by the importing schema.") .arg(formatURI(targetNamespace)).arg(formatURI(m_targetNamespace))); return; } @@ -401,7 +401,7 @@ void XsdSchemaParser::parseSchema(ParserType parserType) const QString targetNamespace = readNamespaceAttribute(QString::fromLatin1("targetNamespace"), "schema"); if (m_targetNamespace != targetNamespace) { - error(QtXmlPatterns::tr("target namespace %1 of imported schema is different from the target namespace %2 as defined by the importing schema") + error(QtXmlPatterns::tr("Target namespace %1 of imported schema is different from the target namespace %2 as defined by the importing schema.") .arg(formatURI(targetNamespace)).arg(formatURI(m_targetNamespace))); return; } @@ -638,7 +638,7 @@ void XsdSchemaParser::parseImport() if (hasAttribute(QString::fromLatin1("namespace"))) { importNamespace = readAttribute(QString::fromLatin1("namespace")); if (importNamespace == m_targetNamespace) { - error(QtXmlPatterns::tr("%1 element is not allowed to have the same %2 attribute value as the target namespace %3") + error(QtXmlPatterns::tr("%1 element is not allowed to have the same %2 attribute value as the target namespace %3.") .arg(formatElement("import")) .arg(formatAttribute("namespace")) .arg(formatURI(m_targetNamespace))); @@ -646,7 +646,7 @@ void XsdSchemaParser::parseImport() } } else { if (m_targetNamespace.isEmpty()) { - error(QtXmlPatterns::tr("%1 element without %2 attribute is not allowed inside schema without target namespace") + error(QtXmlPatterns::tr("%1 element without %2 attribute is not allowed inside schema without target namespace.") .arg(formatElement("import")) .arg(formatAttribute("namespace"))); return; @@ -1479,7 +1479,7 @@ void XsdSchemaParser::parseSimpleRestriction(const XsdSimpleType::Ptr &ptr) ptr->addAnnotation(annotation); } else if (isSchemaTag(XsdSchemaToken::SimpleType, token, namespaceToken)) { if (hasBaseAttribute) { - error(QtXmlPatterns::tr("%1 element is not allowed inside %2 element if %3 attribute is present") + error(QtXmlPatterns::tr("%1 element is not allowed inside %2 element if %3 attribute is present.") .arg(formatElement("simpleType")) .arg(formatElement("restriction")) .arg(formatAttribute("base"))); @@ -1540,7 +1540,7 @@ void XsdSchemaParser::parseSimpleRestriction(const XsdSimpleType::Ptr &ptr) } if (!hasBaseTypeSpecified) { - error(QtXmlPatterns::tr("%1 element has neither %2 attribute nor %3 child element") + error(QtXmlPatterns::tr("%1 element has neither %2 attribute nor %3 child element.") .arg(formatElement("restriction")) .arg(formatAttribute("base")) .arg(formatElement("simpleType"))); @@ -1637,7 +1637,7 @@ void XsdSchemaParser::parseList(const XsdSimpleType::Ptr &ptr) ptr->addAnnotation(annotation); } else if (isSchemaTag(XsdSchemaToken::SimpleType, token, namespaceToken)) { if (hasItemTypeAttribute) { - error(QtXmlPatterns::tr("%1 element is not allowed inside %2 element if %3 attribute is present") + error(QtXmlPatterns::tr("%1 element is not allowed inside %2 element if %3 attribute is present.") .arg(formatElement("simpleType")) .arg(formatElement("list")) .arg(formatAttribute("itemType"))); @@ -1659,7 +1659,7 @@ void XsdSchemaParser::parseList(const XsdSimpleType::Ptr &ptr) } if (!hasItemTypeSpecified) { - error(QtXmlPatterns::tr("%1 element has neither %2 attribute nor %3 child element") + error(QtXmlPatterns::tr("%1 element has neither %2 attribute nor %3 child element.") .arg(formatElement("list")) .arg(formatAttribute("itemType")) .arg(formatElement("simpleType"))); @@ -1751,7 +1751,7 @@ void XsdSchemaParser::parseUnion(const XsdSimpleType::Ptr &ptr) } if (!hasMemberTypesSpecified) { - error(QtXmlPatterns::tr("%1 element has neither %2 attribute nor %3 child element") + error(QtXmlPatterns::tr("%1 element has neither %2 attribute nor %3 child element.") .arg(formatElement("union")) .arg(formatAttribute("memberTypes")) .arg(formatElement("simpleType"))); @@ -2586,7 +2586,7 @@ XsdComplexType::Ptr XsdSchemaParser::parseGlobalComplexType() complexType->addAnnotation(annotation); } else if (isSchemaTag(XsdSchemaToken::SimpleContent, token, namespaceToken)) { if (effectiveMixed) { - error(QtXmlPatterns::tr("%1 element with %2 child element must not have a %3 attribute") + error(QtXmlPatterns::tr("%1 element with %2 child element must not have a %3 attribute.") .arg(formatElement("complexType")) .arg(formatElement("simpleContent")) .arg(formatAttribute("mixed"))); @@ -3588,7 +3588,7 @@ XsdModelGroup::Ptr XsdSchemaParser::parseAll(const NamedSchemaComponent::Ptr &pa particle->setTerm(term); if (particle->maximumOccursUnbounded() || particle->maximumOccurs() > 1) { - error(QtXmlPatterns::tr("%1 attribute of %2 element must be %3 or %4") + error(QtXmlPatterns::tr("%1 attribute of %2 element must be %3 or %4.") .arg(formatAttribute("maxOccurs")) .arg(formatElement("all")) .arg(formatData("0")) @@ -3624,14 +3624,14 @@ XsdModelGroup::Ptr XsdSchemaParser::parseLocalAll(const XsdParticle::Ptr &partic return modelGroup; } if (particle->maximumOccursUnbounded() || particle->maximumOccurs() != 1) { - error(QtXmlPatterns::tr("%1 attribute of %2 element must have a value of %3") + error(QtXmlPatterns::tr("%1 attribute of %2 element must have a value of %3.") .arg(formatAttribute("maxOccurs")) .arg(formatElement("all")) .arg(formatData("1"))); return modelGroup; } if (particle->minimumOccurs() != 0 && particle->minimumOccurs() != 1) { - error(QtXmlPatterns::tr("%1 attribute of %2 element must have a value of %3 or %4") + error(QtXmlPatterns::tr("%1 attribute of %2 element must have a value of %3 or %4.") .arg(formatAttribute("minOccurs")) .arg(formatElement("all")) .arg(formatData("0")) @@ -3665,7 +3665,7 @@ XsdModelGroup::Ptr XsdSchemaParser::parseLocalAll(const XsdParticle::Ptr &partic particle->setTerm(term); if (particle->maximumOccursUnbounded() || particle->maximumOccurs() > 1) { - error(QtXmlPatterns::tr("%1 attribute of %2 element must have a value of %3 or %4") + error(QtXmlPatterns::tr("%1 attribute of %2 element must have a value of %3 or %4.") .arg(formatAttribute("maxOccurs")) .arg(formatElement("all")) .arg(formatData("0")) @@ -3984,7 +3984,7 @@ XsdAttribute::Ptr XsdSchemaParser::parseGlobalAttribute() attribute->scope()->setVariety(XsdAttribute::Scope::Global); if (hasAttribute(QString::fromLatin1("default")) && hasAttribute(QString::fromLatin1("fixed"))) { - error(QtXmlPatterns::tr("%1 element must not have %2 and %3 attribute together") + error(QtXmlPatterns::tr("%1 element must not have %2 and %3 attribute together.") .arg(formatElement("attribute")) .arg(formatAttribute("default")) .arg(formatAttribute("fixed"))); @@ -4011,14 +4011,14 @@ XsdAttribute::Ptr XsdSchemaParser::parseGlobalAttribute() (m_namePool->stringForLocalName(objectName.localName()) != QString::fromLatin1("schemaLocation")) && (m_namePool->stringForLocalName(objectName.localName()) != QString::fromLatin1("noNamespaceSchemaLocation"))) { - error(QtXmlPatterns::tr("content of %1 attribute of %2 element must not be from namespace %3") + error(QtXmlPatterns::tr("Content of %1 attribute of %2 element must not be from namespace %3.") .arg(formatAttribute("name")) .arg(formatElement("attribute")) .arg(formatURI(CommonNamespaces::XSI))); return attribute; } if (m_namePool->stringForLocalName(objectName.localName()) == QString::fromLatin1("xmlns")) { - error(QtXmlPatterns::tr("%1 attribute of %2 element must not be %3") + error(QtXmlPatterns::tr("%1 attribute of %2 element must not be %3.") .arg(formatAttribute("name")) .arg(formatElement("attribute")) .arg(formatData("xmlns"))); @@ -4060,7 +4060,7 @@ XsdAttribute::Ptr XsdSchemaParser::parseGlobalAttribute() attribute->addAnnotation(annotation); } else if (isSchemaTag(XsdSchemaToken::SimpleType, token, namespaceToken)) { if (hasTypeAttribute) { - error(QtXmlPatterns::tr("%1 element with %2 child element must not have a %3 attribute") + error(QtXmlPatterns::tr("%1 element with %2 child element must not have a %3 attribute.") .arg(formatElement("attribute")) .arg(formatElement("simpleType")) .arg(formatAttribute("type"))); @@ -4113,7 +4113,7 @@ XsdAttributeUse::Ptr XsdSchemaParser::parseLocalAttribute(const NamedSchemaCompo } if (hasAttribute(QString::fromLatin1("default")) && hasAttribute(QString::fromLatin1("fixed"))) { - error(QtXmlPatterns::tr("%1 element must not have %2 and %3 attribute together") + error(QtXmlPatterns::tr("%1 element must not have %2 and %3 attribute together.") .arg(formatElement("attribute")) .arg(formatAttribute("default")) .arg(formatAttribute("fixed"))); @@ -4122,21 +4122,21 @@ XsdAttributeUse::Ptr XsdSchemaParser::parseLocalAttribute(const NamedSchemaCompo if (hasRefAttribute) { if (hasAttribute(QString::fromLatin1("form"))) { - error(QtXmlPatterns::tr("%1 element must not have %2 and %3 attribute together") + error(QtXmlPatterns::tr("%1 element must not have %2 and %3 attribute together.") .arg(formatElement("attribute")) .arg(formatAttribute("ref")) .arg(formatAttribute("form"))); return attributeUse; } if (hasAttribute(QString::fromLatin1("name"))) { - error(QtXmlPatterns::tr("%1 element must not have %2 and %3 attribute together") + error(QtXmlPatterns::tr("%1 element must not have %2 and %3 attribute together.") .arg(formatElement("attribute")) .arg(formatAttribute("ref")) .arg(formatAttribute("name"))); return attributeUse; } if (hasAttribute(QString::fromLatin1("type"))) { - error(QtXmlPatterns::tr("%1 element must not have %2 and %3 attribute together") + error(QtXmlPatterns::tr("%1 element must not have %2 and %3 attribute together.") .arg(formatElement("attribute")) .arg(formatAttribute("ref")) .arg(formatAttribute("type"))); @@ -4176,7 +4176,7 @@ XsdAttributeUse::Ptr XsdSchemaParser::parseLocalAttribute(const NamedSchemaCompo attributeUse->setUseType(XsdAttributeUse::RequiredUse); if (attributeUse->valueConstraint() && attributeUse->valueConstraint()->variety() == XsdAttributeUse::ValueConstraint::Default && value != QString::fromLatin1("optional")) { - error(QtXmlPatterns::tr("%1 attribute of %2 element must have the value %3 because the %4 attribute is set") + error(QtXmlPatterns::tr("%1 attribute of %2 element must have the value %3 because the %4 attribute is set.") .arg(formatAttribute("use")) .arg(formatElement("attribute")) .arg(formatData("optional")) @@ -4233,14 +4233,14 @@ XsdAttributeUse::Ptr XsdSchemaParser::parseLocalAttribute(const NamedSchemaCompo (m_namePool->stringForLocalName(objectName.localName()) != QString::fromLatin1("schemaLocation")) && (m_namePool->stringForLocalName(objectName.localName()) != QString::fromLatin1("noNamespaceSchemaLocation"))) { - error(QtXmlPatterns::tr("content of %1 attribute of %2 element must not be from namespace %3") + error(QtXmlPatterns::tr("Content of %1 attribute of %2 element must not be from namespace %3.") .arg(formatAttribute("name")) .arg(formatElement("attribute")) .arg(formatURI(CommonNamespaces::XSI))); return attributeUse; } if (m_namePool->stringForLocalName(objectName.localName()) == QString::fromLatin1("xmlns")) { - error(QtXmlPatterns::tr("%1 attribute of %2 element must not be %3") + error(QtXmlPatterns::tr("%1 attribute of %2 element must not be %3.") .arg(formatAttribute("name")) .arg(formatElement("attribute")) .arg(formatData("xmlns"))); @@ -4292,14 +4292,14 @@ XsdAttributeUse::Ptr XsdSchemaParser::parseLocalAttribute(const NamedSchemaCompo attribute->addAnnotation(annotation); } else if (isSchemaTag(XsdSchemaToken::SimpleType, token, namespaceToken)) { if (hasTypeAttribute) { - error(QtXmlPatterns::tr("%1 element with %2 child element must not have a %3 attribute") + error(QtXmlPatterns::tr("%1 element with %2 child element must not have a %3 attribute.") .arg(formatElement("attribute")) .arg(formatElement("simpleType")) .arg(formatAttribute("type"))); break; } if (hasRefAttribute) { - error(QtXmlPatterns::tr("%1 element with %2 child element must not have a %3 attribute") + error(QtXmlPatterns::tr("%1 element with %2 child element must not have a %3 attribute.") .arg(formatElement("attribute")) .arg(formatElement("simpleType")) .arg(formatAttribute("ref"))); @@ -4363,7 +4363,7 @@ XsdAttributeGroup::Ptr XsdSchemaParser::parseNamedAttributeGroup() const XsdAttributeUse::Ptr attributeUse = parseLocalAttribute(attributeGroup); if (attributeUse->useType() == XsdAttributeUse::ProhibitedUse) { - warning(QtXmlPatterns::tr("specifying use='prohibited' inside an attribute group has no effect")); + warning(QtXmlPatterns::tr("Specifying use='prohibited' inside an attribute group has no effect.")); } else { attributeGroup->addAttributeUse(attributeUse); } @@ -4463,7 +4463,7 @@ XsdElement::Ptr XsdSchemaParser::parseGlobalElement() } if (hasAttribute(QString::fromLatin1("default")) && hasAttribute(QString::fromLatin1("fixed"))) { - error(QtXmlPatterns::tr("%1 element must not have %2 and %3 attribute together") + error(QtXmlPatterns::tr("%1 element must not have %2 and %3 attribute together.") .arg(formatElement("element")) .arg(formatAttribute("default")) .arg(formatAttribute("fixed"))); @@ -4559,7 +4559,7 @@ XsdElement::Ptr XsdSchemaParser::parseGlobalElement() element->addAnnotation(annotation); } else if (isSchemaTag(XsdSchemaToken::SimpleType, token, namespaceToken)) { if (hasTypeAttribute) { - error(QtXmlPatterns::tr("%1 element with %2 child element must not have a %3 attribute") + error(QtXmlPatterns::tr("%1 element with %2 child element must not have a %3 attribute.") .arg(formatElement("element")) .arg(formatElement("simpleType")) .arg(formatAttribute("type"))); @@ -4576,7 +4576,7 @@ XsdElement::Ptr XsdSchemaParser::parseGlobalElement() hasTypeSpecified = true; } else if (isSchemaTag(XsdSchemaToken::ComplexType, token, namespaceToken)) { if (hasTypeAttribute) { - error(QtXmlPatterns::tr("%1 element with %2 child element must not have a %3 attribute") + error(QtXmlPatterns::tr("%1 element with %2 child element must not have a %3 attribute.") .arg(formatElement("element")) .arg(formatElement("complexType")) .arg(formatAttribute("type"))); @@ -4666,43 +4666,43 @@ XsdTerm::Ptr XsdSchemaParser::parseLocalElement(const XsdParticle::Ptr &particle if (hasRefAttribute) { if (hasAttribute(QString::fromLatin1("name"))) { - error(QtXmlPatterns::tr("%1 element must not have %2 and %3 attribute together") + error(QtXmlPatterns::tr("%1 element must not have %2 and %3 attribute together.") .arg(formatElement("element")) .arg(formatAttribute("ref")) .arg(formatAttribute("name"))); return term; } else if (hasAttribute(QString::fromLatin1("block"))) { - error(QtXmlPatterns::tr("%1 element must not have %2 and %3 attribute together") + error(QtXmlPatterns::tr("%1 element must not have %2 and %3 attribute together.") .arg(formatElement("element")) .arg(formatAttribute("ref")) .arg(formatAttribute("block"))); return term; } else if (hasAttribute(QString::fromLatin1("nillable"))) { - error(QtXmlPatterns::tr("%1 element must not have %2 and %3 attribute together") + error(QtXmlPatterns::tr("%1 element must not have %2 and %3 attribute together.") .arg(formatElement("element")) .arg(formatAttribute("ref")) .arg(formatAttribute("nillable"))); return term; } else if (hasAttribute(QString::fromLatin1("default"))) { - error(QtXmlPatterns::tr("%1 element must not have %2 and %3 attribute together") + error(QtXmlPatterns::tr("%1 element must not have %2 and %3 attribute together.") .arg(formatElement("element")) .arg(formatAttribute("ref")) .arg(formatAttribute("default"))); return term; } else if (hasAttribute(QString::fromLatin1("fixed"))) { - error(QtXmlPatterns::tr("%1 element must not have %2 and %3 attribute together") + error(QtXmlPatterns::tr("%1 element must not have %2 and %3 attribute together.") .arg(formatElement("element")) .arg(formatAttribute("ref")) .arg(formatAttribute("fixed"))); return term; } else if (hasAttribute(QString::fromLatin1("form"))) { - error(QtXmlPatterns::tr("%1 element must not have %2 and %3 attribute together") + error(QtXmlPatterns::tr("%1 element must not have %2 and %3 attribute together.") .arg(formatElement("element")) .arg(formatAttribute("ref")) .arg(formatAttribute("form"))); return term; } else if (hasAttribute(QString::fromLatin1("type"))) { - error(QtXmlPatterns::tr("%1 element must not have %2 and %3 attribute together") + error(QtXmlPatterns::tr("%1 element must not have %2 and %3 attribute together.") .arg(formatElement("element")) .arg(formatAttribute("ref")) .arg(formatAttribute("type"))); @@ -4716,7 +4716,7 @@ XsdTerm::Ptr XsdSchemaParser::parseLocalElement(const XsdParticle::Ptr &particle } if (!hasAttribute(QString::fromLatin1("name")) && !hasAttribute(QString::fromLatin1("ref"))) { - error(QtXmlPatterns::tr("%1 element must have either %2 or %3 attribute") + error(QtXmlPatterns::tr("%1 element must have either %2 or %3 attribute.") .arg(formatElement("element")) .arg(formatAttribute("name")) .arg(formatAttribute("ref"))); @@ -4779,7 +4779,7 @@ XsdTerm::Ptr XsdSchemaParser::parseLocalElement(const XsdParticle::Ptr &particle } if (hasAttribute(QString::fromLatin1("default")) && hasAttribute(QString::fromLatin1("fixed"))) { - error(QtXmlPatterns::tr("%1 element must not have %2 and %3 attribute together") + error(QtXmlPatterns::tr("%1 element must not have %2 and %3 attribute together.") .arg(formatElement("element")) .arg(formatAttribute("default")) .arg(formatAttribute("fixed"))); @@ -4834,13 +4834,13 @@ XsdTerm::Ptr XsdSchemaParser::parseLocalElement(const XsdParticle::Ptr &particle element->addAnnotation(annotation); } else if (isSchemaTag(XsdSchemaToken::SimpleType, token, namespaceToken)) { if (hasRefAttribute) { - error(QtXmlPatterns::tr("%1 element with %2 child element must not have a %3 attribute") + error(QtXmlPatterns::tr("%1 element with %2 child element must not have a %3 attribute.") .arg(formatElement("element")) .arg(formatElement("simpleType")) .arg(formatAttribute("ref"))); return term; } else if (hasTypeAttribute) { - error(QtXmlPatterns::tr("%1 element with %2 child element must not have a %3 attribute") + error(QtXmlPatterns::tr("%1 element with %2 child element must not have a %3 attribute.") .arg(formatElement("element")) .arg(formatElement("simpleType")) .arg(formatAttribute("type"))); @@ -4857,13 +4857,13 @@ XsdTerm::Ptr XsdSchemaParser::parseLocalElement(const XsdParticle::Ptr &particle hasTypeSpecified = true; } else if (isSchemaTag(XsdSchemaToken::ComplexType, token, namespaceToken)) { if (hasRefAttribute) { - error(QtXmlPatterns::tr("%1 element with %2 child element must not have a %3 attribute") + error(QtXmlPatterns::tr("%1 element with %2 child element must not have a %3 attribute.") .arg(formatElement("element")) .arg(formatElement("complexType")) .arg(formatAttribute("ref"))); return term; } else if (hasTypeAttribute) { - error(QtXmlPatterns::tr("%1 element with %2 child element must not have a %3 attribute") + error(QtXmlPatterns::tr("%1 element with %2 child element must not have a %3 attribute.") .arg(formatElement("element")) .arg(formatElement("complexType")) .arg(formatAttribute("type"))); @@ -4880,7 +4880,7 @@ XsdTerm::Ptr XsdSchemaParser::parseLocalElement(const XsdParticle::Ptr &particle hasTypeSpecified = true; } else if (isSchemaTag(XsdSchemaToken::Alternative, token, namespaceToken)) { if (hasRefAttribute) { - error(QtXmlPatterns::tr("%1 element with %2 child element must not have a %3 attribute") + error(QtXmlPatterns::tr("%1 element with %2 child element must not have a %3 attribute.") .arg(formatElement("element")) .arg(formatElement("alternative")) .arg(formatAttribute("ref"))); @@ -4891,7 +4891,7 @@ XsdTerm::Ptr XsdSchemaParser::parseLocalElement(const XsdParticle::Ptr &particle alternatives.append(alternative); } else if (isSchemaTag(XsdSchemaToken::Unique, token, namespaceToken)) { if (hasRefAttribute) { - error(QtXmlPatterns::tr("%1 element with %2 child element must not have a %3 attribute") + error(QtXmlPatterns::tr("%1 element with %2 child element must not have a %3 attribute.") .arg(formatElement("element")) .arg(formatElement("unique")) .arg(formatAttribute("ref"))); @@ -4902,7 +4902,7 @@ XsdTerm::Ptr XsdSchemaParser::parseLocalElement(const XsdParticle::Ptr &particle element->addIdentityConstraint(constraint); } else if (isSchemaTag(XsdSchemaToken::Key, token, namespaceToken)) { if (hasRefAttribute) { - error(QtXmlPatterns::tr("%1 element with %2 child element must not have a %3 attribute") + error(QtXmlPatterns::tr("%1 element with %2 child element must not have a %3 attribute.") .arg(formatElement("element")) .arg(formatElement("key")) .arg(formatAttribute("ref"))); @@ -4913,7 +4913,7 @@ XsdTerm::Ptr XsdSchemaParser::parseLocalElement(const XsdParticle::Ptr &particle element->addIdentityConstraint(constraint); } else if (isSchemaTag(XsdSchemaToken::Keyref, token, namespaceToken)) { if (hasRefAttribute) { - error(QtXmlPatterns::tr("%1 element with %2 child element must not have a %3 attribute") + error(QtXmlPatterns::tr("%1 element with %2 child element must not have a %3 attribute.") .arg(formatElement("element")) .arg(formatElement("keyref")) .arg(formatAttribute("ref"))); @@ -5270,7 +5270,7 @@ XsdAlternative::Ptr XsdSchemaParser::parseAlternative() tagValidator.finalize(); if (!hasTypeSpecified) { - error(QtXmlPatterns::tr("%1 element must have either %2 attribute or %3 or %4 as child element") + error(QtXmlPatterns::tr("%1 element must have either %2 attribute or %3 or %4 as child element.") .arg(formatElement("alternative")) .arg(formatAttribute("type")) .arg(formatElement("simpleType")) @@ -5325,7 +5325,7 @@ XsdNotation::Ptr XsdSchemaParser::parseNotation() } if (!hasOptionalAttribute) { - error(QtXmlPatterns::tr("%1 element requires either %2 or %3 attribute") + error(QtXmlPatterns::tr("%1 element requires either %2 or %3 attribute.") .arg(formatElement("notation")) .arg(formatAttribute("public")) .arg(formatAttribute("system"))); @@ -5344,7 +5344,7 @@ XsdNotation::Ptr XsdSchemaParser::parseNotation() if (isCharacters() || isEntityReference()) { if (!text().toString().trimmed().isEmpty()) { - error(QtXmlPatterns::tr("text or entity references not allowed inside %1 element").arg(formatElement("notation"))); + error(QtXmlPatterns::tr("Text or entity references not allowed inside %1 element").arg(formatElement("notation."))); return notation; } } @@ -5385,7 +5385,7 @@ XsdWildcard::Ptr XsdSchemaParser::parseAny(const XsdParticle::Ptr &particle) if (hasAttribute(QString::fromLatin1("namespace"))) { const QSet values = readAttribute(QString::fromLatin1("namespace")).split(QLatin1Char(' '), QString::SkipEmptyParts).toSet(); if ((values.contains(QString::fromLatin1("##any")) || values.contains(QString::fromLatin1("##other"))) && values.count() != 1) { - error(QtXmlPatterns::tr("%1 attribute of %2 element must contain %3, %4 or a list of URIs") + error(QtXmlPatterns::tr("%1 attribute of %2 element must contain %3, %4 or a list of URIs.") .arg(formatAttribute("namespace")) .arg(formatElement("any")) .arg(formatData("##any")) @@ -5497,7 +5497,7 @@ XsdWildcard::Ptr XsdSchemaParser::parseAnyAttribute() if (hasAttribute(QString::fromLatin1("namespace"))) { const QSet values = readAttribute(QString::fromLatin1("namespace")).split(QLatin1Char(' '), QString::SkipEmptyParts).toSet(); if ((values.contains(QString::fromLatin1("##any")) || values.contains(QString::fromLatin1("##other"))) && values.count() != 1) { - error(QtXmlPatterns::tr("%1 attribute of %2 element must contain %3, %4 or a list of URIs") + error(QtXmlPatterns::tr("%1 attribute of %2 element must contain %3, %4 or a list of URIs.") .arg(formatAttribute("namespace")) .arg(formatElement("anyAttribute")) .arg(formatData("##any")) @@ -5623,7 +5623,7 @@ void XsdSchemaParser::parseUnknown() m_namespaceSupport.pushContext(); m_namespaceSupport.setPrefixes(namespaceDeclarations()); - error(QtXmlPatterns::tr("%1 element is not allowed in this context").arg(formatElement(name().toString()))); + error(QtXmlPatterns::tr("%1 element is not allowed in this context.").arg(formatElement(name().toString()))); while (!atEnd()) { readNext(); @@ -5676,7 +5676,7 @@ bool XsdSchemaParser::parseMinMaxConstraint(const XsdParticle::Ptr &particle, co if (!particle->maximumOccursUnbounded()) { if (particle->maximumOccurs() < particle->minimumOccurs()) { - error(QtXmlPatterns::tr("%1 attribute of %2 element has larger value than %3 attribute") + error(QtXmlPatterns::tr("%1 attribute of %2 element has larger value than %3 attribute.") .arg(formatAttribute("minOccurs")) .arg(formatElement(elementName)) .arg(formatAttribute("maxOccurs"))); @@ -5701,7 +5701,7 @@ void XsdSchemaParser::convertName(const QString &qualifiedName, NamespaceSupport { bool result = m_namespaceSupport.processName(qualifiedName, type, name); if (!result) { - error(QtXmlPatterns::tr("prefix of qualified name %1 is not defined").arg(formatKeyword(qualifiedName))); + error(QtXmlPatterns::tr("Prefix of qualified name %1 is not defined.").arg(formatKeyword(qualifiedName))); } } @@ -5766,7 +5766,7 @@ SchemaType::DerivationConstraints XsdSchemaParser::readDerivationConstraintAttri } if ((value == QString::fromLatin1("#all")) && values.count() != 1) { - error(QtXmlPatterns::tr("%1 attribute of %2 element must either contain %3 or the other values") + error(QtXmlPatterns::tr("%1 attribute of %2 element must either contain %3 or the other values.") .arg(formatAttribute("final")) .arg(formatElement(elementName)) .arg(formatData("#all"))); @@ -5827,7 +5827,7 @@ NamedSchemaComponent::BlockingConstraints XsdSchemaParser::readBlockingConstrain } if ((value == QString::fromLatin1("#all")) && values.count() != 1) { - error(QtXmlPatterns::tr("%1 attribute of %2 element must either contain %3 or the other values") + error(QtXmlPatterns::tr("%1 attribute of %2 element must either contain %3 or the other values.") .arg(formatAttribute("block")) .arg(formatElement(elementName)) .arg(formatData("#all"))); @@ -5958,7 +5958,7 @@ void XsdSchemaParser::validateIdAttribute(const char *elementName) attributeContentError("id", elementName, value, BuiltinTypes::xsID); } else { if (m_idCache->hasId(value)) { - error(QtXmlPatterns::tr("component with id %1 has been defined previously").arg(formatData(value))); + error(QtXmlPatterns::tr("Component with id %1 has been defined previously.").arg(formatData(value))); } else { m_idCache->addId(value); } @@ -5975,7 +5975,7 @@ void XsdSchemaParser::addElement(const XsdElement::Ptr &element) { const QXmlName objectName = element->name(m_namePool); if (m_schema->element(objectName)) { - error(QtXmlPatterns::tr("element %1 already defined").arg(formatElement(m_namePool->displayName(objectName)))); + error(QtXmlPatterns::tr("Element %1 already defined.").arg(formatElement(m_namePool->displayName(objectName)))); } else { m_schema->addElement(element); m_componentLocationHash.insert(element, currentSourceLocation()); @@ -5986,7 +5986,7 @@ void XsdSchemaParser::addAttribute(const XsdAttribute::Ptr &attribute) { const QXmlName objectName = attribute->name(m_namePool); if (m_schema->attribute(objectName)) { - error(QtXmlPatterns::tr("attribute %1 already defined").arg(formatAttribute(m_namePool->displayName(objectName)))); + error(QtXmlPatterns::tr("Attribute %1 already defined.").arg(formatAttribute(m_namePool->displayName(objectName)))); } else { m_schema->addAttribute(attribute); m_componentLocationHash.insert(attribute, currentSourceLocation()); @@ -6001,7 +6001,7 @@ void XsdSchemaParser::addType(const SchemaType::Ptr &type) const QXmlName objectName = type->name(m_namePool); if (m_schema->type(objectName)) { - error(QtXmlPatterns::tr("type %1 already defined").arg(formatType(m_namePool, objectName))); + error(QtXmlPatterns::tr("Type %1 already defined.").arg(formatType(m_namePool, objectName))); } else { m_schema->addType(type); if (type->isSimpleType()) @@ -6024,7 +6024,7 @@ void XsdSchemaParser::addAttributeGroup(const XsdAttributeGroup::Ptr &group) { const QXmlName objectName = group->name(m_namePool); if (m_schema->attributeGroup(objectName)) { - error(QtXmlPatterns::tr("attribute group %1 already defined").arg(formatKeyword(m_namePool, objectName))); + error(QtXmlPatterns::tr("Attribute group %1 already defined.").arg(formatKeyword(m_namePool, objectName))); } else { m_schema->addAttributeGroup(group); m_componentLocationHash.insert(group, currentSourceLocation()); @@ -6035,7 +6035,7 @@ void XsdSchemaParser::addElementGroup(const XsdModelGroup::Ptr &group) { const QXmlName objectName = group->name(m_namePool); if (m_schema->elementGroup(objectName)) { - error(QtXmlPatterns::tr("element group %1 already defined").arg(formatKeyword(m_namePool, objectName))); + error(QtXmlPatterns::tr("Element group %1 already defined.").arg(formatKeyword(m_namePool, objectName))); } else { m_schema->addElementGroup(group); m_componentLocationHash.insert(group, currentSourceLocation()); @@ -6046,7 +6046,7 @@ void XsdSchemaParser::addNotation(const XsdNotation::Ptr ¬ation) { const QXmlName objectName = notation->name(m_namePool); if (m_schema->notation(objectName)) { - error(QtXmlPatterns::tr("notation %1 already defined").arg(formatKeyword(m_namePool, objectName))); + error(QtXmlPatterns::tr("Notation %1 already defined.").arg(formatKeyword(m_namePool, objectName))); } else { m_schema->addNotation(notation); m_componentLocationHash.insert(notation, currentSourceLocation()); @@ -6057,7 +6057,7 @@ void XsdSchemaParser::addIdentityConstraint(const XsdIdentityConstraint::Ptr &co { const QXmlName objectName = constraint->name(m_namePool); if (m_schema->identityConstraint(objectName)) { - error(QtXmlPatterns::tr("identity constraint %1 already defined").arg(formatKeyword(m_namePool, objectName))); + error(QtXmlPatterns::tr("Identity constraint %1 already defined.").arg(formatKeyword(m_namePool, objectName))); } else { m_schema->addIdentityConstraint(constraint); m_componentLocationHash.insert(constraint, currentSourceLocation()); @@ -6068,7 +6068,7 @@ void XsdSchemaParser::addFacet(const XsdFacet::Ptr &facet, XsdFacet::Hash &facet { // @see http://www.w3.org/TR/xmlschema-2/#src-single-facet-value if (facets.contains(facet->type())) { - error(QtXmlPatterns::tr("duplicated facets in simple type %1").arg(formatType(m_namePool, type))); + error(QtXmlPatterns::tr("Duplicated facets in simple type %1.").arg(formatType(m_namePool, type))); return; } diff --git a/src/xmlpatterns/schema/qxsdschemaresolver.cpp b/src/xmlpatterns/schema/qxsdschemaresolver.cpp index d71f482..3ec598d 100644 --- a/src/xmlpatterns/schema/qxsdschemaresolver.cpp +++ b/src/xmlpatterns/schema/qxsdschemaresolver.cpp @@ -351,7 +351,7 @@ void XsdSchemaResolver::resolveKeyReferences() const XsdIdentityConstraint::Ptr constraint = m_schema->identityConstraint(ref.reference); if (!constraint) { - m_context->error(QtXmlPatterns::tr("%1 references unknown %2 or %3 element %4") + m_context->error(QtXmlPatterns::tr("%1 references unknown %2 or %3 element %4.") .arg(formatKeyword(ref.keyRef->displayName(m_namePool))) .arg(formatElement("key")) .arg(formatElement("unique")) @@ -361,7 +361,7 @@ void XsdSchemaResolver::resolveKeyReferences() } if (constraint->category() != XsdIdentityConstraint::Key && constraint->category() != XsdIdentityConstraint::Unique) { // only key and unique can be referenced - m_context->error(QtXmlPatterns::tr("%1 references identity constraint %2 that is no %3 or %4 element") + m_context->error(QtXmlPatterns::tr("%1 references identity constraint %2 that is no %3 or %4 element.") .arg(formatKeyword(ref.keyRef->displayName(m_namePool))) .arg(formatKeyword(m_namePool, ref.reference)) .arg(formatElement("key")) @@ -371,7 +371,7 @@ void XsdSchemaResolver::resolveKeyReferences() } if (constraint->fields().count() != ref.keyRef->fields().count()) { - m_context->error(QtXmlPatterns::tr("%1 has a different number of fields from the identity constraint %2 that it references") + m_context->error(QtXmlPatterns::tr("%1 has a different number of fields from the identity constraint %2 that it references.") .arg(formatKeyword(ref.keyRef->displayName(m_namePool))) .arg(formatKeyword(m_namePool, ref.reference)), XsdSchemaContext::XSDError, ref.location); @@ -394,7 +394,7 @@ void XsdSchemaResolver::resolveSimpleRestrictionBaseTypes() // maybe it's a basic type... type = m_context->schemaTypeFactory()->createSchemaType(item.baseName); if (!type) { - m_context->error(QtXmlPatterns::tr("base type %1 of %2 element cannot be resolved") + m_context->error(QtXmlPatterns::tr("Base type %1 of %2 element cannot be resolved.") .arg(formatType(m_namePool, item.baseName)) .arg(formatElement("restriction")), XsdSchemaContext::XSDError, item.location); @@ -478,7 +478,7 @@ void XsdSchemaResolver::resolveSimpleListType() // maybe it's a basic type... type = m_context->schemaTypeFactory()->createSchemaType(item.typeName); if (!type) { - m_context->error(QtXmlPatterns::tr("item type %1 of %2 element cannot be resolved") + m_context->error(QtXmlPatterns::tr("Item type %1 of %2 element cannot be resolved.") .arg(formatType(m_namePool, item.typeName)) .arg(formatElement("list")), XsdSchemaContext::XSDError, item.location); @@ -509,7 +509,7 @@ void XsdSchemaResolver::resolveSimpleUnionTypes() // maybe it's a basic type... type = m_context->schemaTypeFactory()->createSchemaType(typeName); if (!type) { - m_context->error(QtXmlPatterns::tr("member type %1 of %2 element cannot be resolved") + m_context->error(QtXmlPatterns::tr("Member type %1 of %2 element cannot be resolved.") .arg(formatType(m_namePool, typeName)) .arg(formatElement("union")), XsdSchemaContext::XSDError, item.location); @@ -537,7 +537,7 @@ void XsdSchemaResolver::resolveElementTypes() // maybe it's a basic type... type = m_context->schemaTypeFactory()->createSchemaType(item.typeName); if (!type) { - m_context->error(QtXmlPatterns::tr("type %1 of %2 element cannot be resolved") + m_context->error(QtXmlPatterns::tr("Type %1 of %2 element cannot be resolved.") .arg(formatType(m_namePool, item.typeName)) .arg(formatElement("element")), XsdSchemaContext::XSDError, item.location); @@ -559,7 +559,7 @@ void XsdSchemaResolver::resolveComplexBaseTypes() // maybe it's a basic type... type = m_context->schemaTypeFactory()->createSchemaType(item.baseName); if (!type) { - m_context->error(QtXmlPatterns::tr("base type %1 of complex type cannot be resolved").arg(formatType(m_namePool, item.baseName)), XsdSchemaContext::XSDError, item.location); + m_context->error(QtXmlPatterns::tr("Base type %1 of complex type cannot be resolved.").arg(formatType(m_namePool, item.baseName)), XsdSchemaContext::XSDError, item.location); return; } } @@ -568,7 +568,7 @@ void XsdSchemaResolver::resolveComplexBaseTypes() if (type->isComplexType() && type->isDefinedBySchema()) { const XsdComplexType::Ptr baseType = type; if (baseType->contentType()->variety() != XsdComplexType::ContentType::Simple) { - m_context->error(QtXmlPatterns::tr("%1 cannot have complex base type that has a %2") + m_context->error(QtXmlPatterns::tr("%1 cannot have complex base type that has a %2.") .arg(formatElement("simpleContent")) .arg(formatElement("complexContent")), XsdSchemaContext::XSDError, item.location); @@ -847,13 +847,13 @@ void XsdSchemaResolver::resolveComplexContentComplexTypes(const XsdComplexType:: group->setCompositor(XsdModelGroup::SequenceCompositor); if (effectiveContent && effectiveContent->term()->isModelGroup() && XsdModelGroup::Ptr(effectiveContent->term())->compositor() == XsdModelGroup::AllCompositor) { - m_context->error(QtXmlPatterns::tr("content model of complex type %1 contains %2 element so it cannot be derived by extension from a non-empty type") + m_context->error(QtXmlPatterns::tr("Content model of complex type %1 contains %2 element so it cannot be derived by extension from a non-empty type.") .arg(formatType(m_namePool, complexType)).arg(formatKeyword("all")), XsdSchemaContext::XSDError, sourceLocation(complexType)); return; } if (baseParticle && baseParticle->term()->isModelGroup() && XsdModelGroup::Ptr(baseParticle->term())->compositor() == XsdModelGroup::AllCompositor) { - m_context->error(QtXmlPatterns::tr("complex type %1 cannot be derived by extension from %2 as the latter contains %3 element in its content model") + m_context->error(QtXmlPatterns::tr("Complex type %1 cannot be derived by extension from %2 as the latter contains %3 element in its content model.") .arg(formatType(m_namePool, complexType)) .arg(formatType(m_namePool, baseType)) .arg(formatKeyword("all")), XsdSchemaContext::XSDError, sourceLocation(complexType)); @@ -945,7 +945,7 @@ void XsdSchemaResolver::resolveAttributeTypes() // maybe it's a basic type... type = m_context->schemaTypeFactory()->createSchemaType(item.typeName); if (!type) { - m_context->error(QtXmlPatterns::tr("type %1 of %2 element cannot be resolved") + m_context->error(QtXmlPatterns::tr("Type %1 of %2 element cannot be resolved.") .arg(formatType(m_namePool, item.typeName)) .arg(formatElement("attribute")), XsdSchemaContext::XSDError, item.location); @@ -954,7 +954,7 @@ void XsdSchemaResolver::resolveAttributeTypes() } if (!type->isSimpleType() && type->category() != SchemaType::None) { - m_context->error(QtXmlPatterns::tr("type of %1 element must be a simple type, %2 is not") + m_context->error(QtXmlPatterns::tr("Type of %1 element must be a simple type, %2 is not.") .arg(formatElement("attribute")) .arg(formatType(m_namePool, item.typeName)), XsdSchemaContext::XSDError, item.location); @@ -975,7 +975,7 @@ void XsdSchemaResolver::resolveAlternativeTypes() // maybe it's a basic type... type = m_context->schemaTypeFactory()->createSchemaType(item.typeName); if (!type) { - m_context->error(QtXmlPatterns::tr("type %1 of %2 element cannot be resolved") + m_context->error(QtXmlPatterns::tr("Type %1 of %2 element cannot be resolved.") .arg(formatType(m_namePool, item.typeName)) .arg(formatElement("alternative")), XsdSchemaContext::XSDError, item.location); @@ -1016,7 +1016,7 @@ void XsdSchemaResolver::resolveSubstitutionGroupAffiliations() for (int j = 0; j < item.elementNames.count(); ++j) { const XsdElement::Ptr element = m_schema->element(item.elementNames.at(j)); if (!element) { - m_context->error(QtXmlPatterns::tr("substitution group %1 of %2 element cannot be resolved") + m_context->error(QtXmlPatterns::tr("Substitution group %1 of %2 element cannot be resolved.") .arg(formatKeyword(m_namePool, item.elementNames.at(j))) .arg(formatElement("element")), XsdSchemaContext::XSDError, item.location); @@ -1025,7 +1025,7 @@ void XsdSchemaResolver::resolveSubstitutionGroupAffiliations() // @see http://www.w3.org/TR/xmlschema11-1/#e-props-correct 5) if (hasCircularSubstitutionGroup(element, item.element, m_namePool)) { - m_context->error(QtXmlPatterns::tr("substitution group %1 has circular definition").arg(formatKeyword(m_namePool, item.elementNames.at(j))), XsdSchemaContext::XSDError, item.location); + m_context->error(QtXmlPatterns::tr("Substitution group %1 has circular definition.").arg(formatKeyword(m_namePool, item.elementNames.at(j))), XsdSchemaContext::XSDError, item.location); return; } @@ -1145,14 +1145,14 @@ void XsdSchemaResolver::resolveTermReference(const XsdParticle::Ptr &particle, Q if (element->name(m_namePool) == otherElement->name(m_namePool)) { if (modelGroup->compositor() == XsdModelGroup::AllCompositor) { - m_context->error(QtXmlPatterns::tr("duplicated element names %1 in %2 element") + m_context->error(QtXmlPatterns::tr("Duplicated element names %1 in %2 element.") .arg(formatKeyword(element->displayName(m_namePool))) .arg(formatElement("all")), XsdSchemaContext::XSDError, sourceLocation(modelGroup)); return; } else if (modelGroup->compositor() == XsdModelGroup::SequenceCompositor) { if (element->type() != otherElement->type()) { // not same variety - m_context->error(QtXmlPatterns::tr("duplicated element names %1 in %2 element") + m_context->error(QtXmlPatterns::tr("Duplicated element names %1 in %2 element.") .arg(formatKeyword(element->displayName(m_namePool))) .arg(formatElement("sequence")), XsdSchemaContext::XSDError, sourceLocation(modelGroup)); @@ -1181,7 +1181,7 @@ void XsdSchemaResolver::resolveTermReference(const XsdParticle::Ptr &particle, Q if (element) { particle->setTerm(element); } else { - m_context->error(QtXmlPatterns::tr("reference %1 of %2 element cannot be resolved") + m_context->error(QtXmlPatterns::tr("Reference %1 of %2 element cannot be resolved.") .arg(formatKeyword(m_namePool, reference->referenceName())) .arg(formatElement("element")), XsdSchemaContext::XSDError, reference->sourceLocation()); @@ -1194,7 +1194,7 @@ void XsdSchemaResolver::resolveTermReference(const XsdParticle::Ptr &particle, Q const XsdModelGroup::Ptr modelGroup = m_schema->elementGroup(reference->referenceName()); if (modelGroup) { if (visitedGroups.contains(modelGroup->name(m_namePool))) { - m_context->error(QtXmlPatterns::tr("circular group reference for %1").arg(formatKeyword(modelGroup->displayName(m_namePool))), + m_context->error(QtXmlPatterns::tr("Circular group reference for %1.").arg(formatKeyword(modelGroup->displayName(m_namePool))), XsdSchemaContext::XSDError, reference->sourceLocation()); } else { visitedGroups.insert(modelGroup->name(m_namePool)); @@ -1210,12 +1210,12 @@ void XsdSchemaResolver::resolveTermReference(const XsdParticle::Ptr &particle, Q if (modelGroup->compositor() == XsdModelGroup::AllCompositor) { if (m_allGroups.contains(reference)) { - m_context->error(QtXmlPatterns::tr("%1 element is not allowed in this scope").arg(formatElement("all")), + m_context->error(QtXmlPatterns::tr("%1 element is not allowed in this scope").arg(formatElement("all.")), XsdSchemaContext::XSDError, reference->sourceLocation()); return; } if (particle->maximumOccursUnbounded() || particle->maximumOccurs() != 1) { - m_context->error(QtXmlPatterns::tr("%1 element cannot have %2 attribute with value other than %3") + m_context->error(QtXmlPatterns::tr("%1 element cannot have %2 attribute with value other than %3.") .arg(formatElement("all")) .arg(formatAttribute("maxOccurs")) .arg(formatData("1")), @@ -1223,7 +1223,7 @@ void XsdSchemaResolver::resolveTermReference(const XsdParticle::Ptr &particle, Q return; } if (particle->minimumOccurs() != 0 && particle->minimumOccurs() != 1) { - m_context->error(QtXmlPatterns::tr("%1 element cannot have %2 attribute with value other than %3 or %4") + m_context->error(QtXmlPatterns::tr("%1 element cannot have %2 attribute with value other than %3 or %4.") .arg(formatElement("all")) .arg(formatAttribute("minOccurs")) .arg(formatData("0")) @@ -1233,7 +1233,7 @@ void XsdSchemaResolver::resolveTermReference(const XsdParticle::Ptr &particle, Q } } } else { - m_context->error(QtXmlPatterns::tr("reference %1 of %2 element cannot be resolved") + m_context->error(QtXmlPatterns::tr("Reference %1 of %2 element cannot be resolved.") .arg(formatKeyword(m_namePool, reference->referenceName())) .arg(formatElement("group")), XsdSchemaContext::XSDError, reference->sourceLocation()); @@ -1304,7 +1304,7 @@ XsdAttributeUse::List XsdSchemaResolver::resolveAttributeTermReferences(const Xs // lookup the real attribute const XsdAttribute::Ptr attribute = m_schema->attribute(reference->referenceName()); if (!attribute) { - m_context->error(QtXmlPatterns::tr("reference %1 of %2 element cannot be resolved") + m_context->error(QtXmlPatterns::tr("Reference %1 of %2 element cannot be resolved.") .arg(formatKeyword(m_namePool, reference->referenceName())) .arg(formatElement("attribute")), XsdSchemaContext::XSDError, reference->sourceLocation()); @@ -1314,7 +1314,7 @@ XsdAttributeUse::List XsdSchemaResolver::resolveAttributeTermReferences(const Xs // if both, reference and definition have a fixed or default value set, then they must be equal if (attribute->valueConstraint() && attributeUse->valueConstraint()) { if (attribute->valueConstraint()->value() != attributeUse->valueConstraint()->value()) { - m_context->error(QtXmlPatterns::tr("%1 or %2 attribute of reference %3 does not match with the attribute declaration %4") + m_context->error(QtXmlPatterns::tr("%1 or %2 attribute of reference %3 does not match with the attribute declaration %4.") .arg(formatAttribute("fixed")) .arg(formatAttribute("default")) .arg(formatKeyword(m_namePool, reference->referenceName())) @@ -1332,14 +1332,14 @@ XsdAttributeUse::List XsdSchemaResolver::resolveAttributeTermReferences(const Xs } else if (reference->type() == XsdAttributeReference::AttributeGroup) { const XsdAttributeGroup::Ptr attributeGroup = m_schema->attributeGroup(reference->referenceName()); if (!attributeGroup) { - m_context->error(QtXmlPatterns::tr("reference %1 of %2 element cannot be resolved") + m_context->error(QtXmlPatterns::tr("Reference %1 of %2 element cannot be resolved.") .arg(formatKeyword(m_namePool, reference->referenceName())) .arg(formatElement("attributeGroup")), XsdSchemaContext::XSDError, reference->sourceLocation()); return XsdAttributeUse::List(); } if (visitedAttributeGroups.contains(attributeGroup->name(m_namePool))) { - m_context->error(QtXmlPatterns::tr("attribute group %1 has circular reference").arg(formatKeyword(m_namePool, reference->referenceName())), + m_context->error(QtXmlPatterns::tr("Attribute group %1 has circular reference.").arg(formatKeyword(m_namePool, reference->referenceName())), XsdSchemaContext::XSDError, reference->sourceLocation()); return XsdAttributeUse::List(); } else { @@ -1470,7 +1470,7 @@ void XsdSchemaResolver::resolveAttributeInheritance(const XsdComplexType::Ptr &c // check if prohibited usage is violated if ((use->useType() == XsdAttributeUse::ProhibitedUse) && (currentUses.at(k)->useType() != XsdAttributeUse::ProhibitedUse)) { - m_context->error(QtXmlPatterns::tr("%1 attribute in %2 must have %3 use like in base type %4") + m_context->error(QtXmlPatterns::tr("%1 attribute in %2 must have %3 use like in base type %4.") .arg(formatAttribute(use->attribute()->displayName(m_namePool))) .arg(formatType(m_namePool, complexType)) .arg(formatData("prohibited")) @@ -1522,14 +1522,14 @@ void XsdSchemaResolver::resolveAttributeInheritance(const XsdComplexType::Ptr &c if (complexType->attributeWildcard()) { if (complexBaseType->attributeWildcard()) { if (!isValidWildcardRestriction(complexType->attributeWildcard(), complexBaseType->attributeWildcard())) { - m_context->error(QtXmlPatterns::tr("attribute wildcard of %1 is not a valid restriction of attribute wildcard of base type %2") + m_context->error(QtXmlPatterns::tr("Attribute wildcard of %1 is not a valid restriction of attribute wildcard of base type %2.") .arg(formatType(m_namePool, complexType)) .arg(formatType(m_namePool, complexBaseType)), XsdSchemaContext::XSDError, sourceLocation(complexType)); return; } } else { - m_context->error(QtXmlPatterns::tr("%1 has attribute wildcard but its base type %2 has not") + m_context->error(QtXmlPatterns::tr("%1 has attribute wildcard but its base type %2 has not.") .arg(formatType(m_namePool, complexType)) .arg(formatType(m_namePool, complexBaseType)), XsdSchemaContext::XSDError, sourceLocation(complexType)); @@ -1555,7 +1555,7 @@ void XsdSchemaResolver::resolveAttributeInheritance(const XsdComplexType::Ptr &c unionWildcard->setProcessContents(completeWildcard->processContents()); complexType->setAttributeWildcard(unionWildcard); // 2.2.2.3 } else { - m_context->error(QtXmlPatterns::tr("union of attribute wildcard of type %1 and attribute wildcard of its base type %2 is not expressible") + m_context->error(QtXmlPatterns::tr("Union of attribute wildcard of type %1 and attribute wildcard of its base type %2 is not expressible.") .arg(formatType(m_namePool, complexType)) .arg(formatType(m_namePool, complexBaseType)), XsdSchemaContext::XSDError, sourceLocation(complexType)); @@ -1603,7 +1603,7 @@ void XsdSchemaResolver::resolveEnumerationFacetValues() const QString qualifiedName = value->as >()->stringValue(); if (!XPathHelper::isQName(qualifiedName)) { - m_context->error(QtXmlPatterns::tr("enumeration facet contains invalid content: {%1} is not a value of type %2") + m_context->error(QtXmlPatterns::tr("Enumeration facet contains invalid content: {%1} is not a value of type %2.") .arg(formatData(qualifiedName)) .arg(formatType(m_namePool, BuiltinTypes::xsQName)), XsdSchemaContext::XSDError, sourceLocation(simpleType)); @@ -1613,7 +1613,7 @@ void XsdSchemaResolver::resolveEnumerationFacetValues() QXmlName qNameValue; bool result = support.processName(qualifiedName, NamespaceSupport::ElementName, qNameValue); if (!result) { - m_context->error(QtXmlPatterns::tr("namespace prefix of qualified name %1 is not defined").arg(formatData(qualifiedName)), + m_context->error(QtXmlPatterns::tr("Namespace prefix of qualified name %1 is not defined.").arg(formatData(qualifiedName)), XsdSchemaContext::XSDError, sourceLocation(simpleType)); return; } @@ -1664,7 +1664,7 @@ void XsdSchemaResolver::checkRedefinedGroups() // so that we can pass them to XsdParticleChecker::subsumes() QString errorMsg; if (!XsdParticleChecker::subsumes(particle, redefinedParticle, m_context, errorMsg)) { - m_context->error(QtXmlPatterns::tr("%1 element %2 is not a valid restriction of the %3 element it redefines: %4") + m_context->error(QtXmlPatterns::tr("%1 element %2 is not a valid restriction of the %3 element it redefines: %4.") .arg(formatElement("group")) .arg(formatData(item.redefinedGroup->displayName(m_namePool))) .arg(formatElement("group")) @@ -1682,7 +1682,7 @@ void XsdSchemaResolver::checkRedefinedAttributeGroups() QString errorMsg; if (!XsdSchemaHelper::isValidAttributeGroupRestriction(item.redefinedGroup, item.group, m_context, errorMsg)) { - m_context->error(QtXmlPatterns::tr("%1 element %2 is not a valid restriction of the %3 element it redefines: %4") + m_context->error(QtXmlPatterns::tr("%1 element %2 is not a valid restriction of the %3 element it redefines: %4.") .arg(formatElement("attributeGroup")) .arg(formatData(item.redefinedGroup->displayName(m_namePool))) .arg(formatElement("attributeGroup")) diff --git a/src/xmlpatterns/schema/qxsdtypechecker.cpp b/src/xmlpatterns/schema/qxsdtypechecker.cpp index 0d957b6..4eb10dc 100644 --- a/src/xmlpatterns/schema/qxsdtypechecker.cpp +++ b/src/xmlpatterns/schema/qxsdtypechecker.cpp @@ -230,14 +230,14 @@ bool XsdTypeChecker::isValidString(const QString &normalizedString, const AnySim // special QName check if (BuiltinTypes::xsQName->wxsTypeMatches(type)) { if (!XPathHelper::isQName(normalizedString)) { - errorMsg = QtXmlPatterns::tr("%1 is not valid according to %2").arg(formatData(normalizedString)).arg(formatType(m_namePool, type)); + errorMsg = QtXmlPatterns::tr("%1 is not valid according to %2.").arg(formatData(normalizedString)).arg(formatType(m_namePool, type)); return false; } } const AtomicValue::Ptr value = fromLexical(normalizedString, type, m_context, m_reflection); if (value->hasError()) { - errorMsg = QtXmlPatterns::tr("%1 is not valid according to %2").arg(formatData(normalizedString)).arg(formatType(m_namePool, type)); + errorMsg = QtXmlPatterns::tr("%1 is not valid according to %2.").arg(formatData(normalizedString)).arg(formatType(m_namePool, type)); return false; } @@ -258,7 +258,7 @@ bool XsdTypeChecker::isValidString(const QString &normalizedString, const AnySim const AtomicValue::Ptr value = fromLexical(normalizedString, targetType, m_context, m_reflection); if (value->hasError()) { - errorMsg = QtXmlPatterns::tr("%1 is not valid according to %2").arg(formatData(normalizedString)).arg(formatType(m_namePool, targetType)); + errorMsg = QtXmlPatterns::tr("%1 is not valid according to %2.").arg(formatData(normalizedString)).arg(formatType(m_namePool, targetType)); return false; } @@ -425,7 +425,7 @@ bool XsdTypeChecker::checkConstrainingFacetsString(const QString &value, const X const XsdFacet::Ptr facet = facets.value(XsdFacet::Length); const DerivedInteger::Ptr length = facet->value(); if (length->toInteger() != value.length()) { - errorMsg = QtXmlPatterns::tr("string content does not match the length facet"); + errorMsg = QtXmlPatterns::tr("String content does not match the length facet."); return false; } } @@ -433,7 +433,7 @@ bool XsdTypeChecker::checkConstrainingFacetsString(const QString &value, const X const XsdFacet::Ptr facet = facets.value(XsdFacet::MinimumLength); const DerivedInteger::Ptr length = facet->value(); if (length->toInteger() > value.length()) { - errorMsg = QtXmlPatterns::tr("string content does not match the minLength facet"); + errorMsg = QtXmlPatterns::tr("String content does not match the minLength facet."); return false; } } @@ -441,7 +441,7 @@ bool XsdTypeChecker::checkConstrainingFacetsString(const QString &value, const X const XsdFacet::Ptr facet = facets.value(XsdFacet::MaximumLength); const DerivedInteger::Ptr length = facet->value(); if (length->toInteger() < value.length()) { - errorMsg = QtXmlPatterns::tr("string content does not match the maxLength facet"); + errorMsg = QtXmlPatterns::tr("String content does not match the maxLength facet."); return false; } } @@ -459,7 +459,7 @@ bool XsdTypeChecker::checkConstrainingFacetsString(const QString &value, const X } if (!found) { - errorMsg = QtXmlPatterns::tr("string content does not match pattern facet"); + errorMsg = QtXmlPatterns::tr("String content does not match pattern facet."); return false; } } @@ -477,7 +477,7 @@ bool XsdTypeChecker::checkConstrainingFacetsString(const QString &value, const X } if (!found) { - errorMsg = QtXmlPatterns::tr("string content is not listed in the enumeration facet"); + errorMsg = QtXmlPatterns::tr("String content is not listed in the enumeration facet."); return false; } } @@ -494,7 +494,7 @@ bool XsdTypeChecker::checkConstrainingFacetsSignedInteger(long long value, const const XsdFacet::Ptr facet = facets.value(XsdFacet::MaximumInclusive); const Numeric::Ptr facetValue = ValueFactory::fromLexical(facet->value()->as >()->stringValue(), BuiltinTypes::xsLong, m_context, m_reflection); if (facetValue->toInteger() < value) { - errorMsg = QtXmlPatterns::tr("signed integer content does not match the maxInclusive facet"); + errorMsg = QtXmlPatterns::tr("Signed integer content does not match the maxInclusive facet."); return false; } } @@ -502,7 +502,7 @@ bool XsdTypeChecker::checkConstrainingFacetsSignedInteger(long long value, const const XsdFacet::Ptr facet = facets.value(XsdFacet::MaximumExclusive); const Numeric::Ptr facetValue = ValueFactory::fromLexical(facet->value()->as >()->stringValue(), BuiltinTypes::xsLong, m_context, m_reflection); if (facetValue->toInteger() <= value) { - errorMsg = QtXmlPatterns::tr("signed integer content does not match the maxExclusive facet"); + errorMsg = QtXmlPatterns::tr("Signed integer content does not match the maxExclusive facet."); return false; } } @@ -510,7 +510,7 @@ bool XsdTypeChecker::checkConstrainingFacetsSignedInteger(long long value, const const XsdFacet::Ptr facet = facets.value(XsdFacet::MinimumInclusive); const Numeric::Ptr facetValue = ValueFactory::fromLexical(facet->value()->as >()->stringValue(), BuiltinTypes::xsLong, m_context, m_reflection); if (facetValue->toInteger() > value) { - errorMsg = QtXmlPatterns::tr("signed integer content does not match the minInclusive facet"); + errorMsg = QtXmlPatterns::tr("Signed integer content does not match the minInclusive facet."); return false; } } @@ -518,7 +518,7 @@ bool XsdTypeChecker::checkConstrainingFacetsSignedInteger(long long value, const const XsdFacet::Ptr facet = facets.value(XsdFacet::MinimumExclusive); const Numeric::Ptr facetValue = ValueFactory::fromLexical(facet->value()->as >()->stringValue(), BuiltinTypes::xsLong, m_context, m_reflection); if (facetValue->toInteger() >= value) { - errorMsg = QtXmlPatterns::tr("signed integer content does not match the minExclusive facet"); + errorMsg = QtXmlPatterns::tr("Signed integer content does not match the minExclusive facet."); return false; } } @@ -536,7 +536,7 @@ bool XsdTypeChecker::checkConstrainingFacetsSignedInteger(long long value, const } if (!found) { - errorMsg = QtXmlPatterns::tr("signed integer content is not listed in the enumeration facet"); + errorMsg = QtXmlPatterns::tr("Signed integer content is not listed in the enumeration facet."); return false; } } @@ -554,7 +554,7 @@ bool XsdTypeChecker::checkConstrainingFacetsSignedInteger(long long value, const } if (!found) { - errorMsg = QtXmlPatterns::tr("signed integer content does not match pattern facet"); + errorMsg = QtXmlPatterns::tr("Signed integer content does not match pattern facet."); return false; } } @@ -563,7 +563,7 @@ bool XsdTypeChecker::checkConstrainingFacetsSignedInteger(long long value, const const DerivedInteger::Ptr facetValue = facet->value(); if (totalDigitsForSignedLongLong(value) > facetValue->toInteger()) { - errorMsg = QtXmlPatterns::tr("signed integer content does not match in the totalDigits facet"); + errorMsg = QtXmlPatterns::tr("Signed integer content does not match in the totalDigits facet."); return false; } } @@ -580,7 +580,7 @@ bool XsdTypeChecker::checkConstrainingFacetsUnsignedInteger(unsigned long long v const XsdFacet::Ptr facet = facets.value(XsdFacet::MaximumInclusive); const Numeric::Ptr facetValue = ValueFactory::fromLexical(facet->value()->as >()->stringValue(), BuiltinTypes::xsUnsignedLong, m_context, m_reflection); if (facetValue->toUnsignedInteger() < value) { - errorMsg = QtXmlPatterns::tr("unsigned integer content does not match the maxInclusive facet"); + errorMsg = QtXmlPatterns::tr("Unsigned integer content does not match the maxInclusive facet."); return false; } } @@ -588,7 +588,7 @@ bool XsdTypeChecker::checkConstrainingFacetsUnsignedInteger(unsigned long long v const XsdFacet::Ptr facet = facets.value(XsdFacet::MaximumExclusive); const Numeric::Ptr facetValue = ValueFactory::fromLexical(facet->value()->as >()->stringValue(), BuiltinTypes::xsUnsignedLong, m_context, m_reflection); if (facetValue->toUnsignedInteger() <= value) { - errorMsg = QtXmlPatterns::tr("unsigned integer content does not match the maxExclusive facet"); + errorMsg = QtXmlPatterns::tr("Unsigned integer content does not match the maxExclusive facet."); return false; } } @@ -596,7 +596,7 @@ bool XsdTypeChecker::checkConstrainingFacetsUnsignedInteger(unsigned long long v const XsdFacet::Ptr facet = facets.value(XsdFacet::MinimumInclusive); const Numeric::Ptr facetValue = ValueFactory::fromLexical(facet->value()->as >()->stringValue(), BuiltinTypes::xsUnsignedLong, m_context, m_reflection); if (facetValue->toUnsignedInteger() > value) { - errorMsg = QtXmlPatterns::tr("unsigned integer content does not match the minInclusive facet"); + errorMsg = QtXmlPatterns::tr("Unsigned integer content does not match the minInclusive facet."); return false; } } @@ -604,7 +604,7 @@ bool XsdTypeChecker::checkConstrainingFacetsUnsignedInteger(unsigned long long v const XsdFacet::Ptr facet = facets.value(XsdFacet::MinimumExclusive); const Numeric::Ptr facetValue = ValueFactory::fromLexical(facet->value()->as >()->stringValue(), BuiltinTypes::xsUnsignedLong, m_context, m_reflection); if (facetValue->toUnsignedInteger() >= value) { - errorMsg = QtXmlPatterns::tr("unsigned integer content does not match the minExclusive facet"); + errorMsg = QtXmlPatterns::tr("Unsigned integer content does not match the minExclusive facet."); return false; } } @@ -622,7 +622,7 @@ bool XsdTypeChecker::checkConstrainingFacetsUnsignedInteger(unsigned long long v } if (!found) { - errorMsg = QtXmlPatterns::tr("unsigned integer content is not listed in the enumeration facet"); + errorMsg = QtXmlPatterns::tr("Unsigned integer content is not listed in the enumeration facet."); return false; } } @@ -640,7 +640,7 @@ bool XsdTypeChecker::checkConstrainingFacetsUnsignedInteger(unsigned long long v } if (!found) { - errorMsg = QtXmlPatterns::tr("unsigned integer content does not match pattern facet"); + errorMsg = QtXmlPatterns::tr("Unsigned integer content does not match pattern facet."); return false; } } @@ -649,7 +649,7 @@ bool XsdTypeChecker::checkConstrainingFacetsUnsignedInteger(unsigned long long v const DerivedInteger::Ptr facetValue = facet->value(); if (totalDigitsForUnsignedLongLong(value) > facetValue->toInteger()) { - errorMsg = QtXmlPatterns::tr("unsigned integer content does not match in the totalDigits facet"); + errorMsg = QtXmlPatterns::tr("Unsigned integer content does not match in the totalDigits facet."); return false; } } @@ -666,7 +666,7 @@ bool XsdTypeChecker::checkConstrainingFacetsDouble(double value, const QString & const XsdFacet::Ptr facet = facets.value(XsdFacet::MaximumInclusive); const Numeric::Ptr facetValue = ValueFactory::fromLexical(facet->value()->as >()->stringValue(), BuiltinTypes::xsDouble, m_context, m_reflection); if (facetValue->toDouble() < value) { - errorMsg = QtXmlPatterns::tr("double content does not match the maxInclusive facet"); + errorMsg = QtXmlPatterns::tr("Double content does not match the maxInclusive facet."); return false; } } @@ -674,7 +674,7 @@ bool XsdTypeChecker::checkConstrainingFacetsDouble(double value, const QString & const XsdFacet::Ptr facet = facets.value(XsdFacet::MaximumExclusive); const Numeric::Ptr facetValue = ValueFactory::fromLexical(facet->value()->as >()->stringValue(), BuiltinTypes::xsDouble, m_context, m_reflection); if (facetValue->toDouble() <= value) { - errorMsg = QtXmlPatterns::tr("double content does not match the maxExclusive facet"); + errorMsg = QtXmlPatterns::tr("Double content does not match the maxExclusive facet."); return false; } } @@ -682,7 +682,7 @@ bool XsdTypeChecker::checkConstrainingFacetsDouble(double value, const QString & const XsdFacet::Ptr facet = facets.value(XsdFacet::MinimumInclusive); const Numeric::Ptr facetValue = ValueFactory::fromLexical(facet->value()->as >()->stringValue(), BuiltinTypes::xsDouble, m_context, m_reflection); if (facetValue->toDouble() > value) { - errorMsg = QtXmlPatterns::tr("double content does not match the minInclusive facet"); + errorMsg = QtXmlPatterns::tr("Double content does not match the minInclusive facet."); return false; } } @@ -690,7 +690,7 @@ bool XsdTypeChecker::checkConstrainingFacetsDouble(double value, const QString & const XsdFacet::Ptr facet = facets.value(XsdFacet::MinimumExclusive); const Numeric::Ptr facetValue = ValueFactory::fromLexical(facet->value()->as >()->stringValue(), BuiltinTypes::xsDouble, m_context, m_reflection); if (facetValue->toDouble() >= value) { - errorMsg = QtXmlPatterns::tr("double content does not match the minExclusive facet"); + errorMsg = QtXmlPatterns::tr("Double content does not match the minExclusive facet."); return false; } } @@ -708,7 +708,7 @@ bool XsdTypeChecker::checkConstrainingFacetsDouble(double value, const QString & } if (!found) { - errorMsg = QtXmlPatterns::tr("double content is not listed in the enumeration facet"); + errorMsg = QtXmlPatterns::tr("Double content is not listed in the enumeration facet."); return false; } } @@ -726,7 +726,7 @@ bool XsdTypeChecker::checkConstrainingFacetsDouble(double value, const QString & } if (!found) { - errorMsg = QtXmlPatterns::tr("double content does not match pattern facet"); + errorMsg = QtXmlPatterns::tr("Double content does not match pattern facet."); return false; } } @@ -744,7 +744,7 @@ bool XsdTypeChecker::checkConstrainingFacetsDecimal(const AtomicValue::Ptr &valu const DerivedInteger::Ptr facetValue = facet->value(); if (fractionDigitsForDecimal(lexicalValue) > facetValue->toInteger()) { - errorMsg = QtXmlPatterns::tr("decimal content does not match in the fractionDigits facet"); + errorMsg = QtXmlPatterns::tr("Decimal content does not match in the fractionDigits facet."); return false; } } @@ -753,7 +753,7 @@ bool XsdTypeChecker::checkConstrainingFacetsDecimal(const AtomicValue::Ptr &valu const DerivedInteger::Ptr facetValue = facet->value(); if (totalDigitsForDecimal(lexicalValue) > facetValue->toInteger()) { - errorMsg = QtXmlPatterns::tr("decimal content does not match in the totalDigits facet"); + errorMsg = QtXmlPatterns::tr("Decimal content does not match in the totalDigits facet."); return false; } } @@ -767,7 +767,7 @@ bool XsdTypeChecker::checkConstrainingFacetsDateTime(const QDateTime &value, con const XsdFacet::Ptr facet = facets.value(XsdFacet::MaximumInclusive); const AbstractDateTime::Ptr facetValue = ValueFactory::fromLexical(facet->value()->as >()->stringValue(), type, m_context, m_reflection); if (facetValue->toDateTime() < value) { - errorMsg = QtXmlPatterns::tr("date time content does not match the maxInclusive facet"); + errorMsg = QtXmlPatterns::tr("Date time content does not match the maxInclusive facet."); return false; } } @@ -775,7 +775,7 @@ bool XsdTypeChecker::checkConstrainingFacetsDateTime(const QDateTime &value, con const XsdFacet::Ptr facet = facets.value(XsdFacet::MaximumExclusive); const AbstractDateTime::Ptr facetValue = ValueFactory::fromLexical(facet->value()->as >()->stringValue(), type, m_context, m_reflection); if (facetValue->toDateTime() <= value) { - errorMsg = QtXmlPatterns::tr("date time content does not match the maxExclusive facet"); + errorMsg = QtXmlPatterns::tr("Date time content does not match the maxExclusive facet."); return false; } } @@ -783,7 +783,7 @@ bool XsdTypeChecker::checkConstrainingFacetsDateTime(const QDateTime &value, con const XsdFacet::Ptr facet = facets.value(XsdFacet::MinimumInclusive); const AbstractDateTime::Ptr facetValue = ValueFactory::fromLexical(facet->value()->as >()->stringValue(), type, m_context, m_reflection); if (facetValue->toDateTime() > value) { - errorMsg = QtXmlPatterns::tr("date time content does not match the minInclusive facet"); + errorMsg = QtXmlPatterns::tr("Date time content does not match the minInclusive facet."); return false; } } @@ -791,7 +791,7 @@ bool XsdTypeChecker::checkConstrainingFacetsDateTime(const QDateTime &value, con const XsdFacet::Ptr facet = facets.value(XsdFacet::MinimumExclusive); const AbstractDateTime::Ptr facetValue = ValueFactory::fromLexical(facet->value()->as >()->stringValue(), type, m_context, m_reflection); if (facetValue->toDateTime() >= value) { - errorMsg = QtXmlPatterns::tr("date time content does not match the minExclusive facet"); + errorMsg = QtXmlPatterns::tr("Date time content does not match the minExclusive facet."); return false; } } @@ -809,7 +809,7 @@ bool XsdTypeChecker::checkConstrainingFacetsDateTime(const QDateTime &value, con } if (!found) { - errorMsg = QtXmlPatterns::tr("date time content is not listed in the enumeration facet"); + errorMsg = QtXmlPatterns::tr("Date time content is not listed in the enumeration facet."); return false; } } @@ -827,7 +827,7 @@ bool XsdTypeChecker::checkConstrainingFacetsDateTime(const QDateTime &value, con } if (!found) { - errorMsg = QtXmlPatterns::tr("date time content does not match pattern facet"); + errorMsg = QtXmlPatterns::tr("Date time content does not match pattern facet."); return false; } } @@ -842,7 +842,7 @@ bool XsdTypeChecker::checkConstrainingFacetsDuration(const AtomicValue::Ptr&, co const DerivedString::Ptr value = DerivedString::fromLexical(m_namePool, lexicalValue); if (XsdSchemaHelper::constructAndCompare(facets.value(XsdFacet::MaximumInclusive)->value(), AtomicComparator::OperatorLessThan, value, BuiltinTypes::xsDuration, m_context, m_reflection)) { - errorMsg = QtXmlPatterns::tr("duration content does not match the maxInclusive facet"); + errorMsg = QtXmlPatterns::tr("Duration content does not match the maxInclusive facet."); return false; } } @@ -851,7 +851,7 @@ bool XsdTypeChecker::checkConstrainingFacetsDuration(const AtomicValue::Ptr&, co const DerivedString::Ptr value = DerivedString::fromLexical(m_namePool, lexicalValue); if (XsdSchemaHelper::constructAndCompare(facets.value(XsdFacet::MaximumExclusive)->value(), AtomicComparator::OperatorLessOrEqual, value, BuiltinTypes::xsDuration, m_context, m_reflection)) { - errorMsg = QtXmlPatterns::tr("duration content does not match the maxExclusive facet"); + errorMsg = QtXmlPatterns::tr("Duration content does not match the maxExclusive facet."); return false; } } @@ -860,7 +860,7 @@ bool XsdTypeChecker::checkConstrainingFacetsDuration(const AtomicValue::Ptr&, co const DerivedString::Ptr value = DerivedString::fromLexical(m_namePool, lexicalValue); if (XsdSchemaHelper::constructAndCompare(facets.value(XsdFacet::MinimumInclusive)->value(), AtomicComparator::OperatorGreaterThan, value, BuiltinTypes::xsDuration, m_context, m_reflection)) { - errorMsg = QtXmlPatterns::tr("duration content does not match the minInclusive facet"); + errorMsg = QtXmlPatterns::tr("Duration content does not match the minInclusive facet."); return false; } } @@ -869,7 +869,7 @@ bool XsdTypeChecker::checkConstrainingFacetsDuration(const AtomicValue::Ptr&, co const DerivedString::Ptr value = DerivedString::fromLexical(m_namePool, lexicalValue); if (XsdSchemaHelper::constructAndCompare(facets.value(XsdFacet::MinimumExclusive)->value(), AtomicComparator::OperatorGreaterOrEqual, value, BuiltinTypes::xsDuration, m_context, m_reflection)) { - errorMsg = QtXmlPatterns::tr("duration content does not match the minExclusive facet"); + errorMsg = QtXmlPatterns::tr("Duration content does not match the minExclusive facet."); return false; } } @@ -887,7 +887,7 @@ bool XsdTypeChecker::checkConstrainingFacetsDuration(const AtomicValue::Ptr&, co } if (!found) { - errorMsg = QtXmlPatterns::tr("duration content is not listed in the enumeration facet"); + errorMsg = QtXmlPatterns::tr("Duration content is not listed in the enumeration facet."); return false; } } @@ -905,7 +905,7 @@ bool XsdTypeChecker::checkConstrainingFacetsDuration(const AtomicValue::Ptr&, co } if (!found) { - errorMsg = QtXmlPatterns::tr("duration content does not match pattern facet"); + errorMsg = QtXmlPatterns::tr("Duration content does not match pattern facet."); return false; } } @@ -932,7 +932,7 @@ bool XsdTypeChecker::checkConstrainingFacetsBoolean(bool, const QString &lexical } if (!found) { - errorMsg = QtXmlPatterns::tr("boolean content does not match pattern facet"); + errorMsg = QtXmlPatterns::tr("Boolean content does not match pattern facet."); return false; } } @@ -949,7 +949,7 @@ bool XsdTypeChecker::checkConstrainingFacetsBinary(const QByteArray &value, cons const XsdFacet::Ptr facet = facets.value(XsdFacet::Length); const DerivedInteger::Ptr length = facet->value(); if (length->toInteger() != value.length()) { - errorMsg = QtXmlPatterns::tr("binary content does not match the length facet"); + errorMsg = QtXmlPatterns::tr("Binary content does not match the length facet."); return false; } } @@ -957,7 +957,7 @@ bool XsdTypeChecker::checkConstrainingFacetsBinary(const QByteArray &value, cons const XsdFacet::Ptr facet = facets.value(XsdFacet::MinimumLength); const DerivedInteger::Ptr length = facet->value(); if (length->toInteger() > value.length()) { - errorMsg = QtXmlPatterns::tr("binary content does not match the minLength facet"); + errorMsg = QtXmlPatterns::tr("Binary content does not match the minLength facet."); return false; } } @@ -965,7 +965,7 @@ bool XsdTypeChecker::checkConstrainingFacetsBinary(const QByteArray &value, cons const XsdFacet::Ptr facet = facets.value(XsdFacet::MaximumLength); const DerivedInteger::Ptr length = facet->value(); if (length->toInteger() < value.length()) { - errorMsg = QtXmlPatterns::tr("binary content does not match the maxLength facet"); + errorMsg = QtXmlPatterns::tr("Binary content does not match the maxLength facet."); return false; } } @@ -983,7 +983,7 @@ bool XsdTypeChecker::checkConstrainingFacetsBinary(const QByteArray &value, cons } if (!found) { - errorMsg = QtXmlPatterns::tr("binary content is not listed in the enumeration facet"); + errorMsg = QtXmlPatterns::tr("Binary content is not listed in the enumeration facet."); return false; } } @@ -1010,7 +1010,7 @@ bool XsdTypeChecker::checkConstrainingFacetsQName(const QXmlName &value, const Q } if (facets.contains(XsdFacet::Enumeration)) { if (!XPathHelper::isQName(lexicalValue)) { - errorMsg = QtXmlPatterns::tr("invalid QName content: %1").arg(formatData(lexicalValue)); + errorMsg = QtXmlPatterns::tr("Invalid QName content: %1.").arg(formatData(lexicalValue)); return false; } @@ -1027,7 +1027,7 @@ bool XsdTypeChecker::checkConstrainingFacetsQName(const QXmlName &value, const Q } if (!found) { - errorMsg = QtXmlPatterns::tr("QName content is not listed in the enumeration facet"); + errorMsg = QtXmlPatterns::tr("QName content is not listed in the enumeration facet."); return false; } } @@ -1045,7 +1045,7 @@ bool XsdTypeChecker::checkConstrainingFacetsQName(const QXmlName &value, const Q } if (!found) { - errorMsg = QtXmlPatterns::tr("QName content does not match pattern facet"); + errorMsg = QtXmlPatterns::tr("QName content does not match pattern facet."); return false; } } @@ -1081,7 +1081,7 @@ bool XsdTypeChecker::checkConstrainingFacetsNotation(const QXmlName &value, cons } if (!found) { - errorMsg = QtXmlPatterns::tr("notation content is not listed in the enumeration facet"); + errorMsg = QtXmlPatterns::tr("Notation content is not listed in the enumeration facet."); return false; } } @@ -1100,21 +1100,21 @@ bool XsdTypeChecker::checkConstrainingFacetsList(const QStringList &values, cons if (facets.contains(XsdFacet::Length)) { const DerivedInteger::Ptr value = facets.value(XsdFacet::Length)->value(); if (value->toInteger() != values.count()) { - errorMsg = QtXmlPatterns::tr("list content does not match length facet"); + errorMsg = QtXmlPatterns::tr("List content does not match length facet."); return false; } } if (facets.contains(XsdFacet::MinimumLength)) { const DerivedInteger::Ptr value = facets.value(XsdFacet::MinimumLength)->value(); if (value->toInteger() > values.count()) { - errorMsg = QtXmlPatterns::tr("list content does not match minLength facet"); + errorMsg = QtXmlPatterns::tr("List content does not match minLength facet."); return false; } } if (facets.contains(XsdFacet::MaximumLength)) { const DerivedInteger::Ptr value = facets.value(XsdFacet::MaximumLength)->value(); if (value->toInteger() < values.count()) { - errorMsg = QtXmlPatterns::tr("list content does not match maxLength facet"); + errorMsg = QtXmlPatterns::tr("List content does not match maxLength facet."); return false; } } @@ -1204,7 +1204,7 @@ bool XsdTypeChecker::checkConstrainingFacetsList(const QStringList &values, cons } if (!found) { - errorMsg = QtXmlPatterns::tr("list content is not listed in the enumeration facet"); + errorMsg = QtXmlPatterns::tr("List content is not listed in the enumeration facet."); return false; } } @@ -1222,7 +1222,7 @@ bool XsdTypeChecker::checkConstrainingFacetsList(const QStringList &values, cons } if (!found) { - errorMsg = QtXmlPatterns::tr("list content does not match pattern facet"); + errorMsg = QtXmlPatterns::tr("List content does not match pattern facet."); return false; } } @@ -1261,7 +1261,7 @@ bool XsdTypeChecker::checkConstrainingFacetsUnion(const QString &value, const QS } if (!found) { - errorMsg = QtXmlPatterns::tr("union content is not listed in the enumeration facet"); + errorMsg = QtXmlPatterns::tr("Union content is not listed in the enumeration facet."); return false; } } @@ -1279,7 +1279,7 @@ bool XsdTypeChecker::checkConstrainingFacetsUnion(const QString &value, const QS } if (!found) { - errorMsg = QtXmlPatterns::tr("union content does not match pattern facet"); + errorMsg = QtXmlPatterns::tr("Union content does not match pattern facet."); return false; } } @@ -1294,7 +1294,7 @@ AtomicValue::Ptr XsdTypeChecker::fromLexical(const QString &value, const SchemaT { if (type->name(m_namePool) == BuiltinTypes::xsNOTATION->name(m_namePool) || type->name(m_namePool) == BuiltinTypes::xsQName->name(m_namePool)) { if (value.simplified().isEmpty()) - return ValidationError::createError(QtXmlPatterns::tr("data of type %1 are not allowed to be empty").arg(formatType(m_namePool, BuiltinTypes::xsNOTATION))); + return ValidationError::createError(QtXmlPatterns::tr("Data of type %1 are not allowed to be empty.").arg(formatType(m_namePool, BuiltinTypes::xsNOTATION))); const QXmlName valueName = convertToQName(value); return QNameValue::fromValue(m_namePool, valueName); diff --git a/src/xmlpatterns/schema/qxsdvalidatinginstancereader.cpp b/src/xmlpatterns/schema/qxsdvalidatinginstancereader.cpp index 0980777..7552c41 100644 --- a/src/xmlpatterns/schema/qxsdvalidatinginstancereader.cpp +++ b/src/xmlpatterns/schema/qxsdvalidatinginstancereader.cpp @@ -157,7 +157,7 @@ bool XsdValidatingInstanceReader::read() if (!m_stateMachines.isEmpty() && hasStateMachine) { if (!m_stateMachines.top().inEndState()) { - error(QtXmlPatterns::tr("element %1 is missing child element").arg(formatKeyword(m_namePool->displayName(elementName)))); + error(QtXmlPatterns::tr("Element %1 is missing child element.").arg(formatKeyword(m_namePool->displayName(elementName)))); return false; } m_stateMachines.pop(); @@ -173,7 +173,7 @@ bool XsdValidatingInstanceReader::read() while (it.hasNext()) { const QString id = it.next(); if (!ids.contains(id)) { - error(QtXmlPatterns::tr("there is one IDREF value with no corresponding ID: %1").arg(formatKeyword(id))); + error(QtXmlPatterns::tr("There is one IDREF value with no corresponding ID: %1.").arg(formatKeyword(id))); return false; } } @@ -200,7 +200,7 @@ bool XsdValidatingInstanceReader::loadSchema(const QString &targetNamespace, con QXmlSchemaPrivate schema(context); schema.load(reply.data(), location, targetNamespace); if (!schema.isValid()) { - error(QtXmlPatterns::tr("loaded schema file is invalid")); + error(QtXmlPatterns::tr("Loaded schema file is invalid.")); return false; } @@ -216,7 +216,7 @@ bool XsdValidatingInstanceReader::validate(bool &hasStateMachine, XsdElement::Pt const QString schemaLocation = attribute(m_xsiSchemaLocationName); const QStringList parts = schemaLocation.split(QLatin1Char(' '), QString::SkipEmptyParts); if ((parts.count()%2) == 1) { - error(QtXmlPatterns::tr("%1 contains invalid data").arg(formatKeyword(m_namePool, m_xsiSchemaLocationName))); + error(QtXmlPatterns::tr("%1 contains invalid data.").arg(formatKeyword(m_namePool, m_xsiSchemaLocationName))); return false; } @@ -229,7 +229,7 @@ bool XsdValidatingInstanceReader::validate(bool &hasStateMachine, XsdElement::Pt // check constraint 4) from http://www.w3.org/TR/xmlschema-1/#schema-loc (only valid for XML Schema 1.0?) if (m_processedNamespaces.contains(parts.at(i))) { - error(QtXmlPatterns::tr("xsi:schemaLocation namespace %1 has already appeared earlier in the instance document").arg(formatKeyword(parts.at(i)))); + error(QtXmlPatterns::tr("xsi:schemaLocation namespace %1 has already appeared earlier in the instance document.").arg(formatKeyword(parts.at(i)))); return false; } @@ -251,7 +251,7 @@ bool XsdValidatingInstanceReader::validate(bool &hasStateMachine, XsdElement::Pt m_processedSchemaLocations.insert(schemaLocation); if (m_processedNamespaces.contains(QString())) { - error(QtXmlPatterns::tr("xsi:noNamespaceSchemaLocation cannot appear after the first no-namespace element or attribute")); + error(QtXmlPatterns::tr("xsi:noNamespaceSchemaLocation cannot appear after the first no-namespace element or attribute.")); return false; } @@ -269,7 +269,7 @@ bool XsdValidatingInstanceReader::validate(bool &hasStateMachine, XsdElement::Pt m_processedNamespaces.insert(m_namePool->stringForNamespace(name().namespaceURI())); if (!m_schema) { - error(QtXmlPatterns::tr("no schema defined for validation")); + error(QtXmlPatterns::tr("No schema defined for validation.")); return false; } @@ -279,7 +279,7 @@ bool XsdValidatingInstanceReader::validate(bool &hasStateMachine, XsdElement::Pt XsdElement::Ptr element = elementByName(name()); if (!element) { if (!hasAttribute(m_xsiTypeName)) { - error(QtXmlPatterns::tr("no definition for element %1 available").arg(formatKeyword(m_namePool, name()))); + error(QtXmlPatterns::tr("No definition for element %1 available.").arg(formatKeyword(m_namePool, name()))); return false; } @@ -297,7 +297,7 @@ bool XsdValidatingInstanceReader::validate(bool &hasStateMachine, XsdElement::Pt const SchemaType::Ptr elementType = typeByName(typeName); if (!elementType) { - error(QtXmlPatterns::tr("specified type %1 is not known to the schema").arg(formatType(m_namePool, typeName))); + error(QtXmlPatterns::tr("Specified type %1 is not known to the schema.").arg(formatType(m_namePool, typeName))); return false; } element->setType(elementType); @@ -312,7 +312,7 @@ bool XsdValidatingInstanceReader::validate(bool &hasStateMachine, XsdElement::Pt } else { if (!m_stateMachines.top().proceed(name())) { - error(QtXmlPatterns::tr("element %1 is not defined in this scope").arg(formatKeyword(m_namePool, name()))); + error(QtXmlPatterns::tr("Element %1 is not defined in this scope.").arg(formatKeyword(m_namePool, name()))); return false; } @@ -346,7 +346,7 @@ bool XsdValidatingInstanceReader::validate(bool &hasStateMachine, XsdElement::Pt const SchemaType::Ptr elementType = typeByName(typeName); if (!elementType) { - error(QtXmlPatterns::tr("specified type %1 is not known to the schema").arg(formatType(m_namePool, typeName))); + error(QtXmlPatterns::tr("Specified type %1 is not known to the schema.").arg(formatType(m_namePool, typeName))); return false; } elementDeclaration->setType(elementType); @@ -355,7 +355,7 @@ bool XsdValidatingInstanceReader::validate(bool &hasStateMachine, XsdElement::Pt if (!elementDeclaration) { if (wildcard->processContents() == XsdWildcard::Strict) { - error(QtXmlPatterns::tr("declaration for element %1 does not exist").arg(formatKeyword(m_namePool->displayName(name())))); + error(QtXmlPatterns::tr("Declaration for element %1 does not exist.").arg(formatKeyword(m_namePool->displayName(name())))); return false; } else { // in this case we put a state machine for the xs:anyType on the statemachine stack, @@ -367,7 +367,7 @@ bool XsdValidatingInstanceReader::validate(bool &hasStateMachine, XsdElement::Pt } else { if (!validateElement(elementDeclaration, hasStateMachine)) { if (wildcard->processContents() == XsdWildcard::Strict) { - error(QtXmlPatterns::tr("element %1 contains invalid content").arg(formatKeyword(m_namePool->displayName(name())))); + error(QtXmlPatterns::tr("Element %1 contains invalid content.").arg(formatKeyword(m_namePool->displayName(name())))); return false; } } @@ -440,14 +440,14 @@ bool XsdValidatingInstanceReader::validateElement(const XsdElement::Ptr &declara // 2 if (declaration->isAbstract()) { - error(QtXmlPatterns::tr("element %1 is declared as abstract").arg(formatKeyword(declaration->displayName(m_namePool)))); + error(QtXmlPatterns::tr("Element %1 is declared as abstract.").arg(formatKeyword(declaration->displayName(m_namePool)))); return false; } // 3 if (!declaration->isNillable()) { if (hasAttribute(m_xsiNilName)) { - error(QtXmlPatterns::tr("element %1 is not nillable").arg(formatKeyword(declaration->displayName(m_namePool)))); + error(QtXmlPatterns::tr("Element %1 is not nillable.").arg(formatKeyword(declaration->displayName(m_namePool)))); return false; // 3.1 } } else { @@ -455,7 +455,7 @@ bool XsdValidatingInstanceReader::validateElement(const XsdElement::Ptr &declara const QString value = attribute(m_xsiNilName); const Boolean::Ptr nil = Boolean::fromLexical(value); if (nil->hasError()) { - error(QtXmlPatterns::tr("attribute %1 contains invalid data: %2").arg(formatKeyword(QLatin1String("nil"))).arg(formatData(value))); + error(QtXmlPatterns::tr("Attribute %1 contains invalid data: %2").arg(formatKeyword(QLatin1String("nil."))).arg(formatData(value))); return false; } @@ -463,13 +463,13 @@ bool XsdValidatingInstanceReader::validateElement(const XsdElement::Ptr &declara if (nil->as()->value() == true) { // 3.2.3.1 if (hasChildElement() || hasChildText()) { - error(QtXmlPatterns::tr("element contains content although it is nillable")); + error(QtXmlPatterns::tr("Element contains content although it is nillable.")); return false; } // 3.2.3.2 if (declaration->valueConstraint() && declaration->valueConstraint()->variety() == XsdElement::ValueConstraint::Fixed) { - error(QtXmlPatterns::tr("fixed value constrained not allowed if element is nillable")); + error(QtXmlPatterns::tr("Fixed value constrained not allowed if element is nillable.")); return false; } } @@ -488,7 +488,7 @@ bool XsdValidatingInstanceReader::validateElement(const XsdElement::Ptr &declara const SchemaType::Ptr elementType = typeByName(typeName); // 4.1 if (!elementType) { - error(QtXmlPatterns::tr("specified type %1 is not known to the schema").arg(formatType(m_namePool, typeName))); + error(QtXmlPatterns::tr("Specified type %1 is not known to the schema.").arg(formatType(m_namePool, typeName))); return false; } @@ -501,7 +501,7 @@ bool XsdValidatingInstanceReader::validateElement(const XsdElement::Ptr &declara if (!XsdSchemaHelper::isValidlySubstitutable(elementType, declaration->type(), constraints)) { if (declaration->type()->name(m_namePool) != BuiltinTypes::xsAnyType->name(m_namePool)) { // xs:anyType is a valid substitutable type here - error(QtXmlPatterns::tr("specified type %1 is not validly substitutable with element type %2").arg(formatType(m_namePool, elementType)).arg(formatType(m_namePool, declaration->type()))); + error(QtXmlPatterns::tr("Specified type %1 is not validly substitutable with element type %2.").arg(formatType(m_namePool, elementType)).arg(formatType(m_namePool, declaration->type()))); return false; } } @@ -524,7 +524,7 @@ bool XsdValidatingInstanceReader::validateElementType(const XsdElement::Ptr &dec // 2 if (type->isComplexType() && type->isDefinedBySchema()) { if (XsdComplexType::Ptr(type)->isAbstract()) { - error(QtXmlPatterns::tr("complex type %1 is not allowed to be abstract").arg(formatType(m_namePool, type))); + error(QtXmlPatterns::tr("Complex type %1 is not allowed to be abstract.").arg(formatType(m_namePool, type))); return false; } } @@ -545,13 +545,13 @@ bool XsdValidatingInstanceReader::validateElementSimpleType(const XsdElement::Pt QSet elementAttributes = attributeNames(); elementAttributes.subtract(allowedAttributes); if (!elementAttributes.isEmpty()) { - error(QtXmlPatterns::tr("element %1 contains not allowed attributes").arg(formatKeyword(declaration->displayName(m_namePool)))); + error(QtXmlPatterns::tr("Element %1 contains not allowed attributes.").arg(formatKeyword(declaration->displayName(m_namePool)))); return false; } // 3.1.2 if (hasChildElement()) { - error(QtXmlPatterns::tr("element %1 contains not allowed child element").arg(formatKeyword(declaration->displayName(m_namePool)))); + error(QtXmlPatterns::tr("Element %1 contains not allowed child element.").arg(formatKeyword(declaration->displayName(m_namePool)))); return false; } @@ -572,7 +572,7 @@ bool XsdValidatingInstanceReader::validateElementSimpleType(const XsdElement::Pt const XsdTypeChecker checker(m_context, namespaceBindings(item().toNodeModelIndex()), sourceLocation()); if (!checker.isValidString(actualValue, type, errorMsg, &boundType)) { - error(QtXmlPatterns::tr("content of element %1 does not match its type definition: %2").arg(formatKeyword(declaration->displayName(m_namePool))).arg(errorMsg)); + error(QtXmlPatterns::tr("Content of element %1 does not match its type definition: %2.").arg(formatKeyword(declaration->displayName(m_namePool))).arg(errorMsg)); return false; } @@ -580,7 +580,7 @@ bool XsdValidatingInstanceReader::validateElementSimpleType(const XsdElement::Pt if (declaration->valueConstraint() && declaration->valueConstraint()->variety() == XsdElement::ValueConstraint::Fixed) { const QString actualConstraintValue = XsdTypeChecker::normalizedValue(declaration->valueConstraint()->value(), facets); if (!text().isEmpty() && !checker.valuesAreEqual(actualValue, actualConstraintValue, type)) { - error(QtXmlPatterns::tr("content of element %1 does not match defined value constraint").arg(formatKeyword(declaration->displayName(m_namePool)))); + error(QtXmlPatterns::tr("Content of element %1 does not match defined value constraint.").arg(formatKeyword(declaration->displayName(m_namePool)))); return false; } } @@ -640,7 +640,7 @@ bool XsdValidatingInstanceReader::validateElementComplexType(const XsdElement::P // 1.1 if (complexType->contentType()->variety() == XsdComplexType::ContentType::Empty) { if (hasChildText() || hasChildElement()) { - error(QtXmlPatterns::tr("element %1 contains not allowed child content").arg(formatKeyword(declaration->displayName(m_namePool)))); + error(QtXmlPatterns::tr("Element %1 contains not allowed child content.").arg(formatKeyword(declaration->displayName(m_namePool)))); return false; } } @@ -648,7 +648,7 @@ bool XsdValidatingInstanceReader::validateElementComplexType(const XsdElement::P // 1.2 if (complexType->contentType()->variety() == XsdComplexType::ContentType::Simple) { if (hasChildElement()) { - error(QtXmlPatterns::tr("element %1 contains not allowed child element").arg(formatKeyword(declaration->displayName(m_namePool)))); + error(QtXmlPatterns::tr("Element %1 contains not allowed child element.").arg(formatKeyword(declaration->displayName(m_namePool)))); return false; } @@ -665,14 +665,14 @@ bool XsdValidatingInstanceReader::validateElementComplexType(const XsdElement::P AnySimpleType::Ptr boundType; const XsdTypeChecker checker(m_context, namespaceBindings(item().toNodeModelIndex()), sourceLocation()); if (!checker.isValidString(actualValue, complexType->contentType()->simpleType(), errorMsg, &boundType)) { - error(QtXmlPatterns::tr("content of element %1 does not match its type definition: %2").arg(formatKeyword(declaration->displayName(m_namePool))).arg(errorMsg)); + error(QtXmlPatterns::tr("Content of element %1 does not match its type definition: %2.").arg(formatKeyword(declaration->displayName(m_namePool))).arg(errorMsg)); return false; } // additional check if (declaration->valueConstraint() && declaration->valueConstraint()->variety() == XsdElement::ValueConstraint::Fixed) { if (!checker.valuesAreEqual(actualValue, declaration->valueConstraint()->value(), boundType)) { - error(QtXmlPatterns::tr("content of element %1 does not match defined value constraint").arg(formatKeyword(declaration->displayName(m_namePool)))); + error(QtXmlPatterns::tr("Content of element %1 does not match defined value constraint.").arg(formatKeyword(declaration->displayName(m_namePool)))); return false; } } @@ -681,7 +681,7 @@ bool XsdValidatingInstanceReader::validateElementComplexType(const XsdElement::P // 1.3 if (complexType->contentType()->variety() == XsdComplexType::ContentType::ElementOnly) { if (!text().simplified().isEmpty()) { - error(QtXmlPatterns::tr("element %1 contains not allowed text content").arg(formatKeyword(declaration->displayName(m_namePool)))); + error(QtXmlPatterns::tr("Element %1 contains not allowed text content.").arg(formatKeyword(declaration->displayName(m_namePool)))); return false; } } @@ -699,7 +699,7 @@ bool XsdValidatingInstanceReader::validateElementComplexType(const XsdElement::P if (complexType->contentType()->variety() == XsdComplexType::ContentType::Mixed) { if (declaration->valueConstraint() && declaration->valueConstraint()->variety() == XsdElement::ValueConstraint::Fixed) { if (hasChildElement()) { - error(QtXmlPatterns::tr("element %1 can not contain other elements, as it has a fixed content").arg(formatKeyword(declaration->displayName(m_namePool)))); + error(QtXmlPatterns::tr("Element %1 can not contain other elements, as it has a fixed content.").arg(formatKeyword(declaration->displayName(m_namePool)))); return false; } @@ -713,7 +713,7 @@ bool XsdValidatingInstanceReader::validateElementComplexType(const XsdElement::P } if (actualValue != declaration->valueConstraint()->value()) { - error(QtXmlPatterns::tr("content of element %1 does not match defined value constraint").arg(formatKeyword(declaration->displayName(m_namePool)))); + error(QtXmlPatterns::tr("Content of element %1 does not match defined value constraint.").arg(formatKeyword(declaration->displayName(m_namePool)))); return false; } } @@ -742,7 +742,7 @@ bool XsdValidatingInstanceReader::validateElementComplexType(const XsdElement::P if (usesIt.value()->isRequired()) { if (!attributes.contains(usesIt.key())) { - error(QtXmlPatterns::tr("element %1 is missing required attribute %2").arg(formatKeyword(declaration->displayName(m_namePool))) + error(QtXmlPatterns::tr("Element %1 is missing required attribute %2.").arg(formatKeyword(declaration->displayName(m_namePool))) .arg(formatKeyword(m_namePool->displayName(usesIt.key())))); return false; } @@ -771,7 +771,7 @@ bool XsdValidatingInstanceReader::validateElementComplexType(const XsdElement::P if (complexType->attributeWildcard()) { const XsdWildcard::Ptr wildcard(complexType->attributeWildcard()); if (!validateAttributeWildcard(attributeName, wildcard)) { - error(QtXmlPatterns::tr("attribute %1 does not match the attribute wildcard").arg(formatKeyword(m_namePool->displayName(attributeName)))); + error(QtXmlPatterns::tr("Attribute %1 does not match the attribute wildcard.").arg(formatKeyword(m_namePool->displayName(attributeName)))); return false; } @@ -780,13 +780,13 @@ bool XsdValidatingInstanceReader::validateElementComplexType(const XsdElement::P if (!attributeDeclaration) { if (wildcard->processContents() == XsdWildcard::Strict) { - error(QtXmlPatterns::tr("declaration for attribute %1 does not exist").arg(formatKeyword(m_namePool->displayName(attributeName)))); + error(QtXmlPatterns::tr("Declaration for attribute %1 does not exist.").arg(formatKeyword(m_namePool->displayName(attributeName)))); return false; } } else { if (BuiltinTypes::xsID->wxsTypeMatches(attributeDeclaration->type())) { if (hasIDAttribute) { - error(QtXmlPatterns::tr("element %1 contains two attributes of type %2") + error(QtXmlPatterns::tr("Element %1 contains two attributes of type %2.") .arg(formatKeyword(declaration->displayName(m_namePool))) .arg(formatKeyword("ID"))); return false; @@ -797,14 +797,14 @@ bool XsdValidatingInstanceReader::validateElementComplexType(const XsdElement::P if (!validateAttribute(attributeDeclaration, attribute(attributeName))) { if (wildcard->processContents() == XsdWildcard::Strict) { - error(QtXmlPatterns::tr("attribute %1 contains invalid content").arg(formatKeyword(m_namePool->displayName(attributeName)))); + error(QtXmlPatterns::tr("Attribute %1 contains invalid content.").arg(formatKeyword(m_namePool->displayName(attributeName)))); return false; } } } } } else { - error(QtXmlPatterns::tr("element %1 contains unknown attribute %2").arg(formatKeyword(declaration->displayName(m_namePool))) + error(QtXmlPatterns::tr("Element %1 contains unknown attribute %2.").arg(formatKeyword(declaration->displayName(m_namePool))) .arg(formatKeyword(m_namePool->displayName(attributeName)))); return false; } @@ -844,7 +844,7 @@ bool XsdValidatingInstanceReader::validateAttribute(const XsdAttributeUse::Ptr & const XsdTypeChecker checker(m_context, namespaceBindings(index), sourceLocation()); if (!checker.isValidString(actualValue, attributeType, errorMsg, &boundType)) { - error(QtXmlPatterns::tr("content of attribute %1 does not match its type definition: %2").arg(formatKeyword(declaration->attribute()->displayName(m_namePool))).arg(errorMsg)); + error(QtXmlPatterns::tr("Content of attribute %1 does not match its type definition: %2.").arg(formatKeyword(declaration->attribute()->displayName(m_namePool))).arg(errorMsg)); return false; } @@ -852,7 +852,7 @@ bool XsdValidatingInstanceReader::validateAttribute(const XsdAttributeUse::Ptr & if (declaration->valueConstraint() && declaration->valueConstraint()->variety() == XsdAttributeUse::ValueConstraint::Fixed) { const QString actualConstraintValue = XsdTypeChecker::normalizedValue(declaration->valueConstraint()->value(), facets); if (!checker.valuesAreEqual(actualValue, actualConstraintValue, attributeType)) { - error(QtXmlPatterns::tr("content of attribute %1 does not match defined value constraint").arg(formatKeyword(declaration->attribute()->displayName(m_namePool)))); + error(QtXmlPatterns::tr("Content of attribute %1 does not match defined value constraint.").arg(formatKeyword(declaration->attribute()->displayName(m_namePool)))); return false; } } @@ -890,7 +890,7 @@ bool XsdValidatingInstanceReader::validateAttribute(const XsdAttribute::Ptr &dec const XsdTypeChecker checker(m_context, namespaceBindings(index), sourceLocation()); if (!checker.isValidString(actualValue, attributeType, errorMsg, &boundType)) { - error(QtXmlPatterns::tr("content of attribute %1 does not match its type definition: %2").arg(formatKeyword(declaration->displayName(m_namePool))).arg(errorMsg)); + error(QtXmlPatterns::tr("Content of attribute %1 does not match its type definition: %2.").arg(formatKeyword(declaration->displayName(m_namePool))).arg(errorMsg)); return false; } @@ -898,7 +898,7 @@ bool XsdValidatingInstanceReader::validateAttribute(const XsdAttribute::Ptr &dec if (declaration->valueConstraint() && declaration->valueConstraint()->variety() == XsdAttribute::ValueConstraint::Fixed) { const QString actualConstraintValue = XsdTypeChecker::normalizedValue(declaration->valueConstraint()->value(), facets); if (!checker.valuesAreEqual(actualValue, actualConstraintValue, attributeType)) { - error(QtXmlPatterns::tr("content of attribute %1 does not match defined value constraint").arg(formatKeyword(declaration->displayName(m_namePool)))); + error(QtXmlPatterns::tr("Content of attribute %1 does not match defined value constraint.").arg(formatKeyword(declaration->displayName(m_namePool)))); return false; } } @@ -986,7 +986,7 @@ bool XsdValidatingInstanceReader::validateUniqueIdentityConstraint(const XsdElem continue; if (node.fieldsAreEqual(innerNode, m_namePool, m_context, &reflection)) { - error(QtXmlPatterns::tr("non-unique value found for constraint %1").arg(formatKeyword(constraint->displayName(m_namePool)))); + error(QtXmlPatterns::tr("Non-unique value found for constraint %1.").arg(formatKeyword(constraint->displayName(m_namePool)))); return false; } } @@ -1006,7 +1006,7 @@ bool XsdValidatingInstanceReader::validateKeyIdentityConstraint(const XsdElement // 4.2.1 if (targetNodeSet.count() != qualifiedNodeSet.count()) { - error(QtXmlPatterns::tr("key constraint %1 contains absent fields").arg(formatKeyword(constraint->displayName(m_namePool)))); + error(QtXmlPatterns::tr("Key constraint %1 contains absent fields.").arg(formatKeyword(constraint->displayName(m_namePool)))); return false; } @@ -1024,7 +1024,7 @@ bool XsdValidatingInstanceReader::validateKeyIdentityConstraint(const XsdElement if (m_model->kind(index) == QXmlNodeModelIndex::Element) { const XsdElement::Ptr declaration = m_model->assignedElement(index); if (declaration && declaration->isNillable()) { - error(QtXmlPatterns::tr("key constraint %1 contains references nillable element %2") + error(QtXmlPatterns::tr("Key constraint %1 contains references nillable element %2.") .arg(formatKeyword(constraint->displayName(m_namePool))) .arg(formatKeyword(declaration->displayName(m_namePool)))); return false; @@ -1064,7 +1064,7 @@ bool XsdValidatingInstanceReader::validateKeyRefIdentityConstraint(const XsdElem } if (!foundMatching) { - error(QtXmlPatterns::tr("no referenced value found for key reference %1").arg(formatKeyword(constraint->displayName(m_namePool)))); + error(QtXmlPatterns::tr("No referenced value found for key reference %1.").arg(formatKeyword(constraint->displayName(m_namePool)))); return false; } } @@ -1128,7 +1128,7 @@ bool XsdValidatingInstanceReader::selectNodeSets(const XsdElement::Ptr&, const Q } if (fieldVector.count() > 1) { - error(QtXmlPatterns::tr("more than one value found for field %1").arg(formatData(field->expression()))); + error(QtXmlPatterns::tr("More than one value found for field %1.").arg(formatData(field->expression()))); return false; } @@ -1148,7 +1148,7 @@ bool XsdValidatingInstanceReader::selectNodeSets(const XsdElement::Ptr&, const Q } } if (!typeOk) { - error(QtXmlPatterns::tr("field %1 has no simple type").arg(formatData(field->expression()))); + error(QtXmlPatterns::tr("Field %1 has no simple type.").arg(formatData(field->expression()))); return false; } @@ -1221,7 +1221,7 @@ SchemaType::Ptr XsdValidatingInstanceReader::typeByName(const QXmlName &name) co void XsdValidatingInstanceReader::addIdIdRefBinding(const QString &id, const NamedSchemaComponent::Ptr &binding) { if (!m_model->idIdRefBindings(id).isEmpty()) { - error(QtXmlPatterns::tr("ID value '%1' is not unique").arg(formatKeyword(id))); + error(QtXmlPatterns::tr("ID value '%1' is not unique.").arg(formatKeyword(id))); return; } @@ -1232,7 +1232,7 @@ QString XsdValidatingInstanceReader::qNameAttribute(const QXmlName &attributeNam { const QString value = attribute(attributeName).simplified(); if (!XPathHelper::isQName(value)) { - error(QtXmlPatterns::tr("'%1' attribute contains invalid QName content: %2").arg(m_namePool->displayName(attributeName)).arg(formatData(value))); + error(QtXmlPatterns::tr("'%1' attribute contains invalid QName content: %2.").arg(m_namePool->displayName(attributeName)).arg(formatData(value))); return QString(); } else { return value; -- cgit v0.12 From d59e1d8491b3590145e5da0d8b81dc78cc353137 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Thu, 1 Oct 2009 11:32:27 +0200 Subject: Fix tst_QPixmap on 16bit display Pulse machine runs a 16bit display, some comparisons fails. Reviewed-by: Samuel --- tests/auto/qpixmap/tst_qpixmap.cpp | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/tests/auto/qpixmap/tst_qpixmap.cpp b/tests/auto/qpixmap/tst_qpixmap.cpp index 1bfddc1..8151e62 100644 --- a/tests/auto/qpixmap/tst_qpixmap.cpp +++ b/tests/auto/qpixmap/tst_qpixmap.cpp @@ -67,6 +67,9 @@ #include #endif +#ifdef Q_WS_X11 +#include +#endif //TESTED_CLASS= //TESTED_FILES= @@ -175,6 +178,12 @@ static bool lenientCompare(const QPixmap &actual, const QPixmap &expected) int size = actual.width() * actual.height(); + int threshold = 2; +#ifdef Q_WS_X11 + if (QX11Info::appDepth() == 16) + threshold = 10; +#endif + QRgb *a = (QRgb *)actualImage.bits(); QRgb *e = (QRgb *)expectedImage.bits(); for (int i = 0; i < size; ++i) { @@ -183,11 +192,11 @@ static bool lenientCompare(const QPixmap &actual, const QPixmap &expected) bool result = true; - if (qAbs(ca.red() - ce.red()) > 2) + if (qAbs(ca.red() - ce.red()) > threshold) result = false; - if (qAbs(ca.green() - ce.green()) > 2) + if (qAbs(ca.green() - ce.green()) > threshold) result = false; - if (qAbs(ca.blue() - ce.blue()) > 2) + if (qAbs(ca.blue() - ce.blue()) > threshold) result = false; if (!result) @@ -293,15 +302,23 @@ void tst_QPixmap::setAlphaChannel() void tst_QPixmap::fromImage_data() { + bool is16bit = false; +#ifdef Q_WS_X11 + if (QX11Info::appDepth() == 16) + is16bit = true; +#endif + QTest::addColumn("format"); QTest::newRow("Format_Mono") << QImage::Format_Mono; QTest::newRow("Format_MonoLSB") << QImage::Format_MonoLSB; // QTest::newRow("Format_Indexed8") << QImage::Format_Indexed8; - QTest::newRow("Format_RGB32") << QImage::Format_RGB32; + if (!is16bit) + QTest::newRow("Format_RGB32") << QImage::Format_RGB32; QTest::newRow("Format_ARGB32") << QImage::Format_ARGB32; QTest::newRow("Format_ARGB32_Premultiplied") << QImage::Format_ARGB32_Premultiplied; - QTest::newRow("Format_RGB16") << QImage::Format_RGB16; + if (!is16bit) + QTest::newRow("Format_RGB16") << QImage::Format_RGB16; } void tst_QPixmap::fromImage() @@ -986,7 +1003,7 @@ static void compareImages(const QImage &image1, const QImage &image2) QRgb p1 = image1.pixel(x, y); QRgb p2 = image2.pixel(x, y); - bool pixelMatches = + bool pixelMatches = qAbs(qRed(p1) - qRed(p2)) <= fuzz && qAbs(qGreen(p1) - qGreen(p2)) <= fuzz && qAbs(qBlue(p1) - qBlue(p2)) <= fuzz -- cgit v0.12 From 0ec49eca052e452a20d0ab7219c3a42589745ba5 Mon Sep 17 00:00:00 2001 From: Jocelyn Turcotte Date: Thu, 1 Oct 2009 11:42:15 +0200 Subject: Update mkdist-webkit script with latest tag --- util/webkit/mkdist-webkit | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/webkit/mkdist-webkit b/util/webkit/mkdist-webkit index b1efe91..34a2ec7 100755 --- a/util/webkit/mkdist-webkit +++ b/util/webkit/mkdist-webkit @@ -5,7 +5,7 @@ die() { exit 1 } -default_tag="qtwebkit-4.6-snapshot-29092009-2" +default_tag="qtwebkit-4.6-snapshot-30092009-2" if [ $# -eq 0 ]; then tag="$default_tag" -- cgit v0.12 From 34bd937aea27fabbfac964b80bc0ab50d677277e Mon Sep 17 00:00:00 2001 From: Jocelyn Turcotte Date: Thu, 1 Oct 2009 11:45:01 +0200 Subject: Updated WebKit from /home/joce/dev/qtwebkit/ to qtwebkit-4.6-snapshot-30092009-2 ( 284ebfc0df42d408d99838507c1ed335fba9bcf0 ) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Changes in WebKit/qt since the last update: ++ b/WebKit/qt/ChangeLog 2009-09-29 Andras Becsi Reviewed by Tor Arne Vestbø. [Qt] Default font size reconciliation to 16px/13px to match other platform's de-facto standard. This fixes https://bugs.webkit.org/show_bug.cgi?id=19674. * Api/qwebsettings.cpp: (QWebSettings::QWebSettings): 2009-09-29 Jedrzej Nowacki Reviewed by Simon Hausmann. https://bugs.webkit.org/show_bug.cgi?id=29844 QWebPage dependency autotest fix. Fix for database() autotest. All opened databases should be removed at end of test. * tests/qwebpage/tst_qwebpage.cpp: (tst_QWebPage::database): 2009-09-29 Jedrzej Nowacki Reviewed by Simon Hausmann. Some QWebHistory and QWebPage autotest crash fixes. Some checking for m_mainFrame were added. MainFrame should be created at some point of QWebPage live cicle. https://bugs.webkit.org/show_bug.cgi?id=29803 * Api/qwebpage.cpp: (QWebPage::~QWebPage): (QWebPage::currentFrame): (QWebPage::history): (QWebPage::selectedText): (QWebPage::updatePositionDependentActions): * tests/qwebpage/tst_qwebpage.cpp: (tst_QWebPage::crashTests_LazyInitializationOfMainFrame): 2009-09-29 Kenneth Rohde Christiansen Reviewed by Simon Hausmann and Tor Arne Vestbø. Implement QWebPage Extension for error pages, incl. an example on how to use it in QtLauncher. Correct our use of ResourceError. * Api/qwebpage.h: (ExtensionOption::): (ExtensionOption::ErrorPageExtensionReturn::ErrorPageExtensionReturn): * QtLauncher/main.cpp: (WebPage::supportsExtension): (MainWindow::MainWindow): (MainWindow::selectElements): (WebPage::extension): * WebCoreSupport/FrameLoaderClientQt.cpp: (WebCore::FrameLoaderClientQt::cancelledError): (WebCore::FrameLoaderClientQt::blockedError): (WebCore::FrameLoaderClientQt::cannotShowURLError): (WebCore::FrameLoaderClientQt::interruptForPolicyChangeError): (WebCore::FrameLoaderClientQt::cannotShowMIMETypeError): (WebCore::FrameLoaderClientQt::fileDoesNotExistError): (WebCore::FrameLoaderClientQt::callErrorPageExtension): (WebCore::FrameLoaderClientQt::dispatchDidFailProvisionalLoad): (WebCore::FrameLoaderClientQt::dispatchDidFailLoad): * WebCoreSupport/FrameLoaderClientQt.h: --- .../JavaScriptCore/API/JSCallbackConstructor.cpp | 2 +- .../JavaScriptCore/API/JSCallbackConstructor.h | 2 +- .../webkit/JavaScriptCore/API/JSCallbackObject.h | 2 +- .../JavaScriptCore/API/JSCallbackObjectFunctions.h | 2 +- src/3rdparty/webkit/JavaScriptCore/ChangeLog | 428 ++++++++ .../webkit/JavaScriptCore/bytecode/CodeBlock.h | 4 +- .../webkit/JavaScriptCore/bytecode/SamplingTool.h | 2 +- .../webkit/JavaScriptCore/debugger/Debugger.cpp | 6 +- .../JavaScriptCore/debugger/DebuggerCallFrame.cpp | 6 +- .../JavaScriptCore/interpreter/Interpreter.cpp | 55 +- .../JavaScriptCore/interpreter/Interpreter.h | 10 +- src/3rdparty/webkit/JavaScriptCore/jit/JIT.h | 8 +- .../webkit/JavaScriptCore/jit/JITArithmetic.cpp | 160 +-- .../webkit/JavaScriptCore/jit/JITOpcodes.cpp | 30 +- src/3rdparty/webkit/JavaScriptCore/jsc.cpp | 21 +- .../JavaScriptCore/runtime/ArrayConstructor.cpp | 2 +- .../JavaScriptCore/runtime/ArrayConstructor.h | 2 +- .../JavaScriptCore/runtime/ArrayPrototype.cpp | 2 +- .../webkit/JavaScriptCore/runtime/ArrayPrototype.h | 2 +- .../JavaScriptCore/runtime/BooleanConstructor.cpp | 2 +- .../JavaScriptCore/runtime/BooleanConstructor.h | 2 +- .../JavaScriptCore/runtime/BooleanObject.cpp | 2 +- .../webkit/JavaScriptCore/runtime/BooleanObject.h | 2 +- .../JavaScriptCore/runtime/BooleanPrototype.cpp | 2 +- .../JavaScriptCore/runtime/BooleanPrototype.h | 2 +- .../webkit/JavaScriptCore/runtime/Collector.cpp | 8 +- .../webkit/JavaScriptCore/runtime/Completion.cpp | 10 +- .../JavaScriptCore/runtime/DateConstructor.cpp | 2 +- .../JavaScriptCore/runtime/DateConstructor.h | 2 +- .../webkit/JavaScriptCore/runtime/DateInstance.cpp | 2 +- .../webkit/JavaScriptCore/runtime/DateInstance.h | 2 +- .../JavaScriptCore/runtime/DatePrototype.cpp | 2 +- .../webkit/JavaScriptCore/runtime/DatePrototype.h | 2 +- .../JavaScriptCore/runtime/ErrorConstructor.cpp | 2 +- .../JavaScriptCore/runtime/ErrorConstructor.h | 2 +- .../JavaScriptCore/runtime/ErrorInstance.cpp | 2 +- .../webkit/JavaScriptCore/runtime/ErrorInstance.h | 2 +- .../JavaScriptCore/runtime/ErrorPrototype.cpp | 2 +- .../webkit/JavaScriptCore/runtime/ErrorPrototype.h | 2 +- .../webkit/JavaScriptCore/runtime/Executable.h | 22 +- .../JavaScriptCore/runtime/FunctionConstructor.cpp | 2 +- .../JavaScriptCore/runtime/FunctionConstructor.h | 2 +- .../JavaScriptCore/runtime/FunctionPrototype.cpp | 2 +- .../JavaScriptCore/runtime/FunctionPrototype.h | 2 +- .../JavaScriptCore/runtime/GlobalEvalFunction.cpp | 2 +- .../JavaScriptCore/runtime/GlobalEvalFunction.h | 2 +- .../JavaScriptCore/runtime/InternalFunction.cpp | 2 +- .../JavaScriptCore/runtime/InternalFunction.h | 4 +- .../webkit/JavaScriptCore/runtime/JSActivation.cpp | 2 +- .../webkit/JavaScriptCore/runtime/JSActivation.h | 4 +- .../webkit/JavaScriptCore/runtime/JSArray.cpp | 6 +- .../webkit/JavaScriptCore/runtime/JSArray.h | 6 +- .../webkit/JavaScriptCore/runtime/JSByteArray.cpp | 2 +- .../webkit/JavaScriptCore/runtime/JSByteArray.h | 2 +- .../webkit/JavaScriptCore/runtime/JSFunction.cpp | 6 +- .../webkit/JavaScriptCore/runtime/JSFunction.h | 6 +- .../webkit/JavaScriptCore/runtime/JSGlobalData.cpp | 15 + .../webkit/JavaScriptCore/runtime/JSGlobalData.h | 3 + .../JavaScriptCore/runtime/JSGlobalObject.cpp | 7 +- .../webkit/JavaScriptCore/runtime/JSGlobalObject.h | 24 +- .../runtime/JSGlobalObjectFunctions.cpp | 6 +- .../webkit/JavaScriptCore/runtime/JSONObject.h | 2 +- .../webkit/JavaScriptCore/runtime/JSObject.h | 9 +- .../JavaScriptCore/runtime/JSVariableObject.h | 2 +- .../JavaScriptCore/runtime/JSWrapperObject.h | 4 +- .../webkit/JavaScriptCore/runtime/MathObject.cpp | 2 +- .../webkit/JavaScriptCore/runtime/MathObject.h | 2 +- .../runtime/NativeErrorConstructor.cpp | 2 +- .../runtime/NativeErrorConstructor.h | 2 +- .../runtime/NativeErrorPrototype.cpp | 2 +- .../JavaScriptCore/runtime/NativeErrorPrototype.h | 2 +- .../JavaScriptCore/runtime/NumberConstructor.cpp | 2 +- .../JavaScriptCore/runtime/NumberConstructor.h | 2 +- .../webkit/JavaScriptCore/runtime/NumberObject.cpp | 2 +- .../webkit/JavaScriptCore/runtime/NumberObject.h | 2 +- .../JavaScriptCore/runtime/NumberPrototype.cpp | 2 +- .../JavaScriptCore/runtime/NumberPrototype.h | 2 +- .../JavaScriptCore/runtime/ObjectConstructor.cpp | 2 +- .../JavaScriptCore/runtime/ObjectConstructor.h | 2 +- .../JavaScriptCore/runtime/ObjectPrototype.cpp | 2 +- .../JavaScriptCore/runtime/ObjectPrototype.h | 2 +- .../JavaScriptCore/runtime/PropertyNameArray.h | 2 +- .../JavaScriptCore/runtime/PrototypeFunction.cpp | 2 +- .../JavaScriptCore/runtime/PrototypeFunction.h | 2 +- .../JavaScriptCore/runtime/RegExpConstructor.cpp | 2 +- .../JavaScriptCore/runtime/RegExpConstructor.h | 2 +- .../webkit/JavaScriptCore/runtime/RegExpObject.cpp | 2 +- .../webkit/JavaScriptCore/runtime/RegExpObject.h | 4 +- .../JavaScriptCore/runtime/RegExpPrototype.cpp | 2 +- .../JavaScriptCore/runtime/RegExpPrototype.h | 2 +- .../JavaScriptCore/runtime/StringConstructor.cpp | 2 +- .../JavaScriptCore/runtime/StringConstructor.h | 2 +- .../webkit/JavaScriptCore/runtime/StringObject.cpp | 6 +- .../webkit/JavaScriptCore/runtime/StringObject.h | 6 +- .../StringObjectThatMasqueradesAsUndefined.h | 2 +- .../JavaScriptCore/runtime/StringPrototype.cpp | 2 +- .../JavaScriptCore/runtime/StringPrototype.h | 2 +- .../webkit/JavaScriptCore/wtf/Assertions.cpp | 4 + .../webkit/JavaScriptCore/wtf/Assertions.h | 12 + .../webkit/JavaScriptCore/wtf/PassRefPtr.h | 58 +- src/3rdparty/webkit/JavaScriptCore/wtf/Platform.h | 6 +- src/3rdparty/webkit/JavaScriptCore/wtf/RefPtr.h | 27 + src/3rdparty/webkit/VERSION | 4 +- src/3rdparty/webkit/WebCore/ChangeLog | 1100 ++++++++++++++++++++ src/3rdparty/webkit/WebCore/WebCore.gypi | 36 +- src/3rdparty/webkit/WebCore/WebCore.pro | 28 +- .../WebCore/bindings/js/DOMObjectWithSVGContext.h | 2 +- .../WebCore/bindings/js/JSAbstractWorkerCustom.cpp | 4 +- .../bindings/js/JSDOMApplicationCacheCustom.cpp | 4 +- .../webkit/WebCore/bindings/js/JSDOMBinding.cpp | 4 +- .../webkit/WebCore/bindings/js/JSDOMBinding.h | 12 +- .../WebCore/bindings/js/JSDOMGlobalObject.cpp | 14 +- .../webkit/WebCore/bindings/js/JSDOMGlobalObject.h | 10 +- .../webkit/WebCore/bindings/js/JSDOMWindowBase.cpp | 2 +- .../webkit/WebCore/bindings/js/JSDOMWindowBase.h | 2 +- .../WebCore/bindings/js/JSDOMWindowCustom.cpp | 12 +- .../webkit/WebCore/bindings/js/JSEventListener.cpp | 26 +- .../webkit/WebCore/bindings/js/JSEventListener.h | 13 +- .../WebCore/bindings/js/JSEventSourceCustom.cpp | 4 +- .../WebCore/bindings/js/JSHTMLAllCollection.h | 2 +- .../bindings/js/JSInspectedObjectWrapper.cpp | 2 +- .../WebCore/bindings/js/JSInspectedObjectWrapper.h | 2 +- .../bindings/js/JSInspectorCallbackWrapper.cpp | 2 +- .../bindings/js/JSInspectorCallbackWrapper.h | 2 +- .../WebCore/bindings/js/JSLazyEventListener.cpp | 49 +- .../WebCore/bindings/js/JSLazyEventListener.h | 11 +- .../WebCore/bindings/js/JSMessagePortCustom.cpp | 4 +- .../webkit/WebCore/bindings/js/JSNodeCustom.cpp | 4 +- .../bindings/js/JSQuarantinedObjectWrapper.cpp | 2 +- .../bindings/js/JSQuarantinedObjectWrapper.h | 2 +- .../bindings/js/JSSVGElementInstanceCustom.cpp | 4 +- .../WebCore/bindings/js/JSWorkerContextBase.cpp | 2 +- .../WebCore/bindings/js/JSWorkerContextBase.h | 2 +- .../WebCore/bindings/js/JSWorkerContextCustom.cpp | 4 +- .../WebCore/bindings/js/JSXMLHttpRequestCustom.cpp | 4 +- .../bindings/js/JSXMLHttpRequestUploadCustom.cpp | 4 +- .../WebCore/bindings/js/ScriptEventListener.cpp | 57 +- .../WebCore/bindings/js/ScriptEventListener.h | 3 + .../WebCore/bindings/scripts/CodeGeneratorCOM.pm | 3 +- .../WebCore/bindings/scripts/CodeGeneratorJS.pm | 22 +- .../WebCore/bindings/scripts/CodeGeneratorV8.pm | 8 +- .../webkit/WebCore/bridge/runtime_object.cpp | 2 +- .../webkit/WebCore/bridge/runtime_object.h | 2 +- src/3rdparty/webkit/WebCore/dom/Document.cpp | 19 +- src/3rdparty/webkit/WebCore/dom/Document.h | 13 +- src/3rdparty/webkit/WebCore/dom/EventListener.h | 7 +- src/3rdparty/webkit/WebCore/dom/EventListener.idl | 2 +- src/3rdparty/webkit/WebCore/dom/EventTarget.cpp | 2 +- src/3rdparty/webkit/WebCore/dom/Node.cpp | 25 +- src/3rdparty/webkit/WebCore/dom/Node.h | 3 + src/3rdparty/webkit/WebCore/dom/TransformSource.h | 51 + .../webkit/WebCore/dom/TransformSourceLibxslt.cpp | 43 + .../webkit/WebCore/dom/TransformSourceQt.cpp | 34 + .../webkit/WebCore/dom/XMLTokenizerLibxml2.cpp | 4 +- src/3rdparty/webkit/WebCore/dom/XMLTokenizerQt.cpp | 49 +- .../WebCore/editing/BreakBlockquoteCommand.cpp | 9 + .../WebCore/editing/DeleteSelectionCommand.cpp | 2 - .../webkit/WebCore/generated/JSAbstractWorker.cpp | 4 +- .../webkit/WebCore/generated/JSAbstractWorker.h | 4 +- src/3rdparty/webkit/WebCore/generated/JSAttr.cpp | 2 +- src/3rdparty/webkit/WebCore/generated/JSAttr.h | 4 +- .../webkit/WebCore/generated/JSBarInfo.cpp | 2 +- src/3rdparty/webkit/WebCore/generated/JSBarInfo.h | 4 +- .../webkit/WebCore/generated/JSCDATASection.cpp | 2 +- .../webkit/WebCore/generated/JSCDATASection.h | 4 +- .../webkit/WebCore/generated/JSCSSCharsetRule.cpp | 2 +- .../webkit/WebCore/generated/JSCSSCharsetRule.h | 4 +- .../webkit/WebCore/generated/JSCSSFontFaceRule.cpp | 2 +- .../webkit/WebCore/generated/JSCSSFontFaceRule.h | 4 +- .../webkit/WebCore/generated/JSCSSImportRule.cpp | 2 +- .../webkit/WebCore/generated/JSCSSImportRule.h | 4 +- .../webkit/WebCore/generated/JSCSSMediaRule.cpp | 2 +- .../webkit/WebCore/generated/JSCSSMediaRule.h | 4 +- .../webkit/WebCore/generated/JSCSSPageRule.cpp | 2 +- .../webkit/WebCore/generated/JSCSSPageRule.h | 4 +- .../WebCore/generated/JSCSSPrimitiveValue.cpp | 2 +- .../webkit/WebCore/generated/JSCSSPrimitiveValue.h | 4 +- .../webkit/WebCore/generated/JSCSSRule.cpp | 2 +- src/3rdparty/webkit/WebCore/generated/JSCSSRule.h | 4 +- .../webkit/WebCore/generated/JSCSSRuleList.cpp | 2 +- .../webkit/WebCore/generated/JSCSSRuleList.h | 4 +- .../WebCore/generated/JSCSSStyleDeclaration.cpp | 2 +- .../WebCore/generated/JSCSSStyleDeclaration.h | 4 +- .../webkit/WebCore/generated/JSCSSStyleRule.cpp | 2 +- .../webkit/WebCore/generated/JSCSSStyleRule.h | 4 +- .../webkit/WebCore/generated/JSCSSStyleSheet.cpp | 2 +- .../webkit/WebCore/generated/JSCSSStyleSheet.h | 4 +- .../webkit/WebCore/generated/JSCSSValue.cpp | 2 +- src/3rdparty/webkit/WebCore/generated/JSCSSValue.h | 4 +- .../webkit/WebCore/generated/JSCSSValueList.cpp | 2 +- .../webkit/WebCore/generated/JSCSSValueList.h | 4 +- .../generated/JSCSSVariablesDeclaration.cpp | 2 +- .../WebCore/generated/JSCSSVariablesDeclaration.h | 4 +- .../WebCore/generated/JSCSSVariablesRule.cpp | 2 +- .../webkit/WebCore/generated/JSCSSVariablesRule.h | 4 +- .../webkit/WebCore/generated/JSCanvasArray.cpp | 2 +- .../webkit/WebCore/generated/JSCanvasArray.h | 4 +- .../WebCore/generated/JSCanvasArrayBuffer.cpp | 2 +- .../webkit/WebCore/generated/JSCanvasArrayBuffer.h | 4 +- .../webkit/WebCore/generated/JSCanvasByteArray.cpp | 2 +- .../webkit/WebCore/generated/JSCanvasByteArray.h | 4 +- .../WebCore/generated/JSCanvasFloatArray.cpp | 2 +- .../webkit/WebCore/generated/JSCanvasFloatArray.h | 4 +- .../webkit/WebCore/generated/JSCanvasGradient.cpp | 2 +- .../webkit/WebCore/generated/JSCanvasGradient.h | 4 +- .../webkit/WebCore/generated/JSCanvasIntArray.cpp | 2 +- .../webkit/WebCore/generated/JSCanvasIntArray.h | 4 +- .../webkit/WebCore/generated/JSCanvasPattern.cpp | 2 +- .../webkit/WebCore/generated/JSCanvasPattern.h | 4 +- .../WebCore/generated/JSCanvasRenderingContext.cpp | 2 +- .../WebCore/generated/JSCanvasRenderingContext.h | 4 +- .../generated/JSCanvasRenderingContext2D.cpp | 2 +- .../WebCore/generated/JSCanvasRenderingContext2D.h | 4 +- .../generated/JSCanvasRenderingContext3D.cpp | 2 +- .../WebCore/generated/JSCanvasRenderingContext3D.h | 4 +- .../WebCore/generated/JSCanvasShortArray.cpp | 2 +- .../webkit/WebCore/generated/JSCanvasShortArray.h | 4 +- .../generated/JSCanvasUnsignedByteArray.cpp | 2 +- .../WebCore/generated/JSCanvasUnsignedByteArray.h | 4 +- .../WebCore/generated/JSCanvasUnsignedIntArray.cpp | 2 +- .../WebCore/generated/JSCanvasUnsignedIntArray.h | 4 +- .../generated/JSCanvasUnsignedShortArray.cpp | 2 +- .../WebCore/generated/JSCanvasUnsignedShortArray.h | 4 +- .../webkit/WebCore/generated/JSCharacterData.cpp | 2 +- .../webkit/WebCore/generated/JSCharacterData.h | 4 +- .../webkit/WebCore/generated/JSClientRect.cpp | 2 +- .../webkit/WebCore/generated/JSClientRect.h | 4 +- .../webkit/WebCore/generated/JSClientRectList.cpp | 2 +- .../webkit/WebCore/generated/JSClientRectList.h | 4 +- .../webkit/WebCore/generated/JSClipboard.cpp | 2 +- .../webkit/WebCore/generated/JSClipboard.h | 4 +- .../webkit/WebCore/generated/JSComment.cpp | 2 +- src/3rdparty/webkit/WebCore/generated/JSComment.h | 4 +- .../webkit/WebCore/generated/JSConsole.cpp | 2 +- src/3rdparty/webkit/WebCore/generated/JSConsole.h | 4 +- .../webkit/WebCore/generated/JSCoordinates.cpp | 2 +- .../webkit/WebCore/generated/JSCoordinates.h | 4 +- .../webkit/WebCore/generated/JSCounter.cpp | 2 +- src/3rdparty/webkit/WebCore/generated/JSCounter.h | 4 +- .../WebCore/generated/JSDOMApplicationCache.cpp | 18 +- .../WebCore/generated/JSDOMApplicationCache.h | 4 +- .../WebCore/generated/JSDOMCoreException.cpp | 2 +- .../webkit/WebCore/generated/JSDOMCoreException.h | 4 +- .../WebCore/generated/JSDOMImplementation.cpp | 2 +- .../webkit/WebCore/generated/JSDOMImplementation.h | 4 +- .../webkit/WebCore/generated/JSDOMParser.cpp | 2 +- .../webkit/WebCore/generated/JSDOMParser.h | 4 +- .../webkit/WebCore/generated/JSDOMSelection.cpp | 2 +- .../webkit/WebCore/generated/JSDOMSelection.h | 4 +- .../webkit/WebCore/generated/JSDOMWindow.cpp | 158 +-- .../webkit/WebCore/generated/JSDOMWindow.h | 7 +- .../webkit/WebCore/generated/JSDataGridColumn.cpp | 2 +- .../webkit/WebCore/generated/JSDataGridColumn.h | 4 +- .../WebCore/generated/JSDataGridColumnList.cpp | 2 +- .../WebCore/generated/JSDataGridColumnList.h | 4 +- .../webkit/WebCore/generated/JSDatabase.cpp | 2 +- src/3rdparty/webkit/WebCore/generated/JSDatabase.h | 4 +- .../WebCore/generated/JSDedicatedWorkerContext.cpp | 4 +- .../WebCore/generated/JSDedicatedWorkerContext.h | 4 +- .../webkit/WebCore/generated/JSDocument.cpp | 80 +- src/3rdparty/webkit/WebCore/generated/JSDocument.h | 4 +- .../WebCore/generated/JSDocumentFragment.cpp | 2 +- .../webkit/WebCore/generated/JSDocumentFragment.h | 4 +- .../webkit/WebCore/generated/JSDocumentType.cpp | 2 +- .../webkit/WebCore/generated/JSDocumentType.h | 4 +- .../webkit/WebCore/generated/JSElement.cpp | 80 +- src/3rdparty/webkit/WebCore/generated/JSElement.h | 4 +- src/3rdparty/webkit/WebCore/generated/JSEntity.cpp | 2 +- src/3rdparty/webkit/WebCore/generated/JSEntity.h | 4 +- .../webkit/WebCore/generated/JSEntityReference.cpp | 2 +- .../webkit/WebCore/generated/JSEntityReference.h | 4 +- .../webkit/WebCore/generated/JSErrorEvent.cpp | 2 +- .../webkit/WebCore/generated/JSErrorEvent.h | 4 +- src/3rdparty/webkit/WebCore/generated/JSEvent.cpp | 2 +- src/3rdparty/webkit/WebCore/generated/JSEvent.h | 4 +- .../webkit/WebCore/generated/JSEventException.cpp | 2 +- .../webkit/WebCore/generated/JSEventException.h | 4 +- .../webkit/WebCore/generated/JSEventSource.cpp | 8 +- .../webkit/WebCore/generated/JSEventSource.h | 4 +- src/3rdparty/webkit/WebCore/generated/JSFile.cpp | 2 +- src/3rdparty/webkit/WebCore/generated/JSFile.h | 4 +- .../webkit/WebCore/generated/JSFileList.cpp | 2 +- src/3rdparty/webkit/WebCore/generated/JSFileList.h | 4 +- .../webkit/WebCore/generated/JSGeolocation.cpp | 2 +- .../webkit/WebCore/generated/JSGeolocation.h | 4 +- .../webkit/WebCore/generated/JSGeoposition.cpp | 2 +- .../webkit/WebCore/generated/JSGeoposition.h | 4 +- .../WebCore/generated/JSHTMLAnchorElement.cpp | 2 +- .../webkit/WebCore/generated/JSHTMLAnchorElement.h | 4 +- .../WebCore/generated/JSHTMLAppletElement.cpp | 2 +- .../webkit/WebCore/generated/JSHTMLAppletElement.h | 4 +- .../webkit/WebCore/generated/JSHTMLAreaElement.cpp | 2 +- .../webkit/WebCore/generated/JSHTMLAreaElement.h | 4 +- .../WebCore/generated/JSHTMLAudioElement.cpp | 2 +- .../webkit/WebCore/generated/JSHTMLAudioElement.h | 4 +- .../webkit/WebCore/generated/JSHTMLBRElement.cpp | 2 +- .../webkit/WebCore/generated/JSHTMLBRElement.h | 4 +- .../webkit/WebCore/generated/JSHTMLBaseElement.cpp | 2 +- .../webkit/WebCore/generated/JSHTMLBaseElement.h | 4 +- .../WebCore/generated/JSHTMLBaseFontElement.cpp | 2 +- .../WebCore/generated/JSHTMLBaseFontElement.h | 4 +- .../WebCore/generated/JSHTMLBlockquoteElement.cpp | 2 +- .../WebCore/generated/JSHTMLBlockquoteElement.h | 4 +- .../webkit/WebCore/generated/JSHTMLBodyElement.cpp | 18 +- .../webkit/WebCore/generated/JSHTMLBodyElement.h | 4 +- .../WebCore/generated/JSHTMLButtonElement.cpp | 2 +- .../webkit/WebCore/generated/JSHTMLButtonElement.h | 4 +- .../WebCore/generated/JSHTMLCanvasElement.cpp | 2 +- .../webkit/WebCore/generated/JSHTMLCanvasElement.h | 4 +- .../webkit/WebCore/generated/JSHTMLCollection.cpp | 2 +- .../webkit/WebCore/generated/JSHTMLCollection.h | 4 +- .../WebCore/generated/JSHTMLDListElement.cpp | 2 +- .../webkit/WebCore/generated/JSHTMLDListElement.h | 4 +- .../generated/JSHTMLDataGridCellElement.cpp | 2 +- .../WebCore/generated/JSHTMLDataGridCellElement.h | 4 +- .../WebCore/generated/JSHTMLDataGridColElement.cpp | 2 +- .../WebCore/generated/JSHTMLDataGridColElement.h | 4 +- .../WebCore/generated/JSHTMLDataGridElement.cpp | 2 +- .../WebCore/generated/JSHTMLDataGridElement.h | 4 +- .../WebCore/generated/JSHTMLDataGridRowElement.cpp | 2 +- .../WebCore/generated/JSHTMLDataGridRowElement.h | 4 +- .../WebCore/generated/JSHTMLDataListElement.cpp | 2 +- .../WebCore/generated/JSHTMLDataListElement.h | 4 +- .../WebCore/generated/JSHTMLDirectoryElement.cpp | 2 +- .../WebCore/generated/JSHTMLDirectoryElement.h | 4 +- .../webkit/WebCore/generated/JSHTMLDivElement.cpp | 2 +- .../webkit/WebCore/generated/JSHTMLDivElement.h | 4 +- .../webkit/WebCore/generated/JSHTMLDocument.cpp | 2 +- .../webkit/WebCore/generated/JSHTMLDocument.h | 4 +- .../webkit/WebCore/generated/JSHTMLElement.cpp | 2 +- .../webkit/WebCore/generated/JSHTMLElement.h | 4 +- .../WebCore/generated/JSHTMLEmbedElement.cpp | 2 +- .../webkit/WebCore/generated/JSHTMLEmbedElement.h | 4 +- .../WebCore/generated/JSHTMLFieldSetElement.cpp | 2 +- .../WebCore/generated/JSHTMLFieldSetElement.h | 4 +- .../webkit/WebCore/generated/JSHTMLFontElement.cpp | 2 +- .../webkit/WebCore/generated/JSHTMLFontElement.h | 4 +- .../webkit/WebCore/generated/JSHTMLFormElement.cpp | 2 +- .../webkit/WebCore/generated/JSHTMLFormElement.h | 4 +- .../WebCore/generated/JSHTMLFrameElement.cpp | 2 +- .../webkit/WebCore/generated/JSHTMLFrameElement.h | 4 +- .../WebCore/generated/JSHTMLFrameSetElement.cpp | 18 +- .../WebCore/generated/JSHTMLFrameSetElement.h | 4 +- .../webkit/WebCore/generated/JSHTMLHRElement.cpp | 2 +- .../webkit/WebCore/generated/JSHTMLHRElement.h | 4 +- .../webkit/WebCore/generated/JSHTMLHeadElement.cpp | 2 +- .../webkit/WebCore/generated/JSHTMLHeadElement.h | 4 +- .../WebCore/generated/JSHTMLHeadingElement.cpp | 2 +- .../WebCore/generated/JSHTMLHeadingElement.h | 4 +- .../webkit/WebCore/generated/JSHTMLHtmlElement.cpp | 2 +- .../webkit/WebCore/generated/JSHTMLHtmlElement.h | 4 +- .../WebCore/generated/JSHTMLIFrameElement.cpp | 2 +- .../webkit/WebCore/generated/JSHTMLIFrameElement.h | 4 +- .../WebCore/generated/JSHTMLImageElement.cpp | 2 +- .../webkit/WebCore/generated/JSHTMLImageElement.h | 4 +- .../WebCore/generated/JSHTMLInputElement.cpp | 6 +- .../webkit/WebCore/generated/JSHTMLInputElement.h | 4 +- .../WebCore/generated/JSHTMLIsIndexElement.cpp | 2 +- .../WebCore/generated/JSHTMLIsIndexElement.h | 4 +- .../webkit/WebCore/generated/JSHTMLLIElement.cpp | 2 +- .../webkit/WebCore/generated/JSHTMLLIElement.h | 4 +- .../WebCore/generated/JSHTMLLabelElement.cpp | 2 +- .../webkit/WebCore/generated/JSHTMLLabelElement.h | 4 +- .../WebCore/generated/JSHTMLLegendElement.cpp | 2 +- .../webkit/WebCore/generated/JSHTMLLegendElement.h | 4 +- .../webkit/WebCore/generated/JSHTMLLinkElement.cpp | 2 +- .../webkit/WebCore/generated/JSHTMLLinkElement.h | 4 +- .../webkit/WebCore/generated/JSHTMLMapElement.cpp | 2 +- .../webkit/WebCore/generated/JSHTMLMapElement.h | 4 +- .../WebCore/generated/JSHTMLMarqueeElement.cpp | 2 +- .../WebCore/generated/JSHTMLMarqueeElement.h | 4 +- .../WebCore/generated/JSHTMLMediaElement.cpp | 2 +- .../webkit/WebCore/generated/JSHTMLMediaElement.h | 4 +- .../webkit/WebCore/generated/JSHTMLMenuElement.cpp | 2 +- .../webkit/WebCore/generated/JSHTMLMenuElement.h | 4 +- .../webkit/WebCore/generated/JSHTMLMetaElement.cpp | 2 +- .../webkit/WebCore/generated/JSHTMLMetaElement.h | 4 +- .../webkit/WebCore/generated/JSHTMLModElement.cpp | 2 +- .../webkit/WebCore/generated/JSHTMLModElement.h | 4 +- .../WebCore/generated/JSHTMLOListElement.cpp | 2 +- .../webkit/WebCore/generated/JSHTMLOListElement.h | 4 +- .../WebCore/generated/JSHTMLObjectElement.cpp | 2 +- .../webkit/WebCore/generated/JSHTMLObjectElement.h | 4 +- .../WebCore/generated/JSHTMLOptGroupElement.cpp | 2 +- .../WebCore/generated/JSHTMLOptGroupElement.h | 4 +- .../WebCore/generated/JSHTMLOptionElement.cpp | 2 +- .../webkit/WebCore/generated/JSHTMLOptionElement.h | 4 +- .../WebCore/generated/JSHTMLOptionsCollection.cpp | 2 +- .../WebCore/generated/JSHTMLOptionsCollection.h | 4 +- .../WebCore/generated/JSHTMLParagraphElement.cpp | 2 +- .../WebCore/generated/JSHTMLParagraphElement.h | 4 +- .../WebCore/generated/JSHTMLParamElement.cpp | 2 +- .../webkit/WebCore/generated/JSHTMLParamElement.h | 4 +- .../webkit/WebCore/generated/JSHTMLPreElement.cpp | 2 +- .../webkit/WebCore/generated/JSHTMLPreElement.h | 4 +- .../WebCore/generated/JSHTMLQuoteElement.cpp | 2 +- .../webkit/WebCore/generated/JSHTMLQuoteElement.h | 4 +- .../WebCore/generated/JSHTMLScriptElement.cpp | 2 +- .../webkit/WebCore/generated/JSHTMLScriptElement.h | 4 +- .../WebCore/generated/JSHTMLSelectElement.cpp | 2 +- .../webkit/WebCore/generated/JSHTMLSelectElement.h | 4 +- .../WebCore/generated/JSHTMLSourceElement.cpp | 2 +- .../webkit/WebCore/generated/JSHTMLSourceElement.h | 4 +- .../WebCore/generated/JSHTMLStyleElement.cpp | 2 +- .../webkit/WebCore/generated/JSHTMLStyleElement.h | 4 +- .../generated/JSHTMLTableCaptionElement.cpp | 2 +- .../WebCore/generated/JSHTMLTableCaptionElement.h | 4 +- .../WebCore/generated/JSHTMLTableCellElement.cpp | 2 +- .../WebCore/generated/JSHTMLTableCellElement.h | 4 +- .../WebCore/generated/JSHTMLTableColElement.cpp | 2 +- .../WebCore/generated/JSHTMLTableColElement.h | 4 +- .../WebCore/generated/JSHTMLTableElement.cpp | 2 +- .../webkit/WebCore/generated/JSHTMLTableElement.h | 4 +- .../WebCore/generated/JSHTMLTableRowElement.cpp | 2 +- .../WebCore/generated/JSHTMLTableRowElement.h | 4 +- .../generated/JSHTMLTableSectionElement.cpp | 2 +- .../WebCore/generated/JSHTMLTableSectionElement.h | 4 +- .../WebCore/generated/JSHTMLTextAreaElement.cpp | 6 +- .../WebCore/generated/JSHTMLTextAreaElement.h | 4 +- .../WebCore/generated/JSHTMLTitleElement.cpp | 2 +- .../webkit/WebCore/generated/JSHTMLTitleElement.h | 4 +- .../WebCore/generated/JSHTMLUListElement.cpp | 2 +- .../webkit/WebCore/generated/JSHTMLUListElement.h | 4 +- .../WebCore/generated/JSHTMLVideoElement.cpp | 2 +- .../webkit/WebCore/generated/JSHTMLVideoElement.h | 4 +- .../webkit/WebCore/generated/JSHistory.cpp | 2 +- src/3rdparty/webkit/WebCore/generated/JSHistory.h | 4 +- .../webkit/WebCore/generated/JSImageData.cpp | 2 +- .../webkit/WebCore/generated/JSImageData.h | 4 +- .../WebCore/generated/JSInspectorBackend.cpp | 75 +- .../webkit/WebCore/generated/JSInspectorBackend.h | 9 +- .../WebCore/generated/JSJavaScriptCallFrame.cpp | 2 +- .../WebCore/generated/JSJavaScriptCallFrame.h | 4 +- .../webkit/WebCore/generated/JSKeyboardEvent.cpp | 2 +- .../webkit/WebCore/generated/JSKeyboardEvent.h | 4 +- .../webkit/WebCore/generated/JSLocation.cpp | 2 +- src/3rdparty/webkit/WebCore/generated/JSLocation.h | 4 +- src/3rdparty/webkit/WebCore/generated/JSMedia.cpp | 2 +- src/3rdparty/webkit/WebCore/generated/JSMedia.h | 4 +- .../webkit/WebCore/generated/JSMediaError.cpp | 2 +- .../webkit/WebCore/generated/JSMediaError.h | 4 +- .../webkit/WebCore/generated/JSMediaList.cpp | 2 +- .../webkit/WebCore/generated/JSMediaList.h | 4 +- .../webkit/WebCore/generated/JSMessageChannel.cpp | 2 +- .../webkit/WebCore/generated/JSMessageChannel.h | 4 +- .../webkit/WebCore/generated/JSMessageEvent.cpp | 2 +- .../webkit/WebCore/generated/JSMessageEvent.h | 4 +- .../webkit/WebCore/generated/JSMessagePort.cpp | 4 +- .../webkit/WebCore/generated/JSMessagePort.h | 4 +- .../webkit/WebCore/generated/JSMimeType.cpp | 2 +- src/3rdparty/webkit/WebCore/generated/JSMimeType.h | 4 +- .../webkit/WebCore/generated/JSMimeTypeArray.cpp | 2 +- .../webkit/WebCore/generated/JSMimeTypeArray.h | 4 +- .../webkit/WebCore/generated/JSMouseEvent.cpp | 2 +- .../webkit/WebCore/generated/JSMouseEvent.h | 4 +- .../webkit/WebCore/generated/JSMutationEvent.cpp | 2 +- .../webkit/WebCore/generated/JSMutationEvent.h | 4 +- .../webkit/WebCore/generated/JSNamedNodeMap.cpp | 2 +- .../webkit/WebCore/generated/JSNamedNodeMap.h | 4 +- .../webkit/WebCore/generated/JSNavigator.cpp | 2 +- .../webkit/WebCore/generated/JSNavigator.h | 4 +- src/3rdparty/webkit/WebCore/generated/JSNode.cpp | 2 +- src/3rdparty/webkit/WebCore/generated/JSNode.h | 4 +- .../webkit/WebCore/generated/JSNodeFilter.cpp | 2 +- .../webkit/WebCore/generated/JSNodeFilter.h | 4 +- .../webkit/WebCore/generated/JSNodeIterator.cpp | 2 +- .../webkit/WebCore/generated/JSNodeIterator.h | 4 +- .../webkit/WebCore/generated/JSNodeList.cpp | 2 +- src/3rdparty/webkit/WebCore/generated/JSNodeList.h | 4 +- .../webkit/WebCore/generated/JSNotation.cpp | 2 +- src/3rdparty/webkit/WebCore/generated/JSNotation.h | 4 +- .../webkit/WebCore/generated/JSOverflowEvent.cpp | 2 +- .../webkit/WebCore/generated/JSOverflowEvent.h | 4 +- .../WebCore/generated/JSPageTransitionEvent.cpp | 2 +- .../WebCore/generated/JSPageTransitionEvent.h | 4 +- src/3rdparty/webkit/WebCore/generated/JSPlugin.cpp | 2 +- src/3rdparty/webkit/WebCore/generated/JSPlugin.h | 4 +- .../webkit/WebCore/generated/JSPluginArray.cpp | 2 +- .../webkit/WebCore/generated/JSPluginArray.h | 4 +- .../webkit/WebCore/generated/JSPositionError.cpp | 2 +- .../webkit/WebCore/generated/JSPositionError.h | 4 +- .../WebCore/generated/JSProcessingInstruction.cpp | 2 +- .../WebCore/generated/JSProcessingInstruction.h | 4 +- .../webkit/WebCore/generated/JSProgressEvent.cpp | 2 +- .../webkit/WebCore/generated/JSProgressEvent.h | 4 +- .../webkit/WebCore/generated/JSRGBColor.cpp | 2 +- src/3rdparty/webkit/WebCore/generated/JSRGBColor.h | 4 +- src/3rdparty/webkit/WebCore/generated/JSRange.cpp | 2 +- src/3rdparty/webkit/WebCore/generated/JSRange.h | 4 +- .../webkit/WebCore/generated/JSRangeException.cpp | 2 +- .../webkit/WebCore/generated/JSRangeException.h | 4 +- src/3rdparty/webkit/WebCore/generated/JSRect.cpp | 2 +- src/3rdparty/webkit/WebCore/generated/JSRect.h | 4 +- .../webkit/WebCore/generated/JSSQLError.cpp | 2 +- src/3rdparty/webkit/WebCore/generated/JSSQLError.h | 4 +- .../webkit/WebCore/generated/JSSQLResultSet.cpp | 2 +- .../webkit/WebCore/generated/JSSQLResultSet.h | 4 +- .../WebCore/generated/JSSQLResultSetRowList.cpp | 2 +- .../WebCore/generated/JSSQLResultSetRowList.h | 4 +- .../webkit/WebCore/generated/JSSQLTransaction.cpp | 2 +- .../webkit/WebCore/generated/JSSQLTransaction.h | 4 +- .../webkit/WebCore/generated/JSSVGAElement.cpp | 2 +- .../webkit/WebCore/generated/JSSVGAElement.h | 4 +- .../WebCore/generated/JSSVGAltGlyphElement.cpp | 2 +- .../WebCore/generated/JSSVGAltGlyphElement.h | 4 +- .../webkit/WebCore/generated/JSSVGAngle.cpp | 2 +- src/3rdparty/webkit/WebCore/generated/JSSVGAngle.h | 4 +- .../WebCore/generated/JSSVGAnimateColorElement.cpp | 2 +- .../WebCore/generated/JSSVGAnimateColorElement.h | 4 +- .../WebCore/generated/JSSVGAnimateElement.cpp | 2 +- .../webkit/WebCore/generated/JSSVGAnimateElement.h | 4 +- .../generated/JSSVGAnimateTransformElement.cpp | 2 +- .../generated/JSSVGAnimateTransformElement.h | 4 +- .../WebCore/generated/JSSVGAnimatedAngle.cpp | 2 +- .../webkit/WebCore/generated/JSSVGAnimatedAngle.h | 4 +- .../WebCore/generated/JSSVGAnimatedBoolean.cpp | 2 +- .../WebCore/generated/JSSVGAnimatedBoolean.h | 4 +- .../WebCore/generated/JSSVGAnimatedEnumeration.cpp | 2 +- .../WebCore/generated/JSSVGAnimatedEnumeration.h | 4 +- .../WebCore/generated/JSSVGAnimatedInteger.cpp | 2 +- .../WebCore/generated/JSSVGAnimatedInteger.h | 4 +- .../WebCore/generated/JSSVGAnimatedLength.cpp | 2 +- .../webkit/WebCore/generated/JSSVGAnimatedLength.h | 4 +- .../WebCore/generated/JSSVGAnimatedLengthList.cpp | 2 +- .../WebCore/generated/JSSVGAnimatedLengthList.h | 4 +- .../WebCore/generated/JSSVGAnimatedNumber.cpp | 2 +- .../webkit/WebCore/generated/JSSVGAnimatedNumber.h | 4 +- .../WebCore/generated/JSSVGAnimatedNumberList.cpp | 2 +- .../WebCore/generated/JSSVGAnimatedNumberList.h | 4 +- .../generated/JSSVGAnimatedPreserveAspectRatio.cpp | 2 +- .../generated/JSSVGAnimatedPreserveAspectRatio.h | 4 +- .../webkit/WebCore/generated/JSSVGAnimatedRect.cpp | 2 +- .../webkit/WebCore/generated/JSSVGAnimatedRect.h | 4 +- .../WebCore/generated/JSSVGAnimatedString.cpp | 2 +- .../webkit/WebCore/generated/JSSVGAnimatedString.h | 4 +- .../generated/JSSVGAnimatedTransformList.cpp | 2 +- .../WebCore/generated/JSSVGAnimatedTransformList.h | 4 +- .../WebCore/generated/JSSVGAnimationElement.cpp | 2 +- .../WebCore/generated/JSSVGAnimationElement.h | 4 +- .../WebCore/generated/JSSVGCircleElement.cpp | 2 +- .../webkit/WebCore/generated/JSSVGCircleElement.h | 4 +- .../WebCore/generated/JSSVGClipPathElement.cpp | 2 +- .../WebCore/generated/JSSVGClipPathElement.h | 4 +- .../webkit/WebCore/generated/JSSVGColor.cpp | 2 +- src/3rdparty/webkit/WebCore/generated/JSSVGColor.h | 4 +- .../JSSVGComponentTransferFunctionElement.cpp | 2 +- .../JSSVGComponentTransferFunctionElement.h | 4 +- .../WebCore/generated/JSSVGCursorElement.cpp | 2 +- .../webkit/WebCore/generated/JSSVGCursorElement.h | 4 +- .../webkit/WebCore/generated/JSSVGDefsElement.cpp | 2 +- .../webkit/WebCore/generated/JSSVGDefsElement.h | 4 +- .../webkit/WebCore/generated/JSSVGDescElement.cpp | 2 +- .../webkit/WebCore/generated/JSSVGDescElement.h | 4 +- .../webkit/WebCore/generated/JSSVGDocument.cpp | 2 +- .../webkit/WebCore/generated/JSSVGDocument.h | 4 +- .../webkit/WebCore/generated/JSSVGElement.cpp | 2 +- .../webkit/WebCore/generated/JSSVGElement.h | 4 +- .../WebCore/generated/JSSVGElementInstance.cpp | 82 +- .../WebCore/generated/JSSVGElementInstance.h | 4 +- .../WebCore/generated/JSSVGElementInstanceList.cpp | 2 +- .../WebCore/generated/JSSVGElementInstanceList.h | 4 +- .../WebCore/generated/JSSVGEllipseElement.cpp | 2 +- .../webkit/WebCore/generated/JSSVGEllipseElement.h | 4 +- .../webkit/WebCore/generated/JSSVGException.cpp | 2 +- .../webkit/WebCore/generated/JSSVGException.h | 4 +- .../WebCore/generated/JSSVGFEBlendElement.cpp | 2 +- .../webkit/WebCore/generated/JSSVGFEBlendElement.h | 4 +- .../generated/JSSVGFEColorMatrixElement.cpp | 2 +- .../WebCore/generated/JSSVGFEColorMatrixElement.h | 4 +- .../generated/JSSVGFEComponentTransferElement.cpp | 2 +- .../generated/JSSVGFEComponentTransferElement.h | 4 +- .../WebCore/generated/JSSVGFECompositeElement.cpp | 2 +- .../WebCore/generated/JSSVGFECompositeElement.h | 4 +- .../generated/JSSVGFEDiffuseLightingElement.cpp | 2 +- .../generated/JSSVGFEDiffuseLightingElement.h | 4 +- .../generated/JSSVGFEDisplacementMapElement.cpp | 2 +- .../generated/JSSVGFEDisplacementMapElement.h | 4 +- .../generated/JSSVGFEDistantLightElement.cpp | 2 +- .../WebCore/generated/JSSVGFEDistantLightElement.h | 4 +- .../WebCore/generated/JSSVGFEFloodElement.cpp | 2 +- .../webkit/WebCore/generated/JSSVGFEFloodElement.h | 4 +- .../WebCore/generated/JSSVGFEFuncAElement.cpp | 2 +- .../webkit/WebCore/generated/JSSVGFEFuncAElement.h | 4 +- .../WebCore/generated/JSSVGFEFuncBElement.cpp | 2 +- .../webkit/WebCore/generated/JSSVGFEFuncBElement.h | 4 +- .../WebCore/generated/JSSVGFEFuncGElement.cpp | 2 +- .../webkit/WebCore/generated/JSSVGFEFuncGElement.h | 4 +- .../WebCore/generated/JSSVGFEFuncRElement.cpp | 2 +- .../webkit/WebCore/generated/JSSVGFEFuncRElement.h | 4 +- .../generated/JSSVGFEGaussianBlurElement.cpp | 2 +- .../WebCore/generated/JSSVGFEGaussianBlurElement.h | 4 +- .../WebCore/generated/JSSVGFEImageElement.cpp | 2 +- .../webkit/WebCore/generated/JSSVGFEImageElement.h | 4 +- .../WebCore/generated/JSSVGFEMergeElement.cpp | 2 +- .../webkit/WebCore/generated/JSSVGFEMergeElement.h | 4 +- .../WebCore/generated/JSSVGFEMergeNodeElement.cpp | 2 +- .../WebCore/generated/JSSVGFEMergeNodeElement.h | 4 +- .../WebCore/generated/JSSVGFEOffsetElement.cpp | 2 +- .../WebCore/generated/JSSVGFEOffsetElement.h | 4 +- .../WebCore/generated/JSSVGFEPointLightElement.cpp | 2 +- .../WebCore/generated/JSSVGFEPointLightElement.h | 4 +- .../generated/JSSVGFESpecularLightingElement.cpp | 2 +- .../generated/JSSVGFESpecularLightingElement.h | 4 +- .../WebCore/generated/JSSVGFESpotLightElement.cpp | 2 +- .../WebCore/generated/JSSVGFESpotLightElement.h | 4 +- .../WebCore/generated/JSSVGFETileElement.cpp | 2 +- .../webkit/WebCore/generated/JSSVGFETileElement.h | 4 +- .../WebCore/generated/JSSVGFETurbulenceElement.cpp | 2 +- .../WebCore/generated/JSSVGFETurbulenceElement.h | 4 +- .../WebCore/generated/JSSVGFilterElement.cpp | 2 +- .../webkit/WebCore/generated/JSSVGFilterElement.h | 4 +- .../webkit/WebCore/generated/JSSVGFontElement.cpp | 2 +- .../webkit/WebCore/generated/JSSVGFontElement.h | 4 +- .../WebCore/generated/JSSVGFontFaceElement.cpp | 2 +- .../WebCore/generated/JSSVGFontFaceElement.h | 4 +- .../generated/JSSVGFontFaceFormatElement.cpp | 2 +- .../WebCore/generated/JSSVGFontFaceFormatElement.h | 4 +- .../WebCore/generated/JSSVGFontFaceNameElement.cpp | 2 +- .../WebCore/generated/JSSVGFontFaceNameElement.h | 4 +- .../WebCore/generated/JSSVGFontFaceSrcElement.cpp | 2 +- .../WebCore/generated/JSSVGFontFaceSrcElement.h | 4 +- .../WebCore/generated/JSSVGFontFaceUriElement.cpp | 2 +- .../WebCore/generated/JSSVGFontFaceUriElement.h | 4 +- .../generated/JSSVGForeignObjectElement.cpp | 2 +- .../WebCore/generated/JSSVGForeignObjectElement.h | 4 +- .../webkit/WebCore/generated/JSSVGGElement.cpp | 2 +- .../webkit/WebCore/generated/JSSVGGElement.h | 4 +- .../webkit/WebCore/generated/JSSVGGlyphElement.cpp | 2 +- .../webkit/WebCore/generated/JSSVGGlyphElement.h | 4 +- .../WebCore/generated/JSSVGGradientElement.cpp | 2 +- .../WebCore/generated/JSSVGGradientElement.h | 4 +- .../webkit/WebCore/generated/JSSVGHKernElement.cpp | 2 +- .../webkit/WebCore/generated/JSSVGHKernElement.h | 4 +- .../webkit/WebCore/generated/JSSVGImageElement.cpp | 2 +- .../webkit/WebCore/generated/JSSVGImageElement.h | 4 +- .../webkit/WebCore/generated/JSSVGLength.cpp | 2 +- .../webkit/WebCore/generated/JSSVGLength.h | 4 +- .../webkit/WebCore/generated/JSSVGLengthList.cpp | 2 +- .../webkit/WebCore/generated/JSSVGLengthList.h | 4 +- .../webkit/WebCore/generated/JSSVGLineElement.cpp | 2 +- .../webkit/WebCore/generated/JSSVGLineElement.h | 4 +- .../generated/JSSVGLinearGradientElement.cpp | 2 +- .../WebCore/generated/JSSVGLinearGradientElement.h | 4 +- .../WebCore/generated/JSSVGMarkerElement.cpp | 2 +- .../webkit/WebCore/generated/JSSVGMarkerElement.h | 4 +- .../webkit/WebCore/generated/JSSVGMaskElement.cpp | 2 +- .../webkit/WebCore/generated/JSSVGMaskElement.h | 4 +- .../webkit/WebCore/generated/JSSVGMatrix.cpp | 2 +- .../webkit/WebCore/generated/JSSVGMatrix.h | 4 +- .../WebCore/generated/JSSVGMetadataElement.cpp | 2 +- .../WebCore/generated/JSSVGMetadataElement.h | 4 +- .../WebCore/generated/JSSVGMissingGlyphElement.cpp | 2 +- .../WebCore/generated/JSSVGMissingGlyphElement.h | 4 +- .../webkit/WebCore/generated/JSSVGNumber.cpp | 2 +- .../webkit/WebCore/generated/JSSVGNumber.h | 4 +- .../webkit/WebCore/generated/JSSVGNumberList.cpp | 2 +- .../webkit/WebCore/generated/JSSVGNumberList.h | 4 +- .../webkit/WebCore/generated/JSSVGPaint.cpp | 2 +- src/3rdparty/webkit/WebCore/generated/JSSVGPaint.h | 4 +- .../webkit/WebCore/generated/JSSVGPathElement.cpp | 2 +- .../webkit/WebCore/generated/JSSVGPathElement.h | 4 +- .../webkit/WebCore/generated/JSSVGPathSeg.cpp | 2 +- .../webkit/WebCore/generated/JSSVGPathSeg.h | 4 +- .../WebCore/generated/JSSVGPathSegArcAbs.cpp | 2 +- .../webkit/WebCore/generated/JSSVGPathSegArcAbs.h | 4 +- .../WebCore/generated/JSSVGPathSegArcRel.cpp | 2 +- .../webkit/WebCore/generated/JSSVGPathSegArcRel.h | 4 +- .../WebCore/generated/JSSVGPathSegClosePath.cpp | 2 +- .../WebCore/generated/JSSVGPathSegClosePath.h | 4 +- .../generated/JSSVGPathSegCurvetoCubicAbs.cpp | 2 +- .../generated/JSSVGPathSegCurvetoCubicAbs.h | 4 +- .../generated/JSSVGPathSegCurvetoCubicRel.cpp | 2 +- .../generated/JSSVGPathSegCurvetoCubicRel.h | 4 +- .../JSSVGPathSegCurvetoCubicSmoothAbs.cpp | 2 +- .../generated/JSSVGPathSegCurvetoCubicSmoothAbs.h | 4 +- .../JSSVGPathSegCurvetoCubicSmoothRel.cpp | 2 +- .../generated/JSSVGPathSegCurvetoCubicSmoothRel.h | 4 +- .../generated/JSSVGPathSegCurvetoQuadraticAbs.cpp | 2 +- .../generated/JSSVGPathSegCurvetoQuadraticAbs.h | 4 +- .../generated/JSSVGPathSegCurvetoQuadraticRel.cpp | 2 +- .../generated/JSSVGPathSegCurvetoQuadraticRel.h | 4 +- .../JSSVGPathSegCurvetoQuadraticSmoothAbs.cpp | 2 +- .../JSSVGPathSegCurvetoQuadraticSmoothAbs.h | 4 +- .../JSSVGPathSegCurvetoQuadraticSmoothRel.cpp | 2 +- .../JSSVGPathSegCurvetoQuadraticSmoothRel.h | 4 +- .../WebCore/generated/JSSVGPathSegLinetoAbs.cpp | 2 +- .../WebCore/generated/JSSVGPathSegLinetoAbs.h | 4 +- .../generated/JSSVGPathSegLinetoHorizontalAbs.cpp | 2 +- .../generated/JSSVGPathSegLinetoHorizontalAbs.h | 4 +- .../generated/JSSVGPathSegLinetoHorizontalRel.cpp | 2 +- .../generated/JSSVGPathSegLinetoHorizontalRel.h | 4 +- .../WebCore/generated/JSSVGPathSegLinetoRel.cpp | 2 +- .../WebCore/generated/JSSVGPathSegLinetoRel.h | 4 +- .../generated/JSSVGPathSegLinetoVerticalAbs.cpp | 2 +- .../generated/JSSVGPathSegLinetoVerticalAbs.h | 4 +- .../generated/JSSVGPathSegLinetoVerticalRel.cpp | 2 +- .../generated/JSSVGPathSegLinetoVerticalRel.h | 4 +- .../webkit/WebCore/generated/JSSVGPathSegList.cpp | 2 +- .../webkit/WebCore/generated/JSSVGPathSegList.h | 4 +- .../WebCore/generated/JSSVGPathSegMovetoAbs.cpp | 2 +- .../WebCore/generated/JSSVGPathSegMovetoAbs.h | 4 +- .../WebCore/generated/JSSVGPathSegMovetoRel.cpp | 2 +- .../WebCore/generated/JSSVGPathSegMovetoRel.h | 4 +- .../WebCore/generated/JSSVGPatternElement.cpp | 2 +- .../webkit/WebCore/generated/JSSVGPatternElement.h | 4 +- .../webkit/WebCore/generated/JSSVGPoint.cpp | 2 +- src/3rdparty/webkit/WebCore/generated/JSSVGPoint.h | 4 +- .../webkit/WebCore/generated/JSSVGPointList.cpp | 2 +- .../webkit/WebCore/generated/JSSVGPointList.h | 4 +- .../WebCore/generated/JSSVGPolygonElement.cpp | 2 +- .../webkit/WebCore/generated/JSSVGPolygonElement.h | 4 +- .../WebCore/generated/JSSVGPolylineElement.cpp | 2 +- .../WebCore/generated/JSSVGPolylineElement.h | 4 +- .../WebCore/generated/JSSVGPreserveAspectRatio.cpp | 2 +- .../WebCore/generated/JSSVGPreserveAspectRatio.h | 4 +- .../generated/JSSVGRadialGradientElement.cpp | 2 +- .../WebCore/generated/JSSVGRadialGradientElement.h | 4 +- .../webkit/WebCore/generated/JSSVGRect.cpp | 2 +- src/3rdparty/webkit/WebCore/generated/JSSVGRect.h | 4 +- .../webkit/WebCore/generated/JSSVGRectElement.cpp | 2 +- .../webkit/WebCore/generated/JSSVGRectElement.h | 4 +- .../WebCore/generated/JSSVGRenderingIntent.cpp | 2 +- .../WebCore/generated/JSSVGRenderingIntent.h | 4 +- .../webkit/WebCore/generated/JSSVGSVGElement.cpp | 2 +- .../webkit/WebCore/generated/JSSVGSVGElement.h | 4 +- .../WebCore/generated/JSSVGScriptElement.cpp | 2 +- .../webkit/WebCore/generated/JSSVGScriptElement.h | 4 +- .../webkit/WebCore/generated/JSSVGSetElement.cpp | 2 +- .../webkit/WebCore/generated/JSSVGSetElement.h | 4 +- .../webkit/WebCore/generated/JSSVGStopElement.cpp | 2 +- .../webkit/WebCore/generated/JSSVGStopElement.h | 4 +- .../webkit/WebCore/generated/JSSVGStringList.cpp | 2 +- .../webkit/WebCore/generated/JSSVGStringList.h | 4 +- .../webkit/WebCore/generated/JSSVGStyleElement.cpp | 2 +- .../webkit/WebCore/generated/JSSVGStyleElement.h | 4 +- .../WebCore/generated/JSSVGSwitchElement.cpp | 2 +- .../webkit/WebCore/generated/JSSVGSwitchElement.h | 4 +- .../WebCore/generated/JSSVGSymbolElement.cpp | 2 +- .../webkit/WebCore/generated/JSSVGSymbolElement.h | 4 +- .../webkit/WebCore/generated/JSSVGTRefElement.cpp | 2 +- .../webkit/WebCore/generated/JSSVGTRefElement.h | 4 +- .../webkit/WebCore/generated/JSSVGTSpanElement.cpp | 2 +- .../webkit/WebCore/generated/JSSVGTSpanElement.h | 4 +- .../WebCore/generated/JSSVGTextContentElement.cpp | 2 +- .../WebCore/generated/JSSVGTextContentElement.h | 4 +- .../webkit/WebCore/generated/JSSVGTextElement.cpp | 2 +- .../webkit/WebCore/generated/JSSVGTextElement.h | 4 +- .../WebCore/generated/JSSVGTextPathElement.cpp | 2 +- .../WebCore/generated/JSSVGTextPathElement.h | 4 +- .../generated/JSSVGTextPositioningElement.cpp | 2 +- .../generated/JSSVGTextPositioningElement.h | 4 +- .../webkit/WebCore/generated/JSSVGTitleElement.cpp | 2 +- .../webkit/WebCore/generated/JSSVGTitleElement.h | 4 +- .../webkit/WebCore/generated/JSSVGTransform.cpp | 2 +- .../webkit/WebCore/generated/JSSVGTransform.h | 4 +- .../WebCore/generated/JSSVGTransformList.cpp | 2 +- .../webkit/WebCore/generated/JSSVGTransformList.h | 4 +- .../webkit/WebCore/generated/JSSVGUnitTypes.cpp | 2 +- .../webkit/WebCore/generated/JSSVGUnitTypes.h | 4 +- .../webkit/WebCore/generated/JSSVGUseElement.cpp | 2 +- .../webkit/WebCore/generated/JSSVGUseElement.h | 4 +- .../webkit/WebCore/generated/JSSVGViewElement.cpp | 2 +- .../webkit/WebCore/generated/JSSVGViewElement.h | 4 +- .../webkit/WebCore/generated/JSSVGZoomEvent.cpp | 2 +- .../webkit/WebCore/generated/JSSVGZoomEvent.h | 4 +- src/3rdparty/webkit/WebCore/generated/JSScreen.cpp | 2 +- src/3rdparty/webkit/WebCore/generated/JSScreen.h | 4 +- .../webkit/WebCore/generated/JSSharedWorker.cpp | 2 +- .../webkit/WebCore/generated/JSSharedWorker.h | 4 +- .../WebCore/generated/JSSharedWorkerContext.cpp | 4 +- .../WebCore/generated/JSSharedWorkerContext.h | 4 +- .../webkit/WebCore/generated/JSStorage.cpp | 2 +- src/3rdparty/webkit/WebCore/generated/JSStorage.h | 4 +- .../webkit/WebCore/generated/JSStorageEvent.cpp | 2 +- .../webkit/WebCore/generated/JSStorageEvent.h | 4 +- .../webkit/WebCore/generated/JSStyleSheet.cpp | 2 +- .../webkit/WebCore/generated/JSStyleSheet.h | 4 +- .../webkit/WebCore/generated/JSStyleSheetList.cpp | 2 +- .../webkit/WebCore/generated/JSStyleSheetList.h | 4 +- src/3rdparty/webkit/WebCore/generated/JSText.cpp | 2 +- src/3rdparty/webkit/WebCore/generated/JSText.h | 4 +- .../webkit/WebCore/generated/JSTextEvent.cpp | 2 +- .../webkit/WebCore/generated/JSTextEvent.h | 4 +- .../webkit/WebCore/generated/JSTextMetrics.cpp | 2 +- .../webkit/WebCore/generated/JSTextMetrics.h | 4 +- .../webkit/WebCore/generated/JSTimeRanges.cpp | 2 +- .../webkit/WebCore/generated/JSTimeRanges.h | 4 +- .../webkit/WebCore/generated/JSTreeWalker.cpp | 2 +- .../webkit/WebCore/generated/JSTreeWalker.h | 4 +- .../webkit/WebCore/generated/JSUIEvent.cpp | 2 +- src/3rdparty/webkit/WebCore/generated/JSUIEvent.h | 4 +- .../webkit/WebCore/generated/JSValidityState.cpp | 2 +- .../webkit/WebCore/generated/JSValidityState.h | 4 +- .../webkit/WebCore/generated/JSVoidCallback.cpp | 2 +- .../webkit/WebCore/generated/JSVoidCallback.h | 4 +- .../WebCore/generated/JSWebKitAnimationEvent.cpp | 2 +- .../WebCore/generated/JSWebKitAnimationEvent.h | 4 +- .../WebCore/generated/JSWebKitCSSKeyframeRule.cpp | 2 +- .../WebCore/generated/JSWebKitCSSKeyframeRule.h | 4 +- .../WebCore/generated/JSWebKitCSSKeyframesRule.cpp | 2 +- .../WebCore/generated/JSWebKitCSSKeyframesRule.h | 4 +- .../webkit/WebCore/generated/JSWebKitCSSMatrix.cpp | 2 +- .../webkit/WebCore/generated/JSWebKitCSSMatrix.h | 4 +- .../generated/JSWebKitCSSTransformValue.cpp | 2 +- .../WebCore/generated/JSWebKitCSSTransformValue.h | 4 +- .../webkit/WebCore/generated/JSWebKitPoint.cpp | 2 +- .../webkit/WebCore/generated/JSWebKitPoint.h | 4 +- .../WebCore/generated/JSWebKitTransitionEvent.cpp | 2 +- .../WebCore/generated/JSWebKitTransitionEvent.h | 4 +- .../webkit/WebCore/generated/JSWebSocket.cpp | 8 +- .../webkit/WebCore/generated/JSWebSocket.h | 4 +- .../webkit/WebCore/generated/JSWheelEvent.cpp | 2 +- .../webkit/WebCore/generated/JSWheelEvent.h | 4 +- src/3rdparty/webkit/WebCore/generated/JSWorker.cpp | 4 +- src/3rdparty/webkit/WebCore/generated/JSWorker.h | 4 +- .../webkit/WebCore/generated/JSWorkerContext.cpp | 4 +- .../webkit/WebCore/generated/JSWorkerContext.h | 4 +- .../webkit/WebCore/generated/JSWorkerLocation.cpp | 2 +- .../webkit/WebCore/generated/JSWorkerLocation.h | 4 +- .../webkit/WebCore/generated/JSWorkerNavigator.cpp | 2 +- .../webkit/WebCore/generated/JSWorkerNavigator.h | 4 +- .../webkit/WebCore/generated/JSXMLHttpRequest.cpp | 14 +- .../webkit/WebCore/generated/JSXMLHttpRequest.h | 4 +- .../generated/JSXMLHttpRequestException.cpp | 2 +- .../WebCore/generated/JSXMLHttpRequestException.h | 4 +- .../generated/JSXMLHttpRequestProgressEvent.cpp | 2 +- .../generated/JSXMLHttpRequestProgressEvent.h | 4 +- .../WebCore/generated/JSXMLHttpRequestUpload.cpp | 12 +- .../WebCore/generated/JSXMLHttpRequestUpload.h | 4 +- .../webkit/WebCore/generated/JSXMLSerializer.cpp | 2 +- .../webkit/WebCore/generated/JSXMLSerializer.h | 4 +- .../webkit/WebCore/generated/JSXPathEvaluator.cpp | 2 +- .../webkit/WebCore/generated/JSXPathEvaluator.h | 4 +- .../webkit/WebCore/generated/JSXPathException.cpp | 2 +- .../webkit/WebCore/generated/JSXPathException.h | 4 +- .../webkit/WebCore/generated/JSXPathExpression.cpp | 2 +- .../webkit/WebCore/generated/JSXPathExpression.h | 4 +- .../webkit/WebCore/generated/JSXPathNSResolver.cpp | 2 +- .../webkit/WebCore/generated/JSXPathNSResolver.h | 4 +- .../webkit/WebCore/generated/JSXPathResult.cpp | 2 +- .../webkit/WebCore/generated/JSXPathResult.h | 4 +- .../webkit/WebCore/generated/JSXSLTProcessor.cpp | 2 +- .../webkit/WebCore/generated/JSXSLTProcessor.h | 4 +- .../webkit/WebCore/html/HTMLCanvasElement.cpp | 23 +- .../webkit/WebCore/html/HTMLInputElement.cpp | 8 +- .../webkit/WebCore/html/HTMLInputElement.h | 2 +- .../webkit/WebCore/html/HTMLInputElement.idl | 3 +- .../webkit/WebCore/html/HTMLLinkElement.cpp | 18 +- .../webkit/WebCore/html/HTMLTextAreaElement.cpp | 22 +- .../webkit/WebCore/html/HTMLTextAreaElement.h | 4 +- .../webkit/WebCore/html/HTMLTextAreaElement.idl | 3 +- .../webkit/WebCore/inspector/InspectorBackend.cpp | 32 +- .../webkit/WebCore/inspector/InspectorBackend.h | 7 +- .../webkit/WebCore/inspector/InspectorBackend.idl | 7 +- .../WebCore/inspector/InspectorController.cpp | 4 +- .../webkit/WebCore/inspector/InspectorDOMAgent.cpp | 94 +- .../webkit/WebCore/inspector/InspectorDOMAgent.h | 20 +- .../inspector/InspectorDOMStorageResource.cpp | 2 +- .../inspector/InspectorDOMStorageResource.h | 2 +- .../webkit/WebCore/inspector/InspectorFrontend.cpp | 14 + .../webkit/WebCore/inspector/InspectorFrontend.h | 4 + .../webkit/WebCore/inspector/front-end/DOMAgent.js | 24 +- .../WebCore/inspector/front-end/ElementsPanel.js | 14 + .../front-end/EventListenersSidebarPane.js | 221 ++++ .../front-end/Images/grayConnectorPoint.png | Bin 0 -> 236 bytes .../front-end/Images/whiteConnectorPoint.png | Bin 0 -> 225 bytes .../WebCore/inspector/front-end/ProfilesPanel.js | 9 +- .../inspector/front-end/StylesSidebarPane.js | 23 +- .../webkit/WebCore/inspector/front-end/WebKit.qrc | 3 + .../WebCore/inspector/front-end/inspector.css | 107 +- .../WebCore/inspector/front-end/inspector.html | 1 + .../WebCore/inspector/front-end/inspector.js | 17 +- .../WebCore/inspector/front-end/utilities.js | 31 +- src/3rdparty/webkit/WebCore/loader/FrameLoader.cpp | 2 +- .../webkit/WebCore/loader/ImageDocument.cpp | 4 +- src/3rdparty/webkit/WebCore/page/DOMWindow.idl | 4 +- src/3rdparty/webkit/WebCore/page/EventHandler.cpp | 21 +- src/3rdparty/webkit/WebCore/page/EventHandler.h | 2 + src/3rdparty/webkit/WebCore/page/Frame.cpp | 7 +- src/3rdparty/webkit/WebCore/page/Settings.cpp | 16 + src/3rdparty/webkit/WebCore/page/Settings.h | 15 + .../webkit/WebCore/page/UserContentURLPattern.cpp | 212 ++++ .../webkit/WebCore/page/UserContentURLPattern.h | 72 ++ .../platform/graphics/filters/FEComposite.cpp | 72 +- .../WebCore/platform/network/CredentialStorage.cpp | 18 +- .../platform/network/qt/QNetworkReplyHandler.cpp | 49 +- .../webkit/WebCore/platform/qt/Localizations.cpp | 2 +- .../webkit/WebCore/platform/text/CString.cpp | 14 - .../webkit/WebCore/platform/text/CString.h | 5 - .../webkit/WebCore/platform/text/TextEncoding.cpp | 1 + .../WebCore/rendering/MediaControlElements.cpp | 34 +- .../WebCore/rendering/MediaControlElements.h | 8 - .../webkit/WebCore/rendering/RenderBox.cpp | 21 +- .../webkit/WebCore/rendering/RenderInline.cpp | 10 +- .../webkit/WebCore/rendering/RenderObject.cpp | 15 +- .../webkit/WebCore/rendering/RenderObject.h | 10 +- .../webkit/WebCore/rendering/RenderTheme.cpp | 18 + .../webkit/WebCore/rendering/RenderTheme.h | 1 + .../WebCore/rendering/RenderThemeChromiumSkia.cpp | 13 + .../WebCore/rendering/RenderThemeChromiumSkia.h | 5 + .../WebCore/storage/StorageEventDispatcher.h | 54 + src/3rdparty/webkit/WebCore/svg/SVGUseElement.cpp | 4 + .../WebCore/svg/animation/SVGSMILElement.cpp | 4 +- .../webkit/WebCore/workers/WorkerContext.cpp | 2 +- src/3rdparty/webkit/WebCore/xml/XSLStyleSheet.cpp | 312 ------ src/3rdparty/webkit/WebCore/xml/XSLStyleSheet.h | 26 +- .../webkit/WebCore/xml/XSLStyleSheetLibxslt.cpp | 313 ++++++ .../webkit/WebCore/xml/XSLStyleSheetQt.cpp | 103 ++ src/3rdparty/webkit/WebCore/xml/XSLTProcessor.cpp | 315 +----- src/3rdparty/webkit/WebCore/xml/XSLTProcessor.h | 10 +- .../webkit/WebCore/xml/XSLTProcessorLibxslt.cpp | 335 ++++++ .../webkit/WebCore/xml/XSLTProcessorQt.cpp | 149 +++ src/3rdparty/webkit/WebKit/ChangeLog | 20 + src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp | 11 +- src/3rdparty/webkit/WebKit/qt/Api/qwebpage.h | 23 +- src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.cpp | 4 +- src/3rdparty/webkit/WebKit/qt/ChangeLog | 73 ++ .../qt/WebCoreSupport/FrameLoaderClientQt.cpp | 50 +- .../WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h | 1 + .../webkitsnippets/qtwebkit_qwebview_snippet.cpp | 8 +- .../WebKit/qt/tests/qwebpage/tst_qwebpage.cpp | 36 +- 921 files changed, 6113 insertions(+), 2609 deletions(-) create mode 100644 src/3rdparty/webkit/WebCore/dom/TransformSource.h create mode 100644 src/3rdparty/webkit/WebCore/dom/TransformSourceLibxslt.cpp create mode 100644 src/3rdparty/webkit/WebCore/dom/TransformSourceQt.cpp create mode 100644 src/3rdparty/webkit/WebCore/inspector/front-end/EventListenersSidebarPane.js create mode 100644 src/3rdparty/webkit/WebCore/inspector/front-end/Images/grayConnectorPoint.png create mode 100644 src/3rdparty/webkit/WebCore/inspector/front-end/Images/whiteConnectorPoint.png create mode 100644 src/3rdparty/webkit/WebCore/page/UserContentURLPattern.cpp create mode 100644 src/3rdparty/webkit/WebCore/page/UserContentURLPattern.h create mode 100644 src/3rdparty/webkit/WebCore/storage/StorageEventDispatcher.h delete mode 100644 src/3rdparty/webkit/WebCore/xml/XSLStyleSheet.cpp create mode 100644 src/3rdparty/webkit/WebCore/xml/XSLStyleSheetLibxslt.cpp create mode 100644 src/3rdparty/webkit/WebCore/xml/XSLStyleSheetQt.cpp create mode 100644 src/3rdparty/webkit/WebCore/xml/XSLTProcessorLibxslt.cpp create mode 100644 src/3rdparty/webkit/WebCore/xml/XSLTProcessorQt.cpp diff --git a/src/3rdparty/webkit/JavaScriptCore/API/JSCallbackConstructor.cpp b/src/3rdparty/webkit/JavaScriptCore/API/JSCallbackConstructor.cpp index 64c83cb..1c33962 100644 --- a/src/3rdparty/webkit/JavaScriptCore/API/JSCallbackConstructor.cpp +++ b/src/3rdparty/webkit/JavaScriptCore/API/JSCallbackConstructor.cpp @@ -36,7 +36,7 @@ namespace JSC { const ClassInfo JSCallbackConstructor::info = { "CallbackConstructor", 0, 0, 0 }; -JSCallbackConstructor::JSCallbackConstructor(PassRefPtr structure, JSClassRef jsClass, JSObjectCallAsConstructorCallback callback) +JSCallbackConstructor::JSCallbackConstructor(NonNullPassRefPtr structure, JSClassRef jsClass, JSObjectCallAsConstructorCallback callback) : JSObject(structure) , m_class(jsClass) , m_callback(callback) diff --git a/src/3rdparty/webkit/JavaScriptCore/API/JSCallbackConstructor.h b/src/3rdparty/webkit/JavaScriptCore/API/JSCallbackConstructor.h index 0497aa2..202b119 100644 --- a/src/3rdparty/webkit/JavaScriptCore/API/JSCallbackConstructor.h +++ b/src/3rdparty/webkit/JavaScriptCore/API/JSCallbackConstructor.h @@ -33,7 +33,7 @@ namespace JSC { class JSCallbackConstructor : public JSObject { public: - JSCallbackConstructor(PassRefPtr, JSClassRef, JSObjectCallAsConstructorCallback); + JSCallbackConstructor(NonNullPassRefPtr, JSClassRef, JSObjectCallAsConstructorCallback); virtual ~JSCallbackConstructor(); JSClassRef classRef() const { return m_class; } JSObjectCallAsConstructorCallback callback() const { return m_callback; } diff --git a/src/3rdparty/webkit/JavaScriptCore/API/JSCallbackObject.h b/src/3rdparty/webkit/JavaScriptCore/API/JSCallbackObject.h index 47fd6c3..86f2f32 100644 --- a/src/3rdparty/webkit/JavaScriptCore/API/JSCallbackObject.h +++ b/src/3rdparty/webkit/JavaScriptCore/API/JSCallbackObject.h @@ -36,7 +36,7 @@ namespace JSC { template class JSCallbackObject : public Base { public: - JSCallbackObject(ExecState*, PassRefPtr, JSClassRef, void* data); + JSCallbackObject(ExecState*, NonNullPassRefPtr, JSClassRef, void* data); JSCallbackObject(JSClassRef); virtual ~JSCallbackObject(); diff --git a/src/3rdparty/webkit/JavaScriptCore/API/JSCallbackObjectFunctions.h b/src/3rdparty/webkit/JavaScriptCore/API/JSCallbackObjectFunctions.h index 4d113fe..9b726e8 100644 --- a/src/3rdparty/webkit/JavaScriptCore/API/JSCallbackObjectFunctions.h +++ b/src/3rdparty/webkit/JavaScriptCore/API/JSCallbackObjectFunctions.h @@ -47,7 +47,7 @@ inline JSCallbackObject* JSCallbackObject::asCallbackObject(JSValue } template -JSCallbackObject::JSCallbackObject(ExecState* exec, PassRefPtr structure, JSClassRef jsClass, void* data) +JSCallbackObject::JSCallbackObject(ExecState* exec, NonNullPassRefPtr structure, JSClassRef jsClass, void* data) : Base(structure) , m_callbackObjectData(new JSCallbackObjectData(data, jsClass)) { diff --git a/src/3rdparty/webkit/JavaScriptCore/ChangeLog b/src/3rdparty/webkit/JavaScriptCore/ChangeLog index f6a644a..05f90b9 100644 --- a/src/3rdparty/webkit/JavaScriptCore/ChangeLog +++ b/src/3rdparty/webkit/JavaScriptCore/ChangeLog @@ -1,3 +1,431 @@ +2009-09-30 Csaba Osztrogonac + + Reviewed by NOBODY (OOPS!). + + Buildfix for platforms using JSVALUE32. + https://bugs.webkit.org/show_bug.cgi?id=29915 + + After http://trac.webkit.org/changeset/48905 the build broke in JSVALUE32 case. + + * jit/JITArithmetic.cpp: + (JSC::JIT::emit_op_add): + - Declaration of "OperandTypes types" moved before first use. + - Typos fixed: dst modified to result, regT2 added. + - Unnecessary code removed. + (JSC::JIT::emitSlow_op_add): + - Missing declaration of "OperandTypes types" added. + +2009-09-30 Janne Koskinen + + Reviewed by Simon Hausmann. + + Reduce heap size on Symbian from 64MB to 8MB. + + This is not a perfect fix, it requires more fine tuning. + But this makes it possible again to debug in the emulator, + which is more important in order to be able to fix other + run-time issues. + + * runtime/Collector.h: + +2009-09-30 Janne Koskinen + + Reviewed by Simon Hausmann. + + Fix CRASH() macro for Symbian build. + + * wtf/Assertions.h: Added missing } + +2009-09-29 Geoffrey Garen + + Reviewed by Gavin Barraclough. + + Inlined a few math operations. + + ~1% SunSpider speedup. + + * jit/JIT.h: + * jit/JITArithmetic.cpp: + (JSC::JIT::compileBinaryArithOpSlowCase): + (JSC::JIT::emitSlow_op_add): + (JSC::JIT::emitSlow_op_mul): + (JSC::JIT::emit_op_sub): + (JSC::JIT::emitSlow_op_sub): Don't take a stub call when operating on + a constant int and a double. + +2009-09-28 Oliver Hunt + + Reviewed by Gavin Barraclough. + + Tidy up codeblock sampler + https://bugs.webkit.org/show_bug.cgi?id=29836 + + Some rather simple refactoring of codeblock sampler so that + it's easier for us to use it to find problems in non-jsc + environments + + * JavaScriptCore.exp: + * bytecode/SamplingTool.h: + * debugger/Debugger.cpp: + (JSC::evaluateInGlobalCallFrame): + * debugger/DebuggerCallFrame.cpp: + (JSC::DebuggerCallFrame::evaluate): + * interpreter/Interpreter.cpp: + (JSC::Interpreter::Interpreter): + (JSC::Interpreter::execute): + (JSC::Interpreter::privateExecute): + (JSC::Interpreter::enableSampler): + (JSC::Interpreter::dumpSampleData): + (JSC::Interpreter::startSampling): + (JSC::Interpreter::stopSampling): + * interpreter/Interpreter.h: + (JSC::Interpreter::sampler): + * jit/JIT.h: + * jsc.cpp: + (runWithScripts): + * runtime/Completion.cpp: + (JSC::checkSyntax): + (JSC::evaluate): + * runtime/Executable.h: + (JSC::EvalExecutable::EvalExecutable): + (JSC::ProgramExecutable::create): + (JSC::ProgramExecutable::ProgramExecutable): + * runtime/JSGlobalData.cpp: + (JSC::JSGlobalData::startSampling): + (JSC::JSGlobalData::stopSampling): + (JSC::JSGlobalData::dumpSampleData): + * runtime/JSGlobalData.h: + * runtime/JSGlobalObjectFunctions.cpp: + (JSC::globalFuncEval): + +2009-09-29 Jeremy Orlow + + Reviewed by Dimitri Glazkov. + + Add GYP generated files to svn:ignore + https://bugs.webkit.org/show_bug.cgi?id=29895 + + The following files are generated by JavaScriptCore's GYP file and should be ignored: + + pcre.mk + wtf.scons + wtf.mk + SConstruct + wtf_config.scons + wtf_config.mk + pcre.scons + + * JavaScriptCore.gyp: Changed property svn:ignore. + +2009-09-29 Geoffrey Garen + + Reviewed by Sam Weinig. + + Standardized an optimization for adding non-numbers. + + SunSpider says maybe a tiny speedup. + + * jit/JITArithmetic.cpp: + (JSC::JIT::emit_op_add): + (JSC::JIT::emitSlow_op_add): + +2009-09-29 Geoffrey Garen + + Windows build fix: export a new symbol. + + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: + +2009-09-28 Geoffrey Garen + + Reviewed by Sam Weinig. + + Removed virtual destructor from JSGlobalObjectData to eliminate pointer + fix-ups when accessing JSGlobalObject::d. + + Replaced with an explicit destructor function pointer. + + 6% speedup on bench-alloc-nonretained.js. + + * JavaScriptCore.exp: + * runtime/JSGlobalObject.cpp: + (JSC::JSGlobalObject::~JSGlobalObject): + (JSC::JSGlobalObject::destroyJSGlobalObjectData): + * runtime/JSGlobalObject.h: + (JSC::JSGlobalObject::JSGlobalObjectData::JSGlobalObjectData): + (JSC::JSGlobalObject::JSGlobalObject): + +2009-09-29 Janne Koskinen + + Reviewed by David Kilzer. + + [Qt] Assert messages prints visible in Symbian + https://bugs.webkit.org/show_bug.cgi?id=29808 + + Asserts use vprintf to print the messages to stderr. + In Symbian Open C it is not possible to see stderr so + I routed the messages to stdout instead. + + * wtf/Assertions.cpp: + +2009-09-29 Janne Koskinen + + Reviewed by Darin Adler. + + [Qt] Symbian CRASH macro implementation + + Added Symbian specific crash macro that + stops to crash line if JIT debugging is used. + Additional differentiation of access violation + (KERN-EXEC 3) and CRASH panic. + + * wtf/Assertions.h: + +2009-09-28 Mark Rowe + + Fix the PowerPC build. + + * JavaScriptCore.exp: + +2009-09-28 Mark Rowe + + Reviewed by Gavin Barraclough. + + JavaScriptCore fails to mark registers when built for x86_64 using LLVM GCC. + + * runtime/Collector.cpp: + (JSC::Heap::markCurrentThreadConservatively): Force jmp_buf to use the appropriate alignment for a pointer + to ensure that we correctly interpret the contents of registers during marking. + +2009-09-28 Geoffrey Garen + + Windows build fix: added new exports. + + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: + +2009-09-28 Geoffrey Garen + + Windows build fix: removed exports that no longer exist. + + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: + +2009-09-28 Geoffrey Garen + + Reviewed by Darin Adler. + + NotNullPassRefPtr: smart pointer optimized for passing references that are not null + https://bugs.webkit.org/show_bug.cgi?id=29822 + + Added NotNullPassRefPtr, and deployed it in all places that initialize + JavaScript objects. + + 2.2% speedup on bench-allocate-nonretained.js. + + * API/JSCallbackConstructor.cpp: + (JSC::JSCallbackConstructor::JSCallbackConstructor): + * API/JSCallbackConstructor.h: + * API/JSCallbackObject.h: + * API/JSCallbackObjectFunctions.h: + (JSC::JSCallbackObject::JSCallbackObject): + * JavaScriptCore.exp: + * bytecode/CodeBlock.h: + (JSC::CodeBlock::addFunctionDecl): + (JSC::CodeBlock::addFunctionExpr): + * runtime/ArrayConstructor.cpp: + (JSC::ArrayConstructor::ArrayConstructor): + * runtime/ArrayConstructor.h: + * runtime/ArrayPrototype.cpp: + (JSC::ArrayPrototype::ArrayPrototype): + * runtime/ArrayPrototype.h: + * runtime/BooleanConstructor.cpp: + (JSC::BooleanConstructor::BooleanConstructor): + * runtime/BooleanConstructor.h: + * runtime/BooleanObject.cpp: + (JSC::BooleanObject::BooleanObject): + * runtime/BooleanObject.h: + * runtime/BooleanPrototype.cpp: + (JSC::BooleanPrototype::BooleanPrototype): + * runtime/BooleanPrototype.h: + * runtime/DateConstructor.cpp: + (JSC::DateConstructor::DateConstructor): + * runtime/DateConstructor.h: + * runtime/DateInstance.cpp: + (JSC::DateInstance::DateInstance): + * runtime/DateInstance.h: + * runtime/DatePrototype.cpp: + (JSC::DatePrototype::DatePrototype): + * runtime/DatePrototype.h: + * runtime/ErrorConstructor.cpp: + (JSC::ErrorConstructor::ErrorConstructor): + * runtime/ErrorConstructor.h: + * runtime/ErrorInstance.cpp: + (JSC::ErrorInstance::ErrorInstance): + * runtime/ErrorInstance.h: + * runtime/ErrorPrototype.cpp: + (JSC::ErrorPrototype::ErrorPrototype): + * runtime/ErrorPrototype.h: + * runtime/FunctionConstructor.cpp: + (JSC::FunctionConstructor::FunctionConstructor): + * runtime/FunctionConstructor.h: + * runtime/FunctionPrototype.cpp: + (JSC::FunctionPrototype::FunctionPrototype): + * runtime/FunctionPrototype.h: + * runtime/GlobalEvalFunction.cpp: + (JSC::GlobalEvalFunction::GlobalEvalFunction): + * runtime/GlobalEvalFunction.h: + * runtime/InternalFunction.cpp: + (JSC::InternalFunction::InternalFunction): + * runtime/InternalFunction.h: + (JSC::InternalFunction::InternalFunction): + * runtime/JSActivation.cpp: + (JSC::JSActivation::JSActivation): + * runtime/JSActivation.h: + (JSC::JSActivation::JSActivationData::JSActivationData): + * runtime/JSArray.cpp: + (JSC::JSArray::JSArray): + * runtime/JSArray.h: + * runtime/JSByteArray.cpp: + (JSC::JSByteArray::JSByteArray): + * runtime/JSByteArray.h: + * runtime/JSFunction.cpp: + (JSC::JSFunction::JSFunction): + * runtime/JSFunction.h: + * runtime/JSGlobalObject.h: + (JSC::JSGlobalObject::JSGlobalObject): + * runtime/JSONObject.h: + (JSC::JSONObject::JSONObject): + * runtime/JSObject.h: + (JSC::JSObject::JSObject): + (JSC::JSObject::setStructure): + * runtime/JSVariableObject.h: + (JSC::JSVariableObject::JSVariableObject): + * runtime/JSWrapperObject.h: + (JSC::JSWrapperObject::JSWrapperObject): + * runtime/MathObject.cpp: + (JSC::MathObject::MathObject): + * runtime/MathObject.h: + * runtime/NativeErrorConstructor.cpp: + (JSC::NativeErrorConstructor::NativeErrorConstructor): + * runtime/NativeErrorConstructor.h: + * runtime/NativeErrorPrototype.cpp: + (JSC::NativeErrorPrototype::NativeErrorPrototype): + * runtime/NativeErrorPrototype.h: + * runtime/NumberConstructor.cpp: + (JSC::NumberConstructor::NumberConstructor): + * runtime/NumberConstructor.h: + * runtime/NumberObject.cpp: + (JSC::NumberObject::NumberObject): + * runtime/NumberObject.h: + * runtime/NumberPrototype.cpp: + (JSC::NumberPrototype::NumberPrototype): + * runtime/NumberPrototype.h: + * runtime/ObjectConstructor.cpp: + (JSC::ObjectConstructor::ObjectConstructor): + * runtime/ObjectConstructor.h: + * runtime/ObjectPrototype.cpp: + (JSC::ObjectPrototype::ObjectPrototype): + * runtime/ObjectPrototype.h: + * runtime/PropertyNameArray.h: + (JSC::PropertyNameArrayData::setCachedPrototypeChain): + * runtime/PrototypeFunction.cpp: + (JSC::PrototypeFunction::PrototypeFunction): + * runtime/PrototypeFunction.h: + * runtime/RegExpConstructor.cpp: + (JSC::RegExpConstructor::RegExpConstructor): + * runtime/RegExpConstructor.h: + * runtime/RegExpObject.cpp: + (JSC::RegExpObject::RegExpObject): + * runtime/RegExpObject.h: + (JSC::RegExpObject::RegExpObjectData::RegExpObjectData): + * runtime/RegExpPrototype.cpp: + (JSC::RegExpPrototype::RegExpPrototype): + * runtime/RegExpPrototype.h: + * runtime/StringConstructor.cpp: + (JSC::StringConstructor::StringConstructor): + * runtime/StringConstructor.h: + * runtime/StringObject.cpp: + (JSC::StringObject::StringObject): + * runtime/StringObject.h: + * runtime/StringObjectThatMasqueradesAsUndefined.h: + (JSC::StringObjectThatMasqueradesAsUndefined::StringObjectThatMasqueradesAsUndefined): + * runtime/StringPrototype.cpp: + (JSC::StringPrototype::StringPrototype): + * runtime/StringPrototype.h: + * wtf/PassRefPtr.h: + (WTF::NotNullPassRefPtr::NotNullPassRefPtr): + (WTF::NotNullPassRefPtr::~NotNullPassRefPtr): + (WTF::NotNullPassRefPtr::get): + (WTF::NotNullPassRefPtr::clear): + (WTF::NotNullPassRefPtr::releaseRef): + (WTF::NotNullPassRefPtr::operator*): + (WTF::NotNullPassRefPtr::operator->): + (WTF::NotNullPassRefPtr::operator!): + (WTF::NotNullPassRefPtr::operator UnspecifiedBoolType): + * wtf/RefPtr.h: + (WTF::RefPtr::RefPtr): + (WTF::operator==): + +2009-09-28 Oliver Hunt + + Reviewed by Geoff Garen. + + Hard dependency on SSE2 instruction set with JIT + https://bugs.webkit.org/show_bug.cgi?id=29779 + + Add floating point support checks to op_jfalse and op_jtrue, and + fix the logic for the slow case of op_add + + * jit/JITArithmetic.cpp: + (JSC::JIT::emitSlow_op_add): + * jit/JITOpcodes.cpp: + (JSC::JIT::emit_op_jfalse): + (JSC::JIT::emit_op_jtrue): + +2009-09-28 Yaar Schnitman + + Reviewed by Dimitri Glazkov. + + Chromium port - recognize we are being built independently + of chromium and look for dependencies under webkit/chromium rather + than chromium/src. + + https://bugs.webkit.org/show_bug.cgi?id=29722 + + * JavaScriptCore.gyp/JavaScriptCore.gyp: + +2009-09-28 Jakub Wieczorek + + Reviewed by Simon Hausmann. + + [Qt] Implement XSLT support with QtXmlPatterns. + https://bugs.webkit.org/show_bug.cgi?id=28303 + + * wtf/Platform.h: Add a WTF_USE_QXMLQUERY #define. + +2009-09-28 Gabor Loki + + Reviewed by Simon Hausmann. + + Remove __clear_cache which is an internal function of GCC + https://bugs.webkit.org/show_bug.cgi?id=28886 + + Although __clear_cache is exported from GCC, this is an internal + function. GCC makes no promises about it. + + * jit/ExecutableAllocator.h: + (JSC::ExecutableAllocator::cacheFlush): + +2009-09-28 Sam Weinig + + Reviewed by Oliver Hunt. + + Fix an absolute path to somewhere in Oliver's machine to a relative path + for derived JSONObject.lut.h. + + * JavaScriptCore.xcodeproj/project.pbxproj: + 2009-09-28 Joerg Bornemann Reviewed by Simon Hausmann. diff --git a/src/3rdparty/webkit/JavaScriptCore/bytecode/CodeBlock.h b/src/3rdparty/webkit/JavaScriptCore/bytecode/CodeBlock.h index 0163540..4ba58d7 100644 --- a/src/3rdparty/webkit/JavaScriptCore/bytecode/CodeBlock.h +++ b/src/3rdparty/webkit/JavaScriptCore/bytecode/CodeBlock.h @@ -441,10 +441,10 @@ namespace JSC { ALWAYS_INLINE bool isConstantRegisterIndex(int index) { return index >= FirstConstantRegisterIndex; } ALWAYS_INLINE JSValue getConstant(int index) const { return m_constantRegisters[index - FirstConstantRegisterIndex].jsValue(); } - unsigned addFunctionDecl(PassRefPtr n) { unsigned size = m_functionDecls.size(); m_functionDecls.append(n); return size; } + unsigned addFunctionDecl(NonNullPassRefPtr n) { unsigned size = m_functionDecls.size(); m_functionDecls.append(n); return size; } FunctionExecutable* functionDecl(int index) { return m_functionDecls[index].get(); } int numberOfFunctionDecls() { return m_functionDecls.size(); } - unsigned addFunctionExpr(PassRefPtr n) { unsigned size = m_functionExprs.size(); m_functionExprs.append(n); return size; } + unsigned addFunctionExpr(NonNullPassRefPtr n) { unsigned size = m_functionExprs.size(); m_functionExprs.append(n); return size; } FunctionExecutable* functionExpr(int index) { return m_functionExprs[index].get(); } unsigned addRegExp(RegExp* r) { createRareDataIfNecessary(); unsigned size = m_rareData->m_regexps.size(); m_rareData->m_regexps.append(r); return size; } diff --git a/src/3rdparty/webkit/JavaScriptCore/bytecode/SamplingTool.h b/src/3rdparty/webkit/JavaScriptCore/bytecode/SamplingTool.h index 711b086..8e3ed9e 100644 --- a/src/3rdparty/webkit/JavaScriptCore/bytecode/SamplingTool.h +++ b/src/3rdparty/webkit/JavaScriptCore/bytecode/SamplingTool.h @@ -113,7 +113,7 @@ namespace JSC { void sample(CodeBlock*, Instruction*); - ScriptExecutable* m_executable; + RefPtr m_executable; CodeBlock* m_codeBlock; int m_sampleCount; int m_opcodeSampleCount; diff --git a/src/3rdparty/webkit/JavaScriptCore/debugger/Debugger.cpp b/src/3rdparty/webkit/JavaScriptCore/debugger/Debugger.cpp index db02329..902a802 100644 --- a/src/3rdparty/webkit/JavaScriptCore/debugger/Debugger.cpp +++ b/src/3rdparty/webkit/JavaScriptCore/debugger/Debugger.cpp @@ -100,12 +100,12 @@ JSValue evaluateInGlobalCallFrame(const UString& script, JSValue& exception, JSG { CallFrame* globalCallFrame = globalObject->globalExec(); - EvalExecutable eval(globalCallFrame, makeSource(script)); - JSObject* error = eval.compile(globalCallFrame, globalCallFrame->scopeChain()); + RefPtr eval = EvalExecutable::create(globalCallFrame, makeSource(script)); + JSObject* error = eval->compile(globalCallFrame, globalCallFrame->scopeChain()); if (error) return error; - return globalObject->globalData()->interpreter->execute(&eval, globalCallFrame, globalObject, globalCallFrame->scopeChain(), &exception); + return globalObject->globalData()->interpreter->execute(eval.get(), globalCallFrame, globalObject, globalCallFrame->scopeChain(), &exception); } } // namespace JSC diff --git a/src/3rdparty/webkit/JavaScriptCore/debugger/DebuggerCallFrame.cpp b/src/3rdparty/webkit/JavaScriptCore/debugger/DebuggerCallFrame.cpp index 88b14e6..c9d7cc6 100644 --- a/src/3rdparty/webkit/JavaScriptCore/debugger/DebuggerCallFrame.cpp +++ b/src/3rdparty/webkit/JavaScriptCore/debugger/DebuggerCallFrame.cpp @@ -79,12 +79,12 @@ JSValue DebuggerCallFrame::evaluate(const UString& script, JSValue& exception) c if (!m_callFrame->codeBlock()) return JSValue(); - EvalExecutable eval(m_callFrame, makeSource(script)); - JSObject* error = eval.compile(m_callFrame, m_callFrame->scopeChain()); + RefPtr eval = EvalExecutable::create(m_callFrame, makeSource(script)); + JSObject* error = eval->compile(m_callFrame, m_callFrame->scopeChain()); if (error) return error; - return m_callFrame->scopeChain()->globalData->interpreter->execute(&eval, m_callFrame, thisObject(), m_callFrame->scopeChain(), &exception); + return m_callFrame->scopeChain()->globalData->interpreter->execute(eval.get(), m_callFrame, thisObject(), m_callFrame->scopeChain(), &exception); } } // namespace JSC diff --git a/src/3rdparty/webkit/JavaScriptCore/interpreter/Interpreter.cpp b/src/3rdparty/webkit/JavaScriptCore/interpreter/Interpreter.cpp index 2aaa325..847b1fa 100644 --- a/src/3rdparty/webkit/JavaScriptCore/interpreter/Interpreter.cpp +++ b/src/3rdparty/webkit/JavaScriptCore/interpreter/Interpreter.cpp @@ -363,10 +363,13 @@ NEVER_INLINE JSValue Interpreter::callEval(CallFrame* callFrame, RegisterFile* r } Interpreter::Interpreter() - : m_sampler(0) + : m_sampleEntryDepth(0) , m_reentryDepth(0) { privateExecute(InitializeAndReturn, 0, 0, 0); +#if ENABLE(OPCODE_SAMPLING) + enableSampler(); +#endif } #ifndef NDEBUG @@ -648,7 +651,7 @@ JSValue Interpreter::execute(ProgramExecutable* program, CallFrame* callFrame, S JSValue result; { - SamplingTool::CallRecord callRecord(m_sampler); + SamplingTool::CallRecord callRecord(m_sampler.get()); m_reentryDepth++; #if ENABLE(JIT) @@ -714,7 +717,7 @@ JSValue Interpreter::execute(FunctionExecutable* functionExecutable, CallFrame* JSValue result; { - SamplingTool::CallRecord callRecord(m_sampler); + SamplingTool::CallRecord callRecord(m_sampler.get()); m_reentryDepth++; #if ENABLE(JIT) @@ -782,7 +785,7 @@ JSValue Interpreter::execute(CallFrameClosure& closure, JSValue* exception) JSValue result; { - SamplingTool::CallRecord callRecord(m_sampler); + SamplingTool::CallRecord callRecord(m_sampler.get()); m_reentryDepth++; #if ENABLE(JIT) @@ -876,7 +879,7 @@ JSValue Interpreter::execute(EvalExecutable* eval, CallFrame* callFrame, JSObjec JSValue result; { - SamplingTool::CallRecord callRecord(m_sampler); + SamplingTool::CallRecord callRecord(m_sampler.get()); m_reentryDepth++; #if ENABLE(JIT) @@ -3056,7 +3059,7 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi JSValue returnValue; { - SamplingTool::HostCallRecord callRecord(m_sampler); + SamplingTool::HostCallRecord callRecord(m_sampler.get()); returnValue = callData.native.function(newCallFrame, asObject(v), thisValue, args); } CHECK_FOR_EXCEPTION(); @@ -3210,7 +3213,7 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi JSValue returnValue; { - SamplingTool::HostCallRecord callRecord(m_sampler); + SamplingTool::HostCallRecord callRecord(m_sampler.get()); returnValue = callData.native.function(newCallFrame, asObject(v), thisValue, args); } CHECK_FOR_EXCEPTION(); @@ -3462,7 +3465,7 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi JSValue returnValue; { - SamplingTool::HostCallRecord callRecord(m_sampler); + SamplingTool::HostCallRecord callRecord(m_sampler.get()); returnValue = constructData.native.function(newCallFrame, asObject(v), args); } CHECK_FOR_EXCEPTION(); @@ -3914,4 +3917,40 @@ CallFrame* Interpreter::findFunctionCallFrame(CallFrame* callFrame, InternalFunc return 0; } +void Interpreter::enableSampler() +{ +#if ENABLE(OPCODE_SAMPLING) + if (!m_sampler) { + m_sampler.set(new SamplingTool(this)); + m_sampler->setup(); + } +#endif +} +void Interpreter::dumpSampleData(ExecState* exec) +{ +#if ENABLE(OPCODE_SAMPLING) + if (m_sampler) + m_sampler->dump(exec); +#else + UNUSED_PARAM(exec); +#endif +} +void Interpreter::startSampling() +{ +#if ENABLE(SAMPLING_THREAD) + if (!m_sampleEntryDepth) + SamplingThread::start(); + + m_sampleEntryDepth++; +#endif +} +void Interpreter::stopSampling() +{ +#if ENABLE(SAMPLING_THREAD) + m_sampleEntryDepth--; + if (!m_sampleEntryDepth) + SamplingThread::stop(); +#endif +} + } // namespace JSC diff --git a/src/3rdparty/webkit/JavaScriptCore/interpreter/Interpreter.h b/src/3rdparty/webkit/JavaScriptCore/interpreter/Interpreter.h index 8cb75d2..3046b28 100644 --- a/src/3rdparty/webkit/JavaScriptCore/interpreter/Interpreter.h +++ b/src/3rdparty/webkit/JavaScriptCore/interpreter/Interpreter.h @@ -105,13 +105,15 @@ namespace JSC { void getArgumentsData(CallFrame*, JSFunction*&, ptrdiff_t& firstParameterIndex, Register*& argv, int& argc); - void setSampler(SamplingTool* sampler) { m_sampler = sampler; } - SamplingTool* sampler() { return m_sampler; } + SamplingTool* sampler() { return m_sampler.get(); } NEVER_INLINE JSValue callEval(CallFrame*, RegisterFile*, Register* argv, int argc, int registerOffset, JSValue& exceptionValue); NEVER_INLINE HandlerInfo* throwException(CallFrame*&, JSValue&, unsigned bytecodeOffset, bool); NEVER_INLINE void debug(CallFrame*, DebugHookID, int firstLine, int lastLine); + void dumpSampleData(ExecState* exec); + void startSampling(); + void stopSampling(); private: enum ExecutionFlag { Normal, InitializeAndReturn }; @@ -149,7 +151,9 @@ namespace JSC { bool isCallBytecode(Opcode opcode) { return opcode == getOpcode(op_call) || opcode == getOpcode(op_construct) || opcode == getOpcode(op_call_eval); } - SamplingTool* m_sampler; + void enableSampler(); + int m_sampleEntryDepth; + OwnPtr m_sampler; int m_reentryDepth; diff --git a/src/3rdparty/webkit/JavaScriptCore/jit/JIT.h b/src/3rdparty/webkit/JavaScriptCore/jit/JIT.h index 3b35935..0712743 100644 --- a/src/3rdparty/webkit/JavaScriptCore/jit/JIT.h +++ b/src/3rdparty/webkit/JavaScriptCore/jit/JIT.h @@ -514,7 +514,11 @@ namespace JSC { void emitTagAsBoolImmediate(RegisterID reg); void compileBinaryArithOp(OpcodeID, unsigned dst, unsigned src1, unsigned src2, OperandTypes opi); - void compileBinaryArithOpSlowCase(OpcodeID, Vector::iterator&, unsigned dst, unsigned src1, unsigned src2, OperandTypes opi); +#if USE(JSVALUE64) + void compileBinaryArithOpSlowCase(OpcodeID, Vector::iterator&, unsigned dst, unsigned src1, unsigned src2, OperandTypes, bool op1HasImmediateIntFastCase, bool op2HasImmediateIntFastCase); +#else + void compileBinaryArithOpSlowCase(OpcodeID, Vector::iterator&, unsigned dst, unsigned src1, unsigned src2, OperandTypes); +#endif #if ENABLE(JIT_OPTIMIZE_PROPERTY_ACCESS) void compileGetByIdHotPath(int resultVReg, int baseVReg, Identifier* ident, unsigned propertyAccessInstructionIndex); @@ -538,7 +542,7 @@ namespace JSC { static const int patchOffsetGetByIdPropertyMapOffset = 31; static const int patchOffsetGetByIdPutResult = 31; #if ENABLE(OPCODE_SAMPLING) - static const int patchOffsetGetByIdSlowCaseCall = 63; + static const int patchOffsetGetByIdSlowCaseCall = 64; #else static const int patchOffsetGetByIdSlowCaseCall = 41; #endif diff --git a/src/3rdparty/webkit/JavaScriptCore/jit/JITArithmetic.cpp b/src/3rdparty/webkit/JavaScriptCore/jit/JITArithmetic.cpp index fb44386..7afc1f2 100644 --- a/src/3rdparty/webkit/JavaScriptCore/jit/JITArithmetic.cpp +++ b/src/3rdparty/webkit/JavaScriptCore/jit/JITArithmetic.cpp @@ -566,6 +566,14 @@ void JIT::emit_op_add(Instruction* currentInstruction) unsigned op2 = currentInstruction[3].u.operand; OperandTypes types = OperandTypes::fromInt(currentInstruction[4].u.operand); + if (!types.first().mightBeNumber() || !types.second().mightBeNumber()) { + JITStubCall stubCall(this, cti_op_add); + stubCall.addArgument(op1); + stubCall.addArgument(op2); + stubCall.call(dst); + return; + } + JumpList notInt32Op1; JumpList notInt32Op2; @@ -630,19 +638,21 @@ void JIT::emitSlow_op_add(Instruction* currentInstruction, Vector unsigned op2 = currentInstruction[3].u.operand; OperandTypes types = OperandTypes::fromInt(currentInstruction[4].u.operand); + if (!types.first().mightBeNumber() || !types.second().mightBeNumber()) + return; + unsigned op; int32_t constant; if (getOperandConstantImmediateInt(op1, op2, op, constant)) { linkSlowCase(iter); // overflow check - if (!supportsFloatingPoint()) { + if (!supportsFloatingPoint()) linkSlowCase(iter); // non-sse case - return; + else { + ResultType opType = op == op1 ? types.first() : types.second(); + if (!opType.definitelyIsNumber()) + linkSlowCase(iter); // double check } - - ResultType opType = op == op1 ? types.first() : types.second(); - if (!opType.definitelyIsNumber()) - linkSlowCase(iter); // double check } else { linkSlowCase(iter); // overflow check @@ -1932,47 +1942,77 @@ void JIT::compileBinaryArithOp(OpcodeID opcodeID, unsigned, unsigned op1, unsign emitFastArithIntToImmNoCheck(regT0, regT0); } -void JIT::compileBinaryArithOpSlowCase(OpcodeID opcodeID, Vector::iterator& iter, unsigned result, unsigned op1, unsigned, OperandTypes types) +void JIT::compileBinaryArithOpSlowCase(OpcodeID opcodeID, Vector::iterator& iter, unsigned result, unsigned op1, unsigned op2, OperandTypes types, bool op1HasImmediateIntFastCase, bool op2HasImmediateIntFastCase) { // We assume that subtracting TagTypeNumber is equivalent to adding DoubleEncodeOffset. COMPILE_ASSERT(((JSImmediate::TagTypeNumber + JSImmediate::DoubleEncodeOffset) == 0), TagTypeNumber_PLUS_DoubleEncodeOffset_EQUALS_0); - - Jump notImm1 = getSlowCase(iter); - Jump notImm2 = getSlowCase(iter); + + Jump notImm1; + Jump notImm2; + if (op1HasImmediateIntFastCase) { + notImm2 = getSlowCase(iter); + } else if (op2HasImmediateIntFastCase) { + notImm1 = getSlowCase(iter); + } else { + notImm1 = getSlowCase(iter); + notImm2 = getSlowCase(iter); + } linkSlowCase(iter); // Integer overflow case - we could handle this in JIT code, but this is likely rare. - if (opcodeID == op_mul) // op_mul has an extra slow case to handle 0 * negative number. + if (opcodeID == op_mul && !op1HasImmediateIntFastCase && !op2HasImmediateIntFastCase) // op_mul has an extra slow case to handle 0 * negative number. linkSlowCase(iter); emitGetVirtualRegister(op1, regT0); Label stubFunctionCall(this); JITStubCall stubCall(this, opcodeID == op_add ? cti_op_add : opcodeID == op_sub ? cti_op_sub : cti_op_mul); + if (op1HasImmediateIntFastCase || op2HasImmediateIntFastCase) { + emitGetVirtualRegister(op1, regT0); + emitGetVirtualRegister(op2, regT1); + } stubCall.addArgument(regT0); stubCall.addArgument(regT1); stubCall.call(result); Jump end = jump(); - // if we get here, eax is not an int32, edx not yet checked. - notImm1.link(this); - if (!types.first().definitelyIsNumber()) - emitJumpIfNotImmediateNumber(regT0).linkTo(stubFunctionCall, this); - if (!types.second().definitelyIsNumber()) - emitJumpIfNotImmediateNumber(regT1).linkTo(stubFunctionCall, this); - addPtr(tagTypeNumberRegister, regT0); - movePtrToDouble(regT0, fpRegT1); - Jump op2isDouble = emitJumpIfNotImmediateInteger(regT1); - convertInt32ToDouble(regT1, fpRegT2); - Jump op2wasInteger = jump(); - - // if we get here, eax IS an int32, edx is not. - notImm2.link(this); - if (!types.second().definitelyIsNumber()) - emitJumpIfNotImmediateNumber(regT1).linkTo(stubFunctionCall, this); - convertInt32ToDouble(regT0, fpRegT1); - op2isDouble.link(this); - addPtr(tagTypeNumberRegister, regT1); - movePtrToDouble(regT1, fpRegT2); - op2wasInteger.link(this); + if (op1HasImmediateIntFastCase) { + notImm2.link(this); + if (!types.second().definitelyIsNumber()) + emitJumpIfNotImmediateNumber(regT0).linkTo(stubFunctionCall, this); + emitGetVirtualRegister(op1, regT1); + convertInt32ToDouble(regT1, fpRegT1); + addPtr(tagTypeNumberRegister, regT0); + movePtrToDouble(regT0, fpRegT2); + } else if (op2HasImmediateIntFastCase) { + notImm1.link(this); + if (!types.first().definitelyIsNumber()) + emitJumpIfNotImmediateNumber(regT0).linkTo(stubFunctionCall, this); + emitGetVirtualRegister(op2, regT1); + convertInt32ToDouble(regT1, fpRegT1); + addPtr(tagTypeNumberRegister, regT0); + movePtrToDouble(regT0, fpRegT2); + } else { + // if we get here, eax is not an int32, edx not yet checked. + notImm1.link(this); + if (!types.first().definitelyIsNumber()) + emitJumpIfNotImmediateNumber(regT0).linkTo(stubFunctionCall, this); + if (!types.second().definitelyIsNumber()) + emitJumpIfNotImmediateNumber(regT1).linkTo(stubFunctionCall, this); + addPtr(tagTypeNumberRegister, regT0); + movePtrToDouble(regT0, fpRegT1); + Jump op2isDouble = emitJumpIfNotImmediateInteger(regT1); + convertInt32ToDouble(regT1, fpRegT2); + Jump op2wasInteger = jump(); + + // if we get here, eax IS an int32, edx is not. + notImm2.link(this); + if (!types.second().definitelyIsNumber()) + emitJumpIfNotImmediateNumber(regT1).linkTo(stubFunctionCall, this); + convertInt32ToDouble(regT0, fpRegT1); + op2isDouble.link(this); + addPtr(tagTypeNumberRegister, regT1); + movePtrToDouble(regT1, fpRegT2); + op2wasInteger.link(this); + } if (opcodeID == op_add) addDouble(fpRegT2, fpRegT1); @@ -2027,16 +2067,14 @@ void JIT::emitSlow_op_add(Instruction* currentInstruction, Vector unsigned result = currentInstruction[1].u.operand; unsigned op1 = currentInstruction[2].u.operand; unsigned op2 = currentInstruction[3].u.operand; + OperandTypes types = OperandTypes::fromInt(currentInstruction[4].u.operand); - if (isOperandConstantImmediateInt(op1) || isOperandConstantImmediateInt(op2)) { - linkSlowCase(iter); - linkSlowCase(iter); - JITStubCall stubCall(this, cti_op_add); - stubCall.addArgument(op1, regT2); - stubCall.addArgument(op2, regT2); - stubCall.call(result); - } else - compileBinaryArithOpSlowCase(op_add, iter, result, op1, op2, OperandTypes::fromInt(currentInstruction[4].u.operand)); + if (!types.first().mightBeNumber() || !types.second().mightBeNumber()) + return; + + bool op1HasImmediateIntFastCase = isOperandConstantImmediateInt(op1); + bool op2HasImmediateIntFastCase = !op1HasImmediateIntFastCase && isOperandConstantImmediateInt(op2); + compileBinaryArithOpSlowCase(op_add, iter, result, op1, op2, OperandTypes::fromInt(currentInstruction[4].u.operand), op1HasImmediateIntFastCase, op2HasImmediateIntFastCase); } void JIT::emit_op_mul(Instruction* currentInstruction) @@ -2071,17 +2109,9 @@ void JIT::emitSlow_op_mul(Instruction* currentInstruction, Vector unsigned op2 = currentInstruction[3].u.operand; OperandTypes types = OperandTypes::fromInt(currentInstruction[4].u.operand); - if ((isOperandConstantImmediateInt(op1) && (getConstantOperandImmediateInt(op1) > 0)) - || (isOperandConstantImmediateInt(op2) && (getConstantOperandImmediateInt(op2) > 0))) { - linkSlowCase(iter); - linkSlowCase(iter); - // There is an extra slow case for (op1 * -N) or (-N * op2), to check for 0 since this should produce a result of -0. - JITStubCall stubCall(this, cti_op_mul); - stubCall.addArgument(op1, regT2); - stubCall.addArgument(op2, regT2); - stubCall.call(result); - } else - compileBinaryArithOpSlowCase(op_mul, iter, result, op1, op2, types); + bool op1HasImmediateIntFastCase = isOperandConstantImmediateInt(op1) && getConstantOperandImmediateInt(op1) > 0; + bool op2HasImmediateIntFastCase = !op1HasImmediateIntFastCase && isOperandConstantImmediateInt(op2) && getConstantOperandImmediateInt(op2) > 0; + compileBinaryArithOpSlowCase(op_mul, iter, result, op1, op2, OperandTypes::fromInt(currentInstruction[4].u.operand), op1HasImmediateIntFastCase, op2HasImmediateIntFastCase); } void JIT::emit_op_div(Instruction* currentInstruction) @@ -2189,7 +2219,6 @@ void JIT::emit_op_sub(Instruction* currentInstruction) OperandTypes types = OperandTypes::fromInt(currentInstruction[4].u.operand); compileBinaryArithOp(op_sub, result, op1, op2, types); - emitPutVirtualRegister(result); } @@ -2200,7 +2229,7 @@ void JIT::emitSlow_op_sub(Instruction* currentInstruction, Vector unsigned op2 = currentInstruction[3].u.operand; OperandTypes types = OperandTypes::fromInt(currentInstruction[4].u.operand); - compileBinaryArithOpSlowCase(op_sub, iter, result, op1, op2, types); + compileBinaryArithOpSlowCase(op_sub, iter, result, op1, op2, types, false, false); } #else // USE(JSVALUE64) @@ -2383,6 +2412,15 @@ void JIT::emit_op_add(Instruction* currentInstruction) unsigned result = currentInstruction[1].u.operand; unsigned op1 = currentInstruction[2].u.operand; unsigned op2 = currentInstruction[3].u.operand; + OperandTypes types = OperandTypes::fromInt(currentInstruction[4].u.operand); + + if (!types.first().mightBeNumber() || !types.second().mightBeNumber()) { + JITStubCall stubCall(this, cti_op_add); + stubCall.addArgument(op1, regT2); + stubCall.addArgument(op2, regT2); + stubCall.call(result); + return; + } if (isOperandConstantImmediateInt(op1)) { emitGetVirtualRegister(op2, regT0); @@ -2397,15 +2435,7 @@ void JIT::emit_op_add(Instruction* currentInstruction) signExtend32ToPtr(regT0, regT0); emitPutVirtualRegister(result); } else { - OperandTypes types = OperandTypes::fromInt(currentInstruction[4].u.operand); - if (types.first().mightBeNumber() && types.second().mightBeNumber()) - compileBinaryArithOp(op_add, result, op1, op2, OperandTypes::fromInt(currentInstruction[4].u.operand)); - else { - JITStubCall stubCall(this, cti_op_add); - stubCall.addArgument(op1, regT2); - stubCall.addArgument(op2, regT2); - stubCall.call(result); - } + compileBinaryArithOp(op_add, result, op1, op2, OperandTypes::fromInt(currentInstruction[4].u.operand)); } } @@ -2415,6 +2445,10 @@ void JIT::emitSlow_op_add(Instruction* currentInstruction, Vector unsigned op1 = currentInstruction[2].u.operand; unsigned op2 = currentInstruction[3].u.operand; + OperandTypes types = OperandTypes::fromInt(currentInstruction[4].u.operand); + if (!types.first().mightBeNumber() || !types.second().mightBeNumber()) + return; + if (isOperandConstantImmediateInt(op1)) { Jump notImm = getSlowCase(iter); linkSlowCase(iter); diff --git a/src/3rdparty/webkit/JavaScriptCore/jit/JITOpcodes.cpp b/src/3rdparty/webkit/JavaScriptCore/jit/JITOpcodes.cpp index 28d630b..7059cc8 100644 --- a/src/3rdparty/webkit/JavaScriptCore/jit/JITOpcodes.cpp +++ b/src/3rdparty/webkit/JavaScriptCore/jit/JITOpcodes.cpp @@ -794,14 +794,17 @@ void JIT::emit_op_jfalse(Instruction* currentInstruction) Jump isTrue2 = branch32(NotEqual, regT0, Imm32(0)); addJump(jump(), target + 2); - isNotInteger.link(this); + if (supportsFloatingPoint()) { + isNotInteger.link(this); - addSlowCase(branch32(Above, regT1, Imm32(JSValue::LowestTag))); + addSlowCase(branch32(Above, regT1, Imm32(JSValue::LowestTag))); + + zeroDouble(fpRegT0); + emitLoadDouble(cond, fpRegT1); + addJump(branchDouble(DoubleEqual, fpRegT0, fpRegT1), target + 2); + } else + addSlowCase(isNotInteger); - zeroDouble(fpRegT0); - emitLoadDouble(cond, fpRegT1); - addJump(branchDouble(DoubleEqual, fpRegT0, fpRegT1), target + 2); - isTrue.link(this); isTrue2.link(this); } @@ -832,14 +835,17 @@ void JIT::emit_op_jtrue(Instruction* currentInstruction) Jump isFalse2 = branch32(Equal, regT0, Imm32(0)); addJump(jump(), target + 2); - isNotInteger.link(this); + if (supportsFloatingPoint()) { + isNotInteger.link(this); - addSlowCase(branch32(Above, regT1, Imm32(JSValue::LowestTag))); + addSlowCase(branch32(Above, regT1, Imm32(JSValue::LowestTag))); + + zeroDouble(fpRegT0); + emitLoadDouble(cond, fpRegT1); + addJump(branchDouble(DoubleNotEqual, fpRegT0, fpRegT1), target + 2); + } else + addSlowCase(isNotInteger); - zeroDouble(fpRegT0); - emitLoadDouble(cond, fpRegT1); - addJump(branchDouble(DoubleNotEqual, fpRegT0, fpRegT1), target + 2); - isFalse.link(this); isFalse2.link(this); } diff --git a/src/3rdparty/webkit/JavaScriptCore/jsc.cpp b/src/3rdparty/webkit/JavaScriptCore/jsc.cpp index ee4e393..9399b1a 100644 --- a/src/3rdparty/webkit/JavaScriptCore/jsc.cpp +++ b/src/3rdparty/webkit/JavaScriptCore/jsc.cpp @@ -360,11 +360,8 @@ static bool runWithScripts(GlobalObject* globalObject, const Vector + diff --git a/src/3rdparty/webkit/WebCore/inspector/front-end/inspector.js b/src/3rdparty/webkit/WebCore/inspector/front-end/inspector.js index 921bb7a..de4f4fb 100644 --- a/src/3rdparty/webkit/WebCore/inspector/front-end/inspector.js +++ b/src/3rdparty/webkit/WebCore/inspector/front-end/inspector.js @@ -42,7 +42,8 @@ var Preferences = { heapProfilerPresent: false, samplingCPUProfiler: false, showColorNicknames: true, - colorFormat: "hex" + colorFormat: "hex", + eventListenersFilter: "all" } var WebInspector = { @@ -354,6 +355,10 @@ WebInspector.loaded = function() if (colorFormat) Preferences.colorFormat = colorFormat; + var eventListenersFilter = InspectorController.setting("event-listeners-filter"); + if (eventListenersFilter) + Preferences.eventListenersFilter = eventListenersFilter; + this.drawer = new WebInspector.Drawer(); this.console = new WebInspector.ConsoleView(this.drawer); // TODO: Uncomment when enabling the Changes Panel @@ -914,10 +919,8 @@ WebInspector.addResource = function(identifier, payload) this.resources[identifier] = resource; this.resourceURLMap[resource.url] = resource; - if (resource.mainResource) { + if (resource.mainResource) this.mainResource = resource; - this.panels.elements.reset(); - } if (this.panels.resources) this.panels.resources.addResource(resource); @@ -1117,6 +1120,12 @@ WebInspector.resourceURLChanged = function(resource, oldURL) this.resourceURLMap[resource.url] = resource; } +WebInspector.didCommitLoad = function() +{ + // Cleanup elements panel early on inspected page refresh. + WebInspector.setDocument(null); +} + WebInspector.addMessageToConsole = function(payload) { var consoleMessage = new WebInspector.ConsoleMessage( diff --git a/src/3rdparty/webkit/WebCore/inspector/front-end/utilities.js b/src/3rdparty/webkit/WebCore/inspector/front-end/utilities.js index e83c7c0..5f41b56 100644 --- a/src/3rdparty/webkit/WebCore/inspector/front-end/utilities.js +++ b/src/3rdparty/webkit/WebCore/inspector/front-end/utilities.js @@ -621,11 +621,38 @@ function nodeTitleInfo(hasChildren, linkify) return info; } -function getDocumentForNode(node) { +function appropriateSelectorForNode(node, justSelector) +{ + if (!node) + return ""; + + var lowerCaseName = node.localName || node.nodeName.toLowerCase(); + + var id = node.getAttribute("id"); + if (id) { + var selector = "#" + id; + return (justSelector ? selector : lowerCaseName + selector); + } + + var className = node.getAttribute("class"); + if (className) { + var selector = "." + className.replace(/\s+/, "."); + return (justSelector ? selector : lowerCaseName + selector); + } + + if (lowerCaseName === "input" && node.getAttribute("type")) + return lowerCaseName + "[type=\"" + node.getAttribute("type") + "\"]"; + + return lowerCaseName; +} + +function getDocumentForNode(node) +{ return node.nodeType == Node.DOCUMENT_NODE ? node : node.ownerDocument; } -function parentNode(node) { +function parentNode(node) +{ return node.parentNode; } diff --git a/src/3rdparty/webkit/WebCore/loader/FrameLoader.cpp b/src/3rdparty/webkit/WebCore/loader/FrameLoader.cpp index 57cf85a..93a1f10 100644 --- a/src/3rdparty/webkit/WebCore/loader/FrameLoader.cpp +++ b/src/3rdparty/webkit/WebCore/loader/FrameLoader.cpp @@ -947,9 +947,9 @@ void FrameLoader::begin(const KURL& url, bool dispatch, SecurityOrigin* origin) m_outgoingReferrer = ref.string(); m_URL = url; + document->setURL(m_URL); m_frame->setDocument(document); - document->setURL(m_URL); if (m_decoder) document->setDecoder(m_decoder.get()); if (forcedSecurityOrigin) diff --git a/src/3rdparty/webkit/WebCore/loader/ImageDocument.cpp b/src/3rdparty/webkit/WebCore/loader/ImageDocument.cpp index 8078ccd..9b5598d 100644 --- a/src/3rdparty/webkit/WebCore/loader/ImageDocument.cpp +++ b/src/3rdparty/webkit/WebCore/loader/ImageDocument.cpp @@ -70,7 +70,7 @@ private: { } - virtual void handleEvent(Event*); + virtual void handleEvent(ScriptExecutionContext*, Event*); ImageDocument* m_doc; }; @@ -358,7 +358,7 @@ bool ImageDocument::shouldShrinkToFit() const // -------- -void ImageEventListener::handleEvent(Event* event) +void ImageEventListener::handleEvent(ScriptExecutionContext*, Event* event) { if (event->type() == eventNames().resizeEvent) m_doc->windowSizeChanged(); diff --git a/src/3rdparty/webkit/WebCore/page/DOMWindow.idl b/src/3rdparty/webkit/WebCore/page/DOMWindow.idl index f36175e..4e3a03e 100644 --- a/src/3rdparty/webkit/WebCore/page/DOMWindow.idl +++ b/src/3rdparty/webkit/WebCore/page/DOMWindow.idl @@ -489,9 +489,7 @@ module window { attribute XMLHttpRequestUploadConstructor XMLHttpRequestUpload; attribute XMLHttpRequestExceptionConstructor XMLHttpRequestException; -#if defined(ENABLE_XSLT) && ENABLE_XSLT - attribute [JSCCustomGetter] XSLTProcessorConstructor XSLTProcessor; // Usable with the new operator -#endif + attribute [JSCCustomGetter,Conditional=XSLT] XSLTProcessorConstructor XSLTProcessor; // Usable with the new operator #if defined(ENABLE_CHANNEL_MESSAGING) && ENABLE_CHANNEL_MESSAGING attribute MessagePortConstructor MessagePort; diff --git a/src/3rdparty/webkit/WebCore/page/EventHandler.cpp b/src/3rdparty/webkit/WebCore/page/EventHandler.cpp index 3772d65..1075e72 100644 --- a/src/3rdparty/webkit/WebCore/page/EventHandler.cpp +++ b/src/3rdparty/webkit/WebCore/page/EventHandler.cpp @@ -894,8 +894,10 @@ bool EventHandler::scrollOverflow(ScrollDirection direction, ScrollGranularity g if (node) { RenderObject* r = node->renderer(); - if (r && !r->isListBox()) - return r->enclosingBox()->scroll(direction, granularity); + if (r && !r->isListBox() && r->enclosingBox()->scroll(direction, granularity)) { + setFrameWasScrolledByUser(); + return true; + } } return false; @@ -1778,6 +1780,7 @@ bool EventHandler::handleWheelEvent(PlatformWheelEvent& e) FrameView* view = m_frame->view(); if (!view) return false; + setFrameWasScrolledByUser(); IntPoint vPoint = view->windowToContents(e.pos()); Node* node; @@ -2479,17 +2482,23 @@ void EventHandler::sendResizeEvent() void EventHandler::sendScrollEvent() { + setFrameWasScrolledByUser(); + if (m_frame->view()) + m_frame->document()->dispatchEvent(Event::create(eventNames().scrollEvent, true, false)); +} + +void EventHandler::setFrameWasScrolledByUser() +{ FrameView* v = m_frame->view(); - if (!v) - return; - v->setWasScrolledByUser(true); - m_frame->document()->dispatchEvent(Event::create(eventNames().scrollEvent, true, false)); + if (v) + v->setWasScrolledByUser(true); } bool EventHandler::passMousePressEventToScrollbar(MouseEventWithHitTestResults& mev, Scrollbar* scrollbar) { if (!scrollbar || !scrollbar->enabled()) return false; + setFrameWasScrolledByUser(); return scrollbar->mouseDown(mev.event()); } diff --git a/src/3rdparty/webkit/WebCore/page/EventHandler.h b/src/3rdparty/webkit/WebCore/page/EventHandler.h index e1a02db..0221397 100644 --- a/src/3rdparty/webkit/WebCore/page/EventHandler.h +++ b/src/3rdparty/webkit/WebCore/page/EventHandler.h @@ -306,6 +306,8 @@ private: #endif void updateLastScrollbarUnderMouse(Scrollbar*, bool); + + void setFrameWasScrolledByUser(); bool capturesDragging() const { return m_capturesDragging; } diff --git a/src/3rdparty/webkit/WebCore/page/Frame.cpp b/src/3rdparty/webkit/WebCore/page/Frame.cpp index 28e6a9e..e8e796f 100644 --- a/src/3rdparty/webkit/WebCore/page/Frame.cpp +++ b/src/3rdparty/webkit/WebCore/page/Frame.cpp @@ -73,6 +73,7 @@ #include "Settings.h" #include "TextIterator.h" #include "TextResourceDecoder.h" +#include "UserContentURLPattern.h" #include "XMLNames.h" #include "htmlediting.h" #include "markup.h" @@ -870,12 +871,16 @@ void Frame::injectUserScriptsForWorld(unsigned worldID, const UserScriptVector& if (userScripts.isEmpty()) return; + Document* doc = document(); + if (!doc) + return; + // FIXME: Need to implement pattern checking. Vector sourceCode; unsigned count = userScripts.size(); for (unsigned i = 0; i < count; ++i) { UserScript* script = userScripts[i].get(); - if (script->injectionTime() == injectionTime) + if (script->injectionTime() == injectionTime && UserContentURLPattern::matchesPatterns(doc->url(), script->patterns())) sourceCode.append(ScriptSourceCode(script->source(), script->url())); } script()->evaluateInIsolatedWorld(worldID, sourceCode); diff --git a/src/3rdparty/webkit/WebCore/page/Settings.cpp b/src/3rdparty/webkit/WebCore/page/Settings.cpp index 708d595..ab438a1 100644 --- a/src/3rdparty/webkit/WebCore/page/Settings.cpp +++ b/src/3rdparty/webkit/WebCore/page/Settings.cpp @@ -117,6 +117,10 @@ Settings::Settings(Page* page) , m_acceleratedCompositingEnabled(true) , m_experimentalNotificationsEnabled(false) , m_pluginHalterEnabled(false) + , m_experimentalWebGLEnabled(false) +#if ENABLE(WEB_SOCKETS) + , m_experimentalWebSocketsEnabled(false) +#endif { // A Frame may not have been created yet, so we initialize the AtomicString // hash before trying to use it. @@ -528,4 +532,16 @@ void Settings::setShouldUseHighResolutionTimers(bool shouldUseHighResolutionTime } #endif +void Settings::setExperimentalWebGLEnabled(bool enabled) +{ + m_experimentalWebGLEnabled = enabled; +} + +#if ENABLE(WEB_SOCKETS) +void Settings::setExperimentalWebSocketsEnabled(bool enabled) +{ + m_experimentalWebSocketsEnabled = enabled; +} +#endif + } // namespace WebCore diff --git a/src/3rdparty/webkit/WebCore/page/Settings.h b/src/3rdparty/webkit/WebCore/page/Settings.h index b3daf19..ec9c8f9 100644 --- a/src/3rdparty/webkit/WebCore/page/Settings.h +++ b/src/3rdparty/webkit/WebCore/page/Settings.h @@ -267,6 +267,16 @@ namespace WebCore { void setPluginAllowedRunTime(unsigned); unsigned pluginAllowedRunTime() const { return m_pluginAllowedRunTime; } + // This run-time flag is only temporary while the WebGL + // specification is being developed. + void setExperimentalWebGLEnabled(bool); + bool experimentalWebGLEnabled() const { return m_experimentalWebGLEnabled; } + +#if ENABLE(WEB_SOCKETS) + void setExperimentalWebSocketsEnabled(bool); + bool experimentalWebSocketsEnabled() const { return m_experimentalWebSocketsEnabled; } +#endif + private: Page* m_page; @@ -334,6 +344,11 @@ namespace WebCore { bool m_acceleratedCompositingEnabled : 1; bool m_experimentalNotificationsEnabled : 1; bool m_pluginHalterEnabled : 1; + bool m_experimentalWebGLEnabled : 1; + +#if ENABLE(WEB_SOCKETS) + bool m_experimentalWebSocketsEnabled : 1; +#endif #if USE(SAFARI_THEME) static bool gShouldPaintNativeControls; diff --git a/src/3rdparty/webkit/WebCore/page/UserContentURLPattern.cpp b/src/3rdparty/webkit/WebCore/page/UserContentURLPattern.cpp new file mode 100644 index 0000000..1960131 --- /dev/null +++ b/src/3rdparty/webkit/WebCore/page/UserContentURLPattern.cpp @@ -0,0 +1,212 @@ +/* + * Copyright (C) 2009 Apple Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "config.h" +#include "UserContentURLPattern.h" +#include "KURL.h" +#include + +namespace WebCore { + +bool UserContentURLPattern::matchesPatterns(const KURL& url, const Vector& patterns) +{ + // Treat no patterns at all as though a pattern of * was specified. + if (patterns.isEmpty()) + return true; + + for (unsigned i = 0; i < patterns.size(); ++i) { + UserContentURLPattern contentPattern(patterns[i]); + if (contentPattern.matches(url)) + return true; + } + + return false; +} + +bool UserContentURLPattern::parse(const String& pattern) +{ + DEFINE_STATIC_LOCAL(const String, schemeSeparator, ("://")); + + int schemeEndPos = pattern.find(schemeSeparator); + if (schemeEndPos == -1) + return false; + + m_scheme = pattern.left(schemeEndPos); + + int hostStartPos = schemeEndPos + schemeSeparator.length(); + if (hostStartPos >= static_cast(pattern.length())) + return false; + + int pathStartPos = 0; + + if (m_scheme == "file") + pathStartPos = hostStartPos; + else { + int hostEndPos = pattern.find("/", hostStartPos); + if (hostEndPos == -1) + return false; + + m_host = pattern.substring(hostStartPos, hostEndPos - hostStartPos); + + // The first component can be '*', which means to match all subdomains. + Vector hostComponents; + m_host.split(".", hostComponents); + if (hostComponents[0] == "*") { + m_matchSubdomains = true; + m_host = ""; + for (unsigned i = 1; i < hostComponents.size(); ++i) { + m_host = m_host + hostComponents[i]; + if (i < hostComponents.size() - 1) + m_host = m_host + "."; + } + } + + // No other '*' can occur in the host. + if (m_host.find("*") != -1) + return false; + + pathStartPos = hostEndPos; + } + + m_path = pattern.right(pattern.length() - pathStartPos); + + return true; +} + +bool UserContentURLPattern::matches(const KURL& test) const +{ + if (m_invalid) + return false; + + if (test.protocol() != m_scheme) + return false; + + if (!matchesHost(test)) + return false; + + return matchesPath(test); +} + +bool UserContentURLPattern::matchesHost(const KURL& test) const +{ + if (test.host() == m_host) + return true; + + if (!m_matchSubdomains) + return false; + + // If we're matching subdomains, and we have no host, that means the pattern + // was ://*/, so we match anything. + if (!m_host.length()) + return true; + + // Check if the test host is a subdomain of our host. + return test.host().endsWith(m_host, false); +} + +struct MatchTester +{ + const String m_pattern; + unsigned m_patternIndex; + + const String m_test; + unsigned m_testIndex; + + MatchTester(const String& pattern, const String& test) + : m_pattern(pattern) + , m_patternIndex(0) + , m_test(test) + , m_testIndex(0) + { + } + + bool testStringFinished() const { return m_testIndex >= m_test.length(); } + bool patternStringFinished() const { return m_patternIndex >= m_pattern.length(); } + + void eatWildcard() + { + while (!patternStringFinished()) { + if (m_pattern[m_patternIndex] != '*') + return; + m_patternIndex++; + } + } + + void eatSameChars() + { + while (!patternStringFinished() && !testStringFinished()) { + if (m_pattern[m_patternIndex] == '*') + return; + if (m_pattern[m_patternIndex] != m_test[m_testIndex]) + return; + m_patternIndex++; + m_testIndex++; + } + } + + bool test() + { + // Eat all the matching chars. + eatSameChars(); + + // If the string is finished, then the pattern must be empty too, or contains + // only wildcards. + if (testStringFinished()) { + eatWildcard(); + if (patternStringFinished()) + return true; + return false; + } + + // Pattern is empty but not string, this is not a match. + if (patternStringFinished()) + return false; + + // If we don't encounter a *, then we're hosed. + if (m_pattern[m_patternIndex] != '*') + return false; + + while (!testStringFinished()) { + MatchTester nextMatch(*this); + nextMatch.m_patternIndex++; + if (nextMatch.test()) + return true; + m_testIndex++; + } + + // We reached the end of the string. Let's see if the pattern contains only + // wildcards. + eatWildcard(); + return patternStringFinished(); + } +}; + +bool UserContentURLPattern::matchesPath(const KURL& test) const +{ + MatchTester match(m_path, test.path()); + return match.test(); +} + +} // namespace WebCore diff --git a/src/3rdparty/webkit/WebCore/page/UserContentURLPattern.h b/src/3rdparty/webkit/WebCore/page/UserContentURLPattern.h new file mode 100644 index 0000000..bc87f55 --- /dev/null +++ b/src/3rdparty/webkit/WebCore/page/UserContentURLPattern.h @@ -0,0 +1,72 @@ +/* + * Copyright (C) 2009 Apple Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef UserContentURLPattern_h +#define UserContentURLPattern_h + +#include "PlatformString.h" +#include + +namespace WebCore { + +class KURL; + +class UserContentURLPattern { +public: + UserContentURLPattern(const String& pattern) + : m_matchSubdomains(false) + { + m_invalid = !parse(pattern); + } + + bool matches(const KURL&) const; + + const String& scheme() const { return m_scheme; } + const String& host() const { return m_host; } + const String& path() const { return m_path; } + + bool matchSubdomains() const { return m_matchSubdomains; } + + static bool matchesPatterns(const KURL&, const Vector&); + +private: + bool parse(const String& pattern); + + bool matchesHost(const KURL&) const; + bool matchesPath(const KURL&) const; + + bool m_invalid; + + String m_scheme; + String m_host; + String m_path; + + bool m_matchSubdomains; +}; + + +} // namespace WebCore + +#endif // UserContentURLPattern_h diff --git a/src/3rdparty/webkit/WebCore/platform/graphics/filters/FEComposite.cpp b/src/3rdparty/webkit/WebCore/platform/graphics/filters/FEComposite.cpp index 0706358..f452a2d 100644 --- a/src/3rdparty/webkit/WebCore/platform/graphics/filters/FEComposite.cpp +++ b/src/3rdparty/webkit/WebCore/platform/graphics/filters/FEComposite.cpp @@ -2,6 +2,7 @@ Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann 2004, 2005 Rob Buis 2005 Eric Seidel + 2009 Dirk Schulze This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public @@ -24,7 +25,10 @@ #if ENABLE(FILTERS) #include "FEComposite.h" +#include "CanvasPixelArray.h" #include "Filter.h" +#include "GraphicsContext.h" +#include "ImageData.h" namespace WebCore { @@ -97,8 +101,74 @@ void FEComposite::setK4(float k4) m_k4 = k4; } -void FEComposite::apply(Filter*) +inline void arithmetic(const RefPtr& srcPixelArrayA, CanvasPixelArray*& srcPixelArrayB, + float k1, float k2, float k3, float k4) { + float scaledK1 = k1 / 255.f; + float scaledK4 = k4 * 255.f; + for (unsigned pixelOffset = 0; pixelOffset < srcPixelArrayA->length(); pixelOffset += 4) { + for (unsigned channel = 0; channel < 4; ++channel) { + unsigned char i1 = srcPixelArrayA->get(pixelOffset + channel); + unsigned char i2 = srcPixelArrayB->get(pixelOffset + channel); + + unsigned char result = scaledK1 * i1 * i2 + k2 * i1 + k3 * i2 + scaledK4; + if (channel == 3 && i1 == 0 && i2 == 0) + result = 0; + srcPixelArrayB->set(pixelOffset + channel, result); + } + } +} + +void FEComposite::apply(Filter* filter) +{ + m_in->apply(filter); + m_in2->apply(filter); + if (!m_in->resultImage() || !m_in2->resultImage()) + return; + + GraphicsContext* filterContext = getEffectContext(); + if (!filterContext) + return; + + FloatRect srcRect = FloatRect(0.f, 0.f, -1.f, -1.f); + switch (m_type) { + case FECOMPOSITE_OPERATOR_OVER: + filterContext->drawImage(m_in->resultImage()->image(), calculateDrawingRect(m_in->subRegion())); + filterContext->drawImage(m_in2->resultImage()->image(), calculateDrawingRect(m_in2->subRegion())); + break; + case FECOMPOSITE_OPERATOR_IN: + filterContext->save(); + filterContext->clipToImageBuffer(calculateDrawingRect(m_in2->subRegion()), m_in2->resultImage()); + filterContext->drawImage(m_in->resultImage()->image(), calculateDrawingRect(m_in->subRegion())); + filterContext->restore(); + break; + case FECOMPOSITE_OPERATOR_OUT: + filterContext->drawImage(m_in->resultImage()->image(), calculateDrawingRect(m_in->subRegion())); + filterContext->drawImage(m_in2->resultImage()->image(), calculateDrawingRect(m_in2->subRegion()), srcRect, CompositeDestinationOut); + break; + case FECOMPOSITE_OPERATOR_ATOP: + filterContext->drawImage(m_in2->resultImage()->image(), calculateDrawingRect(m_in2->subRegion())); + filterContext->drawImage(m_in->resultImage()->image(), calculateDrawingRect(m_in->subRegion()), srcRect, CompositeSourceAtop); + break; + case FECOMPOSITE_OPERATOR_XOR: + filterContext->drawImage(m_in2->resultImage()->image(), calculateDrawingRect(m_in2->subRegion())); + filterContext->drawImage(m_in->resultImage()->image(), calculateDrawingRect(m_in->subRegion()), srcRect, CompositeXOR); + break; + case FECOMPOSITE_OPERATOR_ARITHMETIC: { + IntRect effectADrawingRect = calculateDrawingIntRect(m_in->subRegion()); + RefPtr srcPixelArrayA(m_in->resultImage()->getPremultipliedImageData(effectADrawingRect)->data()); + + IntRect effectBDrawingRect = calculateDrawingIntRect(m_in2->subRegion()); + RefPtr imageData(m_in2->resultImage()->getPremultipliedImageData(effectBDrawingRect)); + CanvasPixelArray* srcPixelArrayB(imageData->data()); + + arithmetic(srcPixelArrayA, srcPixelArrayB, m_k1, m_k2, m_k3, m_k4); + resultImage()->putPremultipliedImageData(imageData.get(), IntRect(IntPoint(), resultImage()->size()), IntPoint()); + } + break; + default: + break; + } } void FEComposite::dump() diff --git a/src/3rdparty/webkit/WebCore/platform/network/CredentialStorage.cpp b/src/3rdparty/webkit/WebCore/platform/network/CredentialStorage.cpp index b7f4c01..407ed5b 100644 --- a/src/3rdparty/webkit/WebCore/platform/network/CredentialStorage.cpp +++ b/src/3rdparty/webkit/WebCore/platform/network/CredentialStorage.cpp @@ -60,6 +60,9 @@ static String originStringFromURL(const KURL& url) void CredentialStorage::set(const Credential& credential, const ProtectionSpace& protectionSpace, const KURL& url) { + ASSERT(url.protocolInHTTPFamily()); + ASSERT(url.isValid()); + protectionSpaceToCredentialMap().set(protectionSpace, credential); ProtectionSpaceAuthenticationScheme scheme = protectionSpace.authenticationScheme(); @@ -70,14 +73,15 @@ void CredentialStorage::set(const Credential& credential, const ProtectionSpace& pair >::iterator, bool> result = originToDefaultBasicCredentialMap().add(origin, pathToCredentialMap); // Remove the last path component that is not a directory to determine the subpath for which this credential applies. + // We keep a leading slash, but remove a trailing one. String path = url.path(); - if (!path.endsWith("/")) { + ASSERT(path.length() > 0); + ASSERT(path[0] == '/'); + if (path.length() > 1) { int index = path.reverseFind('/'); - if (index != -1) - path = path.substring(0, index); + path = path.substring(0, index ? index : 1); } - if (path.endsWith("/") && path.length() > 1) - path = path.substring(0, path.length() - 1); + ASSERT(path.length() == 1 || path[path.length() - 1] != '/'); result.first->second.set(path, credential); } @@ -102,13 +106,13 @@ Credential CredentialStorage::getDefaultAuthenticationCredential(const KURL& url while (credential.isEmpty() && !path.isNull()) { int index = path.reverseFind('/'); if (index == 0) { - path = String(); credential = pathToCredentialMap.get("/"); + break; } else if (index == -1) { // This case should never happen, as all HTTP URL paths should start with a leading / ASSERT_NOT_REACHED(); credential = pathToCredentialMap.get(path); - path = String(); + break; } else { path = path.substring(0, index); credential = pathToCredentialMap.get(path); diff --git a/src/3rdparty/webkit/WebCore/platform/network/qt/QNetworkReplyHandler.cpp b/src/3rdparty/webkit/WebCore/platform/network/qt/QNetworkReplyHandler.cpp index eac430f..3303b34 100644 --- a/src/3rdparty/webkit/WebCore/platform/network/qt/QNetworkReplyHandler.cpp +++ b/src/3rdparty/webkit/WebCore/platform/network/qt/QNetworkReplyHandler.cpp @@ -205,13 +205,28 @@ QNetworkReply* QNetworkReplyHandler::release() return reply; } +static bool ignoreHttpError(QNetworkReply* reply, bool receivedData) +{ + int httpStatusCode = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(); + + if (httpStatusCode == 401 || httpStatusCode == 407) + return true; + + if (receivedData && (httpStatusCode >= 400 && httpStatusCode < 600)) + return true; + + return false; +} + void QNetworkReplyHandler::finish() { m_shouldFinish = (m_loadMode != LoadNormal); if (m_shouldFinish) return; - sendResponseIfNeeded(); + // FIXME: Investigate if this check should be moved into sendResponseIfNeeded() + if (!m_reply->error()) + sendResponseIfNeeded(); if (!m_resourceHandle) return; @@ -225,23 +240,22 @@ void QNetworkReplyHandler::finish() if (m_redirected) { resetState(); start(); - } else if (m_reply->error() != QNetworkReply::NoError - // a web page that returns 401/403/404 can still have content - && ((m_reply->error() != QNetworkReply::ContentOperationNotPermittedError - && m_reply->error() != QNetworkReply::ContentNotFoundError - && m_reply->error() != QNetworkReply::ProtocolUnknownError - && m_reply->error() != QNetworkReply::UnknownContentError) - // If the web page sent content, let's give it to the user. - || !m_responseDataSent) - && m_reply->error() != QNetworkReply::AuthenticationRequiredError - && m_reply->error() != QNetworkReply::ProxyAuthenticationRequiredError) { - QUrl url = m_reply->url(); - ResourceError error(url.host(), m_reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(), - url.toString(), m_reply->errorString()); - client->didFail(m_resourceHandle, error); - } else { + } else if (!m_reply->error() || ignoreHttpError(m_reply, m_responseDataSent)) { client->didFinishLoading(m_resourceHandle); + } else { + int code = m_reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(); + + QUrl url = m_reply->url(); + + if (code) { + ResourceError error("HTTP", code, url.toString(), m_reply->attribute(QNetworkRequest::HttpReasonPhraseAttribute).toString()); + client->didFail(m_resourceHandle, error); + } else { + ResourceError error("QtNetwork", m_reply->error(), url.toString(), m_reply->errorString()); + client->didFail(m_resourceHandle, error); + } } + oldReply->deleteLater(); if (oldReply == m_reply) m_reply = 0; @@ -300,8 +314,7 @@ void QNetworkReplyHandler::sendResponseIfNeeded() * For local file requests remove the content length and the last-modified * headers as required by fast/dom/xmlhttprequest-get.xhtml */ - foreach (QByteArray headerName, m_reply->rawHeaderList()) { - + foreach (const QByteArray& headerName, m_reply->rawHeaderList()) { if (isLocalFileReply && (headerName == "Content-Length" || headerName == "Last-Modified")) continue; diff --git a/src/3rdparty/webkit/WebCore/platform/qt/Localizations.cpp b/src/3rdparty/webkit/WebCore/platform/qt/Localizations.cpp index 977b284..77cac57 100644 --- a/src/3rdparty/webkit/WebCore/platform/qt/Localizations.cpp +++ b/src/3rdparty/webkit/WebCore/platform/qt/Localizations.cpp @@ -427,7 +427,7 @@ String localizedMediaControlElementHelpText(const String& name) if (name == "CurrentTimeDisplay") return QCoreApplication::translate("QWebPage", "Current movie time", "Media controller element"); if (name == "TimeRemainingDisplay") - return QCoreApplication::translate("QWebPage", "Remaining move time", "Media controller element"); + return QCoreApplication::translate("QWebPage", "Remaining movie time", "Media controller element"); if (name == "StatusDisplay") return QCoreApplication::translate("QWebPage", "Current movie status", "Media controller element"); if (name == "FullscreenButton") diff --git a/src/3rdparty/webkit/WebCore/platform/text/CString.cpp b/src/3rdparty/webkit/WebCore/platform/text/CString.cpp index 5b8ac58..25f5fa1 100644 --- a/src/3rdparty/webkit/WebCore/platform/text/CString.cpp +++ b/src/3rdparty/webkit/WebCore/platform/text/CString.cpp @@ -27,19 +27,10 @@ #include "config.h" #include "CString.h" -#include "Base64.h" - using std::min; namespace WebCore { -PassRefPtr CStringBuffer::base64Encode() -{ - Vector encoded; - WebCore::base64Encode(m_vector, encoded); - return CStringBuffer::create(encoded); -} - CString::CString(const char* str) { init(str, strlen(str)); @@ -99,11 +90,6 @@ void CString::copyBufferIfNeeded() memcpy(m_buffer->mutableData(), m_temp->data(), len); } -CString CString::base64Encode() -{ - return CString(m_buffer->base64Encode().get()); -} - bool operator==(const CString& a, const CString& b) { if (a.isNull() != b.isNull()) diff --git a/src/3rdparty/webkit/WebCore/platform/text/CString.h b/src/3rdparty/webkit/WebCore/platform/text/CString.h index 2d1cc2b..b9030d6 100644 --- a/src/3rdparty/webkit/WebCore/platform/text/CString.h +++ b/src/3rdparty/webkit/WebCore/platform/text/CString.h @@ -43,12 +43,9 @@ namespace WebCore { friend class CString; static PassRefPtr create(unsigned length) { return adoptRef(new CStringBuffer(length)); } - static PassRefPtr create(const Vector& vectorToAdopt) { return adoptRef(new CStringBuffer(vectorToAdopt)); } CStringBuffer(unsigned length) : m_vector(length) { } - CStringBuffer(const Vector& vectorToAdopt) : m_vector(vectorToAdopt) { } char* mutableData() { return m_vector.data(); } - PassRefPtr base64Encode(); Vector m_vector; }; @@ -62,8 +59,6 @@ namespace WebCore { CString(CStringBuffer* buffer) : m_buffer(buffer) { } static CString newUninitialized(size_t length, char*& characterBuffer); - CString base64Encode(); - const char* data() const; char* mutableData(); unsigned length() const; diff --git a/src/3rdparty/webkit/WebCore/platform/text/TextEncoding.cpp b/src/3rdparty/webkit/WebCore/platform/text/TextEncoding.cpp index b76f739..c5c8cfd 100644 --- a/src/3rdparty/webkit/WebCore/platform/text/TextEncoding.cpp +++ b/src/3rdparty/webkit/WebCore/platform/text/TextEncoding.cpp @@ -264,6 +264,7 @@ const TextEncoding& UTF32LittleEndianEncoding() const TextEncoding& UTF8Encoding() { static TextEncoding globalUTF8Encoding("UTF-8"); + ASSERT(globalUTF8Encoding.isValid()); return globalUTF8Encoding; } diff --git a/src/3rdparty/webkit/WebCore/rendering/MediaControlElements.cpp b/src/3rdparty/webkit/WebCore/rendering/MediaControlElements.cpp index 969716f..29e2e57 100644 --- a/src/3rdparty/webkit/WebCore/rendering/MediaControlElements.cpp +++ b/src/3rdparty/webkit/WebCore/rendering/MediaControlElements.cpp @@ -135,7 +135,10 @@ PassRefPtr MediaControlElement::styleForElement() bool MediaControlElement::rendererIsNeeded(RenderStyle* style) { - return HTMLDivElement::rendererIsNeeded(style) && parent() && parent()->renderer(); + ASSERT(document()->page()); + + return HTMLDivElement::rendererIsNeeded(style) && parent() && parent()->renderer() + && document()->page()->theme()->shouldRenderMediaControlPart(style->appearance(), m_mediaElement); } void MediaControlElement::attach() @@ -360,7 +363,10 @@ PassRefPtr MediaControlInputElement::styleForElement() bool MediaControlInputElement::rendererIsNeeded(RenderStyle* style) { - return HTMLInputElement::rendererIsNeeded(style) && parent() && parent()->renderer(); + ASSERT(document()->page()); + + return HTMLInputElement::rendererIsNeeded(style) && parent() && parent()->renderer() + && document()->page()->theme()->shouldRenderMediaControlPart(style->appearance(), m_mediaElement); } void MediaControlInputElement::attach() @@ -444,16 +450,6 @@ void MediaControlMuteButtonElement::updateDisplayType() setDisplayType(m_mediaElement->muted() ? MediaUnMuteButton : MediaMuteButton); } -bool MediaControlMuteButtonElement::disabled() const -{ - return !m_mediaElement->hasAudio(); -} - -bool MediaControlMuteButtonElement::rendererIsNeeded(RenderStyle* style) -{ - return MediaControlInputElement::rendererIsNeeded(style) && !disabled(); -} - // ---------------------------- MediaControlPlayButtonElement::MediaControlPlayButtonElement(Document* document, HTMLMediaElement* element) @@ -551,11 +547,6 @@ void MediaControlRewindButtonElement::defaultEventHandler(Event* event) HTMLInputElement::defaultEventHandler(event); } -bool MediaControlRewindButtonElement::rendererIsNeeded(RenderStyle* style) -{ - return MediaControlInputElement::rendererIsNeeded(style) && m_mediaElement->movieLoadType() != MediaPlayer::LiveStream; -} - // ---------------------------- @@ -573,10 +564,6 @@ void MediaControlReturnToRealtimeButtonElement::defaultEventHandler(Event* event HTMLInputElement::defaultEventHandler(event); } -bool MediaControlReturnToRealtimeButtonElement::rendererIsNeeded(RenderStyle* style) -{ - return MediaControlInputElement::rendererIsNeeded(style) && m_mediaElement->movieLoadType() == MediaPlayer::LiveStream; -} // ---------------------------- @@ -664,11 +651,6 @@ void MediaControlFullscreenButtonElement::defaultEventHandler(Event* event) HTMLInputElement::defaultEventHandler(event); } -bool MediaControlFullscreenButtonElement::rendererIsNeeded(RenderStyle* style) -{ - return MediaControlInputElement::rendererIsNeeded(style) && m_mediaElement->supportsFullscreen(); -} - // ---------------------------- diff --git a/src/3rdparty/webkit/WebCore/rendering/MediaControlElements.h b/src/3rdparty/webkit/WebCore/rendering/MediaControlElements.h index e80f7fa..f692485 100644 --- a/src/3rdparty/webkit/WebCore/rendering/MediaControlElements.h +++ b/src/3rdparty/webkit/WebCore/rendering/MediaControlElements.h @@ -155,9 +155,6 @@ public: bool hitTest(const IntPoint& absPoint); MediaControlElementType displayType() const { return m_displayType; } - // Some elements are disabled by movie state (eg. mute if no audio). - virtual bool disabled() const { return false; } - HTMLMediaElement* mediaElement() const { return m_mediaElement; } virtual bool isMediaControlElement() const { return true; } @@ -177,8 +174,6 @@ public: MediaControlMuteButtonElement(Document*, HTMLMediaElement*); virtual void defaultEventHandler(Event*); virtual void updateDisplayType(); - virtual bool disabled() const; - virtual bool rendererIsNeeded(RenderStyle*); }; // ---------------------------- @@ -212,7 +207,6 @@ class MediaControlRewindButtonElement : public MediaControlInputElement { public: MediaControlRewindButtonElement(Document*, HTMLMediaElement*); virtual void defaultEventHandler(Event*); - virtual bool rendererIsNeeded(RenderStyle*); }; // ---------------------------- @@ -221,7 +215,6 @@ class MediaControlReturnToRealtimeButtonElement : public MediaControlInputElemen public: MediaControlReturnToRealtimeButtonElement(Document*, HTMLMediaElement*); virtual void defaultEventHandler(Event*); - virtual bool rendererIsNeeded(RenderStyle*); }; // ---------------------------- @@ -247,7 +240,6 @@ class MediaControlFullscreenButtonElement : public MediaControlInputElement { public: MediaControlFullscreenButtonElement(Document*, HTMLMediaElement*); virtual void defaultEventHandler(Event*); - virtual bool rendererIsNeeded(RenderStyle*); }; // ---------------------------- diff --git a/src/3rdparty/webkit/WebCore/rendering/RenderBox.cpp b/src/3rdparty/webkit/WebCore/rendering/RenderBox.cpp index dd58ed1..c8d3037 100644 --- a/src/3rdparty/webkit/WebCore/rendering/RenderBox.cpp +++ b/src/3rdparty/webkit/WebCore/rendering/RenderBox.cpp @@ -941,7 +941,8 @@ void RenderBox::mapLocalToContainer(RenderBoxModelObject* repaintContainer, bool if (style()->position() == FixedPosition) fixed = true; - RenderObject* o = container(); + bool containerSkipped; + RenderObject* o = container(repaintContainer, &containerSkipped); if (!o) return; @@ -959,6 +960,14 @@ void RenderBox::mapLocalToContainer(RenderBoxModelObject* repaintContainer, bool } else transformState.move(containerOffset.width(), containerOffset.height(), preserve3D ? TransformState::AccumulateTransform : TransformState::FlattenTransform); + if (containerSkipped) { + // There can't be a transfrom between repaintContainer and o, because transforms create containers, so it should be safe + // to just subtract the delta between the repaintContainer and o. + IntSize repaintContainerOffset = repaintContainer->offsetFromContainer(o); + transformState.move(-repaintContainerOffset.width(), -repaintContainerOffset.height(), preserve3D ? TransformState::AccumulateTransform : TransformState::FlattenTransform); + return; + } + o->mapLocalToContainer(repaintContainer, fixed, useTransforms, transformState); } @@ -1131,7 +1140,8 @@ void RenderBox::computeRectForRepaint(RenderBoxModelObject* repaintContainer, In if (repaintContainer == this) return; - RenderObject* o = container(); + bool containerSkipped; + RenderObject* o = container(repaintContainer, &containerSkipped); if (!o) return; @@ -1188,6 +1198,13 @@ void RenderBox::computeRectForRepaint(RenderBoxModelObject* repaintContainer, In return; } else rect.setLocation(topLeft); + + if (containerSkipped) { + // If the repaintContainer is below o, then we need to map the rect into repaintContainer's coordinates. + IntSize containerOffset = repaintContainer->offsetFromContainer(o); + rect.move(-containerOffset); + return; + } o->computeRectForRepaint(repaintContainer, rect, fixed); } diff --git a/src/3rdparty/webkit/WebCore/rendering/RenderInline.cpp b/src/3rdparty/webkit/WebCore/rendering/RenderInline.cpp index 07b28cc..a5e973e 100644 --- a/src/3rdparty/webkit/WebCore/rendering/RenderInline.cpp +++ b/src/3rdparty/webkit/WebCore/rendering/RenderInline.cpp @@ -652,7 +652,8 @@ void RenderInline::computeRectForRepaint(RenderBoxModelObject* repaintContainer, if (repaintContainer == this) return; - RenderObject* o = container(); + bool containerSkipped; + RenderObject* o = container(repaintContainer, &containerSkipped); if (!o) return; @@ -693,6 +694,13 @@ void RenderInline::computeRectForRepaint(RenderBoxModelObject* repaintContainer, return; } else rect.setLocation(topLeft); + + if (containerSkipped) { + // If the repaintContainer is below o, then we need to map the rect into repaintContainer's coordinates. + IntSize containerOffset = repaintContainer->offsetFromContainer(o); + rect.move(-containerOffset); + return; + } o->computeRectForRepaint(repaintContainer, rect, fixed); } diff --git a/src/3rdparty/webkit/WebCore/rendering/RenderObject.cpp b/src/3rdparty/webkit/WebCore/rendering/RenderObject.cpp index 1d5ed0c..b7f59e1 100644 --- a/src/3rdparty/webkit/WebCore/rendering/RenderObject.cpp +++ b/src/3rdparty/webkit/WebCore/rendering/RenderObject.cpp @@ -1788,8 +1788,11 @@ bool RenderObject::hasOutlineAnnotation() const return node() && node()->isLink() && document()->printing(); } -RenderObject* RenderObject::container() const +RenderObject* RenderObject::container(RenderBoxModelObject* repaintContainer, bool* repaintContainerSkipped) const { + if (repaintContainerSkipped) + *repaintContainerSkipped = false; + // This method is extremely similar to containingBlock(), but with a few notable // exceptions. // (1) It can be used on orphaned subtrees, i.e., it can be called safely even when @@ -1814,14 +1817,20 @@ RenderObject* RenderObject::container() const // we'll just return 0). // FIXME: The definition of view() has changed to not crawl up the render tree. It might // be safe now to use it. - while (o && o->parent() && !(o->hasTransform() && o->isRenderBlock())) + while (o && o->parent() && !(o->hasTransform() && o->isRenderBlock())) { + if (repaintContainerSkipped && o == repaintContainer) + *repaintContainerSkipped = true; o = o->parent(); + } } else if (pos == AbsolutePosition) { // Same goes here. We technically just want our containing block, but // we may not have one if we're part of an uninstalled subtree. We'll // climb as high as we can though. - while (o && o->style()->position() == StaticPosition && !o->isRenderView() && !(o->hasTransform() && o->isRenderBlock())) + while (o && o->style()->position() == StaticPosition && !o->isRenderView() && !(o->hasTransform() && o->isRenderBlock())) { + if (repaintContainerSkipped && o == repaintContainer) + *repaintContainerSkipped = true; o = o->parent(); + } } return o; diff --git a/src/3rdparty/webkit/WebCore/rendering/RenderObject.h b/src/3rdparty/webkit/WebCore/rendering/RenderObject.h index 34f2b8b..367eaa6 100644 --- a/src/3rdparty/webkit/WebCore/rendering/RenderObject.h +++ b/src/3rdparty/webkit/WebCore/rendering/RenderObject.h @@ -403,11 +403,11 @@ public: bool hasOutlineAnnotation() const; bool hasOutline() const { return style()->hasOutline() || hasOutlineAnnotation(); } - /** - * returns the object containing this one. can be different from parent for - * positioned elements - */ - RenderObject* container() const; + // Returns the object containing this one. Can be different from parent for positioned elements. + // If repaintContainer and repaintContainerSkipped are not null, on return *repaintContainerSkipped + // is true if the renderer returned is an ancestor of repaintContainer. + RenderObject* container(RenderBoxModelObject* repaintContainer = 0, bool* repaintContainerSkipped = 0) const; + virtual RenderObject* hoverAncestor() const { return parent(); } // IE Extension that can be called on any RenderObject. See the implementation for the details. diff --git a/src/3rdparty/webkit/WebCore/rendering/RenderTheme.cpp b/src/3rdparty/webkit/WebCore/rendering/RenderTheme.cpp index 7b4dfe3..b5826cd 100644 --- a/src/3rdparty/webkit/WebCore/rendering/RenderTheme.cpp +++ b/src/3rdparty/webkit/WebCore/rendering/RenderTheme.cpp @@ -30,6 +30,7 @@ #include "GraphicsContext.h" #include "HTMLInputElement.h" #include "HTMLNames.h" +#include "MediaControlElements.h" #include "Page.h" #include "RenderStyle.h" #include "RenderView.h" @@ -396,6 +397,23 @@ bool RenderTheme::hitTestMediaControlPart(RenderObject* o, const IntPoint& absPo FloatPoint localPoint = o->absoluteToLocal(absPoint, false, true); // respect transforms return toRenderBox(o)->borderBoxRect().contains(roundedIntPoint(localPoint)); } + +bool RenderTheme::shouldRenderMediaControlPart(ControlPart part, Element* e) +{ + HTMLMediaElement* mediaElement = static_cast(e); + switch (part) { + case MediaMuteButtonPart: + return mediaElement->hasAudio(); + case MediaRewindButtonPart: + return mediaElement->movieLoadType() != MediaPlayer::LiveStream; + case MediaReturnToRealtimeButtonPart: + return mediaElement->movieLoadType() == MediaPlayer::LiveStream; + case MediaFullscreenButtonPart: + return mediaElement->supportsFullscreen(); + default: + return true; + } +} #endif Color RenderTheme::activeSelectionBackgroundColor() const diff --git a/src/3rdparty/webkit/WebCore/rendering/RenderTheme.h b/src/3rdparty/webkit/WebCore/rendering/RenderTheme.h index c00c2eb..1b6a7e4 100644 --- a/src/3rdparty/webkit/WebCore/rendering/RenderTheme.h +++ b/src/3rdparty/webkit/WebCore/rendering/RenderTheme.h @@ -172,6 +172,7 @@ public: #if ENABLE(VIDEO) // Media controls virtual bool hitTestMediaControlPart(RenderObject*, const IntPoint& absPoint); + virtual bool shouldRenderMediaControlPart(ControlPart, Element*); #endif protected: diff --git a/src/3rdparty/webkit/WebCore/rendering/RenderThemeChromiumSkia.cpp b/src/3rdparty/webkit/WebCore/rendering/RenderThemeChromiumSkia.cpp index 82e633b..4f486d5 100644 --- a/src/3rdparty/webkit/WebCore/rendering/RenderThemeChromiumSkia.cpp +++ b/src/3rdparty/webkit/WebCore/rendering/RenderThemeChromiumSkia.cpp @@ -868,6 +868,19 @@ int RenderThemeChromiumSkia::buttonInternalPaddingBottom() const return 1; } +#if ENABLE(VIDEO) +bool RenderThemeChromiumSkia::shouldRenderMediaControlPart(ControlPart part, Element* e) +{ + HTMLMediaElement* mediaElement = static_cast(e); + switch (part) { + case MediaMuteButtonPart: + return true; + default: + return RenderTheme::shouldRenderMediaControlPart(part, e); + } +} +#endif + // static void RenderThemeChromiumSkia::setDefaultFontSize(int fontSize) { diff --git a/src/3rdparty/webkit/WebCore/rendering/RenderThemeChromiumSkia.h b/src/3rdparty/webkit/WebCore/rendering/RenderThemeChromiumSkia.h index 37e656f..98e3a35 100644 --- a/src/3rdparty/webkit/WebCore/rendering/RenderThemeChromiumSkia.h +++ b/src/3rdparty/webkit/WebCore/rendering/RenderThemeChromiumSkia.h @@ -126,6 +126,11 @@ namespace WebCore { virtual int buttonInternalPaddingTop() const; virtual int buttonInternalPaddingBottom() const; +#if ENABLE(VIDEO) + // Media controls + virtual bool shouldRenderMediaControlPart(ControlPart, Element*); +#endif + // Provide a way to pass the default font size from the Settings object // to the render theme. FIXME: http://b/1129186 A cleaner way would be // to remove the default font size from this object and have callers diff --git a/src/3rdparty/webkit/WebCore/storage/StorageEventDispatcher.h b/src/3rdparty/webkit/WebCore/storage/StorageEventDispatcher.h new file mode 100644 index 0000000..f4a98ef --- /dev/null +++ b/src/3rdparty/webkit/WebCore/storage/StorageEventDispatcher.h @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2008 Apple Inc. All rights reserved. + * Copyright (C) 2009 Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef StorageEventDispatcher_h +#define StorageEventDispatcher_h + +#if ENABLE(DOM_STORAGE) + +#include "PlatformString.h" +#include "StorageArea.h" + +namespace WebCore { + + // This is in its own class since Chromium must override it. + class StorageEventDispatcher { + public: + static void dispatch(const String& key, const String& oldValue, const String& newValue, StorageType, SecurityOrigin*, Frame* sourceFrame); + + private: + // Do not instantiate. + StorageEventDispatcher(); + }; + +} // namespace WebCore + +#endif // ENABLE(DOM_STORAGE) + +#endif // StorageEventDispatcher_h diff --git a/src/3rdparty/webkit/WebCore/svg/SVGUseElement.cpp b/src/3rdparty/webkit/WebCore/svg/SVGUseElement.cpp index 4b66e03..0c2abe0 100644 --- a/src/3rdparty/webkit/WebCore/svg/SVGUseElement.cpp +++ b/src/3rdparty/webkit/WebCore/svg/SVGUseElement.cpp @@ -1,6 +1,7 @@ /* Copyright (C) 2004, 2005, 2006, 2007, 2008 Nikolas Zimmermann 2004, 2005, 2006, 2007 Rob Buis + Copyright (C) Research In Motion Limited 2009. All rights reserved. This file is part of the KDE project @@ -158,6 +159,9 @@ void SVGUseElement::childrenChanged(bool changedByParser, Node* beforeChange, No static bool shadowTreeContainsChangedNodes(SVGElementInstance* target) { + if (!target) // when use is referencing an non-existing element, there will be no Instance tree built + return false; + if (target->needsUpdate()) return true; diff --git a/src/3rdparty/webkit/WebCore/svg/animation/SVGSMILElement.cpp b/src/3rdparty/webkit/WebCore/svg/animation/SVGSMILElement.cpp index 8ec9435..3957b81 100644 --- a/src/3rdparty/webkit/WebCore/svg/animation/SVGSMILElement.cpp +++ b/src/3rdparty/webkit/WebCore/svg/animation/SVGSMILElement.cpp @@ -87,7 +87,7 @@ private: m_eventBase->addEventListener(m_condition->m_name, this, false); } - virtual void handleEvent(Event*); + virtual void handleEvent(ScriptExecutionContext*, Event*); SVGSMILElement* m_animation; SVGSMILElement::Condition* m_condition; @@ -103,7 +103,7 @@ bool ConditionEventListener::operator==(const EventListener& listener) return false; } -void ConditionEventListener::handleEvent(Event* event) +void ConditionEventListener::handleEvent(ScriptExecutionContext*, Event* event) { m_animation->handleConditionEvent(event, m_condition); } diff --git a/src/3rdparty/webkit/WebCore/workers/WorkerContext.cpp b/src/3rdparty/webkit/WebCore/workers/WorkerContext.cpp index 22e5b56..f4d795b 100644 --- a/src/3rdparty/webkit/WebCore/workers/WorkerContext.cpp +++ b/src/3rdparty/webkit/WebCore/workers/WorkerContext.cpp @@ -233,7 +233,7 @@ void WorkerContext::reportException(const String& errorMessage, int lineNumber, { bool errorHandled = false; if (onerror()) - errorHandled = onerror()->reportError(errorMessage, sourceURL, lineNumber); + errorHandled = onerror()->reportError(this, errorMessage, sourceURL, lineNumber); if (!errorHandled) thread()->workerReportingProxy().postExceptionToWorkerObject(errorMessage, lineNumber, sourceURL); diff --git a/src/3rdparty/webkit/WebCore/xml/XSLStyleSheet.cpp b/src/3rdparty/webkit/WebCore/xml/XSLStyleSheet.cpp deleted file mode 100644 index b7d52f8..0000000 --- a/src/3rdparty/webkit/WebCore/xml/XSLStyleSheet.cpp +++ /dev/null @@ -1,312 +0,0 @@ -/* - * This file is part of the XSL implementation. - * - * Copyright (C) 2004, 2005, 2006, 2008 Apple Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#include "config.h" -#include "XSLStyleSheet.h" - -#if ENABLE(XSLT) - -#include "CString.h" -#include "Console.h" -#include "DOMWindow.h" -#include "DocLoader.h" -#include "Document.h" -#include "Frame.h" -#include "Node.h" -#include "XMLTokenizer.h" -#include "XMLTokenizerScope.h" -#include "XSLImportRule.h" -#include "XSLTProcessor.h" -#include "loader.h" - -#include -#include - -#if PLATFORM(MAC) -#include "SoftLinking.h" -#endif - -#if PLATFORM(MAC) -SOFT_LINK_LIBRARY(libxslt) -SOFT_LINK(libxslt, xsltIsBlank, int, (xmlChar *str), (str)) -SOFT_LINK(libxslt, xsltGetNsProp, xmlChar *, (xmlNodePtr node, const xmlChar *name, const xmlChar *nameSpace), (node, name, nameSpace)) -SOFT_LINK(libxslt, xsltParseStylesheetDoc, xsltStylesheetPtr, (xmlDocPtr doc), (doc)) -SOFT_LINK(libxslt, xsltLoadStylesheetPI, xsltStylesheetPtr, (xmlDocPtr doc), (doc)) -#endif - -namespace WebCore { - -XSLStyleSheet::XSLStyleSheet(XSLImportRule* parentRule, const String& href) - : StyleSheet(parentRule, href) - , m_ownerDocument(0) - , m_stylesheetDoc(0) - , m_embedded(false) - , m_processed(false) // Child sheets get marked as processed when the libxslt engine has finally seen them. - , m_stylesheetDocTaken(false) - , m_parentStyleSheet(0) -{ -} - -XSLStyleSheet::XSLStyleSheet(Node* parentNode, const String& href, bool embedded) - : StyleSheet(parentNode, href) - , m_ownerDocument(parentNode->document()) - , m_stylesheetDoc(0) - , m_embedded(embedded) - , m_processed(true) // The root sheet starts off processed. - , m_stylesheetDocTaken(false) - , m_parentStyleSheet(0) -{ -} - -XSLStyleSheet::~XSLStyleSheet() -{ - if (!m_stylesheetDocTaken) - xmlFreeDoc(m_stylesheetDoc); -} - -bool XSLStyleSheet::isLoading() -{ - unsigned len = length(); - for (unsigned i = 0; i < len; ++i) { - StyleBase* rule = item(i); - if (rule->isImportRule()) { - XSLImportRule* import = static_cast(rule); - if (import->isLoading()) - return true; - } - } - return false; -} - -void XSLStyleSheet::checkLoaded() -{ - if (isLoading()) - return; - if (parent()) - parent()->checkLoaded(); - if (ownerNode()) - ownerNode()->sheetLoaded(); -} - -xmlDocPtr XSLStyleSheet::document() -{ - if (m_embedded && ownerDocument()) - return (xmlDocPtr)ownerDocument()->transformSource(); - return m_stylesheetDoc; -} - -void XSLStyleSheet::clearDocuments() -{ - m_stylesheetDoc = 0; - unsigned len = length(); - for (unsigned i = 0; i < len; ++i) { - StyleBase* rule = item(i); - if (rule->isImportRule()) { - XSLImportRule* import = static_cast(rule); - if (import->styleSheet()) - import->styleSheet()->clearDocuments(); - } - } -} - -DocLoader* XSLStyleSheet::docLoader() -{ - if (!m_ownerDocument) - return 0; - return m_ownerDocument->docLoader(); -} - -bool XSLStyleSheet::parseString(const String& string, bool) -{ - // Parse in a single chunk into an xmlDocPtr - const UChar BOM = 0xFEFF; - const unsigned char BOMHighByte = *reinterpret_cast(&BOM); - if (!m_stylesheetDocTaken) - xmlFreeDoc(m_stylesheetDoc); - m_stylesheetDocTaken = false; - - Console* console = 0; - if (Frame* frame = ownerDocument()->frame()) - console = frame->domWindow()->console(); - - XMLTokenizerScope scope(docLoader(), XSLTProcessor::genericErrorFunc, XSLTProcessor::parseErrorFunc, console); - - const char* buffer = reinterpret_cast(string.characters()); - int size = string.length() * sizeof(UChar); - - xmlParserCtxtPtr ctxt = xmlCreateMemoryParserCtxt(buffer, size); - - if (m_parentStyleSheet) { - // The XSL transform may leave the newly-transformed document - // with references to the symbol dictionaries of the style sheet - // and any of its children. XML document disposal can corrupt memory - // if a document uses more than one symbol dictionary, so we - // ensure that all child stylesheets use the same dictionaries as their - // parents. - xmlDictFree(ctxt->dict); - ctxt->dict = m_parentStyleSheet->m_stylesheetDoc->dict; - xmlDictReference(ctxt->dict); - } - - m_stylesheetDoc = xmlCtxtReadMemory(ctxt, buffer, size, - href().utf8().data(), - BOMHighByte == 0xFF ? "UTF-16LE" : "UTF-16BE", - XML_PARSE_NOENT | XML_PARSE_DTDATTR | XML_PARSE_NOWARNING | XML_PARSE_NOCDATA); - xmlFreeParserCtxt(ctxt); - - loadChildSheets(); - - return m_stylesheetDoc; -} - -void XSLStyleSheet::loadChildSheets() -{ - if (!document()) - return; - - xmlNodePtr stylesheetRoot = document()->children; - - // Top level children may include other things such as DTD nodes, we ignore those. - while (stylesheetRoot && stylesheetRoot->type != XML_ELEMENT_NODE) - stylesheetRoot = stylesheetRoot->next; - - if (m_embedded) { - // We have to locate (by ID) the appropriate embedded stylesheet element, so that we can walk the - // import/include list. - xmlAttrPtr idNode = xmlGetID(document(), (const xmlChar*)(href().utf8().data())); - if (!idNode) - return; - stylesheetRoot = idNode->parent; - } else { - // FIXME: Need to handle an external URI with a # in it. This is a pretty minor edge case, so we'll deal - // with it later. - } - - if (stylesheetRoot) { - // Walk the children of the root element and look for import/include elements. - // Imports must occur first. - xmlNodePtr curr = stylesheetRoot->children; - while (curr) { - if (curr->type != XML_ELEMENT_NODE) { - curr = curr->next; - continue; - } - if (IS_XSLT_ELEM(curr) && IS_XSLT_NAME(curr, "import")) { - xmlChar* uriRef = xsltGetNsProp(curr, (const xmlChar*)"href", XSLT_NAMESPACE); - loadChildSheet(String::fromUTF8((const char*)uriRef)); - xmlFree(uriRef); - } else - break; - curr = curr->next; - } - - // Now handle includes. - while (curr) { - if (curr->type == XML_ELEMENT_NODE && IS_XSLT_ELEM(curr) && IS_XSLT_NAME(curr, "include")) { - xmlChar* uriRef = xsltGetNsProp(curr, (const xmlChar*)"href", XSLT_NAMESPACE); - loadChildSheet(String::fromUTF8((const char*)uriRef)); - xmlFree(uriRef); - } - curr = curr->next; - } - } -} - -void XSLStyleSheet::loadChildSheet(const String& href) -{ - RefPtr childRule = XSLImportRule::create(this, href); - append(childRule); - childRule->loadSheet(); -} - -xsltStylesheetPtr XSLStyleSheet::compileStyleSheet() -{ - // FIXME: Hook up error reporting for the stylesheet compilation process. - if (m_embedded) - return xsltLoadStylesheetPI(document()); - - // xsltParseStylesheetDoc makes the document part of the stylesheet - // so we have to release our pointer to it. - ASSERT(!m_stylesheetDocTaken); - xsltStylesheetPtr result = xsltParseStylesheetDoc(m_stylesheetDoc); - if (result) - m_stylesheetDocTaken = true; - return result; -} - -void XSLStyleSheet::setParentStyleSheet(XSLStyleSheet* parent) -{ - m_parentStyleSheet = parent; - if (parent) - m_ownerDocument = parent->ownerDocument(); -} - -xmlDocPtr XSLStyleSheet::locateStylesheetSubResource(xmlDocPtr parentDoc, const xmlChar* uri) -{ - bool matchedParent = (parentDoc == document()); - unsigned len = length(); - for (unsigned i = 0; i < len; ++i) { - StyleBase* rule = item(i); - if (rule->isImportRule()) { - XSLImportRule* import = static_cast(rule); - XSLStyleSheet* child = import->styleSheet(); - if (!child) - continue; - if (matchedParent) { - if (child->processed()) - continue; // libxslt has been given this sheet already. - - // Check the URI of the child stylesheet against the doc URI. - // In order to ensure that libxml canonicalized both URLs, we get the original href - // string from the import rule and canonicalize it using libxml before comparing it - // with the URI argument. - CString importHref = import->href().utf8(); - xmlChar* base = xmlNodeGetBase(parentDoc, (xmlNodePtr)parentDoc); - xmlChar* childURI = xmlBuildURI((const xmlChar*)importHref.data(), base); - bool equalURIs = xmlStrEqual(uri, childURI); - xmlFree(base); - xmlFree(childURI); - if (equalURIs) { - child->markAsProcessed(); - return child->document(); - } - } else { - xmlDocPtr result = import->styleSheet()->locateStylesheetSubResource(parentDoc, uri); - if (result) - return result; - } - } - } - - return 0; -} - -void XSLStyleSheet::markAsProcessed() -{ - ASSERT(!m_processed); - ASSERT(!m_stylesheetDocTaken); - m_processed = true; - m_stylesheetDocTaken = true; -} - -} // namespace WebCore - -#endif // ENABLE(XSLT) diff --git a/src/3rdparty/webkit/WebCore/xml/XSLStyleSheet.h b/src/3rdparty/webkit/WebCore/xml/XSLStyleSheet.h index fe97b54..c9729bb 100644 --- a/src/3rdparty/webkit/WebCore/xml/XSLStyleSheet.h +++ b/src/3rdparty/webkit/WebCore/xml/XSLStyleSheet.h @@ -26,8 +26,12 @@ #if ENABLE(XSLT) #include "StyleSheet.h" + +#if !USE(QXMLQUERY) #include #include +#endif + #include namespace WebCore { @@ -38,10 +42,12 @@ class XSLImportRule; class XSLStyleSheet : public StyleSheet { public: +#if !USE(QXMLQUERY) static PassRefPtr create(XSLImportRule* parentImport, const String& href) { return adoptRef(new XSLStyleSheet(parentImport, href)); } +#endif static PassRefPtr create(Node* parentNode, const String& href) { return adoptRef(new XSLStyleSheet(parentNode, href, false)); @@ -65,31 +71,41 @@ public: void loadChildSheets(); void loadChildSheet(const String& href); - xsltStylesheetPtr compileStyleSheet(); - DocLoader* docLoader(); Document* ownerDocument() { return m_ownerDocument; } void setParentStyleSheet(XSLStyleSheet* parent); +#if USE(QXMLQUERY) + String sheetString() const { return m_sheetString; } +#else xmlDocPtr document(); + xsltStylesheetPtr compileStyleSheet(); + xmlDocPtr locateStylesheetSubResource(xmlDocPtr parentDoc, const xmlChar* uri); +#endif void clearDocuments(); - xmlDocPtr locateStylesheetSubResource(xmlDocPtr parentDoc, const xmlChar* uri); - void markAsProcessed(); bool processed() const { return m_processed; } private: XSLStyleSheet(Node* parentNode, const String& href, bool embedded); +#if !USE(QXMLQUERY) XSLStyleSheet(XSLImportRule* parentImport, const String& href); +#endif Document* m_ownerDocument; - xmlDocPtr m_stylesheetDoc; bool m_embedded; bool m_processed; + +#if USE(QXMLQUERY) + String m_sheetString; +#else + xmlDocPtr m_stylesheetDoc; bool m_stylesheetDocTaken; +#endif + XSLStyleSheet* m_parentStyleSheet; }; diff --git a/src/3rdparty/webkit/WebCore/xml/XSLStyleSheetLibxslt.cpp b/src/3rdparty/webkit/WebCore/xml/XSLStyleSheetLibxslt.cpp new file mode 100644 index 0000000..2ae8b82 --- /dev/null +++ b/src/3rdparty/webkit/WebCore/xml/XSLStyleSheetLibxslt.cpp @@ -0,0 +1,313 @@ +/* + * This file is part of the XSL implementation. + * + * Copyright (C) 2004, 2005, 2006, 2008 Apple Inc. All rights reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public License + * along with this library; see the file COPYING.LIB. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#include "config.h" +#include "XSLStyleSheet.h" + +#if ENABLE(XSLT) + +#include "CString.h" +#include "Console.h" +#include "DOMWindow.h" +#include "DocLoader.h" +#include "Document.h" +#include "Frame.h" +#include "Node.h" +#include "TransformSource.h" +#include "XMLTokenizer.h" +#include "XMLTokenizerScope.h" +#include "XSLImportRule.h" +#include "XSLTProcessor.h" +#include "loader.h" + +#include +#include + +#if PLATFORM(MAC) +#include "SoftLinking.h" +#endif + +#if PLATFORM(MAC) +SOFT_LINK_LIBRARY(libxslt) +SOFT_LINK(libxslt, xsltIsBlank, int, (xmlChar *str), (str)) +SOFT_LINK(libxslt, xsltGetNsProp, xmlChar *, (xmlNodePtr node, const xmlChar *name, const xmlChar *nameSpace), (node, name, nameSpace)) +SOFT_LINK(libxslt, xsltParseStylesheetDoc, xsltStylesheetPtr, (xmlDocPtr doc), (doc)) +SOFT_LINK(libxslt, xsltLoadStylesheetPI, xsltStylesheetPtr, (xmlDocPtr doc), (doc)) +#endif + +namespace WebCore { + +XSLStyleSheet::XSLStyleSheet(XSLImportRule* parentRule, const String& href) + : StyleSheet(parentRule, href) + , m_ownerDocument(0) + , m_embedded(false) + , m_processed(false) // Child sheets get marked as processed when the libxslt engine has finally seen them. + , m_stylesheetDoc(0) + , m_stylesheetDocTaken(false) + , m_parentStyleSheet(0) +{ +} + +XSLStyleSheet::XSLStyleSheet(Node* parentNode, const String& href, bool embedded) + : StyleSheet(parentNode, href) + , m_ownerDocument(parentNode->document()) + , m_embedded(embedded) + , m_processed(true) // The root sheet starts off processed. + , m_stylesheetDoc(0) + , m_stylesheetDocTaken(false) + , m_parentStyleSheet(0) +{ +} + +XSLStyleSheet::~XSLStyleSheet() +{ + if (!m_stylesheetDocTaken) + xmlFreeDoc(m_stylesheetDoc); +} + +bool XSLStyleSheet::isLoading() +{ + unsigned len = length(); + for (unsigned i = 0; i < len; ++i) { + StyleBase* rule = item(i); + if (rule->isImportRule()) { + XSLImportRule* import = static_cast(rule); + if (import->isLoading()) + return true; + } + } + return false; +} + +void XSLStyleSheet::checkLoaded() +{ + if (isLoading()) + return; + if (parent()) + parent()->checkLoaded(); + if (ownerNode()) + ownerNode()->sheetLoaded(); +} + +xmlDocPtr XSLStyleSheet::document() +{ + if (m_embedded && ownerDocument() && ownerDocument()->transformSource()) + return (xmlDocPtr)ownerDocument()->transformSource()->platformSource(); + return m_stylesheetDoc; +} + +void XSLStyleSheet::clearDocuments() +{ + m_stylesheetDoc = 0; + unsigned len = length(); + for (unsigned i = 0; i < len; ++i) { + StyleBase* rule = item(i); + if (rule->isImportRule()) { + XSLImportRule* import = static_cast(rule); + if (import->styleSheet()) + import->styleSheet()->clearDocuments(); + } + } +} + +DocLoader* XSLStyleSheet::docLoader() +{ + if (!m_ownerDocument) + return 0; + return m_ownerDocument->docLoader(); +} + +bool XSLStyleSheet::parseString(const String& string, bool) +{ + // Parse in a single chunk into an xmlDocPtr + const UChar BOM = 0xFEFF; + const unsigned char BOMHighByte = *reinterpret_cast(&BOM); + if (!m_stylesheetDocTaken) + xmlFreeDoc(m_stylesheetDoc); + m_stylesheetDocTaken = false; + + Console* console = 0; + if (Frame* frame = ownerDocument()->frame()) + console = frame->domWindow()->console(); + + XMLTokenizerScope scope(docLoader(), XSLTProcessor::genericErrorFunc, XSLTProcessor::parseErrorFunc, console); + + const char* buffer = reinterpret_cast(string.characters()); + int size = string.length() * sizeof(UChar); + + xmlParserCtxtPtr ctxt = xmlCreateMemoryParserCtxt(buffer, size); + + if (m_parentStyleSheet) { + // The XSL transform may leave the newly-transformed document + // with references to the symbol dictionaries of the style sheet + // and any of its children. XML document disposal can corrupt memory + // if a document uses more than one symbol dictionary, so we + // ensure that all child stylesheets use the same dictionaries as their + // parents. + xmlDictFree(ctxt->dict); + ctxt->dict = m_parentStyleSheet->m_stylesheetDoc->dict; + xmlDictReference(ctxt->dict); + } + + m_stylesheetDoc = xmlCtxtReadMemory(ctxt, buffer, size, + href().utf8().data(), + BOMHighByte == 0xFF ? "UTF-16LE" : "UTF-16BE", + XML_PARSE_NOENT | XML_PARSE_DTDATTR | XML_PARSE_NOWARNING | XML_PARSE_NOCDATA); + xmlFreeParserCtxt(ctxt); + + loadChildSheets(); + + return m_stylesheetDoc; +} + +void XSLStyleSheet::loadChildSheets() +{ + if (!document()) + return; + + xmlNodePtr stylesheetRoot = document()->children; + + // Top level children may include other things such as DTD nodes, we ignore those. + while (stylesheetRoot && stylesheetRoot->type != XML_ELEMENT_NODE) + stylesheetRoot = stylesheetRoot->next; + + if (m_embedded) { + // We have to locate (by ID) the appropriate embedded stylesheet element, so that we can walk the + // import/include list. + xmlAttrPtr idNode = xmlGetID(document(), (const xmlChar*)(href().utf8().data())); + if (!idNode) + return; + stylesheetRoot = idNode->parent; + } else { + // FIXME: Need to handle an external URI with a # in it. This is a pretty minor edge case, so we'll deal + // with it later. + } + + if (stylesheetRoot) { + // Walk the children of the root element and look for import/include elements. + // Imports must occur first. + xmlNodePtr curr = stylesheetRoot->children; + while (curr) { + if (curr->type != XML_ELEMENT_NODE) { + curr = curr->next; + continue; + } + if (IS_XSLT_ELEM(curr) && IS_XSLT_NAME(curr, "import")) { + xmlChar* uriRef = xsltGetNsProp(curr, (const xmlChar*)"href", XSLT_NAMESPACE); + loadChildSheet(String::fromUTF8((const char*)uriRef)); + xmlFree(uriRef); + } else + break; + curr = curr->next; + } + + // Now handle includes. + while (curr) { + if (curr->type == XML_ELEMENT_NODE && IS_XSLT_ELEM(curr) && IS_XSLT_NAME(curr, "include")) { + xmlChar* uriRef = xsltGetNsProp(curr, (const xmlChar*)"href", XSLT_NAMESPACE); + loadChildSheet(String::fromUTF8((const char*)uriRef)); + xmlFree(uriRef); + } + curr = curr->next; + } + } +} + +void XSLStyleSheet::loadChildSheet(const String& href) +{ + RefPtr childRule = XSLImportRule::create(this, href); + append(childRule); + childRule->loadSheet(); +} + +xsltStylesheetPtr XSLStyleSheet::compileStyleSheet() +{ + // FIXME: Hook up error reporting for the stylesheet compilation process. + if (m_embedded) + return xsltLoadStylesheetPI(document()); + + // xsltParseStylesheetDoc makes the document part of the stylesheet + // so we have to release our pointer to it. + ASSERT(!m_stylesheetDocTaken); + xsltStylesheetPtr result = xsltParseStylesheetDoc(m_stylesheetDoc); + if (result) + m_stylesheetDocTaken = true; + return result; +} + +void XSLStyleSheet::setParentStyleSheet(XSLStyleSheet* parent) +{ + m_parentStyleSheet = parent; + if (parent) + m_ownerDocument = parent->ownerDocument(); +} + +xmlDocPtr XSLStyleSheet::locateStylesheetSubResource(xmlDocPtr parentDoc, const xmlChar* uri) +{ + bool matchedParent = (parentDoc == document()); + unsigned len = length(); + for (unsigned i = 0; i < len; ++i) { + StyleBase* rule = item(i); + if (rule->isImportRule()) { + XSLImportRule* import = static_cast(rule); + XSLStyleSheet* child = import->styleSheet(); + if (!child) + continue; + if (matchedParent) { + if (child->processed()) + continue; // libxslt has been given this sheet already. + + // Check the URI of the child stylesheet against the doc URI. + // In order to ensure that libxml canonicalized both URLs, we get the original href + // string from the import rule and canonicalize it using libxml before comparing it + // with the URI argument. + CString importHref = import->href().utf8(); + xmlChar* base = xmlNodeGetBase(parentDoc, (xmlNodePtr)parentDoc); + xmlChar* childURI = xmlBuildURI((const xmlChar*)importHref.data(), base); + bool equalURIs = xmlStrEqual(uri, childURI); + xmlFree(base); + xmlFree(childURI); + if (equalURIs) { + child->markAsProcessed(); + return child->document(); + } + } else { + xmlDocPtr result = import->styleSheet()->locateStylesheetSubResource(parentDoc, uri); + if (result) + return result; + } + } + } + + return 0; +} + +void XSLStyleSheet::markAsProcessed() +{ + ASSERT(!m_processed); + ASSERT(!m_stylesheetDocTaken); + m_processed = true; + m_stylesheetDocTaken = true; +} + +} // namespace WebCore + +#endif // ENABLE(XSLT) diff --git a/src/3rdparty/webkit/WebCore/xml/XSLStyleSheetQt.cpp b/src/3rdparty/webkit/WebCore/xml/XSLStyleSheetQt.cpp new file mode 100644 index 0000000..9fada0e --- /dev/null +++ b/src/3rdparty/webkit/WebCore/xml/XSLStyleSheetQt.cpp @@ -0,0 +1,103 @@ +/* + * This file is part of the XSL implementation. + * + * Copyright (C) 2009 Jakub Wieczorek + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public License + * along with this library; see the file COPYING.LIB. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#include "config.h" +#include "XSLStyleSheet.h" + +#if ENABLE(XSLT) + +#include "DOMWindow.h" +#include "Document.h" +#include "Node.h" +#include "NotImplemented.h" +#include "XSLTProcessor.h" +#include "loader.h" + +namespace WebCore { + +XSLStyleSheet::XSLStyleSheet(Node* parentNode, const String& href, bool embedded) + : StyleSheet(parentNode, href) + , m_ownerDocument(parentNode->document()) + , m_embedded(embedded) +{ +} + +XSLStyleSheet::~XSLStyleSheet() +{ +} + +bool XSLStyleSheet::isLoading() +{ + notImplemented(); + return false; +} + +void XSLStyleSheet::checkLoaded() +{ + if (ownerNode()) + ownerNode()->sheetLoaded(); +} + +void XSLStyleSheet::clearDocuments() +{ + notImplemented(); +} + +DocLoader* XSLStyleSheet::docLoader() +{ + if (!m_ownerDocument) + return 0; + return m_ownerDocument->docLoader(); +} + +bool XSLStyleSheet::parseString(const String& string, bool) +{ + // FIXME: Fix QXmlQuery so that it allows compiling the stylesheet before setting the document + // to be transformed. This way we could not only check if the stylesheet is correct before using it + // but also turn XSLStyleSheet::sheetString() into XSLStyleSheet::query() that returns a QXmlQuery. + + m_sheetString = string; + return !m_sheetString.isEmpty(); +} + +void XSLStyleSheet::loadChildSheets() +{ + notImplemented(); +} + +void XSLStyleSheet::loadChildSheet(const String& href) +{ + notImplemented(); +} + +void XSLStyleSheet::setParentStyleSheet(XSLStyleSheet* parent) +{ + notImplemented(); +} + +void XSLStyleSheet::markAsProcessed() +{ + notImplemented(); +} + +} // namespace WebCore + +#endif // ENABLE(XSLT) diff --git a/src/3rdparty/webkit/WebCore/xml/XSLTProcessor.cpp b/src/3rdparty/webkit/WebCore/xml/XSLTProcessor.cpp index 8eaef67..b182243 100644 --- a/src/3rdparty/webkit/WebCore/xml/XSLTProcessor.cpp +++ b/src/3rdparty/webkit/WebCore/xml/XSLTProcessor.cpp @@ -26,10 +26,7 @@ #include "XSLTProcessor.h" -#include "CString.h" -#include "Console.h" #include "DOMImplementation.h" -#include "DOMWindow.h" #include "DocLoader.h" #include "DocumentFragment.h" #include "Frame.h" @@ -38,166 +35,17 @@ #include "HTMLDocument.h" #include "HTMLTokenizer.h" // for parseHTMLDocumentFragment #include "Page.h" -#include "ResourceError.h" -#include "ResourceHandle.h" -#include "ResourceRequest.h" -#include "ResourceResponse.h" #include "Text.h" #include "TextResourceDecoder.h" #include "XMLTokenizer.h" -#include "XSLTExtensions.h" -#include "XSLTUnicodeSort.h" #include "loader.h" #include "markup.h" -#include -#include -#include #include #include #include -#if PLATFORM(MAC) -#include "SoftLinking.h" - -SOFT_LINK_LIBRARY(libxslt); -SOFT_LINK(libxslt, xsltFreeStylesheet, void, (xsltStylesheetPtr sheet), (sheet)) -SOFT_LINK(libxslt, xsltFreeTransformContext, void, (xsltTransformContextPtr ctxt), (ctxt)) -SOFT_LINK(libxslt, xsltNewTransformContext, xsltTransformContextPtr, (xsltStylesheetPtr style, xmlDocPtr doc), (style, doc)) -SOFT_LINK(libxslt, xsltApplyStylesheetUser, xmlDocPtr, (xsltStylesheetPtr style, xmlDocPtr doc, const char** params, const char* output, FILE* profile, xsltTransformContextPtr userCtxt), (style, doc, params, output, profile, userCtxt)) -SOFT_LINK(libxslt, xsltQuoteUserParams, int, (xsltTransformContextPtr ctxt, const char** params), (ctxt, params)) -SOFT_LINK(libxslt, xsltSetCtxtSortFunc, void, (xsltTransformContextPtr ctxt, xsltSortFunc handler), (ctxt, handler)) -SOFT_LINK(libxslt, xsltSetLoaderFunc, void, (xsltDocLoaderFunc f), (f)) -SOFT_LINK(libxslt, xsltSaveResultTo, int, (xmlOutputBufferPtr buf, xmlDocPtr result, xsltStylesheetPtr style), (buf, result, style)) -SOFT_LINK(libxslt, xsltNextImport, xsltStylesheetPtr, (xsltStylesheetPtr style), (style)) -#endif - namespace WebCore { -void XSLTProcessor::genericErrorFunc(void*, const char*, ...) -{ - // It would be nice to do something with this error message. -} - -void XSLTProcessor::parseErrorFunc(void* userData, xmlError* error) -{ - Console* console = static_cast(userData); - if (!console) - return; - - MessageLevel level; - switch (error->level) { - case XML_ERR_NONE: - level = TipMessageLevel; - break; - case XML_ERR_WARNING: - level = WarningMessageLevel; - break; - case XML_ERR_ERROR: - case XML_ERR_FATAL: - default: - level = ErrorMessageLevel; - break; - } - - console->addMessage(XMLMessageSource, LogMessageType, level, error->message, error->line, error->file); -} - -// FIXME: There seems to be no way to control the ctxt pointer for loading here, thus we have globals. -static XSLTProcessor* globalProcessor = 0; -static DocLoader* globalDocLoader = 0; -static xmlDocPtr docLoaderFunc(const xmlChar* uri, - xmlDictPtr, - int options, - void* ctxt, - xsltLoadType type) -{ - if (!globalProcessor) - return 0; - - switch (type) { - case XSLT_LOAD_DOCUMENT: { - xsltTransformContextPtr context = (xsltTransformContextPtr)ctxt; - xmlChar* base = xmlNodeGetBase(context->document->doc, context->node); - KURL url(KURL(ParsedURLString, reinterpret_cast(base)), reinterpret_cast(uri)); - xmlFree(base); - ResourceError error; - ResourceResponse response; - - Vector data; - - bool requestAllowed = globalDocLoader->frame() && globalDocLoader->doc()->securityOrigin()->canRequest(url); - if (requestAllowed) { - globalDocLoader->frame()->loader()->loadResourceSynchronously(url, AllowStoredCredentials, error, response, data); - requestAllowed = globalDocLoader->doc()->securityOrigin()->canRequest(response.url()); - } - if (!requestAllowed) { - data.clear(); - globalDocLoader->printAccessDeniedMessage(url); - } - - Console* console = 0; - if (Frame* frame = globalProcessor->xslStylesheet()->ownerDocument()->frame()) - console = frame->domWindow()->console(); - xmlSetStructuredErrorFunc(console, XSLTProcessor::parseErrorFunc); - xmlSetGenericErrorFunc(console, XSLTProcessor::genericErrorFunc); - - // We don't specify an encoding here. Neither Gecko nor WinIE respects - // the encoding specified in the HTTP headers. - xmlDocPtr doc = xmlReadMemory(data.data(), data.size(), (const char*)uri, 0, options); - - xmlSetStructuredErrorFunc(0, 0); - xmlSetGenericErrorFunc(0, 0); - - return doc; - } - case XSLT_LOAD_STYLESHEET: - return globalProcessor->xslStylesheet()->locateStylesheetSubResource(((xsltStylesheetPtr)ctxt)->doc, uri); - default: - break; - } - - return 0; -} - -static inline void setXSLTLoadCallBack(xsltDocLoaderFunc func, XSLTProcessor* processor, DocLoader* loader) -{ - xsltSetLoaderFunc(func); - globalProcessor = processor; - globalDocLoader = loader; -} - -static int writeToVector(void* context, const char* buffer, int len) -{ - Vector& resultOutput = *static_cast*>(context); - String decodedChunk = String::fromUTF8(buffer, len); - resultOutput.append(decodedChunk.characters(), decodedChunk.length()); - return len; -} - -static bool saveResultToString(xmlDocPtr resultDoc, xsltStylesheetPtr sheet, String& resultString) -{ - xmlOutputBufferPtr outputBuf = xmlAllocOutputBuffer(0); - if (!outputBuf) - return false; - - Vector resultVector; - outputBuf->context = &resultVector; - outputBuf->writecallback = writeToVector; - - int retval = xsltSaveResultTo(outputBuf, resultDoc, sheet); - xmlOutputBufferClose(outputBuf); - if (retval < 0) - return false; - - // Workaround for : libxslt appends an extra line feed to the result. - if (resultVector.size() > 0 && resultVector[resultVector.size() - 1] == '\n') - resultVector.removeLast(); - - resultString = String::adopt(resultVector); - - return true; -} - static inline void transformTextStringToXHTMLDocumentString(String& text) { // Modify the output so that it is a well-formed XHTML document with a
 tag enclosing the text.
@@ -213,38 +61,6 @@ static inline void transformTextStringToXHTMLDocumentString(String& text)
         "\n";
 }
 
-static const char** xsltParamArrayFromParameterMap(XSLTProcessor::ParameterMap& parameters)
-{
-    if (parameters.isEmpty())
-        return 0;
-
-    const char** parameterArray = (const char**)fastMalloc(((parameters.size() * 2) + 1) * sizeof(char*));
-
-    XSLTProcessor::ParameterMap::iterator end = parameters.end();
-    unsigned index = 0;
-    for (XSLTProcessor::ParameterMap::iterator it = parameters.begin(); it != end; ++it) {
-        parameterArray[index++] = strdup(it->first.utf8().data());
-        parameterArray[index++] = strdup(it->second.utf8().data());
-    }
-    parameterArray[index] = 0;
-
-    return parameterArray;
-}
-
-static void freeXsltParamArray(const char** params)
-{
-    const char** temp = params;
-    if (!params)
-        return;
-    
-    while (*temp) {
-        free((void*)*(temp++)); // strdup returns malloc'd blocks, so we have to use free() here
-        free((void*)*(temp++));
-    }
-    fastFree(params);
-}
-
-
 PassRefPtr XSLTProcessor::createDocumentFromSource(const String& sourceString,
     const String& sourceEncoding, const String& sourceMIMEType, Node* sourceNode, Frame* frame)
 {
@@ -258,7 +74,7 @@ PassRefPtr XSLTProcessor::createDocumentFromSource(const String& sourc
         transformTextStringToXHTMLDocumentString(documentSource);
     } else
         result = ownerDocument->implementation()->createDocument(sourceMIMEType, frame, false);
-    
+
     // Before parsing, we need to save & detach the old document and get the new document
     // in place. We have to do this only if we're rendering the result document.
     if (frame) {
@@ -267,15 +83,15 @@ PassRefPtr XSLTProcessor::createDocumentFromSource(const String& sourc
         result->setTransformSourceDocument(frame->document());
         frame->setDocument(result);
     }
-    
+
     if (sourceIsDocument)
         result->setURL(ownerDocument->url());
     result->open();
-    
+
     RefPtr decoder = TextResourceDecoder::create(sourceMIMEType);
     decoder->setEncoding(sourceEncoding.isEmpty() ? UTF8Encoding() : TextEncoding(sourceEncoding), TextResourceDecoder::EncodingFromXMLHeader);
     result->setDecoder(decoder.release());
-    
+
     result->write(documentSource);
     result->finishParsing();
     result->close();
@@ -286,7 +102,7 @@ PassRefPtr XSLTProcessor::createDocumentFromSource(const String& sourc
 static inline RefPtr createFragmentFromSource(const String& sourceString, const String& sourceMIMEType, Document* outputDoc)
 {
     RefPtr fragment = DocumentFragment::create(outputDoc);
-    
+
     if (sourceMIMEType == "text/html")
         parseHTMLDocumentFragment(sourceString, fragment.get());
     else if (sourceMIMEType == "text/plain")
@@ -296,118 +112,10 @@ static inline RefPtr createFragmentFromSource(const String& so
         if (!successfulParse)
             return 0;
     }
-    
-    // FIXME: Do we need to mess with URLs here?
-        
-    return fragment;
-}
-
-static xsltStylesheetPtr xsltStylesheetPointer(RefPtr& cachedStylesheet, Node* stylesheetRootNode)
-{
-    if (!cachedStylesheet && stylesheetRootNode) {
-        cachedStylesheet = XSLStyleSheet::create(stylesheetRootNode->parent() ? stylesheetRootNode->parent() : stylesheetRootNode,
-            stylesheetRootNode->document()->url().string());
-        cachedStylesheet->parseString(createMarkup(stylesheetRootNode));
-    }
-    
-    if (!cachedStylesheet || !cachedStylesheet->document())
-        return 0;
-    
-    return cachedStylesheet->compileStyleSheet();
-}
 
-static inline xmlDocPtr xmlDocPtrFromNode(Node* sourceNode, bool& shouldDelete)
-{
-    RefPtr ownerDocument = sourceNode->document();
-    bool sourceIsDocument = (sourceNode == ownerDocument.get());
-    
-    xmlDocPtr sourceDoc = 0;
-    if (sourceIsDocument)
-        sourceDoc = (xmlDocPtr)ownerDocument->transformSource();
-    if (!sourceDoc) {
-        sourceDoc = (xmlDocPtr)xmlDocPtrForString(ownerDocument->docLoader(), createMarkup(sourceNode),
-            sourceIsDocument ? ownerDocument->url().string() : String());
-        shouldDelete = (sourceDoc != 0);
-    }
-    return sourceDoc;
-}
-
-static inline String resultMIMEType(xmlDocPtr resultDoc, xsltStylesheetPtr sheet)
-{
-    // There are three types of output we need to be able to deal with:
-    // HTML (create an HTML document), XML (create an XML document),
-    // and text (wrap in a 
 and create an XML document).
-
-    const xmlChar* resultType = 0;
-    XSLT_GET_IMPORT_PTR(resultType, sheet, method);
-    if (resultType == 0 && resultDoc->type == XML_HTML_DOCUMENT_NODE)
-        resultType = (const xmlChar*)"html";
-    
-    if (xmlStrEqual(resultType, (const xmlChar*)"html"))
-        return "text/html";
-    else if (xmlStrEqual(resultType, (const xmlChar*)"text"))
-        return "text/plain";
-        
-    return "application/xml";
-}
-
-bool XSLTProcessor::transformToString(Node* sourceNode, String& mimeType, String& resultString, String& resultEncoding)
-{
-    RefPtr ownerDocument = sourceNode->document();
-    
-    setXSLTLoadCallBack(docLoaderFunc, this, ownerDocument->docLoader());
-    xsltStylesheetPtr sheet = xsltStylesheetPointer(m_stylesheet, m_stylesheetRootNode.get());
-    if (!sheet) {
-        setXSLTLoadCallBack(0, 0, 0);
-        return false;
-    }
-    m_stylesheet->clearDocuments();
-
-    xmlChar* origMethod = sheet->method;
-    if (!origMethod && mimeType == "text/html")
-        sheet->method = (xmlChar*)"html";
-
-    bool success = false;
-    bool shouldFreeSourceDoc = false;
-    if (xmlDocPtr sourceDoc = xmlDocPtrFromNode(sourceNode, shouldFreeSourceDoc)) {
-        // The XML declaration would prevent parsing the result as a fragment, and it's not needed even for documents, 
-        // as the result of this function is always immediately parsed.
-        sheet->omitXmlDeclaration = true;
-
-        xsltTransformContextPtr transformContext = xsltNewTransformContext(sheet, sourceDoc);
-        registerXSLTExtensions(transformContext);
-
-        // : XSLT processor  algorithm only compares by code point
-        xsltSetCtxtSortFunc(transformContext, xsltUnicodeSortFunction);
-
-        // This is a workaround for a bug in libxslt. 
-        // The bug has been fixed in version 1.1.13, so once we ship that this can be removed.
-        if (transformContext->globalVars == NULL)
-           transformContext->globalVars = xmlHashCreate(20);
-
-        const char** params = xsltParamArrayFromParameterMap(m_parameters);
-        xsltQuoteUserParams(transformContext, params);
-        xmlDocPtr resultDoc = xsltApplyStylesheetUser(sheet, sourceDoc, 0, 0, 0, transformContext);
-        
-        xsltFreeTransformContext(transformContext);        
-        freeXsltParamArray(params);
-        
-        if (shouldFreeSourceDoc)
-            xmlFreeDoc(sourceDoc);
-        
-        if (success = saveResultToString(resultDoc, sheet, resultString)) {
-            mimeType = resultMIMEType(resultDoc, sheet);
-            resultEncoding = (char*)resultDoc->encoding;
-        }
-        xmlFreeDoc(resultDoc);
-    }
-    
-    sheet->method = origMethod;
-    setXSLTLoadCallBack(0, 0, 0);
-    xsltFreeStylesheet(sheet);
-    m_stylesheet = 0;
+    // FIXME: Do we need to mess with URLs here?
 
-    return success;
+    return fragment;
 }
 
 PassRefPtr XSLTProcessor::transformToDocument(Node* sourceNode)
@@ -429,7 +137,7 @@ PassRefPtr XSLTProcessor::transformToFragment(Node* sourceNode
     // If the output document is HTML, default to HTML method.
     if (outputDoc->isHTMLDocument())
         resultMIMEType = "text/html";
-    
+
     if (!transformToString(sourceNode, resultMIMEType, resultString, resultEncoding))
         return 0;
     return createFragmentFromSource(resultString, resultMIMEType, outputDoc);
@@ -455,6 +163,13 @@ void XSLTProcessor::removeParameter(const String& /*namespaceURI*/, const String
     m_parameters.remove(localName);
 }
 
+void XSLTProcessor::reset()
+{
+    m_stylesheet.clear();
+    m_stylesheetRootNode.clear();
+    m_parameters.clear();
+}
+
 } // namespace WebCore
 
 #endif // ENABLE(XSLT)
diff --git a/src/3rdparty/webkit/WebCore/xml/XSLTProcessor.h b/src/3rdparty/webkit/WebCore/xml/XSLTProcessor.h
index 9ee2aad..9b91017 100644
--- a/src/3rdparty/webkit/WebCore/xml/XSLTProcessor.h
+++ b/src/3rdparty/webkit/WebCore/xml/XSLTProcessor.h
@@ -28,9 +28,12 @@
 #include "Node.h"
 #include "StringHash.h"
 #include "XSLStyleSheet.h"
+#include 
+
+#if !USE(QXMLQUERY)
 #include 
 #include 
-#include 
+#endif
 
 namespace WebCore {
 
@@ -56,14 +59,15 @@ public:
     void removeParameter(const String& namespaceURI, const String& localName);
     void clearParameters() { m_parameters.clear(); }
 
-    void reset() { m_stylesheet.clear(); m_stylesheetRootNode.clear();  m_parameters.clear(); }
+    void reset();
 
+#if !USE(QXMLQUERY)
     static void parseErrorFunc(void* userData, xmlError*);
     static void genericErrorFunc(void* userData, const char* msg, ...);
     
-public:
     // Only for libXSLT callbacks
     XSLStyleSheet* xslStylesheet() const { return m_stylesheet.get(); }
+#endif
 
     typedef HashMap ParameterMap;
 
diff --git a/src/3rdparty/webkit/WebCore/xml/XSLTProcessorLibxslt.cpp b/src/3rdparty/webkit/WebCore/xml/XSLTProcessorLibxslt.cpp
new file mode 100644
index 0000000..200c56b
--- /dev/null
+++ b/src/3rdparty/webkit/WebCore/xml/XSLTProcessorLibxslt.cpp
@@ -0,0 +1,335 @@
+/*
+ * This file is part of the XSL implementation.
+ *
+ * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple, Inc. All rights reserved.
+ * Copyright (C) 2005, 2006 Alexey Proskuryakov 
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "config.h"
+
+#if ENABLE(XSLT)
+
+#include "XSLTProcessor.h"
+
+#include "Console.h"
+#include "CString.h"
+#include "DOMWindow.h"
+#include "DocLoader.h"
+#include "Frame.h"
+#include "ResourceError.h"
+#include "ResourceHandle.h"
+#include "ResourceRequest.h"
+#include "ResourceResponse.h"
+#include "TransformSource.h"
+#include "XMLTokenizer.h"
+#include "XSLStyleSheet.h"
+#include "XSLTExtensions.h"
+#include "XSLTUnicodeSort.h"
+#include "loader.h"
+#include "markup.h"
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#if PLATFORM(MAC)
+#include "SoftLinking.h"
+
+SOFT_LINK_LIBRARY(libxslt);
+SOFT_LINK(libxslt, xsltFreeStylesheet, void, (xsltStylesheetPtr sheet), (sheet))
+SOFT_LINK(libxslt, xsltFreeTransformContext, void, (xsltTransformContextPtr ctxt), (ctxt))
+SOFT_LINK(libxslt, xsltNewTransformContext, xsltTransformContextPtr, (xsltStylesheetPtr style, xmlDocPtr doc), (style, doc))
+SOFT_LINK(libxslt, xsltApplyStylesheetUser, xmlDocPtr, (xsltStylesheetPtr style, xmlDocPtr doc, const char** params, const char* output, FILE* profile, xsltTransformContextPtr userCtxt), (style, doc, params, output, profile, userCtxt))
+SOFT_LINK(libxslt, xsltQuoteUserParams, int, (xsltTransformContextPtr ctxt, const char** params), (ctxt, params))
+SOFT_LINK(libxslt, xsltSetCtxtSortFunc, void, (xsltTransformContextPtr ctxt, xsltSortFunc handler), (ctxt, handler))
+SOFT_LINK(libxslt, xsltSetLoaderFunc, void, (xsltDocLoaderFunc f), (f))
+SOFT_LINK(libxslt, xsltSaveResultTo, int, (xmlOutputBufferPtr buf, xmlDocPtr result, xsltStylesheetPtr style), (buf, result, style))
+SOFT_LINK(libxslt, xsltNextImport, xsltStylesheetPtr, (xsltStylesheetPtr style), (style))
+#endif
+
+namespace WebCore {
+
+void XSLTProcessor::genericErrorFunc(void*, const char*, ...)
+{
+    // It would be nice to do something with this error message.
+}
+
+void XSLTProcessor::parseErrorFunc(void* userData, xmlError* error)
+{
+    Console* console = static_cast(userData);
+    if (!console)
+        return;
+
+    MessageLevel level;
+    switch (error->level) {
+    case XML_ERR_NONE:
+        level = TipMessageLevel;
+        break;
+    case XML_ERR_WARNING:
+        level = WarningMessageLevel;
+        break;
+    case XML_ERR_ERROR:
+    case XML_ERR_FATAL:
+    default:
+        level = ErrorMessageLevel;
+        break;
+    }
+
+    console->addMessage(XMLMessageSource, LogMessageType, level, error->message, error->line, error->file);
+}
+
+// FIXME: There seems to be no way to control the ctxt pointer for loading here, thus we have globals.
+static XSLTProcessor* globalProcessor = 0;
+static DocLoader* globalDocLoader = 0;
+static xmlDocPtr docLoaderFunc(const xmlChar* uri,
+                                    xmlDictPtr,
+                                    int options,
+                                    void* ctxt,
+                                    xsltLoadType type)
+{
+    if (!globalProcessor)
+        return 0;
+
+    switch (type) {
+    case XSLT_LOAD_DOCUMENT: {
+        xsltTransformContextPtr context = (xsltTransformContextPtr)ctxt;
+        xmlChar* base = xmlNodeGetBase(context->document->doc, context->node);
+        KURL url(KURL(ParsedURLString, reinterpret_cast(base)), reinterpret_cast(uri));
+        xmlFree(base);
+        ResourceError error;
+        ResourceResponse response;
+
+        Vector data;
+
+        bool requestAllowed = globalDocLoader->frame() && globalDocLoader->doc()->securityOrigin()->canRequest(url);
+        if (requestAllowed) {
+            globalDocLoader->frame()->loader()->loadResourceSynchronously(url, AllowStoredCredentials, error, response, data);
+            requestAllowed = globalDocLoader->doc()->securityOrigin()->canRequest(response.url());
+        }
+        if (!requestAllowed) {
+            data.clear();
+            globalDocLoader->printAccessDeniedMessage(url);
+        }
+
+        Console* console = 0;
+        if (Frame* frame = globalProcessor->xslStylesheet()->ownerDocument()->frame())
+            console = frame->domWindow()->console();
+        xmlSetStructuredErrorFunc(console, XSLTProcessor::parseErrorFunc);
+        xmlSetGenericErrorFunc(console, XSLTProcessor::genericErrorFunc);
+
+        // We don't specify an encoding here. Neither Gecko nor WinIE respects
+        // the encoding specified in the HTTP headers.
+        xmlDocPtr doc = xmlReadMemory(data.data(), data.size(), (const char*)uri, 0, options);
+
+        xmlSetStructuredErrorFunc(0, 0);
+        xmlSetGenericErrorFunc(0, 0);
+
+        return doc;
+    }
+    case XSLT_LOAD_STYLESHEET:
+        return globalProcessor->xslStylesheet()->locateStylesheetSubResource(((xsltStylesheetPtr)ctxt)->doc, uri);
+    default:
+        break;
+    }
+
+    return 0;
+}
+
+static inline void setXSLTLoadCallBack(xsltDocLoaderFunc func, XSLTProcessor* processor, DocLoader* loader)
+{
+    xsltSetLoaderFunc(func);
+    globalProcessor = processor;
+    globalDocLoader = loader;
+}
+
+static int writeToVector(void* context, const char* buffer, int len)
+{
+    Vector& resultOutput = *static_cast*>(context);
+    String decodedChunk = String::fromUTF8(buffer, len);
+    resultOutput.append(decodedChunk.characters(), decodedChunk.length());
+    return len;
+}
+
+static bool saveResultToString(xmlDocPtr resultDoc, xsltStylesheetPtr sheet, String& resultString)
+{
+    xmlOutputBufferPtr outputBuf = xmlAllocOutputBuffer(0);
+    if (!outputBuf)
+        return false;
+
+    Vector resultVector;
+    outputBuf->context = &resultVector;
+    outputBuf->writecallback = writeToVector;
+
+    int retval = xsltSaveResultTo(outputBuf, resultDoc, sheet);
+    xmlOutputBufferClose(outputBuf);
+    if (retval < 0)
+        return false;
+
+    // Workaround for : libxslt appends an extra line feed to the result.
+    if (resultVector.size() > 0 && resultVector[resultVector.size() - 1] == '\n')
+        resultVector.removeLast();
+
+    resultString = String::adopt(resultVector);
+
+    return true;
+}
+
+static const char** xsltParamArrayFromParameterMap(XSLTProcessor::ParameterMap& parameters)
+{
+    if (parameters.isEmpty())
+        return 0;
+
+    const char** parameterArray = (const char**)fastMalloc(((parameters.size() * 2) + 1) * sizeof(char*));
+
+    XSLTProcessor::ParameterMap::iterator end = parameters.end();
+    unsigned index = 0;
+    for (XSLTProcessor::ParameterMap::iterator it = parameters.begin(); it != end; ++it) {
+        parameterArray[index++] = strdup(it->first.utf8().data());
+        parameterArray[index++] = strdup(it->second.utf8().data());
+    }
+    parameterArray[index] = 0;
+
+    return parameterArray;
+}
+
+static void freeXsltParamArray(const char** params)
+{
+    const char** temp = params;
+    if (!params)
+        return;
+
+    while (*temp) {
+        free((void*)*(temp++)); // strdup returns malloc'd blocks, so we have to use free() here
+        free((void*)*(temp++));
+    }
+    fastFree(params);
+}
+
+static xsltStylesheetPtr xsltStylesheetPointer(RefPtr& cachedStylesheet, Node* stylesheetRootNode)
+{
+    if (!cachedStylesheet && stylesheetRootNode) {
+        cachedStylesheet = XSLStyleSheet::create(stylesheetRootNode->parent() ? stylesheetRootNode->parent() : stylesheetRootNode,
+            stylesheetRootNode->document()->url().string());
+        cachedStylesheet->parseString(createMarkup(stylesheetRootNode));
+    }
+
+    if (!cachedStylesheet || !cachedStylesheet->document())
+        return 0;
+
+    return cachedStylesheet->compileStyleSheet();
+}
+
+static inline xmlDocPtr xmlDocPtrFromNode(Node* sourceNode, bool& shouldDelete)
+{
+    RefPtr ownerDocument = sourceNode->document();
+    bool sourceIsDocument = (sourceNode == ownerDocument.get());
+
+    xmlDocPtr sourceDoc = 0;
+    if (sourceIsDocument && ownerDocument->transformSource())
+        sourceDoc = (xmlDocPtr)ownerDocument->transformSource()->platformSource();
+    if (!sourceDoc) {
+        sourceDoc = (xmlDocPtr)xmlDocPtrForString(ownerDocument->docLoader(), createMarkup(sourceNode),
+            sourceIsDocument ? ownerDocument->url().string() : String());
+        shouldDelete = sourceDoc;
+    }
+    return sourceDoc;
+}
+
+static inline String resultMIMEType(xmlDocPtr resultDoc, xsltStylesheetPtr sheet)
+{
+    // There are three types of output we need to be able to deal with:
+    // HTML (create an HTML document), XML (create an XML document),
+    // and text (wrap in a 
 and create an XML document).
+
+    const xmlChar* resultType = 0;
+    XSLT_GET_IMPORT_PTR(resultType, sheet, method);
+    if (!resultType && resultDoc->type == XML_HTML_DOCUMENT_NODE)
+        resultType = (const xmlChar*)"html";
+
+    if (xmlStrEqual(resultType, (const xmlChar*)"html"))
+        return "text/html";
+    if (xmlStrEqual(resultType, (const xmlChar*)"text"))
+        return "text/plain";
+
+    return "application/xml";
+}
+
+bool XSLTProcessor::transformToString(Node* sourceNode, String& mimeType, String& resultString, String& resultEncoding)
+{
+    RefPtr ownerDocument = sourceNode->document();
+
+    setXSLTLoadCallBack(docLoaderFunc, this, ownerDocument->docLoader());
+    xsltStylesheetPtr sheet = xsltStylesheetPointer(m_stylesheet, m_stylesheetRootNode.get());
+    if (!sheet) {
+        setXSLTLoadCallBack(0, 0, 0);
+        return false;
+    }
+    m_stylesheet->clearDocuments();
+
+    xmlChar* origMethod = sheet->method;
+    if (!origMethod && mimeType == "text/html")
+        sheet->method = (xmlChar*)"html";
+
+    bool success = false;
+    bool shouldFreeSourceDoc = false;
+    if (xmlDocPtr sourceDoc = xmlDocPtrFromNode(sourceNode, shouldFreeSourceDoc)) {
+        // The XML declaration would prevent parsing the result as a fragment, and it's not needed even for documents,
+        // as the result of this function is always immediately parsed.
+        sheet->omitXmlDeclaration = true;
+
+        xsltTransformContextPtr transformContext = xsltNewTransformContext(sheet, sourceDoc);
+        registerXSLTExtensions(transformContext);
+
+        // : XSLT processor  algorithm only compares by code point
+        xsltSetCtxtSortFunc(transformContext, xsltUnicodeSortFunction);
+
+        // This is a workaround for a bug in libxslt.
+        // The bug has been fixed in version 1.1.13, so once we ship that this can be removed.
+        if (!transformContext->globalVars)
+           transformContext->globalVars = xmlHashCreate(20);
+
+        const char** params = xsltParamArrayFromParameterMap(m_parameters);
+        xsltQuoteUserParams(transformContext, params);
+        xmlDocPtr resultDoc = xsltApplyStylesheetUser(sheet, sourceDoc, 0, 0, 0, transformContext);
+
+        xsltFreeTransformContext(transformContext);
+        freeXsltParamArray(params);
+
+        if (shouldFreeSourceDoc)
+            xmlFreeDoc(sourceDoc);
+
+        if (success = saveResultToString(resultDoc, sheet, resultString)) {
+            mimeType = resultMIMEType(resultDoc, sheet);
+            resultEncoding = (char*)resultDoc->encoding;
+        }
+        xmlFreeDoc(resultDoc);
+    }
+
+    sheet->method = origMethod;
+    setXSLTLoadCallBack(0, 0, 0);
+    xsltFreeStylesheet(sheet);
+    m_stylesheet = 0;
+
+    return success;
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(XSLT)
diff --git a/src/3rdparty/webkit/WebCore/xml/XSLTProcessorQt.cpp b/src/3rdparty/webkit/WebCore/xml/XSLTProcessorQt.cpp
new file mode 100644
index 0000000..523306a
--- /dev/null
+++ b/src/3rdparty/webkit/WebCore/xml/XSLTProcessorQt.cpp
@@ -0,0 +1,149 @@
+/*
+ * This file is part of the XSL implementation.
+ *
+ * Copyright (C) 2009 Jakub Wieczorek 
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "config.h"
+
+#if ENABLE(XSLT)
+
+#include "XSLTProcessor.h"
+
+#include "Console.h"
+#include "DOMWindow.h"
+#include "Frame.h"
+#include "TransformSource.h"
+#include "loader.h"
+#include "markup.h"
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+
+namespace WebCore {
+
+class XSLTMessageHandler : public QAbstractMessageHandler {
+
+public:
+    XSLTMessageHandler(Document* document = 0);
+    virtual void handleMessage(QtMsgType type, const QString& description,
+                               const QUrl& identifier, const QSourceLocation& sourceLocation);
+
+private:
+    Document* m_document;
+};
+
+XSLTMessageHandler::XSLTMessageHandler(Document* document)
+    : QAbstractMessageHandler()
+    , m_document(document)
+{
+}
+
+void XSLTMessageHandler::handleMessage(QtMsgType type, const QString& description,
+                                       const QUrl& identifier, const QSourceLocation& sourceLocation)
+{
+    if (!m_document->frame())
+        return;
+
+    MessageLevel level;
+    switch (type) {
+    case QtDebugMsg:
+        level = TipMessageLevel;
+        break;
+    case QtWarningMsg:
+        level = WarningMessageLevel;
+        break;
+    case QtCriticalMsg:
+    case QtFatalMsg:
+        level = ErrorMessageLevel;
+        break;
+    default:
+        level = LogMessageLevel;
+        break;
+    }
+
+    Console* console = m_document->frame()->domWindow()->console();
+    console->addMessage(XMLMessageSource, LogMessageType, level, description,
+                        sourceLocation.line(), sourceLocation.uri().toString());
+}
+
+bool XSLTProcessor::transformToString(Node* sourceNode, String& mimeType, String& resultString, String& resultEncoding)
+{
+    bool success = false;
+
+    RefPtr stylesheet = m_stylesheet;
+    if (!stylesheet && m_stylesheetRootNode) {
+        Node* node = m_stylesheetRootNode.get();
+        stylesheet = XSLStyleSheet::create(node->parent() ? node->parent() : node, node->document()->url().string());
+        stylesheet->parseString(createMarkup(node));
+    }
+
+    if (!stylesheet || stylesheet->sheetString().isEmpty())
+        return success;
+
+    RefPtr ownerDocument = sourceNode->document();
+    bool sourceIsDocument = (sourceNode == ownerDocument.get());
+
+    QXmlQuery query(QXmlQuery::XSLT20);
+
+    XSLTMessageHandler messageHandler(ownerDocument.get());
+    query.setMessageHandler(&messageHandler);
+
+    XSLTProcessor::ParameterMap::iterator end = m_parameters.end();
+    for (XSLTProcessor::ParameterMap::iterator it = m_parameters.begin(); it != end; ++it)
+        query.bindVariable(QString(it->first), QXmlItem(QVariant(it->second)));
+
+    QString source;
+    if (sourceIsDocument && ownerDocument->transformSource())
+        source = ownerDocument->transformSource()->platformSource();
+    if (!sourceIsDocument || source.isEmpty())
+        source = createMarkup(sourceNode);
+
+    QBuffer inputBuffer;
+    QBuffer styleSheetBuffer;
+    QBuffer outputBuffer;
+
+    inputBuffer.setData(source.toUtf8());
+    styleSheetBuffer.setData(QString(stylesheet->sheetString()).toUtf8());
+
+    inputBuffer.open(QIODevice::ReadOnly);
+    styleSheetBuffer.open(QIODevice::ReadOnly);
+    outputBuffer.open(QIODevice::ReadWrite);
+
+    query.setFocus(&inputBuffer);
+    query.setQuery(&styleSheetBuffer, QUrl(stylesheet->href()));
+    success = query.evaluateTo(&outputBuffer);
+    outputBuffer.reset();
+    resultString = QString::fromUtf8(outputBuffer.readAll()).trimmed();
+
+    if (m_stylesheet) {
+        m_stylesheet->clearDocuments();
+        m_stylesheet = 0;
+    }
+
+    return success;
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(XSLT)
diff --git a/src/3rdparty/webkit/WebKit/ChangeLog b/src/3rdparty/webkit/WebKit/ChangeLog
index 7d55d82..2f8f18f 100644
--- a/src/3rdparty/webkit/WebKit/ChangeLog
+++ b/src/3rdparty/webkit/WebKit/ChangeLog
@@ -1,3 +1,23 @@
+2009-09-29  Brady Eidson  
+
+        Reviewed by John Sullivan.
+
+        WebKit Mac API should provide a delegate interface for global history.
+         and https://webkit.org/b/29904
+
+        * WebKit.xcodeproj/project.pbxproj:
+
+2009-09-28  Yaar Schnitman  
+
+        Reviewed by Dimitri Glazkov.
+
+        https://bugs.webkit.org/show_bug.cgi?id=29722
+
+        * chromium/DEPS: Describes the chromium port's dependencies and
+          is used by gclient to fetch them.
+        * chromium/webkit.gyp: Currently only builds webcore but in
+          the future will also build the webkit api.
+
 2009-09-26  David Kilzer  
 
         Part 2 of 2:  DerivedSources.make broken for non-Mac targets
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp
index 45a38c6..4b6248a 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp
@@ -1491,11 +1491,10 @@ QWebPage::QWebPage(QObject *parent)
 */
 QWebPage::~QWebPage()
 {
-    if (d->mainFrame) {
-        FrameLoader *loader = d->mainFrame->d->frame->loader();
-        if (loader)
-            loader->detachFromParent();
-    }
+    d->createMainFrame();
+    FrameLoader *loader = d->mainFrame->d->frame->loader();
+    if (loader)
+        loader->detachFromParent();
     if (d->inspector)
         d->inspector->setPage(0);
     delete d;
@@ -1936,6 +1935,7 @@ bool QWebPage::acceptNavigationRequest(QWebFrame *frame, const QWebNetworkReques
 */
 QString QWebPage::selectedText() const
 {
+    d->createMainFrame();
     return d->page->focusController()->focusedOrMainFrame()->selectedText();
 }
 
@@ -2491,6 +2491,7 @@ void QWebPage::updatePositionDependentActions(const QPoint &pos)
         }
     }
 
+    d->createMainFrame();
     WebCore::Frame* focusedFrame = d->page->focusController()->focusedOrMainFrame();
     HitTestResult result = focusedFrame->eventHandler()->hitTestResultAtPoint(focusedFrame->view()->windowToContents(pos), /*allowShadowContent*/ false);
 
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.h
index aecd860..b024997 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.h
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.h
@@ -25,12 +25,12 @@
 #include "qwebkitglobal.h"
 
 #include 
+#include 
 #include 
 
 QT_BEGIN_NAMESPACE
 class QNetworkProxy;
 class QUndoStack;
-class QUrl;
 class QMenu;
 class QNetworkRequest;
 class QNetworkReply;
@@ -266,7 +266,8 @@ public:
     QMenu *createStandardContextMenu();
 
     enum Extension {
-        ChooseMultipleFilesExtension
+        ChooseMultipleFilesExtension,
+        ErrorPageExtension
     };
     class ExtensionOption
     {};
@@ -284,6 +285,24 @@ public:
         QStringList fileNames;
     };
 
+    enum ErrorDomain { QtNetwork, Http, WebKit };
+    class ErrorPageExtensionOption : public ExtensionOption {
+    public:
+        ErrorDomain domain;
+        int error;
+        QString errorString;
+    };
+
+    class ErrorPageExtensionReturn : public ExtensionReturn {
+    public:
+        ErrorPageExtensionReturn() : contentType(QLatin1String("text/html")), encoding(QLatin1String("utf-8")) {};
+        QString contentType;
+        QString encoding;
+        QUrl baseUrl;
+        QByteArray content;
+    };
+
+
     virtual bool extension(Extension extension, const ExtensionOption *option = 0, ExtensionReturn *output = 0);
     virtual bool supportsExtension(Extension extension) const;
 
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.cpp
index 5f74f36..eedf7d1 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.cpp
@@ -356,8 +356,8 @@ QWebSettings::QWebSettings()
     // Initialize our global defaults
     d->fontSizes.insert(QWebSettings::MinimumFontSize, 0);
     d->fontSizes.insert(QWebSettings::MinimumLogicalFontSize, 0);
-    d->fontSizes.insert(QWebSettings::DefaultFontSize, 14);
-    d->fontSizes.insert(QWebSettings::DefaultFixedFontSize, 14);
+    d->fontSizes.insert(QWebSettings::DefaultFontSize, 16);
+    d->fontSizes.insert(QWebSettings::DefaultFixedFontSize, 13);
     d->fontFamilies.insert(QWebSettings::StandardFont, QLatin1String("Arial"));
     d->fontFamilies.insert(QWebSettings::FixedFont, QLatin1String("Courier New"));
     d->fontFamilies.insert(QWebSettings::SerifFont, QLatin1String("Times New Roman"));
diff --git a/src/3rdparty/webkit/WebKit/qt/ChangeLog b/src/3rdparty/webkit/WebKit/qt/ChangeLog
index a8b5c38..b252d8c 100644
--- a/src/3rdparty/webkit/WebKit/qt/ChangeLog
+++ b/src/3rdparty/webkit/WebKit/qt/ChangeLog
@@ -1,3 +1,76 @@
+2009-09-29  Andras Becsi  
+
+        Reviewed by Tor Arne Vestbø.
+
+        [Qt] Default font size reconciliation to 16px/13px to match other platform's de-facto standard.
+        This fixes https://bugs.webkit.org/show_bug.cgi?id=19674.
+
+        * Api/qwebsettings.cpp:
+        (QWebSettings::QWebSettings):
+
+2009-09-29  Jedrzej Nowacki  
+
+        Reviewed by Simon Hausmann.
+
+        https://bugs.webkit.org/show_bug.cgi?id=29844
+
+        QWebPage dependency autotest fix.
+
+        Fix for database() autotest. All opened databases should be removed at
+        end of test.
+
+        * tests/qwebpage/tst_qwebpage.cpp:
+        (tst_QWebPage::database):
+
+2009-09-29  Jedrzej Nowacki  
+
+        Reviewed by Simon Hausmann.
+
+        Some QWebHistory and QWebPage autotest crash fixes.
+
+        Some checking for m_mainFrame were added. MainFrame should be created
+        at some point of QWebPage live cicle.
+
+        https://bugs.webkit.org/show_bug.cgi?id=29803
+
+        * Api/qwebpage.cpp:
+        (QWebPage::~QWebPage):
+        (QWebPage::currentFrame):
+        (QWebPage::history):
+        (QWebPage::selectedText):
+        (QWebPage::updatePositionDependentActions):
+        * tests/qwebpage/tst_qwebpage.cpp:
+        (tst_QWebPage::crashTests_LazyInitializationOfMainFrame):
+
+2009-09-29  Kenneth Rohde Christiansen  
+
+        Reviewed by Simon Hausmann and Tor Arne Vestbø.
+
+        Implement QWebPage Extension for error pages, incl.
+        an example on how to use it in QtLauncher.
+
+        Correct our use of ResourceError.
+
+        * Api/qwebpage.h:
+        (ExtensionOption::):
+        (ExtensionOption::ErrorPageExtensionReturn::ErrorPageExtensionReturn):
+        * QtLauncher/main.cpp:
+        (WebPage::supportsExtension):
+        (MainWindow::MainWindow):
+        (MainWindow::selectElements):
+        (WebPage::extension):
+        * WebCoreSupport/FrameLoaderClientQt.cpp:
+        (WebCore::FrameLoaderClientQt::cancelledError):
+        (WebCore::FrameLoaderClientQt::blockedError):
+        (WebCore::FrameLoaderClientQt::cannotShowURLError):
+        (WebCore::FrameLoaderClientQt::interruptForPolicyChangeError):
+        (WebCore::FrameLoaderClientQt::cannotShowMIMETypeError):
+        (WebCore::FrameLoaderClientQt::fileDoesNotExistError):
+        (WebCore::FrameLoaderClientQt::callErrorPageExtension):
+        (WebCore::FrameLoaderClientQt::dispatchDidFailProvisionalLoad):
+        (WebCore::FrameLoaderClientQt::dispatchDidFailLoad):
+        * WebCoreSupport/FrameLoaderClientQt.h:
+
 2009-09-28  Andre Poenitz  
 
         Reviewed by Simon Hausmann.
diff --git a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
index 0c636f6..67d974c 100644
--- a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
@@ -702,8 +702,10 @@ void FrameLoaderClientQt::committedLoad(WebCore::DocumentLoader* loader, const c
 
 WebCore::ResourceError FrameLoaderClientQt::cancelledError(const WebCore::ResourceRequest& request)
 {
-    return ResourceError("Error", -999, request.url().prettyURL(),
+    ResourceError error = ResourceError("QtNetwork", QNetworkReply::OperationCanceledError, request.url().prettyURL(),
             QCoreApplication::translate("QWebFrame", "Request cancelled", 0, QCoreApplication::UnicodeUTF8));
+    error.setIsCancellation(true);
+    return error;
 }
 
 // copied from WebKit/Misc/WebKitErrors[Private].h
@@ -719,32 +721,32 @@ enum {
 
 WebCore::ResourceError FrameLoaderClientQt::blockedError(const WebCore::ResourceRequest& request)
 {
-    return ResourceError("Error", WebKitErrorCannotUseRestrictedPort, request.url().prettyURL(),
+    return ResourceError("WebKit", WebKitErrorCannotUseRestrictedPort, request.url().prettyURL(),
             QCoreApplication::translate("QWebFrame", "Request blocked", 0, QCoreApplication::UnicodeUTF8));
 }
 
 
 WebCore::ResourceError FrameLoaderClientQt::cannotShowURLError(const WebCore::ResourceRequest& request)
 {
-    return ResourceError("Error", WebKitErrorCannotShowURL, request.url().string(),
+    return ResourceError("WebKit", WebKitErrorCannotShowURL, request.url().string(),
             QCoreApplication::translate("QWebFrame", "Cannot show URL", 0, QCoreApplication::UnicodeUTF8));
 }
 
 WebCore::ResourceError FrameLoaderClientQt::interruptForPolicyChangeError(const WebCore::ResourceRequest& request)
 {
-    return ResourceError("Error", WebKitErrorFrameLoadInterruptedByPolicyChange, request.url().string(),
+    return ResourceError("WebKit", WebKitErrorFrameLoadInterruptedByPolicyChange, request.url().string(),
             QCoreApplication::translate("QWebFrame", "Frame load interrupted by policy change", 0, QCoreApplication::UnicodeUTF8));
 }
 
 WebCore::ResourceError FrameLoaderClientQt::cannotShowMIMETypeError(const WebCore::ResourceResponse& response)
 {
-    return ResourceError("Error", WebKitErrorCannotShowMIMEType, response.url().string(),
+    return ResourceError("WebKit", WebKitErrorCannotShowMIMEType, response.url().string(),
             QCoreApplication::translate("QWebFrame", "Cannot show mimetype", 0, QCoreApplication::UnicodeUTF8));
 }
 
 WebCore::ResourceError FrameLoaderClientQt::fileDoesNotExistError(const WebCore::ResourceResponse& response)
 {
-    return ResourceError("Error", -998 /* ### */, response.url().string(),
+    return ResourceError("QtNetwork", QNetworkReply::ContentNotFoundError, response.url().string(),
             QCoreApplication::translate("QWebFrame", "File does not exist", 0, QCoreApplication::UnicodeUTF8));
 }
 
@@ -860,12 +862,46 @@ void FrameLoaderClientQt::dispatchDidLoadResourceByXMLHttpRequest(unsigned long,
     notImplemented();
 }
 
+void FrameLoaderClientQt::callErrorPageExtension(const WebCore::ResourceError& error)
+{
+    QWebPage* page = m_webFrame->page();
+    if (page->supportsExtension(QWebPage::ErrorPageExtension)) {
+        QWebPage::ErrorPageExtensionOption option;
+
+        if (error.domain() == "QtNetwork")
+            option.domain = QWebPage::QtNetwork;
+        else if (error.domain() == "HTTP")
+            option.domain = QWebPage::Http;
+        else if (error.domain() == "WebKit")
+            option.domain = QWebPage::WebKit;
+        else
+            return;
+
+        option.error = error.errorCode();
+        option.errorString = error.localizedDescription();
+
+        QWebPage::ErrorPageExtensionReturn output;
+        if (!page->extension(QWebPage::ErrorPageExtension, &option, &output))
+            return;
+
+        KURL baseUrl(output.baseUrl);
+        KURL failingUrl(QUrl(error.failingURL()));
+
+        WebCore::ResourceRequest request(baseUrl);
+        WTF::RefPtr buffer = WebCore::SharedBuffer::create(output.content.constData(), output.content.length());
+        WebCore::SubstituteData substituteData(buffer, output.contentType, output.encoding, failingUrl);
+        m_frame->loader()->load(request, substituteData, false);
+    }
+}
+
 void FrameLoaderClientQt::dispatchDidFailProvisionalLoad(const WebCore::ResourceError& error)
 {
     if (dumpFrameLoaderCallbacks)
         printf("%s - didFailProvisionalLoadWithError\n", qPrintable(drtDescriptionSuitableForTestResult(m_frame)));
 
     m_loadError = error;
+    if (!error.isNull() && !error.isCancellation())
+        callErrorPageExtension(error);
 }
 
 void FrameLoaderClientQt::dispatchDidFailLoad(const WebCore::ResourceError& error)
@@ -874,6 +910,8 @@ void FrameLoaderClientQt::dispatchDidFailLoad(const WebCore::ResourceError& erro
         printf("%s - didFailLoadWithError\n", qPrintable(drtDescriptionSuitableForTestResult(m_frame)));
 
     m_loadError = error;
+    if (!error.isNull() && !error.isCancellation())
+        callErrorPageExtension(error);
 }
 
 WebCore::Frame* FrameLoaderClientQt::dispatchCreatePage()
diff --git a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h
index 8a7e428..66c4252 100644
--- a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h
+++ b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h
@@ -59,6 +59,7 @@ namespace WebCore {
 
         friend class ::QWebFrame;
         void callPolicyFunction(FramePolicyFunction function, PolicyAction action);
+        void callErrorPageExtension(const ResourceError&);
     signals:
         void loadStarted();
         void loadProgress(int d);
diff --git a/src/3rdparty/webkit/WebKit/qt/docs/webkitsnippets/qtwebkit_qwebview_snippet.cpp b/src/3rdparty/webkit/WebKit/qt/docs/webkitsnippets/qtwebkit_qwebview_snippet.cpp
index 069bea2..f04cd29 100644
--- a/src/3rdparty/webkit/WebKit/qt/docs/webkitsnippets/qtwebkit_qwebview_snippet.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/docs/webkitsnippets/qtwebkit_qwebview_snippet.cpp
@@ -13,22 +13,22 @@ void wrapInFunction()
 
 
 //! [2]
-    view->triggerPageAction(QWebPage::Copy);
+    view->triggerAction(QWebPage::Copy);
 //! [2]
 
 
 //! [3]
-    view->page()->triggerAction(QWebPage::Stop);
+    view->page()->triggerPageAction(QWebPage::Stop);
 //! [3]
 
 
 //! [4]
-    view->page()->triggerAction(QWebPage::GoBack);
+    view->page()->triggerPageAction(QWebPage::GoBack);
 //! [4]
 
 
 //! [5]
-    view->page()->triggerAction(QWebPage::GoForward);
+    view->page()->triggerPageAction(QWebPage::GoForward);
 //! [5]
 
 }
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp b/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
index 0fb05b8..283950e 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
@@ -113,11 +113,9 @@ private slots:
     void localURLSchemes();
     void testOptionalJSObjects();
     void testEnablePersistentStorage();
-
     void consoleOutput();
 
-private:
-
+    void crashTests_LazyInitializationOfMainFrame();
 
 private:
     QWebView* m_view;
@@ -466,14 +464,19 @@ void tst_QWebPage::database()
     m_page->mainFrame()->evaluateJavaScript("var db3; db3=openDatabase('testdb', '1.0', 'test database API', 50000);db3.transaction(function(tx) { tx.executeSql('CREATE TABLE IF NOT EXISTS Test (text TEXT)', []); }, function(tx, result) { }, function(tx, error) { });");
     QTest::qWait(200);
 
+    // Remove all databases.
     QWebSecurityOrigin origin = m_page->mainFrame()->securityOrigin();
     QList dbs = origin.databases();
-    if (dbs.count() > 0) {
-        QString fileName = dbs[0].fileName();
+    for (int i = 0; i < dbs.count(); i++) {
+        QString fileName = dbs[i].fileName();
         QVERIFY(QFile::exists(fileName));
-        QWebDatabase::removeDatabase(dbs[0]);
+        QWebDatabase::removeDatabase(dbs[i]);
         QVERIFY(!QFile::exists(fileName));
     }
+    QVERIFY(!origin.databases().size());
+    // Remove removed test :-)
+    QWebDatabase::removeAllDatabases();
+    QVERIFY(!origin.databases().size());
     QTest::qWait(1000);
 }
 
@@ -1301,5 +1304,26 @@ void tst_QWebPage::testEnablePersistentStorage()
     QVERIFY(!webPage.settings()->iconDatabasePath().isEmpty());
 }
 
+void tst_QWebPage::crashTests_LazyInitializationOfMainFrame()
+{
+    {
+        QWebPage webPage;
+    }
+    {
+        QWebPage webPage;
+        webPage.selectedText();
+    }
+    {
+        QWebPage webPage;
+        webPage.triggerAction(QWebPage::Back, true);
+    }
+    {
+        QWebPage webPage;
+        QPoint pos(10,10);
+        webPage.updatePositionDependentActions(pos);
+    }
+}
+
+
 QTEST_MAIN(tst_QWebPage)
 #include "tst_qwebpage.moc"
-- 
cgit v0.12


From c40702827c53cea1f4e3d7fbcd060d9548cfd1a4 Mon Sep 17 00:00:00 2001
From: Volker Hilsheimer 
Date: Thu, 1 Oct 2009 10:56:13 +0200
Subject: Doc: gcc 3.4-based MinGW is downgraded to Tier 2 support, gcc 4.4 is
 Tier 1

---
 doc/src/platforms/supported-platforms.qdoc | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/doc/src/platforms/supported-platforms.qdoc b/doc/src/platforms/supported-platforms.qdoc
index 5f72ce3..f03f758 100644
--- a/doc/src/platforms/supported-platforms.qdoc
+++ b/doc/src/platforms/supported-platforms.qdoc
@@ -78,7 +78,7 @@
     \row    \o Linux (32 and 64-bit)
                                      \o gcc 4.2
     \row    \o Microsoft Windows XP
-                                     \o gcc 3.4.2 (MinGW) (32-bit), MSVC 2003, 2005 (32 and 64-bit)
+                                     \o gcc 4.4 (MinGW) (32-bit), MSVC 2003, 2005 (32 and 64-bit)
     \row    \o Microsoft Windows Vista
                                      \o MSVC 2005, 2008
     \row    \o Microsoft Windows Vista 64bit
@@ -104,6 +104,8 @@
     \table
     \header \o Platform
                                      \o Compilers
+    \row    \o Windows XP, Vista
+                                     \o gcc 3.4.2 (MinGW)
     \omit
     \row    \o Windows 7
                                      \o MSVC 2008
-- 
cgit v0.12


From e1496edf9e4dcec0f4e55fb320ec49dba9e548d5 Mon Sep 17 00:00:00 2001
From: Volker Hilsheimer 
Date: Thu, 1 Oct 2009 11:54:28 +0200
Subject: Doc: add graphics effects and XML Schema Validation support.

Also add links to relevant APIs or documents for each block.

Missing: Qt on Symbian
---
 doc/src/qt4-intro.qdoc | 65 ++++++++++++++++++++++++++++++++++++++------------
 1 file changed, 50 insertions(+), 15 deletions(-)

diff --git a/doc/src/qt4-intro.qdoc b/doc/src/qt4-intro.qdoc
index eafae14..be4cb48 100644
--- a/doc/src/qt4-intro.qdoc
+++ b/doc/src/qt4-intro.qdoc
@@ -464,6 +464,7 @@
     previous releases in the Qt 4 series. This document covers the
     most important features in this release, separated by category.
 
+\omit
     A comprehensive list of changes between Qt 4.5 and Qt 4.6 is
     included in the \c changes-4.6.0 file
     \l{http://qt.nokia.com/developer/changes/changes-4.6.0}{available
@@ -473,6 +474,7 @@
     Changes between this release and the previous release are provided
     in the \c{changes-%VERSION%} file (also
     \l{http://qt.nokia.com/developer/changes/changes-%VERSION%}{available online}).
+\endomit
 
     A list of other Qt 4 features can be found on the \bold{\l{What's
     New in Qt 4}} page.
@@ -508,6 +510,8 @@
     The state machine framework is introduced in 4.6 and is described
     below.
 
+    See \l{The Animation Framework} documentation for more information.
+
     \section1 State Machine Framework
 
     The state machine framework provides a robust state chart
@@ -533,6 +537,8 @@
     trigger on signals and \l{QEvent}s. By inserting animations into
     the state machine, it is also easier to use the framework for
     animating GUIs, for instance.
+    
+    See \l{The State Machine Framework} documentation for more infromation.
 
     \section1 Multi-touch & Gestures
 
@@ -552,6 +558,8 @@
         \o Enable extensibility.
     \endlist
 
+    See the QTouchEvent and QGesture class documentation for more information.
+
     \section1 DOM access API
 
     Web pages and XML both have very complex document object models.
@@ -566,20 +574,7 @@
         QList introSpans = document.findAll("p.intro span");
     \endcode
 
-    \section1 Qt3D enablers
-
-    As more of Qt, and more of the applications built on Qt go 3D,
-    API's should be provided to simplify this. Mainly, the new API
-    aims to make it more easy to create 3D applications with OpenGL.
-    It will also unify the Qt OpenGL codebase, and enable
-    cross-platform 3D codebase.
-
-    The main features of the Qt3D enablers are currently: Math
-    primitives for matrix multiplication, vectors, quaternions
-    (client-side), and API for vertex and fragment shaders, GLSL/ES.
-    Future research will, among other things include stencils,
-    scissors, vertex buffers and arrays, texture manipulation, and
-    geometry shaders.
+    See the QWebElement class documentation for more information.
 
     \section1 Performance Optimizations
 
@@ -592,10 +587,48 @@
         \o Reduced overhead in QNetworkAccessManager.
         \o Added the QContiguousCache class, which provides efficient caching of
            contiguous data.
+        \o Added support for hardware-accelerated rendering through
+        \l{OpenVG Rendering in Qt}{OpenVG}
         \o Removed Win9x support.
     \endlist
 
-    \section1 Multimedia Audio Services
+    \section1 Graphics Effects
+
+    Effects can be used to alter the appearance of UI elements such as
+    \l{QGraphicsItem}s and \l{QWidget}s. A range of standard effects such
+    as blurring, colorizing or blooming is provided, and it is possible to
+    implement custom effects.
+
+    \img graphicseffect-widget.png
+
+    See the QGraphicsEffect class documentation for more information.
+
+    \section1 XML Schema Validation
+
+    The QtXmlPatterns module can now be used to validate schemas, either
+    through C++ APIs in the Qt application, or using the xmlpatternsvalidator
+    command line utility. The implementation of XML Schema Validation supports
+    the specification version 1.0 in large parts.
+
+    See the \l{XML Processing} and QXmlSchema class documentation for more
+    information.
+
+    \section1 Qt3D enablers
+
+    As more of Qt, and more of the applications built on Qt go 3D,
+    API's should be provided to simplify this. Mainly, the new API
+    aims to make it more easy to create 3D applications with OpenGL.
+    It will also unify the Qt OpenGL codebase, and enable
+    cross-platform 3D codebase.
+
+    The main features of the Qt3D enablers are currently: Math
+    primitives for matrix multiplication, vectors, quaternions
+    (client-side), and API for vertex and fragment shaders, GLSL/ES.
+    Future research will, among other things include stencils,
+    scissors, vertex buffers and arrays, texture manipulation, and
+    geometry shaders.
+
+    \section1 Multimedia Services
 
     Qt 4.6 comes with new classes for handling audio. These classes
     provide low-level access to the system's audio system. By
@@ -605,6 +638,8 @@
     functions to query audio devices for which audio formats they
     support.
 
+    See the \l{QtMultimedia Module} documentation for more information.
+
     \section1 Classes, functions, and other items introduced in 4.6
 
     Links to classes, function, and other items that were added in
-- 
cgit v0.12


From 997cb3006a8dfeea71132f9593c7421ca151f009 Mon Sep 17 00:00:00 2001
From: Alessandro Portale 
Date: Thu, 1 Oct 2009 11:42:37 +0200
Subject: Fix an issue that was uncovered by two tst_QAbstractItemView fails.

tst_QAbstractItemView::shiftArrowSelectionAfterScrolling() and
tst_QAbstractItemView::shiftSelectionAfterRubberbandSelection() are two
relatively new test cases that always failed when Qt was configured
with QT_KEYPAD_NAVIGATION. And that even though we set the navigation
mode to Qt::NavigationModeNone when running autotests for Symbian.

Fix: in QAbstractItemViewPrivate::extendedSelectionCommand(), we make
sure that even with keypad navigation enabled, the shift-arrow feature
is available.

Reviewed-by: Jani Hautakangas

	modified:   src/gui/itemviews/qabstractitemview.cpp
---
 src/gui/itemviews/qabstractitemview.cpp | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/gui/itemviews/qabstractitemview.cpp b/src/gui/itemviews/qabstractitemview.cpp
index 303f45b..0fae959 100644
--- a/src/gui/itemviews/qabstractitemview.cpp
+++ b/src/gui/itemviews/qabstractitemview.cpp
@@ -3626,12 +3626,13 @@ QItemSelectionModel::SelectionFlags QAbstractItemViewPrivate::extendedSelectionC
             case Qt::Key_PageUp:
             case Qt::Key_PageDown:
             case Qt::Key_Tab:
+                if (modifiers & Qt::ControlModifier
 #ifdef QT_KEYPAD_NAVIGATION
-                return QItemSelectionModel::NoUpdate;
-#else
-                if (modifiers & Qt::ControlModifier)
-                    return QItemSelectionModel::NoUpdate;
+                    // Preserve historical tab order navigation behavior
+                    || QApplication::navigationMode() == Qt::NavigationModeKeypadTabOrder
 #endif
+                    )
+                    return QItemSelectionModel::NoUpdate;
                 break;
             case Qt::Key_Select:
                 return QItemSelectionModel::Toggle|selectionBehaviorFlags();
-- 
cgit v0.12


From 4ba85ab41513851236d62225b244b4364b825eaf Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Thorbj=C3=B8rn=20Lindeijer?= 
Date: Thu, 1 Oct 2009 12:11:43 +0200
Subject: doc: Fixed ending of header in the HTML generated for \sincelist

---
 tools/qdoc3/htmlgenerator.cpp | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp
index 2757cd8..291f60b 100644
--- a/tools/qdoc3/htmlgenerator.cpp
+++ b/tools/qdoc3/htmlgenerator.cpp
@@ -732,13 +732,12 @@ int HtmlGenerator::generateAtom(const Atom *atom,
                               << Node::typeName(i)
                               << " new in Qt "
                               << atom->string()
-                              << "

"; + << "

"; generateAnnotatedList(relative, marker, nodeMap); nodeMap.clear(); } } } - } break; case Atom::Image: -- cgit v0.12 From a9d47220b9f0936550522d9a34748692701a2acf Mon Sep 17 00:00:00 2001 From: Kent Hansen Date: Thu, 1 Oct 2009 12:11:11 +0200 Subject: Updated JavaScriptCore from /home/khansen/dev/qtwebkit to jsc-for-qtscript-4.6-staging-01102009 ( 79e88e90aab6674098b6d73b1b41998117164499 ) --- src/3rdparty/javascriptcore/JavaScriptCore/ChangeLog | 13 +++++++++++++ .../javascriptcore/JavaScriptCore/generated/Grammar.cpp | 2 +- src/3rdparty/javascriptcore/JavaScriptCore/parser/Grammar.y | 2 +- src/3rdparty/javascriptcore/JavaScriptCore/parser/Lexer.cpp | 12 +++++------- src/3rdparty/javascriptcore/JavaScriptCore/parser/Lexer.h | 4 ---- src/3rdparty/javascriptcore/VERSION | 4 ++-- 6 files changed, 22 insertions(+), 15 deletions(-) diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/ChangeLog b/src/3rdparty/javascriptcore/JavaScriptCore/ChangeLog index 20bfc23..84a2935 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/ChangeLog +++ b/src/3rdparty/javascriptcore/JavaScriptCore/ChangeLog @@ -2,6 +2,19 @@ Reviewed by Gavin Barraclough. + Reduce heap size on Symbian from 64MB to 8MB. + + This is not a perfect fix, it requires more fine tuning. + But this makes it possible again to debug in the emulator, + which is more important in order to be able to fix other + run-time issues. + + * runtime/Collector.h: + +2009-09-30 Janne Koskinen + + Reviewed by Simon Hausmann. + Avoid __clear_cache built-in function if DISABLE_BUILTIN_CLEAR_CACHE define is set https://bugs.webkit.org/show_bug.cgi?id=28886 diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/generated/Grammar.cpp b/src/3rdparty/javascriptcore/JavaScriptCore/generated/Grammar.cpp index 44559a8..f1fa708 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/generated/Grammar.cpp +++ b/src/3rdparty/javascriptcore/JavaScriptCore/generated/Grammar.cpp @@ -432,7 +432,7 @@ typedef struct YYLTYPE template inline void setStatementLocation(StatementNode* statement, const T& start, const T& end) { - statement->setLoc(start.first_line, end.last_line, start.first_column + 1); + statement->setLoc(start.first_line, end.last_line, start.first_column); } static inline void setExceptionLocation(ThrowableExpressionData* node, unsigned start, unsigned divot, unsigned end) diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/parser/Grammar.y b/src/3rdparty/javascriptcore/JavaScriptCore/parser/Grammar.y index ffed3bb..fa4ffd0 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/parser/Grammar.y +++ b/src/3rdparty/javascriptcore/JavaScriptCore/parser/Grammar.y @@ -179,7 +179,7 @@ static inline void appendToVarDeclarationList(JSGlobalData* globalData, ParserAr template inline void setStatementLocation(StatementNode* statement, const T& start, const T& end) { - statement->setLoc(start.first_line, end.last_line, start.first_column + 1); + statement->setLoc(start.first_line, end.last_line, start.first_column); } static inline void setExceptionLocation(ThrowableExpressionData* node, unsigned start, unsigned divot, unsigned end) diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/parser/Lexer.cpp b/src/3rdparty/javascriptcore/JavaScriptCore/parser/Lexer.cpp index ec700bd..a85ed3d 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/parser/Lexer.cpp +++ b/src/3rdparty/javascriptcore/JavaScriptCore/parser/Lexer.cpp @@ -59,7 +59,6 @@ static const UChar byteOrderMark = 0xFEFF; Lexer::Lexer(JSGlobalData* globalData) : m_isReparsing(false) , m_globalData(globalData) - , m_startColumnNumberCorrection(0) , m_keywordTable(JSC::mainTable) { m_buffer8.reserveInitialCapacity(initialReadBufferCapacity); @@ -204,7 +203,6 @@ void Lexer::shiftLineTerminator() else shift1(); - m_startColumnNumberCorrection = currentOffset(); ++m_lineNumber; } @@ -900,11 +898,11 @@ doneString: // Fall through into returnToken. returnToken: { - llocp->first_line = m_lineNumber; - llocp->last_line = m_lineNumber; - - llocp->first_column = startOffset - m_startColumnNumberCorrection; - llocp->last_column = currentOffset() - m_startColumnNumberCorrection; + int lineNumber = m_lineNumber; + llocp->first_line = lineNumber; + llocp->last_line = lineNumber; + llocp->first_column = startOffset; + llocp->last_column = currentOffset(); m_lastToken = token; return token; diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/parser/Lexer.h b/src/3rdparty/javascriptcore/JavaScriptCore/parser/Lexer.h index 885e4d9..174e05a 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/parser/Lexer.h +++ b/src/3rdparty/javascriptcore/JavaScriptCore/parser/Lexer.h @@ -86,10 +86,6 @@ namespace JSC { static const size_t initialReadBufferCapacity = 32; int m_lineNumber; - // this variable is supposed to keep index of last new line character ('\n' or '\r\n'or '\n\r'...) - // it is importent to calculate correct first_column in parser - int m_startColumnNumberCorrection; - Vector m_buffer8; Vector m_buffer16; diff --git a/src/3rdparty/javascriptcore/VERSION b/src/3rdparty/javascriptcore/VERSION index edcf898..3d9c27c 100644 --- a/src/3rdparty/javascriptcore/VERSION +++ b/src/3rdparty/javascriptcore/VERSION @@ -4,8 +4,8 @@ This is a snapshot of JavaScriptCore from The commit imported was from the - jsc-for-qtscript-4.6-staging-30092009 branch/tag + jsc-for-qtscript-4.6-staging-01102009 branch/tag and has the sha1 checksum - e8f42cf0203bee0ba89a05e0e773d713782129b4 + 79e88e90aab6674098b6d73b1b41998117164499 -- cgit v0.12 From 0ae74e4c267c7b15a405240ec4dc038374d95bd2 Mon Sep 17 00:00:00 2001 From: Kent Hansen Date: Thu, 1 Oct 2009 12:14:12 +0200 Subject: Fix column number provided to QScriptEngineAgent Introduced a helper function in our custom source provider, columnNumberFromOffset(), that maps an absolute offset in the source input to a relative column number. Reviewed-by: Jedrzej Nowacki --- src/script/api/qscriptengine.cpp | 67 +------------------- src/script/api/qscriptengine_p.h | 73 +++++++++++++++++++++- src/script/api/qscriptengineagent.cpp | 6 ++ tests/auto/qscriptengine/tst_qscriptengine.cpp | 1 - .../qscriptengineagent/tst_qscriptengineagent.cpp | 9 ++- 5 files changed, 88 insertions(+), 68 deletions(-) diff --git a/src/script/api/qscriptengine.cpp b/src/script/api/qscriptengine.cpp index 9604fff..059b102 100644 --- a/src/script/api/qscriptengine.cpp +++ b/src/script/api/qscriptengine.cpp @@ -382,65 +382,6 @@ private: bool m_shouldAbortEvaluation; }; -/*Helper class. Main purpose is to give debugger feedback about unloading and loading scripts. - It keeps pointer to JSGlobalObject assuming that it is always the same - there is no way to update - this data. Class is internal and used as an implementation detail in and only in QScriptEngine::evaluate.*/ -class UStringSourceProviderWithFeedback: public JSC::UStringSourceProvider -{ -public: - - static PassRefPtr create(const JSC::UString& source, const JSC::UString& url, int lineNumber, QScriptEnginePrivate* engine) - { - return adoptRef(new UStringSourceProviderWithFeedback(source, url, lineNumber, engine)); - } - - /* Destruction means that there is no more copies of script so create scriptUnload event - and unregister script in QScriptEnginePrivate::loadedScripts */ - virtual ~UStringSourceProviderWithFeedback() - { - if (m_ptr) { - if (JSC::Debugger* debugger = this->debugger()) - debugger->scriptUnload(asID()); - m_ptr->loadedScripts.remove(this); - } - } - - /* set internal QScriptEnginePrivate pointer to null and create unloadScript event, should be called - only if QScriptEnginePrivate is about to be destroyed.*/ - void disconnectFromEngine() - { - if (JSC::Debugger* debugger = this->debugger()) - debugger->scriptUnload(asID()); - m_ptr = 0; - } - -protected: - UStringSourceProviderWithFeedback(const JSC::UString& source, const JSC::UString& url, int lineNumber, QScriptEnginePrivate* engine) - : UStringSourceProvider(source, url), - m_ptr(engine) - { - if (JSC::Debugger* debugger = this->debugger()) - debugger->scriptLoad(asID(), source, url, lineNumber); - if (m_ptr) - m_ptr->loadedScripts.insert(this); - } - - JSC::Debugger* debugger() - { - //if m_ptr is null it mean that QScriptEnginePrivate was destroyed and scriptUnload was called - //else m_ptr is stable and we can use it as normal pointer without hesitation - if(!m_ptr) - return 0; //we are in ~QScriptEnginePrivate - else - return m_ptr->originalGlobalObject()->debugger(); //QScriptEnginePrivate is still alive - } - - //trace global object and debugger instance - QScriptEnginePrivate* m_ptr; -}; - - - static int toDigit(char c) { if ((c >= '0') && (c <= '9')) @@ -900,11 +841,9 @@ QScriptEnginePrivate::QScriptEnginePrivate() QScriptEnginePrivate::~QScriptEnginePrivate() { //disconnect all loadedScripts and generate all jsc::debugger::scriptUnload events - QSet::const_iterator i = loadedScripts.constBegin(); - while(i!=loadedScripts.constEnd()) { - (*i)->disconnectFromEngine(); - i++; - } + QHash::const_iterator it; + for (it = loadedScripts.constBegin(); it != loadedScripts.constEnd(); ++it) + it.value()->disconnectFromEngine(); while (!ownedAgents.isEmpty()) delete ownedAgents.takeFirst(); diff --git a/src/script/api/qscriptengine_p.h b/src/script/api/qscriptengine_p.h index b8b805e..5f31054 100644 --- a/src/script/api/qscriptengine_p.h +++ b/src/script/api/qscriptengine_p.h @@ -60,7 +60,10 @@ #include "qscriptvalue_p.h" #include "qscriptstring_p.h" +#include "Debugger.h" +#include "Lexer.h" #include "RefPtr.h" +#include "SourceProvider.h" #include "Structure.h" #include "JSGlobalObject.h" #include "JSValue.h" @@ -259,7 +262,7 @@ public: QSet importedExtensions; QSet extensionsBeingImported; - QSet loadedScripts; + QHash loadedScripts; #ifndef QT_NO_QOBJECT QHash m_qobjectData; @@ -273,6 +276,74 @@ public: namespace QScript { +/*Helper class. Main purpose is to give debugger feedback about unloading and loading scripts. + It keeps pointer to JSGlobalObject assuming that it is always the same - there is no way to update + this data. Class is internal and used as an implementation detail in and only in QScriptEngine::evaluate.*/ +class UStringSourceProviderWithFeedback: public JSC::UStringSourceProvider +{ +public: + static PassRefPtr create( + const JSC::UString& source, const JSC::UString& url, + int lineNumber, QScriptEnginePrivate* engine) + { + return adoptRef(new UStringSourceProviderWithFeedback(source, url, lineNumber, engine)); + } + + /* Destruction means that there is no more copies of script so create scriptUnload event + and unregister script in QScriptEnginePrivate::loadedScripts */ + virtual ~UStringSourceProviderWithFeedback() + { + if (m_ptr) { + if (JSC::Debugger* debugger = this->debugger()) + debugger->scriptUnload(asID()); + m_ptr->loadedScripts.remove(asID()); + } + } + + /* set internal QScriptEnginePrivate pointer to null and create unloadScript event, should be called + only if QScriptEnginePrivate is about to be destroyed.*/ + void disconnectFromEngine() + { + if (JSC::Debugger* debugger = this->debugger()) + debugger->scriptUnload(asID()); + m_ptr = 0; + } + + int columnNumberFromOffset(int offset) const + { + for (const UChar *c = m_source.data() + offset; c >= m_source.data(); --c) { + if (JSC::Lexer::isLineTerminator(*c)) + return offset - static_cast(c - data()); + } + return offset + 1; + } + +protected: + UStringSourceProviderWithFeedback(const JSC::UString& source, const JSC::UString& url, + int lineNumber, QScriptEnginePrivate* engine) + : UStringSourceProvider(source, url), + m_ptr(engine) + { + if (JSC::Debugger* debugger = this->debugger()) + debugger->scriptLoad(asID(), source, url, lineNumber); + if (m_ptr) + m_ptr->loadedScripts.insert(asID(), this); + } + + JSC::Debugger* debugger() + { + //if m_ptr is null it mean that QScriptEnginePrivate was destroyed and scriptUnload was called + //else m_ptr is stable and we can use it as normal pointer without hesitation + if(!m_ptr) + return 0; //we are in ~QScriptEnginePrivate + else + return m_ptr->originalGlobalObject()->debugger(); //QScriptEnginePrivate is still alive + } + + //trace global object and debugger instance + QScriptEnginePrivate* m_ptr; +}; + class SaveFrameHelper { public: diff --git a/src/script/api/qscriptengineagent.cpp b/src/script/api/qscriptengineagent.cpp index 84ae380..bc2eea2 100644 --- a/src/script/api/qscriptengineagent.cpp +++ b/src/script/api/qscriptengineagent.cpp @@ -169,6 +169,9 @@ void QScriptEngineAgentPrivate::exceptionCatch(const JSC::DebuggerCallFrame& fra void QScriptEngineAgentPrivate::atStatement(const JSC::DebuggerCallFrame& frame, intptr_t sourceID, int lineno, int column) { + QScript::UStringSourceProviderWithFeedback *source = engine->loadedScripts.value(sourceID); + Q_ASSERT(source != 0); + column = source->columnNumberFromOffset(column); JSC::CallFrame *oldFrame = engine->currentFrame; int oldAgentLineNumber = engine->agentLineNumber; engine->currentFrame = frame.callFrame(); @@ -195,6 +198,9 @@ void QScriptEngineAgentPrivate::didReachBreakpoint(const JSC::DebuggerCallFrame& intptr_t sourceID, int lineno, int column) { if (q_ptr->supportsExtension(QScriptEngineAgent::DebuggerInvocationRequest)) { + QScript::UStringSourceProviderWithFeedback *source = engine->loadedScripts.value(sourceID); + Q_ASSERT(source != 0); + column = source->columnNumberFromOffset(column); JSC::CallFrame *oldFrame = engine->currentFrame; int oldAgentLineNumber = engine->agentLineNumber; engine->currentFrame = frame.callFrame(); diff --git a/tests/auto/qscriptengine/tst_qscriptengine.cpp b/tests/auto/qscriptengine/tst_qscriptengine.cpp index 183aa3f..f2c7157 100644 --- a/tests/auto/qscriptengine/tst_qscriptengine.cpp +++ b/tests/auto/qscriptengine/tst_qscriptengine.cpp @@ -1632,7 +1632,6 @@ void tst_QScriptEngine::errorMessage_QT679() engine.globalObject().setProperty("foo", 15); QScriptValue error = engine.evaluate("'hello world';\nfoo.bar.blah"); QVERIFY(error.isError()); - QEXPECT_FAIL("", "Task QT-679: the error message always contains the first line of the script, even if the error was on a different line", Continue); QCOMPARE(error.toString(), QString::fromLatin1("TypeError: Result of expression 'foo.bar' [undefined] is not an object.")); } diff --git a/tests/auto/qscriptengineagent/tst_qscriptengineagent.cpp b/tests/auto/qscriptengineagent/tst_qscriptengineagent.cpp index 82bca8f..283e489 100644 --- a/tests/auto/qscriptengineagent/tst_qscriptengineagent.cpp +++ b/tests/auto/qscriptengineagent/tst_qscriptengineagent.cpp @@ -1193,10 +1193,15 @@ void tst_QScriptEngineAgent::positionChange_1() QCOMPARE(spy->at(0).columnNumber, 1); } - { + QStringList lineTerminators; + lineTerminators << "\n" << "\r" << "\n\r" << "\r\n"; + for (int i = 0; i < lineTerminators.size(); ++i) { spy->clear(); int lineNumber = 456; - eng.evaluate("1 + 2; 3 + 4;\n5 + 6", "foo.qs", lineNumber); + QString code = "1 + 2; 3 + 4;"; + code.append(lineTerminators.at(i)); + code.append("5 + 6"); + eng.evaluate(code, "foo.qs", lineNumber); QCOMPARE(spy->count(), 3); // 1 + 2 -- cgit v0.12 From 91c7b2d6cfa4f8ac63d12c1da131e1813a3c690c Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Thu, 1 Oct 2009 12:19:06 +0200 Subject: qdoc: Added a missing "/" in a "

". --- src/gui/graphicsview/qgraphicsscene.cpp | 212 ++++++++++++++++---------------- tools/qdoc3/doc.cpp | 83 +++++++------ 2 files changed, 152 insertions(+), 143 deletions(-) diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp index 0acef0b..a1ff6d2 100644 --- a/src/gui/graphicsview/qgraphicsscene.cpp +++ b/src/gui/graphicsview/qgraphicsscene.cpp @@ -1759,10 +1759,10 @@ QRectF QGraphicsScene::itemsBoundingRect() const return boundingRect; } -/*! - Returns a list of all items on the scene, in no particular order. +/*! \fn QList QGraphicsScene::items() const + Returns a list of all items on the scene, in no particular order. - \sa addItem(), removeItem() + \sa addItem(), removeItem() */ QList QGraphicsScene::items() const { @@ -1770,11 +1770,11 @@ QList QGraphicsScene::items() const return d->index->items(Qt::DescendingOrder); } -/*! - Returns an ordered list of all items on the scene. \a order decides the - sorting. +/*! \fn QList QGraphicsScene::items(Qt::SortOrder order) const + Returns an ordered list of all items on the scene. \a order decides the + sorting. - \sa addItem(), removeItem() + \sa addItem(), removeItem() */ QList QGraphicsScene::items(Qt::SortOrder order) const { @@ -1782,18 +1782,18 @@ QList QGraphicsScene::items(Qt::SortOrder order) const return d->index->items(order); } -/*! - \obsolete +/*! \fn QList QGraphicsScene::items(const QPointF &pos) const + \obsolete - Returns all visible items at position \a pos in the scene. The items are - listed in descending stacking order (i.e., the first item in the list is the - top-most item, and the last item is the bottom-most item). + Returns all visible items at position \a pos in the scene. The items are + listed in descending stacking order (i.e., the first item in the list is the + top-most item, and the last item is the bottom-most item). - This function is deprecated and returns incorrect results if the scene - contains items that ignore transformations. Use the overload that takes - a QTransform instead. + This function is deprecated and returns incorrect results if the scene + contains items that ignore transformations. Use the overload that takes + a QTransform instead. - \sa itemAt() + \sa itemAt() */ QList QGraphicsScene::items(const QPointF &pos) const { @@ -1801,21 +1801,21 @@ QList QGraphicsScene::items(const QPointF &pos) const return d->index->items(pos, Qt::IntersectsItemShape, Qt::DescendingOrder); } -/*! - \overload - \obsolete +/*! \fn QList QGraphicsScene::items(const QRectF &rectangle, Qt::ItemSelectionMode mode) const + \overload + \obsolete - Returns all visible items that, depending on \a mode, are either inside or - intersect with the specified \a rectangle. + Returns all visible items that, depending on \a mode, are either inside or + intersect with the specified \a rectangle. - The default value for \a mode is Qt::IntersectsItemShape; all items whose - exact shape intersects with or is contained by \a rectangle are returned. + The default value for \a mode is Qt::IntersectsItemShape; all items whose + exact shape intersects with or is contained by \a rectangle are returned. - This function is deprecated and returns incorrect results if the scene - contains items that ignore transformations. Use the overload that takes - a QTransform instead. + This function is deprecated and returns incorrect results if the scene + contains items that ignore transformations. Use the overload that takes + a QTransform instead. - \sa itemAt() + \sa itemAt() */ QList QGraphicsScene::items(const QRectF &rectangle, Qt::ItemSelectionMode mode) const { @@ -1823,47 +1823,45 @@ QList QGraphicsScene::items(const QRectF &rectangle, Qt::ItemSe return d->index->items(rectangle, mode, Qt::DescendingOrder); } -/*! - \fn QList QGraphicsScene::items(qreal x, qreal y, qreal w, qreal h, Qt::ItemSelectionMode mode) const - \obsolete - \since 4.3 +/*! \fn QList QGraphicsScene::items(qreal x, qreal y, qreal w, qreal h, Qt::ItemSelectionMode mode) const + \obsolete + \since 4.3 - This convenience function is equivalent to calling items(QRectF(\a x, \a y, \a w, \a h), \a mode). + This convenience function is equivalent to calling items(QRectF(\a x, \a y, \a w, \a h), \a mode). - This function is deprecated and returns incorrect results if the scene - contains items that ignore transformations. Use the overload that takes - a QTransform instead. + This function is deprecated and returns incorrect results if the scene + contains items that ignore transformations. Use the overload that takes + a QTransform instead. */ /*! - \fn QList QGraphicsScene::items(qreal x, qreal y, qreal w, qreal h, - Qt::ItemSelectionMode mode, Qt::SortOrder order, const QTransform &deviceTransform) const - \overload - \since 4.6 + \fn QList QGraphicsScene::items(qreal x, qreal y, qreal w, qreal h, Qt::ItemSelectionMode mode, Qt::SortOrder order, const QTransform &deviceTransform) const + \overload + \since 4.6 - Returns all visible items that, depending on \a mode, are either inside or - intersect with the rectangle defined by \a x, \a y, \a w and \a h, in a list - sorted using \a order. + \brief Returns all visible items that, depending on \a mode, are + either inside or intersect with the rectangle defined by \a x, \a y, + \a w and \a h, in a list sorted using \a order. - \a deviceTransform is the transformation that applies to the view, and needs to - be provided if the scene contains items that ignore transformations. + \a deviceTransform is the transformation that applies to the view, and needs to + be provided if the scene contains items that ignore transformations. */ -/*! - \overload - \obsolete +/*! \fn QList QGraphicsScene::items(const QPolygonF &polygon, Qt::ItemSelectionMode mode) const + \overload + \obsolete - Returns all visible items that, depending on \a mode, are either inside or - intersect with the polygon \a polygon. + Returns all visible items that, depending on \a mode, are either inside or + intersect with the polygon \a polygon. - The default value for \a mode is Qt::IntersectsItemShape; all items whose - exact shape intersects with or is contained by \a polygon are returned. + The default value for \a mode is Qt::IntersectsItemShape; all items whose + exact shape intersects with or is contained by \a polygon are returned. - This function is deprecated and returns incorrect results if the scene - contains items that ignore transformations. Use the overload that takes - a QTransform instead. + This function is deprecated and returns incorrect results if the scene + contains items that ignore transformations. Use the overload that takes + a QTransform instead. - \sa itemAt() + \sa itemAt() */ QList QGraphicsScene::items(const QPolygonF &polygon, Qt::ItemSelectionMode mode) const { @@ -1871,21 +1869,21 @@ QList QGraphicsScene::items(const QPolygonF &polygon, Qt::ItemS return d->index->items(polygon, mode, Qt::DescendingOrder); } -/*! - \overload - \obsolete +/*! \fn QList QGraphicsScene::items(const QPainterPath &path, Qt::ItemSelectionMode mode) const + \overload + \obsolete - Returns all visible items that, depending on \a path, are either inside or - intersect with the path \a path. + Returns all visible items that, depending on \a path, are either inside or + intersect with the path \a path. - The default value for \a mode is Qt::IntersectsItemShape; all items whose - exact shape intersects with or is contained by \a path are returned. + The default value for \a mode is Qt::IntersectsItemShape; all items whose + exact shape intersects with or is contained by \a path are returned. - This function is deprecated and returns incorrect results if the scene - contains items that ignore transformations. Use the overload that takes - a QTransform instead. + This function is deprecated and returns incorrect results if the scene + contains items that ignore transformations. Use the overload that takes + a QTransform instead. - \sa itemAt() + \sa itemAt() */ QList QGraphicsScene::items(const QPainterPath &path, Qt::ItemSelectionMode mode) const { @@ -1893,19 +1891,20 @@ QList QGraphicsScene::items(const QPainterPath &path, Qt::ItemS return d->index->items(path, mode, Qt::DescendingOrder); } -/*! - \since 4.6 +/*! \fn QList QGraphicsScene::items(const QPointF &pos, Qt::ItemSelectionMode mode, Qt::SortOrder order, const QTransform &deviceTransform) const - Returns all visible items that, depending on \a mode, are at the specified \a pos - in a list sorted using \a order. + \since 4.6 - The default value for \a mode is Qt::IntersectsItemShape; all items whose - exact shape intersects with \a pos are returned. + \brief Returns all visible items that, depending on \a mode, are at + the specified \a pos in a list sorted using \a order. - \a deviceTransform is the transformation that applies to the view, and needs to - be provided if the scene contains items that ignore transformations. + The default value for \a mode is Qt::IntersectsItemShape; all items whose + exact shape intersects with \a pos are returned. - \sa itemAt() + \a deviceTransform is the transformation that applies to the view, and needs to + be provided if the scene contains items that ignore transformations. + + \sa itemAt() */ QList QGraphicsScene::items(const QPointF &pos, Qt::ItemSelectionMode mode, Qt::SortOrder order, const QTransform &deviceTransform) const @@ -1914,20 +1913,21 @@ QList QGraphicsScene::items(const QPointF &pos, Qt::ItemSelecti return d->index->items(pos, mode, order, deviceTransform); } -/*! - \overload - \since 4.6 +/*! \fn QList QGraphicsScene::items(const QRectF &rect, Qt::ItemSelectionMode mode, Qt::SortOrder order, const QTransform &deviceTransform) const + \overload + \since 4.6 - Returns all visible items that, depending on \a mode, are either inside or - intersect with the specified \a rect and return a list sorted using \a order. + \brief Returns all visible items that, depending on \a mode, are + either inside or intersect with the specified \a rect and return a + list sorted using \a order. - The default value for \a mode is Qt::IntersectsItemShape; all items whose - exact shape intersects with or is contained by \a rect are returned. + The default value for \a mode is Qt::IntersectsItemShape; all items whose + exact shape intersects with or is contained by \a rect are returned. - \a deviceTransform is the transformation that applies to the view, and needs to - be provided if the scene contains items that ignore transformations. + \a deviceTransform is the transformation that applies to the view, and needs to + be provided if the scene contains items that ignore transformations. - \sa itemAt() + \sa itemAt() */ QList QGraphicsScene::items(const QRectF &rect, Qt::ItemSelectionMode mode, Qt::SortOrder order, const QTransform &deviceTransform) const @@ -1936,20 +1936,21 @@ QList QGraphicsScene::items(const QRectF &rect, Qt::ItemSelecti return d->index->items(rect, mode, order, deviceTransform); } -/*! - \overload - \since 4.6 +/*! \fn QList QGraphicsScene::items(const QPolygonF &polygon, Qt::ItemSelectionMode mode, Qt::SortOrder order, const QTransform &deviceTransform) const + \overload + \since 4.6 - Returns all visible items that, depending on \a mode, are either inside or - intersect with the specified \a polygon and return a list sorted using \a order. + \brief Returns all visible items that, depending on \a mode, are + either inside or intersect with the specified \a polygon and return + a list sorted using \a order. - The default value for \a mode is Qt::IntersectsItemShape; all items whose - exact shape intersects with or is contained by \a polygon are returned. + The default value for \a mode is Qt::IntersectsItemShape; all items whose + exact shape intersects with or is contained by \a polygon are returned. - \a deviceTransform is the transformation that applies to the view, and needs to - be provided if the scene contains items that ignore transformations. + \a deviceTransform is the transformation that applies to the view, and needs to + be provided if the scene contains items that ignore transformations. - \sa itemAt() + \sa itemAt() */ QList QGraphicsScene::items(const QPolygonF &polygon, Qt::ItemSelectionMode mode, Qt::SortOrder order, const QTransform &deviceTransform) const @@ -1958,20 +1959,21 @@ QList QGraphicsScene::items(const QPolygonF &polygon, Qt::ItemS return d->index->items(polygon, mode, order, deviceTransform); } -/*! - \overload - \since 4.6 +/*! \fn QList QGraphicsScene::items(const QPainterPath &path, Qt::ItemSelectionMode mode, Qt::SortOrder order, const QTransform &deviceTransform) const + \overload + \since 4.6 - Returns all visible items that, depending on \a mode, are either inside or - intersect with the specified \a path and return a list sorted using \a order. + \brief Returns all visible items that, depending on \a mode, are + either inside or intersect with the specified \a path and return a + list sorted using \a order. - The default value for \a mode is Qt::IntersectsItemShape; all items whose - exact shape intersects with or is contained by \a path are returned. + The default value for \a mode is Qt::IntersectsItemShape; all items whose + exact shape intersects with or is contained by \a path are returned. - \a deviceTransform is the transformation that applies to the view, and needs to - be provided if the scene contains items that ignore transformations. + \a deviceTransform is the transformation that applies to the view, and needs to + be provided if the scene contains items that ignore transformations. - \sa itemAt() + \sa itemAt() */ QList QGraphicsScene::items(const QPainterPath &path, Qt::ItemSelectionMode mode, Qt::SortOrder order, const QTransform &deviceTransform) const diff --git a/tools/qdoc3/doc.cpp b/tools/qdoc3/doc.cpp index c202d71..748390f 100644 --- a/tools/qdoc3/doc.cpp +++ b/tools/qdoc3/doc.cpp @@ -2641,56 +2641,63 @@ Text Doc::trimmedBriefText(const QString &className) const bool standardWording = true; /* - This code is really ugly. The entire \brief business - should be rethought. + This code is really ugly. The entire \brief business + should be rethought. */ - while (atom && (atom->type() == Atom::AutoLink || atom->type() == Atom::String)) { - briefStr += atom->string(); + while (atom) { + if (atom->type() == Atom::AutoLink || atom->type() == Atom::String) { + briefStr += atom->string(); + } atom = atom->next(); } QStringList w = briefStr.split(" "); - if (!w.isEmpty() && w.first() == "The") - w.removeFirst(); - else { - location().warning( - tr("Nonstandard wording in '\\%1' text for '%2' (expected 'The')") - .arg(COMMAND_BRIEF).arg(className)); - standardWording = false; + if (!w.isEmpty() && w.first() == "Returns") { } - - if (!w.isEmpty() && (w.first() == className || w.first() == classNameOnly)) - w.removeFirst(); else { - location().warning( - tr("Nonstandard wording in '\\%1' text for '%2' (expected '%3')") - .arg(COMMAND_BRIEF).arg(className).arg(className)); - standardWording = false; - } + if (!w.isEmpty() && w.first() == "The") + w.removeFirst(); + else { + location().warning( + tr("Nonstandard wording in '\\%1' text for '%2' (expected 'The')") + .arg(COMMAND_BRIEF).arg(className)); + standardWording = false; + } - if (!w.isEmpty() && ((w.first() == "class") || - (w.first() == "function") || - (w.first() == "macro") || - (w.first() == "widget") || - (w.first() == "namespace") || - (w.first() == "header"))) - w.removeFirst(); - else { - location().warning( - tr("Nonstandard wording in '\\%1' text for '%2' (" - "expected 'class', 'function', 'macro', 'widget', " - "'namespace' or 'header')") - .arg(COMMAND_BRIEF).arg(className)); - standardWording = false; - } + if (!w.isEmpty() && (w.first() == className || w.first() == classNameOnly)) + w.removeFirst(); + else { + location().warning( + tr("Nonstandard wording in '\\%1' text for '%2' (expected '%3')") + .arg(COMMAND_BRIEF).arg(className).arg(className)); + standardWording = false; + } - if (!w.isEmpty() && (w.first() == "is" || w.first() == "provides")) - w.removeFirst(); + if (!w.isEmpty() && ((w.first() == "class") || + (w.first() == "function") || + (w.first() == "macro") || + (w.first() == "widget") || + (w.first() == "namespace") || + (w.first() == "header"))) + w.removeFirst(); + else { + location().warning( + tr("Nonstandard wording in '\\%1' text for '%2' (" + "expected 'class', 'function', 'macro', 'widget', " + "'namespace' or 'header')") + .arg(COMMAND_BRIEF).arg(className)); + standardWording = false; + } - if (!w.isEmpty() && (w.first() == "a" || w.first() == "an")) - w.removeFirst(); + if (!w.isEmpty() && (w.first() == "is" || w.first() == "provides")) + w.removeFirst(); + + if (!w.isEmpty() && (w.first() == "a" || w.first() == "an")) + w.removeFirst(); + } whats = w.join(" "); + if (whats.endsWith(".")) whats.truncate(whats.length() - 1); -- cgit v0.12 From dde7e6835ddaa8e1531de57887686c6c4f89d83d Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Thu, 1 Oct 2009 12:40:56 +0200 Subject: Fix tst_QIcon::isNull The test tries to load a file from an unsuported format. The problem is that tga is a supported format if KDE plugins are installed It is unlikely that cpp will ever be a supported image format Reviewed-by: paul --- tests/auto/qicon/image.tga | Bin 51708 -> 0 bytes tests/auto/qicon/qicon.pro | 4 ++-- tests/auto/qicon/tst_qicon.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) delete mode 100644 tests/auto/qicon/image.tga diff --git a/tests/auto/qicon/image.tga b/tests/auto/qicon/image.tga deleted file mode 100644 index 0cd507d..0000000 Binary files a/tests/auto/qicon/image.tga and /dev/null differ diff --git a/tests/auto/qicon/qicon.pro b/tests/auto/qicon/qicon.pro index 0c9c7e9..8ae252f 100644 --- a/tests/auto/qicon/qicon.pro +++ b/tests/auto/qicon/qicon.pro @@ -6,9 +6,9 @@ RESOURCES = tst_qicon.qrc wince* { QT += xml svg addFiles.sources += $$_PRO_FILE_PWD_/*.png - addFiles.sources += $$_PRO_FILE_PWD_/*.tga addFiles.sources += $$_PRO_FILE_PWD_/*.svg addFiles.sources += $$_PRO_FILE_PWD_/*.svgz + addFiles.sources += $$_PRO_FILE_PWD_/tst_qicon.cpp addFiles.path = . DEPLOYMENT += addFiles @@ -16,7 +16,7 @@ wince* { DEFINES += SRCDIR=\\\".\\\" } else:symbian { QT += xml svg - addFiles.sources = *.png *.tga *.svg *.svgz + addFiles.sources = *.png tst_qicon.cpp *.svg *.svgz addFiles.path = . plugins.sources = qsvgicon.dll plugins.path = iconengines diff --git a/tests/auto/qicon/tst_qicon.cpp b/tests/auto/qicon/tst_qicon.cpp index 96d1d6c..f5baeaa 100644 --- a/tests/auto/qicon/tst_qicon.cpp +++ b/tests/auto/qicon/tst_qicon.cpp @@ -242,7 +242,7 @@ void tst_QIcon::isNull() { const QString prefix = QLatin1String(SRCDIR) + QLatin1String("/"); // test string constructor with existing file but unsupported format - QIcon iconUnsupportedFormat = QIcon(prefix + "image.tga"); + QIcon iconUnsupportedFormat = QIcon(prefix + "tst_qicon.cpp"); QVERIFY(!iconUnsupportedFormat.isNull()); QVERIFY(!iconUnsupportedFormat.actualSize(QSize(32, 32)).isValid()); -- cgit v0.12 From a542c1c7f5f49b0b5feb85d6ea56155e0cec411b Mon Sep 17 00:00:00 2001 From: Kent Hansen Date: Thu, 1 Oct 2009 12:39:33 +0200 Subject: Skip unstable test The test relies on wall-clock time. --- tests/auto/qscriptjstestsuite/tst_qscriptjstestsuite.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/auto/qscriptjstestsuite/tst_qscriptjstestsuite.cpp b/tests/auto/qscriptjstestsuite/tst_qscriptjstestsuite.cpp index 94f08d9..4f4c547 100644 --- a/tests/auto/qscriptjstestsuite/tst_qscriptjstestsuite.cpp +++ b/tests/auto/qscriptjstestsuite/tst_qscriptjstestsuite.cpp @@ -649,6 +649,8 @@ tst_Suite::tst_Suite() addFileExclusion("regress-322135-04.js", "takes forever"); addFileExclusion("ecma_3/RegExp/regress-375715-04.js", "bug"); + addFileExclusion("ecma_3/RegExp/regress-289669.js", "Can fail due to relying on wall-clock time"); + // Failures due to switch to JSC as back-end addExpectedFailure("ecma/Array/15.4.3.1-2.js", "var props = ''; for ( p in Array ) { props += p } props", willFixInNextReleaseMessage); addExpectedFailure("ecma/Boolean/15.6.3.1-1.js", "var str='';for ( p in Boolean ) { str += p } str;", willFixInNextReleaseMessage); -- cgit v0.12 From a7273386adb9399ecdc7b7c8f4b041099db042ef Mon Sep 17 00:00:00 2001 From: Shane Kearns Date: Thu, 1 Oct 2009 12:41:23 +0200 Subject: Fix crash in S60 input methods after task switching When switching away from the application, the focused widget is set to null. When switching back, there are callbacks from S60 before the focus has been restored. These functions check for null widget, but the output function parameters are left uninitialised, which causes a crash inside the S60 FEP. 1) GetXYZ functions now initialise the output parameters even when the focused widget is null. 2) Return no input capability when there is no focused widget, as was already done during destruction. This stops most of the callbacks from S60. Task-number: QTBUG-4618 Reviewed-by: axis --- src/gui/inputmethod/qcoefepinputcontext_s60.cpp | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp index fc55a0f..c4d17ff 100644 --- a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp +++ b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp @@ -222,7 +222,7 @@ void QCoeFepInputContext::mouseHandler( int x, QMouseEvent *event) TCoeInputCapabilities QCoeFepInputContext::inputCapabilities() { - if (m_inDestruction) { + if (m_inDestruction || !focusWidget()) { return TCoeInputCapabilities(TCoeInputCapabilities::ENone, 0, 0); } @@ -554,8 +554,10 @@ void QCoeFepInputContext::SetCursorSelectionForFepL(const TCursorSelection& aCur void QCoeFepInputContext::GetCursorSelectionForFep(TCursorSelection& aCursorSelection) const { QWidget *w = focusWidget(); - if (!w) + if (!w) { + aCursorSelection.SetSelection(0,0); return; + } int cursor = w->inputMethodQuery(Qt::ImCursorPosition).toInt() + m_preeditString.size(); int anchor = w->inputMethodQuery(Qt::ImAnchorPosition).toInt() + m_preeditString.size(); @@ -567,8 +569,10 @@ void QCoeFepInputContext::GetEditorContentForFep(TDes& aEditorContent, TInt aDoc TInt aLengthToRetrieve) const { QWidget *w = focusWidget(); - if (!w) + if (!w) { + aEditorContent.FillZ(aLengthToRetrieve); return; + } QString text = w->inputMethodQuery(Qt::ImSurroundingText).value(); // FEP expects the preedit string to be part of the editor content, so let's mix it in. @@ -580,8 +584,10 @@ void QCoeFepInputContext::GetEditorContentForFep(TDes& aEditorContent, TInt aDoc void QCoeFepInputContext::GetFormatForFep(TCharFormat& aFormat, TInt /* aDocumentPosition */) const { QWidget *w = focusWidget(); - if (!w) + if (!w) { + aFormat = TCharFormat(); return; + } QFont font = w->inputMethodQuery(Qt::ImFont).value(); QFontMetrics metrics(font); @@ -595,8 +601,12 @@ void QCoeFepInputContext::GetScreenCoordinatesForFepL(TPoint& aLeftSideOfBaseLin TInt& aAscent, TInt /* aDocumentPosition */) const { QWidget *w = focusWidget(); - if (!w) + if (!w) { + aLeftSideOfBaseLine = TPoint(0,0); + aHeight = 0; + aAscent = 0; return; + } QRect rect = w->inputMethodQuery(Qt::ImMicroFocus).value(); aLeftSideOfBaseLine.iX = rect.left(); -- cgit v0.12 From 3b37aff1e6c641290c155a6aa14d83167725556b Mon Sep 17 00:00:00 2001 From: Alexis Menard Date: Thu, 1 Oct 2009 12:45:52 +0200 Subject: Fix auto-test that was crashing on Mac Carbon. If you let top level widget hanging around with a broken state it may crash when a process event is triggered. Reviewed-by:ogoffart --- tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp b/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp index 00fae2f..e70d286 100644 --- a/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp +++ b/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp @@ -3059,6 +3059,8 @@ void tst_QGraphicsProxyWidget::deleteProxyForChildWidget() proxy->setWidget(0); //just don't crash + QApplication::processEvents(); + delete combo; } void tst_QGraphicsProxyWidget::bypassGraphicsProxyWidget_data() @@ -3090,11 +3092,17 @@ void tst_QGraphicsProxyWidget::bypassGraphicsProxyWidget() if (bypass) flags |= Qt::BypassGraphicsProxyWidget; QFileDialog *dialog = new QFileDialog(widget, flags); + dialog->setOption(QFileDialog::DontUseNativeDialog, true); dialog->show(); QCOMPARE(proxy->childItems().size(), bypass ? 0 : 1); if (!bypass) QCOMPARE(((QGraphicsProxyWidget *)proxy->childItems().first())->widget(), (QWidget *)dialog); + + dialog->hide(); + QApplication::processEvents(); + delete dialog; + delete widget; } static void makeDndEvent(QGraphicsSceneDragDropEvent *event, QGraphicsView *view, const QPointF &pos) -- cgit v0.12 From 973adfb8272c95bd197af8b0afc9c1a9095552cb Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Thu, 1 Oct 2009 12:58:08 +0200 Subject: Doc: A bit of text for example categories. IPC is missing. --- doc/src/getting-started/examples.qdoc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/src/getting-started/examples.qdoc b/doc/src/getting-started/examples.qdoc index 543a2e1..d80308a 100644 --- a/doc/src/getting-started/examples.qdoc +++ b/doc/src/getting-started/examples.qdoc @@ -295,6 +295,8 @@ \o \image animation-examples.png \o + These examples show to to use the \l{The Animation Framework}{animation framework} + to build highly animated, high-performance GUIs. \row \o{2,1} \l{Gestures Examples}{\bold{Gestures}} @@ -322,6 +324,8 @@ \o \image activeqt-examples.png ActiveQt \o + These examples demonstrate how to write ActiveX controls and control servers + with Qt, and how to use ActiveX controls and COM objects in a Qt application. \row \o{2,1} \l{Qt Quarterly}{\bold{Qt Quarterly}} -- cgit v0.12 From 17fc5f3f3bb358049ac49e6b2ae2f3e277fee595 Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Thu, 1 Oct 2009 13:13:25 +0200 Subject: Doc: nicer screenshots for Graphics Effects section in "What's New" --- doc/src/images/graphicseffect-plain.png | Bin 0 -> 68763 bytes doc/src/qt4-intro.qdoc | 11 ++++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 doc/src/images/graphicseffect-plain.png diff --git a/doc/src/images/graphicseffect-plain.png b/doc/src/images/graphicseffect-plain.png new file mode 100644 index 0000000..8b4c1c4 Binary files /dev/null and b/doc/src/images/graphicseffect-plain.png differ diff --git a/doc/src/qt4-intro.qdoc b/doc/src/qt4-intro.qdoc index be4cb48..aff0a76 100644 --- a/doc/src/qt4-intro.qdoc +++ b/doc/src/qt4-intro.qdoc @@ -599,7 +599,16 @@ as blurring, colorizing or blooming is provided, and it is possible to implement custom effects. - \img graphicseffect-widget.png + \table + \row + \o + \o \img graphicseffect-plain.png + \o + \row + \o \img graphicseffect-blur.png + \o \img graphicseffect-colorize.png + \o \img graphicseffect-bloom.png + \endtable See the QGraphicsEffect class documentation for more information. -- cgit v0.12 From b8544f961ea8b5b2aee49aec330883191d2c910c Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Thu, 1 Oct 2009 13:14:11 +0200 Subject: Doc: A short paragraph about Symbian support. Needs a screenshot or picture. --- doc/src/qt4-intro.qdoc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/doc/src/qt4-intro.qdoc b/doc/src/qt4-intro.qdoc index aff0a76..e273c6e 100644 --- a/doc/src/qt4-intro.qdoc +++ b/doc/src/qt4-intro.qdoc @@ -483,6 +483,14 @@ \tableofcontents + \section1 Support for Symbian + + Qt 4.6 is the first release to include support for the Symbian + platform, with integration into the S60 framework. The port to + Symbian and S60 provides all functionality required to develop + rich end-user applications for devices running Symbian 3.1 and + later. + \section1 Animation Framework The animation framework helps build highly animated, -- cgit v0.12 From 7edd3d86530ed4036482d05e2791569f3f53afa6 Mon Sep 17 00:00:00 2001 From: Denis Dzyubenko Date: Thu, 1 Oct 2009 12:56:31 +0200 Subject: Fixes clipboard handling on X11. This fixes handling selection requests for invalid targets - when someone asks for a target that is not supported by the clipboard content we shouldn't do anything (unless it's MULTIPLE). Fixes copying data when using Synergy which tries to get all targets it knows about even if they are not listed in TARGETS. Task-number: QTBUG-4652 Reviewed-by: Bradley T. Hughes --- src/gui/kernel/qdnd_x11.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gui/kernel/qdnd_x11.cpp b/src/gui/kernel/qdnd_x11.cpp index 33da0f3..da150fb 100644 --- a/src/gui/kernel/qdnd_x11.cpp +++ b/src/gui/kernel/qdnd_x11.cpp @@ -506,6 +506,7 @@ bool QX11Data::xdndMimeDataForAtom(Atom a, QMimeData *mimeData, QByteArray *data *atomFormat = textprop.encoding; *dataFormat = textprop.format; *data = QByteArray((const char *) textprop.value, textprop.nitems * textprop.format / 8); + ret = true; DEBUG(" textprop type %lx\n" " textprop name '%s'\n" @@ -541,12 +542,13 @@ bool QX11Data::xdndMimeDataForAtom(Atom a, QMimeData *mimeData, QByteArray *data dm->xdndMimeTransferedPixmap[dm->xdndMimeTransferedPixmapIndex] = pm; dm->xdndMimeTransferedPixmapIndex = (dm->xdndMimeTransferedPixmapIndex + 1) % 2; + ret = true; } } else { DEBUG("QClipboard: xdndMimeDataForAtom(): converting to type '%s' is not supported", qPrintable(atomName)); } } - return data; + return ret && data != 0; } //$$$ -- cgit v0.12 From 3f711d2a40224f7f4d609fdb60d26ad79998da59 Mon Sep 17 00:00:00 2001 From: Alexis Menard Date: Thu, 1 Oct 2009 13:16:17 +0200 Subject: Doc fix on QGraphicsWidget and QGraphicsObject. Reviewed-by:David Boddie --- doc/src/qt4-intro.qdoc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/src/qt4-intro.qdoc b/doc/src/qt4-intro.qdoc index e273c6e..47eab16 100644 --- a/doc/src/qt4-intro.qdoc +++ b/doc/src/qt4-intro.qdoc @@ -501,8 +501,9 @@ The framework makes it easy to animate \l{QObject}s, including QWidgets, by allowing Qt properties to be animated. It also allows creating custom animations and interpolation functions. Graphics - views are not left out--one can animate \l{QGraphicsWidget}s, - which inherits from QObject (and thereby enables properties). + views are not left out; one can animate \l{QGraphicsWidget}s and + new \l{QGraphicsObject}s which inherit from QGraphicsItem + (and thereby enable properties). Animations are controlled using easing curves and can be grouped together. This enables animations of arbitrary complexity. -- cgit v0.12 From ac557bcf08f651b1634235d70bc6c02512ab8c49 Mon Sep 17 00:00:00 2001 From: ninerider Date: Thu, 1 Oct 2009 13:20:56 +0200 Subject: Test http://codepaster-nokia.troll.no/?id=18722 skipped for WinCE Test does not really make sense on WinCE as it is. Lists with items size over 5000 are not useful there. Reviewed-by: Joerg --- tests/auto/qwidget/tst_qwidget.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/auto/qwidget/tst_qwidget.cpp b/tests/auto/qwidget/tst_qwidget.cpp index 94e67a4..c4e62ef 100644 --- a/tests/auto/qwidget/tst_qwidget.cpp +++ b/tests/auto/qwidget/tst_qwidget.cpp @@ -9146,6 +9146,9 @@ void tst_QWidget::destroyBackingStore() void tst_QWidget::rectOutsideCoordinatesLimit_task144779() { +#ifdef Q_OS_WINCE_WM + QSKIP( "Tables of 5000 elements do not make sense on Windows Mobile.", SkipAll); +#endif QApplication::setOverrideCursor(Qt::BlankCursor); //keep the cursor out of screen grabs QWidget main(0,Qt::FramelessWindowHint); //don't get confused by the size of the window frame QPalette palette; -- cgit v0.12 From 210b0fabc4c983049ad5c6823a5723554e1fd108 Mon Sep 17 00:00:00 2001 From: ninerider Date: Thu, 1 Oct 2009 13:28:01 +0200 Subject: Disabled icon conversion functions for WinCE These test will require more work on WinCE which we will invest shortly. Reviewed-by: Joerg --- tests/auto/qpixmap/tst_qpixmap.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/auto/qpixmap/tst_qpixmap.cpp b/tests/auto/qpixmap/tst_qpixmap.cpp index 8151e62..2568b94 100644 --- a/tests/auto/qpixmap/tst_qpixmap.cpp +++ b/tests/auto/qpixmap/tst_qpixmap.cpp @@ -1034,6 +1034,10 @@ void tst_QPixmap::toWinHICON_data() void tst_QPixmap::toWinHICON() { +#ifdef Q_OS_WINCE + QSKIP("Test shall be enabled for Windows CE shortly.", SkipAll); +#endif + QFETCH(int, width); QFETCH(int, height); QFETCH(QString, image); @@ -1074,6 +1078,10 @@ void tst_QPixmap::fromWinHICON_data() void tst_QPixmap::fromWinHICON() { +#ifdef Q_OS_WINCE + QSKIP("Test shall be enabled for Windows CE shortly.", SkipAll); + +#else QFETCH(int, width); QFETCH(int, height); QFETCH(QString, image); @@ -1090,6 +1098,7 @@ void tst_QPixmap::fromWinHICON() // QVERIFY(imageFromHICON == imageFromFile); compareImages(imageFromHICON, imageFromFile); +#endif } #endif // Q_WS_WIN -- cgit v0.12 From 09df1ded0bc52700b19b19edf17f7dff5a16a2d9 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Thu, 1 Oct 2009 14:29:39 +0300 Subject: Worked around S60 3.1 bug in CCoeControl::PositionRelativeToScreen CCoeControl::PositionRelativeToScreen sometimes freezes the device in S60 3.1 based devices. Exact cause is unknown, but it might be OOM situation given that some cases where this is an issue, changing to a simpler theme makes the freeze go away. Task-number: QTBUG-4565 Reviewed-by: Sami Merila Reviewed-by: Espen Riskedal --- src/gui/styles/qs60style_s60.cpp | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/gui/styles/qs60style_s60.cpp b/src/gui/styles/qs60style_s60.cpp index 131d8bc..cde48d8 100644 --- a/src/gui/styles/qs60style_s60.cpp +++ b/src/gui/styles/qs60style_s60.cpp @@ -635,8 +635,18 @@ bool QS60StylePrivate::isToolBarBackground() QPoint qt_s60_fill_background_offset(const QWidget *targetWidget) { CCoeControl *control = targetWidget->effectiveWinId(); - TPoint globalPos = control ? control->PositionRelativeToScreen() : TPoint(0,0); - return QPoint(globalPos.iX, globalPos.iY); + TPoint pos(0,0); + if (control) { + // FIXME properly: S60 3.1 has a bug that CCoeControl::PositionRelativeToScreen sometimes + // freezes the device, possibly in cases where we run out of memory. + // We use CCoeControl::Position instead in S60 3.1, which returns same values + // in most cases. + if (QSysInfo::s60Version() == QSysInfo::SV_S60_3_1) + pos = control->Position(); + else + pos = control->PositionRelativeToScreen(); + } + return QPoint(pos.iX, pos.iY); } QPixmap QS60StyleModeSpecifics::createSkinnedGraphicsLX( @@ -1137,11 +1147,11 @@ QPixmap QS60StylePrivate::part(QS60StyleEnums::SkinParts part, const QSize &size, SkinElementFlags flags) { QSymbianFbsHeapLock lock(QSymbianFbsHeapLock::Unlock); - + QPixmap result = (flags & SF_ColorSkinned)? QS60StyleModeSpecifics::colorSkinnedGraphics(part, size, flags) : QS60StyleModeSpecifics::skinnedGraphics(part, size, flags); - + lock.relock(); if (flags & SF_StateDisabled && !QS60StyleModeSpecifics::disabledPartGraphic(part)) { -- cgit v0.12 From cf7bbfca65039f0e94951269e2dfc09ae66a28d4 Mon Sep 17 00:00:00 2001 From: ninerider Date: Thu, 1 Oct 2009 13:49:28 +0200 Subject: Deployment augmented for WinCE SRCDIR problem fixed and deployment augmented to accomodate image and icon tests. Reviewed-by: Joerg --- tests/auto/qpixmap/qpixmap.pro | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/tests/auto/qpixmap/qpixmap.pro b/tests/auto/qpixmap/qpixmap.pro index 31d6eaa..a3577bd 100644 --- a/tests/auto/qpixmap/qpixmap.pro +++ b/tests/auto/qpixmap/qpixmap.pro @@ -2,16 +2,23 @@ load(qttest_p4) SOURCES += tst_qpixmap.cpp contains(QT_CONFIG, qt3support): QT += qt3support wince*|symbian*: { - task31722_0.sources = convertFromImage/task31722_0/* + + task31722_0.sources = convertFromImage/task31722_0/*.png task31722_0.path = convertFromImage/task31722_0 - task31722_1.sources = convertFromImage/task31722_1/* + + task31722_1.sources = convertFromImage/task31722_1/*.png task31722_1.path = convertFromImage/task31722_1 - DEPLOYMENT += task31722_0 task31722_1 + + icons.sources = convertFromToHICON/* + icons.path = convertFromToHICON + + DEPLOYMENT += task31722_0 task31722_1 icons + DEPLOYMENT_PLUGIN += qico } wince*: { DEFINES += SRCDIR=\\\".\\\" -} symbian*: { +} else:symbian* { DEPLOYMENT_PLUGIN += qmng LIBS += -lfbscli.dll -lbitgdi.dll -lgdi.dll contains(QT_CONFIG, openvg) { -- cgit v0.12 From 25a0a22533f593ed1a91567be3f74ed8b48e7717 Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Thu, 1 Oct 2009 13:53:47 +0200 Subject: Doc: Mark new overloads with \since 4.6. --- src/opengl/qgl.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp index bfb004e..665290c 100644 --- a/src/opengl/qgl.cpp +++ b/src/opengl/qgl.cpp @@ -1718,7 +1718,7 @@ Q_OPENGL_EXPORT QGLShareRegister* qgl_share_reg() the top left corner. Inverting the texture implies a deep copy prior to upload. - \value MipmapBindOption Specifies that bindTexture should try + \value MipmapBindOption Specifies that bindTexture() should try to generate mipmaps. If the GL implementation supports the \c GL_SGIS_generate_mipmap extension, mipmaps will be automatically generated for the texture. Mipmap generation is only supported for @@ -2361,6 +2361,8 @@ GLuint QGLContext::bindTexture(const QImage &image, GLenum target, GLint format) } /*! + \since 4.6 + Generates and binds a 2D GL texture to the current context, based on \a image. The generated texture id is returned and can be used in later \c glBindTexture() calls. @@ -2422,6 +2424,7 @@ GLuint QGLContext::bindTexture(const QPixmap &pixmap, GLenum target, GLint forma /*! \overload + \since 4.6 Generates and binds a 2D GL texture to the current context, based on \a pixmap. @@ -4503,6 +4506,7 @@ GLuint QGLWidget::bindTexture(const QImage &image, GLenum target, GLint format) /*! \overload + \since 4.6 The binding \a options are a set of options used to decide how to bind the texture to the context. @@ -4544,6 +4548,7 @@ GLuint QGLWidget::bindTexture(const QPixmap &pixmap, GLenum target, GLint format /*! \overload + \since 4.6 Generates and binds a 2D GL texture to the current context, based on \a pixmap. The generated texture id is returned and can be used in -- cgit v0.12 From 8b179f84f10eb84d9e76662959d2b39e4316d6f9 Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Thu, 1 Oct 2009 14:53:18 +0300 Subject: Fixed QPixmap::fromImage when using Format_Mono for Symbian. The intermediate sourceImage was stored to wrong QImage object (image instead of correct sourceImage). This made subsequent switch-case statement to fail because destFormat was set to QImage::Format_Invalid Autotest: Fixes QItemDelegate::decoration autotest Reviewed-by: Jani Hautakangas --- src/gui/image/qpixmap_s60.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui/image/qpixmap_s60.cpp b/src/gui/image/qpixmap_s60.cpp index dccc691..4938442 100644 --- a/src/gui/image/qpixmap_s60.cpp +++ b/src/gui/image/qpixmap_s60.cpp @@ -476,9 +476,9 @@ void QS60PixmapData::fromImage(const QImage &img, Qt::ImageConversionFlags flags sourceImage = img.convertToFormat(QImage::Format_MonoLSB); } else { if (img.depth() == 1) { - image = img.hasAlphaChannel() - ? img.convertToFormat(QImage::Format_ARGB32_Premultiplied) - : img.convertToFormat(QImage::Format_RGB32); + sourceImage = img.hasAlphaChannel() + ? img.convertToFormat(QImage::Format_ARGB32_Premultiplied) + : img.convertToFormat(QImage::Format_RGB32); } else { QImage::Format opaqueFormat = QNativeImage::systemFormat(); -- cgit v0.12 From 05b7c4d75e9d77aafce285659ec4a2dd3c55691b Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Thu, 1 Oct 2009 14:57:31 +0300 Subject: Fixed qitemdelegate autotest compilation with Nokia X86 compiler. Reviewed-by: TrustMe --- tests/auto/qitemdelegate/tst_qitemdelegate.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/auto/qitemdelegate/tst_qitemdelegate.cpp b/tests/auto/qitemdelegate/tst_qitemdelegate.cpp index 5d1034a..426887d 100644 --- a/tests/auto/qitemdelegate/tst_qitemdelegate.cpp +++ b/tests/auto/qitemdelegate/tst_qitemdelegate.cpp @@ -865,7 +865,7 @@ void tst_QItemDelegate::decoration() qt_x11_wait_for_window_manager(&table); #endif QApplication::setActiveWindow(&table); - QTRY_COMPARE(QApplication::activeWindow(), &table); + QTRY_COMPARE(QApplication::activeWindow(), static_cast(&table)); QVariant value; switch ((QVariant::Type)type) { -- cgit v0.12 From 276496e9f646be3c442d46fda4298e00330763c2 Mon Sep 17 00:00:00 2001 From: Paul Olav Tvete Date: Thu, 1 Oct 2009 14:06:11 +0200 Subject: Make test pass even if printer names contain punctuation Reviewed-by: Jesper --- tests/auto/qprinterinfo/tst_qprinterinfo.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/auto/qprinterinfo/tst_qprinterinfo.cpp b/tests/auto/qprinterinfo/tst_qprinterinfo.cpp index 2fa7515..7352524 100644 --- a/tests/auto/qprinterinfo/tst_qprinterinfo.cpp +++ b/tests/auto/qprinterinfo/tst_qprinterinfo.cpp @@ -134,7 +134,7 @@ QStringList tst_QPrinterInfo::getPrintersFromSystem() QString output = getOutputFromCommand(command); QStringList list = output.split(QChar::fromLatin1('\n')); - QRegExp reg("^[Pp]rinter ([a-zA-Z0-9_]+)"); + QRegExp reg("^[Pp]rinter ([.a-zA-Z0-9_-]+)"); for (int c = 0; c < list.size(); ++c) { if (reg.indexIn(list[c]) >= 0) { QString printer = reg.cap(1); -- cgit v0.12 From 938ba08e7bf90063127b298da25a124441659e89 Mon Sep 17 00:00:00 2001 From: Markus Goetz Date: Thu, 1 Oct 2009 13:42:15 +0200 Subject: tst_qhttpnetworkconnection: Add a priority test Add a testcase that checks that high priority requests are actually high priority. Reviewed-by: Peter Hartmann --- .../tst_qhttpnetworkconnection.cpp | 59 ++++++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/tests/auto/qhttpnetworkconnection/tst_qhttpnetworkconnection.cpp b/tests/auto/qhttpnetworkconnection/tst_qhttpnetworkconnection.cpp index 470e57f..6036a14 100644 --- a/tests/auto/qhttpnetworkconnection/tst_qhttpnetworkconnection.cpp +++ b/tests/auto/qhttpnetworkconnection/tst_qhttpnetworkconnection.cpp @@ -106,6 +106,7 @@ private Q_SLOTS: void getMultiple_data(); void getMultiple(); void getMultipleWithPipeliningAndMultiplePriorities(); + void getMultipleWithPriorities(); }; tst_QHttpNetworkConnection::tst_QHttpNetworkConnection() @@ -908,5 +909,63 @@ void tst_QHttpNetworkConnection::getMultipleWithPipeliningAndMultiplePriorities( qDeleteAll(replies); } +class GetMultipleWithPrioritiesReceiver : public QObject +{ + Q_OBJECT +public: + int highPrioReceived; + int lowPrioReceived; + int requestCount; + GetMultipleWithPrioritiesReceiver(int rq) : highPrioReceived(0), lowPrioReceived(0), requestCount(rq) { } +public Q_SLOTS: + void finishedSlot() { + QHttpNetworkReply *reply = (QHttpNetworkReply*) sender(); + if (reply->request().priority() == QHttpNetworkRequest::HighPriority) + highPrioReceived++; + else if (reply->request().priority() == QHttpNetworkRequest::LowPriority) + lowPrioReceived++; + else + QFAIL("Wrong priority!?"); + + QVERIFY(highPrioReceived >= lowPrioReceived); + + if (highPrioReceived + lowPrioReceived == requestCount) + QTestEventLoop::instance().exitLoop(); + } +}; + +void tst_QHttpNetworkConnection::getMultipleWithPriorities() +{ + quint16 requestCount = 100; + // use 2 connections. + QHttpNetworkConnection connection(2, QtNetworkSettings::serverName()); + GetMultipleWithPrioritiesReceiver receiver(requestCount); + QUrl url("http://" + QtNetworkSettings::serverName() + "/qtest/rfc3252.txt"); + QList requests; + QList replies; + + for (int i = 0; i < requestCount; i++) { + QHttpNetworkRequest *request = new QHttpNetworkRequest(url);; + + if (i % 2) + request->setPriority(QHttpNetworkRequest::HighPriority); + else + request->setPriority(QHttpNetworkRequest::LowPriority); + + requests.append(request); + QHttpNetworkReply *reply = connection.sendRequest(*request); + connect(reply, SIGNAL(finished()), &receiver, SLOT(finishedSlot())); + replies.append(reply); + } + + QTestEventLoop::instance().enterLoop(40); + QVERIFY(!QTestEventLoop::instance().timeout()); + + qDeleteAll(requests); + qDeleteAll(replies); +} + + + QTEST_MAIN(tst_QHttpNetworkConnection) #include "tst_qhttpnetworkconnection.moc" -- cgit v0.12 From 072e748adbdab1d51b240b9983ce82b213b66f18 Mon Sep 17 00:00:00 2001 From: Jeremy Katz Date: Thu, 1 Oct 2009 14:08:11 +0200 Subject: Enable qws/qvfb use for multiple users on one machine Task-number: QTBUG-1711 Reviewed-by: Paul --- src/gui/embedded/qscreenvfb_qws.cpp | 8 +++----- src/gui/embedded/qsoundqss_qws.cpp | 11 ++++++----- src/gui/embedded/qvfbhdr.h | 19 ++++++++++++++++--- src/gui/embedded/qwscommand_qws_p.h | 2 -- src/gui/kernel/qapplication_qws.cpp | 18 +++++++----------- tools/qvfb/qvfb.cpp | 7 ++++--- tools/qvfb/qvfbprotocol.cpp | 6 ++++-- tools/qvfb/qvfbshmem.cpp | 8 +++----- 8 files changed, 43 insertions(+), 36 deletions(-) diff --git a/src/gui/embedded/qscreenvfb_qws.cpp b/src/gui/embedded/qscreenvfb_qws.cpp index 19d4fa8..d71336d 100644 --- a/src/gui/embedded/qscreenvfb_qws.cpp +++ b/src/gui/embedded/qscreenvfb_qws.cpp @@ -196,7 +196,7 @@ bool QVFbScreen::connect(const QString &displaySpec) if (displayArgs.contains(QLatin1String("Gray"))) grayscale = true; - key_t key = ftok(QByteArray(QT_VFB_MOUSE_PIPE).replace("%1", QByteArray::number(displayId)), 'b'); + key_t key = ftok(QT_VFB_MOUSE_PIPE(displayId).toLocal8Bit(), 'b'); if (key == -1) return false; @@ -330,8 +330,7 @@ void QVFbScreen::disconnect() bool QVFbScreen::initDevice() { #ifndef QT_NO_QWS_MOUSE_QVFB - const QString mouseDev = QString::fromLatin1(QT_VFB_MOUSE_PIPE) - .arg(displayId); + const QString mouseDev = QT_VFB_MOUSE_PIPE(displayId); d_ptr->mouse = new QVFbMouseHandler(QLatin1String("QVFbMouse"), mouseDev); qwsServer->setDefaultMouse("None"); if (d_ptr->mouse) @@ -339,8 +338,7 @@ bool QVFbScreen::initDevice() #endif #if !defined(QT_NO_QWS_KBD_QVFB) && !defined(QT_NO_QWS_KEYBOARD) - const QString keyboardDev = QString::fromLatin1(QT_VFB_KEYBOARD_PIPE) - .arg(displayId); + const QString keyboardDev = QT_VFB_KEYBOARD_PIPE(displayId); d_ptr->keyboard = new QVFbKeyboardHandler(keyboardDev); qwsServer->setDefaultKeyboard("None"); #endif diff --git a/src/gui/embedded/qsoundqss_qws.cpp b/src/gui/embedded/qsoundqss_qws.cpp index 6bac8dc..b859be5 100644 --- a/src/gui/embedded/qsoundqss_qws.cpp +++ b/src/gui/embedded/qsoundqss_qws.cpp @@ -67,6 +67,8 @@ #include +#include + extern int errno; QT_BEGIN_NAMESPACE @@ -79,7 +81,6 @@ QT_BEGIN_NAMESPACE static int sound_speed = 44100; #ifndef QT_NO_QWS_SOUNDSERVER extern int qws_display_id; -#define SOUND_PIPE "/tmp/.qt_soundserver-%1" #endif static char *zeroMem = 0; @@ -708,7 +709,7 @@ protected: #ifndef QT_NO_QWS_SOUNDSERVER QWSSoundServerSocket::QWSSoundServerSocket(QObject *parent) : - QWSServerSocket(QString::fromLatin1(SOUND_PIPE).arg(qws_display_id), parent) + QWSServerSocket(QT_VFB_SOUND_PIPE(qws_display_id), parent) { connect(this, SIGNAL(newConnection()), this, SLOT(newConnection())); } @@ -716,7 +717,7 @@ QWSSoundServerSocket::QWSSoundServerSocket(QObject *parent) : #ifdef QT3_SUPPORT QWSSoundServerSocket::QWSSoundServerSocket(QObject *parent, const char *name) : - QWSServerSocket(QString::fromLatin1(SOUND_PIPE).arg(qws_display_id), parent) + QWSServerSocket(QT_VFB_SOUND_PIPE(qws_display_id), parent) { if (name) setObjectName(QString::fromAscii(name)); @@ -1395,7 +1396,7 @@ void QWSSoundServer::translateSoundCompleted( int, int sid ) QWSSoundClient::QWSSoundClient(QObject* parent) : QWSSocket(parent) { - connectToLocalFile(QString::fromLatin1(SOUND_PIPE).arg(qws_display_id)); + connectToLocalFile(QT_VFB_SOUND_PIPE(qws_display_id)); QObject::connect(this,SIGNAL(readyRead()), this,SLOT(tryReadCommand())); if( state() == QWS_SOCK_BASE::ConnectedState ) QTimer::singleShot(1, this, SIGNAL(connected())); @@ -1409,7 +1410,7 @@ QWSSoundClient::~QWSSoundClient( ) void QWSSoundClient::reconnect() { - connectToLocalFile(QString::fromLatin1(SOUND_PIPE).arg(qws_display_id)); + connectToLocalFile(QT_VFB_SOUND_PIPE(qws_display_id)); if( state() == QWS_SOCK_BASE::ConnectedState ) emit connected(); else emit error( QTcpSocket::ConnectionRefusedError ); } diff --git a/src/gui/embedded/qvfbhdr.h b/src/gui/embedded/qvfbhdr.h index 73e08e0..f02286e 100644 --- a/src/gui/embedded/qvfbhdr.h +++ b/src/gui/embedded/qvfbhdr.h @@ -52,9 +52,22 @@ QT_BEGIN_NAMESPACE QT_MODULE(Gui) -#define QT_VFB_MOUSE_PIPE "/tmp/.qtvfb_mouse-%1" -#define QT_VFB_KEYBOARD_PIPE "/tmp/.qtvfb_keyboard-%1" -#define QT_VFB_MAP "/tmp/.qtvfb_map-%1" +#ifndef QT_QWS_TEMP_DIR +#define QT_QWS_TEMP_DIR "/tmp" +#endif + +#define QT_VFB_DATADIR(DISPLAY) QString("%1/qtembedded-%2-%3") \ + .arg(QT_QWS_TEMP_DIR).arg(getuid()).arg(DISPLAY) + +#define QT_VFB_MOUSE_PIPE(DISPLAY) QT_VFB_DATADIR(DISPLAY) \ + .append("/qtvfb_mouse") +#define QT_VFB_KEYBOARD_PIPE(DISPLAY) QT_VFB_DATADIR(DISPLAY) \ + .append("/qtvfb_keyboard") +#define QT_VFB_MAP(DISPLAY) QT_VFB_DATADIR(DISPLAY) \ + .append("/qtvfb_map") +#define QT_VFB_SOUND_PIPE(DISPLAY) QT_VFB_DATADIR(DISPLAY) \ + .append("/qt_soundserver") +#define QTE_PIPE "QtEmbedded" struct QVFbHeader { diff --git a/src/gui/embedded/qwscommand_qws_p.h b/src/gui/embedded/qwscommand_qws_p.h index d92c6af..f986a9d 100644 --- a/src/gui/embedded/qwscommand_qws_p.h +++ b/src/gui/embedded/qwscommand_qws_p.h @@ -75,8 +75,6 @@ QT_BEGIN_NAMESPACE QT_MODULE(Gui) -#define QTE_PIPE "QtEmbedded-%1" - class QRect; /********************************************************************* diff --git a/src/gui/kernel/qapplication_qws.cpp b/src/gui/kernel/qapplication_qws.cpp index e9284f7..01c64f1 100644 --- a/src/gui/kernel/qapplication_qws.cpp +++ b/src/gui/kernel/qapplication_qws.cpp @@ -110,6 +110,8 @@ #include #include +#include + #ifndef QT_NO_QWS_MULTIPROCESS #ifdef QT_NO_QSHM #include @@ -199,14 +201,9 @@ QString qws_dataDir() static QString result; if (!result.isEmpty()) return result; - QByteArray dataDir; -#ifdef QT_QWS_TEMP_DIR - dataDir = QT_QWS_TEMP_DIR; -#else - dataDir = "/tmp"; -#endif - dataDir += "/qtembedded-"; - dataDir += QByteArray::number(qws_display_id); + result = QT_VFB_DATADIR(qws_display_id); + QByteArray dataDir = result.toLocal8Bit(); + if (QT_MKDIR(dataDir, 0700)) { if (errno != EEXIST) { qFatal("Cannot create Qt for Embedded Linux data directory: %s", dataDir.constData()); @@ -227,16 +224,15 @@ QString qws_dataDir() if ((buf.st_mode & 0677) != 0600) qFatal("Qt for Embedded Linux data directory has incorrect permissions: %s", dataDir.constData()); #endif - dataDir += '/'; - result = QString::fromLocal8Bit(dataDir); + result.append("/"); return result; } // Get the filename of the pipe Qt for Embedded Linux uses for server/client comms Q_GUI_EXPORT QString qws_qtePipeFilename() { - return (qws_dataDir() + QString::fromLatin1(QTE_PIPE).arg(qws_display_id)); + return (qws_dataDir().append(QTE_PIPE)); } static void setMaxWindowRect(const QRect &rect) diff --git a/tools/qvfb/qvfb.cpp b/tools/qvfb/qvfb.cpp index 879fb6b..6119419 100644 --- a/tools/qvfb/qvfb.cpp +++ b/tools/qvfb/qvfb.cpp @@ -41,6 +41,7 @@ #include "qvfb.h" #include "qvfbview.h" +#include "qvfbhdr.h" #ifdef Q_WS_X11 #include "qvfbx11view.h" #endif @@ -134,7 +135,7 @@ static const char *red_off_led_xpm[] = { static bool copyButtonConfiguration(const QString &prefix, int displayId) { - const QString destDir = QString(QLatin1String("/tmp/qtembedded-%1/")).arg(displayId); + const QString destDir = QT_VFB_DATADIR(displayId); const QFileInfo src(prefix + QLatin1String("defaultbuttons.conf")); const QFileInfo dst(destDir + QLatin1String("defaultbuttons.conf")); unlink(dst.absoluteFilePath().toLatin1().constData()); @@ -351,9 +352,9 @@ void QVFb::init( int display_id, int pw, int ph, int d, int r, const QString& sk ph += 2; // avoid scrollbar scroller->show(); // delete defaultbuttons.conf if it was left behind... - unlink(QFileInfo(QString("/tmp/qtembedded-%1/defaultbuttons.conf").arg(view->displayId())).absoluteFilePath().toLatin1().constData()); + unlink(QFileInfo(QT_VFB_DATADIR(view->displayId()).append("/defaultbuttons.conf")).absoluteFilePath().toLatin1().constData()); if (secondaryView) - unlink(QFileInfo(QString("/tmp/qtembedded-%1/defaultbuttons.conf").arg(view->displayId()+1)).absoluteFilePath().toLatin1().constData()); + unlink(QFileInfo(QT_VFB_DATADIR(view->displayId() + 1).append("/defaultbuttons.conf")).absoluteFilePath().toLatin1().constData()); } view->setRate(refreshRate); if (secondaryView) { diff --git a/tools/qvfb/qvfbprotocol.cpp b/tools/qvfb/qvfbprotocol.cpp index b09ed0e..df6c110 100644 --- a/tools/qvfb/qvfbprotocol.cpp +++ b/tools/qvfb/qvfbprotocol.cpp @@ -56,6 +56,8 @@ #include #endif +#include "qvfbshmem.h" + QT_BEGIN_NAMESPACE QVFbViewProtocol::QVFbViewProtocol(int display_id, QObject *parent) : @@ -90,7 +92,7 @@ static int openPipe(const char *fileName) QVFbKeyPipeProtocol::QVFbKeyPipeProtocol(int display_id) : QVFbKeyProtocol(display_id) { - fileName = QString(QT_VFB_KEYBOARD_PIPE).arg(display_id); + fileName = QT_VFB_KEYBOARD_PIPE(display_id); fd = openPipe(fileName.toLocal8Bit().constData()); if (fd == -1) @@ -119,7 +121,7 @@ void QVFbKeyPipeProtocol::sendKeyboardData(QString unicode, int keycode, QVFbMousePipe::QVFbMousePipe(int display_id) : QVFbMouseProtocol(display_id) { - fileName = QString(QT_VFB_MOUSE_PIPE).arg(display_id); + fileName = QT_VFB_MOUSE_PIPE(display_id); fd = openPipe(fileName.toLocal8Bit().constData()); if (fd == -1) diff --git a/tools/qvfb/qvfbshmem.cpp b/tools/qvfb/qvfbshmem.cpp index 0d2b3ca..8c4cdb9 100644 --- a/tools/qvfb/qvfbshmem.cpp +++ b/tools/qvfb/qvfbshmem.cpp @@ -44,8 +44,6 @@ #include "qvfbshmem.h" #include "qvfbhdr.h" -#define QTE_PIPE "QtEmbedded-%1" - #include #include @@ -71,7 +69,7 @@ QT_BEGIN_NAMESPACE // live. static QString qws_dataDir(int qws_display_id) { - QByteArray dataDir = QString("/tmp/qtembedded-%1").arg(qws_display_id).toLocal8Bit(); + QByteArray dataDir = QT_VFB_DATADIR(qws_display_id).toLocal8Bit(); if (mkdir(dataDir, 0700)) { if (errno != EEXIST) { qFatal("Cannot create Qt for Embedded Linux data directory: %s", dataDir.constData()); @@ -151,6 +149,8 @@ QShMemViewProtocol::QShMemViewProtocol(int displayid, const QSize &s, } } + displayPipe = qws_dataDir(displayid).append(QTE_PIPE); + kh = new QVFbKeyPipeProtocol(displayid); /* should really depend on receiving qt version, but how can one tell? */ @@ -209,8 +209,6 @@ QShMemViewProtocol::QShMemViewProtocol(int displayid, const QSize &s, hdr->brightness = 255; hdr->windowId = 0; - displayPipe = qws_dataDir(displayid) + QString(QTE_PIPE).arg(displayid); - displayPiped = displayPipe + 'd'; -- cgit v0.12 From 0b24f1996debc24a9af2bd1dc921f347506ac32c Mon Sep 17 00:00:00 2001 From: Markus Goetz Date: Thu, 1 Oct 2009 14:03:31 +0200 Subject: QNAM HTTP Code: Always send an Accept-Language header Send a header that we accept every language. Works around a bug in some broken websites and is hopefully of no harm for us. Task-number: QT-952 Reviewed-by: Thiago --- src/network/access/qhttpnetworkconnection.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/network/access/qhttpnetworkconnection.cpp b/src/network/access/qhttpnetworkconnection.cpp index 4fcbc1f..aef1258 100644 --- a/src/network/access/qhttpnetworkconnection.cpp +++ b/src/network/access/qhttpnetworkconnection.cpp @@ -244,6 +244,15 @@ void QHttpNetworkConnectionPrivate::prepareRequest(HttpMessagePair &messagePair) request.d->autoDecompress = false; #endif } + + // some websites mandate an accept-language header and fail + // if it is not sent. This is a problem with the website and + // not with us, but we work around this by setting a + // universal one always. + value = request.headerField("accept-language"); + if (value.isEmpty()) + request.setHeaderField("accept-language", "en,*"); + // set the User Agent value = request.headerField("user-agent"); if (value.isEmpty()) -- cgit v0.12 From 5af79b7efd66ff2ce014cb480d27f768ffa19215 Mon Sep 17 00:00:00 2001 From: Thierry Bastian Date: Thu, 1 Oct 2009 14:09:28 +0200 Subject: Try to fix autotest Also improves a bit the quality of the code by sending the event instead of calling directly the event handler --- tests/auto/qtableview/tst_qtableview.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/auto/qtableview/tst_qtableview.cpp b/tests/auto/qtableview/tst_qtableview.cpp index 71218a3..59e80c5 100644 --- a/tests/auto/qtableview/tst_qtableview.cpp +++ b/tests/auto/qtableview/tst_qtableview.cpp @@ -378,7 +378,6 @@ public: } bool checkSignalOrder; - using QTableView::wheelEvent; public slots: void currentChanged(QModelIndex , QModelIndex ) { hasCurrentChanged++; @@ -3222,6 +3221,7 @@ void tst_QTableView::mouseWheel() for (int c = 0; c < 100; ++c) view.setColumnWidth(c, 100); view.show(); + QTest::qWaitForWindowShown(view); view.setModel(&model); @@ -3230,12 +3230,13 @@ void tst_QTableView::mouseWheel() view.horizontalScrollBar()->setValue(10); view.verticalScrollBar()->setValue(10); - QPoint pos(100,100); + 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); - view.wheelEvent(&horizontalEvent); + QApplication::sendEvent(view.viewport(), &horizontalEvent); QVERIFY(qAbs(view.horizontalScrollBar()->value() - horizontalPositon) < 10); - view.wheelEvent(&verticalEvent); + QApplication::sendEvent(view.viewport(), &verticalEvent); QVERIFY(qAbs(view.verticalScrollBar()->value() - verticalPosition) < 10); } -- cgit v0.12 From b2f87d7217df22d1cf244907757810d0afb70ad8 Mon Sep 17 00:00:00 2001 From: Thierry Bastian Date: Thu, 1 Oct 2009 14:13:06 +0200 Subject: oops.. fixed compilation of test --- tests/auto/qtableview/tst_qtableview.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/auto/qtableview/tst_qtableview.cpp b/tests/auto/qtableview/tst_qtableview.cpp index 59e80c5..03f4966 100644 --- a/tests/auto/qtableview/tst_qtableview.cpp +++ b/tests/auto/qtableview/tst_qtableview.cpp @@ -3221,7 +3221,7 @@ void tst_QTableView::mouseWheel() for (int c = 0; c < 100; ++c) view.setColumnWidth(c, 100); view.show(); - QTest::qWaitForWindowShown(view); + QTest::qWaitForWindowShown(&view); view.setModel(&model); -- cgit v0.12 From b718b80cd94063b491ba7695ccd2902c2819141b Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Thu, 1 Oct 2009 14:00:03 +0200 Subject: warning fix in qgraphicseffect_p.h for qreal == float Reviewed-by: thartman --- src/gui/effects/qgraphicseffect_p.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/effects/qgraphicseffect_p.h b/src/gui/effects/qgraphicseffect_p.h index 96eda0e..ff2fb85 100644 --- a/src/gui/effects/qgraphicseffect_p.h +++ b/src/gui/effects/qgraphicseffect_p.h @@ -189,7 +189,7 @@ class QGraphicsBloomEffectPrivate : public QGraphicsEffectPrivate { Q_DECLARE_PUBLIC(QGraphicsBlurEffect) public: - QGraphicsBloomEffectPrivate() : brightness(70), strength(0.7) {} + QGraphicsBloomEffectPrivate() : brightness(70), strength(qreal(0.7)) {} QPixmapBlurFilter blurFilter; int colorTable[256]; -- cgit v0.12 From 9a2fe76443e814c221f308f8fe37ef6fcccbcf74 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Thu, 1 Oct 2009 14:12:30 +0200 Subject: fix minimizing for Windows CE and Windows mobile Task-number: QT-2243 Reviewed-by: thartman --- src/gui/kernel/qapplication_win.cpp | 19 ++++++++++++++----- src/gui/kernel/qguifunctions_wince.cpp | 13 +++++-------- src/gui/kernel/qwidget_wince.cpp | 26 +++++++++++--------------- tests/auto/qwidget/tst_qwidget.cpp | 10 ---------- 4 files changed, 30 insertions(+), 38 deletions(-) diff --git a/src/gui/kernel/qapplication_win.cpp b/src/gui/kernel/qapplication_win.cpp index eb9e276..44f82b6 100644 --- a/src/gui/kernel/qapplication_win.cpp +++ b/src/gui/kernel/qapplication_win.cpp @@ -1967,13 +1967,22 @@ LRESULT CALLBACK QtWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam // where it got it from; it would simply get a 0 value as the old focus widget. #ifdef Q_WS_WINCE { - if (widget->windowState() & Qt::WindowMinimized) { - if (widget->windowState() & Qt::WindowMaximized) - widget->showMaximized(); - else - widget->show(); +#ifdef Q_WS_WINCE_WM + // On Windows mobile we do not receive WM_SYSCOMMAND / SC_MINIMIZE messages. + // Thus we have to unset the minimized state explicitly. We must do this for all + // top-level widgets, because we get the HWND of a random widget here. + foreach (QWidget* tlw, QApplication::topLevelWidgets()) { + if (tlw->isMinimized()) + tlw->setWindowState(tlw->windowState() & ~Qt::WindowMinimized); } #else + // On Windows CE we do not receive WM_SYSCOMMAND / SC_MINIMIZE messages. + // Thus we have to unset the minimized state explicitly. + if (widget->windowState() & Qt::WindowMinimized) + widget->setWindowState(widget->windowState() & ~Qt::WindowMinimized); +#endif // Q_WS_WINCE_WM + +#else if (!(widget->windowState() & Qt::WindowMinimized)) { #endif // Ignore the activate message send by WindowsXP to a minimized window diff --git a/src/gui/kernel/qguifunctions_wince.cpp b/src/gui/kernel/qguifunctions_wince.cpp index 048780e..58e12ee 100644 --- a/src/gui/kernel/qguifunctions_wince.cpp +++ b/src/gui/kernel/qguifunctions_wince.cpp @@ -329,17 +329,14 @@ void qt_wince_maximize(QWidget *widget) void qt_wince_minimize(HWND hwnd) { - uint exstyle = GetWindowLongW(hwnd, GWL_EXSTYLE); - uint style = GetWindowLongW(hwnd, GWL_STYLE); - RECT rect; - RECT crect = {0,0,0,0}; - GetWindowRect(hwnd, &rect); - AdjustWindowRectEx(&crect, style & ~WS_OVERLAPPED, FALSE, exstyle); - MoveWindow(hwnd, rect.left - crect.left, rect.top - crect.top, 0, 0, true); - SetWindowLong(hwnd, GWL_EXSTYLE, GetWindowLong (hwnd, GWL_EXSTYLE) | WS_EX_NODRAG); #ifdef Q_OS_WINCE_WM ShowWindow(hwnd, SW_HIDE); #else + if (!IsWindowVisible(hwnd)) { + // Hack for an initial showMinimized. + // Without it, our widget doesn't appear in the task bar. + ShowWindow(hwnd, SW_SHOW); + } ShowWindow(hwnd, SW_MINIMIZE); #endif } diff --git a/src/gui/kernel/qwidget_wince.cpp b/src/gui/kernel/qwidget_wince.cpp index 32e8e7f..c0664f4 100644 --- a/src/gui/kernel/qwidget_wince.cpp +++ b/src/gui/kernel/qwidget_wince.cpp @@ -416,6 +416,10 @@ void QWidgetPrivate::show_sys() { SetWindowLong(q->internalWinId(), GWL_STYLE, style | WS_MAXIMIZEBOX); } } else +#else + // Imitate minimizing on Windows mobile by hiding the widget. + if (q->isMinimized()) + sm = SW_HIDE; #endif if (q->isHidden()) { sm = SW_HIDE; @@ -428,8 +432,7 @@ void QWidgetPrivate::show_sys() { sm = SW_SHOWNOACTIVATE; } - if (!(data.window_state & Qt::WindowMinimized)) - ShowWindow(q->internalWinId(), sm); + ShowWindow(q->internalWinId(), sm); if (q->isMaximized() && q->isWindow()) qt_wince_maximize(q); @@ -438,7 +441,7 @@ void QWidgetPrivate::show_sys() { if (!qt_wince_is_mobile() && q->isFullScreen()) { HWND handle = FindWindow(L"HHTaskBar", L""); if (handle) { - ShowWindow(handle, 0); + ShowWindow(handle, SW_HIDE); EnableWindow(handle, false); } } @@ -468,17 +471,12 @@ void QWidget::setWindowState(Qt::WindowStates newstate) return; int max = SW_SHOWNORMAL; - int min = SW_SHOWNOACTIVATE; - int normal = SW_SHOWNOACTIVATE; if ((oldstate & Qt::WindowMinimized) && !(newstate & Qt::WindowMinimized)) newstate |= Qt::WindowActive; - if (newstate & Qt::WindowActive) { - max = SW_SHOWNORMAL; - min = SW_SHOWNORMAL; + if (newstate & Qt::WindowActive) normal = SW_SHOWNORMAL; - } if (isWindow()) { createWinId(); Q_ASSERT(testAttribute(Qt::WA_WState_Created)); @@ -556,13 +554,11 @@ void QWidget::setWindowState(Qt::WindowStates newstate) } } if ((oldstate & Qt::WindowMinimized) != (newstate & Qt::WindowMinimized)) { - if (isVisible()) { - ShowWindow(internalWinId(), (newstate & Qt::WindowMinimized) ? min : - (newstate & Qt::WindowMaximized) ? max : normal); - if (newstate & Qt::WindowMaximized) - qt_wince_maximize(this); if (newstate & Qt::WindowMinimized) qt_wince_minimize(internalWinId()); + else if (newstate & Qt::WindowMaximized) { + ShowWindow(internalWinId(), max); + qt_wince_maximize(this); } } if ((newstate & Qt::WindowMaximized) && !(newstate & Qt::WindowFullScreen)) { @@ -588,7 +584,7 @@ void QWidgetPrivate::deleteSysExtra() if (!qt_wince_is_mobile() && q->isFullScreen()) { HWND handle = FindWindow(L"HHTaskBar", L""); if (handle) { - ShowWindow(handle, 1); + ShowWindow(handle, SW_SHOWNORMAL); EnableWindow(handle, true); } } diff --git a/tests/auto/qwidget/tst_qwidget.cpp b/tests/auto/qwidget/tst_qwidget.cpp index c4e62ef..e4608b2 100644 --- a/tests/auto/qwidget/tst_qwidget.cpp +++ b/tests/auto/qwidget/tst_qwidget.cpp @@ -8046,13 +8046,8 @@ void tst_QWidget::doubleRepaint() QTRY_COMPARE(widget.numPaintEvents, expectedRepaints); widget.numPaintEvents = 0; -#ifndef Q_OS_WINCE //still no proper minimizing // Minmize: Should not trigger a repaint. widget.showMinimized(); -#else - // Hide: Should not trigger a repaint. - widget.hide(); -#endif QTest::qWait(10); QCOMPARE(widget.numPaintEvents, 0); widget.numPaintEvents = 0; @@ -8061,12 +8056,7 @@ void tst_QWidget::doubleRepaint() widget.showNormal(); QTest::qWaitForWindowShown(&widget); QTest::qWait(10); -#ifndef Q_OS_WINCE QCOMPARE(widget.numPaintEvents, 0); -#else - // We called hide(), and then it'll get repainted once it's shown again. - QCOMPARE(widget.numPaintEvents, 1); -#endif } #ifndef Q_WS_MAC -- cgit v0.12 From ec05eed4fa68b7b1af2dead4fdbb83cd3a758ac0 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 1 Oct 2009 12:51:41 +0200 Subject: make -help reflect reality --- tools/linguist/lupdate/main.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tools/linguist/lupdate/main.cpp b/tools/linguist/lupdate/main.cpp index 8818b50..8560c7d 100644 --- a/tools/linguist/lupdate/main.cpp +++ b/tools/linguist/lupdate/main.cpp @@ -119,12 +119,11 @@ static void printUsage() " Name of a .pro file. Useful for files with .pro\n" " file syntax but different file suffix\n" " -source-language [_]\n" - " Specify/override the language of the source strings. Defaults to\n" - " POSIX if not specified and the file does not name it yet.\n" + " Specify the language of the source strings for new files.\n" + " Defaults to POSIX if not specified.\n" " -target-language [_]\n" - " Specify/override the language of the translation.\n" - " The target language is guessed from the file name if this option\n" - " is not specified and the file contents name no language yet.\n" + " Specify the language of the translations for new files.\n" + " Guessed from the file name if not specified.\n" " -version\n" " Display the version of lupdate and exit.\n" ).arg(m_defaultExtensions)); -- cgit v0.12 From ce7cf03ab1346b5f447db3d849d2c183abce0138 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 1 Oct 2009 13:37:21 +0200 Subject: make -{source,target}-language actually override values from files -help says it does, and it kinda makes sense --- tools/linguist/lconvert/main.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/linguist/lconvert/main.cpp b/tools/linguist/lconvert/main.cpp index c342def..3cc9509 100644 --- a/tools/linguist/lconvert/main.cpp +++ b/tools/linguist/lconvert/main.cpp @@ -215,10 +215,6 @@ int main(int argc, char *argv[]) return usage(args); tr.setLanguageCode(Translator::guessLanguageCodeFromFileName(inFiles[0].name)); - if (!targetLanguage.isEmpty()) - tr.setLanguageCode(targetLanguage); - if (!sourceLanguage.isEmpty()) - tr.setSourceLanguageCode(sourceLanguage); if (!tr.load(inFiles[0].name, cd, inFiles[0].format)) { qWarning() << qPrintable(cd.error()); @@ -237,6 +233,10 @@ int main(int argc, char *argv[]) tr.replaceSorted(tr2.message(j)); } + if (!targetLanguage.isEmpty()) + tr.setLanguageCode(targetLanguage); + if (!sourceLanguage.isEmpty()) + tr.setSourceLanguageCode(sourceLanguage); if (noObsolete) tr.stripObsoleteMessages(); if (noFinished) -- cgit v0.12 From 5e8e4ac80db41887902d840a92b415137857f1dd Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Thu, 1 Oct 2009 14:26:26 +0200 Subject: Doc: RTOS'es are available under a commerical license, without support. Also point to the right contact-us address. --- doc/src/platforms/supported-platforms.qdoc | 9 ++++++++- doc/src/qt-webpages.qdoc | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/doc/src/platforms/supported-platforms.qdoc b/doc/src/platforms/supported-platforms.qdoc index f03f758..788af67 100644 --- a/doc/src/platforms/supported-platforms.qdoc +++ b/doc/src/platforms/supported-platforms.qdoc @@ -136,7 +136,14 @@ All platforms not specifically listed above are not supported by Nokia. Nokia does not run its unit test suite or perform any other internal tests on platforms not - listed above. Qt users should note, however, that there may be various open source + listed above. + + Even though some Tier 3 platforms are available under the Qt Commercial License, + technical support is not included in that license. + However, \l{Hot to Order}{contact our sales team} to find out about the + availability of other services for those platforms. + + Qt users should note, however, that there may be various open source projects, community users and/or Qt partners who are able to provide assistance with platforms not supported by Nokia. diff --git a/doc/src/qt-webpages.qdoc b/doc/src/qt-webpages.qdoc index e02cd19..7287656 100644 --- a/doc/src/qt-webpages.qdoc +++ b/doc/src/qt-webpages.qdoc @@ -145,7 +145,7 @@ */ /*! - \externalpage http://qt.nokia.com/contact + \externalpage http://qt.nokia.com/about/contact-us \title How to Order */ -- cgit v0.12 From 7dd756f010ee871f2e4eec10d36414969de98997 Mon Sep 17 00:00:00 2001 From: Frans Englich Date: Thu, 1 Oct 2009 14:35:13 +0200 Subject: Exclude the MMF Phonon plugin folder for qdoc. As done for the other plugins. Brought to attention by Volker. --- tools/qdoc3/test/qt.qdocconf | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/qdoc3/test/qt.qdocconf b/tools/qdoc3/test/qt.qdocconf index 7d594c7..aa8e981 100644 --- a/tools/qdoc3/test/qt.qdocconf +++ b/tools/qdoc3/test/qt.qdocconf @@ -97,6 +97,7 @@ excludedirs = $QTDIR/src/3rdparty/clucene \ $QTDIR/src/3rdparty/phonon/gstreamer \ $QTDIR/src/3rdparty/phonon/ds9 \ $QTDIR/src/3rdparty/phonon/qt7 \ + $QTDIR/src/3rdparty/phonon/mmf \ $QTDIR/src/3rdparty/phonon/waveout sources.fileextensions = "*.cpp *.qdoc *.mm" -- cgit v0.12 From d2d4fa3365beecc6fe1dca7bcffb8a9167fa991d Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Thu, 1 Oct 2009 14:45:49 +0200 Subject: qdoc: Marked some undocumented Phonon classes internal --- src/3rdparty/phonon/mmf/abstractaudioeffect.cpp | 4 ++++ src/3rdparty/phonon/mmf/abstractmediaplayer.cpp | 4 ++++ src/3rdparty/phonon/mmf/abstractplayer.cpp | 3 +++ src/3rdparty/phonon/mmf/audioequalizer.cpp | 4 ++++ src/3rdparty/phonon/mmf/audiooutput.cpp | 3 +++ src/3rdparty/phonon/mmf/audioplayer.cpp | 4 ++++ src/3rdparty/phonon/mmf/backend.cpp | 8 ++++++++ src/3rdparty/phonon/mmf/bassboost.cpp | 4 ++++ src/3rdparty/phonon/mmf/dummyplayer.cpp | 4 ++++ src/3rdparty/phonon/mmf/effectfactory.cpp | 4 ++++ src/3rdparty/phonon/mmf/mediaobject.cpp | 4 ++++ src/3rdparty/phonon/mmf/mmf_medianode.cpp | 4 ++++ src/3rdparty/phonon/mmf/mmf_videoplayer.cpp | 4 ++++ src/3rdparty/phonon/mmf/utils.cpp | 12 ++++++++++++ src/3rdparty/phonon/mmf/videooutput.cpp | 4 ++++ src/3rdparty/phonon/mmf/videowidget.cpp | 4 ++++ 16 files changed, 74 insertions(+) diff --git a/src/3rdparty/phonon/mmf/abstractaudioeffect.cpp b/src/3rdparty/phonon/mmf/abstractaudioeffect.cpp index b3155a6..a793390 100644 --- a/src/3rdparty/phonon/mmf/abstractaudioeffect.cpp +++ b/src/3rdparty/phonon/mmf/abstractaudioeffect.cpp @@ -25,6 +25,10 @@ QT_BEGIN_NAMESPACE using namespace Phonon; using namespace Phonon::MMF; +/*! \class MMF::AbstractAudioEffect + \internal +*/ + AbstractAudioEffect::AbstractAudioEffect(QObject *parent, const QList ¶ms) : MediaNode::MediaNode(parent) , m_params(params) diff --git a/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp b/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp index 8fe1e4d..2fdb092 100644 --- a/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp +++ b/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp @@ -27,6 +27,10 @@ QT_BEGIN_NAMESPACE using namespace Phonon; using namespace Phonon::MMF; +/*! \class MMF::AbstractMediaPlayer + \internal +*/ + //----------------------------------------------------------------------------- // Constants //----------------------------------------------------------------------------- diff --git a/src/3rdparty/phonon/mmf/abstractplayer.cpp b/src/3rdparty/phonon/mmf/abstractplayer.cpp index 24ef20a..e3c0ecb 100644 --- a/src/3rdparty/phonon/mmf/abstractplayer.cpp +++ b/src/3rdparty/phonon/mmf/abstractplayer.cpp @@ -25,6 +25,9 @@ QT_BEGIN_NAMESPACE using namespace Phonon; using namespace Phonon::MMF; +/*! \class MMF::AbstractPlayer + \internal +*/ //----------------------------------------------------------------------------- // Constructor / destructor diff --git a/src/3rdparty/phonon/mmf/audioequalizer.cpp b/src/3rdparty/phonon/mmf/audioequalizer.cpp index 78c6ff7..c691e1e 100644 --- a/src/3rdparty/phonon/mmf/audioequalizer.cpp +++ b/src/3rdparty/phonon/mmf/audioequalizer.cpp @@ -23,6 +23,10 @@ QT_BEGIN_NAMESPACE using namespace Phonon; using namespace Phonon::MMF; +/*! \class MMF::AudioEqualizer + \internal +*/ + AudioEqualizer::AudioEqualizer(QObject *parent) : AbstractAudioEffect::AbstractAudioEffect(parent, createParams()) { } diff --git a/src/3rdparty/phonon/mmf/audiooutput.cpp b/src/3rdparty/phonon/mmf/audiooutput.cpp index 8c8c330..58e2f5e 100644 --- a/src/3rdparty/phonon/mmf/audiooutput.cpp +++ b/src/3rdparty/phonon/mmf/audiooutput.cpp @@ -29,6 +29,9 @@ QT_BEGIN_NAMESPACE using namespace Phonon; using namespace Phonon::MMF; +/*! \class MMF::AudioOutput + \internal +*/ //----------------------------------------------------------------------------- // Constructor / destructor diff --git a/src/3rdparty/phonon/mmf/audioplayer.cpp b/src/3rdparty/phonon/mmf/audioplayer.cpp index 3a4e04b..aa2a94b 100644 --- a/src/3rdparty/phonon/mmf/audioplayer.cpp +++ b/src/3rdparty/phonon/mmf/audioplayer.cpp @@ -26,6 +26,10 @@ QT_BEGIN_NAMESPACE using namespace Phonon; using namespace Phonon::MMF; +/*! \class MMF::AudioPlayer + \internal +*/ + //----------------------------------------------------------------------------- // Constructor / destructor //----------------------------------------------------------------------------- diff --git a/src/3rdparty/phonon/mmf/backend.cpp b/src/3rdparty/phonon/mmf/backend.cpp index 0a9130c..be43f46 100644 --- a/src/3rdparty/phonon/mmf/backend.cpp +++ b/src/3rdparty/phonon/mmf/backend.cpp @@ -37,6 +37,14 @@ QT_BEGIN_NAMESPACE using namespace Phonon; using namespace Phonon::MMF; +/*! \class MMF::VolumeObserver + \internal +*/ + +/*! \class MMF::Backend + \internal +*/ + Backend::Backend(QObject *parent) : QObject(parent) { TRACE_CONTEXT(Backend::Backend, EBackend); diff --git a/src/3rdparty/phonon/mmf/bassboost.cpp b/src/3rdparty/phonon/mmf/bassboost.cpp index fc88d03..e34f9e7 100644 --- a/src/3rdparty/phonon/mmf/bassboost.cpp +++ b/src/3rdparty/phonon/mmf/bassboost.cpp @@ -23,6 +23,10 @@ QT_BEGIN_NAMESPACE using namespace Phonon; using namespace Phonon::MMF; +/*! \class MMF::BassBoost + \internal +*/ + BassBoost::BassBoost(QObject *parent) : AbstractAudioEffect::AbstractAudioEffect(parent, QList()) { diff --git a/src/3rdparty/phonon/mmf/dummyplayer.cpp b/src/3rdparty/phonon/mmf/dummyplayer.cpp index 4c059c4..bd21d20 100644 --- a/src/3rdparty/phonon/mmf/dummyplayer.cpp +++ b/src/3rdparty/phonon/mmf/dummyplayer.cpp @@ -23,6 +23,10 @@ QT_BEGIN_NAMESPACE using namespace Phonon; using namespace Phonon::MMF; +/*! \class MMF::DummyPlayer + \internal +*/ + //----------------------------------------------------------------------------- // Constructor / destructor //----------------------------------------------------------------------------- diff --git a/src/3rdparty/phonon/mmf/effectfactory.cpp b/src/3rdparty/phonon/mmf/effectfactory.cpp index 9843a6c..214baa0 100644 --- a/src/3rdparty/phonon/mmf/effectfactory.cpp +++ b/src/3rdparty/phonon/mmf/effectfactory.cpp @@ -40,6 +40,10 @@ QT_BEGIN_NAMESPACE using namespace Phonon; using namespace Phonon::MMF; +/*! \class MMF::EffectFactory + \internal +*/ + QHash EffectFactory::constructEffectDescription(const QString &name, const QString &description) { diff --git a/src/3rdparty/phonon/mmf/mediaobject.cpp b/src/3rdparty/phonon/mmf/mediaobject.cpp index 0591e05..76db5cb 100644 --- a/src/3rdparty/phonon/mmf/mediaobject.cpp +++ b/src/3rdparty/phonon/mmf/mediaobject.cpp @@ -35,6 +35,10 @@ QT_BEGIN_NAMESPACE using namespace Phonon; using namespace Phonon::MMF; +/*! \class MMF::MediaObject + \internal +*/ + //----------------------------------------------------------------------------- // Constructor / destructor //----------------------------------------------------------------------------- diff --git a/src/3rdparty/phonon/mmf/mmf_medianode.cpp b/src/3rdparty/phonon/mmf/mmf_medianode.cpp index a9eee58..b5ea91a 100644 --- a/src/3rdparty/phonon/mmf/mmf_medianode.cpp +++ b/src/3rdparty/phonon/mmf/mmf_medianode.cpp @@ -25,6 +25,10 @@ QT_BEGIN_NAMESPACE using namespace Phonon; using namespace Phonon::MMF; +/*! \class MMF::MediaNode + \internal +*/ + MMF::MediaNode::MediaNode(QObject *parent) : QObject::QObject(parent) , m_source(0) , m_target(0) diff --git a/src/3rdparty/phonon/mmf/mmf_videoplayer.cpp b/src/3rdparty/phonon/mmf/mmf_videoplayer.cpp index 64e6568..83d715d 100644 --- a/src/3rdparty/phonon/mmf/mmf_videoplayer.cpp +++ b/src/3rdparty/phonon/mmf/mmf_videoplayer.cpp @@ -35,6 +35,10 @@ QT_BEGIN_NAMESPACE using namespace Phonon; using namespace Phonon::MMF; +/*! \class MMF::VideoPlayer + \internal +*/ + //----------------------------------------------------------------------------- // Constructor / destructor //----------------------------------------------------------------------------- diff --git a/src/3rdparty/phonon/mmf/utils.cpp b/src/3rdparty/phonon/mmf/utils.cpp index 2956722..3bd6d74 100644 --- a/src/3rdparty/phonon/mmf/utils.cpp +++ b/src/3rdparty/phonon/mmf/utils.cpp @@ -24,6 +24,18 @@ QT_BEGIN_NAMESPACE using namespace Phonon; using namespace Phonon::MMF; +/*! \class MMF::Utils + \internal +*/ + +/*! \class MMF::TTraceContext + \internal +*/ + +/*! \class MMF::Utils + \internal +*/ + _LIT(PanicCategory, "Phonon::MMF"); void MMF::Utils::panic(PanicCode code) diff --git a/src/3rdparty/phonon/mmf/videooutput.cpp b/src/3rdparty/phonon/mmf/videooutput.cpp index e51fbcf..041b0a8 100644 --- a/src/3rdparty/phonon/mmf/videooutput.cpp +++ b/src/3rdparty/phonon/mmf/videooutput.cpp @@ -36,6 +36,10 @@ QT_BEGIN_NAMESPACE using namespace Phonon; using namespace Phonon::MMF; +/*! \class MMF::VideoOutput + \internal +*/ + //----------------------------------------------------------------------------- // Constructor / destructor //----------------------------------------------------------------------------- diff --git a/src/3rdparty/phonon/mmf/videowidget.cpp b/src/3rdparty/phonon/mmf/videowidget.cpp index ac93929..8a5c9ff 100644 --- a/src/3rdparty/phonon/mmf/videowidget.cpp +++ b/src/3rdparty/phonon/mmf/videowidget.cpp @@ -27,6 +27,10 @@ QT_BEGIN_NAMESPACE using namespace Phonon; using namespace Phonon::MMF; +/*! \class MMF::VideoWidget + \internal +*/ + //----------------------------------------------------------------------------- // Constants //----------------------------------------------------------------------------- -- cgit v0.12 From 976adc629192d42882eeba33d5b398618d4445b1 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Thu, 1 Oct 2009 12:43:40 +0000 Subject: Implementation for QWebPage::inputMethodQuery and QWebPagePrivate::inputMethodEvent Patch by Joe Ligman on 2009-10-01 Reviewed by Simon Hausmann. https://bugs.webkit.org/show_bug.cgi?id=29681 Some additional changes from axis: * Fixed surrounding text to exclude preedit string * Avoid emission of microFocusChanged during setComposition() * Api/qwebpage.cpp: (QWebPagePrivate::inputMethodEvent): (QWebPage::inputMethodQuery): * WebCoreSupport/EditorClientQt.cpp: (WebCore::EditorClientQt::respondToChangedSelection): * tests/qwebpage/tst_qwebpage.cpp: (tst_QWebPage::inputMethods): git-svn-id: http://svn.webkit.org/repository/webkit/trunk@48967 268f45cc-cd09-0410-ab3c-d52691b4dbfc Signed-off-by: Simon Hausmann --- src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp | 163 ++++++++++++++++----- src/3rdparty/webkit/WebKit/qt/ChangeLog | 21 +++ .../WebKit/qt/WebCoreSupport/EditorClientQt.cpp | 4 +- .../WebKit/qt/tests/qwebpage/tst_qwebpage.cpp | 90 ++++++++++++ 4 files changed, 242 insertions(+), 36 deletions(-) diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp index 4b6248a..000b895 100644 --- a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp +++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp @@ -66,8 +66,12 @@ #include "PluginDatabase.h" #include "ProgressTracker.h" #include "RefPtr.h" +#include "RenderTextControl.h" +#include "TextIterator.h" #include "HashMap.h" #include "HTMLFormElement.h" +#include "HTMLInputElement.h" +#include "HTMLNames.h" #include "HitTestResult.h" #include "WindowFeatures.h" #include "LocalizedStrings.h" @@ -95,6 +99,7 @@ #include #include #include +#include #if QT_VERSION >= 0x040400 #include #include @@ -1087,13 +1092,53 @@ void QWebPagePrivate::inputMethodEvent(QInputMethodEvent *ev) return; } + RenderObject* renderer = 0; + RenderTextControl* renderTextControl = 0; + + if (frame->selection()->rootEditableElement()) + renderer = frame->selection()->rootEditableElement()->shadowAncestorNode()->renderer(); + + if (renderer && renderer->isTextControl()) + renderTextControl = toRenderTextControl(renderer); + + Vector underlines; + + for (int i = 0; i < ev->attributes().size(); ++i) { + const QInputMethodEvent::Attribute& a = ev->attributes().at(i); + switch (a.type) { + case QInputMethodEvent::TextFormat: { + QTextCharFormat textCharFormat = a.value.value().toCharFormat(); + QColor qcolor = textCharFormat.underlineColor(); + underlines.append(CompositionUnderline(a.start, a.length, Color(makeRGBA(qcolor.red(), qcolor.green(), qcolor.blue(), qcolor.alpha())), false)); + break; + } + case QInputMethodEvent::Cursor: { + frame->setCaretVisible(a.length); //if length is 0 cursor is invisible + if (a.length > 0) { + RenderObject* caretRenderer = frame->selection()->caretRenderer(); + if (caretRenderer) { + QColor qcolor = a.value.value(); + caretRenderer->style()->setColor(Color(makeRGBA(qcolor.red(), qcolor.green(), qcolor.blue(), qcolor.alpha()))); + } + } + break; + } +#if QT_VERSION >= 0x040600 + case QInputMethodEvent::Selection: { + if (renderTextControl) { + renderTextControl->setSelectionStart(a.start); + renderTextControl->setSelectionEnd(a.start + a.length); + } + break; + } +#endif + } + } + if (!ev->commitString().isEmpty()) editor->confirmComposition(ev->commitString()); - else { + else if (!ev->preeditString().isEmpty()) { QString preedit = ev->preeditString(); - // ### FIXME: use the provided QTextCharFormat (use color at least) - Vector underlines; - underlines.append(CompositionUnderline(0, preedit.length(), Color(0, 0, 0), false)); editor->setComposition(preedit, underlines, preedit.length(), 0); } ev->accept(); @@ -1196,41 +1241,89 @@ bool QWebPagePrivate::handleScrolling(QKeyEvent *ev, Frame *frame) */ QVariant QWebPage::inputMethodQuery(Qt::InputMethodQuery property) const { + Frame* frame = d->page->focusController()->focusedFrame(); + if (!frame) + return QVariant(); + + WebCore::Editor* editor = frame->editor(); + + RenderObject* renderer = 0; + RenderTextControl* renderTextControl = 0; + + if (frame->selection()->rootEditableElement()) + renderer = frame->selection()->rootEditableElement()->shadowAncestorNode()->renderer(); + + if (renderer && renderer->isTextControl()) + renderTextControl = toRenderTextControl(renderer); + switch (property) { - case Qt::ImMicroFocus: { - Frame *frame = d->page->focusController()->focusedFrame(); - if (frame) + case Qt::ImMicroFocus: { return QVariant(frame->selection()->absoluteCaretBounds()); - return QVariant(); - } - case Qt::ImFont: { - QWebView *webView = qobject_cast(d->view); - if (webView) - return QVariant(webView->font()); - return QVariant(); - } - case Qt::ImCursorPosition: { - Frame *frame = d->page->focusController()->focusedFrame(); - if (frame) { - VisibleSelection selection = frame->selection()->selection(); - if (selection.isCaret()) - return QVariant(selection.start().deprecatedEditingOffset()); } - return QVariant(); - } - case Qt::ImSurroundingText: { - Frame *frame = d->page->focusController()->focusedFrame(); - if (frame) { - Document *document = frame->document(); - if (document->focusedNode()) - return QVariant(document->focusedNode()->nodeValue()); + case Qt::ImFont: { + if (renderTextControl) { + RenderStyle* renderStyle = renderTextControl->style(); + return QVariant(QFont(renderStyle->font().font())); + } + return QVariant(QFont()); } - return QVariant(); - } - case Qt::ImCurrentSelection: - return QVariant(selectedText()); - default: - return QVariant(); + case Qt::ImCursorPosition: { + if (renderTextControl) { + if (editor->hasComposition()) { + RefPtr range = editor->compositionRange(); + return QVariant(renderTextControl->selectionEnd() - TextIterator::rangeLength(range.get())); + } + return QVariant(renderTextControl->selectionEnd()); + } + return QVariant(); + } + case Qt::ImSurroundingText: { + if (renderTextControl) { + QString text = renderTextControl->text(); + RefPtr range = editor->compositionRange(); + if (range) { + text.remove(range->startPosition().offsetInContainerNode(), TextIterator::rangeLength(range.get())); + } + return QVariant(text); + } + return QVariant(); + } + case Qt::ImCurrentSelection: { + if (renderTextControl) { + int start = renderTextControl->selectionStart(); + int end = renderTextControl->selectionEnd(); + if (end > start) + return QVariant(QString(renderTextControl->text()).mid(start,end-start)); + } + return QVariant(); + + } +#if QT_VERSION >= 0x040600 + case Qt::ImAnchorPosition: { + if (renderTextControl) { + if (editor->hasComposition()) { + RefPtr range = editor->compositionRange(); + return QVariant(renderTextControl->selectionStart() - TextIterator::rangeLength(range.get())); + } + return QVariant(renderTextControl->selectionStart()); + } + return QVariant(); + } + case Qt::ImMaximumTextLength: { + if (frame->selection()->isContentEditable()) { + if (frame->document() && frame->document()->focusedNode()) { + if (frame->document()->focusedNode()->hasTagName(HTMLNames::inputTag)) { + HTMLInputElement* inputElement = static_cast(frame->document()->focusedNode()); + return QVariant(inputElement->maxLength()); + } + } + return QVariant(InputElement::s_maximumLength); + } + return QVariant(0); + } +#endif + default: + return QVariant(); } } diff --git a/src/3rdparty/webkit/WebKit/qt/ChangeLog b/src/3rdparty/webkit/WebKit/qt/ChangeLog index b252d8c..a78f573 100644 --- a/src/3rdparty/webkit/WebKit/qt/ChangeLog +++ b/src/3rdparty/webkit/WebKit/qt/ChangeLog @@ -1,3 +1,24 @@ +2009-10-01 Joe Ligman + + Reviewed by Simon Hausmann. + + Implementation for QWebPage::inputMethodQuery and QWebPagePrivate::inputMethodEvent + + https://bugs.webkit.org/show_bug.cgi?id=29681 + + Some additional changes from Kristian Amlie : + + * Fixed surrounding text to exclude preedit string + * Avoid emission of microFocusChanged during setComposition() + + * Api/qwebpage.cpp: + (QWebPagePrivate::inputMethodEvent): + (QWebPage::inputMethodQuery): + * WebCoreSupport/EditorClientQt.cpp: + (WebCore::EditorClientQt::respondToChangedSelection): + * tests/qwebpage/tst_qwebpage.cpp: + (tst_QWebPage::inputMethods): + 2009-09-29 Andras Becsi Reviewed by Tor Arne Vestbø. diff --git a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/EditorClientQt.cpp b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/EditorClientQt.cpp index 40833f2..5d5df97 100644 --- a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/EditorClientQt.cpp +++ b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/EditorClientQt.cpp @@ -220,7 +220,9 @@ void EditorClientQt::respondToChangedSelection() m_page->d->updateEditorActions(); emit m_page->selectionChanged(); - emit m_page->microFocusChanged(); + Frame* frame = m_page->d->page->focusController()->focusedOrMainFrame(); + if (!frame->editor()->ignoreCompositionSelectionChange()) + emit m_page->microFocusChanged(); } void EditorClientQt::didEndEditing() diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp b/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp index 283950e..8f9a740 100644 --- a/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp +++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp @@ -20,6 +20,7 @@ #include +#include #include #include #include @@ -114,6 +115,7 @@ private slots: void testOptionalJSObjects(); void testEnablePersistentStorage(); void consoleOutput(); + void inputMethods(); void crashTests_LazyInitializationOfMainFrame(); @@ -1203,6 +1205,94 @@ void tst_QWebPage::frameAt() frameAtHelper(webPage, webPage->mainFrame(), webPage->mainFrame()->pos()); } +void tst_QWebPage::inputMethods() +{ + m_view->page()->mainFrame()->setHtml("" \ + "" \ + ""); + m_view->page()->mainFrame()->setFocus(); + + QList inputs = m_view->page()->mainFrame()->documentElement().findAll("input"); + + QMouseEvent evpres(QEvent::MouseButtonPress, inputs.at(0).geometry().center(), Qt::LeftButton, Qt::NoButton, Qt::NoModifier); + m_view->page()->event(&evpres); + QMouseEvent evrel(QEvent::MouseButtonRelease, inputs.at(0).geometry().center(), Qt::LeftButton, Qt::NoButton, Qt::NoModifier); + m_view->page()->event(&evrel); + + //ImMicroFocus + QVariant variant = m_view->page()->inputMethodQuery(Qt::ImMicroFocus); + QRect focusRect = variant.toRect(); + QVERIFY(inputs.at(0).geometry().contains(variant.toRect().topLeft())); + + //ImFont + variant = m_view->page()->inputMethodQuery(Qt::ImFont); + QFont font = variant.value(); + QCOMPARE(QString("-webkit-serif"), font.family()); + + QList inputAttributes; + + //Insert text. + { + QInputMethodEvent eventText("QtWebKit", inputAttributes); + QSignalSpy signalSpy(m_view->page(), SIGNAL(microFocusChanged())); + m_view->page()->event(&eventText); + QCOMPARE(signalSpy.count(), 0); + } + + { + QInputMethodEvent eventText("", inputAttributes); + eventText.setCommitString(QString("QtWebKit"), 0, 0); + m_view->page()->event(&eventText); + } + +#if QT_VERSION >= 0x040600 + //ImMaximumTextLength + variant = m_view->page()->inputMethodQuery(Qt::ImMaximumTextLength); + QCOMPARE(20, variant.toInt()); + + //Set selection + inputAttributes << QInputMethodEvent::Attribute(QInputMethodEvent::Selection, 3, 2, QVariant()); + QInputMethodEvent eventSelection("",inputAttributes); + m_view->page()->event(&eventSelection); + + //ImAnchorPosition + variant = m_view->page()->inputMethodQuery(Qt::ImAnchorPosition); + int anchorPosition = variant.toInt(); + QCOMPARE(anchorPosition, 3); + + //ImCursorPosition + variant = m_view->page()->inputMethodQuery(Qt::ImCursorPosition); + int cursorPosition = variant.toInt(); + QCOMPARE(cursorPosition, 5); + + //ImCurrentSelection + variant = m_view->page()->inputMethodQuery(Qt::ImCurrentSelection); + QString selectionValue = variant.value(); + QCOMPARE(selectionValue, QString("eb")); +#endif + + //ImSurroundingText + variant = m_view->page()->inputMethodQuery(Qt::ImSurroundingText); + QString value = variant.value(); + QCOMPARE(value, QString("QtWebKit")); + +#if QT_VERSION >= 0x040600 + { + QList attributes; + // Clear the selection, so the next test does not clear any contents. + QInputMethodEvent::Attribute newSelection(QInputMethodEvent::Selection, 0, 0, QVariant()); + attributes.append(newSelection); + QInputMethodEvent event("composition", attributes); + m_view->page()->event(&event); + } + + // A ongoing composition should not change the surrounding text before it is committed. + variant = m_view->page()->inputMethodQuery(Qt::ImSurroundingText); + value = variant.value(); + QCOMPARE(value, QString("QtWebKit")); +#endif +} + // import a little DRT helper function to trigger the garbage collector void QWEBKIT_EXPORT qt_drt_garbageCollector_collect(); -- cgit v0.12 From df7669b7f41f4284e297c0e8d56b3d71019625d0 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Thu, 1 Oct 2009 12:43:49 +0000 Subject: Fixed software input panel support on web input elements. Patch by axis on 2009-10-01 Reviewed by Simon Hausmann. Send the RequestSoftwareInputPanel event if the element supports focus and the element is clicked. * Api/qwebpage.cpp: (QWebPagePrivate::QWebPagePrivate): (QWebPagePrivate::mousePressEvent): (QWebPagePrivate::mouseReleaseEvent): * Api/qwebpage_p.h: git-svn-id: http://svn.webkit.org/repository/webkit/trunk@48968 268f45cc-cd09-0410-ab3c-d52691b4dbfc Signed-off-by: Simon Hausmann --- src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp | 28 ++++++++++++++++++++++++++ src/3rdparty/webkit/WebKit/qt/Api/qwebpage_p.h | 2 ++ src/3rdparty/webkit/WebKit/qt/ChangeLog | 15 ++++++++++++++ 3 files changed, 45 insertions(+) diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp index 000b895..d1a4059 100644 --- a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp +++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp @@ -267,6 +267,7 @@ QWebPagePrivate::QWebPagePrivate(QWebPage *qq) , inspector(0) , inspectorIsInternalOnly(false) , viewportSize(QSize(0, 0)) + , clickCausedFocus(false) { WebCore::InitializeLoggingChannelsIfNecessary(); JSC::initializeThreading(); @@ -632,6 +633,11 @@ void QWebPagePrivate::mousePressEvent(QMouseEvent *ev) if (!frame->view()) return; + RefPtr oldNode; + if (page->focusController()->focusedFrame() + && page->focusController()->focusedFrame()->document()) + oldNode = page->focusController()->focusedFrame()->document()->focusedNode(); + if (tripleClickTimer.isActive() && (ev->pos() - tripleClick).manhattanLength() < QApplication::startDragDistance()) { @@ -645,6 +651,14 @@ void QWebPagePrivate::mousePressEvent(QMouseEvent *ev) if (mev.button() != NoButton) accepted = frame->eventHandler()->handleMousePressEvent(mev); ev->setAccepted(accepted); + + RefPtr newNode; + if (page->focusController()->focusedFrame() + && page->focusController()->focusedFrame()->document()) + newNode = page->focusController()->focusedFrame()->document()->focusedNode(); + + if (newNode && oldNode != newNode) + clickCausedFocus = true; } void QWebPagePrivate::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *ev) @@ -750,6 +764,20 @@ void QWebPagePrivate::mouseReleaseEvent(QGraphicsSceneMouseEvent* ev) ev->setAccepted(accepted); handleClipboard(ev, ev->button()); + +#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0) + if (view && view->testAttribute(Qt::WA_InputMethodEnabled) + && ev->button() == Qt::LeftButton && qApp->autoSipEnabled()) { + QStyle::RequestSoftwareInputPanel behavior = QStyle::RequestSoftwareInputPanel( + view->style()->styleHint(QStyle::SH_RequestSoftwareInputPanel)); + if (!clickCausedFocus || behavior == QStyle::RSIP_OnMouseClick) { + QEvent event(QEvent::RequestSoftwareInputPanel); + QApplication::sendEvent(view, &event); + } + } + + clickCausedFocus = false; +#endif } void QWebPagePrivate::mouseReleaseEvent(QMouseEvent *ev) diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage_p.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage_p.h index 9f4216a..d41471a 100644 --- a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage_p.h +++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage_p.h @@ -143,6 +143,8 @@ public: QPoint tripleClick; QBasicTimer tripleClickTimer; + bool clickCausedFocus; + #if QT_VERSION < 0x040400 bool acceptNavigationRequest(QWebFrame *frame, const QWebNetworkRequest &request, QWebPage::NavigationType type); diff --git a/src/3rdparty/webkit/WebKit/qt/ChangeLog b/src/3rdparty/webkit/WebKit/qt/ChangeLog index a78f573..8b9b14f 100644 --- a/src/3rdparty/webkit/WebKit/qt/ChangeLog +++ b/src/3rdparty/webkit/WebKit/qt/ChangeLog @@ -1,3 +1,18 @@ +2009-10-01 Kristian Amlie + + Reviewed by Simon Hausmann. + + Fixed software input panel support on web input elements. + + Send the RequestSoftwareInputPanel event if the element supports focus + and the element is clicked. + + * Api/qwebpage.cpp: + (QWebPagePrivate::QWebPagePrivate): + (QWebPagePrivate::mousePressEvent): + (QWebPagePrivate::mouseReleaseEvent): + * Api/qwebpage_p.h: + 2009-10-01 Joe Ligman Reviewed by Simon Hausmann. -- cgit v0.12 From 45f095b8970dc3c1b6f6e97fa2323654ba848288 Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Wed, 30 Sep 2009 08:52:50 +0200 Subject: Fix: Abstract slider does not understand wheel events properly A wheel event contain delta values that describe the rotation angle the wheel was rotated (in 1/8 of a degree). For some mouse devices (thinking of mac mighty mouse/trackpad) the resolution is better than the standard 15 degrees. The Qt docs describe how to deal with this. But abstract scrollbar does did follow this recipe, but it does now with this patch. Reb-By: prasanth --- src/gui/kernel/qapplication.cpp | 2 +- src/gui/kernel/qapplication_mac.mm | 20 ++++++++++++++----- src/gui/kernel/qcocoaview_mac.mm | 20 +++++++++++-------- src/gui/widgets/qabstractslider.cpp | 39 +++++++++++++++---------------------- src/gui/widgets/qabstractslider_p.h | 1 + src/gui/widgets/qtextedit.cpp | 5 +++++ 6 files changed, 50 insertions(+), 37 deletions(-) diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp index df5097b..1332545 100644 --- a/src/gui/kernel/qapplication.cpp +++ b/src/gui/kernel/qapplication.cpp @@ -925,7 +925,7 @@ void QApplicationPrivate::initialize() graphics_system = QGraphicsSystemFactory::create(graphics_system_name); #endif #ifndef QT_NO_WHEELEVENT -#ifdef QT_MAC_USE_COCOA +#ifdef Q_OS_MAC QApplicationPrivate::wheel_scroll_lines = 1; #else QApplicationPrivate::wheel_scroll_lines = 3; diff --git a/src/gui/kernel/qapplication_mac.mm b/src/gui/kernel/qapplication_mac.mm index c294e62..a95ae9d 100644 --- a/src/gui/kernel/qapplication_mac.mm +++ b/src/gui/kernel/qapplication_mac.mm @@ -1686,13 +1686,15 @@ QApplicationPrivate::globalEventProcessor(EventHandlerCallRef er, EventRef event // (actually two events; one for horizontal and one for vertical). // As a results of this, and to make sure we dont't receive duplicate events, // we try to detect when this happend by checking the 'compatibilityEvent'. + const int scrollFactor = 4 * 8; SInt32 mdelt = 0; GetEventParameter(event, kEventParamMouseWheelSmoothHorizontalDelta, typeSInt32, 0, sizeof(mdelt), 0, &mdelt); - wheel_deltaX = mdelt; + wheel_deltaX = mdelt * scrollFactor; + mdelt = 0; GetEventParameter(event, kEventParamMouseWheelSmoothVerticalDelta, typeSInt32, 0, sizeof(mdelt), 0, &mdelt); - wheel_deltaY = mdelt; + wheel_deltaY = mdelt * scrollFactor; GetEventParameter(event, kEventParamEventRef, typeEventRef, 0, sizeof(compatibilityEvent), 0, &compatibilityEvent); } else if (ekind == kEventMouseWheelMoved) { @@ -1704,10 +1706,14 @@ QApplicationPrivate::globalEventProcessor(EventHandlerCallRef er, EventRef event EventMouseWheelAxis axis; GetEventParameter(event, kEventParamMouseWheelAxis, typeMouseWheelAxis, 0, sizeof(axis), 0, &axis); + + // The 'new' event has acceleration applied by the OS, while the old (on + // Carbon only), has not. So we introduce acceleration here to be consistent: + int scrollFactor = 120 * qMin(5, qAbs(mdelt)); if (axis == kEventMouseWheelAxisX) - wheel_deltaX = mdelt * 120; + wheel_deltaX = mdelt * scrollFactor; else - wheel_deltaY = mdelt * 120; + wheel_deltaY = mdelt * scrollFactor; } } @@ -2660,7 +2666,11 @@ int QApplication::keyboardInputInterval() void QApplication::setWheelScrollLines(int n) { - QApplicationPrivate::wheel_scroll_lines = n; + Q_UNUSED(n); + // On Mac, acceleration is handled by the OS. Multiplying wheel scroll + // deltas with n will not be as cross platform as one might think! So + // we choose to go native in this case (and let wheel_scroll_lines == 1). + // QApplicationPrivate::wheel_scroll_lines = n; } int QApplication::wheelScrollLines() diff --git a/src/gui/kernel/qcocoaview_mac.mm b/src/gui/kernel/qcocoaview_mac.mm index f482d1c..b1c5fc5 100644 --- a/src/gui/kernel/qcocoaview_mac.mm +++ b/src/gui/kernel/qcocoaview_mac.mm @@ -789,18 +789,22 @@ extern "C" { const EventRef carbonEvent = (EventRef)[theEvent eventRef]; const UInt32 carbonEventKind = carbonEvent ? ::GetEventKind(carbonEvent) : 0; if (carbonEventKind == kEventMouseScroll) { - // The mouse device containts pixel scroll - // wheel support (Mighty Mouse, Trackpad) - deltaX = (int)[theEvent deviceDeltaX] * 120; - deltaY = (int)[theEvent deviceDeltaY] * 120; - deltaZ = (int)[theEvent deviceDeltaZ] * 120; + // The mouse device containts pixel scroll wheel support (Mighty Mouse, Trackpad). + // Since deviceDelta is delivered as pixels rather than degrees, we need to + // convert from pixels to degrees in a sensible manner. + // It looks like four degrees per pixel behaves most native. + // Qt expects the unit for delta to be 1/8 of a degree: + const int scrollFactor = 4 * 8; + deltaX = (int)[theEvent deviceDeltaX] * scrollFactor; + deltaY = (int)[theEvent deviceDeltaY] * scrollFactor; + deltaZ = (int)[theEvent deviceDeltaZ] * scrollFactor; } else { // carbonEventKind == kEventMouseWheelMoved // Mouse wheel deltas seem to tick in at increments of 0.1. // Qt widgets expect the delta to be a multiple of 120. const int scrollFactor = 10 * 120; - deltaX = [theEvent deltaX] * scrollFactor * qMax(0.6, 1.1 - qAbs([theEvent deltaX])); - deltaY = [theEvent deltaY] * scrollFactor * qMax(0.6, 1.1 - qAbs([theEvent deltaY])); - deltaZ = [theEvent deltaZ] * scrollFactor * qMax(0.6, 1.1 - qAbs([theEvent deltaZ])); + deltaX = [theEvent deltaX] * scrollFactor; + deltaY = [theEvent deltaY] * scrollFactor; + deltaZ = [theEvent deltaZ] * scrollFactor; } if (deltaX != 0) { diff --git a/src/gui/widgets/qabstractslider.cpp b/src/gui/widgets/qabstractslider.cpp index a50c105..c3289b4 100644 --- a/src/gui/widgets/qabstractslider.cpp +++ b/src/gui/widgets/qabstractslider.cpp @@ -215,7 +215,8 @@ QT_BEGIN_NAMESPACE QAbstractSliderPrivate::QAbstractSliderPrivate() : minimum(0), maximum(99), singleStep(1), pageStep(10), - value(0), position(0), pressValue(-1), tracking(true), blocktracking(false), pressed(false), + value(0), position(0), pressValue(-1), offset_accumulated(0), tracking(true), + blocktracking(false), pressed(false), invertedAppearance(false), invertedControls(false), orientation(Qt::Horizontal), repeatAction(QAbstractSlider::SliderNoAction) { @@ -691,38 +692,30 @@ void QAbstractSlider::wheelEvent(QWheelEvent * e) e->ignore(); if (e->orientation() != d->orientation && !rect().contains(e->pos())) return; - static qreal offset = 0; - static QAbstractSlider *offset_owner = 0; - if (offset_owner != this){ - offset_owner = this; - offset = 0; - } - // On Mac/Cocoa, always scroll one step. The mouse wheel acceleration - // is higher than on other systems, so this works well in practice. -#ifdef QT_MAC_USE_COCOA - int step = 1; -#else int step = qMin(QApplication::wheelScrollLines() * d->singleStep, d->pageStep); -#endif if ((e->modifiers() & Qt::ControlModifier) || (e->modifiers() & Qt::ShiftModifier)) step = d->pageStep; - int currentOffset = qRound(qreal(e->delta()) * step / 120); - if (currentOffset == 0) - currentOffset = (e->delta() < 0 ? -1 : 1); - offset += currentOffset; - if (d->invertedControls) - offset = -offset; + qreal currentOffset = qreal(e->delta()) * step / 120; + d->offset_accumulated += d->invertedControls ? -currentOffset : currentOffset; - int prevValue = d->value; - d->position = d->overflowSafeAdd(int(offset)); // value will be updated by triggerAction() + 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 + // wheel events (this means that the wheel resolution is higher than + // 15 degrees, e.g. when using mac mighty mouse/trackpad): + return; + } + int prevValue = d->value; + d->position = d->overflowSafeAdd(int(d->offset_accumulated)); // value will be updated by triggerAction() triggerAction(SliderMove); + if (prevValue == d->value) { - offset = 0; + d->offset_accumulated = 0; } else { - offset -= int(offset); + d->offset_accumulated -= int(d->offset_accumulated); e->accept(); } } diff --git a/src/gui/widgets/qabstractslider_p.h b/src/gui/widgets/qabstractslider_p.h index 071b8df..9324d44 100644 --- a/src/gui/widgets/qabstractslider_p.h +++ b/src/gui/widgets/qabstractslider_p.h @@ -69,6 +69,7 @@ public: void setSteps(int single, int page); int minimum, maximum, singleStep, pageStep, value, position, pressValue; + float offset_accumulated; uint tracking : 1; uint blocktracking :1; uint pressed : 1; diff --git a/src/gui/widgets/qtextedit.cpp b/src/gui/widgets/qtextedit.cpp index dc78fd5..3fe9bb4 100644 --- a/src/gui/widgets/qtextedit.cpp +++ b/src/gui/widgets/qtextedit.cpp @@ -174,8 +174,13 @@ 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); -- cgit v0.12 From e3a0975fdf5aa7d997b3890ce2626769ea948d7a Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Thu, 1 Oct 2009 14:58:33 +0200 Subject: qdoc: Marked some undocumented Phonon classes internal --- src/3rdparty/phonon/mmf/utils.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/3rdparty/phonon/mmf/utils.cpp b/src/3rdparty/phonon/mmf/utils.cpp index 3bd6d74..2f5b68f 100644 --- a/src/3rdparty/phonon/mmf/utils.cpp +++ b/src/3rdparty/phonon/mmf/utils.cpp @@ -24,7 +24,7 @@ QT_BEGIN_NAMESPACE using namespace Phonon; using namespace Phonon::MMF; -/*! \class MMF::Utils +/*! \namespace MMF::Utils \internal */ -- cgit v0.12 From 44c5cdc66c5cbeaa88d5dcbb3be629abfb889bcc Mon Sep 17 00:00:00 2001 From: David Boddie Date: Tue, 29 Sep 2009 16:25:23 +0200 Subject: Doc: Added a script to generate one of the model/view images. Reviewed-by: Trust Me --- doc/src/diagrams/programs/standard_views.py | 42 +++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 doc/src/diagrams/programs/standard_views.py diff --git a/doc/src/diagrams/programs/standard_views.py b/doc/src/diagrams/programs/standard_views.py new file mode 100644 index 0000000..f1d69f6 --- /dev/null +++ b/doc/src/diagrams/programs/standard_views.py @@ -0,0 +1,42 @@ +#!/usr/bin/env python + +import sys +from PyQt4.QtCore import QDir, Qt +from PyQt4.QtGui import * + +app = QApplication(sys.argv) + +background = QWidget() +palette = QPalette() +palette.setColor(QPalette.Window, QColor(Qt.white)) +background.setPalette(palette) + +model = QFileSystemModel() +model.setRootPath(QDir.currentPath()) + +treeView = QTreeView(background) +treeView.setModel(model) +treeView.setRootIndex(model.index(QDir.currentPath())) + +listView = QListView(background) +listView.setModel(model) +listView.setRootIndex(model.index(QDir.currentPath())) + +tableView = QTableView(background) +tableView.setModel(model) +tableView.setRootIndex(model.index(QDir.currentPath())) + +selection = QItemSelectionModel(model) +treeView.setSelectionModel(selection) +listView.setSelectionModel(selection) +tableView.setSelectionModel(selection) + +layout = QHBoxLayout(background) +layout.addWidget(listView) +layout.addSpacing(24) +layout.addWidget(treeView, 1) +layout.addSpacing(24) +layout.addWidget(tableView) +background.show() + +sys.exit(app.exec_()) -- cgit v0.12 From 79e5594bf0da1aefbde463e77998ee62ab943a5a Mon Sep 17 00:00:00 2001 From: David Boddie Date: Thu, 1 Oct 2009 15:04:02 +0200 Subject: Doc: Removed the old Console edition and updated edition naming. Reviewed-by: Trust Me --- tools/qdoc3/generator.cpp | 15 ++++----------- tools/qdoc3/test/qt-build-docs.qdocconf | 2 -- tools/qdoc3/test/qt-inc.qdocconf | 1 - tools/qdoc3/test/qt.qdocconf | 2 -- 4 files changed, 4 insertions(+), 16 deletions(-) diff --git a/tools/qdoc3/generator.cpp b/tools/qdoc3/generator.cpp index 47fe4b5..f7569ce 100644 --- a/tools/qdoc3/generator.cpp +++ b/tools/qdoc3/generator.cpp @@ -562,27 +562,20 @@ void Generator::generateModuleWarning(const ClassNode *classe, QString module = classe->moduleName(); if (!module.isEmpty()) { Text text; - if (!editionModuleMap["Console"].contains(module)) { + if (!editionModuleMap["DesktopLight"].contains(module)) { text << Atom::ParaLeft << Atom(Atom::FormattingLeft, ATOM_FORMATTING_BOLD) - << "This class is not part of the Qt Console Edition." - << Atom(Atom::FormattingRight, ATOM_FORMATTING_BOLD) - << Atom::ParaRight; - } - else if (!editionModuleMap["DesktopLight"].contains(module)) { - text << Atom::ParaLeft - << Atom(Atom::FormattingLeft, ATOM_FORMATTING_BOLD) - << "This class is not part of the Qt Desktop Light Edition." + << "This class is not part of the Qt GUI Framework Edition." << Atom(Atom::FormattingRight, ATOM_FORMATTING_BOLD) << Atom::ParaRight; } else if (module == "Qt3Support") { text << Atom::ParaLeft << Atom(Atom::FormattingLeft, ATOM_FORMATTING_BOLD) - << "Note to Qt Desktop Light Edition users:" + << "Note to Qt GUI Framework Edition users:" << Atom(Atom::FormattingRight, ATOM_FORMATTING_BOLD) << " This class is only available in the " - << Atom(Atom::AutoLink, "Qt Desktop Edition") + << Atom(Atom::AutoLink, "Qt Full Framework Edition") << "." << Atom::ParaRight; } diff --git a/tools/qdoc3/test/qt-build-docs.qdocconf b/tools/qdoc3/test/qt-build-docs.qdocconf index cec43a4..8da7442 100644 --- a/tools/qdoc3/test/qt-build-docs.qdocconf +++ b/tools/qdoc3/test/qt-build-docs.qdocconf @@ -8,8 +8,6 @@ project = Qt description = Qt Reference Documentation url = http://qt.nokia.com/doc/4.6 -edition.Console.modules = QtCore QtDBus QtNetwork QtScript QtSql QtXml \ - QtXmlPatterns QtTest edition.Desktop.modules = QtCore QtDBus QtGui QtNetwork QtOpenGL QtScript QtSql QtSvg \ QtWebKit QtXml QtXmlPatterns Qt3Support QtHelp \ QtDesigner QtAssistant QAxContainer Phonon \ diff --git a/tools/qdoc3/test/qt-inc.qdocconf b/tools/qdoc3/test/qt-inc.qdocconf index 4ef32b8..48a0d27 100644 --- a/tools/qdoc3/test/qt-inc.qdocconf +++ b/tools/qdoc3/test/qt-inc.qdocconf @@ -5,7 +5,6 @@ project = Qt description = Qt Reference Documentation url = http://qt.nokia.com/doc/4.6 -edition.Console = QtCore QtNetwork QtSql QtXml QtScript QtTest edition.Desktop = QtCore QtGui QtNetwork QtOpenGL QtSql QtSvg QtXml QtScript \ QtDesigner QtAssistant Qt3Support QAxContainer \ QAxServer QtUiTools QtTest QtDBus diff --git a/tools/qdoc3/test/qt.qdocconf b/tools/qdoc3/test/qt.qdocconf index aa8e981..d70ef58 100644 --- a/tools/qdoc3/test/qt.qdocconf +++ b/tools/qdoc3/test/qt.qdocconf @@ -10,8 +10,6 @@ version = %VERSION% description = Qt Reference Documentation url = http://qt.nokia.com/doc/4.6 -edition.Console.modules = QtCore QtDBus QtNetwork QtScript QtSql QtXml \ - QtXmlPatterns QtTest edition.Desktop.modules = QtCore QtDBus QtGui QtNetwork QtOpenGL QtScript QtScriptTools QtSql QtSvg \ QtWebKit QtXml QtXmlPatterns Qt3Support QtHelp \ QtDesigner QtAssistant QAxContainer Phonon \ -- cgit v0.12 From d0f43348e5cc88cffa134361313084ce7cc3f30f Mon Sep 17 00:00:00 2001 From: David Boddie Date: Thu, 1 Oct 2009 15:05:34 +0200 Subject: Doc: Removed the old What's New page for Designer. Reviewed-by: Trust Me --- doc/src/development/designer-manual.qdoc | 3 --- 1 file changed, 3 deletions(-) diff --git a/doc/src/development/designer-manual.qdoc b/doc/src/development/designer-manual.qdoc index 4f4db85..bfd8066 100644 --- a/doc/src/development/designer-manual.qdoc +++ b/doc/src/development/designer-manual.qdoc @@ -61,9 +61,6 @@ \l{Getting To Know Qt Designer} document. For a quick tutorial on how to use \QD, refer to \l{A Quick Start to Qt Designer}. - Qt Designer 4.6 boasts a long list of improvements. For a detailed list of - what is new, refer \l{What's New in Qt Designer 4.6}. - \image designer-multiple-screenshot.png For more information on using \QD, you can take a look at the following -- cgit v0.12 From 2ed4e4afbb267c407699bbb384af778f84168c2f Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Thu, 1 Oct 2009 14:18:07 +0200 Subject: remove unused member from QWidgetData on Windows CE Reviewed-by: thartman --- src/gui/kernel/qwidget.cpp | 4 ---- src/gui/kernel/qwidget.h | 3 --- src/gui/kernel/qwidget_win.cpp | 2 +- src/gui/kernel/qwidget_wince.cpp | 2 -- 4 files changed, 1 insertion(+), 10 deletions(-) diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index 83593ab..0b75b06 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -1177,10 +1177,6 @@ void QWidgetPrivate::init(QWidget *parentWidget, Qt::WindowFlags f) if (f & Qt::MSWindowsOwnDC) q->setAttribute(Qt::WA_NativeWindow); -#ifdef Q_WS_WINCE - data.window_state_internal = 0; -#endif - q->setAttribute(Qt::WA_QuitOnClose); // might be cleared in adjustQuitOnCloseAttribute() adjustQuitOnCloseAttribute(); diff --git a/src/gui/kernel/qwidget.h b/src/gui/kernel/qwidget.h index 7e250e2..76418af 100644 --- a/src/gui/kernel/qwidget.h +++ b/src/gui/kernel/qwidget.h @@ -133,9 +133,6 @@ public: int alloc_region_index; // int alloc_region_revision; #endif -#if defined(Q_WS_WINCE) - uint window_state_internal : 4; -#endif QRect wrect; }; diff --git a/src/gui/kernel/qwidget_win.cpp b/src/gui/kernel/qwidget_win.cpp index c705e2a..a0982f4 100644 --- a/src/gui/kernel/qwidget_win.cpp +++ b/src/gui/kernel/qwidget_win.cpp @@ -1402,7 +1402,7 @@ void QWidgetPrivate::setGeometry_sys(int x, int y, int w, int h, bool isMove) SetWindowPlacement(q->internalWinId(), &wndpl); } else { #else - if (data.window_state_internal & Qt::WindowMaximized) { + if (data.window_state & Qt::WindowMaximized) { qt_wince_maximize(q); } else { #endif diff --git a/src/gui/kernel/qwidget_wince.cpp b/src/gui/kernel/qwidget_wince.cpp index c0664f4..4a0d30c 100644 --- a/src/gui/kernel/qwidget_wince.cpp +++ b/src/gui/kernel/qwidget_wince.cpp @@ -480,7 +480,6 @@ void QWidget::setWindowState(Qt::WindowStates newstate) if (isWindow()) { createWinId(); Q_ASSERT(testAttribute(Qt::WA_WState_Created)); - data->window_state_internal = newstate; // Ensure the initial size is valid, since we store it as normalGeometry below. if ((!testAttribute(Qt::WA_Resized) && !isVisible())) adjustSize(); @@ -573,7 +572,6 @@ void QWidget::setWindowState(Qt::WindowStates newstate) } } data->window_state = newstate; - data->window_state_internal = newstate; QWindowStateChangeEvent e(oldstate); QApplication::sendEvent(this, &e); } -- cgit v0.12 From 27ad49b1677b06017fb922299efabe7bee320f2f Mon Sep 17 00:00:00 2001 From: mread Date: Thu, 1 Oct 2009 14:13:44 +0100 Subject: S60 qt_init() fix to set system font This gives the system font the default font family name, which is appropriate for S60, "Series 60 Sans". Without this, the system font has a requested family name of "Helvetica". Upside of this fix is that it makes tst_qFontComboBox pass on S60 Reviewed-by: Alessandro Portale --- src/gui/kernel/qapplication_s60.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp index 27c7c94..d50e7e1 100644 --- a/src/gui/kernel/qapplication_s60.cpp +++ b/src/gui/kernel/qapplication_s60.cpp @@ -1085,6 +1085,10 @@ void qt_init(QApplicationPrivate * /* priv */, int) } #endif + QFont systemFont; + systemFont.setFamily(systemFont.defaultFamily()); + QApplicationPrivate::setSystemFont(systemFont); + /* ### Commented out for now as parameter handling not needed in SOS(yet). Code below will break testlib with -o flag int argc = priv->argc; -- cgit v0.12 From da53926fe3e910941d0112072fcbeba565b967fe Mon Sep 17 00:00:00 2001 From: Denis Dzyubenko Date: Thu, 1 Oct 2009 12:56:31 +0200 Subject: Fixes clipboard handling on X11. This fixes handling selection requests for invalid targets - when someone asks for a target that is not supported by the clipboard content we shouldn't do anything (unless it's MULTIPLE). Fixes copying data when using Synergy which tries to get all targets it knows about even if they are not listed in TARGETS. Task-number: QTBUG-4652 Reviewed-by: Bradley T. Hughes --- src/gui/kernel/qdnd_x11.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gui/kernel/qdnd_x11.cpp b/src/gui/kernel/qdnd_x11.cpp index d1ef810..d5a6095 100644 --- a/src/gui/kernel/qdnd_x11.cpp +++ b/src/gui/kernel/qdnd_x11.cpp @@ -506,6 +506,7 @@ bool QX11Data::xdndMimeDataForAtom(Atom a, QMimeData *mimeData, QByteArray *data *atomFormat = textprop.encoding; *dataFormat = textprop.format; *data = QByteArray((const char *) textprop.value, textprop.nitems * textprop.format / 8); + ret = true; DEBUG(" textprop type %lx\n" " textprop name '%s'\n" @@ -541,10 +542,11 @@ bool QX11Data::xdndMimeDataForAtom(Atom a, QMimeData *mimeData, QByteArray *data dm->xdndMimeTransferedPixmap[dm->xdndMimeTransferedPixmapIndex] = pm; dm->xdndMimeTransferedPixmapIndex = (dm->xdndMimeTransferedPixmapIndex + 1) % 2; + ret = true; } } } - return data; + return ret && data != 0; } //$$$ -- cgit v0.12 From eda97a69aba55f32c348f4a8a830d5d80104d19b Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Thu, 1 Oct 2009 15:31:22 +0200 Subject: Add input method hint for URL input widgets. Rev-by: Axis --- src/corelib/global/qnamespace.h | 1 + src/corelib/global/qnamespace.qdoc | 1 + 2 files changed, 2 insertions(+) diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h index 473398b..a440606 100644 --- a/src/corelib/global/qnamespace.h +++ b/src/corelib/global/qnamespace.h @@ -1431,6 +1431,7 @@ public: ImhLowercaseOnly = 0x80000, ImhDialableCharactersOnly = 0x100000, ImhEmailCharactersOnly = 0x200000, + ImhUrlCharactersOnly = 0x400000, ImhExclusiveInputMask = 0xffff0000 }; diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc index 684ebca..9106fa8 100644 --- a/src/corelib/global/qnamespace.qdoc +++ b/src/corelib/global/qnamespace.qdoc @@ -2469,6 +2469,7 @@ \value ImhLowercaseOnly Only lower case letter input is allowed. \value ImhDialableCharactersOnly Only characters suitable for phone dialling are allowed. \value ImhEmailCharactersOnly Only characters suitable for email addresses are allowed. + \value ImhUrlCharactersOnly Only characters suitable for URLs are allowed. Masks: -- cgit v0.12 From ee51f0ee63fe5c6388cea1a1043963303ee3810b Mon Sep 17 00:00:00 2001 From: Peter Hartmann Date: Thu, 1 Oct 2009 15:11:57 +0200 Subject: network selftest: make sure tested file has correct line endings added file to preserver the correct line endings for the test file Reviewed-by: Aleksandar Babic --- tests/auto/networkselftest/.gitattributes | 1 + 1 file changed, 1 insertion(+) create mode 100644 tests/auto/networkselftest/.gitattributes diff --git a/tests/auto/networkselftest/.gitattributes b/tests/auto/networkselftest/.gitattributes new file mode 100644 index 0000000..e04709a --- /dev/null +++ b/tests/auto/networkselftest/.gitattributes @@ -0,0 +1 @@ +rfc3252.txt -crlf -- cgit v0.12 From e247c880800c15914fb12679fe65949034f77403 Mon Sep 17 00:00:00 2001 From: Jens Bache-Wiig Date: Thu, 1 Oct 2009 15:47:49 +0200 Subject: Touch up and fixes for the documentation frontpage - I reverted the font enlargement. This should be up to the user. - The fonts are now uniform again, giving a more professional apparance. - Added a slight gradient for the headers to give it a more modern look. - Fixed a rendering glitch with webkit where no borders were visible. The qt-resources.qdoc is basically there to export the image. Reviewed-by: Morten Engvoldsen --- doc/src/images/gradient.png | Bin 0 -> 222 bytes doc/src/index.qdoc | 12 ++++++------ doc/src/qt-resources.qdoc | 45 +++++++++++++++++++++++++++++++++++++++++++ tools/qdoc3/test/classic.css | 14 +++++++++----- 4 files changed, 60 insertions(+), 11 deletions(-) create mode 100644 doc/src/images/gradient.png create mode 100644 doc/src/qt-resources.qdoc diff --git a/doc/src/images/gradient.png b/doc/src/images/gradient.png new file mode 100644 index 0000000..2ef36ed Binary files /dev/null and b/doc/src/images/gradient.png differ diff --git a/doc/src/index.qdoc b/doc/src/index.qdoc index ed4bbbe..f376af2 100644 --- a/doc/src/index.qdoc +++ b/doc/src/index.qdoc @@ -79,15 +79,15 @@ - + Fundamentals - + User Interface Design - + Technologies - + - + - +
  • Input/Output and Resources
  • Network Programming
  • diff --git a/doc/src/qt-resources.qdoc b/doc/src/qt-resources.qdoc new file mode 100644 index 0000000..a7dffe4 --- /dev/null +++ b/doc/src/qt-resources.qdoc @@ -0,0 +1,45 @@ +/**************************************************************************** +** +** 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 documentation 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$ +** +****************************************************************************/ + +/*! + \page qt-resources.html + \image gradient.png +*/ diff --git a/tools/qdoc3/test/classic.css b/tools/qdoc3/test/classic.css index c0bc3d47..320da66 100644 --- a/tools/qdoc3/test/classic.css +++ b/tools/qdoc3/test/classic.css @@ -43,10 +43,11 @@ table.valuelist { table.indextable { border-width: 1px 1px 1px 1px; + border-style: solid; border-collapse: collapse; background-color: #f0f0f0; border-color:#555; - font-size: 110%; + font-size: 100%; } table td.largeindex { @@ -68,14 +69,17 @@ table.valuelist th { th.titleheader { border-width: 1px 0px 1px 0px; - padding: 4px; + padding: 2px; border-style: solid; - border-color: #444; + border-color: #666; color:white; - background-color:#555555; - font-size: 110%; + background-color:#555; + background-image:url('images/gradient.png')}; + background-repeat: repeat-x; + font-size: 100%; } + th.largeheader { border-width: 1px 0px 1px 0px; padding: 4px; -- cgit v0.12 From 8d920689a704be771488d2aae61b69077a7a491f Mon Sep 17 00:00:00 2001 From: Kent Hansen Date: Thu, 1 Oct 2009 15:47:09 +0200 Subject: Reset timeout-checker before evaluating when processEventsInterval is used When the timeout-checker was not reset, it could take a while (e.g. 1-2 seconds) before the next timeout occurred, depending on what the tick counter happened to be after the previous evaluate(). When a processEventsInterval of e.g. 100 milliseconds has been specified, we want the timeout to happen much sooner, thus we need to reset the checker. This will cause the first timeout to happen quickly, and then at steady intervals (processEventsInterval ms) after that. The tst_QScriptEngine::processEventsWhileRunning() test was sporadically failing due to this issue. Reviewed-by: Olivier Goffart --- src/script/api/qscriptengine.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/script/api/qscriptengine.cpp b/src/script/api/qscriptengine.cpp index 059b102..fb14940 100644 --- a/src/script/api/qscriptengine.cpp +++ b/src/script/api/qscriptengine.cpp @@ -2185,6 +2185,8 @@ QScriptValue QScriptEngine::evaluate(const QString &program, const QString &file JSC::JSObject* thisObject = (!thisValue || thisValue.isUndefinedOrNull()) ? exec->dynamicGlobalObject() : thisValue.toObject(exec); JSC::JSValue exceptionValue; d->timeoutChecker()->setShouldAbort(false); + if (d->processEventsInterval > 0) + d->timeoutChecker()->reset(); JSC::JSValue result = exec->interpreter()->execute(&executable, exec, thisObject, exec->scopeChain(), &exceptionValue); if (d->timeoutChecker()->shouldAbort()) { -- cgit v0.12 From 47fa47c8fe7af6d3184bb634f96bc552fff3c620 Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Thu, 1 Oct 2009 16:09:41 +0200 Subject: Use "if (1) {} else" instead of "if (1); else" to silence compiler. Rev-by: Thiago --- src/corelib/global/qglobal.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index 7fe67ec..dcd4397 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -1615,11 +1615,11 @@ Q_CORE_EXPORT_INLINE QDebug qCritical(); inline QNoDebug qDebug(); #endif -#define QT_NO_QDEBUG_MACRO if(1); else qDebug +#define QT_NO_QDEBUG_MACRO if(1) {} else qDebug #ifdef QT_NO_DEBUG_OUTPUT # define qDebug QT_NO_QDEBUG_MACRO #endif -#define QT_NO_QWARNING_MACRO if(1); else qWarning +#define QT_NO_QWARNING_MACRO if(1) {} else qWarning #ifdef QT_NO_WARNING_OUTPUT # define qWarning QT_NO_QWARNING_MACRO #endif -- cgit v0.12 From f0ebe295d475a172233c3dc9262ce4a53e7c5cdd Mon Sep 17 00:00:00 2001 From: Denis Dzyubenko Date: Thu, 1 Oct 2009 16:29:10 +0200 Subject: Fixed typo in the doc. Reviewed-by: trustme --- src/gui/kernel/qevent.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp index ce64c68..7b9cc9a 100644 --- a/src/gui/kernel/qevent.cpp +++ b/src/gui/kernel/qevent.cpp @@ -3566,7 +3566,7 @@ QMenubarUpdatedEvent::QMenubarUpdatedEvent(QMenuBar * const menuBar) Qt::WA_AcceptTouchEvents attribute set and graphics items need to have the \l{QGraphicsItem::setAcceptTouchEvents()}{acceptTouchEvents} attribute set to true. - When using QAbstractScrollArea based widgets, you should enabled the Qt::WA_AcceptTouchEvents + When using QAbstractScrollArea based widgets, you should enable the Qt::WA_AcceptTouchEvents attribute on the scroll area's \l{QAbstractScrollArea::viewport()}{viewport}. Similarly to QMouseEvent, Qt automatically grabs each touch point on the first press inside a -- cgit v0.12 From 984fe9ebfc6d9582d21bcf1d09cb0578fd163f54 Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Tue, 29 Sep 2009 15:37:33 +0200 Subject: Fixed Designer property editor selection bug. When the editor had been created inside the QtPropertyEditorView (inheriting QTreeWidget), the subsequent show sent a synthetic mouse move event down to the QLineEdit, and a new selection was made on the text because the mouse button was marked as pressed in the event. QApplicationPrivate::sendSyntheticEnterLeave() now sends a mouse move event without any button pressed. Auto-test included in tst_QWidget. Task-number: QTBUG-4055 Task-number: 253159 Task-number: QT-659 Task-number: 245398 Reviewed-by: bnilsen --- src/gui/kernel/qapplication.cpp | 2 +- tests/auto/qwidget/tst_qwidget.cpp | 82 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 83 insertions(+), 1 deletion(-) diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp index 3715059..832d829 100644 --- a/src/gui/kernel/qapplication.cpp +++ b/src/gui/kernel/qapplication.cpp @@ -3002,7 +3002,7 @@ void QApplicationPrivate::sendSyntheticEnterLeave(QWidget *widget) qt_button_down = 0; // Send enter/leave events followed by a mouse move on the entered widget. - QMouseEvent e(QEvent::MouseMove, pos, globalPos, Qt::NoButton, mouse_buttons, modifier_buttons); + QMouseEvent e(QEvent::MouseMove, pos, globalPos, Qt::NoButton, Qt::NoButton, Qt::NoModifier); sendMouseEvent(widgetUnderCursor, &e, widgetUnderCursor, tlw, &qt_button_down, qt_last_mouse_receiver); #endif // QT_NO_CURSOR } diff --git a/tests/auto/qwidget/tst_qwidget.cpp b/tests/auto/qwidget/tst_qwidget.cpp index 8d7e5fe..fe863fb 100644 --- a/tests/auto/qwidget/tst_qwidget.cpp +++ b/tests/auto/qwidget/tst_qwidget.cpp @@ -342,6 +342,7 @@ private slots: void maskedUpdate(); #if defined(Q_WS_WIN) || defined(Q_WS_X11) void syntheticEnterLeave(); + void taskQTBUG_4055_sendSyntheticEnterLeave(); #endif void windowFlags(); void initialPosForDontShowOnScreenWidgets(); @@ -8851,6 +8852,87 @@ void tst_QWidget::syntheticEnterLeave() QCOMPARE(window.numEnterEvents, 0); QCOMPARE(child1->numEnterEvents, 1); } + +void tst_QWidget::taskQTBUG_4055_sendSyntheticEnterLeave() +{ + class SELParent : public QWidget + { + public: + SELParent(QWidget *parent = 0): QWidget(parent) { } + + void mousePressEvent(QMouseEvent *) { child->show(); } + QWidget *child; + }; + + class SELChild : public QWidget + { + public: + SELChild(QWidget *parent = 0) : QWidget(parent), numEnterEvents(0), numMouseMoveEvents(0) {} + void enterEvent(QEvent *) { ++numEnterEvents; } + void mouseMoveEvent(QMouseEvent *event) + { + QCOMPARE(event->button(), Qt::NoButton); + QCOMPARE(event->buttons(), Qt::MouseButtons(Qt::NoButton)); + ++numMouseMoveEvents; + } + void reset() { numEnterEvents = numMouseMoveEvents = 0; } + int numEnterEvents, numMouseMoveEvents; + }; + + SELParent parent; + parent.resize(200, 200); + SELChild child(&parent); + child.resize(200, 200); + parent.show(); + #ifdef Q_WS_X11 + qt_x11_wait_for_window_manager(&parent); + #endif + QTest::qWait(100); + + QCursor::setPos(child.mapToGlobal(QPoint(100, 100))); + QTest::qWait(100); + // Make sure the cursor has entered the child. + QVERIFY(child.numEnterEvents > 0); + + child.hide(); + child.reset(); + child.show(); + + // Make sure the child gets enter event and no mouse move event. + QCOMPARE(child.numEnterEvents, 1); + QCOMPARE(child.numMouseMoveEvents, 0); + + child.hide(); + child.reset(); + child.setMouseTracking(true); + child.show(); + + // Make sure the child gets enter event and mouse move event. + // Note that we verify event->button() and event->buttons() + // in SELChild::mouseMoveEvent(). + QCOMPARE(child.numEnterEvents, 1); + QCOMPARE(child.numMouseMoveEvents, 1); + + // Sending synthetic enter/leave trough the parent's mousePressEvent handler. + parent.child = &child; + + child.hide(); + child.reset(); + QTest::mouseClick(&parent, Qt::LeftButton); + + // Make sure the child gets enter event and one mouse move event. + QCOMPARE(child.numEnterEvents, 1); + QCOMPARE(child.numMouseMoveEvents, 1); + + child.hide(); + child.reset(); + child.setMouseTracking(false); + QTest::mouseClick(&parent, Qt::LeftButton); + + // Make sure the child gets enter event and no mouse move event. + QCOMPARE(child.numEnterEvents, 1); + QCOMPARE(child.numMouseMoveEvents, 0); + } #endif void tst_QWidget::windowFlags() -- cgit v0.12 From a62045bd0ef52f3d439cb862ee7a38366536a0ec Mon Sep 17 00:00:00 2001 From: Alexis Menard Date: Thu, 1 Oct 2009 17:51:17 +0200 Subject: Rename QWebGraphicsItem to QGraphicsWebView MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Patch by Alexis Menard on 2009-10-01 Reviewed by Tor Arne Vestbø. git-svn-id: http://svn.webkit.org/repository/webkit/trunk@48974 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- src/3rdparty/webkit/WebCore/WebCore.pro | 2 +- src/3rdparty/webkit/WebKit/qt/Api/headers.pri | 2 +- .../webkit/WebKit/qt/Api/qgraphicswebview.cpp | 822 +++++++++++++++++++++ .../webkit/WebKit/qt/Api/qgraphicswebview.h | 144 ++++ .../webkit/WebKit/qt/Api/qwebgraphicsitem.cpp | 822 --------------------- .../webkit/WebKit/qt/Api/qwebgraphicsitem.h | 144 ---- src/3rdparty/webkit/WebKit/qt/Api/qwebpage.h | 2 +- .../qt/tests/qgraphicswebview/qgraphicswebview.pro | 6 + .../qgraphicswebview/tst_qgraphicswebview.cpp | 58 ++ .../qt/tests/qwebgraphicsitem/qwebgraphicsitem.pro | 6 - .../qwebgraphicsitem/tst_qwebgraphicsitem.cpp | 58 -- src/3rdparty/webkit/WebKit/qt/tests/tests.pro | 2 +- 12 files changed, 1034 insertions(+), 1034 deletions(-) create mode 100644 src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.cpp create mode 100644 src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.h delete mode 100644 src/3rdparty/webkit/WebKit/qt/Api/qwebgraphicsitem.cpp delete mode 100644 src/3rdparty/webkit/WebKit/qt/Api/qwebgraphicsitem.h create mode 100644 src/3rdparty/webkit/WebKit/qt/tests/qgraphicswebview/qgraphicswebview.pro create mode 100644 src/3rdparty/webkit/WebKit/qt/tests/qgraphicswebview/tst_qgraphicswebview.cpp delete mode 100644 src/3rdparty/webkit/WebKit/qt/tests/qwebgraphicsitem/qwebgraphicsitem.pro delete mode 100644 src/3rdparty/webkit/WebKit/qt/tests/qwebgraphicsitem/tst_qwebgraphicsitem.cpp diff --git a/src/3rdparty/webkit/WebCore/WebCore.pro b/src/3rdparty/webkit/WebCore/WebCore.pro index c7bd640..bc22b7a 100644 --- a/src/3rdparty/webkit/WebCore/WebCore.pro +++ b/src/3rdparty/webkit/WebCore/WebCore.pro @@ -2391,7 +2391,7 @@ SOURCES += \ ../WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp \ ../WebKit/qt/WebCoreSupport/InspectorClientQt.cpp \ ../WebKit/qt/Api/qwebframe.cpp \ - ../WebKit/qt/Api/qwebgraphicsitem.cpp \ + ../WebKit/qt/Api/qgraphicswebview.cpp \ ../WebKit/qt/Api/qwebpage.cpp \ ../WebKit/qt/Api/qwebview.cpp \ ../WebKit/qt/Api/qwebelement.cpp \ diff --git a/src/3rdparty/webkit/WebKit/qt/Api/headers.pri b/src/3rdparty/webkit/WebKit/qt/Api/headers.pri index 51abba4..5a95c67 100644 --- a/src/3rdparty/webkit/WebKit/qt/Api/headers.pri +++ b/src/3rdparty/webkit/WebKit/qt/Api/headers.pri @@ -1,5 +1,5 @@ WEBKIT_API_HEADERS = $$PWD/qwebframe.h \ - $$PWD/qwebgraphicsitem.h \ + $$PWD/qgraphicswebview.h \ $$PWD/qwebkitglobal.h \ $$PWD/qwebpage.h \ $$PWD/qwebview.h \ diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.cpp new file mode 100644 index 0000000..d8d9d64 --- /dev/null +++ b/src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.cpp @@ -0,0 +1,822 @@ +/* + Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include "config.h" +#include "qgraphicswebview.h" + +#include "qwebframe.h" +#include "qwebpage.h" +#include "qwebpage_p.h" +#include "QWebPageClient.h" +#include +#include +#include +#include +#include +#if defined(Q_WS_X11) +#include +#endif + +class QGraphicsWebViewPrivate : public QWebPageClient { +public: + QGraphicsWebViewPrivate(QGraphicsWebView* parent) + : q(parent) + , page(0) + , interactive(true) + , progress(1.0) + {} + + virtual void scroll(int dx, int dy, const QRect&); + virtual void update(const QRect& dirtyRect); + + virtual QCursor cursor() const; + virtual void updateCursor(const QCursor& cursor); + + virtual int screenNumber() const; + virtual WId winId() const; + + void _q_doLoadProgress(int progress); + void _q_doLoadFinished(bool success); + void _q_setStatusBarMessage(const QString& message); + + QGraphicsWebView* q; + QWebPage* page; + + QString statusBarMessage; + bool interactive; + qreal progress; +}; + +void QGraphicsWebViewPrivate::_q_doLoadProgress(int progress) +{ + if (qFuzzyCompare(this->progress, qreal(progress / 100.))) + return; + + this->progress = progress / 100.; + + emit q->progressChanged(this->progress); +} + +void QGraphicsWebViewPrivate::_q_doLoadFinished(bool success) +{ + // If the page had no title, still make sure it gets the signal + if (q->title().isEmpty()) + emit q->urlChanged(q->url()); + + if (success) + emit q->loadFinished(); + else + emit q->loadFailed(); +} + +void QGraphicsWebViewPrivate::scroll(int dx, int dy, const QRect& rectToScroll) +{ + q->scroll(qreal(dx), qreal(dy), QRectF(rectToScroll)); +} + +void QGraphicsWebViewPrivate::update(const QRect & dirtyRect) +{ + q->update(QRectF(dirtyRect)); +} + +QCursor QGraphicsWebViewPrivate::cursor() const +{ + return q->cursor(); +} + +void QGraphicsWebViewPrivate::updateCursor(const QCursor& cursor) +{ + q->setCursor(cursor); +} + +int QGraphicsWebViewPrivate::screenNumber() const +{ +#if defined(Q_WS_X11) + const QList views = q->scene()->views(); + + if (!views.isEmpty()) + return views.at(0)->x11Info().screen(); +#endif + + return 0; +} + +WId QGraphicsWebViewPrivate::winId() const +{ + const QList views = q->scene()->views(); + + if (!views.isEmpty()) + return views.at(0)->winId(); + + return 0; +} + +void QGraphicsWebViewPrivate::_q_setStatusBarMessage(const QString& s) +{ + statusBarMessage = s; + emit q->statusChanged(); +} + +/*! + \class QGraphicsWebView + \brief The QGraphicsWebView class allows web content to be added to a GraphicsView. + \since 4.6 + + A WebGraphicsItem renders web content based on a URL or set data. + + If the width and height of the item is not set, they will + dynamically adjust to a size appropriate for the content. + This width may be large (eg. 980) for typical online web pages. +*/ + +/*! + Constructs an empty QGraphicsWebView with parent \a parent. + + \sa load() +*/ +QGraphicsWebView::QGraphicsWebView(QGraphicsItem* parent) + : QGraphicsWidget(parent) + , d(new QGraphicsWebViewPrivate(this)) +{ +#if QT_VERSION >= 0x040600 + setFlag(QGraphicsItem::ItemUsesExtendedStyleOption, true); +#endif + setAcceptHoverEvents(true); + setFocusPolicy(Qt::StrongFocus); +} + +/*! + Destroys the web graphicsitem. +*/ +QGraphicsWebView::~QGraphicsWebView() +{ + if (d->page) + d->page->d->view = 0; + + if (d->page && d->page->parent() == this) + delete d->page; + + delete d; +} + +/*! + Returns a pointer to the underlying web page. + + \sa setPage() +*/ +QWebPage* QGraphicsWebView::page() const +{ + if (!d->page) { + QGraphicsWebView* that = const_cast(this); + QWebPage* page = new QWebPage(that); + + // Default to not having a background, in the case + // the page doesn't provide one. + QPalette palette = QApplication::palette(); + palette.setBrush(QPalette::Base, QColor::fromRgbF(0, 0, 0, 0)); + page->setPalette(palette); + + that->setPage(page); + } + + return d->page; +} + +/*! \reimp +*/ +void QGraphicsWebView::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget*) +{ + page()->mainFrame()->render(painter, option->exposedRect.toRect()); +} + +/*! \reimp +*/ +bool QGraphicsWebView::sceneEvent(QEvent* event) +{ + // Re-implemented in order to allows fixing event-related bugs in patch releases. + return QGraphicsWidget::sceneEvent(event); +} + +/*! \reimp +*/ +bool QGraphicsWebView::event(QEvent* event) +{ + // Re-implemented in order to allows fixing event-related bugs in patch releases. + + if (d->page) { +#ifndef QT_NO_CURSOR +#if QT_VERSION >= 0x040400 + } else if (event->type() == QEvent::CursorChange) { + // An unsetCursor will set the cursor to Qt::ArrowCursor. + // Thus this cursor change might be a QWidget::unsetCursor() + // If this is not the case and it came from WebCore, the + // QWebPageClient already has set its cursor internally + // to Qt::ArrowCursor, so updating the cursor is always + // right, as it falls back to the last cursor set by + // WebCore. + // FIXME: Add a QEvent::CursorUnset or similar to Qt. + if (cursor().shape() == Qt::ArrowCursor) + d->resetCursor(); +#endif +#endif + } + return QGraphicsWidget::event(event); +} + +/*! + Makes \a page the new web page of the web graphicsitem. + + The parent QObject of the provided page remains the owner + of the object. If the current document is a child of the web + view, it will be deleted. + + \sa page() +*/ +void QGraphicsWebView::setPage(QWebPage* page) +{ + if (d->page == page) + return; + + if (d->page) { + d->page->d->client = 0; // unset the page client + if (d->page->parent() == this) + delete d->page; + else + d->page->disconnect(this); + } + + d->page = page; + if (!d->page) + return; + d->page->d->client = d; // set the page client + + QSize size = geometry().size().toSize(); + page->setViewportSize(size); + + QWebFrame* mainFrame = d->page->mainFrame(); + + connect(mainFrame, SIGNAL(titleChanged(const QString&)), + this, SIGNAL(titleChanged(const QString&))); + connect(mainFrame, SIGNAL(iconChanged()), + this, SIGNAL(iconChanged())); + connect(mainFrame, SIGNAL(urlChanged(const QUrl&)), + this, SIGNAL(urlChanged(const QUrl&))); + connect(d->page, SIGNAL(loadStarted()), + this, SIGNAL(loadStarted())); + connect(d->page, SIGNAL(loadProgress(int)), + this, SLOT(_q_doLoadProgress(int))); + connect(d->page, SIGNAL(loadFinished(bool)), + this, SLOT(_q_doLoadFinished(bool))); + connect(d->page, SIGNAL(statusBarMessage(const QString&)), + this, SLOT(_q_setStatusBarMessage(const QString&))); +} + +/*! + \property QGraphicsWebView::url + \brief the url of the web page currently viewed + + Setting this property clears the view and loads the URL. + + By default, this property contains an empty, invalid URL. + + \sa load(), urlChanged() +*/ + +void QGraphicsWebView::setUrl(const QUrl &url) +{ + page()->mainFrame()->setUrl(url); +} + +QUrl QGraphicsWebView::url() const +{ + if (d->page) + return d->page->mainFrame()->url(); + + return QUrl(); +} + +/*! + \property QGraphicsWebView::title + \brief the title of the web page currently viewed + + By default, this property contains an empty string. + + \sa titleChanged() +*/ +QString QGraphicsWebView::title() const +{ + if (d->page) + return d->page->mainFrame()->title(); + + return QString(); +} + +/*! + \property QGraphicsWebView::icon + \brief the icon associated with the web page currently viewed + + By default, this property contains a null icon. + + \sa iconChanged(), QWebSettings::iconForUrl() +*/ +QIcon QGraphicsWebView::icon() const +{ + if (d->page) + return d->page->mainFrame()->icon(); + + return QIcon(); +} + +/*! + \property QGraphicsWebView::zoomFactor + \since 4.5 + \brief the zoom factor for the view +*/ + +void QGraphicsWebView::setZoomFactor(qreal factor) +{ + if (factor == page()->mainFrame()->zoomFactor()) + return; + + page()->mainFrame()->setZoomFactor(factor); + emit zoomFactorChanged(); +} + +qreal QGraphicsWebView::zoomFactor() const +{ + return page()->mainFrame()->zoomFactor(); +} + +/*! \reimp +*/ +void QGraphicsWebView::updateGeometry() +{ + QGraphicsWidget::updateGeometry(); + + if (!d->page) + return; + + QSize size = geometry().size().toSize(); + d->page->setViewportSize(size); +} + +/*! \reimp +*/ +void QGraphicsWebView::setGeometry(const QRectF& rect) +{ + QGraphicsWidget::setGeometry(rect); + + if (!d->page) + return; + + // NOTE: call geometry() as setGeometry ensures that + // the geometry is within legal bounds (minimumSize, maximumSize) + QSize size = geometry().size().toSize(); + d->page->setViewportSize(size); +} + +/*! + \brief The load status message associated to the web graphicsitem + + Provides the latest status message set during the load of a URL. + Commonly shown by Status Bar widgets. + + \sa statusChanged() +*/ + +QString QGraphicsWebView::status() const +{ + return d->statusBarMessage; +} + +/*! + Convenience slot that stops loading the document. + + \sa reload(), loadFinished() +*/ +void QGraphicsWebView::stop() +{ + if (d->page) + d->page->triggerAction(QWebPage::Stop); +} + +/*! + Convenience slot that loads the previous document in the list of documents + built by navigating links. Does nothing if there is no previous document. + + \sa forward() +*/ +void QGraphicsWebView::back() +{ + if (d->page) + d->page->triggerAction(QWebPage::Back); +} + +/*! + Convenience slot that loads the next document in the list of documents + built by navigating links. Does nothing if there is no next document. + + \sa back() +*/ +void QGraphicsWebView::forward() +{ + if (d->page) + d->page->triggerAction(QWebPage::Forward); +} + +/*! + Reloads the current document. + + \sa stop(), loadStarted() +*/ +void QGraphicsWebView::reload() +{ + if (d->page) + d->page->triggerAction(QWebPage::Reload); +} + +/*! + \property QGraphicsWebView::progress + \brief the progress of loading the current URL, from 0 to 1. +*/ +qreal QGraphicsWebView::progress() const +{ + return d->progress; +} + +/*! + Loads the specified \a url and displays it. + + \note The view remains the same until enough data has arrived to display the new \a url. + + \sa setUrl(), url(), urlChanged() +*/ +void QGraphicsWebView::load(const QUrl& url) +{ + page()->mainFrame()->load(url); +} + +/*! + \fn void QGraphicsWebView::load(const QNetworkRequest &request, QNetworkAccessManager::Operation operation, const QByteArray &body) + + Loads a network request, \a request, using the method specified in \a operation. + + \a body is optional and is only used for POST operations. + + \note The view remains the same until enough data has arrived to display the new url. + + \sa url(), urlChanged() +*/ + +void QGraphicsWebView::load(const QNetworkRequest& request, + QNetworkAccessManager::Operation operation, + const QByteArray& body) +{ + page()->mainFrame()->load(request, operation, body); +} + +/*! + Sets the content of the web graphicsitem to the specified \a html. + + External objects such as stylesheets or images referenced in the HTML + document are located relative to \a baseUrl. + + The \a html is loaded immediately; external objects are loaded asynchronously. + + When using this method, WebKit assumes that external resources such as + JavaScript programs or style sheets are encoded in UTF-8 unless otherwise + specified. For example, the encoding of an external script can be specified + through the charset attribute of the HTML script tag. Alternatively, the + encoding can also be specified by the web server. + + \sa load(), setContent(), QWebFrame::toHtml() +*/ +void QGraphicsWebView::setHtml(const QString& html, const QUrl& baseUrl) +{ + page()->mainFrame()->setHtml(html, baseUrl); +} + +QString QGraphicsWebView::toHtml() const +{ + return page()->mainFrame()->toHtml(); +} + +/*! + Sets the content of the web graphicsitem to the specified content \a data. If the \a mimeType argument + is empty it is currently assumed that the content is HTML but in future versions we may introduce + auto-detection. + + External objects referenced in the content are located relative to \a baseUrl. + + The \a data is loaded immediately; external objects are loaded asynchronously. + + \sa load(), setHtml(), QWebFrame::toHtml() +*/ +void QGraphicsWebView::setContent(const QByteArray& data, const QString& mimeType, const QUrl& baseUrl) +{ + page()->mainFrame()->setContent(data, mimeType, baseUrl); +} + +/*! + Returns a pointer to the view's history of navigated web pages. + + It is equivalent to + + \snippet webkitsnippets/qtwebkit_qwebview_snippet.cpp 0 +*/ +QWebHistory* QGraphicsWebView::history() const +{ + return page()->history(); +} + +/*! + \property QGraphicsWebView::interactive + \brief controls whether the item responds to mouse and key events. +*/ + +bool QGraphicsWebView::isInteractive() const +{ + return d->interactive; +} + +void QGraphicsWebView::setInteractive(bool allowed) +{ + if (d->interactive == allowed) + return; + + d->interactive = allowed; + emit interactivityChanged(); +} + +/*! + Returns a pointer to the view/page specific settings object. + + It is equivalent to + + \snippet webkitsnippets/qtwebkit_qwebview_snippet.cpp 1 + + \sa QWebSettings::globalSettings() +*/ +QWebSettings* QGraphicsWebView::settings() const +{ + return page()->settings(); +} + +/*! \reimp +*/ +void QGraphicsWebView::hoverMoveEvent(QGraphicsSceneHoverEvent* ev) +{ + if (d->interactive && d->page) { + const bool accepted = ev->isAccepted(); + QMouseEvent me = QMouseEvent(QEvent::MouseMove, + ev->pos().toPoint(), Qt::NoButton, + Qt::NoButton, Qt::NoModifier); + d->page->setView(ev->widget()); + d->page->event(&me); + ev->setAccepted(accepted); + } + + if (!ev->isAccepted()) + QGraphicsItem::hoverMoveEvent(ev); +} + +/*! \reimp +*/ +void QGraphicsWebView::hoverLeaveEvent(QGraphicsSceneHoverEvent* ev) +{ + Q_UNUSED(ev); +} + +/*! \reimp +*/ +void QGraphicsWebView::mouseMoveEvent(QGraphicsSceneMouseEvent* ev) +{ + if (d->interactive && d->page) { + const bool accepted = ev->isAccepted(); + d->page->event(ev); + ev->setAccepted(accepted); + } + + if (!ev->isAccepted()) + QGraphicsItem::mouseMoveEvent(ev); +} + +/*! \reimp +*/ +void QGraphicsWebView::mousePressEvent(QGraphicsSceneMouseEvent* ev) +{ + if (d->interactive && d->page) { + const bool accepted = ev->isAccepted(); + d->page->event(ev); + ev->setAccepted(accepted); + } + + if (!ev->isAccepted()) + QGraphicsItem::mousePressEvent(ev); +} + +/*! \reimp +*/ +void QGraphicsWebView::mouseReleaseEvent(QGraphicsSceneMouseEvent* ev) +{ + if (d->interactive && d->page) { + const bool accepted = ev->isAccepted(); + d->page->event(ev); + ev->setAccepted(accepted); + } + + if (!ev->isAccepted()) + QGraphicsItem::mouseReleaseEvent(ev); +} + +/*! \reimp +*/ +void QGraphicsWebView::mouseDoubleClickEvent(QGraphicsSceneMouseEvent* ev) +{ + if (d->interactive && d->page) { + const bool accepted = ev->isAccepted(); + d->page->event(ev); + ev->setAccepted(accepted); + } + + if (!ev->isAccepted()) + QGraphicsItem::mouseDoubleClickEvent(ev); +} + +/*! \reimp +*/ +void QGraphicsWebView::keyPressEvent(QKeyEvent* ev) +{ + if (d->interactive && d->page) + d->page->event(ev); + + if (!ev->isAccepted()) + QGraphicsItem::keyPressEvent(ev); +} + +/*! \reimp +*/ +void QGraphicsWebView::keyReleaseEvent(QKeyEvent* ev) +{ + if (d->interactive && d->page) + d->page->event(ev); + + if (!ev->isAccepted()) + QGraphicsItem::keyReleaseEvent(ev); +} + +/*! \reimp +*/ +void QGraphicsWebView::focusInEvent(QFocusEvent* ev) +{ + if (d->page) + d->page->event(ev); + else + QGraphicsItem::focusInEvent(ev); +} + +/*! \reimp +*/ +void QGraphicsWebView::focusOutEvent(QFocusEvent* ev) +{ + if (d->page) + d->page->event(ev); + else + QGraphicsItem::focusOutEvent(ev); +} + +/*! \reimp +*/ +bool QGraphicsWebView::focusNextPrevChild(bool next) +{ + if (d->page) + return d->page->focusNextPrevChild(next); + + return QGraphicsWidget::focusNextPrevChild(next); +} + +/*! \reimp +*/ +void QGraphicsWebView::dragEnterEvent(QGraphicsSceneDragDropEvent* ev) +{ +#ifndef QT_NO_DRAGANDDROP + //if (d->page) + // d->page->event(ev); + //Just remove this line below when the code above is working + Q_UNUSED(ev); +#else + Q_UNUSED(ev); +#endif +} + +/*! \reimp +*/ +void QGraphicsWebView::dragLeaveEvent(QGraphicsSceneDragDropEvent* ev) +{ +#ifndef QT_NO_DRAGANDDROP + if (d->interactive && d->page) { + const bool accepted = ev->isAccepted(); + d->page->event(ev); + ev->setAccepted(accepted); + } + + if (!ev->isAccepted()) + QGraphicsWidget::dragLeaveEvent(ev); +#else + Q_UNUSED(ev); +#endif +} + +/*! \reimp +*/ +void QGraphicsWebView::dragMoveEvent(QGraphicsSceneDragDropEvent* ev) +{ +#ifndef QT_NO_DRAGANDDROP + if (d->interactive && d->page) { + const bool accepted = ev->isAccepted(); + d->page->event(ev); + ev->setAccepted(accepted); + } + + if (!ev->isAccepted()) + QGraphicsWidget::dragMoveEvent(ev); +#else + Q_UNUSED(ev); +#endif +} + +/*! \reimp +*/ +void QGraphicsWebView::dropEvent(QGraphicsSceneDragDropEvent* ev) +{ +#ifndef QT_NO_DRAGANDDROP + if (d->interactive && d->page) { + const bool accepted = ev->isAccepted(); + d->page->event(ev); + ev->setAccepted(accepted); + } + + if (!ev->isAccepted()) + QGraphicsWidget::dropEvent(ev); +#else + Q_UNUSED(ev); +#endif +} + +#ifndef QT_NO_CONTEXTMENU +/*! \reimp +*/ +void QGraphicsWebView::contextMenuEvent(QGraphicsSceneContextMenuEvent* ev) +{ + if (d->page) { + const bool accepted = ev->isAccepted(); + d->page->event(ev); + ev->setAccepted(accepted); + } +} +#endif // QT_NO_CONTEXTMENU + +#ifndef QT_NO_WHEELEVENT +/*! \reimp +*/ +void QGraphicsWebView::wheelEvent(QGraphicsSceneWheelEvent* ev) +{ + if (d->interactive && d->page) { + const bool accepted = ev->isAccepted(); + d->page->event(ev); + ev->setAccepted(accepted); + } + + if (!ev->isAccepted()) + QGraphicsItem::wheelEvent(ev); +} +#endif // QT_NO_WHEELEVENT + +/*! \reimp +*/ +void QGraphicsWebView::inputMethodEvent(QInputMethodEvent* ev) +{ + if (d->interactive && d->page) + d->page->event(ev); + + if (!ev->isAccepted()) + QGraphicsItem::inputMethodEvent(ev); +} + +#include "moc_qgraphicswebview.cpp" diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.h b/src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.h new file mode 100644 index 0000000..a8478d8 --- /dev/null +++ b/src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.h @@ -0,0 +1,144 @@ +/* + Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef QGraphicsWebView_h +#define QGraphicsWebView_h + +#include "qwebkitglobal.h" +#include +#include +#include +#include +#include +#include + +class QWebPage; +class QWebHistory; +class QWebSettings; + +class QGraphicsWebViewPrivate; + +class QWEBKIT_EXPORT QGraphicsWebView : public QGraphicsWidget { + Q_OBJECT + + Q_PROPERTY(QString title READ title NOTIFY titleChanged) + Q_PROPERTY(QIcon icon READ icon NOTIFY iconChanged) + Q_PROPERTY(qreal zoomFactor READ zoomFactor WRITE setZoomFactor NOTIFY zoomFactorChanged) + Q_PROPERTY(QString status READ status NOTIFY statusChanged) + + Q_PROPERTY(QString html READ toHtml WRITE setHtml) + Q_PROPERTY(QUrl url READ url WRITE setUrl NOTIFY urlChanged) + Q_PROPERTY(qreal progress READ progress NOTIFY progressChanged) + + Q_PROPERTY(bool interactive READ isInteractive WRITE setInteractive NOTIFY interactivityChanged) + +public: + QGraphicsWebView(QGraphicsItem* parent = 0); + ~QGraphicsWebView(); + + QWebPage* page() const; + void setPage(QWebPage*); + + QUrl url() const; + void setUrl(const QUrl&); + + QString title() const; + QIcon icon() const; + + qreal zoomFactor() const; + void setZoomFactor(qreal); + + bool isInteractive() const; + void setInteractive(bool); + + qreal progress() const; + + void load(const QUrl &url); + void load(const QNetworkRequest& request, QNetworkAccessManager::Operation operation = QNetworkAccessManager::GetOperation, const QByteArray& body = QByteArray()); + + QString toHtml() const; + void setHtml(const QString& html, const QUrl& baseUrl = QUrl()); + // FIXME: Consider rename to setHtml? + void setContent(const QByteArray& data, const QString& mimeType = QString(), const QUrl& baseUrl = QUrl()); + + QWebHistory* history() const; + QWebSettings* settings() const; + + QString status() const; + + virtual void setGeometry(const QRectF& rect); + virtual void updateGeometry(); + virtual void paint(QPainter*, const QStyleOptionGraphicsItem* options, QWidget* widget = 0); + virtual bool event(QEvent*); + +public Q_SLOTS: + void stop(); + void back(); + void forward(); + void reload(); + +Q_SIGNALS: + void loadStarted(); + void loadFinished(); + void loadFailed(); + + void progressChanged(qreal); + void interactivityChanged(); + void urlChanged(const QUrl&); + void titleChanged(const QString&); + void iconChanged(); + void statusChanged(); + void zoomFactorChanged(); + +protected: + virtual void mousePressEvent(QGraphicsSceneMouseEvent*); + virtual void mouseDoubleClickEvent(QGraphicsSceneMouseEvent*); + virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent*); + virtual void mouseMoveEvent(QGraphicsSceneMouseEvent*); + virtual void hoverMoveEvent(QGraphicsSceneHoverEvent*); + virtual void hoverLeaveEvent(QGraphicsSceneHoverEvent*); +#ifndef QT_NO_WHEELEVENT + virtual void wheelEvent(QGraphicsSceneWheelEvent*); +#endif + virtual void keyPressEvent(QKeyEvent*); + virtual void keyReleaseEvent(QKeyEvent*); +#ifndef QT_NO_CONTEXTMENU + virtual void contextMenuEvent(QGraphicsSceneContextMenuEvent*); +#endif + virtual void dragEnterEvent(QGraphicsSceneDragDropEvent*); + virtual void dragLeaveEvent(QGraphicsSceneDragDropEvent*); + virtual void dragMoveEvent(QGraphicsSceneDragDropEvent*); + virtual void dropEvent(QGraphicsSceneDragDropEvent*); + virtual void focusInEvent(QFocusEvent*); + virtual void focusOutEvent(QFocusEvent*); + virtual void inputMethodEvent(QInputMethodEvent*); + virtual bool focusNextPrevChild(bool next); + + virtual bool sceneEvent(QEvent*); + +private: + Q_PRIVATE_SLOT(d, void _q_doLoadProgress(int progress)) + Q_PRIVATE_SLOT(d, void _q_doLoadFinished(bool success)) + Q_PRIVATE_SLOT(d, void _q_setStatusBarMessage(const QString& message)) + + QGraphicsWebViewPrivate* const d; + friend class QGraphicsWebViewPrivate; +}; + +#endif // QGraphicsWebView_h diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebgraphicsitem.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebgraphicsitem.cpp deleted file mode 100644 index 196f0b8..0000000 --- a/src/3rdparty/webkit/WebKit/qt/Api/qwebgraphicsitem.cpp +++ /dev/null @@ -1,822 +0,0 @@ -/* - Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#include "config.h" -#include "qwebgraphicsitem.h" - -#include "qwebframe.h" -#include "qwebpage.h" -#include "qwebpage_p.h" -#include "QWebPageClient.h" -#include -#include -#include -#include -#include -#if defined(Q_WS_X11) -#include -#endif - -class QWebGraphicsItemPrivate : public QWebPageClient { -public: - QWebGraphicsItemPrivate(QWebGraphicsItem* parent) - : q(parent) - , page(0) - , interactive(true) - , progress(1.0) - {} - - virtual void scroll(int dx, int dy, const QRect&); - virtual void update(const QRect& dirtyRect); - - virtual QCursor cursor() const; - virtual void updateCursor(const QCursor& cursor); - - virtual int screenNumber() const; - virtual WId winId() const; - - void _q_doLoadProgress(int progress); - void _q_doLoadFinished(bool success); - void _q_setStatusBarMessage(const QString& message); - - QWebGraphicsItem* q; - QWebPage* page; - - QString statusBarMessage; - bool interactive; - qreal progress; -}; - -void QWebGraphicsItemPrivate::_q_doLoadProgress(int progress) -{ - if (qFuzzyCompare(this->progress, qreal(progress / 100.))) - return; - - this->progress = progress / 100.; - - emit q->progressChanged(this->progress); -} - -void QWebGraphicsItemPrivate::_q_doLoadFinished(bool success) -{ - // If the page had no title, still make sure it gets the signal - if (q->title().isEmpty()) - emit q->urlChanged(q->url()); - - if (success) - emit q->loadFinished(); - else - emit q->loadFailed(); -} - -void QWebGraphicsItemPrivate::scroll(int dx, int dy, const QRect& rectToScroll) -{ - q->scroll(qreal(dx), qreal(dy), QRectF(rectToScroll)); -} - -void QWebGraphicsItemPrivate::update(const QRect & dirtyRect) -{ - q->update(QRectF(dirtyRect)); -} - -QCursor QWebGraphicsItemPrivate::cursor() const -{ - return q->cursor(); -} - -void QWebGraphicsItemPrivate::updateCursor(const QCursor& cursor) -{ - q->setCursor(cursor); -} - -int QWebGraphicsItemPrivate::screenNumber() const -{ -#if defined(Q_WS_X11) - const QList views = q->scene()->views(); - - if (!views.isEmpty()) - return views.at(0)->x11Info().screen(); -#endif - - return 0; -} - -WId QWebGraphicsItemPrivate::winId() const -{ - const QList views = q->scene()->views(); - - if (!views.isEmpty()) - return views.at(0)->winId(); - - return 0; -} - -void QWebGraphicsItemPrivate::_q_setStatusBarMessage(const QString& s) -{ - statusBarMessage = s; - emit q->statusChanged(); -} - -/*! - \class QWebGraphicsItem - \brief The QWebGraphicsItem class allows web content to be added to a GraphicsView. - \since 4.6 - - A WebGraphicsItem renders web content based on a URL or set data. - - If the width and height of the item is not set, they will - dynamically adjust to a size appropriate for the content. - This width may be large (eg. 980) for typical online web pages. -*/ - -/*! - Constructs an empty QWebGraphicsItem with parent \a parent. - - \sa load() -*/ -QWebGraphicsItem::QWebGraphicsItem(QGraphicsItem* parent) - : QGraphicsWidget(parent) - , d(new QWebGraphicsItemPrivate(this)) -{ -#if QT_VERSION >= 0x040600 - setFlag(QGraphicsItem::ItemUsesExtendedStyleOption, true); -#endif - setAcceptHoverEvents(true); - setFocusPolicy(Qt::StrongFocus); -} - -/*! - Destroys the web graphicsitem. -*/ -QWebGraphicsItem::~QWebGraphicsItem() -{ - if (d->page) - d->page->d->view = 0; - - if (d->page && d->page->parent() == this) - delete d->page; - - delete d; -} - -/*! - Returns a pointer to the underlying web page. - - \sa setPage() -*/ -QWebPage* QWebGraphicsItem::page() const -{ - if (!d->page) { - QWebGraphicsItem* that = const_cast(this); - QWebPage* page = new QWebPage(that); - - // Default to not having a background, in the case - // the page doesn't provide one. - QPalette palette = QApplication::palette(); - palette.setBrush(QPalette::Base, QColor::fromRgbF(0, 0, 0, 0)); - page->setPalette(palette); - - that->setPage(page); - } - - return d->page; -} - -/*! \reimp -*/ -void QWebGraphicsItem::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget*) -{ - page()->mainFrame()->render(painter, option->exposedRect.toRect()); -} - -/*! \reimp -*/ -bool QWebGraphicsItem::sceneEvent(QEvent* event) -{ - // Re-implemented in order to allows fixing event-related bugs in patch releases. - return QGraphicsWidget::sceneEvent(event); -} - -/*! \reimp -*/ -bool QWebGraphicsItem::event(QEvent* event) -{ - // Re-implemented in order to allows fixing event-related bugs in patch releases. - - if (d->page) { -#ifndef QT_NO_CURSOR -#if QT_VERSION >= 0x040400 - } else if (event->type() == QEvent::CursorChange) { - // An unsetCursor will set the cursor to Qt::ArrowCursor. - // Thus this cursor change might be a QWidget::unsetCursor() - // If this is not the case and it came from WebCore, the - // QWebPageClient already has set its cursor internally - // to Qt::ArrowCursor, so updating the cursor is always - // right, as it falls back to the last cursor set by - // WebCore. - // FIXME: Add a QEvent::CursorUnset or similar to Qt. - if (cursor().shape() == Qt::ArrowCursor) - d->resetCursor(); -#endif -#endif - } - return QGraphicsWidget::event(event); -} - -/*! - Makes \a page the new web page of the web graphicsitem. - - The parent QObject of the provided page remains the owner - of the object. If the current document is a child of the web - view, it will be deleted. - - \sa page() -*/ -void QWebGraphicsItem::setPage(QWebPage* page) -{ - if (d->page == page) - return; - - if (d->page) { - d->page->d->client = 0; // unset the page client - if (d->page->parent() == this) - delete d->page; - else - d->page->disconnect(this); - } - - d->page = page; - if (!d->page) - return; - d->page->d->client = d; // set the page client - - QSize size = geometry().size().toSize(); - page->setViewportSize(size); - - QWebFrame* mainFrame = d->page->mainFrame(); - - connect(mainFrame, SIGNAL(titleChanged(const QString&)), - this, SIGNAL(titleChanged(const QString&))); - connect(mainFrame, SIGNAL(iconChanged()), - this, SIGNAL(iconChanged())); - connect(mainFrame, SIGNAL(urlChanged(const QUrl&)), - this, SIGNAL(urlChanged(const QUrl&))); - connect(d->page, SIGNAL(loadStarted()), - this, SIGNAL(loadStarted())); - connect(d->page, SIGNAL(loadProgress(int)), - this, SLOT(_q_doLoadProgress(int))); - connect(d->page, SIGNAL(loadFinished(bool)), - this, SLOT(_q_doLoadFinished(bool))); - connect(d->page, SIGNAL(statusBarMessage(const QString&)), - this, SLOT(_q_setStatusBarMessage(const QString&))); -} - -/*! - \property QWebGraphicsItem::url - \brief the url of the web page currently viewed - - Setting this property clears the view and loads the URL. - - By default, this property contains an empty, invalid URL. - - \sa load(), urlChanged() -*/ - -void QWebGraphicsItem::setUrl(const QUrl &url) -{ - page()->mainFrame()->setUrl(url); -} - -QUrl QWebGraphicsItem::url() const -{ - if (d->page) - return d->page->mainFrame()->url(); - - return QUrl(); -} - -/*! - \property QWebGraphicsItem::title - \brief the title of the web page currently viewed - - By default, this property contains an empty string. - - \sa titleChanged() -*/ -QString QWebGraphicsItem::title() const -{ - if (d->page) - return d->page->mainFrame()->title(); - - return QString(); -} - -/*! - \property QWebGraphicsItem::icon - \brief the icon associated with the web page currently viewed - - By default, this property contains a null icon. - - \sa iconChanged(), QWebSettings::iconForUrl() -*/ -QIcon QWebGraphicsItem::icon() const -{ - if (d->page) - return d->page->mainFrame()->icon(); - - return QIcon(); -} - -/*! - \property QWebGraphicsItem::zoomFactor - \since 4.5 - \brief the zoom factor for the view -*/ - -void QWebGraphicsItem::setZoomFactor(qreal factor) -{ - if (factor == page()->mainFrame()->zoomFactor()) - return; - - page()->mainFrame()->setZoomFactor(factor); - emit zoomFactorChanged(); -} - -qreal QWebGraphicsItem::zoomFactor() const -{ - return page()->mainFrame()->zoomFactor(); -} - -/*! \reimp -*/ -void QWebGraphicsItem::updateGeometry() -{ - QGraphicsWidget::updateGeometry(); - - if (!d->page) - return; - - QSize size = geometry().size().toSize(); - d->page->setViewportSize(size); -} - -/*! \reimp -*/ -void QWebGraphicsItem::setGeometry(const QRectF& rect) -{ - QGraphicsWidget::setGeometry(rect); - - if (!d->page) - return; - - // NOTE: call geometry() as setGeometry ensures that - // the geometry is within legal bounds (minimumSize, maximumSize) - QSize size = geometry().size().toSize(); - d->page->setViewportSize(size); -} - -/*! - \brief The load status message associated to the web graphicsitem - - Provides the latest status message set during the load of a URL. - Commonly shown by Status Bar widgets. - - \sa statusChanged() -*/ - -QString QWebGraphicsItem::status() const -{ - return d->statusBarMessage; -} - -/*! - Convenience slot that stops loading the document. - - \sa reload(), loadFinished() -*/ -void QWebGraphicsItem::stop() -{ - if (d->page) - d->page->triggerAction(QWebPage::Stop); -} - -/*! - Convenience slot that loads the previous document in the list of documents - built by navigating links. Does nothing if there is no previous document. - - \sa forward() -*/ -void QWebGraphicsItem::back() -{ - if (d->page) - d->page->triggerAction(QWebPage::Back); -} - -/*! - Convenience slot that loads the next document in the list of documents - built by navigating links. Does nothing if there is no next document. - - \sa back() -*/ -void QWebGraphicsItem::forward() -{ - if (d->page) - d->page->triggerAction(QWebPage::Forward); -} - -/*! - Reloads the current document. - - \sa stop(), loadStarted() -*/ -void QWebGraphicsItem::reload() -{ - if (d->page) - d->page->triggerAction(QWebPage::Reload); -} - -/*! - \property QWebGraphicsItem::progress - \brief the progress of loading the current URL, from 0 to 1. -*/ -qreal QWebGraphicsItem::progress() const -{ - return d->progress; -} - -/*! - Loads the specified \a url and displays it. - - \note The view remains the same until enough data has arrived to display the new \a url. - - \sa setUrl(), url(), urlChanged() -*/ -void QWebGraphicsItem::load(const QUrl& url) -{ - page()->mainFrame()->load(url); -} - -/*! - \fn void QWebGraphicsItem::load(const QNetworkRequest &request, QNetworkAccessManager::Operation operation, const QByteArray &body) - - Loads a network request, \a request, using the method specified in \a operation. - - \a body is optional and is only used for POST operations. - - \note The view remains the same until enough data has arrived to display the new url. - - \sa url(), urlChanged() -*/ - -void QWebGraphicsItem::load(const QNetworkRequest& request, - QNetworkAccessManager::Operation operation, - const QByteArray& body) -{ - page()->mainFrame()->load(request, operation, body); -} - -/*! - Sets the content of the web graphicsitem to the specified \a html. - - External objects such as stylesheets or images referenced in the HTML - document are located relative to \a baseUrl. - - The \a html is loaded immediately; external objects are loaded asynchronously. - - When using this method, WebKit assumes that external resources such as - JavaScript programs or style sheets are encoded in UTF-8 unless otherwise - specified. For example, the encoding of an external script can be specified - through the charset attribute of the HTML script tag. Alternatively, the - encoding can also be specified by the web server. - - \sa load(), setContent(), QWebFrame::toHtml() -*/ -void QWebGraphicsItem::setHtml(const QString& html, const QUrl& baseUrl) -{ - page()->mainFrame()->setHtml(html, baseUrl); -} - -QString QWebGraphicsItem::toHtml() const -{ - return page()->mainFrame()->toHtml(); -} - -/*! - Sets the content of the web graphicsitem to the specified content \a data. If the \a mimeType argument - is empty it is currently assumed that the content is HTML but in future versions we may introduce - auto-detection. - - External objects referenced in the content are located relative to \a baseUrl. - - The \a data is loaded immediately; external objects are loaded asynchronously. - - \sa load(), setHtml(), QWebFrame::toHtml() -*/ -void QWebGraphicsItem::setContent(const QByteArray& data, const QString& mimeType, const QUrl& baseUrl) -{ - page()->mainFrame()->setContent(data, mimeType, baseUrl); -} - -/*! - Returns a pointer to the view's history of navigated web pages. - - It is equivalent to - - \snippet webkitsnippets/qtwebkit_qwebview_snippet.cpp 0 -*/ -QWebHistory* QWebGraphicsItem::history() const -{ - return page()->history(); -} - -/*! - \property QWebGraphicsItem::interactive - \brief controls whether the item responds to mouse and key events. -*/ - -bool QWebGraphicsItem::isInteractive() const -{ - return d->interactive; -} - -void QWebGraphicsItem::setInteractive(bool allowed) -{ - if (d->interactive == allowed) - return; - - d->interactive = allowed; - emit interactivityChanged(); -} - -/*! - Returns a pointer to the view/page specific settings object. - - It is equivalent to - - \snippet webkitsnippets/qtwebkit_qwebview_snippet.cpp 1 - - \sa QWebSettings::globalSettings() -*/ -QWebSettings* QWebGraphicsItem::settings() const -{ - return page()->settings(); -} - -/*! \reimp -*/ -void QWebGraphicsItem::hoverMoveEvent(QGraphicsSceneHoverEvent* ev) -{ - if (d->interactive && d->page) { - const bool accepted = ev->isAccepted(); - QMouseEvent me = QMouseEvent(QEvent::MouseMove, - ev->pos().toPoint(), Qt::NoButton, - Qt::NoButton, Qt::NoModifier); - d->page->setView(ev->widget()); - d->page->event(&me); - ev->setAccepted(accepted); - } - - if (!ev->isAccepted()) - QGraphicsItem::hoverMoveEvent(ev); -} - -/*! \reimp -*/ -void QWebGraphicsItem::hoverLeaveEvent(QGraphicsSceneHoverEvent* ev) -{ - Q_UNUSED(ev); -} - -/*! \reimp -*/ -void QWebGraphicsItem::mouseMoveEvent(QGraphicsSceneMouseEvent* ev) -{ - if (d->interactive && d->page) { - const bool accepted = ev->isAccepted(); - d->page->event(ev); - ev->setAccepted(accepted); - } - - if (!ev->isAccepted()) - QGraphicsItem::mouseMoveEvent(ev); -} - -/*! \reimp -*/ -void QWebGraphicsItem::mousePressEvent(QGraphicsSceneMouseEvent* ev) -{ - if (d->interactive && d->page) { - const bool accepted = ev->isAccepted(); - d->page->event(ev); - ev->setAccepted(accepted); - } - - if (!ev->isAccepted()) - QGraphicsItem::mousePressEvent(ev); -} - -/*! \reimp -*/ -void QWebGraphicsItem::mouseReleaseEvent(QGraphicsSceneMouseEvent* ev) -{ - if (d->interactive && d->page) { - const bool accepted = ev->isAccepted(); - d->page->event(ev); - ev->setAccepted(accepted); - } - - if (!ev->isAccepted()) - QGraphicsItem::mouseReleaseEvent(ev); -} - -/*! \reimp -*/ -void QWebGraphicsItem::mouseDoubleClickEvent(QGraphicsSceneMouseEvent* ev) -{ - if (d->interactive && d->page) { - const bool accepted = ev->isAccepted(); - d->page->event(ev); - ev->setAccepted(accepted); - } - - if (!ev->isAccepted()) - QGraphicsItem::mouseDoubleClickEvent(ev); -} - -/*! \reimp -*/ -void QWebGraphicsItem::keyPressEvent(QKeyEvent* ev) -{ - if (d->interactive && d->page) - d->page->event(ev); - - if (!ev->isAccepted()) - QGraphicsItem::keyPressEvent(ev); -} - -/*! \reimp -*/ -void QWebGraphicsItem::keyReleaseEvent(QKeyEvent* ev) -{ - if (d->interactive && d->page) - d->page->event(ev); - - if (!ev->isAccepted()) - QGraphicsItem::keyReleaseEvent(ev); -} - -/*! \reimp -*/ -void QWebGraphicsItem::focusInEvent(QFocusEvent* ev) -{ - if (d->page) - d->page->event(ev); - else - QGraphicsItem::focusInEvent(ev); -} - -/*! \reimp -*/ -void QWebGraphicsItem::focusOutEvent(QFocusEvent* ev) -{ - if (d->page) - d->page->event(ev); - else - QGraphicsItem::focusOutEvent(ev); -} - -/*! \reimp -*/ -bool QWebGraphicsItem::focusNextPrevChild(bool next) -{ - if (d->page) - return d->page->focusNextPrevChild(next); - - return QGraphicsWidget::focusNextPrevChild(next); -} - -/*! \reimp -*/ -void QWebGraphicsItem::dragEnterEvent(QGraphicsSceneDragDropEvent* ev) -{ -#ifndef QT_NO_DRAGANDDROP - //if (d->page) - // d->page->event(ev); - //Just remove this line below when the code above is working - Q_UNUSED(ev); -#else - Q_UNUSED(ev); -#endif -} - -/*! \reimp -*/ -void QWebGraphicsItem::dragLeaveEvent(QGraphicsSceneDragDropEvent* ev) -{ -#ifndef QT_NO_DRAGANDDROP - if (d->interactive && d->page) { - const bool accepted = ev->isAccepted(); - d->page->event(ev); - ev->setAccepted(accepted); - } - - if (!ev->isAccepted()) - QGraphicsWidget::dragLeaveEvent(ev); -#else - Q_UNUSED(ev); -#endif -} - -/*! \reimp -*/ -void QWebGraphicsItem::dragMoveEvent(QGraphicsSceneDragDropEvent* ev) -{ -#ifndef QT_NO_DRAGANDDROP - if (d->interactive && d->page) { - const bool accepted = ev->isAccepted(); - d->page->event(ev); - ev->setAccepted(accepted); - } - - if (!ev->isAccepted()) - QGraphicsWidget::dragMoveEvent(ev); -#else - Q_UNUSED(ev); -#endif -} - -/*! \reimp -*/ -void QWebGraphicsItem::dropEvent(QGraphicsSceneDragDropEvent* ev) -{ -#ifndef QT_NO_DRAGANDDROP - if (d->interactive && d->page) { - const bool accepted = ev->isAccepted(); - d->page->event(ev); - ev->setAccepted(accepted); - } - - if (!ev->isAccepted()) - QGraphicsWidget::dropEvent(ev); -#else - Q_UNUSED(ev); -#endif -} - -#ifndef QT_NO_CONTEXTMENU -/*! \reimp -*/ -void QWebGraphicsItem::contextMenuEvent(QGraphicsSceneContextMenuEvent* ev) -{ - if (d->page) { - const bool accepted = ev->isAccepted(); - d->page->event(ev); - ev->setAccepted(accepted); - } -} -#endif // QT_NO_CONTEXTMENU - -#ifndef QT_NO_WHEELEVENT -/*! \reimp -*/ -void QWebGraphicsItem::wheelEvent(QGraphicsSceneWheelEvent* ev) -{ - if (d->interactive && d->page) { - const bool accepted = ev->isAccepted(); - d->page->event(ev); - ev->setAccepted(accepted); - } - - if (!ev->isAccepted()) - QGraphicsItem::wheelEvent(ev); -} -#endif // QT_NO_WHEELEVENT - -/*! \reimp -*/ -void QWebGraphicsItem::inputMethodEvent(QInputMethodEvent* ev) -{ - if (d->interactive && d->page) - d->page->event(ev); - - if (!ev->isAccepted()) - QGraphicsItem::inputMethodEvent(ev); -} - -#include "moc_qwebgraphicsitem.cpp" diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebgraphicsitem.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebgraphicsitem.h deleted file mode 100644 index 2c6817a..0000000 --- a/src/3rdparty/webkit/WebKit/qt/Api/qwebgraphicsitem.h +++ /dev/null @@ -1,144 +0,0 @@ -/* - Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#ifndef QWebGraphicsItem_h -#define QWebGraphicsItem_h - -#include "qwebkitglobal.h" -#include -#include -#include -#include -#include -#include - -class QWebPage; -class QWebHistory; -class QWebSettings; - -class QWebGraphicsItemPrivate; - -class QWEBKIT_EXPORT QWebGraphicsItem : public QGraphicsWidget { - Q_OBJECT - - Q_PROPERTY(QString title READ title NOTIFY titleChanged) - Q_PROPERTY(QIcon icon READ icon NOTIFY iconChanged) - Q_PROPERTY(qreal zoomFactor READ zoomFactor WRITE setZoomFactor NOTIFY zoomFactorChanged) - Q_PROPERTY(QString status READ status NOTIFY statusChanged) - - Q_PROPERTY(QString html READ toHtml WRITE setHtml) - Q_PROPERTY(QUrl url READ url WRITE setUrl NOTIFY urlChanged) - Q_PROPERTY(qreal progress READ progress NOTIFY progressChanged) - - Q_PROPERTY(bool interactive READ isInteractive WRITE setInteractive NOTIFY interactivityChanged) - -public: - QWebGraphicsItem(QGraphicsItem* parent = 0); - ~QWebGraphicsItem(); - - QWebPage* page() const; - void setPage(QWebPage*); - - QUrl url() const; - void setUrl(const QUrl&); - - QString title() const; - QIcon icon() const; - - qreal zoomFactor() const; - void setZoomFactor(qreal); - - bool isInteractive() const; - void setInteractive(bool); - - qreal progress() const; - - void load(const QUrl &url); - void load(const QNetworkRequest& request, QNetworkAccessManager::Operation operation = QNetworkAccessManager::GetOperation, const QByteArray& body = QByteArray()); - - QString toHtml() const; - void setHtml(const QString& html, const QUrl& baseUrl = QUrl()); - // FIXME: Consider rename to setHtml? - void setContent(const QByteArray& data, const QString& mimeType = QString(), const QUrl& baseUrl = QUrl()); - - QWebHistory* history() const; - QWebSettings* settings() const; - - QString status() const; - - virtual void setGeometry(const QRectF& rect); - virtual void updateGeometry(); - virtual void paint(QPainter*, const QStyleOptionGraphicsItem* options, QWidget* widget = 0); - virtual bool event(QEvent*); - -public Q_SLOTS: - void stop(); - void back(); - void forward(); - void reload(); - -Q_SIGNALS: - void loadStarted(); - void loadFinished(); - void loadFailed(); - - void progressChanged(qreal); - void interactivityChanged(); - void urlChanged(const QUrl&); - void titleChanged(const QString&); - void iconChanged(); - void statusChanged(); - void zoomFactorChanged(); - -protected: - virtual void mousePressEvent(QGraphicsSceneMouseEvent*); - virtual void mouseDoubleClickEvent(QGraphicsSceneMouseEvent*); - virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent*); - virtual void mouseMoveEvent(QGraphicsSceneMouseEvent*); - virtual void hoverMoveEvent(QGraphicsSceneHoverEvent*); - virtual void hoverLeaveEvent(QGraphicsSceneHoverEvent*); -#ifndef QT_NO_WHEELEVENT - virtual void wheelEvent(QGraphicsSceneWheelEvent*); -#endif - virtual void keyPressEvent(QKeyEvent*); - virtual void keyReleaseEvent(QKeyEvent*); -#ifndef QT_NO_CONTEXTMENU - virtual void contextMenuEvent(QGraphicsSceneContextMenuEvent*); -#endif - virtual void dragEnterEvent(QGraphicsSceneDragDropEvent*); - virtual void dragLeaveEvent(QGraphicsSceneDragDropEvent*); - virtual void dragMoveEvent(QGraphicsSceneDragDropEvent*); - virtual void dropEvent(QGraphicsSceneDragDropEvent*); - virtual void focusInEvent(QFocusEvent*); - virtual void focusOutEvent(QFocusEvent*); - virtual void inputMethodEvent(QInputMethodEvent*); - virtual bool focusNextPrevChild(bool next); - - virtual bool sceneEvent(QEvent*); - -private: - Q_PRIVATE_SLOT(d, void _q_doLoadProgress(int progress)) - Q_PRIVATE_SLOT(d, void _q_doLoadFinished(bool success)) - Q_PRIVATE_SLOT(d, void _q_setStatusBarMessage(const QString& message)) - - QWebGraphicsItemPrivate* const d; - friend class QWebGraphicsItemPrivate; -}; - -#endif // QWebGraphicsItem_h diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.h index b024997..41d1835 100644 --- a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.h +++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.h @@ -371,7 +371,7 @@ private: friend class QWebFrame; friend class QWebPagePrivate; friend class QWebView; - friend class QWebGraphicsItem; + friend class QGraphicsWebView; friend class QWebInspector; friend class WebCore::ChromeClientQt; friend class WebCore::EditorClientQt; diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qgraphicswebview/qgraphicswebview.pro b/src/3rdparty/webkit/WebKit/qt/tests/qgraphicswebview/qgraphicswebview.pro new file mode 100644 index 0000000..cba6f11 --- /dev/null +++ b/src/3rdparty/webkit/WebKit/qt/tests/qgraphicswebview/qgraphicswebview.pro @@ -0,0 +1,6 @@ +TEMPLATE = app +TARGET = tst_qgraphicswebview +include(../../../../WebKit.pri) +SOURCES += tst_qgraphicswebview.cpp +QT += testlib network +QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qgraphicswebview/tst_qgraphicswebview.cpp b/src/3rdparty/webkit/WebKit/qt/tests/qgraphicswebview/tst_qgraphicswebview.cpp new file mode 100644 index 0000000..1a57286 --- /dev/null +++ b/src/3rdparty/webkit/WebKit/qt/tests/qgraphicswebview/tst_qgraphicswebview.cpp @@ -0,0 +1,58 @@ +/* + Copyright (C) 2009 Jakub Wieczorek + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include + +#include + +class tst_QGraphicsWebView : public QObject +{ + Q_OBJECT + +private slots: + void qgraphicswebview(); +}; + +void tst_QGraphicsWebView::qgraphicswebview() +{ + QGraphicsWebView item; + item.url(); + item.title(); + item.icon(); + item.zoomFactor(); + item.isInteractive(); + item.progress(); + item.toHtml(); + item.history(); + item.settings(); + item.status(); + item.page(); + item.setPage(0); + item.page(); + item.setUrl(QUrl()); + item.setZoomFactor(0); + item.setInteractive(true); + item.load(QUrl()); + item.setHtml(QString()); + item.setContent(QByteArray()); +} + +QTEST_MAIN(tst_QGraphicsWebView) + +#include "tst_qgraphicswebview.moc" diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebgraphicsitem/qwebgraphicsitem.pro b/src/3rdparty/webkit/WebKit/qt/tests/qwebgraphicsitem/qwebgraphicsitem.pro deleted file mode 100644 index 39e90e7..0000000 --- a/src/3rdparty/webkit/WebKit/qt/tests/qwebgraphicsitem/qwebgraphicsitem.pro +++ /dev/null @@ -1,6 +0,0 @@ -TEMPLATE = app -TARGET = tst_qwebgraphicsitem -include(../../../../WebKit.pri) -SOURCES += tst_qwebgraphicsitem.cpp -QT += testlib network -QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebgraphicsitem/tst_qwebgraphicsitem.cpp b/src/3rdparty/webkit/WebKit/qt/tests/qwebgraphicsitem/tst_qwebgraphicsitem.cpp deleted file mode 100644 index 731e342..0000000 --- a/src/3rdparty/webkit/WebKit/qt/tests/qwebgraphicsitem/tst_qwebgraphicsitem.cpp +++ /dev/null @@ -1,58 +0,0 @@ -/* - Copyright (C) 2009 Jakub Wieczorek - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#include - -#include - -class tst_QWebGraphicsItem : public QObject -{ - Q_OBJECT - -private slots: - void qwebgraphicsitem(); -}; - -void tst_QWebGraphicsItem::qwebgraphicsitem() -{ - QWebGraphicsItem item; - item.url(); - item.title(); - item.icon(); - item.zoomFactor(); - item.isInteractive(); - item.progress(); - item.toHtml(); - item.history(); - item.settings(); - item.status(); - item.page(); - item.setPage(0); - item.page(); - item.setUrl(QUrl()); - item.setZoomFactor(0); - item.setInteractive(true); - item.load(QUrl()); - item.setHtml(QString()); - item.setContent(QByteArray()); -} - -QTEST_MAIN(tst_QWebGraphicsItem) - -#include "tst_qwebgraphicsitem.moc" diff --git a/src/3rdparty/webkit/WebKit/qt/tests/tests.pro b/src/3rdparty/webkit/WebKit/qt/tests/tests.pro index ec496e3..81cc8f3 100644 --- a/src/3rdparty/webkit/WebKit/qt/tests/tests.pro +++ b/src/3rdparty/webkit/WebKit/qt/tests/tests.pro @@ -1,4 +1,4 @@ TEMPLATE = subdirs -SUBDIRS = qwebframe qwebpage qwebelement qwebgraphicsitem qwebhistoryinterface qwebplugindatabase qwebview qwebhistory +SUBDIRS = qwebframe qwebpage qwebelement qgraphicswebview qwebhistoryinterface qwebplugindatabase qwebview qwebhistory greaterThan(QT_MINOR_VERSION, 4): SUBDIRS += benchmarks/painting/tst_painting.pro benchmarks/loading/tst_loading.pro -- cgit v0.12 From d2a0ebd94b1bba93e74dd40db5044b125b1de614 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 1 Oct 2009 17:55:13 +0200 Subject: remove unused translations.pro --- .../assistant/compat/translations/translations.pro | 34 ---------------------- 1 file changed, 34 deletions(-) delete mode 100644 tools/assistant/compat/translations/translations.pro diff --git a/tools/assistant/compat/translations/translations.pro b/tools/assistant/compat/translations/translations.pro deleted file mode 100644 index 19fcc06..0000000 --- a/tools/assistant/compat/translations/translations.pro +++ /dev/null @@ -1,34 +0,0 @@ -# Include those manually as they do not contain any directory specification - -FORMS += ../helpdialog.ui \ - ../mainwindow.ui \ - ../tabbedbrowser.ui \ - ../topicchooser.ui - -SOURCES += ../main.cpp \ - ../helpwindow.cpp \ - ../topicchooser.cpp \ - ../docuparser.cpp \ - ../index.cpp \ - ../profile.cpp \ - ../config.cpp \ - ../helpdialog.cpp \ - ../mainwindow.cpp \ - ../tabbedbrowser.cpp \ - ../fontsettingsdialog.cpp - -SOURCES += ../../../shared/fontpanel/fontpanel.cpp - -HEADERS += ../helpwindow.h \ - ../topicchooser.h \ - ../docuparser.h \ - ../index.h \ - ../profile.h \ - ../helpdialog.h \ - ../mainwindow.h \ - ../tabbedbrowser.h \ - ../config.h \ - ../fontsettingsdialog.h - - -TRANSLATIONS=$$[QT_INSTALL_TRANSLATIONS]/assistant_de.ts $$[QT_INSTALL_TRANSLATIONS]/assistant_untranslated.ts -- cgit v0.12 From 504e6c63bc7fc577b2a97b0e459bab4f872652e6 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 1 Oct 2009 16:52:00 +0200 Subject: remove *_untranslated.ts with the current scheme of running "make ts" only when doing a particular translation and checking in only the relevant file, these files are never updated. lconvert can generate an empty template from any translation anyway. --- tools/assistant/translations/qt_help.pro | 2 +- tools/assistant/translations/translations.pro | 1 - tools/assistant/translations/translations_adp.pro | 2 +- tools/designer/translations/translations.pro | 3 +- tools/linguist/linguist/linguist.pro | 1 - tools/qtconfig/translations/translations.pro | 1 - tools/qvfb/translations/translations.pro | 1 - translations/assistant_adp_untranslated.ts | 967 --- translations/assistant_untranslated.ts | 1059 --- translations/designer_untranslated.ts | 6950 ------------------- translations/linguist_untranslated.ts | 1964 ------ translations/qt_help_untranslated.ts | 355 - translations/qt_untranslated.ts | 7693 --------------------- translations/qtconfig_untranslated.ts | 885 --- translations/qvfb_untranslated.ts | 325 - translations/translations.pri | 2 +- 16 files changed, 4 insertions(+), 20207 deletions(-) delete mode 100644 translations/assistant_adp_untranslated.ts delete mode 100644 translations/assistant_untranslated.ts delete mode 100644 translations/designer_untranslated.ts delete mode 100644 translations/linguist_untranslated.ts delete mode 100644 translations/qt_help_untranslated.ts delete mode 100644 translations/qt_untranslated.ts delete mode 100644 translations/qtconfig_untranslated.ts delete mode 100644 translations/qvfb_untranslated.ts diff --git a/tools/assistant/translations/qt_help.pro b/tools/assistant/translations/qt_help.pro index 9f4d7d8..7d92d06 100644 --- a/tools/assistant/translations/qt_help.pro +++ b/tools/assistant/translations/qt_help.pro @@ -43,8 +43,8 @@ TRANSLATIONS=$$[QT_INSTALL_TRANSLATIONS]/qt_help_de.ts \ $$[QT_INSTALL_TRANSLATIONS]/qt_help_ja.ts \ $$[QT_INSTALL_TRANSLATIONS]/qt_help_pl.ts \ $$[QT_INSTALL_TRANSLATIONS]/qt_help_ru.ts \ - $$[QT_INSTALL_TRANSLATIONS]/qt_help_untranslated.ts \ $$[QT_INSTALL_TRANSLATIONS]/qt_help_zh_CN.ts \ $$[QT_INSTALL_TRANSLATIONS]/qt_help_zh_TW.ts \ $$[QT_INSTALL_TRANSLATIONS]/qt_help_da.ts + error("This is a dummy profile to be used for translations ONLY.") diff --git a/tools/assistant/translations/translations.pro b/tools/assistant/translations/translations.pro index 4b836e6..b3dbd10 100644 --- a/tools/assistant/translations/translations.pro +++ b/tools/assistant/translations/translations.pro @@ -44,7 +44,6 @@ TRANSLATIONS=$$[QT_INSTALL_TRANSLATIONS]/assistant_de.ts \ $$[QT_INSTALL_TRANSLATIONS]/assistant_ja.ts \ $$[QT_INSTALL_TRANSLATIONS]/assistant_pl.ts \ $$[QT_INSTALL_TRANSLATIONS]/assistant_ru.ts \ - $$[QT_INSTALL_TRANSLATIONS]/assistant_untranslated.ts \ $$[QT_INSTALL_TRANSLATIONS]/assistant_zh_CN.ts \ $$[QT_INSTALL_TRANSLATIONS]/assistant_zh_TW.ts \ $$[QT_INSTALL_TRANSLATIONS]/assistant_da.ts diff --git a/tools/assistant/translations/translations_adp.pro b/tools/assistant/translations/translations_adp.pro index c6f3e81..4ff6576 100644 --- a/tools/assistant/translations/translations_adp.pro +++ b/tools/assistant/translations/translations_adp.pro @@ -35,7 +35,7 @@ TRANSLATIONS=$$[QT_INSTALL_TRANSLATIONS]/assistant_adp_de.ts \ $$[QT_INSTALL_TRANSLATIONS]/assistant_adp_ja.ts \ $$[QT_INSTALL_TRANSLATIONS]/assistant_adp_pl.ts \ $$[QT_INSTALL_TRANSLATIONS]/assistant_adp_ru.ts \ - $$[QT_INSTALL_TRANSLATIONS]/assistant_adp_untranslated.ts \ $$[QT_INSTALL_TRANSLATIONS]/assistant_adp_zh_CN.ts \ $$[QT_INSTALL_TRANSLATIONS]/assistant_adp_zh_TW.ts + error("This is a dummy profile to be used for translations ONLY.") diff --git a/tools/designer/translations/translations.pro b/tools/designer/translations/translations.pro index fd782b0..96d9074 100644 --- a/tools/designer/translations/translations.pro +++ b/tools/designer/translations/translations.pro @@ -136,5 +136,4 @@ TRANSLATIONS=$$[QT_INSTALL_TRANSLATIONS]/designer_de.ts \ $$[QT_INSTALL_TRANSLATIONS]/designer_ru.ts \ $$[QT_INSTALL_TRANSLATIONS]/designer_sl.ts \ $$[QT_INSTALL_TRANSLATIONS]/designer_zh_CN.ts \ - $$[QT_INSTALL_TRANSLATIONS]/designer_zh_TW.ts \ - $$[QT_INSTALL_TRANSLATIONS]/designer_untranslated.ts + $$[QT_INSTALL_TRANSLATIONS]/designer_zh_TW.ts diff --git a/tools/linguist/linguist/linguist.pro b/tools/linguist/linguist/linguist.pro index 00ebec1..c7f6f1c 100644 --- a/tools/linguist/linguist/linguist.pro +++ b/tools/linguist/linguist/linguist.pro @@ -98,7 +98,6 @@ RESOURCES += linguist.qrc TRANSLATIONS=$$[QT_INSTALL_TRANSLATIONS]/linguist_ja.ts \ $$[QT_INSTALL_TRANSLATIONS]/linguist_pl.ts \ $$[QT_INSTALL_TRANSLATIONS]/linguist_ru.ts \ - $$[QT_INSTALL_TRANSLATIONS]/linguist_untranslated.ts \ $$[QT_INSTALL_TRANSLATIONS]/linguist_zh_CN.ts \ $$[QT_INSTALL_TRANSLATIONS]/linguist_zh_TW.ts \ $$[QT_INSTALL_TRANSLATIONS]/linguist_de.ts \ diff --git a/tools/qtconfig/translations/translations.pro b/tools/qtconfig/translations/translations.pro index 1f9f572..51e96f0 100644 --- a/tools/qtconfig/translations/translations.pro +++ b/tools/qtconfig/translations/translations.pro @@ -9,6 +9,5 @@ FORMS = ../mainwindowbase.ui ../paletteeditoradvancedbase.ui ../previewwi TRANSLATIONS=$$[QT_INSTALL_TRANSLATIONS]/qtconfig_pl.ts \ $$[QT_INSTALL_TRANSLATIONS]/qtconfig_ru.ts \ - $$[QT_INSTALL_TRANSLATIONS]/qtconfig_untranslated.ts \ $$[QT_INSTALL_TRANSLATIONS]/qtconfig_zh_CN.ts \ $$[QT_INSTALL_TRANSLATIONS]/qtconfig_zh_TW.ts diff --git a/tools/qvfb/translations/translations.pro b/tools/qvfb/translations/translations.pro index 17579f7..2f37b0e 100644 --- a/tools/qvfb/translations/translations.pro +++ b/tools/qvfb/translations/translations.pro @@ -28,6 +28,5 @@ SOURCES = ../qvfb.cpp \ TRANSLATIONS=$$[QT_INSTALL_TRANSLATIONS]/qvfb_pl.ts \ $$[QT_INSTALL_TRANSLATIONS]/qvfb_ru.ts \ - $$[QT_INSTALL_TRANSLATIONS]/qvfb_untranslated.ts \ $$[QT_INSTALL_TRANSLATIONS]/qvfb_zh_CN.ts \ $$[QT_INSTALL_TRANSLATIONS]/qvfb_zh_TW.ts diff --git a/translations/assistant_adp_untranslated.ts b/translations/assistant_adp_untranslated.ts deleted file mode 100644 index e6c927a..0000000 --- a/translations/assistant_adp_untranslated.ts +++ /dev/null @@ -1,967 +0,0 @@ - - - - - AssistantServer - - - Qt Assistant - - - - - Failed to bind to port %1 - - - - - FontPanel - - - Font - - - - - &Writing system - - - - - &Family - - - - - &Style - - - - - &Point size - - - - - FontSettingsDialog - - - Font Settings - - - - - Font settings for: - - - - - Browser - - - - - Application - - - - - Use custom settings - - - - - HelpDialog - - - Con&tents - - - - - - - Qt Assistant - - - - - Open Link in Current Tab - - - - - Open Link in New Window - - - - - Open Link in New Tab - - - - - - Prepare... - - - - - Failed to load keyword index file -Assistant will not work! - - - - - Cannot open the index file %1 - - - - - - - Warning - - - - - - Documentation file %1 does not exist! -Skipping file. - - - - - - Parse Error - - - - - Documentation file %1 is not compatible! -Skipping file. - - - - - - Done - - - - - Failed to save fulltext search index -Assistant will not work! - - - - - Indexing files... - - - - - Reading dictionary... - - - - - - Full Text Search - - - - - Using a wildcard within phrases is not allowed. - - - - - The closing quotation mark is missing. - - - - - %n document(s) found. - - - - - - - Help - - - - - <b>Help</b><p>Choose the topic you want help on from the contents list, or search the index for keywords.</p> - - - - - Displays help topics organized by category, index or bookmarks. Another tab inherits the full text search. - - - - - <b>Help topics organized by category.</b><p>Double-click an item to see the topics in that category. To view a topic, just double-click it.</p> - - - - - column 1 - - - - - &Index - - - - - &Look For: - - - - - Enter keyword - - - - - <b>Enter a keyword.</b><p>The list will select an item that matches the entered string best.</p> - - - - - <b>List of available help topics.</b><p>Double-click on an item to open its help page. If more than one is found, you must specify which page you want.</p> - - - - - &Bookmarks - - - - - Displays the list of bookmarks. - - - - - Add new bookmark - - - - - Add the currently displayed page as a new bookmark. - - - - - &New - - - - - Delete bookmark - - - - - Delete the selected bookmark. - - - - - &Delete - - - - - &Search - - - - - Searching f&or: - - - - - Enter searchword(s). - - - - - <b>Enter search word(s).</b><p>Enter here the word(s) you are looking for. The words may contain wildcards (*). For a sequence of words quote them.</p> - - - - - <b>Found documents</b><p>This list contains all found documents from the last search. The documents are ordered, i.e. the first document has the most matches.</p> - - - - - Found &Documents: - - - - - Display the help page. - - - - - Display the help page for the full text search. - - - - - He&lp - - - - - Start searching. - - - - - Pressing this button starts the search. - - - - - Preparing... - - - - - HelpWindow - - - Help - - - - - Open Link in New Window Shift+LMB - - - - - Unable to launch web browser. - - - - - - OK - - - - - Failed to open link: '%1' - - - - - <div align="center"><h1>The page could not be found</h1><br><h3>'%1'</h3></div> - - - - - Error... - - - - - Copy &Link Location - - - - - Open Link in New Tab - - - - - Index - - - Untitled - - - - - MainWindow - - - Toolbar - - - - - &Print... - - - - - E&xit - - - - - &Copy - - - - - &Find in Text... - - - - - &Home - - - - - &Previous - - - - - &Next - - - - - About Qt - - - - - Zoom &in - - - - - Zoom &out - - - - - New Window - - - - - Ctrl+T - - - - - Ctrl+I - - - - - Ctrl+B - - - - - - Qt Assistant - - - - - &Add Bookmark - - - - - Sidebar - - - - - &Window - - - - - Minimize - - - - - Ctrl+M - - - - - Initializing Qt Assistant... - - - - - SHIFT+CTRL+= - - - - - Ctrl+S - - - - - Ctrl+W - - - - - Ctrl+] - - - - - Ctrl+[ - - - - - Views - - - - - Displays the main page of a specific documentation set. - - - - - Failed to open about application contents in file: '%1' - - - - - ... - - - - - - Save Page - - - - - Cannot open file for writing! - - - - - Qt Assistant by Nokia - - - - - Go - - - - - &Help - - - - - &File - - - - - Boo&kmarks - - - - - &Go - - - - - &View - - - - - &Edit - - - - - Print the currently displayed page. - - - - - Ctrl+P - - - - - Quit Qt Assistant. - - - - - Ctrl+Q - - - - - Copy the selected text to the clipboard. - - - - - Ctrl+C - - - - - Open the Find dialog. Qt Assistant will search the currently displayed page for the text you enter. - - - - - Ctrl+F - - - - - Find &Next - - - - - F3 - - - - - Find &Previous - - - - - Shift+F3 - - - - - Go to the home page. Qt Assistant's home page is the Qt Reference Documentation. - - - - - Ctrl+Home - - - - - Go to the previous page. - - - - - Alt+Left - - - - - Go to the next page. - - - - - Alt+Right - - - - - About Qt Assistant - - - - - Display further information about Qt Assistant. - - - - - Zoom in on the document, i.e. increase the font size. - - - - - Ctrl++ - - - - - Zoom out on the document, i.e. decrease the font size. - - - - - Ctrl+- - - - - - Open a new window. - - - - - Ctrl+N - - - - - &Close - - - - - Close the current window. - - - - - Add the currently displayed page as a new bookmark. - - - - - What's This? - - - - - "What's This?" context sensitive help. - - - - - Shift+F1 - - - - - Add Tab - - - - - Ctrl+Alt+N - - - - - Next Tab - - - - - Ctrl+Alt+Right - - - - - Previous Tab - - - - - Ctrl+Alt+Left - - - - - Close Tab - - - - - Ctrl+Alt+Q - - - - - Qt Assistant Manual - - - - - F1 - - - - - Save Page As... - - - - - Ctrl+Alt+S - - - - - Sync with Table of Contents - - - - - Select the page in contents tab. - - - - - Font Settings... - - - - - QObject - - - Qt Assistant by Nokia - - - - - TabbedBrowser - - - ... - - - - - Add page - - - - - Close page - - - - - New Tab - - - - - Close Tab - - - - - Close Other Tabs - - - - - TabbedBrowser - - - - - Untitled - - - - - Previous - - - - - Next - - - - - Case Sensitive - - - - - Whole words - - - - - <img src=":/trolltech/assistant/images/wrap.png">&nbsp;Search wrapped - - - - - TopicChooser - - - Choose a topic for <b>%1</b> - - - - - Choose Topic - - - - - Select a topic from the list and click the <b>Display</b>-button to open the online help. - - - - - &Topics - - - - - Displays a list of available help topics for the keyword. - - - - - &Display - - - - - Open the topic selected in the list. - - - - - &Close - - - - - Close the Dialog. - - - - diff --git a/translations/assistant_untranslated.ts b/translations/assistant_untranslated.ts deleted file mode 100644 index 1853155..0000000 --- a/translations/assistant_untranslated.ts +++ /dev/null @@ -1,1059 +0,0 @@ - - - - - AboutDialog - - - &Close - - - - - AboutLabel - - - Warning - - - - - Unable to launch external application. - - - - - - OK - - - - - BookmarkDialog - - - - - - - Bookmarks - - - - - Add Bookmark - - - - - Bookmark: - - - - - Add in Folder: - - - - - + - - - - - New Folder - - - - - Delete Folder - - - - - Rename Folder - - - - - BookmarkManager - - - Bookmarks - - - - - Remove - - - - - You are going to delete a Folder, this will also<br>remove it's content. Are you sure to continue? - - - - - - New Folder - - - - - BookmarkWidget - - - Filter: - - - - - Remove - - - - - Delete Folder - - - - - Rename Folder - - - - - Show Bookmark - - - - - Show Bookmark in New Tab - - - - - Delete Bookmark - - - - - Rename Bookmark - - - - - Add - - - - - CentralWidget - - - Add new page - - - - - Close current page - - - - - Print Document - - - - - - unknown - - - - - Add New Page - - - - - Close This Page - - - - - Close Other Pages - - - - - Add Bookmark for this Page... - - - - - Search - - - - - ContentWindow - - - Open Link - - - - - Open Link in New Tab - - - - - FilterNameDialogClass - - - Add Filter Name - - - - - Filter Name: - - - - - FindWidget - - - Previous - - - - - Next - - - - - Case Sensitive - - - - - Whole words - - - - - <img src=":/trolltech/assistant/images/wrap.png">&nbsp;Search wrapped - - - - - FontPanel - - - Font - - - - - &Writing system - - - - - &Family - - - - - &Style - - - - - &Point size - - - - - HelpViewer - - - Help - - - - - OK - - - - - <title>Error 404...</title><div align="center"><br><br><h1>The page could not be found</h1><br><h3>'%1'</h3></div> - - - - - Copy &Link Location - - - - - Open Link in New Tab Ctrl+LMB - - - - - Open Link in New Tab - - - - - Unable to launch external application. - - - - - - IndexWindow - - - &Look for: - - - - - Open Link - - - - - Open Link in New Tab - - - - - InstallDialog - - - - Install Documentation - - - - - Downloading documentation info... - - - - - Download canceled. - - - - - - - Done. - - - - - The file %1 already exists. Do you want to overwrite it? - - - - - Unable to save the file %1: %2. - - - - - Downloading %1... - - - - - - - Download failed: %1. - - - - - Documentation info file is corrupt! - - - - - Download failed: Downloaded file is corrupted. - - - - - Installing documentation %1... - - - - - Error while installing documentation: -%1 - - - - - Available Documentation: - - - - - Install - - - - - Cancel - - - - - Close - - - - - Installation Path: - - - - - ... - - - - - MainWindow - - - - Index - - - - - - Contents - - - - - - Bookmarks - - - - - - Search - - - - - - - Qt Assistant - - - - - - Unfiltered - - - - - Page Set&up... - - - - - Print Preview... - - - - - &Print... - - - - - New &Tab - - - - - &Close Tab - - - - - &Quit - - - - - CTRL+Q - - - - - &Copy selected Text - - - - - &Find in Text... - - - - - Find &Next - - - - - Find &Previous - - - - - Preferences... - - - - - Zoom &in - - - - - Zoom &out - - - - - Normal &Size - - - - - Ctrl+0 - - - - - ALT+C - - - - - ALT+I - - - - - ALT+S - - - - - &Home - - - - - Ctrl+Home - - - - - &Back - - - - - &Forward - - - - - Sync with Table of Contents - - - - - Next Page - - - - - Ctrl+Alt+Right - - - - - Previous Page - - - - - Ctrl+Alt+Left - - - - - Add Bookmark... - - - - - About... - - - - - Navigation Toolbar - - - - - Toolbars - - - - - Filter Toolbar - - - - - Filtered by: - - - - - Address Toolbar - - - - - Address: - - - - - Could not find the associated content item. - - - - - About %1 - - - - - Updating search index - - - - - Looking for Qt Documentation... - - - - - &Window - - - - - Minimize - - - - - Ctrl+M - - - - - Zoom - - - - - &File - - - - - &Edit - - - - - &View - - - - - &Go - - - - - &Bookmarks - - - - - &Help - - - - - ALT+O - - - - - CTRL+D - - - - - PreferencesDialog - - - - - Add Documentation - - - - - Qt Compressed Help Files (*.qch) - - - - - The specified file is not a valid Qt Help File! - - - - - The namespace %1 is already registered! - - - - - Remove Documentation - - - - - Some documents currently opened in Assistant reference the documentation you are attempting to remove. Removing the documentation will close those documents. - - - - - Cancel - - - - - OK - - - - - Use custom settings - - - - - PreferencesDialogClass - - - Preferences - - - - - Fonts - - - - - Font settings: - - - - - Browser - - - - - Application - - - - - Filters - - - - - Filter: - - - - - Attributes: - - - - - 1 - - - - - Add - - - - - Remove - - - - - Documentation - - - - - Registered Documentation: - - - - - Add... - - - - - Options - - - - - Current Page - - - - - Restore to default - - - - - Homepage - - - - - QObject - - - The specified collection file does not exist! - - - - - Missing collection file! - - - - - Invalid URL! - - - - - Missing URL! - - - - - - - Unknown widget: %1 - - - - - - - Missing widget! - - - - - - The specified Qt help file does not exist! - - - - - - Missing help file! - - - - - Missing filter argument! - - - - - Unknown option: %1 - - - - - - Qt Assistant - - - - - Could not register documentation file -%1 - -Reason: -%2 - - - - - Documentation successfully registered. - - - - - Could not unregister documentation file -%1 - -Reason: -%2 - - - - - Documentation successfully unregistered. - - - - - Cannot load sqlite database driver! - - - - - The specified collection file could not be read! - - - - - - Bookmark - - - - - RemoteControl - - - Debugging Remote Control - - - - - Received Command: %1 %2 - - - - - SearchWidget - - - &Copy - - - - - Copy &Link Location - - - - - - Open Link in New Tab - - - - - Select All - - - - - Open Link - - - - - TopicChooser - - - Choose a topic for <b>%1</b>: - - - - - Choose Topic - - - - - &Topics - - - - - &Display - - - - - &Close - - - - diff --git a/translations/designer_untranslated.ts b/translations/designer_untranslated.ts deleted file mode 100644 index 1666363..0000000 --- a/translations/designer_untranslated.ts +++ /dev/null @@ -1,6950 +0,0 @@ - - - - - - - - <object> - - - - - <signal> - - - - - <slot> - - - - - The moose in the noose -ate the goose who was loose. - - - - - AbstractFindWidget - - - &Previous - - - - - &Next - - - - - &Case sensitive - - - - - Whole &words - - - - - <img src=":/trolltech/shared/images/wrap.png">&nbsp;Search wrapped - - - - - AddLinkDialog - - - Insert Link - - - - - Title: - - - - - URL: - - - - - AppFontDialog - - - Additional Fonts - - - - - AppFontManager - - - '%1' is not a file. - - - - - The font file '%1' does not have read permissions. - - - - - The font file '%1' is already loaded. - - - - - The font file '%1' could not be loaded. - - - - - '%1' is not a valid font id. - - - - - There is no loaded font matching the id '%1'. - - - - - The font '%1' (%2) could not be unloaded. - - - - - AppFontWidget - - - Fonts - - - - - Add font files - - - - - Remove current font file - - - - - Remove all font files - - - - - Add Font Files - - - - - Font files (*.ttf) - - - - - Error Adding Fonts - - - - - Error Removing Fonts - - - - - Remove Fonts - - - - - Would you like to remove all fonts? - - - - - AppearanceOptionsWidget - - - Form - - - - - User Interface Mode - - - - - AssistantClient - - - Unable to send request: Assistant is not responding. - - - - - The binary '%1' does not exist. - - - - - Unable to launch assistant (%1). - - - - - BrushManagerProxy - - - The element '%1' is missing the required attribute '%2'. - - - - - Empty brush name encountered. - - - - - An unexpected element '%1' was encountered. - - - - - An error occurred when reading the brush definition file '%1' at line line %2, column %3: %4 - - - - - An error occurred when reading the resource file '%1' at line %2, column %3: %4 - - - - - BrushPropertyManager - - - No brush - - - - - Solid - - - - - Dense 1 - - - - - Dense 2 - - - - - Dense 3 - - - - - Dense 4 - - - - - Dense 5 - - - - - Dense 6 - - - - - Dense 7 - - - - - Horizontal - - - - - Vertical - - - - - Cross - - - - - Backward diagonal - - - - - Forward diagonal - - - - - Crossing diagonal - - - - - Style - - - - - Color - - - - - [%1, %2] - - - - - Command - - - - Change signal - - - - - - Change slot - - - - - Change signal-slot connection - - - - - Change sender - - - - - Change receiver - - - - - Add connection - - - - - Adjust connection - - - - - Delete connections - - - - - Change source - - - - - Change target - - - - - Insert '%1' - - - - - Raise '%1' - - - - - Lower '%1' - - - - - Delete '%1' - - - - - Reparent '%1' - - - - - Promote to custom widget - - - - - Demote from custom widget - - - - - Lay out using grid - - - - - Lay out vertically - - - - - Lay out horizontally - - - - - Break layout - - - - - - - Move Page - - - - - - - - Delete Page - - - - - - Page - - - - - - - page - - - - - - - - Insert Page - - - - - tab - - - - - Change Tab order - - - - - Create Menu Bar - - - - - Delete Menu Bar - - - - - Create Status Bar - - - - - Delete Status Bar - - - - - Add Tool Bar - - - - - Add Dock Window - - - - - Adjust Size of '%1' - - - - - Change Form Layout Item Geometry - - - - - Change Layout Item Geometry - - - - - Change Table Contents - - - - - Change Tree Contents - - - - - - Add action - - - - - - Remove action - - - - - Add menu - - - - - Remove menu - - - - - Create submenu - - - - - Delete Tool Bar - - - - - Set action text - - - - - Insert action - - - - - - Move action - - - - - Change Title - - - - - Insert Menu - - - - - Change signals/slots - - - - - Delete Subwindow - - - - - Insert Subwindow - - - - - subwindow - - - - - Subwindow - - - - - Change Z-order of '%1' - - - - - Simplify Grid Layout - - - - - Create button group - - - - - Break button group - - - - - Break button group '%1' - - - - - Add buttons to group - - - - - - Add '%1' to '%2' - Command description for adding buttons to a QButtonGroup - - - - - Remove buttons from group - - - - - Remove '%1' from '%2' - Command description for removing buttons from a QButtonGroup - - - - - Morph %1/'%2' into %3 - MorphWidgetCommand description - - - - - Change layout of '%1' from %2 to %3 - - - - - Change script - - - - - Changed '%1' of '%2' - - - - - Changed '%1' of %n objects - - - - - - - Reset '%1' of '%2' - - - - - Reset '%1' of %n objects - - - - - - - Add dynamic property '%1' to '%2' - - - - - Add dynamic property '%1' to %n objects - - - - - - - Remove dynamic property '%1' from '%2' - - - - - Remove dynamic property '%1' from %n objects - - - - - - - ConnectDialog - - - Configure Connection - - - - - GroupBox - - - - - Edit... - - - - - Show signals and slots inherited from QWidget - - - - - DPI_Chooser - - - Standard (96 x 96) - Embedded device standard screen resolution - - - - - Greenphone (179 x 185) - Embedded device screen resolution - - - - - High (192 x 192) - Embedded device high definition screen resolution - - - - - Designer - - - Qt Designer - - - - - This file contains top level spacers.<br>They have <b>NOT</b> been saved into the form. - - - - - Perhaps you forgot to create a layout? - - - - - This file cannot be read because it was created using %1. - - - - - This file was created using Designer from Qt-%1 and cannot be read. - - - - - This file cannot be read because the extra info extension failed to load. - - - - - The converted file could not be read. - - - - - Invalid ui file: The root element <ui> is missing. - - - - - An error has occurred while reading the ui file at line %1, column %2: %3 - - - - - This file was created using Designer from Qt-%1 and will be converted to a new form by Qt Designer. - - - - - The old form has not been touched, but you will have to save the form under a new name. - - - - - This file was created using Designer from Qt-%1 and could not be read: -%2 - - - - - Please run it through <b>uic3&nbsp;-convert</b> to convert it to Qt-4's ui format. - - - - - Custom Widgets - - - - - Promoted Widgets - - - - - Unable to launch %1. - - - - - %1 timed out. - - - - - DesignerMetaEnum - - - %1 is not a valid enumeration value of '%2'. - - - - - '%1' could not be converted to an enumeration value of type '%2'. - - - - - DesignerMetaFlags - - - '%1' could not be converted to a flag value of type '%2'. - - - - - DeviceProfile - - - '%1' is not a number. - Reading a number for an embedded device profile - - - - - An invalid tag <%1> was encountered. - - - - - DeviceProfileDialog - - - &Family - - - - - &Point Size - - - - - Style - - - - - Device DPI - - - - - Name - - - - - DeviceSkin - - - The image file '%1' could not be loaded. - - - - - The skin directory '%1' does not contain a configuration file. - - - - - The skin configuration file '%1' could not be opened. - - - - - Syntax error: %1 - - - - - The skin cursor image file '%1' does not exist. - - - - - Syntax error in area definition: %1 - - - - - Mismatch in number of areas, expected %1, got %2. - - - - - The skin configuration file '%1' could not be read: %2 - - - - - The skin "up" image file '%1' does not exist. - - - - - The skin "down" image file '%1' does not exist. - - - - - The skin "closed" image file '%1' does not exist. - - - - - EmbeddedOptionsControl - - - <html><table><tr><td><b>Font</b></td><td>%1, %2</td></tr><tr><td><b>Style</b></td><td>%3</td></tr><tr><td><b>Resolution</b></td><td>%4 x %5</td></tr></table></html> - Format embedded device profile description - - - - - EmbeddedOptionsPage - - - Embedded Design - Tab in preferences dialog - - - - - Device Profiles - EmbeddedOptionsControl group box" - - - - - FontPanel - - - Font - - - - - &Writing system - - - - - &Family - - - - - &Style - - - - - &Point size - - - - - FontPropertyManager - - - PreferDefault - - - - - NoAntialias - - - - - PreferAntialias - - - - - Antialiasing - - - - - FormBuilder - - - Invalid stretch value for '%1': '%2' - Parsing layout stretch values - - - - - Invalid minimum size for '%1': '%2' - Parsing grid layout minimum size values - - - - - FormEditorOptionsPage - - - %1 % - - - - - Preview Zoom - - - - - Default Zoom - - - - - Forms - Tab in preferences dialog - - - - - Default Grid - - - - - FormLayoutRowDialog - - - Add Form Layout Row - - - - - &Label text: - - - - - Field &type: - - - - - &Field name: - - - - - &Buddy: - - - - - &Row: - - - - - Label &name: - - - - - FormWindow - - - Unexpected element <%1> - - - - - Error while pasting clipboard contents at line %1, column %2: %3 - - - - - FormWindowSettings - - - Form Settings - - - - - Layout &Default - - - - - &Spacing: - - - - - &Margin: - - - - - &Layout Function - - - - - Ma&rgin: - - - - - Spa&cing: - - - - - Embedded Design - - - - - &Author - - - - - &Include Hints - - - - - &Pixmap Function - - - - - Grid - - - - - IconSelector - - - All Pixmaps ( - - - - - ItemPropertyBrowser - - - XX Icon Selected off - Sample string to determinate the width for the first column of the list item property browser - - - - - LanguageResourceDialog - - - Choose Resource - - - - - MainWindowBase - - - Main - Not currently used (main tool bar) - - - - - File - - - - - Edit - - - - - Tools - - - - - Form - - - - - Qt Designer - - - - - NewForm - - - C&reate - - - - - Recent - - - - - &Close - - - - - &Open... - - - - - &Recent Forms - - - - - Read error - - - - - New Form - - - - - Show this Dialog on Startup - - - - - A temporary form file could not be created in %1. - - - - - The temporary form file %1 could not be written. - - - - - NewFormWidget - - - Unable to open the form template file '%1': %2 - - - - - ObjectInspectorModel - - - Object - - - - - Class - - - - - separator - - - - - <noname> - - - - - ObjectNameDialog - - - Change Object Name - - - - - Object Name - - - - - PluginDialog - - - Plugin Information - - - - - 1 - - - - - PreferencesDialog - - - Preferences - - - - - PreviewConfigurationWidget - - - Default - - - - - None - - - - - Browse... - - - - - Form - - - - - Print/Preview Configuration - - - - - Style - - - - - Style sheet - - - - - ... - - - - - Device skin - - - - - PromotionModel - - - Not used - Usage of promoted widgets - - - - - Q3WizardContainer - - - - Page - - - - - QAbstractFormBuilder - - - Unexpected element <%1> - - - - - An error has occurred while reading the ui file at line %1, column %2: %3 - - - - - Invalid ui file: The root element <ui> is missing. - - - - - The creation of a widget of the class '%1' failed. - - - - - Attempt to add child that is not of class QWizardPage to QWizard. - - - - - Attempt to add a layout to a widget '%1' (%2) which already has a layout of non-box type %3. -This indicates an inconsistency in the ui-file. - - - - - Empty widget item in %1 '%2'. - - - - - Flags property are not supported yet. - - - - - While applying tab stops: The widget '%1' could not be found. - - - - - Invalid QButtonGroup reference '%1' referenced by '%2'. - - - - - This version of the uitools library is linked without script support. - - - - - QAxWidgetPlugin - - - ActiveX control - - - - - ActiveX control widget - - - - - QAxWidgetTaskMenu - - - Set Control - - - - - Reset Control - - - - - Licensed Control - - - - - The control requires a design-time license - - - - - QCoreApplication - - - %1 is not a promoted class. - - - - - The base class %1 is invalid. - - - - - The class %1 already exists. - - - - - Promoted Widgets - - - - - The class %1 cannot be removed - - - - - The class %1 cannot be removed because it is still referenced. - - - - - The class %1 cannot be renamed - - - - - The class %1 cannot be renamed to an empty name. - - - - - There is already a class named %1. - - - - - Cannot set an empty include file. - - - - - Exception at line %1: %2 - - - - - Unknown error - - - - - An error occurred while running the script for %1: %2 -Script: %3 - - - - - QDesigner - - - %1 - warning - - - - - Qt Designer - - - - - This application cannot be used for the Console edition of Qt - - - - - QDesignerActions - - - Edit Widgets - - - - - &Quit - - - - - &Minimize - - - - - Bring All to Front - - - - - Preferences... - - - - - Clear &Menu - - - - - CTRL+SHIFT+S - - - - - CTRL+Q - - - - - CTRL+R - - - - - CTRL+M - - - - - Qt Designer &Help - - - - - Current Widget Help - - - - - What's New in Qt Designer? - - - - - About Plugins - - - - - - About Qt Designer - - - - - About Qt - - - - - - Open Form - - - - - - - Designer UI files (*.%1);;All Files (*) - - - - - %1 already exists. -Do you want to replace it? - - - - - Saved %1. - - - - - Additional Fonts... - - - - - &Recent Forms - - - - - Designer - - - - - Feature not implemented yet! - - - - - Read error - - - - - %1 -Do you want to update the file location or generate a new form? - - - - - &Update - - - - - &New Form - - - - - - Save Form? - - - - - Could not open file - - - - - Select New File - - - - - Could not write file - - - - - &Close Preview - - - - - Save &Image... - - - - - &Print... - - - - - The file %1 could not be opened. -Reason: %2 -Would you like to retry or select a different file? - - - - - It was not possible to write the entire file %1 to disk. -Reason:%2 -Would you like to retry? - - - - - - The backup file %1 could not be written. - - - - - The backup directory %1 could not be created. - - - - - The temporary backup directory %1 could not be created. - - - - - Image files (*.%1) - - - - - - Save Image - - - - - The file %1 could not be written. - - - - - &New... - - - - - &Open... - - - - - &Save - - - - - Save &As... - - - - - Save A&ll - - - - - Save As &Template... - - - - - - &Close - - - - - View &Code... - - - - - - Save Form As - - - - - Preview failed - - - - - Code generation failed - - - - - - Assistant - - - - - Saved image %1. - - - - - Please close all forms to enable the loading of additional fonts. - - - - - Printed %1. - - - - - ALT+CTRL+S - - - - - QDesignerAppearanceOptionsPage - - - Appearance - Tab in preferences dialog - - - - - QDesignerAppearanceOptionsWidget - - - Docked Window - - - - - Multiple Top-Level Windows - - - - - Toolwindow Font - - - - - QDesignerAxWidget - - - Reset control - - - - - Set control - - - - - Control loaded - - - - - A COM exception occurred when executing a meta call of type %1, index %2 of "%3". - - - - - QDesignerFormBuilder - - - Script errors occurred: - - - - - The preview failed to build. - - - - - Designer - - - - - QDesignerFormWindow - - - %1 - %2[*] - - - - - Save Form? - - - - - Do you want to save the changes to this document before closing? - - - - - If you don't save, your changes will be lost. - - - - - QDesignerMenu - - - Type Here - - - - - Add Separator - - - - - Insert separator - - - - - Remove separator - - - - - Remove action '%1' - - - - - - Add separator - - - - - Insert action - - - - - QDesignerMenuBar - - - Type Here - - - - - Remove Menu '%1' - - - - - Remove Menu Bar - - - - - Menu - - - - - QDesignerPluginManager - - - An XML error was encountered when parsing the XML of the custom widget %1: %2 - - - - - The XML of the custom widget %1 does not contain any of the elements <widget> or <ui>. - - - - - The class attribute for the class %1 is missing. - - - - - The class attribute for the class %1 does not match the class name %2. - - - - - QDesignerPropertySheet - - - Dynamic Properties - - - - - QDesignerResource - - - The layout type '%1' is not supported, defaulting to grid. - - - - - The container extension of the widget '%1' (%2) returned a widget not managed by Designer '%3' (%4) when queried for page #%5. -Container pages should only be added by specifying them in XML returned by the domXml() method of the custom widget. - - - - - Unexpected element <%1> - Parsing clipboard contents - - - - - Error while pasting clipboard contents at line %1, column %2: %3 - Parsing clipboard contents - - - - - Error while pasting clipboard contents: The root element <ui> is missing. - Parsing clipboard contents - - - - - QDesignerSharedSettings - - - The template path %1 could not be created. - - - - - An error has been encountered while parsing device profile XML: %1 - - - - - QDesignerToolWindow - - - Property Editor - - - - - Action Editor - - - - - Object Inspector - - - - - Resource Browser - - - - - Signal/Slot Editor - - - - - Widget Box - - - - - QDesignerWidgetBox - - - An error has been encountered at line %1 of %2: %3 - - - - - Unexpected element <%1> encountered when parsing for <widget> or <ui> - - - - - Unexpected end of file encountered when parsing widgets. - - - - - A widget element could not be found. - - - - - QDesignerWorkbench - - - &File - - - - - F&orm - - - - - Preview in - - - - - &Window - - - - - &Help - - - - - Edit - - - - - Toolbars - - - - - Save Forms? - - - - - &View - - - - - &Settings - - - - - If you do not review your documents, all your changes will be lost. - - - - - Discard Changes - - - - - Review Changes - - - - - Backup Information - - - - - The last session of Designer was not terminated correctly. Backup files were left behind. Do you want to load them? - - - - - The file <b>%1</b> could not be opened. - - - - - The file <b>%1</b> is not a valid Designer ui file. - - - - - There are %n forms with unsaved changes. Do you want to review these changes before quitting? - - - - - - - QFormBuilder - - - An empty class name was passed on to %1 (object name: '%2'). - Empty class name passed to widget factory method - - - - - QFormBuilder was unable to create a custom widget of the class '%1'; defaulting to base class '%2'. - - - - - QFormBuilder was unable to create a widget of the class '%1'. - - - - - The layout type `%1' is not supported. - - - - - The set-type property %1 could not be read. - - - - - The enumeration-type property %1 could not be read. - - - - - Reading properties of the type %1 is not supported yet. - - - - - The property %1 could not be written. The type %2 is not supported yet. - - - - - The enumeration-value '%1' is invalid. The default value '%2' will be used instead. - - - - - The flag-value '%1' is invalid. Zero will be used instead. - - - - - QStackedWidgetEventFilter - - - Previous Page - - - - - Next Page - - - - - Delete - - - - - Before Current Page - - - - - After Current Page - - - - - Change Page Order... - - - - - Change Page Order - - - - - Page %1 of %2 - - - - - Insert Page - - - - - QStackedWidgetPreviewEventFilter - - - Go to previous page of %1 '%2' (%3/%4). - - - - - Go to next page of %1 '%2' (%3/%4). - - - - - QTabWidgetEventFilter - - - Delete - - - - - Before Current Page - - - - - After Current Page - - - - - Page %1 of %2 - - - - - Insert Page - - - - - QToolBoxHelper - - - Delete Page - - - - - Before Current Page - - - - - After Current Page - - - - - Change Page Order... - - - - - Change Page Order - - - - - Page %1 of %2 - - - - - Insert Page - - - - - QtBoolEdit - - - - - True - - - - - - False - - - - - QtBoolPropertyManager - - - True - - - - - False - - - - - QtCharEdit - - - Clear Char - - - - - QtColorEditWidget - - - ... - - - - - QtColorPropertyManager - - - Red - - - - - Green - - - - - Blue - - - - - Alpha - - - - - QtCursorDatabase - - - Arrow - - - - - Up Arrow - - - - - Cross - - - - - Wait - - - - - IBeam - - - - - Size Vertical - - - - - Size Horizontal - - - - - Size Backslash - - - - - Size Slash - - - - - Size All - - - - - Blank - - - - - Split Vertical - - - - - Split Horizontal - - - - - Pointing Hand - - - - - Forbidden - - - - - Open Hand - - - - - Closed Hand - - - - - What's This - - - - - Busy - - - - - QtFontEditWidget - - - ... - - - - - Select Font - - - - - QtFontPropertyManager - - - Family - - - - - Point Size - - - - - Bold - - - - - Italic - - - - - Underline - - - - - Strikeout - - - - - Kerning - - - - - QtGradientDialog - - - Edit Gradient - - - - - QtGradientEditor - - - Start X - - - - - Start Y - - - - - Final X - - - - - Final Y - - - - - - Central X - - - - - - Central Y - - - - - Focal X - - - - - Focal Y - - - - - Radius - - - - - Angle - - - - - Form - - - - - Gradient Editor - - - - - 1 - - - - - 2 - - - - - 3 - - - - - 4 - - - - - 5 - - - - - Gradient Stops Editor - - - - - This area allows you to edit gradient stops. Double click on the existing stop handle to duplicate it. Double click outside of the existing stop handles to create a new stop. Drag & drop the handle to reposition it. Use right mouse button to popup context menu with extra actions. - - - - - Zoom - - - - - Position - - - - - Hue - - - - - H - - - - - Saturation - - - - - S - - - - - Sat - - - - - Value - - - - - V - - - - - Val - - - - - Alpha - - - - - A - - - - - Type - - - - - Spread - - - - - Color - - - - - Current stop's color - - - - - HSV - - - - - RGB - - - - - Current stop's position - - - - - % - - - - - Zoom In - - - - - Zoom Out - - - - - Toggle details extension - - - - - > - - - - - Linear Type - - - - - ... - - - - - Radial Type - - - - - Conical Type - - - - - Pad Spread - - - - - Repeat Spread - - - - - Reflect Spread - - - - - This area shows a preview of the gradient being edited. It also allows you to edit parameters specific to the gradient's type such as start and final point, radius, etc. by drag & drop. - - - - - Show HSV specification - - - - - Show RGB specification - - - - - Reset Zoom - - - - - QtGradientStopsWidget - - - New Stop - - - - - Delete - - - - - Flip All - - - - - Select All - - - - - Zoom In - - - - - Zoom Out - - - - - Reset Zoom - - - - - QtGradientView - - - Grad - - - - - Remove Gradient - - - - - Are you sure you want to remove the selected gradient? - - - - - - New... - - - - - - Edit... - - - - - - Rename - - - - - - Remove - - - - - Gradient View - - - - - QtGradientViewDialog - - - - Select Gradient - - - - - QtKeySequenceEdit - - - Clear Shortcut - - - - - QtLocalePropertyManager - - - %1, %2 - - - - - Language - - - - - Country - - - - - QtPointFPropertyManager - - - (%1, %2) - - - - - X - - - - - Y - - - - - QtPointPropertyManager - - - (%1, %2) - - - - - X - - - - - Y - - - - - QtPropertyBrowserUtils - - - [%1, %2, %3] (%4) - - - - - [%1, %2] - - - - - QtRectFPropertyManager - - - [(%1, %2), %3 x %4] - - - - - X - - - - - Y - - - - - Width - - - - - Height - - - - - QtRectPropertyManager - - - [(%1, %2), %3 x %4] - - - - - X - - - - - Y - - - - - Width - - - - - Height - - - - - QtResourceEditorDialog - - - %1 already exists. -Do you want to replace it? - - - - - The file does not appear to be a resource file; element '%1' was found where '%2' was expected. - - - - - %1 [read-only] - - - - - - %1 [missing] - - - - - <no prefix> - - - - - - New Resource File - - - - - - Resource files (*.qrc) - - - - - Import Resource File - - - - - newPrefix - - - - - Add Files - - - - - Incorrect Path - - - - - - - - Copy - - - - - Copy As... - - - - - Keep - - - - - Skip - - - - - Clone Prefix - - - - - Enter the suffix which you want to add to the names of the cloned files. -This could for example be a language extension like "_de". - - - - - - Copy As - - - - - <p>The selected file:</p><p>%1</p><p>is outside of the current resource file's directory:</p><p>%2</p><p>Please select another path within this directory.<p> - - - - - Could not overwrite %1. - - - - - <p><b>Warning:</b> The file</p><p>%1</p><p>is outside of the current resource file's parent directory.</p> - - - - - <p>To resolve the issue, press:</p><table><tr><th align="left">Copy</th><td>to copy the file to the resource file's parent directory.</td></tr><tr><th align="left">Copy As...</th><td>to copy the file into a subdirectory of the resource file's parent directory.</td></tr><tr><th align="left">Keep</th><td>to use its current location.</td></tr></table> - - - - - Could not copy -%1 -to -%2 - - - - - A parse error occurred at line %1, column %2 of %3: -%4 - - - - - Save Resource File - - - - - Edit Resources - - - - - New... - - - - - Open... - - - - - - Remove - - - - - - Move Up - - - - - - Move Down - - - - - - Add Prefix - - - - - Add Files... - - - - - Change Prefix - - - - - Change Language - - - - - Change Alias - - - - - Clone Prefix... - - - - - Prefix / Path - - - - - Language / Alias - - - - - <html><p><b>Warning:</b> There have been problems while reloading the resources:</p><pre>%1</pre></html> - - - - - Resource Warning - - - - - Dialog - - - - - New File - - - - - N - - - - - Remove File - - - - - R - - - - - I - - - - - New Resource - - - - - A - - - - - Remove Resource or File - - - - - Could not write %1: %2 - - - - - Open Resource File - - - - - QtResourceView - - - Size: %1 x %2 -%3 - - - - - Edit Resources... - - - - - Reload - - - - - Copy Path - - - - - QtResourceViewDialog - - - Select Resource - - - - - QtSizeFPropertyManager - - - %1 x %2 - - - - - Width - - - - - Height - - - - - QtSizePolicyPropertyManager - - - - <Invalid> - - - - - [%1, %2, %3, %4] - - - - - Horizontal Policy - - - - - Vertical Policy - - - - - Horizontal Stretch - - - - - Vertical Stretch - - - - - QtSizePropertyManager - - - %1 x %2 - - - - - Width - - - - - Height - - - - - QtToolBarDialog - - - < S E P A R A T O R > - - - - - Customize Toolbars - - - - - 1 - - - - - Actions - - - - - Toolbars - - - - - New - - - - - Remove - - - - - Rename - - - - - Up - - - - - <- - - - - - -> - - - - - Down - - - - - Current Toolbar Actions - - - - - Custom Toolbar - - - - - Add new toolbar - - - - - Remove selected toolbar - - - - - Rename toolbar - - - - - Move action up - - - - - Remove action from toolbar - - - - - Add action to toolbar - - - - - Move action down - - - - - QtTreePropertyBrowser - - - Property - - - - - Value - - - - - SaveFormAsTemplate - - - Add path... - - - - - Template Exists - - - - - A template with the name %1 already exists. -Do you want overwrite the template? - - - - - Overwrite Template - - - - - Open Error - - - - - There was an error opening template %1 for writing. Reason: %2 - - - - - Write Error - - - - - There was an error writing the template %1 to disk. Reason: %2 - - - - - Pick a directory to save templates in - - - - - Save Form As Template - - - - - &Category: - - - - - &Name: - - - - - ScriptErrorDialog - - - An error occurred while running the scripts for "%1": - - - - - - SelectSignalDialog - - - Go to slot - - - - - Select signal - - - - - signal - - - - - class - - - - - SignalSlotConnection - - - SENDER(%1), SIGNAL(%2), RECEIVER(%3), SLOT(%4) - - - - - SignalSlotDialogClass - - - Signals and slots - - - - - Slots - - - - - ... - - - - - Signals - - - - - Add - - - - - Delete - - - - - Spacer - - - Horizontal Spacer '%1', %2 x %3 - - - - - Vertical Spacer '%1', %2 x %3 - - - - - TemplateOptionsPage - - - Template Paths - Tab in preferences dialog - - - - - ToolBarManager - - - Configure Toolbars... - - - - - Window - - - - - Help - - - - - Style - - - - - Dock views - - - - - Toolbars - - - - - VersionDialog - - - <h3>%1</h3><br/><br/>Version %2 - - - - - Qt Designer - - - - - <br/>Qt Designer is a graphical user interface designer for Qt applications.<br/> - - - - - %1<br/>%2<br/>Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).<br/><br/>The program is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.<br/> - - - - - WidgetDataBase - - - The file contains a custom widget '%1' whose base class (%2) differs from the current entry in the widget database (%3). The widget database is left unchanged. - - - - - qdesigner_internal::ActionEditor - - - Actions - - - - - New... - - - - - Delete - - - - - New action - - - - - Edit action - - - - - Edit... - - - - - Go to slot... - - - - - Copy - - - - - Cut - - - - - Paste - - - - - Select all - - - - - Icon View - - - - - Detailed View - - - - - Remove actions - - - - - Remove action '%1' - - - - - Used In - - - - - Configure Action Editor - - - - - qdesigner_internal::ActionModel - - - Name - - - - - Used - - - - - Text - - - - - Shortcut - - - - - Checkable - - - - - ToolTip - - - - - qdesigner_internal::BuddyEditor - - - Add buddy - - - - - Remove buddies - - - - - Remove %n buddies - - - - - - - Add %n buddies - - - - - - - Set automatically - - - - - qdesigner_internal::BuddyEditorPlugin - - - Edit Buddies - - - - - qdesigner_internal::BuddyEditorTool - - - Edit Buddies - - - - - qdesigner_internal::ButtonGroupMenu - - - Select members - - - - - Break - - - - - qdesigner_internal::ButtonTaskMenu - - - Assign to button group - - - - - Button group - - - - - New button group - - - - - Change text... - - - - - None - - - - - Button group '%1' - - - - - qdesigner_internal::CodeDialog - - - Save... - - - - - Copy All - - - - - &Find in Text... - - - - - A temporary form file could not be created in %1. - - - - - The temporary form file %1 could not be written. - - - - - %1 - [Code] - - - - - Save Code - - - - - Header Files (*.%1) - - - - - The file %1 could not be opened: %2 - - - - - The file %1 could not be written: %2 - - - - - %1 - Error - - - - - qdesigner_internal::ColorAction - - - Text Color - - - - - qdesigner_internal::ComboBoxTaskMenu - - - Edit Items... - - - - - Change Combobox Contents - - - - - qdesigner_internal::CommandLinkButtonTaskMenu - - - Change description... - - - - - qdesigner_internal::ConnectionEdit - - - Select All - - - - - Deselect All - - - - - Delete - - - - - qdesigner_internal::ConnectionModel - - - Sender - - - - - Signal - - - - - Receiver - - - - - Slot - - - - - <sender> - - - - - <signal> - - - - - <receiver> - - - - - <slot> - - - - - Signal and Slot Editor - - - - - The connection already exists!<br>%1 - - - - - qdesigner_internal::ContainerWidgetTaskMenu - - - Insert Page Before Current Page - - - - - Insert Page After Current Page - - - - - Add Subwindow - - - - - Delete - - - - - Insert - - - - - Subwindow - - - - - Page - - - - - Page %1 of %2 - - - - - qdesigner_internal::DPI_Chooser - - - System (%1 x %2) - System resolution - - - - - User defined - - - - - x - DPI X/Y separator - - - - - qdesigner_internal::DesignerPropertyManager - - - - AlignLeft - - - - - AlignHCenter - - - - - AlignRight - - - - - AlignJustify - - - - - AlignTop - - - - - - AlignVCenter - - - - - AlignBottom - - - - - %1, %2 - - - - - Customized (%n roles) - - - - - - - Inherited - - - - - Horizontal - - - - - Vertical - - - - - Normal Off - - - - - Normal On - - - - - Disabled Off - - - - - Disabled On - - - - - Active Off - - - - - Active On - - - - - Selected Off - - - - - Selected On - - - - - - translatable - - - - - - disambiguation - - - - - - comment - - - - - qdesigner_internal::DeviceProfileDialog - - - Device Profiles (*.%1) - - - - - Default - - - - - Save Profile - - - - - Save Profile - Error - - - - - Unable to open the file '%1' for writing: %2 - - - - - Open profile - - - - - - Open Profile - Error - - - - - Unable to open the file '%1' for reading: %2 - - - - - '%1' is not a valid profile: %2 - - - - - qdesigner_internal::Dialog - - - Dialog - - - - - StringList - - - - - New String - - - - - &New - - - - - Delete String - - - - - &Delete - - - - - &Value: - - - - - Move String Up - - - - - Up - - - - - Move String Down - - - - - Down - - - - - qdesigner_internal::EmbeddedOptionsControl - - - None - - - - - Add a profile - - - - - Edit the selected profile - - - - - Delete the selected profile - - - - - Add Profile - - - - - New profile - - - - - Edit Profile - - - - - Delete Profile - - - - - Would you like to delete the profile '%1'? - - - - - Default - - - - - qdesigner_internal::FilterWidget - - - <Filter> - - - - - qdesigner_internal::FormEditor - - - Resource File Changed - - - - - The file "%1" has changed outside Designer. Do you want to reload it? - - - - - qdesigner_internal::FormLayoutMenu - - - Add form layout row... - - - - - qdesigner_internal::FormWindow - - - Edit contents - - - - - F2 - - - - - Resize - - - - - - Key Move - - - - - Cannot paste widgets. Designer could not find a container without a layout to paste into. - - - - - Break the layout of the container you want to paste into, select this container and then paste again. - - - - - Paste error - - - - - Lay out - - - - - - Drop widget - - - - - Paste %n action(s) - - - - - - - Insert widget '%1' - - - - - Paste %n widget(s) - - - - - - - Paste (%1 widgets, %2 actions) - - - - - Select Ancestor - - - - - A QMainWindow-based form does not contain a central widget. - - - - - Raise widgets - - - - - Lower widgets - - - - - qdesigner_internal::FormWindowBase - - - Delete - - - - - Delete '%1' - - - - - qdesigner_internal::FormWindowManager - - - Cu&t - - - - - Cuts the selected widgets and puts them on the clipboard - - - - - &Copy - - - - - Copies the selected widgets to the clipboard - - - - - &Paste - - - - - Pastes the clipboard's contents - - - - - &Delete - - - - - Deletes the selected widgets - - - - - Select &All - - - - - Selects all widgets - - - - - Bring to &Front - - - - - - Raises the selected widgets - - - - - Send to &Back - - - - - - Lowers the selected widgets - - - - - Adjust &Size - - - - - Adjusts the size of the selected widget - - - - - Lay Out &Horizontally - - - - - Lays out the selected widgets horizontally - - - - - Lay Out &Vertically - - - - - Lays out the selected widgets vertically - - - - - Lay Out in a &Grid - - - - - Lays out the selected widgets in a grid - - - - - Lay Out Horizontally in S&plitter - - - - - Lays out the selected widgets horizontally in a splitter - - - - - Lay Out Vertically in Sp&litter - - - - - Lays out the selected widgets vertically in a splitter - - - - - &Break Layout - - - - - Breaks the selected layout - - - - - &Preview... - - - - - Preview current form - - - - - Form &Settings... - - - - - Break Layout - - - - - Adjust Size - - - - - Could not create form preview - Title of warning message box - - - - - Form Settings - %1 - - - - - Removes empty columns and rows - - - - - Lay Out in a &Form Layout - - - - - Lays out the selected widgets in a form layout - - - - - Si&mplify Grid Layout - - - - - qdesigner_internal::FormWindowSettings - - - None - - - - - Device Profile: %1 - - - - - qdesigner_internal::GridPanel - - - Form - - - - - Grid - - - - - Visible - - - - - Grid &X - - - - - Snap - - - - - Reset - - - - - Grid &Y - - - - - qdesigner_internal::GroupBoxTaskMenu - - - Change title... - - - - - qdesigner_internal::HtmlTextEdit - - - Insert HTML entity - - - - - qdesigner_internal::IconSelector - - - The pixmap file '%1' cannot be read. - - - - - The file '%1' does not appear to be a valid pixmap file: %2 - - - - - The file '%1' could not be read: %2 - - - - - Pixmap Read Error - - - - - ... - - - - - Normal Off - - - - - Normal On - - - - - Disabled Off - - - - - Disabled On - - - - - Active Off - - - - - Active On - - - - - Selected Off - - - - - Selected On - - - - - Choose Resource... - - - - - Choose File... - - - - - Reset - - - - - Reset All - - - - - Choose a Pixmap - - - - - qdesigner_internal::ItemListEditor - - - Properties &<< - - - - - - Properties &>> - - - - - Items List - - - - - New Item - - - - - &New - - - - - Delete Item - - - - - &Delete - - - - - Move Item Up - - - - - U - - - - - Move Item Down - - - - - D - - - - - qdesigner_internal::LabelTaskMenu - - - Change rich text... - - - - - Change plain text... - - - - - qdesigner_internal::LineEditTaskMenu - - - Change text... - - - - - qdesigner_internal::ListWidgetEditor - - - Edit List Widget - - - - - Edit Combobox - - - - - New Item - - - - - qdesigner_internal::ListWidgetTaskMenu - - - Edit Items... - - - - - Change List Contents - - - - - qdesigner_internal::MdiContainerWidgetTaskMenu - - - Next Subwindow - - - - - Previous Subwindow - - - - - Tile - - - - - Cascade - - - - - qdesigner_internal::MenuTaskMenu - - - Remove - - - - - qdesigner_internal::MorphMenu - - - Morph into - - - - - qdesigner_internal::NewActionDialog - - - New Action... - - - - - &Text: - - - - - &Icon: - - - - - Shortcut: - - - - - Checkable: - - - - - ToolTip: - - - - - ... - - - - - Object &name: - - - - - qdesigner_internal::NewDynamicPropertyDialog - - - Set Property Name - - - - - The current object already has a property named '%1'. -Please select another, unique one. - - - - - Create Dynamic Property - - - - - Property Name - - - - - Property Type - - - - - The '_q_' prefix is reserved for the Qt library. -Please select another name. - - - - - horizontalSpacer - - - - - qdesigner_internal::NewFormWidget - - - Default size - - - - - QVGA portrait (240x320) - - - - - QVGA landscape (320x240) - - - - - VGA portrait (480x640) - - - - - VGA landscape (640x480) - - - - - Widgets - New Form Dialog Categories - - - - - Custom Widgets - - - - - None - - - - - Error loading form - - - - - Internal error: No template selected. - - - - - 0 - - - - - Choose a template for a preview - - - - - Embedded Design - - - - - Device: - - - - - Screen Size: - - - - - qdesigner_internal::NewPromotedClassPanel - - - Add - - - - - New Promoted Class - - - - - Base class name: - - - - - Promoted class name: - - - - - Header file: - - - - - Global include - - - - - Reset - - - - - qdesigner_internal::ObjectInspector - - - &Find in Text... - - - - - qdesigner_internal::ObjectInspector::ObjectInspectorPrivate - - - Change Current Page - - - - - qdesigner_internal::OrderDialog - - - Index %1 (%2) - - - - - Change Page Order - - - - - Page Order - - - - - Move page up - - - - - Move page down - - - - - %1 %2 - - - - - qdesigner_internal::PaletteEditor - - - Edit Palette - - - - - Tune Palette - - - - - Show Details - - - - - Compute Details - - - - - Quick - - - - - Preview - - - - - Disabled - - - - - Inactive - - - - - Active - - - - - qdesigner_internal::PaletteEditorButton - - - Change Palette - - - - - qdesigner_internal::PaletteModel - - - Color Role - - - - - Active - - - - - Inactive - - - - - Disabled - - - - - qdesigner_internal::PixmapEditor - - - Copy Path - - - - - Paste Path - - - - - Choose Resource... - - - - - Choose File... - - - - - - ... - - - - - qdesigner_internal::PlainTextEditorDialog - - - Edit text - - - - - qdesigner_internal::PluginDialog - - - Components - - - - - Plugin Information - - - - - Refresh - - - - - Scan for newly installed custom widget plugins. - - - - - Qt Designer couldn't find any plugins - - - - - Qt Designer found the following plugins - - - - - New custom widget plugins have been found. - - - - - qdesigner_internal::PreviewActionGroup - - - %1 Style - - - - - qdesigner_internal::PreviewConfigurationWidget::PreviewConfigurationWidgetPrivate - - - Load Custom Device Skin - - - - - All QVFB Skins (*.%1) - - - - - %1 - Duplicate Skin - - - - - The skin '%1' already exists. - - - - - %1 - Error - - - - - %1 is not a valid skin directory: -%2 - - - - - qdesigner_internal::PreviewDeviceSkin - - - &Close - - - - - qdesigner_internal::PreviewManager - - - %1 - [Preview] - - - - - qdesigner_internal::PreviewWidget - - - Preview Window - - - - - LineEdit - - - - - ComboBox - - - - - PushButton - - - - - ButtonGroup2 - - - - - CheckBox1 - - - - - CheckBox2 - - - - - ButtonGroup - - - - - RadioButton1 - - - - - RadioButton2 - - - - - RadioButton3 - - - - - qdesigner_internal::PromotionModel - - - Name - - - - - Header file - - - - - Global include - - - - - Usage - - - - - qdesigner_internal::PromotionTaskMenu - - - Promoted widgets... - - - - - Promote to ... - - - - - Promote to - - - - - Demote to %1 - - - - - Change signals/slots... - - - - - qdesigner_internal::PropertyEditor - - - Add Dynamic Property... - - - - - Remove Dynamic Property - - - - - Tree View - - - - - Drop Down Button View - - - - - Object: %1 -Class: %2 - - - - - Sorting - - - - - Color Groups - - - - - Configure Property Editor - - - - - String... - - - - - Bool... - - - - - Other... - - - - - qdesigner_internal::PropertyLineEdit - - - Insert line break - - - - - qdesigner_internal::QDesignerPromotionDialog - - - Promoted Widgets - - - - - Promoted Classes - - - - - Promote - - - - - %1 - Error - - - - - Change signals/slots... - - - - - qdesigner_internal::QDesignerResource - - - Loading qrc file - - - - - The specified qrc file <p><b>%1</b></p><p>could not be found. Do you want to update the file location?</p> - - - - - New location for %1 - - - - - Resource files (*.qrc) - - - - - qdesigner_internal::QDesignerTaskMenu - - - Set size constraint on %n widget(s) - - - - - - - Change objectName... - - - - - Change toolTip... - - - - - Change whatsThis... - - - - - Change styleSheet... - - - - - Create Menu Bar - - - - - Add Tool Bar - - - - - Create Status Bar - - - - - Remove Status Bar - - - - - Change script... - - - - - Change signals/slots... - - - - - Go to slot... - - - - - Size Constraints - - - - - Set Minimum Width - - - - - Set Minimum Height - - - - - Set Minimum Size - - - - - Set Maximum Width - - - - - Set Maximum Height - - - - - Set Maximum Size - - - - - Edit ToolTip - - - - - Edit WhatsThis - - - - - no signals available - - - - - qdesigner_internal::QDesignerWidgetBox - - - - Unexpected element <%1> - - - - - A parse error occurred at line %1, column %2 of the XML code specified for the widget %3: %4 -%5 - - - - - The XML code specified for the widget %1 does not contain any widget elements. -%2 - - - - - qdesigner_internal::QtGradientEditor - - - Linear - - - - - Radial - - - - - Conical - - - - - Pad - - - - - Repeat - - - - - Reflect - - - - - qdesigner_internal::QtGradientStopsController - - - H - - - - - S - - - - - V - - - - - - Hue - - - - - Sat - - - - - Val - - - - - Saturation - - - - - Value - - - - - R - - - - - G - - - - - B - - - - - Red - - - - - Green - - - - - Blue - - - - - qdesigner_internal::RichTextEditorDialog - - - Edit text - - - - - &OK - - - - - &Cancel - - - - - Rich Text - - - - - Source - - - - - qdesigner_internal::RichTextEditorToolBar - - - Bold - - - - - CTRL+B - - - - - Italic - - - - - CTRL+I - - - - - Underline - - - - - CTRL+U - - - - - Left Align - - - - - Center - - - - - Right Align - - - - - Justify - - - - - Superscript - - - - - Subscript - - - - - Insert &Link - - - - - Insert &Image - - - - - qdesigner_internal::ScriptDialog - - - Edit script - - - - - <html>Enter a Qt Script snippet to be executed while loading the form.<br>The widget and its children are accessible via the variables <i>widget</i> and <i>childWidgets</i>, respectively. - - - - - Syntax error - - - - - qdesigner_internal::ScriptErrorDialog - - - Script errors - - - - - qdesigner_internal::SignalSlotDialog - - - There is already a slot with the signature '%1'. - - - - - There is already a signal with the signature '%1'. - - - - - %1 - Duplicate Signature - - - - - - Signals/Slots of %1 - - - - - qdesigner_internal::SignalSlotEditorPlugin - - - Edit Signals/Slots - - - - - F4 - - - - - qdesigner_internal::SignalSlotEditorTool - - - Edit Signals/Slots - - - - - qdesigner_internal::StatusBarTaskMenu - - - Remove - - - - - qdesigner_internal::StringListEditorButton - - - Change String List - - - - - qdesigner_internal::StyleSheetEditorDialog - - - Edit Style Sheet - - - - - - Valid Style Sheet - - - - - Add Resource... - - - - - Add Gradient... - - - - - Add Color... - - - - - Add Font... - - - - - Invalid Style Sheet - - - - - qdesigner_internal::TabOrderEditor - - - Start from Here - - - - - Restart - - - - - Tab Order List... - - - - - Tab Order List - - - - - Tab Order - - - - - qdesigner_internal::TabOrderEditorPlugin - - - Edit Tab Order - - - - - qdesigner_internal::TabOrderEditorTool - - - Edit Tab Order - - - - - qdesigner_internal::TableWidgetEditor - - - New Column - - - - - New Row - - - - - &Columns - - - - - &Rows - - - - - Properties &<< - - - - - - Properties &>> - - - - - Edit Table Widget - - - - - &Items - - - - - Table Items - - - - - qdesigner_internal::TableWidgetTaskMenu - - - Edit Items... - - - - - qdesigner_internal::TemplateOptionsWidget - - - Pick a directory to save templates in - - - - - Form - - - - - Additional Template Paths - - - - - ... - - - - - qdesigner_internal::TextEditTaskMenu - - - Change HTML... - - - - - Edit HTML - - - - - Edit Text - - - - - Change Plain Text... - - - - - qdesigner_internal::TextEditor - - - Choose Resource... - - - - - Choose File... - - - - - Choose a File - - - - - ... - - - - - qdesigner_internal::ToolBarEventFilter - - - Insert Separator - - - - - Remove action '%1' - - - - - Remove Toolbar '%1' - - - - - Insert Separator before '%1' - - - - - Append Separator - - - - - qdesigner_internal::TreeWidgetEditor - - - &Columns - - - - - Per column properties - - - - - Common properties - - - - - - New Item - - - - - Properties &<< - - - - - - Properties &>> - - - - - New Column - - - - - Edit Tree Widget - - - - - &Items - - - - - Tree Items - - - - - - New Subitem - - - - - New &Subitem - - - - - Delete Item - - - - - Move Item Left (before Parent Item) - - - - - L - - - - - Move Item Right (as a First Subitem of the Next Sibling Item) - - - - - R - - - - - Move Item Up - - - - - U - - - - - Move Item Down - - - - - D - - - - - 1 - - - - - &New - - - - - &Delete - - - - - qdesigner_internal::TreeWidgetTaskMenu - - - Edit Items... - - - - - qdesigner_internal::WidgetBox - - - Warning: Widget creation failed in the widget box. This could be caused by invalid custom widget XML. - - - - - qdesigner_internal::WidgetBoxTreeWidget - - - Scratchpad - - - - - Custom Widgets - - - - - Expand all - - - - - Collapse all - - - - - List View - - - - - Icon View - - - - - Remove - - - - - Edit name - - - - - qdesigner_internal::WidgetDataBase - - - A custom widget plugin whose class name (%1) matches that of an existing class has been found. - - - - - qdesigner_internal::WidgetEditorTool - - - Edit Widgets - - - - - qdesigner_internal::WidgetFactory - - - The custom widget factory registered for widgets of class %1 returned 0. - - - - - A class name mismatch occurred when creating a widget using the custom widget factory registered for widgets of class %1. It returned a widget of class %2. - - - - - %1 Widget - - - - - The current page of the container '%1' (%2) could not be determined while creating a layout.This indicates an inconsistency in the ui-file, probably a layout being constructed on a container widget. - - - - - Attempt to add a layout to a widget '%1' (%2) which already has an unmanaged layout of type %3. -This indicates an inconsistency in the ui-file. - - - - - Cannot create style '%1'. - - - - - qdesigner_internal::WizardContainerWidgetTaskMenu - - - Next - - - - - Back - - - - - qdesigner_internal::ZoomMenu - - - %1 % - Zoom factor - - - - diff --git a/translations/linguist_untranslated.ts b/translations/linguist_untranslated.ts deleted file mode 100644 index ae3ff20..0000000 --- a/translations/linguist_untranslated.ts +++ /dev/null @@ -1,1964 +0,0 @@ - - - - - - - - (New Entry) - - - - - AboutDialog - - - Qt Linguist - - - - - BatchTranslationDialog - - - Batch Translation of '%1' - Qt Linguist - - - - - Searching, please wait... - - - - - &Cancel - - - - - Linguist batch translator - - - - - Batch translated %n entries - - - - - - - Qt Linguist - Batch Translation - - - - - Options - - - - - Set translated entries to finished - - - - - Retranslate entries with existing translation - - - - - Note that the modified entries will be reset to unfinished if 'Set translated entries to finished' above is unchecked. - - - - - Translate also finished entries - - - - - Phrase book preference - - - - - Move up - - - - - Move down - - - - - The batch translator will search through the selected phrase books in the order given above. - - - - - &Run - - - - - Cancel - - - - - DataModel - - - <qt>Duplicate messages found in '%1': - - - - - <p>[more duplicates omitted] - - - - - <p>* Context: %1<br>* Source: %2 - - - - - <br>* Comment: %3 - - - - - Linguist does not know the plural rules for '%1'. -Will assume a single universal form. - - - - - Cannot create '%2': %1 - - - - - Universal Form - - - - - ErrorsView - - - Accelerator possibly superfluous in translation. - - - - - Accelerator possibly missing in translation. - - - - - Translation does not end with the same punctuation as the source text. - - - - - A phrase book suggestion for '%1' was ignored. - - - - - Translation does not refer to the same place markers as in the source text. - - - - - Translation does not contain the necessary %n place marker. - - - - - Unknown error - - - - - FindDialog - - - This window allows you to search for some text in the translation source file. - - - - - Type in the text to search for. - - - - - Options - - - - - Source texts are searched when checked. - - - - - Translations are searched when checked. - - - - - Texts such as 'TeX' and 'tex' are considered as different when checked. - - - - - Comments and contexts are searched when checked. - - - - - Find - - - - - &Find what: - - - - - &Source texts - - - - - &Translations - - - - - &Match case - - - - - &Comments - - - - - Ignore &accelerators - - - - - Click here to find the next occurrence of the text you typed in. - - - - - Find Next - - - - - Click here to close this window. - - - - - Cancel - - - - - - Choose Edit|Find from the menu bar or press Ctrl+F to pop up the Find dialog - - - - - LRelease - - - Generated %n translation(s) (%1 finished and %2 unfinished) - - - - - - - - Ignored %n untranslated source text(s) - - - - - - - - MainWindow - - - MainWindow - - - - - &Phrases - - - - - &Close Phrase Book - - - - - &Edit Phrase Book - - - - - &Print Phrase Book - - - - - V&alidation - - - - - &View - - - - - Vie&ws - - - - - &Toolbars - - - - - &Help - - - - - &Translation - - - - - &File - - - - - Recently Opened &Files - - - - - &Edit - - - - - Open a Qt translation source file (TS file) for editing - - - - - Ctrl+O - - - - - E&xit - - - - - Close this window and exit. - - - - - Ctrl+Q - - - - - - &Save - - - - - Save changes made to this Qt translation source file - - - - - Open Read-O&nly... - - - - - &Save All - - - - - Ctrl+S - - - - - - - Save &As... - - - - - Save As... - - - - - Save changes made to this Qt translation source file into a new file. - - - - - &Release - - - - - Create a Qt message file suitable for released applications from the current message file. - - - - - Ctrl+P - - - - - &Undo - - - - - Ctrl+Z - - - - - &Redo - - - - - Redo an undone editing operation performed on the translation. - - - - - Ctrl+Y - - - - - Cu&t - - - - - Copy the selected translation text to the clipboard and deletes it. - - - - - Ctrl+X - - - - - &Copy - - - - - Copy the selected translation text to the clipboard. - - - - - Ctrl+C - - - - - &Paste - - - - - Paste the clipboard text into the translation. - - - - - Ctrl+V - - - - - Select &All - - - - - Select the whole translation text. - - - - - Ctrl+A - - - - - Search for some text in the translation source file. - - - - - Ctrl+F - - - - - Find &Next - - - - - Continue the search where it was left. - - - - - F3 - - - - - &Prev Unfinished - - - - - Ctrl+K - - - - - &Next Unfinished - - - - - P&rev - - - - - Ctrl+Shift+K - - - - - Ne&xt - - - - - &Done and Next - - - - - Copies the source text into the translation field. - - - - - Ctrl+B - - - - - &Accelerators - - - - - &Ending Punctuation - - - - - &Phrase matches - - - - - Toggle checking that phrase suggestions are used. - - - - - Place &Marker Matches - - - - - Create a new phrase book. - - - - - Ctrl+N - - - - - Open a phrase book to assist translation. - - - - - Ctrl+H - - - - - Sort the items back in the same order as in the message file. - - - - - &Display guesses - - - - - Set whether or not to display translation guesses. - - - - - &Statistics - - - - - &Manual - - - - - F1 - - - - - About Qt Linguist - - - - - About Qt - - - - - Display information about the Qt toolkit by Trolltech. - - - - - &What's This? - - - - - What's This? - - - - - Enter What's This? mode. - - - - - Shift+F1 - - - - - Replace the translation on all entries that matches the search source text. - - - - - Batch translate all entries using the information in the phrase books. - - - - - - - Release As... - - - - - Create a Qt message file suitable for released applications from the current message file. The filename will automatically be determined from the name of the .ts file. - - - - - - This is the application's main window. - - - - - Source text - - - - - - Index - - - - - - Context - - - - - Items - - - - - This panel lists the source contexts. - - - - - Strings - - - - - Phrases and guesses - - - - - Sources and Forms - - - - - Warnings - - - - - MOD - status bar: file(s) modified - - - - - Loading... - - - - - - Loading File - Qt Linguist - - - - - The file '%1' does not seem to be related to the currently open file(s) '%2'. - -Close the open file(s) first? - - - - - The file '%1' does not seem to be related to the file '%2' which is being loaded as well. - -Skip loading the first named file? - - - - - %n translation unit(s) loaded. - - - - - - - Related files (%1);; - - - - - Open Translation Files - - - - - - File saved. - - - - - - - Release - - - - - Qt message files for released applications (*.qm) -All files (*) - - - - - - File created. - - - - - - Printing... - - - - - Context: %1 - - - - - finished - - - - - unresolved - - - - - obsolete - - - - - - Printing... (page %1) - - - - - - Printing completed - - - - - - Printing aborted - - - - - Search wrapped. - - - - - - - - - - - - - - Qt Linguist - - - - - - Cannot find the string '%1'. - - - - - Search And Translate in '%1' - Qt Linguist - - - - - - - Translate - Qt Linguist - - - - - Translated %n entry(s) - - - - - - - No more occurrences of '%1'. Start over? - - - - - Create New Phrase Book - - - - - Qt phrase books (*.qph) -All files (*) - - - - - Phrase book created. - - - - - Open Phrase Book - - - - - Qt phrase books (*.qph);;All files (*) - - - - - %n phrase(s) loaded. - - - - - - - - - Add to phrase book - - - - - No appropriate phrasebook found. - - - - - Adding entry to phrasebook %1 - - - - - Select phrase book to add to - - - - - Unable to launch Qt Assistant (%1) - - - - - Version %1 - - - - - <center><img src=":/images/splash.png"/></img><p>%1</p></center><p>Qt Linguist is a tool for adding translations to Qt applications.</p><p>%2</p><p>Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).</p><p>The program is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.</p> - - - - - Do you want to save the modified files? - - - - - Do you want to save '%1'? - - - - - Qt Linguist[*] - - - - - %1[*] - Qt Linguist - - - - - - No untranslated translation units left. - - - - - &Window - - - - - Minimize - - - - - Ctrl+M - - - - - Display the manual for %1. - - - - - Display information about %1. - - - - - &Save '%1' - - - - - Save '%1' &As... - - - - - Release '%1' - - - - - Release '%1' As... - - - - - &Close '%1' - - - - - - &Close - - - - - Save All - - - - - - &Release All - - - - - Close All - - - - - Translation File &Settings for '%1'... - - - - - &Batch Translation of '%1'... - - - - - Search And &Translate in '%1'... - - - - - Search And &Translate... - - - - - - File - - - - - - Edit - - - - - - Translation - - - - - - Validation - - - - - - Help - - - - - Cannot read from phrase book '%1'. - - - - - Close this phrase book. - - - - - Enables you to add, modify, or delete entries in this phrase book. - - - - - Print the entries in this phrase book. - - - - - Cannot create phrase book '%1'. - - - - - Do you want to save phrase book '%1'? - - - - - All - - - - - Open/Refresh Form &Preview - - - - - Form Preview Tool - - - - - F5 - - - - - &Open... - - - - - Save - - - - - &Print... - - - - - Print a list of all the translation units in the current translation source file. - - - - - Undo the last editing operation performed on the current translation. - - - - - &Find... - - - - - Previous unfinished item. - - - - - Move to the previous unfinished item. - - - - - Next unfinished item. - - - - - Move to the next unfinished item. - - - - - Move to previous item. - - - - - Move to the previous item. - - - - - Next item. - - - - - Move to the next item. - - - - - Mark item as done and move to the next unfinished item. - - - - - Mark this item as done and move to the next unfinished item. - - - - - Copy from source text - - - - - Toggle the validity check of accelerators. - - - - - Toggle the validity check of accelerators, i.e. whether the number of ampersands in the source and translation text is the same. If the check fails, a message is shown in the warnings window. - - - - - Toggle the validity check of ending punctuation. - - - - - Toggle the validity check of ending punctuation. If the check fails, a message is shown in the warnings window. - - - - - Toggle checking that phrase suggestions are used. If the check fails, a message is shown in the warnings window. - - - - - Toggle the validity check of place markers. - - - - - Toggle the validity check of place markers, i.e. whether %1, %2, ... are used consistently in the source text and translation text. If the check fails, a message is shown in the warnings window. - - - - - &New Phrase Book... - - - - - &Open Phrase Book... - - - - - &Reset Sorting - - - - - Display translation statistics. - - - - - &Search And Translate... - - - - - Close - - - - - &Close All - - - - - Ctrl+W - - - - - - &Batch Translation... - - - - - - Translation File &Settings... - - - - - &Add to Phrase Book - - - - - Ctrl+T - - - - - Ctrl+J - - - - - Ctrl+Shift+J - - - - - MessageEditor - - - German - - - - - Japanese - - - - - French - - - - - Polish - - - - - Chinese - - - - - This whole panel allows you to view and edit the translation of some source text. - - - - - Source text - - - - - This area shows the source text. - - - - - Source text (Plural) - - - - - This area shows the plural form of the source text. - - - - - Developer comments - - - - - This area shows a comment that may guide you, and the context in which the text occurs. - - - - - Here you can enter comments for your own use. They have no effect on the translated applications. - - - - - %1 translation (%2) - - - - - This is where you can enter or modify the translation of the above source text. - - - - - %1 translation - - - - - %1 translator comments - - - - - '%1' -Line: %2 - - - - - MessageModel - - - Completion status for %1 - - - - - <file header> - - - - - <context comment> - - - - - <unnamed context> - - - - - MsgEdit - - - - This is the right panel of the main window. - - - - - PhraseBookBox - - - %1[*] - Qt Linguist - - - - - Qt Linguist - - - - - Cannot save phrase book '%1'. - - - - - Edit Phrase Book - - - - - &Translation: - - - - - This is the phrase in the target language corresponding to the source phrase. - - - - - S&ource phrase: - - - - - This is a definition for the source phrase. - - - - - This is the phrase in the source language. - - - - - &Definition: - - - - - Click here to add the phrase to the phrase book. - - - - - &Save - - - - - Click here to save the changes made. - - - - - This window allows you to add, modify, or delete entries in a phrase book. - - - - - &New Entry - - - - - Click here to remove the entry from the phrase book. - - - - - &Remove Entry - - - - - Settin&gs... - - - - - Close - - - - - Click here to close this window. - - - - - - Go to Phrase > Edit Phrase Book... The dialog that pops up is a PhraseBookBox. - - - - - PhraseModel - - - Source phrase - - - - - Translation - - - - - Definition - - - - - PhraseView - - - Insert - - - - - Edit - - - - - Guess (%1) - - - - - Guess - - - - - QObject - - - Compiled Qt translations - - - - - Translation files (%1);; - - - - - All files (*) - - - - - - - - - - - Qt Linguist - - - - - C++ source files - - - - - Java source files - - - - - GNU Gettext localization files - - - - - Qt Script source files - - - - - Qt translation sources (format 1.1) - - - - - Qt translation sources (format 2.0) - - - - - Qt translation sources (latest format) - - - - - Qt Designer form files - - - - - Qt Jambi form files - - - - - XLIFF localization files - - - - - Qt Linguist 'Phrase Book' - - - - - SourceCodeView - - - <i>Source code not available</i> - - - - - <i>File %1 not available</i> - - - - - <i>File %1 not readable</i> - - - - - Statistics - - - Statistics - - - - - Translation - - - - - Source - - - - - 0 - - - - - Words: - - - - - Characters: - - - - - Characters (with spaces): - - - - - Close - - - - - TrWindow - - - - This is the application's main window. - - - - - TranslateDialog - - - This window allows you to search for some text in the translation source file. - - - - - Type in the text to search for. - - - - - Find &source text: - - - - - &Translate to: - - - - - Search options - - - - - Texts such as 'TeX' and 'tex' are considered as different when checked. - - - - - Match &case - - - - - Mark new translation as &finished - - - - - Click here to find the next occurrence of the text you typed in. - - - - - Find Next - - - - - Translate - - - - - Translate All - - - - - Click here to close this window. - - - - - Cancel - - - - - TranslationSettingsDialog - - - Any Country - - - - - - Settings for '%1' - Qt Linguist - - - - - Source language - - - - - Language - - - - - Country/Region - - - - - Target language - - - - diff --git a/translations/qt_help_untranslated.ts b/translations/qt_help_untranslated.ts deleted file mode 100644 index 5702cfd..0000000 --- a/translations/qt_help_untranslated.ts +++ /dev/null @@ -1,355 +0,0 @@ - - - - - QCLuceneResultWidget - - - Search Results - - - - - Note: - - - - - The search results may not be complete since the documentation is still being indexed! - - - - - Your search did not match any documents. - - - - - (The reason for this might be that the documentation is still being indexed.) - - - - - QHelpCollectionHandler - - - The collection file is not set up yet! - - - - - Cannot load sqlite database driver! - - - - - - Cannot open collection file: %1 - - - - - Cannot create tables in file %1! - - - - - The specified collection file already exists! - - - - - Cannot create directory: %1 - - - - - Cannot copy collection file: %1 - - - - - Unknown filter! - - - - - Cannot register filter %1! - - - - - Cannot open documentation file %1! - - - - - Invalid documentation file! - - - - - The namespace %1 was not registered! - - - - - Namespace %1 already exists! - - - - - Cannot register namespace! - - - - - Cannot open database to optimize! - - - - - QHelpDBReader - - - Cannot open database '%1' '%2': %3 - - - - - QHelpEngineCore - - - The specified namespace does not exist! - - - - - QHelpEngineCorePrivate - - - Cannot open documentation file %1: %2! - - - - - QHelpGenerator - - - Invalid help data! - - - - - No output file name specified! - - - - - Building up file structure... - - - - - The file %1 cannot be overwritten! - - - - - Cannot open data base file %1! - - - - - Cannot register namespace %1! - - - - - Insert custom filters... - - - - - Insert help data for filter section (%1 of %2)... - - - - - Documentation successfully generated. - - - - - Some tables already exist! - - - - - Cannot create tables! - - - - - Cannot register virtual folder! - - - - - Insert files... - - - - - The file %1 does not exist! Skipping it. - - - - - Cannot open file %1! Skipping it. - - - - - The filter %1 is already registered! - - - - - Cannot register filter %1! - - - - - Insert indices... - - - - - Insert contents... - - - - - Cannot insert contents! - - - - - Cannot register contents! - - - - - QHelpSearchQueryWidget - - - Search for: - - - - - Search - - - - - Advanced search - - - - - words <B>similar</B> to: - - - - - <B>without</B> the words: - - - - - with <B>exact phrase</B>: - - - - - with <B>all</B> of the words: - - - - - with <B>at least one</B> of the words: - - - - - QHelpSearchResultWidget - - - 0 - 0 of 0 Hits - - - - - QHelpSearchResultWidgetPrivate - - - %1 - %2 of %3 Hits - - - - - QObject - - - Untitled - - - - - Unknown token. - - - - - Unknown token. Expected "QtHelpProject"! - - - - - Error in line %1: %2 - - - - - A virtual folder must not contain a '/' character! - - - - - A namespace must not contain a '/' character! - - - - - Missing namespace in QtHelpProject. - - - - - Missing virtual folder in QtHelpProject - - - - - Missing attribute in keyword at line %1. - - - - - The input file %1 could not be opened! - - - - diff --git a/translations/qt_untranslated.ts b/translations/qt_untranslated.ts deleted file mode 100644 index 710e440..0000000 --- a/translations/qt_untranslated.ts +++ /dev/null @@ -1,7693 +0,0 @@ - - - - - AudioOutput - - - <html>The audio playback device <b>%1</b> does not work.<br/>Falling back to <b>%2</b>.</html> - - - - - <html>Switching to the audio playback device <b>%1</b><br/>which just became available and has higher preference.</html> - - - - - Revert back to device '%1' - - - - - CloseButton - - - Close Tab - - - - - Phonon:: - - - Notifications - - - - - Music - - - - - Video - - - - - Communication - - - - - Games - - - - - Accessibility - - - - - Phonon::Gstreamer::Backend - - - Warning: You do not seem to have the package gstreamer0.10-plugins-good installed. - Some video features have been disabled. - - - - - Warning: You do not seem to have the base GStreamer plugins installed. - All audio and video support has been disabled - - - - - Phonon::Gstreamer::MediaObject - - - Cannot start playback. - -Check your Gstreamer installation and make sure you -have libgstreamer-plugins-base installed. - - - - - A required codec is missing. You need to install the following codec(s) to play this content: %0 - - - - - - - - - - - - Could not open media source. - - - - - Invalid source type. - - - - - Could not locate media source. - - - - - Could not open audio device. The device is already in use. - - - - - Could not decode media source. - - - - - Phonon::VolumeSlider - - - - Volume: %1% - - - - - - - Use this slider to adjust the volume. The leftmost position is 0%, the rightmost is %1% - - - - - Q3Accel - - - %1, %2 not defined - - - - - Ambiguous %1 not handled - - - - - Q3DataTable - - - True - - - - - False - - - - - Insert - - - - - Update - - - - - Delete - - - - - Q3FileDialog - - - Copy or Move a File - - - - - Read: %1 - - - - - - Write: %1 - - - - - - Cancel - - - - - - - - All Files (*) - - - - - Name - - - - - Size - - - - - Type - - - - - Date - - - - - Attributes - - - - - - &OK - - - - - Look &in: - - - - - - - File &name: - - - - - File &type: - - - - - Back - - - - - One directory up - - - - - Create New Folder - - - - - List View - - - - - Detail View - - - - - Preview File Info - - - - - Preview File Contents - - - - - Read-write - - - - - Read-only - - - - - Write-only - - - - - Inaccessible - - - - - Symlink to File - - - - - Symlink to Directory - - - - - Symlink to Special - - - - - File - - - - - Dir - - - - - Special - - - - - - - Open - - - - - - Save As - - - - - - - &Open - - - - - - &Save - - - - - &Rename - - - - - &Delete - - - - - R&eload - - - - - Sort by &Name - - - - - Sort by &Size - - - - - Sort by &Date - - - - - &Unsorted - - - - - Sort - - - - - Show &hidden files - - - - - the file - - - - - the directory - - - - - the symlink - - - - - Delete %1 - - - - - <qt>Are you sure you wish to delete %1 "%2"?</qt> - - - - - &Yes - - - - - &No - - - - - New Folder 1 - - - - - New Folder - - - - - New Folder %1 - - - - - Find Directory - - - - - - Directories - - - - - Directory: - - - - - - Error - - - - - %1 -File not found. -Check path and filename. - - - - - All Files (*.*) - - - - - Open - - - - - Select a Directory - - - - - Q3LocalFs - - - - Could not read directory -%1 - - - - - Could not create directory -%1 - - - - - Could not remove file or directory -%1 - - - - - Could not rename -%1 -to -%2 - - - - - Could not open -%1 - - - - - Could not write -%1 - - - - - Q3MainWindow - - - Line up - - - - - Customize... - - - - - Q3NetworkProtocol - - - Operation stopped by the user - - - - - Q3ProgressDialog - - - - Cancel - - - - - Q3TabDialog - - - - OK - - - - - Apply - - - - - Help - - - - - Defaults - - - - - Cancel - - - - - Q3TextEdit - - - &Undo - - - - - &Redo - - - - - Cu&t - - - - - &Copy - - - - - &Paste - - - - - Clear - - - - - - Select All - - - - - Q3TitleBar - - - System - - - - - Restore up - - - - - Minimize - - - - - Restore down - - - - - Maximize - - - - - Close - - - - - Contains commands to manipulate the window - - - - - Puts a minimized back to normal - - - - - Moves the window out of the way - - - - - Puts a maximized window back to normal - - - - - Makes the window full screen - - - - - Closes the window - - - - - Displays the name of the window and contains controls to manipulate it - - - - - Q3ToolBar - - - More... - - - - - Q3UrlOperator - - - - - The protocol `%1' is not supported - - - - - The protocol `%1' does not support listing directories - - - - - The protocol `%1' does not support creating new directories - - - - - The protocol `%1' does not support removing files or directories - - - - - The protocol `%1' does not support renaming files or directories - - - - - The protocol `%1' does not support getting files - - - - - The protocol `%1' does not support putting files - - - - - - The protocol `%1' does not support copying or moving files or directories - - - - - - (unknown) - - - - - Q3Wizard - - - &Cancel - - - - - < &Back - - - - - &Next > - - - - - &Finish - - - - - &Help - - - - - QAbstractSocket - - - - - - Host not found - - - - - - - Connection refused - - - - - Connection timed out - - - - - - - Operation on socket is not supported - - - - - Socket operation timed out - - - - - Socket is not connected - - - - - Network unreachable - - - - - QAbstractSpinBox - - - &Step up - - - - - Step &down - - - - - &Select All - - - - - QApplication - - - Activate - - - - - Executable '%1' requires Qt %2, found Qt %3. - - - - - Incompatible Qt Library Error - - - - - QT_LAYOUT_DIRECTION - Translate this string to the string 'LTR' in left-to-right languages or to 'RTL' in right-to-left languages (such as Hebrew and Arabic) to get proper widget layout. - - - - - Activates the program's main window - - - - - QAxSelect - - - Select ActiveX Control - - - - - OK - - - - - &Cancel - - - - - COM &Object: - - - - - QCheckBox - - - Uncheck - - - - - Check - - - - - Toggle - - - - - QColorDialog - - - Hu&e: - - - - - &Sat: - - - - - &Val: - - - - - &Red: - - - - - &Green: - - - - - Bl&ue: - - - - - A&lpha channel: - - - - - Select Color - - - - - &Basic colors - - - - - &Custom colors - - - - - &Add to Custom Colors - - - - - QComboBox - - - - Open - - - - - False - - - - - True - - - - - Close - - - - - QCoreApplication - - - %1: key is empty - QSystemSemaphore - - - - - %1: unable to make key - QSystemSemaphore - - - - - %1: ftok failed - QSystemSemaphore - - - - - QDB2Driver - - - Unable to connect - - - - - Unable to commit transaction - - - - - Unable to rollback transaction - - - - - Unable to set autocommit - - - - - QDB2Result - - - - Unable to execute statement - - - - - Unable to prepare statement - - - - - Unable to bind variable - - - - - Unable to fetch record %1 - - - - - Unable to fetch next - - - - - Unable to fetch first - - - - - QDateTimeEdit - - - AM - - - - - am - - - - - PM - - - - - pm - - - - - QDial - - - QDial - - - - - SpeedoMeter - - - - - SliderHandle - - - - - QDialog - - - What's This? - - - - - Done - - - - - QDialogButtonBox - - - - - OK - - - - - &OK - - - - - &Save - - - - - Save - - - - - Open - - - - - &Cancel - - - - - Cancel - - - - - &Close - - - - - Close - - - - - Apply - - - - - Reset - - - - - Help - - - - - Don't Save - - - - - Discard - - - - - &Yes - - - - - Yes to &All - - - - - &No - - - - - N&o to All - - - - - Save All - - - - - Abort - - - - - Retry - - - - - Ignore - - - - - Restore Defaults - - - - - Close without Saving - - - - - QDirModel - - - Name - - - - - Size - - - - - Kind - Match OS X Finder - - - - - Type - All other platforms - - - - - Date Modified - - - - - QDockWidget - - - Close - - - - - Dock - - - - - Float - - - - - QDoubleSpinBox - - - More - - - - - Less - - - - - QErrorMessage - - - Debug Message: - - - - - Warning: - - - - - Fatal Error: - - - - - &Show this message again - - - - - &OK - - - - - QFile - - - - Destination file exists - - - - - Cannot remove source file - - - - - Cannot open %1 for input - - - - - Cannot open for output - - - - - Failure to write block - - - - - Cannot create %1 for output - - - - - QFileDialog - - - - All Files (*) - - - - - Directories - - - - - - - - &Open - - - - - - &Save - - - - - Open - - - - - %1 already exists. -Do you want to replace it? - - - - - %1 -File not found. -Please verify the correct file name was given. - - - - - My Computer - - - - - &Rename - - - - - &Delete - - - - - Show &hidden files - - - - - - Back - - - - - - Parent Directory - - - - - - List View - - - - - - Detail View - - - - - - Files of type: - - - - - - Directory: - - - - - - %1 -Directory not found. -Please verify the correct directory name was given. - - - - - '%1' is write protected. -Do you want to delete it anyway? - - - - - Are sure you want to delete '%1'? - - - - - Could not delete directory. - - - - - Recent Places - - - - - All Files (*.*) - - - - - Save As - - - - - Drive - - - - - - File - - - - - Unknown - - - - - Find Directory - - - - - Show - - - - - - Forward - - - - - New Folder - - - - - &New Folder - - - - - - &Choose - - - - - Remove - - - - - - File &name: - - - - - - Look in: - - - - - - Create New Folder - - - - - QFileSystemModel - - - Invalid filename - - - - - <b>The name "%1" can not be used.</b><p>Try using another name, with fewer characters or no punctuations marks. - - - - - Name - - - - - Size - - - - - Kind - Match OS X Finder - - - - - Type - All other platforms - - - - - Date Modified - - - - - My Computer - - - - - Computer - - - - - %1 TB - - - - - %1 GB - - - - - %1 MB - - - - - %1 KB - - - - - %1 bytes - - - - - QFontDatabase - - - - Normal - - - - - - - Bold - - - - - - Demi Bold - - - - - - - Black - - - - - Demi - - - - - - Light - - - - - - Italic - - - - - - Oblique - - - - - Any - - - - - Latin - - - - - Greek - - - - - Cyrillic - - - - - Armenian - - - - - Hebrew - - - - - Arabic - - - - - Syriac - - - - - Thaana - - - - - Devanagari - - - - - Bengali - - - - - Gurmukhi - - - - - Gujarati - - - - - Oriya - - - - - Tamil - - - - - Telugu - - - - - Kannada - - - - - Malayalam - - - - - Sinhala - - - - - Thai - - - - - Lao - - - - - Tibetan - - - - - Myanmar - - - - - Georgian - - - - - Khmer - - - - - Simplified Chinese - - - - - Traditional Chinese - - - - - Japanese - - - - - Korean - - - - - Vietnamese - - - - - Symbol - - - - - Ogham - - - - - Runic - - - - - QFontDialog - - - &Font - - - - - Font st&yle - - - - - &Size - - - - - Effects - - - - - Stri&keout - - - - - &Underline - - - - - Sample - - - - - Wr&iting System - - - - - - Select Font - - - - - QFtp - - - - Not connected - - - - - - Host %1 not found - - - - - - Connection refused to host %1 - - - - - Connection timed out to host %1 - - - - - - - Connected to host %1 - - - - - - Connection refused for data connection - - - - - - - - Unknown error - - - - - - Connecting to host failed: -%1 - - - - - - Login failed: -%1 - - - - - - Listing directory failed: -%1 - - - - - - Changing directory failed: -%1 - - - - - - Downloading file failed: -%1 - - - - - - Uploading file failed: -%1 - - - - - - Removing file failed: -%1 - - - - - - Creating directory failed: -%1 - - - - - - Removing directory failed: -%1 - - - - - - - Connection closed - - - - - Host %1 found - - - - - Connection to %1 closed - - - - - Host found - - - - - Connected to host - - - - - QHostInfo - - - Unknown error - - - - - QHostInfoAgent - - - - - - - - - - Host not found - - - - - - - - Unknown address type - - - - - - - Unknown error - - - - - QHttp - - - - - - Unknown error - - - - - - Request aborted - - - - - - No server set to connect to - - - - - - Wrong content length - - - - - - Server closed connection unexpectedly - - - - - Unknown authentication method - - - - - Error writing response to device - - - - - - Connection refused - - - - - - - Host %1 not found - - - - - - - - HTTP request failed - - - - - - Invalid HTTP response header - - - - - - - - Invalid HTTP chunked body - - - - - Host %1 found - - - - - Connected to host %1 - - - - - Connection to %1 closed - - - - - Host found - - - - - Connected to host - - - - - - Connection closed - - - - - Proxy authentication required - - - - - Authentication required - - - - - Connection refused (or timed out) - - - - - Proxy requires authentication - - - - - Host requires authentication - - - - - Data corrupted - - - - - Unknown protocol specified - - - - - SSL handshake failed - - - - - HTTPS connection requested but SSL support not compiled in - - - - - QHttpSocketEngine - - - Did not receive HTTP response from proxy - - - - - Error parsing authentication request from proxy - - - - - Authentication required - - - - - Proxy denied connection - - - - - Error communicating with HTTP proxy - - - - - Proxy server not found - - - - - Proxy connection refused - - - - - Proxy server connection timed out - - - - - Proxy connection closed prematurely - - - - - QIBaseDriver - - - Error opening database - - - - - Could not start transaction - - - - - Unable to commit transaction - - - - - Unable to rollback transaction - - - - - QIBaseResult - - - Unable to create BLOB - - - - - Unable to write BLOB - - - - - Unable to open BLOB - - - - - Unable to read BLOB - - - - - - Could not find array - - - - - Could not get array data - - - - - Could not get query info - - - - - Could not start transaction - - - - - Unable to commit transaction - - - - - Could not allocate statement - - - - - Could not prepare statement - - - - - - Could not describe input statement - - - - - Could not describe statement - - - - - Unable to close statement - - - - - Unable to execute query - - - - - Could not fetch next item - - - - - Could not get statement info - - - - - QIODevice - - - Permission denied - - - - - Too many open files - - - - - No such file or directory - - - - - No space left on device - - - - - Unknown error - - - - - QInputContext - - - XIM - - - - - XIM input method - - - - - Windows input method - - - - - Mac OS X input method - - - - - QInputDialog - - - Enter a value: - - - - - QLibrary - - - Could not mmap '%1': %2 - - - - - Plugin verification data mismatch in '%1' - - - - - Could not unmap '%1': %2 - - - - - The plugin '%1' uses incompatible Qt library. (%2.%3.%4) [%5] - - - - - The plugin '%1' uses incompatible Qt library. Expected build key "%2", got "%3" - - - - - Unknown error - - - - - - The shared library was not found. - - - - - The file '%1' is not a valid Qt plugin. - - - - - The plugin '%1' uses incompatible Qt library. (Cannot mix debug and release libraries.) - - - - - - Cannot load library %1: %2 - - - - - - Cannot unload library %1: %2 - - - - - - Cannot resolve symbol "%1" in %2: %3 - - - - - QLineEdit - - - &Undo - - - - - &Redo - - - - - Cu&t - - - - - &Copy - - - - - &Paste - - - - - Delete - - - - - Select All - - - - - QLocalServer - - - - %1: Name error - - - - - %1: Permission denied - - - - - %1: Address in use - - - - - - %1: Unknown error %2 - - - - - QLocalSocket - - - - %1: Connection refused - - - - - - %1: Remote closed - - - - - - - - %1: Invalid name - - - - - - %1: Socket access error - - - - - - %1: Socket resource error - - - - - - %1: Socket operation timed out - - - - - - %1: Datagram too large - - - - - - - %1: Connection error - - - - - - %1: The socket operation is not supported - - - - - %1: Unknown error - - - - - - %1: Unknown error %2 - - - - - QMYSQLDriver - - - Unable to open database ' - - - - - Unable to connect - - - - - Unable to begin transaction - - - - - Unable to commit transaction - - - - - Unable to rollback transaction - - - - - QMYSQLResult - - - Unable to fetch data - - - - - Unable to execute query - - - - - Unable to store result - - - - - - Unable to prepare statement - - - - - Unable to reset statement - - - - - Unable to bind value - - - - - Unable to execute statement - - - - - - Unable to bind outvalues - - - - - Unable to store statement results - - - - - Unable to execute next query - - - - - Unable to store next result - - - - - QMdiArea - - - (Untitled) - - - - - QMdiSubWindow - - - %1 - [%2] - - - - - Close - - - - - Minimize - - - - - Restore Down - - - - - &Restore - - - - - &Move - - - - - &Size - - - - - Mi&nimize - - - - - Ma&ximize - - - - - Stay on &Top - - - - - &Close - - - - - - [%1] - - - - - Maximize - - - - - Unshade - - - - - Shade - - - - - Restore - - - - - Help - - - - - Menu - - - - - QMenu - - - - Close - - - - - - Open - - - - - - - Execute - - - - - QMessageBox - - - Help - - - - - - - - OK - - - - - About Qt - - - - - Show Details... - - - - - Hide Details... - - - - - <h3>About Qt</h3><p>This program uses Qt version %1.</p><p>Qt is a C++ toolkit for cross-platform application development.</p><p>Qt provides single-source portability across MS&nbsp;Windows, Mac&nbsp;OS&nbsp;X, Linux, and all major commercial Unix variants. Qt is also available for embedded devices as Qt for Embedded Linux and Qt for Windows CE.</p><p>Qt is available under three different licensing options designed to accommodate the needs of our various users.</p>Qt licensed under our commercial license agreement is appropriate for development of proprietary/commercial software where you do not want to share any source code with third parties or otherwise cannot comply with the terms of the GNU LGPL version 2.1 or GNU GPL version 3.0.</p><p>Qt licensed under the GNU LGPL version 2.1 is appropriate for the development of Qt applications (proprietary or open source) provided you can comply with the terms and conditions of the GNU LGPL version 2.1.</p><p>Qt licensed under the GNU General Public License version 3.0 is appropriate for the development of Qt applications where you wish to use such applications in combination with software subject to the terms of the GNU GPL version 3.0 or where you are otherwise willing to comply with the terms of the GNU GPL version 3.0.</p><p>Please see <a href="http://qt.nokia.com/products/licensing">qt.nokia.com/products/licensing</a> for an overview of Qt licensing.</p><p>Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).</p><p>Qt is a Nokia product. See <a href="http://qt.nokia.com/">qt.nokia.com</a> for more information.</p> - - - - - QMultiInputContext - - - Select IM - - - - - QMultiInputContextPlugin - - - Multiple input method switcher - - - - - Multiple input method switcher that uses the context menu of the text widgets - - - - - QNativeSocketEngine - - - The remote host closed the connection - - - - - Network operation timed out - - - - - Out of resources - - - - - Unsupported socket operation - - - - - Protocol type not supported - - - - - Invalid socket descriptor - - - - - Network unreachable - - - - - Permission denied - - - - - Connection timed out - - - - - Connection refused - - - - - The bound address is already in use - - - - - The address is not available - - - - - The address is protected - - - - - Unable to send a message - - - - - Unable to receive a message - - - - - Unable to write - - - - - Network error - - - - - Another socket is already listening on the same port - - - - - Unable to initialize non-blocking socket - - - - - Unable to initialize broadcast socket - - - - - Attempt to use IPv6 socket on a platform with no IPv6 support - - - - - Host unreachable - - - - - Datagram was too large to send - - - - - Operation on non-socket - - - - - Unknown error - - - - - The proxy type is invalid for this operation - - - - - QNetworkAccessCacheBackend - - - Error opening %1 - - - - - QNetworkAccessFileBackend - - - Request for opening non-local file %1 - - - - - Error opening %1: %2 - - - - - Write error writing to %1: %2 - - - - - Cannot open %1: Path is a directory - - - - - Read error reading from %1: %2 - - - - - QNetworkAccessFtpBackend - - - No suitable proxy found - - - - - Cannot open %1: is a directory - - - - - Logging in to %1 failed: authentication required - - - - - Error while downloading %1: %2 - - - - - Error while uploading %1: %2 - - - - - QNetworkAccessHttpBackend - - - No suitable proxy found - - - - - QNetworkReply - - - Error downloading %1 - server replied: %2 - - - - - Protocol "%1" is unknown - - - - - QNetworkReplyImpl - - - - Operation canceled - - - - - QOCIDriver - - - Unable to logon - - - - - Unable to initialize - QOCIDriver - - - - - Unable to begin transaction - - - - - Unable to commit transaction - - - - - Unable to rollback transaction - - - - - QOCIResult - - - - - Unable to bind column for batch execute - - - - - Unable to execute batch statement - - - - - Unable to goto next - - - - - Unable to alloc statement - - - - - Unable to prepare statement - - - - - Unable to bind value - - - - - Unable to execute statement - - - - - QODBCDriver - - - Unable to connect - - - - - Unable to connect - Driver doesn't support all needed functionality - - - - - Unable to disable autocommit - - - - - Unable to commit transaction - - - - - Unable to rollback transaction - - - - - Unable to enable autocommit - - - - - QODBCResult - - - - QODBCResult::reset: Unable to set 'SQL_CURSOR_STATIC' as statement attribute. Please check your ODBC driver configuration - - - - - - Unable to execute statement - - - - - Unable to fetch next - - - - - Unable to prepare statement - - - - - Unable to bind variable - - - - - - - Unable to fetch last - - - - - Unable to fetch - - - - - Unable to fetch first - - - - - Unable to fetch previous - - - - - QObject - - - Home - - - - - Operation not supported on %1 - - - - - Invalid URI: %1 - - - - - Write error writing to %1: %2 - - - - - Read error reading from %1: %2 - - - - - Socket error on %1: %2 - - - - - Remote host closed the connection prematurely on %1 - - - - - Protocol error: packet of size 0 received - - - - - - No host name given - - - - - QPPDOptionsModel - - - Name - - - - - Value - - - - - QPSQLDriver - - - Unable to connect - - - - - Could not begin transaction - - - - - Could not commit transaction - - - - - Could not rollback transaction - - - - - Unable to subscribe - - - - - Unable to unsubscribe - - - - - QPSQLResult - - - Unable to create query - - - - - Unable to prepare statement - - - - - QPageSetupWidget - - - Centimeters (cm) - - - - - Millimeters (mm) - - - - - Inches (in) - - - - - Points (pt) - - - - - Form - - - - - Paper - - - - - Page size: - - - - - Width: - - - - - Height: - - - - - Paper source: - - - - - Orientation - - - - - Portrait - - - - - Landscape - - - - - Reverse landscape - - - - - Reverse portrait - - - - - Margins - - - - - top margin - - - - - left margin - - - - - right margin - - - - - bottom margin - - - - - QPluginLoader - - - Unknown error - - - - - The plugin was not loaded. - - - - - QPrintDialog - - - locally connected - - - - - - Aliases: %1 - - - - - - unknown - - - - - A0 (841 x 1189 mm) - - - - - A1 (594 x 841 mm) - - - - - A2 (420 x 594 mm) - - - - - A3 (297 x 420 mm) - - - - - A4 (210 x 297 mm, 8.26 x 11.7 inches) - - - - - A5 (148 x 210 mm) - - - - - A6 (105 x 148 mm) - - - - - A7 (74 x 105 mm) - - - - - A8 (52 x 74 mm) - - - - - A9 (37 x 52 mm) - - - - - B0 (1000 x 1414 mm) - - - - - B1 (707 x 1000 mm) - - - - - B2 (500 x 707 mm) - - - - - B3 (353 x 500 mm) - - - - - B4 (250 x 353 mm) - - - - - B5 (176 x 250 mm, 6.93 x 9.84 inches) - - - - - B6 (125 x 176 mm) - - - - - B7 (88 x 125 mm) - - - - - B8 (62 x 88 mm) - - - - - B9 (44 x 62 mm) - - - - - B10 (31 x 44 mm) - - - - - C5E (163 x 229 mm) - - - - - DLE (110 x 220 mm) - - - - - Executive (7.5 x 10 inches, 191 x 254 mm) - - - - - Folio (210 x 330 mm) - - - - - Ledger (432 x 279 mm) - - - - - Legal (8.5 x 14 inches, 216 x 356 mm) - - - - - Letter (8.5 x 11 inches, 216 x 279 mm) - - - - - Tabloid (279 x 432 mm) - - - - - US Common #10 Envelope (105 x 241 mm) - - - - - OK - - - - - - - Print - - - - - Print To File ... - - - - - Print range - - - - - Print all - - - - - File %1 is not writable. -Please choose a different file name. - - - - - %1 already exists. -Do you want to overwrite it? - - - - - File exists - - - - - <qt>Do you want to overwrite it?</qt> - - - - - Print selection - - - - - %1 is a directory. -Please choose a different file name. - - - - - A0 - - - - - A1 - - - - - A2 - - - - - A3 - - - - - A4 - - - - - A5 - - - - - A6 - - - - - A7 - - - - - A8 - - - - - A9 - - - - - B0 - - - - - B1 - - - - - B2 - - - - - B3 - - - - - B4 - - - - - B5 - - - - - B6 - - - - - B7 - - - - - B8 - - - - - B9 - - - - - B10 - - - - - C5E - - - - - DLE - - - - - Executive - - - - - Folio - - - - - Ledger - - - - - Legal - - - - - Letter - - - - - Tabloid - - - - - US Common #10 Envelope - - - - - Custom - - - - - - &Options >> - - - - - &Print - - - - - &Options << - - - - - Print to File (PDF) - - - - - Print to File (Postscript) - - - - - Local file - - - - - Write %1 file - - - - - The 'From' value cannot be greater than the 'To' value. - - - - - QPrintPreviewDialog - - - - Page Setup - - - - - %1% - - - - - Print Preview - - - - - Next page - - - - - Previous page - - - - - First page - - - - - Last page - - - - - Fit width - - - - - Fit page - - - - - Zoom in - - - - - Zoom out - - - - - Portrait - - - - - Landscape - - - - - Show single page - - - - - Show facing pages - - - - - Show overview of all pages - - - - - Print - - - - - Page setup - - - - - Close - - - - - Export to PDF - - - - - Export to PostScript - - - - - QPrintPropertiesWidget - - - Form - - - - - Page - - - - - Advanced - - - - - QPrintSettingsOutput - - - Form - - - - - Copies - - - - - Print range - - - - - Print all - - - - - Pages from - - - - - to - - - - - Selection - - - - - Output Settings - - - - - Copies: - - - - - Collate - - - - - Reverse - - - - - Options - - - - - Color Mode - - - - - Color - - - - - Grayscale - - - - - Duplex Printing - - - - - None - - - - - Long side - - - - - Short side - - - - - QPrintWidget - - - Form - - - - - Printer - - - - - &Name: - - - - - P&roperties - - - - - Location: - - - - - Preview - - - - - Type: - - - - - Output &file: - - - - - ... - - - - - QProcess - - - - Could not open input redirection for reading - - - - - - Could not open output redirection for writing - - - - - Resource error (fork failure): %1 - - - - - - - - - - - - - Process operation timed out - - - - - - - - Error reading from process - - - - - - - Error writing to process - - - - - Process crashed - - - - - No program defined - - - - - Process failed to start - - - - - QProgressDialog - - - Cancel - - - - - QPushButton - - - Open - - - - - QRadioButton - - - Check - - - - - QRegExp - - - no error occurred - - - - - disabled feature used - - - - - bad char class syntax - - - - - bad lookahead syntax - - - - - bad repetition syntax - - - - - invalid octal value - - - - - missing left delim - - - - - unexpected end - - - - - met internal limit - - - - - QSQLite2Driver - - - Error to open database - - - - - Unable to begin transaction - - - - - Unable to commit transaction - - - - - Unable to rollback Transaction - - - - - QSQLite2Result - - - Unable to fetch results - - - - - Unable to execute statement - - - - - QSQLiteDriver - - - Error opening database - - - - - Error closing database - - - - - Unable to begin transaction - - - - - Unable to commit transaction - - - - - Unable to rollback transaction - - - - - QSQLiteResult - - - - - Unable to fetch row - - - - - Unable to execute statement - - - - - Unable to reset statement - - - - - Unable to bind parameters - - - - - Parameter count mismatch - - - - - No query - - - - - QScrollBar - - - Scroll here - - - - - Left edge - - - - - Top - - - - - Right edge - - - - - Bottom - - - - - Page left - - - - - - Page up - - - - - Page right - - - - - - Page down - - - - - Scroll left - - - - - Scroll up - - - - - Scroll right - - - - - Scroll down - - - - - Line up - - - - - Position - - - - - Line down - - - - - QSharedMemory - - - %1: unable to set key on lock - - - - - %1: create size is less then 0 - - - - - - %1: unable to lock - - - - - %1: unable to unlock - - - - - - %1: permission denied - - - - - - %1: already exists - - - - - - %1: doesn't exists - - - - - - %1: out of resources - - - - - - %1: unknown error %2 - - - - - %1: key is empty - - - - - %1: unix key file doesn't exists - - - - - %1: ftok failed - - - - - - %1: unable to make key - - - - - %1: system-imposed size restrictions - - - - - %1: not attached - - - - - %1: invalid size - - - - - %1: key error - - - - - %1: size query failed - - - - - QShortcut - - - Space - - - - - Esc - - - - - Tab - - - - - Backtab - - - - - Backspace - - - - - Return - - - - - Enter - - - - - Ins - - - - - Del - - - - - Pause - - - - - Print - - - - - SysReq - - - - - Home - - - - - End - - - - - Left - - - - - Up - - - - - Right - - - - - Down - - - - - PgUp - - - - - PgDown - - - - - CapsLock - - - - - NumLock - - - - - ScrollLock - - - - - Menu - - - - - Help - - - - - Back - - - - - Forward - - - - - Stop - - - - - Refresh - - - - - Volume Down - - - - - Volume Mute - - - - - Volume Up - - - - - Bass Boost - - - - - Bass Up - - - - - Bass Down - - - - - Treble Up - - - - - Treble Down - - - - - Media Play - - - - - Media Stop - - - - - Media Previous - - - - - Media Next - - - - - Media Record - - - - - Favorites - - - - - Search - - - - - Standby - - - - - Open URL - - - - - Launch Mail - - - - - Launch Media - - - - - Launch (0) - - - - - Launch (1) - - - - - Launch (2) - - - - - Launch (3) - - - - - Launch (4) - - - - - Launch (5) - - - - - Launch (6) - - - - - Launch (7) - - - - - Launch (8) - - - - - Launch (9) - - - - - Launch (A) - - - - - Launch (B) - - - - - Launch (C) - - - - - Launch (D) - - - - - Launch (E) - - - - - Launch (F) - - - - - Print Screen - - - - - Page Up - - - - - Page Down - - - - - Caps Lock - - - - - Num Lock - - - - - Number Lock - - - - - Scroll Lock - - - - - Insert - - - - - Delete - - - - - Escape - - - - - System Request - - - - - Select - - - - - Yes - - - - - No - - - - - Context1 - - - - - Context2 - - - - - Context3 - - - - - Context4 - - - - - Call - - - - - Hangup - - - - - Flip - - - - - - Ctrl - - - - - - Shift - - - - - - Alt - - - - - - Meta - - - - - + - - - - - F%1 - - - - - Home Page - - - - - QSlider - - - Page left - - - - - Page up - - - - - Position - - - - - Page right - - - - - Page down - - - - - QSocks5SocketEngine - - - Connection to proxy refused - - - - - Connection to proxy closed prematurely - - - - - Proxy host not found - - - - - Connection to proxy timed out - - - - - Proxy authentication failed - - - - - Proxy authentication failed: %1 - - - - - SOCKS version 5 protocol error - - - - - General SOCKSv5 server failure - - - - - Connection not allowed by SOCKSv5 server - - - - - TTL expired - - - - - SOCKSv5 command not supported - - - - - Address type not supported - - - - - Unknown SOCKSv5 proxy error code 0x%1 - - - - - Network operation timed out - - - - - QSpinBox - - - More - - - - - Less - - - - - QSql - - - Delete - - - - - Delete this record? - - - - - - - Yes - - - - - - - No - - - - - Insert - - - - - Update - - - - - Save edits? - - - - - Cancel - - - - - Confirm - - - - - Cancel your edits? - - - - - QSslSocket - - - Unable to write data: %1 - - - - - Error while reading: %1 - - - - - Error during SSL handshake: %1 - - - - - Error creating SSL context (%1) - - - - - Invalid or empty cipher list (%1) - - - - - Error creating SSL session, %1 - - - - - Error creating SSL session: %1 - - - - - Cannot provide a certificate with no key, %1 - - - - - Error loading local certificate, %1 - - - - - Error loading private key, %1 - - - - - Private key does not certificate public key, %1 - - - - - QSystemSemaphore - - - - %1: out of resources - - - - - - %1: permission denied - - - - - %1: already exists - - - - - %1: does not exist - - - - - - %1: unknown error %2 - - - - - QTDSDriver - - - Unable to open connection - - - - - Unable to use database - - - - - QTabBar - - - Scroll Left - - - - - Scroll Right - - - - - QTcpServer - - - Operation on socket is not supported - - - - - QTextControl - - - &Undo - - - - - &Redo - - - - - Cu&t - - - - - &Copy - - - - - Copy &Link Location - - - - - &Paste - - - - - Delete - - - - - Select All - - - - - QToolButton - - - - Press - - - - - - Open - - - - - QUdpSocket - - - This platform does not support IPv6 - - - - - QUndoGroup - - - Undo - - - - - Redo - - - - - QUndoModel - - - <empty> - - - - - QUndoStack - - - Undo - - - - - Redo - - - - - QUnicodeControlCharacterMenu - - - LRM Left-to-right mark - - - - - RLM Right-to-left mark - - - - - ZWJ Zero width joiner - - - - - ZWNJ Zero width non-joiner - - - - - ZWSP Zero width space - - - - - LRE Start of left-to-right embedding - - - - - RLE Start of right-to-left embedding - - - - - LRO Start of left-to-right override - - - - - RLO Start of right-to-left override - - - - - PDF Pop directional formatting - - - - - Insert Unicode control character - - - - - QWebFrame - - - Request cancelled - - - - - Request blocked - - - - - Cannot show URL - - - - - Frame load interruped by policy change - - - - - Cannot show mimetype - - - - - File does not exist - - - - - QWebPage - - - Bad HTTP request - - - - - Submit - default label for Submit buttons in forms on web pages - - - - - Submit - Submit (input element) alt text for <input> elements with no alt, title, or value - - - - - Reset - default label for Reset buttons in forms on web pages - - - - - This is a searchable index. Enter search keywords: - text that appears at the start of nearly-obsolete web pages in the form of a 'searchable index' - - - - - Choose File - title for file button used in HTML forms - - - - - No file selected - text to display in file button used in HTML forms when no file is selected - - - - - Open in New Window - Open in New Window context menu item - - - - - Save Link... - Download Linked File context menu item - - - - - Copy Link - Copy Link context menu item - - - - - Open Image - Open Image in New Window context menu item - - - - - Save Image - Download Image context menu item - - - - - Copy Image - Copy Link context menu item - - - - - Open Frame - Open Frame in New Window context menu item - - - - - Copy - Copy context menu item - - - - - Go Back - Back context menu item - - - - - Go Forward - Forward context menu item - - - - - Stop - Stop context menu item - - - - - Reload - Reload context menu item - - - - - Cut - Cut context menu item - - - - - Paste - Paste context menu item - - - - - No Guesses Found - No Guesses Found context menu item - - - - - Ignore - Ignore Spelling context menu item - - - - - Add To Dictionary - Learn Spelling context menu item - - - - - Search The Web - Search The Web context menu item - - - - - Look Up In Dictionary - Look Up in Dictionary context menu item - - - - - Open Link - Open Link context menu item - - - - - Ignore - Ignore Grammar context menu item - - - - - Spelling - Spelling and Grammar context sub-menu item - - - - - Show Spelling and Grammar - menu item title - - - - - Hide Spelling and Grammar - menu item title - - - - - Check Spelling - Check spelling context menu item - - - - - Check Spelling While Typing - Check spelling while typing context menu item - - - - - Check Grammar With Spelling - Check grammar with spelling context menu item - - - - - Fonts - Font context sub-menu item - - - - - Bold - Bold context menu item - - - - - Italic - Italic context menu item - - - - - Underline - Underline context menu item - - - - - Outline - Outline context menu item - - - - - Direction - Writing direction context sub-menu item - - - - - Text Direction - Text direction context sub-menu item - - - - - Default - Default writing direction context menu item - - - - - LTR - Left to Right context menu item - - - - - RTL - Right to Left context menu item - - - - - Inspect - Inspect Element context menu item - - - - - No recent searches - Label for only item in menu that appears when clicking on the search field image, when no searches have been performed - - - - - Recent searches - label for first item in the menu that appears when clicking on the search field image, used as embedded menu title - - - - - Clear recent searches - menu item in Recent Searches menu that empties menu's contents - - - - - Unknown - Unknown filesize FTP directory listing item - - - - - %1 (%2x%3 pixels) - Title string for images - - - - - Web Inspector - %2 - - - - - Scroll here - - - - - Left edge - - - - - Top - - - - - Right edge - - - - - Bottom - - - - - Page left - - - - - Page up - - - - - Page right - - - - - Page down - - - - - Scroll left - - - - - Scroll up - - - - - Scroll right - - - - - Scroll down - - - - - %n file(s) - number of chosen file - - - - - - - JavaScript Alert - %1 - - - - - JavaScript Confirm - %1 - - - - - JavaScript Prompt - %1 - - - - - Move the cursor to the next character - - - - - Move the cursor to the previous character - - - - - Move the cursor to the next word - - - - - Move the cursor to the previous word - - - - - Move the cursor to the next line - - - - - Move the cursor to the previous line - - - - - Move the cursor to the start of the line - - - - - Move the cursor to the end of the line - - - - - Move the cursor to the start of the block - - - - - Move the cursor to the end of the block - - - - - Move the cursor to the start of the document - - - - - Move the cursor to the end of the document - - - - - Select all - - - - - Select to the next character - - - - - Select to the previous character - - - - - Select to the next word - - - - - Select to the previous word - - - - - Select to the next line - - - - - Select to the previous line - - - - - Select to the start of the line - - - - - Select to the end of the line - - - - - Select to the start of the block - - - - - Select to the end of the block - - - - - Select to the start of the document - - - - - Select to the end of the document - - - - - Delete to the start of the word - - - - - Delete to the end of the word - - - - - Insert a new paragraph - - - - - Insert a new line - - - - - QWhatsThisAction - - - What's This? - - - - - QWidget - - - * - - - - - QWizard - - - Go Back - - - - - Continue - - - - - Commit - - - - - Done - - - - - Help - - - - - < &Back - - - - - &Finish - - - - - Cancel - - - - - &Help - - - - - &Next - - - - - &Next > - - - - - QWorkspace - - - &Restore - - - - - &Move - - - - - &Size - - - - - Mi&nimize - - - - - Ma&ximize - - - - - &Close - - - - - Stay on &Top - - - - - - Sh&ade - - - - - - %1 - [%2] - - - - - Minimize - - - - - Restore Down - - - - - Close - - - - - &Unshade - - - - - QXml - - - no error occurred - - - - - error triggered by consumer - - - - - unexpected end of file - - - - - more than one document type definition - - - - - error occurred while parsing element - - - - - tag mismatch - - - - - error occurred while parsing content - - - - - unexpected character - - - - - invalid name for processing instruction - - - - - version expected while reading the XML declaration - - - - - wrong value for standalone declaration - - - - - encoding declaration or standalone declaration expected while reading the XML declaration - - - - - standalone declaration expected while reading the XML declaration - - - - - error occurred while parsing document type definition - - - - - letter is expected - - - - - error occurred while parsing comment - - - - - error occurred while parsing reference - - - - - internal general entity reference not allowed in DTD - - - - - external parsed general entity reference not allowed in attribute value - - - - - external parsed general entity reference not allowed in DTD - - - - - unparsed entity reference in wrong context - - - - - recursive entities - - - - - error in the text declaration of an external entity - - - - - QXmlStream - - - - Extra content at end of document. - - - - - Invalid entity value. - - - - - Invalid XML character. - - - - - Sequence ']]>' not allowed in content. - - - - - Namespace prefix '%1' not declared - - - - - Attribute redefined. - - - - - Unexpected character '%1' in public id literal. - - - - - Invalid XML version string. - - - - - Unsupported XML version. - - - - - %1 is an invalid encoding name. - - - - - Encoding %1 is unsupported - - - - - Standalone accepts only yes or no. - - - - - Invalid attribute in XML declaration. - - - - - Premature end of document. - - - - - Invalid document. - - - - - Expected - - - - - , but got ' - - - - - Unexpected ' - - - - - Expected character data. - - - - - Recursive entity detected. - - - - - Start tag expected. - - - - - XML declaration not at start of document. - - - - - NDATA in parameter entity declaration. - - - - - %1 is an invalid processing instruction name. - - - - - Invalid processing instruction name. - - - - - - - - Illegal namespace declaration. - - - - - Invalid XML name. - - - - - Opening and ending tag mismatch. - - - - - Reference to unparsed entity '%1'. - - - - - - - Entity '%1' not declared. - - - - - Reference to external entity '%1' in attribute value. - - - - - Invalid character reference. - - - - - - Encountered incorrectly encoded content. - - - - - The standalone pseudo attribute must appear after the encoding. - - - - - %1 is an invalid PUBLIC identifier. - - - - - QtXmlPatterns - - - An %1-attribute with value %2 has already been declared. - - - - - An %1-attribute must have a valid %2 as value, which %3 isn't. - - - - - Network timeout. - - - - - Element %1 can't be serialized because it appears outside the document element. - - - - - Year %1 is invalid because it begins with %2. - - - - - Day %1 is outside the range %2..%3. - - - - - Month %1 is outside the range %2..%3. - - - - - Overflow: Can't represent date %1. - - - - - Day %1 is invalid for month %2. - - - - - Time 24:%1:%2.%3 is invalid. Hour is 24, but minutes, seconds, and milliseconds are not all 0; - - - - - Time %1:%2:%3.%4 is invalid. - - - - - Overflow: Date can't be represented. - - - - - - At least one component must be present. - - - - - At least one time component must appear after the %1-delimiter. - - - - - No operand in an integer division, %1, can be %2. - - - - - The first operand in an integer division, %1, cannot be infinity (%2). - - - - - The second operand in a division, %1, cannot be zero (%2). - - - - - %1 is not a valid value of type %2. - - - - - When casting to %1 from %2, the source value cannot be %3. - - - - - Integer division (%1) by zero (%2) is undefined. - - - - - Division (%1) by zero (%2) is undefined. - - - - - Modulus division (%1) by zero (%2) is undefined. - - - - - - Dividing a value of type %1 by %2 (not-a-number) is not allowed. - - - - - Dividing a value of type %1 by %2 or %3 (plus or minus zero) is not allowed. - - - - - Multiplication of a value of type %1 by %2 or %3 (plus or minus infinity) is not allowed. - - - - - A value of type %1 cannot have an Effective Boolean Value. - - - - - Effective Boolean Value cannot be calculated for a sequence containing two or more atomic values. - - - - - Value %1 of type %2 exceeds maximum (%3). - - - - - Value %1 of type %2 is below minimum (%3). - - - - - A value of type %1 must contain an even number of digits. The value %2 does not. - - - - - %1 is not valid as a value of type %2. - - - - - Operator %1 cannot be used on type %2. - - - - - Operator %1 cannot be used on atomic values of type %2 and %3. - - - - - The namespace URI in the name for a computed attribute cannot be %1. - - - - - The name for a computed attribute cannot have the namespace URI %1 with the local name %2. - - - - - Type error in cast, expected %1, received %2. - - - - - When casting to %1 or types derived from it, the source value must be of the same type, or it must be a string literal. Type %2 is not allowed. - - - - - No casting is possible with %1 as the target type. - - - - - It is not possible to cast from %1 to %2. - - - - - Casting to %1 is not possible because it is an abstract type, and can therefore never be instantiated. - - - - - It's not possible to cast the value %1 of type %2 to %3 - - - - - Failure when casting from %1 to %2: %3 - - - - - A comment cannot contain %1 - - - - - A comment cannot end with a %1. - - - - - No comparisons can be done involving the type %1. - - - - - Operator %1 is not available between atomic values of type %2 and %3. - - - - - An attribute node cannot be a child of a document node. Therefore, the attribute %1 is out of place. - - - - - A library module cannot be evaluated directly. It must be imported from a main module. - - - - - No template by name %1 exists. - - - - - A value of type %1 cannot be a predicate. A predicate must have either a numeric type or an Effective Boolean Value type. - - - - - A positional predicate must evaluate to a single numeric value. - - - - - The target name in a processing instruction cannot be %1 in any combination of upper and lower case. Therefore, is %2 invalid. - - - - - %1 is not a valid target name in a processing instruction. It must be a %2 value, e.g. %3. - - - - - The last step in a path must contain either nodes or atomic values. It cannot be a mixture between the two. - - - - - The data of a processing instruction cannot contain the string %1 - - - - - No namespace binding exists for the prefix %1 - - - - - No namespace binding exists for the prefix %1 in %2 - - - - - - %1 is an invalid %2 - - - - - %1 takes at most %n argument(s). %2 is therefore invalid. - - - - - - - %1 requires at least %n argument(s). %2 is therefore invalid. - - - - - - - The first argument to %1 cannot be of type %2. It must be a numeric type, xs:yearMonthDuration or xs:dayTimeDuration. - - - - - The first argument to %1 cannot be of type %2. It must be of type %3, %4, or %5. - - - - - The second argument to %1 cannot be of type %2. It must be of type %3, %4, or %5. - - - - - %1 is not a valid XML 1.0 character. - - - - - The first argument to %1 cannot be of type %2. - - - - - If both values have zone offsets, they must have the same zone offset. %1 and %2 are not the same. - - - - - %1 was called. - - - - - %1 must be followed by %2 or %3, not at the end of the replacement string. - - - - - In the replacement string, %1 must be followed by at least one digit when not escaped. - - - - - In the replacement string, %1 can only be used to escape itself or %2, not %3 - - - - - %1 matches newline characters - - - - - %1 and %2 match the start and end of a line. - - - - - Matches are case insensitive - - - - - Whitespace characters are removed, except when they appear in character classes - - - - - %1 is an invalid regular expression pattern: %2 - - - - - %1 is an invalid flag for regular expressions. Valid flags are: - - - - - If the first argument is the empty sequence or a zero-length string (no namespace), a prefix cannot be specified. Prefix %1 was specified. - - - - - It will not be possible to retrieve %1. - - - - - The root node of the second argument to function %1 must be a document node. %2 is not a document node. - - - - - The default collection is undefined - - - - - %1 cannot be retrieved - - - - - The normalization form %1 is unsupported. The supported forms are %2, %3, %4, and %5, and none, i.e. the empty string (no normalization). - - - - - A zone offset must be in the range %1..%2 inclusive. %3 is out of range. - - - - - %1 is not a whole number of minutes. - - - - - Required cardinality is %1; got cardinality %2. - - - - - The item %1 did not match the required type %2. - - - - - - %1 is an unknown schema type. - - - - - Only one %1 declaration can occur in the query prolog. - - - - - The initialization of variable %1 depends on itself - - - - - No variable by name %1 exists - - - - - The variable %1 is unused - - - - - Version %1 is not supported. The supported XQuery version is 1.0. - - - - - The encoding %1 is invalid. It must contain Latin characters only, must not contain whitespace, and must match the regular expression %2. - - - - - No function with signature %1 is available - - - - - - A default namespace declaration must occur before function, variable, and option declarations. - - - - - Namespace declarations must occur before function, variable, and option declarations. - - - - - Module imports must occur before function, variable, and option declarations. - - - - - It is not possible to redeclare prefix %1. - - - - - Prefix %1 is already declared in the prolog. - - - - - The name of an option must have a prefix. There is no default namespace for options. - - - - - The Schema Import feature is not supported, and therefore %1 declarations cannot occur. - - - - - The target namespace of a %1 cannot be empty. - - - - - The module import feature is not supported - - - - - No value is available for the external variable by name %1. - - - - - A construct was encountered which only is allowed in XQuery. - - - - - A template by name %1 has already been declared. - - - - - The keyword %1 cannot occur with any other mode name. - - - - - The value of attribute %1 must of type %2, which %3 isn't. - - - - - The prefix %1 can not be bound. By default, it is already bound to the namespace %2. - - - - - A variable by name %1 has already been declared. - - - - - A stylesheet function must have a prefixed name. - - - - - The namespace for a user defined function cannot be empty (try the predefined prefix %1 which exists for cases like this) - - - - - The namespace %1 is reserved; therefore user defined functions may not use it. Try the predefined prefix %2, which exists for these cases. - - - - - The namespace of a user defined function in a library module must be equivalent to the module namespace. In other words, it should be %1 instead of %2 - - - - - A function already exists with the signature %1. - - - - - No external functions are supported. All supported functions can be used directly, without first declaring them as external - - - - - An argument by name %1 has already been declared. Every argument name must be unique. - - - - - When function %1 is used for matching inside a pattern, the argument must be a variable reference or a string literal. - - - - - In an XSL-T pattern, the first argument to function %1 must be a string literal, when used for matching. - - - - - In an XSL-T pattern, the first argument to function %1 must be a literal or a variable reference, when used for matching. - - - - - In an XSL-T pattern, function %1 cannot have a third argument. - - - - - In an XSL-T pattern, only function %1 and %2, not %3, can be used for matching. - - - - - In an XSL-T pattern, axis %1 cannot be used, only axis %2 or %3 can. - - - - - %1 is an invalid template mode name. - - - - - The name of a variable bound in a for-expression must be different from the positional variable. Hence, the two variables named %1 collide. - - - - - The Schema Validation Feature is not supported. Hence, %1-expressions may not be used. - - - - - None of the pragma expressions are supported. Therefore, a fallback expression must be present - - - - - Each name of a template parameter must be unique; %1 is duplicated. - - - - - The %1-axis is unsupported in XQuery - - - - - %1 is not a valid name for a processing-instruction. - - - - - %1 is not a valid numeric literal. - - - - - No function by name %1 is available. - - - - - The namespace URI cannot be the empty string when binding to a prefix, %1. - - - - - %1 is an invalid namespace URI. - - - - - It is not possible to bind to the prefix %1 - - - - - Namespace %1 can only be bound to %2 (and it is, in either case, pre-declared). - - - - - Prefix %1 can only be bound to %2 (and it is, in either case, pre-declared). - - - - - Two namespace declaration attributes have the same name: %1. - - - - - The namespace URI must be a constant and cannot use enclosed expressions. - - - - - An attribute by name %1 has already appeared on this element. - - - - - A direct element constructor is not well-formed. %1 is ended with %2. - - - - - The name %1 does not refer to any schema type. - - - - - %1 is an complex type. Casting to complex types is not possible. However, casting to atomic types such as %2 works. - - - - - %1 is not an atomic type. Casting is only possible to atomic types. - - - - - - %1 is not in the in-scope attribute declarations. Note that the schema import feature is not supported. - - - - - The name of an extension expression must be in a namespace. - - - - - empty - - - - - zero or one - - - - - exactly one - - - - - one or more - - - - - zero or more - - - - - Required type is %1, but %2 was found. - - - - - Promoting %1 to %2 may cause loss of precision. - - - - - The focus is undefined. - - - - - It's not possible to add attributes after any other kind of node. - - - - - An attribute by name %1 has already been created. - - - - - Only the Unicode Codepoint Collation is supported(%1). %2 is unsupported. - - - - - Attribute %1 can't be serialized because it appears at the top level. - - - - - %1 is an unsupported encoding. - - - - - %1 contains octets which are disallowed in the requested encoding %2. - - - - - The codepoint %1, occurring in %2 using encoding %3, is an invalid XML character. - - - - - Ambiguous rule match. - - - - - In a namespace constructor, the value for a namespace cannot be an empty string. - - - - - The prefix must be a valid %1, which %2 is not. - - - - - The prefix %1 cannot be bound. - - - - - Only the prefix %1 can be bound to %2 and vice versa. - - - - - Circularity detected - - - - - The parameter %1 is required, but no corresponding %2 is supplied. - - - - - The parameter %1 is passed, but no corresponding %2 exists. - - - - - The URI cannot have a fragment - - - - - Element %1 is not allowed at this location. - - - - - Text nodes are not allowed at this location. - - - - - Parse error: %1 - - - - - The value of the XSL-T version attribute must be a value of type %1, which %2 isn't. - - - - - Running an XSL-T 1.0 stylesheet with a 2.0 processor. - - - - - Unknown XSL-T attribute %1. - - - - - Attribute %1 and %2 are mutually exclusive. - - - - - In a simplified stylesheet module, attribute %1 must be present. - - - - - If element %1 has no attribute %2, it cannot have attribute %3 or %4. - - - - - Element %1 must have at least one of the attributes %2 or %3. - - - - - At least one mode must be specified in the %1-attribute on element %2. - - - - - Attribute %1 cannot appear on the element %2. Only the standard attributes can appear. - - - - - Attribute %1 cannot appear on the element %2. Only %3 is allowed, and the standard attributes. - - - - - Attribute %1 cannot appear on the element %2. Allowed is %3, %4, and the standard attributes. - - - - - Attribute %1 cannot appear on the element %2. Allowed is %3, and the standard attributes. - - - - - XSL-T attributes on XSL-T elements must be in the null namespace, not in the XSL-T namespace which %1 is. - - - - - The attribute %1 must appear on element %2. - - - - - The element with local name %1 does not exist in XSL-T. - - - - - Element %1 must come last. - - - - - At least one %1-element must occur before %2. - - - - - Only one %1-element can appear. - - - - - At least one %1-element must occur inside %2. - - - - - When attribute %1 is present on %2, a sequence constructor cannot be used. - - - - - Element %1 must have either a %2-attribute or a sequence constructor. - - - - - When a parameter is required, a default value cannot be supplied through a %1-attribute or a sequence constructor. - - - - - Element %1 cannot have children. - - - - - Element %1 cannot have a sequence constructor. - - - - - - The attribute %1 cannot appear on %2, when it is a child of %3. - - - - - A parameter in a function cannot be declared to be a tunnel. - - - - - This processor is not Schema-aware and therefore %1 cannot be used. - - - - - Top level stylesheet elements must be in a non-null namespace, which %1 isn't. - - - - - The value for attribute %1 on element %2 must either be %3 or %4, not %5. - - - - - Attribute %1 cannot have the value %2. - - - - - The attribute %1 can only appear on the first %2 element. - - - - - At least one %1 element must appear as child of %2. - - - - - VolumeSlider - - - Muted - - - - - - Volume: %1% - - - - diff --git a/translations/qtconfig_untranslated.ts b/translations/qtconfig_untranslated.ts deleted file mode 100644 index 62a74b8..0000000 --- a/translations/qtconfig_untranslated.ts +++ /dev/null @@ -1,885 +0,0 @@ - - - - - MainWindow - - - Desktop Settings (Default) - - - - - Choose style and palette based on your desktop settings. - - - - - On The Spot - - - - - - - - Auto (default) - - - - - Choose audio output automatically. - - - - - - aRts - - - - - Experimental aRts support for GStreamer. - - - - - Phonon GStreamer backend not available. - - - - - Choose render method automatically - - - - - - X11 - - - - - Use X11 Overlays - - - - - - OpenGL - - - - - Use OpenGL if avaiable - - - - - - Software - - - - - Use simple software rendering - - - - - No changes to be saved. - - - - - Saving changes... - - - - - Over The Spot - - - - - Off The Spot - - - - - Root - - - - - Select a Directory - - - - - <h3>%1</h3><br/>Version %2<br/><br/>Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).<br/><br/>The program is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.<br/> - - - - - - - Qt Configuration - - - - - Save Changes - - - - - Save changes to settings? - - - - - &Yes - - - - - &No - - - - - &Cancel - - - - - MainWindowBase - - - Qt Configuration - - - - - Appearance - - - - - GUI Style - - - - - Select GUI &Style: - - - - - Build Palette - - - - - &3-D Effects: - - - - - Window Back&ground: - - - - - &Tune Palette... - - - - - Please use the KDE Control Center to set the palette. - - - - - Preview - - - - - Select &Palette: - - - - - Active Palette - - - - - Inactive Palette - - - - - Disabled Palette - - - - - Fonts - - - - - Default Font - - - - - &Style: - - - - - &Point Size: - - - - - F&amily: - - - - - Sample Text - - - - - Font Substitution - - - - - S&elect or Enter a Family: - - - - - Current Substitutions: - - - - - Up - - - - - Down - - - - - Remove - - - - - Select s&ubstitute Family: - - - - - Add - - - - - Interface - - - - - Feel Settings - - - - - ms - - - - - &Double Click Interval: - - - - - No blinking - - - - - &Cursor Flash Time: - - - - - lines - - - - - Wheel &Scroll Lines: - - - - - Resolve symlinks in URLs - - - - - GUI Effects - - - - - &Enable - - - - - Alt+E - - - - - &Menu Effect: - - - - - C&omboBox Effect: - - - - - &ToolTip Effect: - - - - - Tool&Box Effect: - - - - - Disable - - - - - Animate - - - - - Fade - - - - - Global Strut - - - - - Minimum &Width: - - - - - Minimum Hei&ght: - - - - - pixels - - - - - Enhanced support for languages written right-to-left - - - - - XIM Input Style: - - - - - On The Spot - - - - - Over The Spot - - - - - Off The Spot - - - - - Root - - - - - Default Input Method: - - - - - Printer - - - - - Enable Font embedding - - - - - Font Paths - - - - - Browse... - - - - - Press the <b>Browse</b> button or enter a directory and press Enter to add them to the list. - - - - - Phonon - - - - - About Phonon - - - - - Current Version: - - - - - Not available - - - - - Website: - - - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="http://phonon.kde.org"><span style=" text-decoration: underline; color:#0000ff;">http://phonon.kde.org</span></a></p></body></html> - - - - - About GStreamer - - - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="http://gstreamer.freedesktop.org/"><span style=" text-decoration: underline; color:#0000ff;">http://gstreamer.freedesktop.org/</span></a></p></body></html> - - - - - GStreamer backend settings - - - - - Preferred audio sink: - - - - - Preferred render method: - - - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-style:italic;">Note: changes to these settings may prevent applications from starting up correctly.</span></p></body></html> - - - - - &File - - - - - &Help - - - - - &Save - - - - - Save - - - - - Ctrl+S - - - - - E&xit - - - - - Exit - - - - - &About - - - - - About - - - - - About &Qt - - - - - About Qt - - - - - PaletteEditorAdvancedBase - - - Tune Palette - - - - - <b>Edit Palette</b><p>Change the palette of the current widget or form.</p><p>Use a generated palette or select colors for each color group and each color role.</p><p>The palette can be tested with different widget layouts in the preview section.</p> - - - - - Select &Palette: - - - - - Active Palette - - - - - Inactive Palette - - - - - Disabled Palette - - - - - Auto - - - - - Build inactive palette from active - - - - - Build disabled palette from active - - - - - Central color &roles - - - - - Choose central color role - - - - - <b>Select a color role.</b><p>Available central roles are: <ul> <li>Window - general background color.</li> <li>WindowText - general foreground color. </li> <li>Base - used as background color for e.g. text entry widgets, usually white or another light color. </li> <li>Text - the foreground color used with Base. Usually this is the same as WindowText, in what case it must provide good contrast both with Window and Base. </li> <li>Button - general button background color, where buttons need a background different from Window, as in the Macintosh style. </li> <li>ButtonText - a foreground color used with the Button color. </li> <li>Highlight - a color to indicate a selected or highlighted item. </li> <li>HighlightedText - a text color that contrasts to Highlight. </li> <li>BrightText - a text color that is very different from WindowText and contrasts well with e.g. black. </li> </ul> </p> - - - - - Window - - - - - WindowText - - - - - Button - - - - - Base - - - - - Text - - - - - BrightText - - - - - ButtonText - - - - - Highlight - - - - - HighlightedText - - - - - &Select Color: - - - - - Choose a color - - - - - Choose a color for the selected central color role. - - - - - 3-D shadow &effects - - - - - Build &from button color - - - - - Generate shadings - - - - - Check to let 3D-effect colors be calculated from button-color. - - - - - Choose 3D-effect color role - - - - - <b>Select a color role.</b><p>Available effect roles are: <ul> <li>Light - lighter than Button color. </li> <li>Midlight - between Button and Light. </li> <li>Mid - between Button and Dark. </li> <li>Dark - darker than Button. </li> <li>Shadow - a very dark color. </li> </ul> - - - - - Light - - - - - Midlight - - - - - Mid - - - - - Dark - - - - - Shadow - - - - - Select Co&lor: - - - - - Choose a color for the selected effect color role. - - - - - OK - - - - - Close dialog and apply all changes. - - - - - Cancel - - - - - Close dialog and discard all changes. - - - - - PreviewFrame - - - Desktop settings will only take effect after an application restart. - - - - - PreviewWidgetBase - - - Preview Window - - - - - ButtonGroup - - - - - RadioButton1 - - - - - RadioButton2 - - - - - RadioButton3 - - - - - ButtonGroup2 - - - - - CheckBox1 - - - - - CheckBox2 - - - - - LineEdit - - - - - ComboBox - - - - - PushButton - - - - - <p> -<a href="http://qt.nokia.com">http://qt.nokia.com</a> -</p> -<p> -<a href="http://www.kde.org">http://www.kde.org</a> -</p> - - - - diff --git a/translations/qvfb_untranslated.ts b/translations/qvfb_untranslated.ts deleted file mode 100644 index cc18132..0000000 --- a/translations/qvfb_untranslated.ts +++ /dev/null @@ -1,325 +0,0 @@ - - - - - AnimationSaveWidget - - - - Record - - - - - Reset - - - - - Save - - - - - Save in MPEG format (requires netpbm package installed) - - - - - - Click record to begin recording. - - - - - - Finished saving. - - - - - Paused. Click record to resume, or save if done. - - - - - Pause - - - - - Recording... - - - - - Saving... - - - - - - Save animation... - - - - - Save canceled. - - - - - Save failed! - - - - - Config - - - Configure - - - - - Size - - - - - 176x220 "SmartPhone" - - - - - 240x320 "PDA" - - - - - 320x240 "TV" / "QVGA" - - - - - 640x480 "VGA" - - - - - 800x600 - - - - - 1024x768 - - - - - Custom - - - - - Depth - - - - - 1 bit monochrome - - - - - 4 bit grayscale - - - - - 8 bit - - - - - 12 (16) bit - - - - - 15 bit - - - - - 16 bit - - - - - 18 bit - - - - - 24 bit - - - - - 32 bit - - - - - 32 bit ARGB - - - - - Skin - - - - - None - - - - - Emulate touch screen (no mouse move) - - - - - Emulate LCD screen (Only with fixed zoom of 3.0 times magnification) - - - - - <p>Note that any applications using the virtual framebuffer will be terminated if you change the Size or Depth <i>above</i>. You may freely modify the Gamma <i>below</i>. - - - - - Gamma - - - - - Blue - - - - - 1.0 - - - - - Green - - - - - All - - - - - Red - - - - - Set all to 1.0 - - - - - &OK - - - - - &Cancel - - - - - DeviceSkin - - - The image file '%1' could not be loaded. - - - - - The skin directory '%1' does not contain a configuration file. - - - - - The skin configuration file '%1' could not be opened. - - - - - The skin configuration file '%1' could not be read: %2 - - - - - Syntax error: %1 - - - - - The skin "up" image file '%1' does not exist. - - - - - The skin "down" image file '%1' does not exist. - - - - - The skin "closed" image file '%1' does not exist. - - - - - The skin cursor image file '%1' does not exist. - - - - - Syntax error in area definition: %1 - - - - - Mismatch in number of areas, expected %1, got %2. - - - - - QVFb - - - Browse... - - - - - Load Custom Skin... - - - - - All QVFB Skins (*.skin) - - - - diff --git a/translations/translations.pri b/translations/translations.pri index fae0f7e..f984e39 100644 --- a/translations/translations.pri +++ b/translations/translations.pri @@ -21,7 +21,7 @@ LRELEASE = $$fixPath($$QT_BUILD_TREE/bin/lrelease) ###### Qt Libraries -QT_TS = de fr zh_CN untranslated ar es iw ja_JP pl pt ru sk sl sv uk zh_TW da +QT_TS = ar da de es fr iw ja_JP pl pt ru sk sl sv uk zh_CN zh_TW ts-qt.commands = (cd $$QT_SOURCE_TREE/src && $$LUPDATE \ -I../include -I../include/Qt \ -- cgit v0.12 From 6ee282013b82b5f46fa972296b801eab55c614c1 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Wed, 23 Sep 2009 16:41:17 +0200 Subject: fix ts and qm targets for shadow builds and builds with -prefix --- tools/assistant/translations/qt_help.pro | 16 +++++++++------- tools/assistant/translations/translations.pro | 16 +++++++++------- tools/assistant/translations/translations_adp.pro | 14 ++++++++------ tools/designer/translations/translations.pro | 16 +++++++++------- tools/linguist/linguist/linguist.pro | 16 +++++++++------- tools/qtconfig/translations/translations.pro | 10 ++++++---- tools/qvfb/translations/translations.pro | 10 ++++++---- translations/translations.pri | 4 ++-- 8 files changed, 58 insertions(+), 44 deletions(-) diff --git a/tools/assistant/translations/qt_help.pro b/tools/assistant/translations/qt_help.pro index 7d92d06..69570d3 100644 --- a/tools/assistant/translations/qt_help.pro +++ b/tools/assistant/translations/qt_help.pro @@ -39,12 +39,14 @@ HEADERS += ../lib/qhelpcollectionhandler_p.h \ ../lib/qhelp_global.h -TRANSLATIONS=$$[QT_INSTALL_TRANSLATIONS]/qt_help_de.ts \ - $$[QT_INSTALL_TRANSLATIONS]/qt_help_ja.ts \ - $$[QT_INSTALL_TRANSLATIONS]/qt_help_pl.ts \ - $$[QT_INSTALL_TRANSLATIONS]/qt_help_ru.ts \ - $$[QT_INSTALL_TRANSLATIONS]/qt_help_zh_CN.ts \ - $$[QT_INSTALL_TRANSLATIONS]/qt_help_zh_TW.ts \ - $$[QT_INSTALL_TRANSLATIONS]/qt_help_da.ts +TR_DIR = $$PWD/../../../translations +TRANSLATIONS = \ + $$TR_DIR/qt_help_da.ts \ + $$TR_DIR/qt_help_de.ts + $$TR_DIR/qt_help_ja.ts \ + $$TR_DIR/qt_help_pl.ts \ + $$TR_DIR/qt_help_ru.ts \ + $$TR_DIR/qt_help_zh_CN.ts \ + $$TR_DIR/qt_help_zh_TW.ts error("This is a dummy profile to be used for translations ONLY.") diff --git a/tools/assistant/translations/translations.pro b/tools/assistant/translations/translations.pro index b3dbd10..6ff1fc9 100644 --- a/tools/assistant/translations/translations.pro +++ b/tools/assistant/translations/translations.pro @@ -40,10 +40,12 @@ HEADERS += ../tools/assistant/aboutdialog.h \ ../tools/assistant/searchwidget.h \ ../tools/assistant/topicchooser.h \ -TRANSLATIONS=$$[QT_INSTALL_TRANSLATIONS]/assistant_de.ts \ - $$[QT_INSTALL_TRANSLATIONS]/assistant_ja.ts \ - $$[QT_INSTALL_TRANSLATIONS]/assistant_pl.ts \ - $$[QT_INSTALL_TRANSLATIONS]/assistant_ru.ts \ - $$[QT_INSTALL_TRANSLATIONS]/assistant_zh_CN.ts \ - $$[QT_INSTALL_TRANSLATIONS]/assistant_zh_TW.ts \ - $$[QT_INSTALL_TRANSLATIONS]/assistant_da.ts +TR_DIR = $$PWD/../../../translations +TRANSLATIONS = \ + $$TR_DIR/assistant_da.ts \ + $$TR_DIR/assistant_de.ts \ + $$TR_DIR/assistant_ja.ts \ + $$TR_DIR/assistant_pl.ts \ + $$TR_DIR/assistant_ru.ts \ + $$TR_DIR/assistant_zh_CN.ts \ + $$TR_DIR/assistant_zh_TW.ts diff --git a/tools/assistant/translations/translations_adp.pro b/tools/assistant/translations/translations_adp.pro index 4ff6576..852bdeb 100644 --- a/tools/assistant/translations/translations_adp.pro +++ b/tools/assistant/translations/translations_adp.pro @@ -31,11 +31,13 @@ HEADERS += ../compat/helpwindow.h \ ../compat/fontsettingsdialog.h -TRANSLATIONS=$$[QT_INSTALL_TRANSLATIONS]/assistant_adp_de.ts \ - $$[QT_INSTALL_TRANSLATIONS]/assistant_adp_ja.ts \ - $$[QT_INSTALL_TRANSLATIONS]/assistant_adp_pl.ts \ - $$[QT_INSTALL_TRANSLATIONS]/assistant_adp_ru.ts \ - $$[QT_INSTALL_TRANSLATIONS]/assistant_adp_zh_CN.ts \ - $$[QT_INSTALL_TRANSLATIONS]/assistant_adp_zh_TW.ts +TR_DIR = $$PWD/../../../translations +TRANSLATIONS = \ + $$TR_DIR/assistant_adp_de.ts \ + $$TR_DIR/assistant_adp_ja.ts \ + $$TR_DIR/assistant_adp_pl.ts \ + $$TR_DIR/assistant_adp_ru.ts \ + $$TR_DIR/assistant_adp_zh_CN.ts \ + $$TR_DIR/assistant_adp_zh_TW.ts error("This is a dummy profile to be used for translations ONLY.") diff --git a/tools/designer/translations/translations.pro b/tools/designer/translations/translations.pro index 96d9074..a37918c 100644 --- a/tools/designer/translations/translations.pro +++ b/tools/designer/translations/translations.pro @@ -130,10 +130,12 @@ HEADERS += ../../shared/findwidget/abstractfindwidget.h \ ../../shared/findwidget/itemviewfindwidget.h \ ../../shared/findwidget/texteditfindwidget.h -TRANSLATIONS=$$[QT_INSTALL_TRANSLATIONS]/designer_de.ts \ - $$[QT_INSTALL_TRANSLATIONS]/designer_ja.ts \ - $$[QT_INSTALL_TRANSLATIONS]/designer_pl.ts \ - $$[QT_INSTALL_TRANSLATIONS]/designer_ru.ts \ - $$[QT_INSTALL_TRANSLATIONS]/designer_sl.ts \ - $$[QT_INSTALL_TRANSLATIONS]/designer_zh_CN.ts \ - $$[QT_INSTALL_TRANSLATIONS]/designer_zh_TW.ts +TR_DIR = $$PWD/../../../translations +TRANSLATIONS = \ + $$TR_DIR/designer_de.ts \ + $$TR_DIR/designer_ja.ts \ + $$TR_DIR/designer_pl.ts \ + $$TR_DIR/designer_ru.ts \ + $$TR_DIR/designer_sl.ts \ + $$TR_DIR/designer_zh_CN.ts \ + $$TR_DIR/designer_zh_TW.ts diff --git a/tools/linguist/linguist/linguist.pro b/tools/linguist/linguist/linguist.pro index c7f6f1c..c902aeb 100644 --- a/tools/linguist/linguist/linguist.pro +++ b/tools/linguist/linguist/linguist.pro @@ -95,10 +95,12 @@ FORMS += statistics.ui \ finddialog.ui RESOURCES += linguist.qrc -TRANSLATIONS=$$[QT_INSTALL_TRANSLATIONS]/linguist_ja.ts \ - $$[QT_INSTALL_TRANSLATIONS]/linguist_pl.ts \ - $$[QT_INSTALL_TRANSLATIONS]/linguist_ru.ts \ - $$[QT_INSTALL_TRANSLATIONS]/linguist_zh_CN.ts \ - $$[QT_INSTALL_TRANSLATIONS]/linguist_zh_TW.ts \ - $$[QT_INSTALL_TRANSLATIONS]/linguist_de.ts \ - $$[QT_INSTALL_TRANSLATIONS]/linguist_fr.ts +TR_DIR = $$PWD/../../../translations +TRANSLATIONS = \ + $$TR_DIR/linguist_de.ts \ + $$TR_DIR/linguist_fr.ts \ + $$TR_DIR/linguist_ja.ts \ + $$TR_DIR/linguist_pl.ts \ + $$TR_DIR/linguist_ru.ts \ + $$TR_DIR/linguist_zh_CN.ts \ + $$TR_DIR/linguist_zh_TW.ts diff --git a/tools/qtconfig/translations/translations.pro b/tools/qtconfig/translations/translations.pro index 51e96f0..bf8a1da 100644 --- a/tools/qtconfig/translations/translations.pro +++ b/tools/qtconfig/translations/translations.pro @@ -7,7 +7,9 @@ HEADERS += ../colorbutton.h ../previewframe.h ../previewwidget.h ../mainw FORMS = ../mainwindowbase.ui ../paletteeditoradvancedbase.ui ../previewwidgetbase.ui -TRANSLATIONS=$$[QT_INSTALL_TRANSLATIONS]/qtconfig_pl.ts \ - $$[QT_INSTALL_TRANSLATIONS]/qtconfig_ru.ts \ - $$[QT_INSTALL_TRANSLATIONS]/qtconfig_zh_CN.ts \ - $$[QT_INSTALL_TRANSLATIONS]/qtconfig_zh_TW.ts +TR_DIR = $$PWD/../../../translations +TRANSLATIONS = \ + $$TR_DIR/qtconfig_pl.ts \ + $$TR_DIR/qtconfig_ru.ts \ + $$TR_DIR/qtconfig_zh_CN.ts \ + $$TR_DIR/qtconfig_zh_TW.ts diff --git a/tools/qvfb/translations/translations.pro b/tools/qvfb/translations/translations.pro index 2f37b0e..ef42063 100644 --- a/tools/qvfb/translations/translations.pro +++ b/tools/qvfb/translations/translations.pro @@ -26,7 +26,9 @@ SOURCES = ../qvfb.cpp \ ../../../src/gui/embedded/qwssignalhandler.cpp \ ../../shared/deviceskin/deviceskin.cpp -TRANSLATIONS=$$[QT_INSTALL_TRANSLATIONS]/qvfb_pl.ts \ - $$[QT_INSTALL_TRANSLATIONS]/qvfb_ru.ts \ - $$[QT_INSTALL_TRANSLATIONS]/qvfb_zh_CN.ts \ - $$[QT_INSTALL_TRANSLATIONS]/qvfb_zh_TW.ts +TR_DIR = $$PWD/../../../translations +TRANSLATIONS = \ + $$TR_DIR/qvfb_pl.ts \ + $$TR_DIR/qvfb_ru.ts \ + $$TR_DIR/qvfb_zh_CN.ts \ + $$TR_DIR/qvfb_zh_TW.ts diff --git a/translations/translations.pri b/translations/translations.pri index f984e39..b7924cd 100644 --- a/translations/translations.pri +++ b/translations/translations.pri @@ -41,10 +41,10 @@ ts-qt.commands = (cd $$QT_SOURCE_TREE/src && $$LUPDATE \ svg \ xml \ xmlpatterns \ - -ts $$prependAll($$[QT_INSTALL_TRANSLATIONS]/qt_,$$QT_TS,.ts)) + -ts $$prependAll($$QT_SOURCE_TREE/translations/qt_,$$QT_TS,.ts)) ts-qt.depends = sub-tools -qm-qt.commands = $$LRELEASE $$prependAll($$[QT_INSTALL_TRANSLATIONS]/qt_,$$QT_TS,.ts) +qm-qt.commands = $$LRELEASE $$prependAll($$QT_SOURCE_TREE/translations/qt_,$$QT_TS,.ts) qm-qt.depends = sub-tools ###### Designer -- cgit v0.12 From ed6a2701320db60dd256df61a8030a867b917302 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Wed, 30 Sep 2009 16:37:55 +0200 Subject: Refactor retrieving the X11 visual for EGL We need this in qwindowsurface_gl.cpp. This patch was modified slightly by Tom, who stole it from another branch. :-) Reviewed-by: Gunnar --- src/opengl/qgl_x11egl.cpp | 158 ++++++++++++++++++++++++---------------------- 1 file changed, 84 insertions(+), 74 deletions(-) diff --git a/src/opengl/qgl_x11egl.cpp b/src/opengl/qgl_x11egl.cpp index d4bf4da..d802bdd 100644 --- a/src/opengl/qgl_x11egl.cpp +++ b/src/opengl/qgl_x11egl.cpp @@ -140,85 +140,36 @@ void QGLWidget::updateOverlayGL() //handle overlay } -void QGLWidget::setContext(QGLContext *context, const QGLContext* shareContext, bool deleteOldContext) +bool qt_egl_setup_x11_visual(XVisualInfo &vi, EGLDisplay display, EGLConfig config, const QX11Info &x11Info, bool useArgbVisual) { - Q_D(QGLWidget); - if (context == 0) { - qWarning("QGLWidget::setContext: Cannot set null context"); - return; - } - if (!context->deviceIsPixmap() && context->device() != this) { - qWarning("QGLWidget::setContext: Context must refer to this widget"); - return; - } - - if (d->glcx) - d->glcx->doneCurrent(); - QGLContext* oldcx = d->glcx; - d->glcx = context; - - if (parentWidget()) { - // force creation of delay-created widgets - parentWidget()->winId(); - if (parentWidget()->x11Info().screen() != x11Info().screen()) - d_func()->xinfo = parentWidget()->d_func()->xinfo; - } - - // If the application has set WA_TranslucentBackground and not explicitly set - // the alpha buffer size to zero, modify the format so it have an alpha channel - QGLFormat& fmt = d->glcx->d_func()->glFormat; - const bool useArgbVisual = testAttribute(Qt::WA_TranslucentBackground); - if (useArgbVisual && fmt.alphaBufferSize() == -1) - fmt.setAlphaBufferSize(1); - - bool createFailed = false; - if (!d->glcx->isValid()) { - if (!d->glcx->create(shareContext ? shareContext : oldcx)) - createFailed = true; - } - if (createFailed) { - if (deleteOldContext) - delete oldcx; - return; - } - - if (d->glcx->windowCreated() || d->glcx->deviceIsPixmap()) { - if (deleteOldContext) - delete oldcx; - return; - } + bool foundVisualIsArgb = useArgbVisual; - bool visible = isVisible(); - if (visible) - hide(); - - XVisualInfo vi; memset(&vi, 0, sizeof(XVisualInfo)); // Check to see if EGL is suggesting an appropriate visual id: EGLint nativeVisualId; - QEglContext* qeglCtx = d->glcx->d_func()->eglContext; - qeglCtx->configAttrib(EGL_NATIVE_VISUAL_ID, &nativeVisualId); + eglGetConfigAttrib(display, config, EGL_NATIVE_VISUAL_ID, &nativeVisualId); vi.visualid = nativeVisualId; if (vi.visualid) { // EGL has suggested a visual id, so get the rest of the visual info for that id: XVisualInfo *chosenVisualInfo; int matchingCount = 0; - chosenVisualInfo = XGetVisualInfo(x11Info().display(), VisualIDMask, &vi, &matchingCount); + chosenVisualInfo = XGetVisualInfo(x11Info.display(), VisualIDMask, &vi, &matchingCount); if (chosenVisualInfo) { #if !defined(QT_NO_XRENDER) if (useArgbVisual) { // Check to make sure the visual provided by EGL is ARGB XRenderPictFormat *format; - format = XRenderFindVisualFormat(x11Info().display(), chosenVisualInfo->visual); + format = XRenderFindVisualFormat(x11Info.display(), chosenVisualInfo->visual); if (format->type == PictTypeDirect && format->direct.alphaMask) { -// qDebug("Using opaque X Visual ID (%d) provided by EGL", (int)vi.visualid); +// qDebug("Using ARGB X Visual ID (%d) provided by EGL", (int)vi.visualid); + foundVisualIsArgb = true; vi = *chosenVisualInfo; } else { qWarning("Warning: EGL suggested using X visual ID %d for config %d, but this is not ARGB", - nativeVisualId, (int)qeglCtx->config()); + nativeVisualId, (int)config); vi.visualid = 0; } } else @@ -231,32 +182,32 @@ void QGLWidget::setContext(QGLContext *context, const QGLContext* shareContext, } else { qWarning("Warning: EGL suggested using X visual ID %d for config %d, but this seems to be invalid!", - nativeVisualId, (int)qeglCtx->config()); + nativeVisualId, (int)config); vi.visualid = 0; } } // If EGL does not know the visual ID, so try to select an appropriate one ourselves, first // using XRender if we're supposed to have an alpha, then falling back to XGetVisualInfo - - bool useArgb = context->format().alpha() && !context->deviceIsPixmap(); + #if !defined(QT_NO_XRENDER) - if (vi.visualid == 0 && useArgb) { + if (vi.visualid == 0 && useArgbVisual) { // Try to use XRender to find an ARGB visual we can use - vi.screen = x11Info().screen(); - vi.depth = 32; + vi.screen = x11Info.screen(); + vi.depth = 32; //### We might at some point (soon) get ARGB4444 vi.c_class = TrueColor; XVisualInfo *matchingVisuals; int matchingCount = 0; - matchingVisuals = XGetVisualInfo(x11Info().display(), + matchingVisuals = XGetVisualInfo(x11Info.display(), VisualScreenMask|VisualDepthMask|VisualClassMask, &vi, &matchingCount); for (int i = 0; i < matchingCount; ++i) { XRenderPictFormat *format; - format = XRenderFindVisualFormat(x11Info().display(), matchingVisuals[i].visual); + format = XRenderFindVisualFormat(x11Info.display(), matchingVisuals[i].visual); if (format->type == PictTypeDirect && format->direct.alphaMask) { vi = matchingVisuals[i]; + foundVisualIsArgb = true; // qDebug("Using X Visual ID (%d) for ARGB visual as provided by XRender", (int)vi.visualid); break; } @@ -267,17 +218,17 @@ void QGLWidget::setContext(QGLContext *context, const QGLContext* shareContext, if (vi.visualid == 0) { EGLint depth; - qeglCtx->configAttrib(EGL_BUFFER_SIZE, &depth); + eglGetConfigAttrib(display, config, EGL_BUFFER_SIZE, &depth); int err; - err = XMatchVisualInfo(x11Info().display(), x11Info().screen(), depth, TrueColor, &vi); + err = XMatchVisualInfo(x11Info.display(), x11Info.screen(), depth, TrueColor, &vi); if (err == 0) { qWarning("Warning: Can't find an X visual which matches the EGL config(%d)'s depth (%d)!", - (int)qeglCtx->config(), depth); - depth = x11Info().depth(); - err = XMatchVisualInfo(x11Info().display(), x11Info().screen(), depth, TrueColor, &vi); + (int)config, depth); + depth = x11Info.depth(); + err = XMatchVisualInfo(x11Info.display(), x11Info.screen(), depth, TrueColor, &vi); if (err == 0) { qWarning("Error: Couldn't get any matching X visual!"); - return; + return false; } else qWarning(" - Falling back to X11 suggested depth (%d)", depth); } @@ -285,8 +236,8 @@ void QGLWidget::setContext(QGLContext *context, const QGLContext* shareContext, // qDebug("Using X Visual ID (%d) for EGL provided depth (%d)", (int)vi.visualid, depth); // Don't try to use ARGB now unless the visual is 32-bit - even then it might stil fail :-( - if (useArgb) - useArgb = vi.depth == 32; + if (useArgbVisual) + foundVisualIsArgb = vi.depth == 32; //### We might at some point (soon) get ARGB4444 } // qDebug("Visual Info:"); @@ -299,6 +250,65 @@ void QGLWidget::setContext(QGLContext *context, const QGLContext* shareContext, // qDebug(" depth=%d", vi.depth); // qDebug(" screen=%d", vi.screen); // qDebug(" visualid=%d", vi.visualid); + return foundVisualIsArgb; +} + +void QGLWidget::setContext(QGLContext *context, const QGLContext* shareContext, bool deleteOldContext) +{ + Q_D(QGLWidget); + if (context == 0) { + qWarning("QGLWidget::setContext: Cannot set null context"); + return; + } + if (!context->deviceIsPixmap() && context->device() != this) { + qWarning("QGLWidget::setContext: Context must refer to this widget"); + return; + } + + if (d->glcx) + d->glcx->doneCurrent(); + QGLContext* oldcx = d->glcx; + d->glcx = context; + + if (parentWidget()) { + // force creation of delay-created widgets + parentWidget()->winId(); + if (parentWidget()->x11Info().screen() != x11Info().screen()) + d_func()->xinfo = parentWidget()->d_func()->xinfo; + } + + // If the application has set WA_TranslucentBackground and not explicitly set + // the alpha buffer size to zero, modify the format so it have an alpha channel + QGLFormat& fmt = d->glcx->d_func()->glFormat; + const bool tryArgbVisual = testAttribute(Qt::WA_TranslucentBackground); + if (tryArgbVisual && fmt.alphaBufferSize() == -1) + fmt.setAlphaBufferSize(1); + + bool createFailed = false; + if (!d->glcx->isValid()) { + if (!d->glcx->create(shareContext ? shareContext : oldcx)) + createFailed = true; + } + if (createFailed) { + if (deleteOldContext) + delete oldcx; + return; + } + + if (d->glcx->windowCreated() || d->glcx->deviceIsPixmap()) { + if (deleteOldContext) + delete oldcx; + return; + } + + bool visible = isVisible(); + if (visible) + hide(); + + XVisualInfo vi; + QEglContext *eglContext = d->glcx->d_func()->eglContext; + bool usingArgbVisual = qt_egl_setup_x11_visual(vi, eglContext->display(), eglContext->config(), + x11Info(), tryArgbVisual); XSetWindowAttributes a; @@ -311,7 +321,7 @@ void QGLWidget::setContext(QGLContext *context, const QGLContext* shareContext, a.border_pixel = colmap.pixel(Qt::black); unsigned int valueMask = CWBackPixel|CWBorderPixel; - if(useArgb) { + if (usingArgbVisual) { a.colormap = XCreateColormap(x11Info().display(), p, vi.visual, AllocNone); valueMask |= CWColormap; } -- cgit v0.12 From 2a54ab7fe6f3979a75154a02c0c810cf6cd28033 Mon Sep 17 00:00:00 2001 From: Tom Cooksey Date: Thu, 1 Oct 2009 18:01:20 +0200 Subject: Fix BadDrawable errors when re-parenting a QGLWidget on X11/EGL It's actually not really reparenting, but calling setWindowFlags which triggered the errors. But setWindowFlags causes a re-parent. The context isn't really the right please to free the surface, but fixing that is a much more intrusive change. Reviewed-By: TrustMe --- src/opengl/qgl_egl.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/opengl/qgl_egl.cpp b/src/opengl/qgl_egl.cpp index 6c93bea..fa876c7 100644 --- a/src/opengl/qgl_egl.cpp +++ b/src/opengl/qgl_egl.cpp @@ -142,8 +142,19 @@ void QGLContext::reset() d->cleanup(); doneCurrent(); if (d->eglContext) { - if (d->eglSurface != EGL_NO_SURFACE) - eglDestroySurface(d->eglContext->display(), d->eglSurface); + if (d->eglSurface != EGL_NO_SURFACE) { +#ifdef Q_WS_X11 + // Make sure we don't call eglDestroySurface on a surface which + // was created for a different winId: + if (d->paintDevice->devType() == QInternal::Widget) { + QGLWidget* w = static_cast(d->paintDevice); + + if (w->d_func()->eglSurfaceWindowId == w->winId()) + eglDestroySurface(d->eglContext->display(), d->eglSurface); + } else +#endif + eglDestroySurface(d->eglContext->display(), d->eglSurface); + } delete d->eglContext; } d->eglContext = 0; -- cgit v0.12 From 712eece4e399fe5ca916ecf7b6d77fdddddbf7fe Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Thu, 1 Oct 2009 16:59:28 +0000 Subject: Make Software Input Panel requests work with QGraphicsWebView _and_ QWebView by sharing the event code in handleSoftwareInputPanel(). MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Patch by Simon Hausmann on 2009-10-01 Reviewed by Tor Arne Vestbø. * Api/qwebpage.cpp: (QWebPagePrivate::mouseReleaseEvent): (QWebPagePrivate::handleSoftwareInputPanel): * Api/qwebpage_p.h: git-svn-id: http://svn.webkit.org/repository/webkit/trunk@48977 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp | 7 ++++++- src/3rdparty/webkit/WebKit/qt/Api/qwebpage_p.h | 1 + src/3rdparty/webkit/WebKit/qt/ChangeLog | 12 ++++++++++++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp index d1a4059..942c3ea 100644 --- a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp +++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp @@ -764,10 +764,14 @@ void QWebPagePrivate::mouseReleaseEvent(QGraphicsSceneMouseEvent* ev) ev->setAccepted(accepted); handleClipboard(ev, ev->button()); + handleSoftwareInputPanel(ev->button()); +} +void QWebPagePrivate::handleSoftwareInputPanel(Qt::MouseButton button) +{ #if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0) if (view && view->testAttribute(Qt::WA_InputMethodEnabled) - && ev->button() == Qt::LeftButton && qApp->autoSipEnabled()) { + && button == Qt::LeftButton && qApp->autoSipEnabled()) { QStyle::RequestSoftwareInputPanel behavior = QStyle::RequestSoftwareInputPanel( view->style()->styleHint(QStyle::SH_RequestSoftwareInputPanel)); if (!clickCausedFocus || behavior == QStyle::RSIP_OnMouseClick) { @@ -794,6 +798,7 @@ void QWebPagePrivate::mouseReleaseEvent(QMouseEvent *ev) ev->setAccepted(accepted); handleClipboard(ev, ev->button()); + handleSoftwareInputPanel(ev->button()); } #ifndef QT_NO_CONTEXTMENU diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage_p.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage_p.h index d41471a..b9571fa 100644 --- a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage_p.h +++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage_p.h @@ -111,6 +111,7 @@ public: void shortcutOverrideEvent(QKeyEvent*); void leaveEvent(QEvent*); void handleClipboard(QEvent*, Qt::MouseButton); + void handleSoftwareInputPanel(Qt::MouseButton); bool handleScrolling(QKeyEvent*, WebCore::Frame*); void setInspector(QWebInspector*); diff --git a/src/3rdparty/webkit/WebKit/qt/ChangeLog b/src/3rdparty/webkit/WebKit/qt/ChangeLog index 8b9b14f..fd2768c 100644 --- a/src/3rdparty/webkit/WebKit/qt/ChangeLog +++ b/src/3rdparty/webkit/WebKit/qt/ChangeLog @@ -1,3 +1,15 @@ +2009-10-01 Simon Hausmann + + Reviewed by Tor Arne Vestbø. + + Make Software Input Panel requests work with QGraphicsWebView + _and_ QWebView by sharing the event code in handleSoftwareInputPanel(). + + * Api/qwebpage.cpp: + (QWebPagePrivate::mouseReleaseEvent): + (QWebPagePrivate::handleSoftwareInputPanel): + * Api/qwebpage_p.h: + 2009-10-01 Kristian Amlie Reviewed by Simon Hausmann. -- cgit v0.12 From 5892406fe5e04f363aed3f5f903d8da601c9cf56 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 1 Oct 2009 19:14:31 +0200 Subject: =?UTF-8?q?unscrew=20line=20numbers=20...=20again.=20!@=C2=A7$#%?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../linguist/lupdate/testdata/good/merge_ordering/project.ts.result | 2 +- tests/auto/linguist/lupdate/testdata/good/mergeui/project.ts.before | 6 +++--- tests/auto/linguist/lupdate/testdata/good/mergeui/project.ts.result | 6 +++--- .../lupdate/testdata/good/multiple_locations/project.ts.result | 6 +++--- .../linguist/lupdate/testdata/good/namespaces/project.ts.result | 2 +- tests/auto/linguist/lupdate/testdata/good/parseui/project.ts.result | 4 ++-- tests/auto/linguist/lupdate/testdata/good/prefix/project.ts.result | 6 +++--- 7 files changed, 16 insertions(+), 16 deletions(-) diff --git a/tests/auto/linguist/lupdate/testdata/good/merge_ordering/project.ts.result b/tests/auto/linguist/lupdate/testdata/good/merge_ordering/project.ts.result index 5104860..4fe1e37 100644 --- a/tests/auto/linguist/lupdate/testdata/good/merge_ordering/project.ts.result +++ b/tests/auto/linguist/lupdate/testdata/good/merge_ordering/project.ts.result @@ -4,7 +4,7 @@ Foo - + This is the first entry. diff --git a/tests/auto/linguist/lupdate/testdata/good/mergeui/project.ts.before b/tests/auto/linguist/lupdate/testdata/good/mergeui/project.ts.before index e297784..1602dcc 100644 --- a/tests/auto/linguist/lupdate/testdata/good/mergeui/project.ts.before +++ b/tests/auto/linguist/lupdate/testdata/good/mergeui/project.ts.before @@ -3,18 +3,18 @@ FindDialog - + Qt Assistant - Find text Qt Assistant - Finn tekst - + 300px 300px - + 400px diff --git a/tests/auto/linguist/lupdate/testdata/good/mergeui/project.ts.result b/tests/auto/linguist/lupdate/testdata/good/mergeui/project.ts.result index b21f583..a56a547 100644 --- a/tests/auto/linguist/lupdate/testdata/good/mergeui/project.ts.result +++ b/tests/auto/linguist/lupdate/testdata/good/mergeui/project.ts.result @@ -4,18 +4,18 @@ FindDialog - + Qt Assistant - Find Text Qt Assistant - Find text Qt Assistant - Finn tekst - + 300px 300px - + 401 pixels diff --git a/tests/auto/linguist/lupdate/testdata/good/multiple_locations/project.ts.result b/tests/auto/linguist/lupdate/testdata/good/multiple_locations/project.ts.result index ec1f02f..a7ae155 100644 --- a/tests/auto/linguist/lupdate/testdata/good/multiple_locations/project.ts.result +++ b/tests/auto/linguist/lupdate/testdata/good/multiple_locations/project.ts.result @@ -4,9 +4,9 @@ context - - - + + + just a message This is one comment ---------- diff --git a/tests/auto/linguist/lupdate/testdata/good/namespaces/project.ts.result b/tests/auto/linguist/lupdate/testdata/good/namespaces/project.ts.result index bb5b739..c1a34bd 100644 --- a/tests/auto/linguist/lupdate/testdata/good/namespaces/project.ts.result +++ b/tests/auto/linguist/lupdate/testdata/good/namespaces/project.ts.result @@ -30,7 +30,7 @@ Outer::Middle1::Different - different namespaced class def diff --git a/tests/auto/linguist/lupdate/testdata/good/parseui/project.ts.result b/tests/auto/linguist/lupdate/testdata/good/parseui/project.ts.result index ddf58c3..b27d239 100644 --- a/tests/auto/linguist/lupdate/testdata/good/parseui/project.ts.result +++ b/tests/auto/linguist/lupdate/testdata/good/parseui/project.ts.result @@ -4,12 +4,12 @@ FindDialog - + Qt Assistant - Finn text - + Finn tekst - Der Bjørn möchte auch mal. diff --git a/tests/auto/linguist/lupdate/testdata/good/prefix/project.ts.result b/tests/auto/linguist/lupdate/testdata/good/prefix/project.ts.result index c15b986..e356921 100644 --- a/tests/auto/linguist/lupdate/testdata/good/prefix/project.ts.result +++ b/tests/auto/linguist/lupdate/testdata/good/prefix/project.ts.result @@ -4,18 +4,18 @@ Foo - + XXX YYY - + CTOR - + BAR -- cgit v0.12 From 3c2d0a7812a7add0aa954657356ecce136ad6f42 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 1 Oct 2009 19:14:31 +0200 Subject: don't ignore first character in each .java file backport of 59aa130bb9209aa1809c7bd31f694265eeb1baf1 --- tools/linguist/shared/java.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/linguist/shared/java.cpp b/tools/linguist/shared/java.cpp index be34d20..109650c 100644 --- a/tools/linguist/shared/java.cpp +++ b/tools/linguist/shared/java.cpp @@ -634,7 +634,6 @@ bool loadJava(Translator &translator, QIODevice &dev, ConversionData &cd) yyFileName = cd.m_sourceFileName; yyCurLineNo = 1; yyParenLineNo = 1; - yyCh = getChar(); parse(&translator); -- cgit v0.12 From b75057bf8943ff67d566132587c8db3941a9cf47 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Thu, 1 Oct 2009 22:08:26 +0200 Subject: Test stabilisation on X11 for the Q3Table one, it sometimes fail with XPASS. There is no point trying to stabilize a failure on a test for a class we are not likely to touch anyway. --- tests/auto/q3table/tst_q3table.cpp | 2 +- tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp | 2 +- .../qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp | 1 + tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp | 1 + tests/auto/qgridlayout/tst_qgridlayout.cpp | 2 +- tests/auto/qmessagebox/tst_qmessagebox.cpp | 4 ++-- tests/auto/qwidget/tst_qwidget.cpp | 18 +++++++++++------- 7 files changed, 18 insertions(+), 12 deletions(-) diff --git a/tests/auto/q3table/tst_q3table.cpp b/tests/auto/q3table/tst_q3table.cpp index 770bf4d..bffb118 100644 --- a/tests/auto/q3table/tst_q3table.cpp +++ b/tests/auto/q3table/tst_q3table.cpp @@ -1200,7 +1200,7 @@ protected: void tst_Q3Table::editCheck() { // Test for task 28086 -#if 0 +#if 1 QSKIP("This test currently fails on all versions", SkipAll); #endif diff --git a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp index 20dc0a4..21f6269 100644 --- a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp +++ b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp @@ -3017,7 +3017,7 @@ void tst_QGraphicsItem::hoverEventsGenerateRepaints() QGraphicsView view(&scene); view.show(); QTest::qWaitForWindowShown(&view); - QTest::qWait(100); + QTest::qWait(150); EventTester *tester = new EventTester; scene.addItem(tester); diff --git a/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp b/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp index e70d286..f0ed008 100644 --- a/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp +++ b/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp @@ -1303,6 +1303,7 @@ void tst_QGraphicsProxyWidget::paintEvent() //make sure we flush all the paint events QTest::qWait(70); QTRY_VERIFY(proxy.paintCount > 1); + QTest::qWait(70); proxy.paintCount = 0; w->update(); diff --git a/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp b/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp index 90477f0..a76e607 100644 --- a/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp +++ b/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp @@ -1633,6 +1633,7 @@ void tst_QGraphicsScene::hoverEvents_siblings() #endif qApp->setActiveWindow(&view); view.activateWindow(); + QTest::qWait(70); QCursor::setPos(view.mapToGlobal(QPoint(-5, -5))); diff --git a/tests/auto/qgridlayout/tst_qgridlayout.cpp b/tests/auto/qgridlayout/tst_qgridlayout.cpp index 4a5a341..3c7e1fb 100644 --- a/tests/auto/qgridlayout/tst_qgridlayout.cpp +++ b/tests/auto/qgridlayout/tst_qgridlayout.cpp @@ -921,7 +921,7 @@ void tst_QGridLayout::minMaxSize() #endif QTest::qWait(20); m_toplevel->adjustSize(); - QTest::qWait(20); // wait for the implicit adjustSize + QTest::qWait(120); // wait for the implicit adjustSize // If the following fails we might have to wait longer. // If that does not help there is likely a problem with the implicit adjustSize in show() if (!fixedSize.isValid()) { diff --git a/tests/auto/qmessagebox/tst_qmessagebox.cpp b/tests/auto/qmessagebox/tst_qmessagebox.cpp index 12858d7..1f8e925 100644 --- a/tests/auto/qmessagebox/tst_qmessagebox.cpp +++ b/tests/auto/qmessagebox/tst_qmessagebox.cpp @@ -714,8 +714,8 @@ void tst_QMessageBox::setInformativeText() msgbox.setInformativeText(itext); msgbox.show(); QCOMPARE(msgbox.informativeText(), itext); - QVERIFY2(msgbox.width() > 200, //verify it's big enough (task181688) - qPrintable(QString("%1 > 200").arg(msgbox.width()))); + QVERIFY2(msgbox.width() > 190, //verify it's big enough (task181688) + qPrintable(QString("%1 > 190").arg(msgbox.width()))); } void tst_QMessageBox::iconPixmap() diff --git a/tests/auto/qwidget/tst_qwidget.cpp b/tests/auto/qwidget/tst_qwidget.cpp index 22aedc5..a9033ba 100644 --- a/tests/auto/qwidget/tst_qwidget.cpp +++ b/tests/auto/qwidget/tst_qwidget.cpp @@ -3118,7 +3118,7 @@ void tst_QWidget::saveRestoreGeometry() widget.resize(size); widget.show(); QTest::qWaitForWindowShown(&widget); - QTest::qWait(200); + QTest::qWait(500); QTRY_COMPARE(widget.geometry().size(), size); QRect geom; @@ -3138,7 +3138,7 @@ void tst_QWidget::saveRestoreGeometry() widget.setWindowState(widget.windowState() | Qt::WindowFullScreen); QTest::qWait(120); QTRY_VERIFY((widget.windowState() & Qt::WindowFullScreen)); - QTest::qWait(400); + QTest::qWait(500); savedGeometry = widget.saveGeometry(); geom = widget.geometry(); widget.setWindowState(widget.windowState() ^ Qt::WindowFullScreen); @@ -3160,14 +3160,14 @@ void tst_QWidget::saveRestoreGeometry() widget.resize(size); QTest::qWait(10); QTRY_COMPARE(widget.size(), size); - QTest::qWait(400); + QTest::qWait(500); savedGeometry = widget.saveGeometry(); geom = widget.geometry(); widget.setWindowState(widget.windowState() | Qt::WindowMaximized); QTest::qWait(120); QTRY_VERIFY((widget.windowState() & Qt::WindowMaximized)); QTRY_VERIFY(widget.geometry() != geom); - QTest::qWait(400); + QTest::qWait(500); QVERIFY(widget.restoreGeometry(savedGeometry)); QTest::qWait(120); QTRY_COMPARE(widget.geometry(), geom); @@ -3178,13 +3178,13 @@ void tst_QWidget::saveRestoreGeometry() widget.setWindowState(widget.windowState() | Qt::WindowMaximized); QTest::qWait(120); QTRY_VERIFY((widget.windowState() & Qt::WindowMaximized)); - QTest::qWait(400); + QTest::qWait(500); geom = widget.geometry(); savedGeometry = widget.saveGeometry(); widget.setWindowState(widget.windowState() ^ Qt::WindowMaximized); QTest::qWait(120); QTRY_VERIFY(!(widget.windowState() & Qt::WindowMaximized)); - QTest::qWait(400); + QTest::qWait(500); QVERIFY(widget.restoreGeometry(savedGeometry)); QTest::qWait(120); QTRY_VERIFY((widget.windowState() & Qt::WindowMaximized)); @@ -6507,7 +6507,7 @@ void tst_QWidget::renderInvisible() dummyFocusWidget.show(); QTest::qWaitForWindowShown(&dummyFocusWidget); qApp->processEvents(); - QTest::qWait(100); + QTest::qWait(120); // Create normal reference image. const QSize calendarSize = calendar->size(); @@ -6522,6 +6522,7 @@ void tst_QWidget::renderInvisible() const QSize calendarSizeResized = calendar->size() + QSize(50, 50); calendar->resize(calendarSizeResized); qApp->processEvents(); + QTest::qWait(30); QImage referenceImageResized(calendarSizeResized, QImage::Format_ARGB32); calendar->render(&referenceImageResized); #ifdef RENDER_DEBUG @@ -6532,6 +6533,7 @@ void tst_QWidget::renderInvisible() // Explicitly hide the calendar. calendar->hide(); qApp->processEvents(); + QTest::qWait(30); workaroundPaletteIssue(calendar); { // Make sure we get the same image when the calendar is explicitly hidden. @@ -6562,6 +6564,7 @@ void tst_QWidget::renderInvisible() calendar->hide(); qApp->processEvents(); + QTest::qWait(30); { // Calendar explicitly hidden. QImage testImage(calendarSize, QImage::Format_ARGB32); @@ -6629,6 +6632,7 @@ void tst_QWidget::renderInvisible() // Navigation bar isn't explicitly hidden anymore. navigationBar->show(); qApp->processEvents(); + QTest::qWait(30); QVERIFY(!calendar->isVisible()); // Now, completely mess up the layout. This will trigger an update on the layout -- cgit v0.12 From a94e9c5022076a97e796a984527ed1935c0803d0 Mon Sep 17 00:00:00 2001 From: Rhys Weatherley Date: Fri, 2 Oct 2009 08:37:48 +1000 Subject: Add "opengl2" as an option for creating an OpenGL graphics system Reviewed-by: trustme --- src/plugins/graphicssystems/opengl/main.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/plugins/graphicssystems/opengl/main.cpp b/src/plugins/graphicssystems/opengl/main.cpp index c28b09a..6216ada 100644 --- a/src/plugins/graphicssystems/opengl/main.cpp +++ b/src/plugins/graphicssystems/opengl/main.cpp @@ -56,6 +56,9 @@ QStringList QGLGraphicsSystemPlugin::keys() const { QStringList list; list << QLatin1String("OpenGL") << QLatin1String("OpenGL1"); +#if !defined(QT_OPENGL_ES_1) && !defined(QT_OPENGL_ES_1_CL) + list << QLatin1String("OpenGL2"); +#endif return list; } @@ -66,6 +69,13 @@ QGraphicsSystem* QGLGraphicsSystemPlugin::create(const QString& system) return new QGLGraphicsSystem; } +#if !defined(QT_OPENGL_ES_1) && !defined(QT_OPENGL_ES_1_CL) + if (system.toLower() == QLatin1String("opengl2")) { + QGL::setPreferredPaintEngine(QPaintEngine::OpenGL2); + return new QGLGraphicsSystem; + } +#endif + if (system.toLower() == QLatin1String("opengl")) return new QGLGraphicsSystem; -- cgit v0.12 From 99b5a05cf2a83cceb361e510e935902a943885f8 Mon Sep 17 00:00:00 2001 From: Rhys Weatherley Date: Fri, 2 Oct 2009 08:55:46 +1000 Subject: Remove unnecessary function definition: qt_qgl_egl_display() The qt_qgl_egl_display() function no longer exists. Reviewed-by: trustme --- src/opengl/qgl_p.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/opengl/qgl_p.h b/src/opengl/qgl_p.h index 9b09c7c..6b7e892 100644 --- a/src/opengl/qgl_p.h +++ b/src/opengl/qgl_p.h @@ -490,8 +490,6 @@ private: #ifdef Q_WS_QWS extern QPaintEngine* qt_qgl_paint_engine(); - -extern EGLDisplay qt_qgl_egl_display(); #endif bool qt_gl_preferGL2Engine(); -- cgit v0.12 From 6ca9ba3b67695e18c1c57176d5d8849547517199 Mon Sep 17 00:00:00 2001 From: Rhys Weatherley Date: Fri, 2 Oct 2009 10:23:46 +1000 Subject: Remove unnecessary reference to QGLContextGroup::extensionFuncs() Reviewed-by: Andrew den Exter --- src/opengl/qgl_p.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/opengl/qgl_p.h b/src/opengl/qgl_p.h index 6b7e892..991c948 100644 --- a/src/opengl/qgl_p.h +++ b/src/opengl/qgl_p.h @@ -343,13 +343,11 @@ public: #ifdef Q_WS_WIN static inline QGLExtensionFuncs& extensionFuncs(const QGLContext *ctx) { return ctx->d_ptr->group->extensionFuncs(); } - static inline QGLExtensionFuncs& extensionFuncs(QGLContextGroup *ctx) { return ctx->extensionFuncs(); } #endif #if defined(Q_WS_X11) || defined(Q_WS_MAC) || defined(Q_WS_QWS) static QGLExtensionFuncs qt_extensionFuncs; static inline QGLExtensionFuncs& extensionFuncs(const QGLContext *) { return qt_extensionFuncs; } - static inline QGLExtensionFuncs& extensionFuncs(QGLContextGroup *) { return qt_extensionFuncs; } #endif static void setCurrentContext(QGLContext *context); -- cgit v0.12 From 53b3a0572242d0a425e74848afba1293f195d29b Mon Sep 17 00:00:00 2001 From: Rhys Weatherley Date: Fri, 2 Oct 2009 10:31:39 +1000 Subject: Fix support for 32-bit PowerVR screens with QGraphicsView When QGLWidget was used as a viewport for QGraphicsView, it was still treating the window surface as RGB16. Use the screen's actual pixel format. Also ensure that PvrEglWindowSurface::image() returns a non-null QImage if the drawable hasn't been created yet. Reviewed-by: trustme --- .../gfxdrivers/powervr/pvreglscreen/pvreglwindowsurface.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglwindowsurface.cpp b/src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglwindowsurface.cpp index 3698afd..afee77e 100644 --- a/src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglwindowsurface.cpp +++ b/src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglwindowsurface.cpp @@ -157,18 +157,21 @@ QImage PvrEglWindowSurface::image() const void *data = pvrQwsGetRenderBuffer(drawable); if (data) { return QImage((uchar *)data, pvrRect.width, pvrRect.height, - pvrQwsGetStride(drawable), QImage::Format_RGB16); + pvrQwsGetStride(drawable), screen->pixelFormat()); } } - return QImage(); + return QImage(16, 16, screen->pixelFormat()); } QPaintDevice *PvrEglWindowSurface::paintDevice() { - // Return a dummy paint device because the widget itself - // cannot be painted to this way. + QGLWidget *glWidget = qobject_cast(window()); + if (glWidget) + return glWidget; + + // Should be a QGLWidget, but if not return a dummy paint device. if (!pdevice) - pdevice = new QImage(50, 50, QImage::Format_RGB16); + pdevice = new QImage(50, 50, screen->pixelFormat()); return pdevice; } -- cgit v0.12 From ad90350d0ba3971591554f871ec17544be414038 Mon Sep 17 00:00:00 2001 From: Rhys Weatherley Date: Fri, 2 Oct 2009 11:38:10 +1000 Subject: Remove QHash overhead from QGLShareRegister Move the list of shared contexts from QGLShareRegister into QGLContextGroup. There is then no need for the QHash. Reviewed-by: trustme --- src/opengl/qgl.cpp | 40 ++++++++++++++++++---------------------- src/opengl/qgl_p.h | 8 ++------ 2 files changed, 20 insertions(+), 28 deletions(-) diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp index 665290c..0402268 100644 --- a/src/opengl/qgl.cpp +++ b/src/opengl/qgl.cpp @@ -4860,44 +4860,40 @@ void QGLShareRegister::addShare(const QGLContext *context, const QGLContext *sha return; // Make sure 'context' is not already shared with another group of contexts. - Q_ASSERT(reg.find(context->d_ptr->group) == reg.end()); Q_ASSERT(context->d_ptr->group->m_refs == 1); // Free 'context' group resources and make it use the same resources as 'share'. + QGLContextGroup *group = share->d_ptr->group; delete context->d_ptr->group; - context->d_ptr->group = share->d_ptr->group; - context->d_ptr->group->m_refs.ref(); + context->d_ptr->group = group; + group->m_refs.ref(); // Maintain a list of all the contexts in each group of sharing contexts. - SharingHash::iterator it = reg.find(share->d_ptr->group); - if (it == reg.end()) - it = reg.insert(share->d_ptr->group, ContextList() << share); - it.value() << context; + // The list is empty if the "share" context wasn't sharing already. + if (group->m_shares.isEmpty()) + group->m_shares.append(share); + group->m_shares.append(context); } QList QGLShareRegister::shares(const QGLContext *context) { - SharingHash::const_iterator it = reg.find(context->d_ptr->group); - if (it == reg.end()) - return ContextList(); - return it.value(); + return context->d_ptr->group->m_shares; } void QGLShareRegister::removeShare(const QGLContext *context) { - SharingHash::iterator it = reg.find(context->d_ptr->group); - if (it == reg.end()) + // Remove the context from the group. + QGLContextGroup *group = context->d_ptr->group; + if (group->m_shares.isEmpty()) return; - - int count = it.value().removeAll(context); - Q_ASSERT(count == 1); - Q_UNUSED(count); + group->m_shares.removeAll(context); // Update context group representative. - if (context->d_ptr->group->m_context == context) - context->d_ptr->group->m_context = it.value().first(); + Q_ASSERT(group->m_shares.size() != 0); + if (group->m_context == context) + group->m_context = group->m_shares[0]; - Q_ASSERT(it.value().size() != 0); - if (it.value().size() == 1) - reg.erase(it); + // If there is only one context left, then make the list empty. + if (group->m_shares.size() == 1) + group->m_shares.clear(); } QGLContextResource::QGLContextResource(FreeFunc f, QObject *parent) diff --git a/src/opengl/qgl_p.h b/src/opengl/qgl_p.h index 991c948..1957429 100644 --- a/src/opengl/qgl_p.h +++ b/src/opengl/qgl_p.h @@ -233,6 +233,7 @@ private: QGLExtensionFuncs m_extensionFuncs; const QGLContext *m_context; // context group's representative + QList m_shares; QAtomicInt m_refs; friend class QGLShareRegister; @@ -401,16 +402,11 @@ class Q_AUTOTEST_EXPORT QGLShareRegister { public: QGLShareRegister() {} - ~QGLShareRegister() { reg.clear(); } + ~QGLShareRegister() {} void addShare(const QGLContext *context, const QGLContext *share); QList shares(const QGLContext *context); void removeShare(const QGLContext *context); -private: - // Use a context's 'group' pointer to uniquely identify a group. - typedef QList ContextList; - typedef QHash SharingHash; - SharingHash reg; }; extern Q_OPENGL_EXPORT QGLShareRegister* qgl_share_reg(); -- cgit v0.12 From 5d94ce44f19316ce1c30c23635bf9575d80aa4e2 Mon Sep 17 00:00:00 2001 From: Kurt Korbatits Date: Fri, 2 Oct 2009 14:45:05 +1000 Subject: Fixed logic in clock() function of audio class's. - clock() should return valid value except in stop state, return 0. - Added clock() function testing to unit tests. Reviewed-by:Justin McPherson --- src/multimedia/audio/qaudioinput_alsa_p.cpp | 2 +- src/multimedia/audio/qaudioinput_mac_p.cpp | 3 +++ src/multimedia/audio/qaudioinput_win32_p.cpp | 2 +- src/multimedia/audio/qaudiooutput_alsa_p.cpp | 2 +- src/multimedia/audio/qaudiooutput_mac_p.cpp | 3 +++ src/multimedia/audio/qaudiooutput_win32_p.cpp | 2 +- tests/auto/qaudioinput/tst_qaudioinput.cpp | 3 +++ tests/auto/qaudiooutput/tst_qaudiooutput.cpp | 3 +++ 8 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/multimedia/audio/qaudioinput_alsa_p.cpp b/src/multimedia/audio/qaudioinput_alsa_p.cpp index 46c4392..5e9aa81 100644 --- a/src/multimedia/audio/qaudioinput_alsa_p.cpp +++ b/src/multimedia/audio/qaudioinput_alsa_p.cpp @@ -598,7 +598,7 @@ qint64 QAudioInputPrivate::clock() const if(!handle) return 0; - if(deviceState != QAudio::ActiveState) + if (deviceState == QAudio::StopState) return 0; snd_pcm_status_t* status; diff --git a/src/multimedia/audio/qaudioinput_mac_p.cpp b/src/multimedia/audio/qaudioinput_mac_p.cpp index 07fa3f4..cb05920 100644 --- a/src/multimedia/audio/qaudioinput_mac_p.cpp +++ b/src/multimedia/audio/qaudioinput_mac_p.cpp @@ -819,6 +819,9 @@ qint64 QAudioInputPrivate::totalTime() const qint64 QAudioInputPrivate::clock() const { + if (stateCode == QAudio::StopState) + return 0; + return (AudioGetCurrentHostTime() - startTime) / (clockFrequency / 1000); } diff --git a/src/multimedia/audio/qaudioinput_win32_p.cpp b/src/multimedia/audio/qaudioinput_win32_p.cpp index d4226f5..b6b1efe 100644 --- a/src/multimedia/audio/qaudioinput_win32_p.cpp +++ b/src/multimedia/audio/qaudioinput_win32_p.cpp @@ -541,7 +541,7 @@ bool QAudioInputPrivate::deviceReady() qint64 QAudioInputPrivate::clock() const { - if(deviceState != QAudio::ActiveState) + if (deviceState == QAudio::StopState) return 0; return timeStampOpened.elapsed(); diff --git a/src/multimedia/audio/qaudiooutput_alsa_p.cpp b/src/multimedia/audio/qaudiooutput_alsa_p.cpp index 0d37d61..d814d97 100644 --- a/src/multimedia/audio/qaudiooutput_alsa_p.cpp +++ b/src/multimedia/audio/qaudiooutput_alsa_p.cpp @@ -650,7 +650,7 @@ qint64 QAudioOutputPrivate::clock() const if(!handle) return 0; - if(deviceState != QAudio::ActiveState) + if (deviceState == QAudio::StopState) return 0; snd_pcm_status_t* status; diff --git a/src/multimedia/audio/qaudiooutput_mac_p.cpp b/src/multimedia/audio/qaudiooutput_mac_p.cpp index 4364704..f23db80 100644 --- a/src/multimedia/audio/qaudiooutput_mac_p.cpp +++ b/src/multimedia/audio/qaudiooutput_mac_p.cpp @@ -551,6 +551,9 @@ qint64 QAudioOutputPrivate::totalTime() const qint64 QAudioOutputPrivate::clock() const { + if (stateCode == QAudio::StopState) + return 0; + return (AudioGetCurrentHostTime() - startTime) / (clockFrequency / 1000); } diff --git a/src/multimedia/audio/qaudiooutput_win32_p.cpp b/src/multimedia/audio/qaudiooutput_win32_p.cpp index bb61f41..ef4bf0e 100644 --- a/src/multimedia/audio/qaudiooutput_win32_p.cpp +++ b/src/multimedia/audio/qaudiooutput_win32_p.cpp @@ -492,7 +492,7 @@ bool QAudioOutputPrivate::deviceReady() qint64 QAudioOutputPrivate::clock() const { - if(deviceState != QAudio::ActiveState) + if (deviceState == QAudio::StopState) return 0; return timeStampOpened.elapsed(); diff --git a/tests/auto/qaudioinput/tst_qaudioinput.cpp b/tests/auto/qaudioinput/tst_qaudioinput.cpp index 69b507d..3945364 100644 --- a/tests/auto/qaudioinput/tst_qaudioinput.cpp +++ b/tests/auto/qaudioinput/tst_qaudioinput.cpp @@ -139,12 +139,14 @@ void tst_QAudioInput::pullFile() // Always have default states, before start QVERIFY(audio->state() == QAudio::StopState); QVERIFY(audio->error() == QAudio::NoError); + QVERIFY(audio->clock() == 0); audio->start(&filename); QTest::qWait(20); // Check state and periodSize() are valid non-zero values. QVERIFY(audio->state() == QAudio::ActiveState); QVERIFY(audio->error() == QAudio::NoError); + QVERIFY(audio->clock() > 0); QVERIFY(audio->periodSize() > 0); QVERIFY(stateSignal.count() == 1); // State changed to QAudio::ActiveState @@ -157,6 +159,7 @@ void tst_QAudioInput::pullFile() audio->stop(); QTest::qWait(20); QVERIFY(audio->state() == QAudio::StopState); + QVERIFY(audio->clock() == 0); // Can only check to make sure we got at least 1 more signal, but can be more. QVERIFY(stateSignal.count() > 1); diff --git a/tests/auto/qaudiooutput/tst_qaudiooutput.cpp b/tests/auto/qaudiooutput/tst_qaudiooutput.cpp index f1c75dc..b90873e 100644 --- a/tests/auto/qaudiooutput/tst_qaudiooutput.cpp +++ b/tests/auto/qaudiooutput/tst_qaudiooutput.cpp @@ -142,6 +142,7 @@ void tst_QAudioOutput::pullFile() // Always have default states, before start QVERIFY(audio->state() == QAudio::StopState); QVERIFY(audio->error() == QAudio::NoError); + QVERIFY(audio->clock() == 0); audio->start(&file); QTest::qWait(20); // wait 20ms @@ -149,6 +150,7 @@ void tst_QAudioOutput::pullFile() QVERIFY(audio->state() == QAudio::ActiveState); QVERIFY(audio->error() == QAudio::NoError); QVERIFY(audio->periodSize() > 0); + QVERIFY(audio->clock() > 0); QVERIFY(stateSignal.count() == 1); // State changed to QAudio::ActiveState // Wait until finished... @@ -160,6 +162,7 @@ void tst_QAudioOutput::pullFile() audio->stop(); QTest::qWait(20); // wait 20ms QVERIFY(audio->state() == QAudio::StopState); + QVERIFY(audio->clock() == 0); // Can only check to make sure we got at least 1 more signal, but can be more. QVERIFY(stateSignal.count() > 1); -- cgit v0.12 From 7ea326d796a6d2ecb13b961c576c82a797d84706 Mon Sep 17 00:00:00 2001 From: Andreas Aardal Hanssen Date: Fri, 2 Oct 2009 08:04:05 +0200 Subject: Update documentation for sorting / stacking order in Graphics View. Remove all references to "elevation" and how items are sorted by their "z order". Now use "stacking order" and only refer to "z-value" when discussing sibling order. Move almost all sorting docs from the QGraphicsItem::setZValue() function to a general overview section in QGraphicsItem's class documentation. Reviewed-by: David Boddie --- src/gui/graphicsview/qgraphicsitem.cpp | 95 ++++++++----- src/gui/graphicsview/qgraphicsscene.cpp | 243 ++++++++++++++++---------------- src/gui/graphicsview/qgraphicsview.cpp | 28 ++-- 3 files changed, 202 insertions(+), 164 deletions(-) diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp index bc9c73f..0690690 100644 --- a/src/gui/graphicsview/qgraphicsitem.cpp +++ b/src/gui/graphicsview/qgraphicsitem.cpp @@ -186,6 +186,49 @@ high z-values. Stacking order applies to sibling items; parents are always drawn before their children. + \section1 Sorting + + All items are drawn in a defined, stable order, and this same order decides + which items will receive mouse input first when you click on the scene. + Normally you don't have to worry about sorting, as the items follow a + "natural order", following the logical structure of the scene. + + An item's children are stacked on top of the parent, and sibling items are + stacked by insertion order (i.e., in the same order that they were either + added to the scene, or added to the same parent). If you add item A, and + then B, then B will be on top of A. If you then add C, the items' stacking + order will be A, then B, then C. + + \image graphicsview-zorder.png + + This example shows the stacking order of all limbs of the robot from the + \l{graphicsview/dragdroprobot}{Drag and Drop Robot} example. The torso is + the root item (all other items are children or descendants of the torso), + so it is drawn first. Next, the head is drawn, as it is the first item in + the torso's list of children. Then the upper left arm is drawn. As the + lower arm is a child of the upper arm, the lower arm is then drawn, + followed by the upper arm's next sibling, which is the upper right arm, and + so on. + + For advanced users, there are ways to alter how your items are sorted: + + \list + \o You can call setZValue() on an item to explicitly stack it on top of, or + under, other sibling items. The default Z value for an item is 0. Items + with the same Z value are stacked by insertion order. + + \o You can call stackBefore() to reorder the list of children. This will + directly modify the insertion order. + + \o You can set the ItemStacksBehindParent flag to stack a child item behind + its parent. + \endlist + + The stacking order of two sibling items also counts for each item's + children and descendant items. So if one item is on top of another, then + all its children will also be on top of all the other item's children as + well. + \section1 Events QGraphicsItem receives events from QGraphicsScene through the virtual @@ -1487,10 +1530,12 @@ QList QGraphicsItem::children() const /*! \since 4.4 - Returns a list of this item's children. The items are returned in no - particular order. + Returns a list of this item's children. - \sa setParentItem() + The items are sorted by stacking order. This takes into account both the + items' insertion order and their Z-values. + + \sa setParentItem(), zValue(), {QGraphicsItem#Sorting}{Sorting} */ QList QGraphicsItem::childItems() const { @@ -4090,12 +4135,12 @@ void QGraphicsItem::advance(int phase) } /*! - Returns the Z-value, or the elevation, of the item. The Z-value decides - the stacking order of sibling (neighboring) items. + Returns the Z-value of the item. The Z-value affects the stacking order of + sibling (neighboring) items. The default Z-value is 0. - \sa setZValue() + \sa setZValue(), {QGraphicsItem#Sorting}{Sorting}, stackBefore(), ItemStacksBehindParent */ qreal QGraphicsItem::zValue() const { @@ -4103,33 +4148,18 @@ qreal QGraphicsItem::zValue() const } /*! - Sets the Z-value, or the elevation, of the item, to \a z. The elevation - decides the stacking order of sibling (neighboring) items. An item of high - Z-value will be drawn on top of an item with a lower Z-value if they share - the same parent item. In addition, children of an item will always be - drawn on top of the parent, regardless of the child's Z-value. Sibling - items that share the same Z-value will be drawn in order of insertion; the - last inserted child is stacked above previous children. - - \img graphicsview-zorder.png + Sets the Z-value of the item to \a z. The Z value decides the stacking + order of sibling (neighboring) items. A sibling item of high Z value will + always be drawn on top of another sibling item with a lower Z value. - Children of different parents are stacked according to the Z-value of - each item's ancestor item which is an immediate child of the two - items' closest common ancestor. For example, a robot item might - define a torso item as the parent of a head item, two arm items, - and two upper-leg items. The upper-leg items would each be parents - of one lower-leg item, and each lower-leg item would be parents of - one foot item. The stacking order of the feet is the same as the - stacking order of each foot's ancestor that is an immediate child - of the two feet's common ancestor (i.e., the torso item); so the - feet are stacked in the same order as the upper-leg items, - regardless of each foot's Z-value. + If you restore the Z value, the item's insertion order will decide its + stacking order. The Z-value does not affect the item's size in any way. The default Z-value is 0. - \sa zValue() + \sa zValue(), {QGraphicsItem#Sorting}{Sorting}, stackBefore(), ItemStacksBehindParent */ void QGraphicsItem::setZValue(qreal z) { @@ -4192,12 +4222,13 @@ void QGraphicsItemPrivate::ensureSequentialSiblingIndex() The \a sibling must have the same Z value as this item, otherwise calling this function will have no effect. - By default, all items are stacked by insertion order (i.e., the first item - you add is drawn before the next item you add). If two items' Z values are - different, then the item with the highest Z value is drawn on top. When the - Z values are the same, the insertion order will decide the stacking order. + By default, all sibling items are stacked by insertion order (i.e., the + first item you add is drawn before the next item you add). If two items' Z + values are different, then the item with the highest Z value is drawn on + top. When the Z values are the same, the insertion order will decide the + stacking order. - \sa setZValue(), ItemStacksBehindParent + \sa setZValue(), ItemStacksBehindParent, {QGraphicsItem#Sorting}{Sorting} */ void QGraphicsItem::stackBefore(const QGraphicsItem *sibling) { diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp index a1ff6d2..1226722 100644 --- a/src/gui/graphicsview/qgraphicsscene.cpp +++ b/src/gui/graphicsview/qgraphicsscene.cpp @@ -1759,10 +1759,10 @@ QRectF QGraphicsScene::itemsBoundingRect() const return boundingRect; } -/*! \fn QList QGraphicsScene::items() const - Returns a list of all items on the scene, in no particular order. +/*! + Returns a list of all items in the scene in descending stacking order. - \sa addItem(), removeItem() + \sa addItem(), removeItem(), {QGraphicsItem#Sorting}{Sorting} */ QList QGraphicsScene::items() const { @@ -1770,11 +1770,11 @@ QList QGraphicsScene::items() const return d->index->items(Qt::DescendingOrder); } -/*! \fn QList QGraphicsScene::items(Qt::SortOrder order) const - Returns an ordered list of all items on the scene. \a order decides the - sorting. +/*! + Returns an ordered list of all items on the scene. \a order decides the + stacking order. - \sa addItem(), removeItem() + \sa addItem(), removeItem(), {QGraphicsItem#Sorting}{Sorting} */ QList QGraphicsScene::items(Qt::SortOrder order) const { @@ -1782,18 +1782,18 @@ QList QGraphicsScene::items(Qt::SortOrder order) const return d->index->items(order); } -/*! \fn QList QGraphicsScene::items(const QPointF &pos) const - \obsolete +/*! + \obsolete - Returns all visible items at position \a pos in the scene. The items are - listed in descending stacking order (i.e., the first item in the list is the - top-most item, and the last item is the bottom-most item). + Returns all visible items at position \a pos in the scene. The items are + listed in descending stacking order (i.e., the first item in the list is the + top-most item, and the last item is the bottom-most item). - This function is deprecated and returns incorrect results if the scene - contains items that ignore transformations. Use the overload that takes - a QTransform instead. + This function is deprecated and returns incorrect results if the scene + contains items that ignore transformations. Use the overload that takes + a QTransform instead. - \sa itemAt() + \sa itemAt(), {QGraphicsItem#Sorting}{Sorting} */ QList QGraphicsScene::items(const QPointF &pos) const { @@ -1801,21 +1801,21 @@ QList QGraphicsScene::items(const QPointF &pos) const return d->index->items(pos, Qt::IntersectsItemShape, Qt::DescendingOrder); } -/*! \fn QList QGraphicsScene::items(const QRectF &rectangle, Qt::ItemSelectionMode mode) const - \overload - \obsolete +/*! + \overload + \obsolete - Returns all visible items that, depending on \a mode, are either inside or - intersect with the specified \a rectangle. + Returns all visible items that, depending on \a mode, are either inside or + intersect with the specified \a rectangle. - The default value for \a mode is Qt::IntersectsItemShape; all items whose - exact shape intersects with or is contained by \a rectangle are returned. + The default value for \a mode is Qt::IntersectsItemShape; all items whose + exact shape intersects with or is contained by \a rectangle are returned. - This function is deprecated and returns incorrect results if the scene - contains items that ignore transformations. Use the overload that takes - a QTransform instead. + This function is deprecated and returns incorrect results if the scene + contains items that ignore transformations. Use the overload that takes + a QTransform instead. - \sa itemAt() + \sa itemAt(), {QGraphicsItem#Sorting}{Sorting} */ QList QGraphicsScene::items(const QRectF &rectangle, Qt::ItemSelectionMode mode) const { @@ -1823,45 +1823,47 @@ QList QGraphicsScene::items(const QRectF &rectangle, Qt::ItemSe return d->index->items(rectangle, mode, Qt::DescendingOrder); } -/*! \fn QList QGraphicsScene::items(qreal x, qreal y, qreal w, qreal h, Qt::ItemSelectionMode mode) const - \obsolete - \since 4.3 +/*! + \fn QList QGraphicsScene::items(qreal x, qreal y, qreal w, qreal h, Qt::ItemSelectionMode mode) const + \obsolete + \since 4.3 - This convenience function is equivalent to calling items(QRectF(\a x, \a y, \a w, \a h), \a mode). + This convenience function is equivalent to calling items(QRectF(\a x, \a y, \a w, \a h), \a mode). - This function is deprecated and returns incorrect results if the scene - contains items that ignore transformations. Use the overload that takes - a QTransform instead. + This function is deprecated and returns incorrect results if the scene + contains items that ignore transformations. Use the overload that takes + a QTransform instead. */ /*! - \fn QList QGraphicsScene::items(qreal x, qreal y, qreal w, qreal h, Qt::ItemSelectionMode mode, Qt::SortOrder order, const QTransform &deviceTransform) const - \overload - \since 4.6 + \fn QList QGraphicsScene::items(qreal x, qreal y, qreal w, qreal h, Qt::ItemSelectionMode mode, Qt::SortOrder order, const QTransform &deviceTransform) const + \overload + \since 4.6 - \brief Returns all visible items that, depending on \a mode, are - either inside or intersect with the rectangle defined by \a x, \a y, - \a w and \a h, in a list sorted using \a order. + \brief Returns all visible items that, depending on \a mode, are + either inside or intersect with the rectangle defined by \a x, \a y, + \a w and \a h, in a list sorted using \a order. - \a deviceTransform is the transformation that applies to the view, and needs to - be provided if the scene contains items that ignore transformations. + \a deviceTransform is the transformation that applies to the view, and needs to + be provided if the scene contains items that ignore transformations. */ -/*! \fn QList QGraphicsScene::items(const QPolygonF &polygon, Qt::ItemSelectionMode mode) const - \overload - \obsolete +/*! + \fn QList QGraphicsScene::items(const QPolygonF &polygon, Qt::ItemSelectionMode mode) const + \overload + \obsolete - Returns all visible items that, depending on \a mode, are either inside or - intersect with the polygon \a polygon. + Returns all visible items that, depending on \a mode, are either inside or + intersect with the polygon \a polygon. - The default value for \a mode is Qt::IntersectsItemShape; all items whose - exact shape intersects with or is contained by \a polygon are returned. + The default value for \a mode is Qt::IntersectsItemShape; all items whose + exact shape intersects with or is contained by \a polygon are returned. - This function is deprecated and returns incorrect results if the scene - contains items that ignore transformations. Use the overload that takes - a QTransform instead. + This function is deprecated and returns incorrect results if the scene + contains items that ignore transformations. Use the overload that takes + a QTransform instead. - \sa itemAt() + \sa itemAt(), {QGraphicsItem#Sorting}{Sorting} */ QList QGraphicsScene::items(const QPolygonF &polygon, Qt::ItemSelectionMode mode) const { @@ -1869,21 +1871,22 @@ QList QGraphicsScene::items(const QPolygonF &polygon, Qt::ItemS return d->index->items(polygon, mode, Qt::DescendingOrder); } -/*! \fn QList QGraphicsScene::items(const QPainterPath &path, Qt::ItemSelectionMode mode) const - \overload - \obsolete +/*! + \fn QList QGraphicsScene::items(const QPainterPath &path, Qt::ItemSelectionMode mode) const + \overload + \obsolete - Returns all visible items that, depending on \a path, are either inside or - intersect with the path \a path. + Returns all visible items that, depending on \a path, are either inside or + intersect with the path \a path. - The default value for \a mode is Qt::IntersectsItemShape; all items whose - exact shape intersects with or is contained by \a path are returned. + The default value for \a mode is Qt::IntersectsItemShape; all items whose + exact shape intersects with or is contained by \a path are returned. - This function is deprecated and returns incorrect results if the scene - contains items that ignore transformations. Use the overload that takes - a QTransform instead. + This function is deprecated and returns incorrect results if the scene + contains items that ignore transformations. Use the overload that takes + a QTransform instead. - \sa itemAt() + \sa itemAt(), {QGraphicsItem#Sorting}{Sorting} */ QList QGraphicsScene::items(const QPainterPath &path, Qt::ItemSelectionMode mode) const { @@ -1891,20 +1894,20 @@ QList QGraphicsScene::items(const QPainterPath &path, Qt::ItemS return d->index->items(path, mode, Qt::DescendingOrder); } -/*! \fn QList QGraphicsScene::items(const QPointF &pos, Qt::ItemSelectionMode mode, Qt::SortOrder order, const QTransform &deviceTransform) const - - \since 4.6 +/*! + \fn QList QGraphicsScene::items(const QPointF &pos, Qt::ItemSelectionMode mode, Qt::SortOrder order, const QTransform &deviceTransform) const + \since 4.6 - \brief Returns all visible items that, depending on \a mode, are at - the specified \a pos in a list sorted using \a order. + \brief Returns all visible items that, depending on \a mode, are at + the specified \a pos in a list sorted using \a order. - The default value for \a mode is Qt::IntersectsItemShape; all items whose - exact shape intersects with \a pos are returned. + The default value for \a mode is Qt::IntersectsItemShape; all items whose + exact shape intersects with \a pos are returned. - \a deviceTransform is the transformation that applies to the view, and needs to - be provided if the scene contains items that ignore transformations. + \a deviceTransform is the transformation that applies to the view, and needs to + be provided if the scene contains items that ignore transformations. - \sa itemAt() + \sa itemAt(), {QGraphicsItem#Sorting}{Sorting} */ QList QGraphicsScene::items(const QPointF &pos, Qt::ItemSelectionMode mode, Qt::SortOrder order, const QTransform &deviceTransform) const @@ -1913,21 +1916,22 @@ QList QGraphicsScene::items(const QPointF &pos, Qt::ItemSelecti return d->index->items(pos, mode, order, deviceTransform); } -/*! \fn QList QGraphicsScene::items(const QRectF &rect, Qt::ItemSelectionMode mode, Qt::SortOrder order, const QTransform &deviceTransform) const - \overload - \since 4.6 +/*! + \fn QList QGraphicsScene::items(const QRectF &rect, Qt::ItemSelectionMode mode, Qt::SortOrder order, const QTransform &deviceTransform) const + \overload + \since 4.6 - \brief Returns all visible items that, depending on \a mode, are - either inside or intersect with the specified \a rect and return a - list sorted using \a order. + \brief Returns all visible items that, depending on \a mode, are + either inside or intersect with the specified \a rect and return a + list sorted using \a order. - The default value for \a mode is Qt::IntersectsItemShape; all items whose - exact shape intersects with or is contained by \a rect are returned. + The default value for \a mode is Qt::IntersectsItemShape; all items whose + exact shape intersects with or is contained by \a rect are returned. - \a deviceTransform is the transformation that applies to the view, and needs to - be provided if the scene contains items that ignore transformations. + \a deviceTransform is the transformation that applies to the view, and needs to + be provided if the scene contains items that ignore transformations. - \sa itemAt() + \sa itemAt(), {QGraphicsItem#Sorting}{Sorting} */ QList QGraphicsScene::items(const QRectF &rect, Qt::ItemSelectionMode mode, Qt::SortOrder order, const QTransform &deviceTransform) const @@ -1936,21 +1940,22 @@ QList QGraphicsScene::items(const QRectF &rect, Qt::ItemSelecti return d->index->items(rect, mode, order, deviceTransform); } -/*! \fn QList QGraphicsScene::items(const QPolygonF &polygon, Qt::ItemSelectionMode mode, Qt::SortOrder order, const QTransform &deviceTransform) const - \overload - \since 4.6 +/*! + \fn QList QGraphicsScene::items(const QPolygonF &polygon, Qt::ItemSelectionMode mode, Qt::SortOrder order, const QTransform &deviceTransform) const + \overload + \since 4.6 - \brief Returns all visible items that, depending on \a mode, are - either inside or intersect with the specified \a polygon and return - a list sorted using \a order. + \brief Returns all visible items that, depending on \a mode, are + either inside or intersect with the specified \a polygon and return + a list sorted using \a order. - The default value for \a mode is Qt::IntersectsItemShape; all items whose - exact shape intersects with or is contained by \a polygon are returned. + The default value for \a mode is Qt::IntersectsItemShape; all items whose + exact shape intersects with or is contained by \a polygon are returned. - \a deviceTransform is the transformation that applies to the view, and needs to - be provided if the scene contains items that ignore transformations. + \a deviceTransform is the transformation that applies to the view, and needs to + be provided if the scene contains items that ignore transformations. - \sa itemAt() + \sa itemAt(), {QGraphicsItem#Sorting}{Sorting} */ QList QGraphicsScene::items(const QPolygonF &polygon, Qt::ItemSelectionMode mode, Qt::SortOrder order, const QTransform &deviceTransform) const @@ -1959,21 +1964,22 @@ QList QGraphicsScene::items(const QPolygonF &polygon, Qt::ItemS return d->index->items(polygon, mode, order, deviceTransform); } -/*! \fn QList QGraphicsScene::items(const QPainterPath &path, Qt::ItemSelectionMode mode, Qt::SortOrder order, const QTransform &deviceTransform) const - \overload - \since 4.6 +/*! + \fn QList QGraphicsScene::items(const QPainterPath &path, Qt::ItemSelectionMode mode, Qt::SortOrder order, const QTransform &deviceTransform) const + \overload + \since 4.6 - \brief Returns all visible items that, depending on \a mode, are - either inside or intersect with the specified \a path and return a - list sorted using \a order. + \brief Returns all visible items that, depending on \a mode, are + either inside or intersect with the specified \a path and return a + list sorted using \a order. - The default value for \a mode is Qt::IntersectsItemShape; all items whose - exact shape intersects with or is contained by \a path are returned. + The default value for \a mode is Qt::IntersectsItemShape; all items whose + exact shape intersects with or is contained by \a path are returned. - \a deviceTransform is the transformation that applies to the view, and needs to - be provided if the scene contains items that ignore transformations. + \a deviceTransform is the transformation that applies to the view, and needs to + be provided if the scene contains items that ignore transformations. - \sa itemAt() + \sa itemAt(), {QGraphicsItem#Sorting}{Sorting} */ QList QGraphicsScene::items(const QPainterPath &path, Qt::ItemSelectionMode mode, Qt::SortOrder order, const QTransform &deviceTransform) const @@ -1988,10 +1994,11 @@ QList QGraphicsScene::items(const QPainterPath &path, Qt::ItemS detection is determined by \a mode. By default, all items whose shape intersects \a item or is contained inside \a item's shape are returned. - The items are returned in descending Z order (i.e., the first item in the - list is the top-most item, and the last item is the bottom-most item). + The items are returned in descending stacking order (i.e., the first item + in the list is the uppermost item, and the last item is the lowermost + item). - \sa items(), itemAt(), QGraphicsItem::collidesWithItem() + \sa items(), itemAt(), QGraphicsItem::collidesWithItem(), {QGraphicsItem#Sorting}{Sorting} */ QList QGraphicsScene::collidingItems(const QGraphicsItem *item, Qt::ItemSelectionMode mode) const @@ -2018,13 +2025,11 @@ QList QGraphicsScene::collidingItems(const QGraphicsItem *item, Returns the topmost visible item at the specified \a position, or 0 if there are no items at this position. - \note The topmost item is the one with the highest Z-value. - This function is deprecated and returns incorrect results if the scene contains items that ignore transformations. Use the overload that takes a QTransform instead. - \sa items(), collidingItems(), QGraphicsItem::setZValue() + \sa items(), collidingItems(), {QGraphicsItem#Sorting}{Sorting} */ QGraphicsItem *QGraphicsScene::itemAt(const QPointF &position) const { @@ -2041,10 +2046,8 @@ QGraphicsItem *QGraphicsScene::itemAt(const QPointF &position) const \a deviceTransform is the transformation that applies to the view, and needs to be provided if the scene contains items that ignore transformations. - \note The topmost item is the one with the highest Z-value. - - \sa items(), collidingItems(), QGraphicsItem::setZValue() - */ + \sa items(), collidingItems(), {QGraphicsItem#Sorting}{Sorting} +*/ QGraphicsItem *QGraphicsScene::itemAt(const QPointF &position, const QTransform &deviceTransform) const { QList itemsAtPoint = items(position, Qt::IntersectsItemShape, @@ -2065,8 +2068,6 @@ QGraphicsItem *QGraphicsScene::itemAt(const QPointF &position, const QTransform This convenience function is equivalent to calling \c {itemAt(QPointF(x, y), deviceTransform)}. - - \note The topmost item is the one with the highest Z-value. */ /*! @@ -2083,8 +2084,6 @@ QGraphicsItem *QGraphicsScene::itemAt(const QPointF &position, const QTransform This function is deprecated and returns incorrect results if the scene contains items that ignore transformations. Use the overload that takes a QTransform instead. - - \note The topmost item is the one with the highest Z-value. */ /*! @@ -2363,7 +2362,7 @@ void QGraphicsScene::destroyItemGroup(QGraphicsItemGroup *group) in the scene, then the item will be activated. \sa removeItem(), addEllipse(), addLine(), addPath(), addPixmap(), - addRect(), addText(), addWidget() + addRect(), addText(), addWidget(), {QGraphicsItem#Sorting}{Sorting} */ void QGraphicsScene::addItem(QGraphicsItem *item) { diff --git a/src/gui/graphicsview/qgraphicsview.cpp b/src/gui/graphicsview/qgraphicsview.cpp index 98b2c9c..32747cc 100644 --- a/src/gui/graphicsview/qgraphicsview.cpp +++ b/src/gui/graphicsview/qgraphicsview.cpp @@ -2016,9 +2016,11 @@ void QGraphicsView::render(QPainter *painter, const QRectF &target, const QRect } /*! - Returns a list of all the items in the associated scene. + Returns a list of all the items in the associated scene, in descending + stacking order (i.e., the first item in the returned list is the uppermost + item). - \sa QGraphicsScene::items() + \sa QGraphicsScene::items(), {QGraphicsItem#Sorting}{Sorting} */ QList QGraphicsView::items() const { @@ -2030,9 +2032,9 @@ QList QGraphicsView::items() const /*! Returns a list of all the items at the position \a pos in the view. The - items are listed in descending Z order (i.e., the first item in the list - is the top-most item, and the last item is the bottom-most item). \a pos - is in viewport coordinates. + items are listed in descending stacking order (i.e., the first item in the + list is the uppermost item, and the last item is the lowermost item). \a + pos is in viewport coordinates. This function is most commonly called from within mouse event handlers in a subclass in QGraphicsView. \a pos is in untransformed viewport @@ -2040,7 +2042,7 @@ QList QGraphicsView::items() const \snippet doc/src/snippets/code/src_gui_graphicsview_qgraphicsview.cpp 5 - \sa QGraphicsScene::items(), QGraphicsItem::zValue() + \sa QGraphicsScene::items(), {QGraphicsItem#Sorting}{Sorting} */ QList QGraphicsView::items(const QPoint &pos) const { @@ -2082,7 +2084,10 @@ QList QGraphicsView::items(const QPoint &pos) const The default value for \a mode is Qt::IntersectsItemShape; all items whose exact shape intersects with or is contained by \a rect are returned. - \sa itemAt(), items(), mapToScene() + The items are sorted in descending stacking order (i.e., the first item in + the returned list is the uppermost item). + + \sa itemAt(), items(), mapToScene(), {QGraphicsItem#Sorting}{Sorting} */ QList QGraphicsView::items(const QRect &rect, Qt::ItemSelectionMode mode) const { @@ -2110,7 +2115,10 @@ QList QGraphicsView::items(const QRect &rect, Qt::ItemSelection The default value for \a mode is Qt::IntersectsItemShape; all items whose exact shape intersects with or is contained by \a polygon are returned. - \sa itemAt(), items(), mapToScene() + The items are sorted by descending stacking order (i.e., the first item in + the returned list is the uppermost item). + + \sa itemAt(), items(), mapToScene(), {QGraphicsItem#Sorting}{Sorting} */ QList QGraphicsView::items(const QPolygon &polygon, Qt::ItemSelectionMode mode) const { @@ -2130,7 +2138,7 @@ QList QGraphicsView::items(const QPolygon &polygon, Qt::ItemSel The default value for \a mode is Qt::IntersectsItemShape; all items whose exact shape intersects with or is contained by \a path are returned. - \sa itemAt(), items(), mapToScene() + \sa itemAt(), items(), mapToScene(), {QGraphicsItem#Sorting}{Sorting} */ QList QGraphicsView::items(const QPainterPath &path, Qt::ItemSelectionMode mode) const { @@ -2149,7 +2157,7 @@ QList QGraphicsView::items(const QPainterPath &path, Qt::ItemSe \snippet doc/src/snippets/code/src_gui_graphicsview_qgraphicsview.cpp 6 - \sa items() + \sa items(), {QGraphicsItem#Sorting}{Sorting} */ QGraphicsItem *QGraphicsView::itemAt(const QPoint &pos) const { -- cgit v0.12 From ea6d4e94c802f648e296eec0bde1661728d82024 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Wed, 30 Sep 2009 15:48:07 +0200 Subject: Add configure flags to force turning on or off JavaScriptCore JIT Also add configure test to see if arm toolchain can compile JavaScript JIT Task-number:QTBUG-4632 Reviewed-by:Simon Hausmann , Marius Storm-Olsen --- .../unix/javascriptcore-jit/hwcap_test.cpp | 46 ++++++++++++++++++++++ .../unix/javascriptcore-jit/javascriptcore-jit.pro | 2 + configure | 37 ++++++++++++++++- .../JavaScriptCore/JavaScriptCore.pri | 3 ++ .../webkit/JavaScriptCore/JavaScriptCore.pri | 2 + 5 files changed, 88 insertions(+), 2 deletions(-) create mode 100644 config.tests/unix/javascriptcore-jit/hwcap_test.cpp create mode 100644 config.tests/unix/javascriptcore-jit/javascriptcore-jit.pro diff --git a/config.tests/unix/javascriptcore-jit/hwcap_test.cpp b/config.tests/unix/javascriptcore-jit/hwcap_test.cpp new file mode 100644 index 0000000..f0f5d40 --- /dev/null +++ b/config.tests/unix/javascriptcore-jit/hwcap_test.cpp @@ -0,0 +1,46 @@ +/**************************************************************************** +** +** 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 documentation 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 + +int main (int argc, char **argv) +{ + return 0; +} diff --git a/config.tests/unix/javascriptcore-jit/javascriptcore-jit.pro b/config.tests/unix/javascriptcore-jit/javascriptcore-jit.pro new file mode 100644 index 0000000..0d5a20d --- /dev/null +++ b/config.tests/unix/javascriptcore-jit/javascriptcore-jit.pro @@ -0,0 +1,2 @@ +SOURCES = hwcap_test.cpp +CONFIG -= qt dylib diff --git a/configure b/configure index e86d008..1430d78 100755 --- a/configure +++ b/configure @@ -673,6 +673,7 @@ CFG_PHONON_BACKEND=yes CFG_MULTIMEDIA=yes CFG_SVG=yes CFG_WEBKIT=auto # (yes|no|auto) +CFG_JAVASCRIPTCORE_JIT=auto CFG_GFX_AVAILABLE="linuxfb transformed qvfb vnc multiscreen directfb" CFG_GFX_ON="linuxfb multiscreen" @@ -911,7 +912,7 @@ while [ "$#" -gt 0 ]; do VAL=no ;; #Qt style yes options - -incremental|-qvfb|-profile|-shared|-static|-sm|-xinerama|-xshape|-xinput|-reduce-exports|-pch|-separate-debug-info|-stl|-freetype|-xcursor|-xfixes|-xrandr|-xrender|-mitshm|-fontconfig|-xkb|-nis|-qdbus|-dbus|-dbus-linked|-glib|-gstreamer|-gtkstyle|-cups|-iconv|-largefile|-h|-help|-v|-verbose|-debug|-release|-fast|-accessibility|-confirm-license|-gnumake|-framework|-qt3support|-debug-and-release|-exceptions|-cocoa|-universal|-prefix-install|-silent|-armfpa|-optimized-qmake|-dwarf2|-reduce-relocations|-sse|-openssl|-openssl-linked|-ptmalloc|-xmlpatterns|-phonon|-phonon-backend|-multimedia|-svg|-webkit|-script|-scripttools|-rpath|-force-pkg-config) + -incremental|-qvfb|-profile|-shared|-static|-sm|-xinerama|-xshape|-xinput|-reduce-exports|-pch|-separate-debug-info|-stl|-freetype|-xcursor|-xfixes|-xrandr|-xrender|-mitshm|-fontconfig|-xkb|-nis|-qdbus|-dbus|-dbus-linked|-glib|-gstreamer|-gtkstyle|-cups|-iconv|-largefile|-h|-help|-v|-verbose|-debug|-release|-fast|-accessibility|-confirm-license|-gnumake|-framework|-qt3support|-debug-and-release|-exceptions|-cocoa|-universal|-prefix-install|-silent|-armfpa|-optimized-qmake|-dwarf2|-reduce-relocations|-sse|-openssl|-openssl-linked|-ptmalloc|-xmlpatterns|-phonon|-phonon-backend|-multimedia|-svg|-webkit|-javascript-jit|-script|-scripttools|-rpath|-force-pkg-config) VAR=`echo $1 | sed "s,^-\(.*\),\1,"` VAL=yes ;; @@ -1854,6 +1855,13 @@ while [ "$#" -gt 0 ]; do fi fi ;; + javascript-jit) + if [ "$VAL" = "yes" ] || [ "$VAL" = "auto" ] || [ "$VAL" = "no" ]; then + CFG_JAVASCRIPTCORE_JIT="$VAL" + else + UNKNOWN_OPT=yes + fi + ;; confirm-license) if [ "$VAL" = "yes" ]; then OPT_CONFIRM_LICENSE="$VAL" @@ -3225,7 +3233,7 @@ Usage: $relconf [-h] [-prefix ] [-prefix-install] [-bindir ] [-libdir [-no-optimized-qmake] [-optimized-qmake] [-no-xmlpatterns] [-xmlpatterns] [-no-multimedia] [-multimedia] [-no-phonon] [-phonon] [-no-phonon-backend] [-phonon-backend] [-no-openssl] [-openssl] [-openssl-linked] - [-no-gtkstyle] [-gtkstyle] [-no-svg] [-svg] [-no-webkit] [-webkit] + [-no-gtkstyle] [-gtkstyle] [-no-svg] [-svg] [-no-webkit] [-webkit] [-no-javascript-jit] [-javascript-jit] [-no-script] [-script] [-no-scripttools] [-scripttools] [additional platform specific options (see below)] @@ -3375,6 +3383,9 @@ fi + -webkit ............ Build the WebKit module. WebKit is built if a decent C++ compiler is used. + -no-javascript-jit . Do not build the JavaScriptCore JIT compiler. + + -javascript-jit .... Build the JavaScriptCore JIT compiler. + -no-script ......... Do not build the QtScript module. + -script ............ Build the QtScript module. @@ -5757,6 +5768,21 @@ if [ "$CFG_ALSA" = "auto" ]; then fi fi +if [ "$CFG_JAVASCRIPTCORE_JIT" = "yes" ] || [ "$CFG_JAVASCRIPTCORE_JIT" = "auto" ]; then + if [ "$CFG_ARCH" = "arm" ] || [ "$CFG_ARCH" = "armv6" ]; then + "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/javascriptcore-jit "javascriptcore-jit" $L_FLAGS $I_FLAGS $l_FLAGS + if [ $? != "0" ]; then + CFG_JAVASCRIPTCORE_JIT=no + fi + fi +fi + +if [ "$CFG_JAVASCRIPTCORE_JIT" = "yes" ]; then + QMakeVar set JAVASCRIPTCORE_JIT yes +elif [ "$CFG_JAVASCRIPTCORE_JIT" = "no" ]; then + QMakeVar set JAVASCRIPTCORE_JIT no +fi + #------------------------------------------------------------------------------- # ask for all that hasn't been auto-detected or specified in the arguments #------------------------------------------------------------------------------- @@ -7268,6 +7294,13 @@ echo "Phonon module ....... $CFG_PHONON" echo "Multimedia module ... $CFG_MULTIMEDIA" echo "SVG module .......... $CFG_SVG" echo "WebKit module ....... $CFG_WEBKIT" +if [ "$CFG_WEBKIT" = "yes" ]; then + if [ "$CFG_JAVASCRIPTCORE_JIT" = "auto" ]; then + echo "JavaScriptCore JIT .. To be decided by JavaScriptCore" + else + echo "JavaScriptCore JIT .. $CFG_JAVASCRIPTCORE_JIT" + fi +fi echo "STL support ......... $CFG_STL" echo "PCH support ......... $CFG_PRECOMPILE" echo "MMX/3DNOW/SSE/SSE2.. ${CFG_MMX}/${CFG_3DNOW}/${CFG_SSE}/${CFG_SSE2}" diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/JavaScriptCore.pri b/src/3rdparty/javascriptcore/JavaScriptCore/JavaScriptCore.pri index 8483469..965f3d6 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/JavaScriptCore.pri +++ b/src/3rdparty/javascriptcore/JavaScriptCore/JavaScriptCore.pri @@ -37,6 +37,9 @@ win32-* { LIBS += -lwinmm } +contains(JAVASCRIPTCORE_JIT,yes): DEFINES+=ENABLE_JIT=1 +contains(JAVASCRIPTCORE_JIT,no): DEFINES+=ENABLE_JIT=0 + # In debug mode JIT disabled until crash fixed win32-* { CONFIG(debug):!contains(DEFINES, ENABLE_JIT=1): DEFINES+=ENABLE_JIT=0 diff --git a/src/3rdparty/webkit/JavaScriptCore/JavaScriptCore.pri b/src/3rdparty/webkit/JavaScriptCore/JavaScriptCore.pri index 73791e0..d8b6f4b 100644 --- a/src/3rdparty/webkit/JavaScriptCore/JavaScriptCore.pri +++ b/src/3rdparty/webkit/JavaScriptCore/JavaScriptCore.pri @@ -36,6 +36,8 @@ GENERATED_SOURCES_DIR_SLASH = $${GENERATED_SOURCES_DIR}$${QMAKE_DIR_SEP} win32-* { LIBS += -lwinmm } +contains(JAVASCRIPTCORE_JIT,yes): DEFINES+=ENABLE_JIT=1 +contains(JAVASCRIPTCORE_JIT,no): DEFINES+=ENABLE_JIT=0 # In debug mode JIT disabled until crash fixed win32-* { -- cgit v0.12 From f51b454100b4145350617ab3ff13bbf596deb2dc Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Fri, 2 Oct 2009 09:47:16 +0200 Subject: Stabilize tests on X11 --- tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp | 3 ++- tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp | 2 +- tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp | 2 +- tests/auto/qgridlayout/tst_qgridlayout.cpp | 1 + 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp index 21f6269..297b6d3 100644 --- a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp +++ b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp @@ -6306,6 +6306,7 @@ void tst_QGraphicsItem::itemStacksBehindParent() QGraphicsView view(&scene); view.show(); QTest::qWaitForWindowShown(&view); + QTRY_VERIFY(!paintedItems.isEmpty()); QTest::qWait(100); paintedItems.clear(); view.viewport()->update(); @@ -6315,7 +6316,7 @@ void tst_QGraphicsItem::itemStacksBehindParent() << grandChild121 << child12 << parent1 << grandChild211 << child21 << grandChild221 << child22 << parent2)); - QCOMPARE(paintedItems, QList() + QTRY_COMPARE(paintedItems, QList() << parent2 << child22 << grandChild221 << child21 << grandChild211 << parent1 << child12 << grandChild121 diff --git a/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp b/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp index f0ed008..76e7202 100644 --- a/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp +++ b/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp @@ -1296,7 +1296,7 @@ void tst_QGraphicsProxyWidget::paintEvent() w->show(); QTest::qWaitForWindowShown(w); QApplication::processEvents(); - + QTest::qWait(50); proxy.setWidget(w); scene.addItem(&proxy); diff --git a/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp b/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp index a76e607..e55dc9aa 100644 --- a/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp +++ b/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp @@ -1657,7 +1657,7 @@ void tst_QGraphicsScene::hoverEvents_siblings() qApp->processEvents(); // this posts updates from the scene to the view qApp->processEvents(); // which trigger a repaint here - QVERIFY(items.at(i)->isHovered); + QTRY_VERIFY(items.at(i)->isHovered); if (j && i > 0) QVERIFY(!items.at(i - 1)->isHovered); if (!j && i < 14) diff --git a/tests/auto/qgridlayout/tst_qgridlayout.cpp b/tests/auto/qgridlayout/tst_qgridlayout.cpp index 3c7e1fb..7c320be 100644 --- a/tests/auto/qgridlayout/tst_qgridlayout.cpp +++ b/tests/auto/qgridlayout/tst_qgridlayout.cpp @@ -884,6 +884,7 @@ void tst_QGridLayout::minMaxSize() for (int pass = 0; pass < 2; ++pass) { m_toplevel->hide(); QApplication::processEvents(); + QTest::qWait(20); // Test if removeItem uninitializes data properly while (m_grid->count()) { QLayoutItem *item = m_grid->itemAt(0); -- cgit v0.12 From 4cbbb0e7bec3f11654ae140e4b1c966bb6aabae6 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Fri, 2 Oct 2009 10:52:57 +0300 Subject: Added support for -small-screen argument for Context2d example To improve screen real-estate utilization in small screen devices, added -small-screen command line argument to the Context2d application. Task-number: QTBUG-3296 Reviewed-by: Janne Koskinen --- demos/embedded/fluidlauncher/config_s60/config.xml | 2 +- examples/script/context2d/main.cpp | 13 ++++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/demos/embedded/fluidlauncher/config_s60/config.xml b/demos/embedded/fluidlauncher/config_s60/config.xml index acd14cb..68c3f2f 100644 --- a/demos/embedded/fluidlauncher/config_s60/config.xml +++ b/demos/embedded/fluidlauncher/config_s60/config.xml @@ -7,7 +7,7 @@ - + diff --git a/examples/script/context2d/main.cpp b/examples/script/context2d/main.cpp index 2f195c9..2c3c623 100644 --- a/examples/script/context2d/main.cpp +++ b/examples/script/context2d/main.cpp @@ -46,8 +46,19 @@ int main(int argc, char **argv) { Q_INIT_RESOURCE(context2d); + bool smallScreen = false; + for (int i = 0; i < argc; i++) + if (QString(argv[i]) == "-small-screen") + smallScreen = true; + QApplication app(argc, argv); Window win; - win.show(); + + if (!smallScreen) { + win.show(); + } else { + win.showFullScreen(); + } + return app.exec(); } -- cgit v0.12 From 686330063c26fc6ebe65c7374811c94e9680c2c0 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Fri, 2 Oct 2009 09:40:23 +0200 Subject: Add comment to changes file about behavioral change in QDataStream Refers to change 5170432e7cb2d0d1adf7ac2ec1ece627c75470f3 where QDataStream was altered to stream all floating point numbers with the same precision. Reviewed-by: Samuel --- dist/changes-4.6.0 | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/dist/changes-4.6.0 b/dist/changes-4.6.0 index f9984d3..2e7e699 100644 --- a/dist/changes-4.6.0 +++ b/dist/changes-4.6.0 @@ -126,3 +126,11 @@ information about a particular change. means that code that assigned a float to a variant would create a variant with userType QMetaType::Float, instead of QVariant::Double. + - QDataStream will now read and write all floating point numbers with the + same precision, regardless of whether it's streamed into or out from a + float or double. This is to maintain compatibility across platforms with + a different default precision for qreal. The default is 64-bit precision + for all floating point numbers, and this can be changed using the new + function setFloatingPointPrecision(). Set Qt_4_5 as the version of the + QDataStream to get the behavior of previous versions. + \ No newline at end of file -- cgit v0.12 From 2d003378ff5e7621d5dcc810408039cfe13a8c0a Mon Sep 17 00:00:00 2001 From: Kent Hansen Date: Fri, 2 Oct 2009 10:11:48 +0200 Subject: attempt to make QScriptEngine::collectGarbage() autotest more robust Since the GC looks for pointers in the C stack, try to kill those pointers before calling collectGarbage(). Reviewed-by: Simon Hausmann --- tests/auto/qscriptengine/tst_qscriptengine.cpp | 32 ++++++++++++++++++-------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/tests/auto/qscriptengine/tst_qscriptengine.cpp b/tests/auto/qscriptengine/tst_qscriptengine.cpp index f2c7157..25ee00f 100644 --- a/tests/auto/qscriptengine/tst_qscriptengine.cpp +++ b/tests/auto/qscriptengine/tst_qscriptengine.cpp @@ -48,6 +48,7 @@ #include #include #include +#include Q_DECLARE_METATYPE(QList) Q_DECLARE_METATYPE(QObjectList) @@ -60,6 +61,22 @@ Q_DECLARE_METATYPE(QObjectList) # define TOSTRING(x) STRINGIFY(x) # define SRCDIR "C:/Private/" TOSTRING(SYMBIAN_SRCDIR_UID) #endif + +// The JavaScriptCore GC marks the C stack. To try to ensure that there is +// no JSObject* left in stack memory by the compiler, we call this function +// to zap some bytes of memory before calling collectGarbage(). +static void zapSomeStack() +{ + char buf[4096]; + memset(buf, 0, sizeof(buf)); +} + +static void collectGarbage_helper(QScriptEngine &eng) +{ + zapSomeStack(); + eng.collectGarbage(); +} + class tst_QScriptEngine : public QObject { Q_OBJECT @@ -825,7 +842,7 @@ void tst_QScriptEngine::newQMetaObject() // verify that AutoOwnership is in effect instance = QScriptValue(); - eng.collectGarbage(); + collectGarbage_helper(eng); QVERIFY(!qpointer1); QVERIFY(qpointer2); @@ -835,7 +852,7 @@ void tst_QScriptEngine::newQMetaObject() QVERIFY(instance3.toQObject() == 0); // was child of instance QVERIFY(instance2.toQObject() != 0); instance2 = QScriptValue(); - eng.collectGarbage(); + collectGarbage_helper(eng); QVERIFY(instance2.toQObject() == 0); // with custom constructor @@ -922,14 +939,14 @@ void tst_QScriptEngine::getSetGlobalObject() QCOMPARE(eng.globalObject().toString(), QString::fromLatin1("[object Object]")); glob = QScriptValue(); // kill reference to old global object - eng.collectGarbage(); + collectGarbage_helper(eng); obj = eng.newObject(); eng.setGlobalObject(obj); QVERIFY(eng.globalObject().strictlyEquals(obj)); QVERIFY(eng.currentContext()->thisObject().strictlyEquals(obj)); QVERIFY(eng.currentContext()->activationObject().strictlyEquals(obj)); - eng.collectGarbage(); + collectGarbage_helper(eng); QVERIFY(eng.globalObject().strictlyEquals(obj)); QVERIFY(eng.currentContext()->thisObject().strictlyEquals(obj)); QVERIFY(eng.currentContext()->activationObject().strictlyEquals(obj)); @@ -2341,11 +2358,8 @@ void tst_QScriptEngine::collectGarbage() a = eng.newObject(); QPointer ptr = new QObject(); QVERIFY(ptr != 0); - { - QScriptValue v = eng.newQObject(ptr, QScriptEngine::ScriptOwnership); - } - eng.collectGarbage(); - QEXPECT_FAIL("","collectGarbage not working", Continue); + (void)eng.newQObject(ptr, QScriptEngine::ScriptOwnership); + collectGarbage_helper(eng); QVERIFY(ptr == 0); } -- cgit v0.12