From f816e5a928703850b7aa6c4a8b94136356c62a19 Mon Sep 17 00:00:00 2001 From: Aleksandar Sasha Babic Date: Mon, 16 Nov 2009 17:29:27 +0100 Subject: Fixing merger errors. Removing some unreferenced variables that were left overs after revert&merge operation. Reviewed-by: Kim Motoyoshi Kalland --- src/gui/painting/qblendfunctions.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/gui/painting/qblendfunctions.cpp b/src/gui/painting/qblendfunctions.cpp index ba1b642..b92c5c2 100644 --- a/src/gui/painting/qblendfunctions.cpp +++ b/src/gui/painting/qblendfunctions.cpp @@ -227,9 +227,6 @@ void qt_scale_image_16bit(uchar *destPixels, int dbpl, quint32 basex; quint32 srcy; - const int dstx = qCeil((tx1 + 0.5 - qMin(targetRect.left(), targetRect.right())) * ix) - 1; - const int dsty = qCeil((ty1 + 0.5 - qMin(targetRect.top(), targetRect.bottom())) * iy) - 1; - if (sx < 0) { int dstx = qFloor((tx1 + qreal(0.5) - targetRect.right()) * ix) + 1; basex = quint32(srcRect.right() * 65536) + dstx; -- cgit v0.12 From c535df0f286826c5575ec00c7e4c3f811a73918b Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Mon, 16 Nov 2009 15:54:38 +0100 Subject: Fix tst_QGraphicsView::inputMethodSensitivity autotest The problem was that the scene was not notified it lost the focus when it was disconnected from the view (with setScene) So when it got back the focus, nothing was updated because the scene thought it still had the focus. Reviewed-by: jasplin --- src/gui/graphicsview/qgraphicsview.cpp | 2 + tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp | 62 +++++++++++++++++++++--- tests/auto/qgraphicsview/tst_qgraphicsview.cpp | 9 ++++ 3 files changed, 67 insertions(+), 6 deletions(-) diff --git a/src/gui/graphicsview/qgraphicsview.cpp b/src/gui/graphicsview/qgraphicsview.cpp index 3ef311c..3f9f443 100644 --- a/src/gui/graphicsview/qgraphicsview.cpp +++ b/src/gui/graphicsview/qgraphicsview.cpp @@ -1517,6 +1517,8 @@ void QGraphicsView::setScene(QGraphicsScene *scene) QEvent windowDeactivate(QEvent::WindowDeactivate); QApplication::sendEvent(d->scene, &windowDeactivate); } + if(hasFocus()) + d->scene->clearFocus(); } // Assign the new scene and update the contents (scrollbars, etc.)). diff --git a/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp b/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp index 9a561eb..a49c2c1 100644 --- a/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp +++ b/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp @@ -3983,20 +3983,28 @@ void tst_QGraphicsScene::isActive() QVERIFY(!scene1.isActive()); //it is hidden; QVERIFY(scene2.isActive()); + QVERIFY(!scene1.hasFocus()); + QVERIFY(scene2.hasFocus()); view1->show(); QVERIFY(scene1.isActive()); QVERIFY(scene2.isActive()); + QVERIFY(!scene1.hasFocus()); + QVERIFY(scene2.hasFocus()); view2->hide(); QVERIFY(scene1.isActive()); QVERIFY(!scene2.isActive()); + QVERIFY(scene1.hasFocus()); + QVERIFY(!scene2.hasFocus()); toplevel1.hide(); - QTest::qWait(12); + QTest::qWait(50); QTRY_VERIFY(!scene1.isActive()); QTRY_VERIFY(!scene2.isActive()); + QVERIFY(!scene1.hasFocus()); + QVERIFY(!scene2.hasFocus()); toplevel1.show(); QApplication::setActiveWindow(&toplevel1); @@ -4005,14 +4013,21 @@ void tst_QGraphicsScene::isActive() QTRY_VERIFY(scene1.isActive()); QTRY_VERIFY(!scene2.isActive()); + QVERIFY(scene1.hasFocus()); + QVERIFY(!scene2.hasFocus()); view2->show(); QVERIFY(scene1.isActive()); QVERIFY(scene2.isActive()); + QVERIFY(scene1.hasFocus()); + QVERIFY(!scene2.hasFocus()); } QVERIFY(!scene1.isActive()); QVERIFY(!scene2.isActive()); + QVERIFY(!scene1.hasFocus()); + QVERIFY(!scene2.hasFocus()); + { QWidget toplevel2; @@ -4025,6 +4040,8 @@ void tst_QGraphicsScene::isActive() QVERIFY(!scene1.isActive()); QVERIFY(!scene2.isActive()); + QVERIFY(!scene1.hasFocus()); + QVERIFY(!scene2.hasFocus()); toplevel2.show(); QApplication::setActiveWindow(&toplevel2); @@ -4033,66 +4050,89 @@ void tst_QGraphicsScene::isActive() QVERIFY(scene1.isActive()); QVERIFY(!scene2.isActive()); + QVERIFY(scene1.hasFocus()); + QVERIFY(!scene2.hasFocus()); view2->setScene(&scene2); QVERIFY(scene1.isActive()); QVERIFY(scene2.isActive()); + QVERIFY(scene1.hasFocus()); + QVERIFY(!scene2.hasFocus()); view1->setScene(&scene2); QVERIFY(!scene1.isActive()); QVERIFY(scene2.isActive()); + QVERIFY(!scene1.hasFocus()); + QVERIFY(scene2.hasFocus()); view1->hide(); QVERIFY(!scene1.isActive()); QVERIFY(scene2.isActive()); + QVERIFY(!scene1.hasFocus()); + QVERIFY(scene2.hasFocus()); view1->setScene(&scene1); QVERIFY(!scene1.isActive()); QVERIFY(scene2.isActive()); - - view1->show(); + QVERIFY(!scene1.hasFocus()); + QVERIFY(scene2.hasFocus()); view1->show(); QVERIFY(scene1.isActive()); QVERIFY(scene2.isActive()); + QVERIFY(!scene1.hasFocus()); + QVERIFY(scene2.hasFocus()); view2->hide(); QVERIFY(scene1.isActive()); QVERIFY(!scene2.isActive()); + QVERIFY(scene1.hasFocus()); + QVERIFY(!scene2.hasFocus()); QGraphicsView topLevelView; topLevelView.show(); QApplication::setActiveWindow(&topLevelView); + topLevelView.setFocus(); QTest::qWaitForWindowShown(&topLevelView); QTRY_COMPARE(QApplication::activeWindow(), static_cast(&topLevelView)); QVERIFY(!scene1.isActive()); QVERIFY(!scene2.isActive()); + QVERIFY(!scene1.hasFocus()); + QVERIFY(!scene2.hasFocus()); topLevelView.setScene(&scene1); QVERIFY(scene1.isActive()); QVERIFY(!scene2.isActive()); + QVERIFY(scene1.hasFocus()); + QVERIFY(!scene2.hasFocus()); view2->show(); QVERIFY(scene1.isActive()); QVERIFY(!scene2.isActive()); + QVERIFY(scene1.hasFocus()); + QVERIFY(!scene2.hasFocus()); view1->hide(); QVERIFY(scene1.isActive()); QVERIFY(!scene2.isActive()); + QVERIFY(scene1.hasFocus()); + QVERIFY(!scene2.hasFocus()); QApplication::setActiveWindow(&toplevel2); QTRY_COMPARE(QApplication::activeWindow(), &toplevel2); QVERIFY(!scene1.isActive()); QVERIFY(scene2.isActive()); - - + QVERIFY(!scene1.hasFocus()); + QVERIFY(scene2.hasFocus()); } QVERIFY(!scene1.isActive()); QVERIFY(!scene2.isActive()); + QVERIFY(!scene1.hasFocus()); + QVERIFY(!scene2.hasFocus()); { QWidget toplevel3; @@ -4104,6 +4144,9 @@ void tst_QGraphicsScene::isActive() QVERIFY(!scene1.isActive()); QVERIFY(!scene2.isActive()); + QVERIFY(!scene1.hasFocus()); + QVERIFY(!scene2.hasFocus()); + toplevel3.show(); QApplication::setActiveWindow(&toplevel3); @@ -4112,23 +4155,30 @@ void tst_QGraphicsScene::isActive() QVERIFY(scene1.isActive()); QVERIFY(!scene2.isActive()); + QVERIFY(scene1.hasFocus()); + QVERIFY(!scene2.hasFocus()); layout->addWidget(view2); QApplication::processEvents(); QVERIFY(scene1.isActive()); QVERIFY(scene2.isActive()); + QVERIFY(scene1.hasFocus()); + QVERIFY(!scene2.hasFocus()); view1->setParent(0); QVERIFY(!scene1.isActive()); QVERIFY(scene2.isActive()); + QVERIFY(!scene1.hasFocus()); + QVERIFY(scene2.hasFocus()); delete view1; } QVERIFY(!scene1.isActive()); QVERIFY(!scene2.isActive()); + QVERIFY(!scene1.hasFocus()); + QVERIFY(!scene2.hasFocus()); } - QTEST_MAIN(tst_QGraphicsScene) #include "tst_qgraphicsscene.moc" diff --git a/tests/auto/qgraphicsview/tst_qgraphicsview.cpp b/tests/auto/qgraphicsview/tst_qgraphicsview.cpp index f07453c..1ff06c2 100644 --- a/tests/auto/qgraphicsview/tst_qgraphicsview.cpp +++ b/tests/auto/qgraphicsview/tst_qgraphicsview.cpp @@ -3600,6 +3600,7 @@ void tst_QGraphicsView::inputMethodSensitivity() item->setFlag(QGraphicsItem::ItemIsFocusable); scene.addItem(item); scene.setFocusItem(item); + QCOMPARE(scene.focusItem(), item); QCOMPARE(view.testAttribute(Qt::WA_InputMethodEnabled), true); item->setFlag(QGraphicsItem::ItemAcceptsInputMethod, false); @@ -3614,27 +3615,35 @@ void tst_QGraphicsView::inputMethodSensitivity() scene.addItem(item2); scene.setFocusItem(item2); QCOMPARE(view.testAttribute(Qt::WA_InputMethodEnabled), false); + QCOMPARE(scene.focusItem(), item2); scene.setFocusItem(item); QCOMPARE(view.testAttribute(Qt::WA_InputMethodEnabled), true); + QCOMPARE(scene.focusItem(), item); view.setScene(0); QCOMPARE(view.testAttribute(Qt::WA_InputMethodEnabled), false); + QCOMPARE(scene.focusItem(), item); view.setScene(&scene); QCOMPARE(view.testAttribute(Qt::WA_InputMethodEnabled), true); + QCOMPARE(scene.focusItem(), item); scene.setFocusItem(item2); QCOMPARE(view.testAttribute(Qt::WA_InputMethodEnabled), false); + QCOMPARE(scene.focusItem(), item2); view.setScene(0); QCOMPARE(view.testAttribute(Qt::WA_InputMethodEnabled), false); + QCOMPARE(scene.focusItem(), item2); scene.setFocusItem(item); QCOMPARE(view.testAttribute(Qt::WA_InputMethodEnabled), false); + QCOMPARE(scene.focusItem(), item); view.setScene(&scene); QCOMPARE(view.testAttribute(Qt::WA_InputMethodEnabled), true); + QCOMPARE(scene.focusItem(), item); } class InputContextTester : public QInputContext -- cgit v0.12 From ecc202c0410125c944f156b5d0de67f093c02723 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Tue, 17 Nov 2009 10:21:48 +0100 Subject: Fix long text regression in listview that does not fits into the viewport. In commit f44fe888ee82b9e04, we adjusted the item size to the size of the viewport. It should really be adjusted to the size of the content. Task-number: QTBUG-5854 Reviewed-by: Gabi --- src/gui/itemviews/qlistview.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/itemviews/qlistview.cpp b/src/gui/itemviews/qlistview.cpp index 15db9a6..c6622cb 100644 --- a/src/gui/itemviews/qlistview.cpp +++ b/src/gui/itemviews/qlistview.cpp @@ -972,9 +972,9 @@ void QListView::paintEvent(QPaintEvent *e) option.rect = visualRect(*it); if (flow() == TopToBottom) - option.rect.setWidth(qMin(viewport()->size().width() - 2 * d->spacing(), option.rect.width())); + option.rect.setWidth(qMin(d->contentsSize().width() - 2 * d->spacing(), option.rect.width())); else - option.rect.setHeight(qMin(viewport()->size().height() - 2 * d->spacing(), option.rect.height())); + option.rect.setHeight(qMin(d->contentsSize().height() - 2 * d->spacing(), option.rect.height())); option.state = state; if (selections && selections->isSelected(*it)) -- cgit v0.12 From bf5754e0da8c8f783b8e1e7be341a6a4979d1939 Mon Sep 17 00:00:00 2001 From: tomyri Date: Mon, 2 Nov 2009 16:05:15 +0200 Subject: e32def.h include removes TRUE/FALSE redifine warnings on Symbian with gcce compiler Signed-off-by: axis axis: While the fix seems to break our policy of having no system headers included from qglobal.h, it should be harmless since e32def.h is to Symbian what stddef.h is to POSIX. --- src/corelib/global/qglobal.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index 9558256..2e9f839 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -910,6 +910,8 @@ QT_END_INCLUDE_NAMESPACE /* Symbian OS defines TRUE = 1 and FALSE = 0, redefine to built-in booleans to make autotests work properly */ #ifdef Q_OS_SYMBIAN + #include /* Symbian OS defines */ + #undef TRUE #undef FALSE #endif -- cgit v0.12 From 75ebdd04f41dd75be1e046a1c54ced0bfb78a0f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sami=20Meril=C3=A4?= Date: Tue, 17 Nov 2009 13:02:42 +0200 Subject: LineEdit graphics are sometimes missing from webpages with s60style If the webpage does define BODY colors for background, it is possible that lineEdits are not drawn at all. Actually, they are drawn but with transparent background, which makes them near-invisible. This is due to that QS60Style tries to check if the themePalette has been changed and if it has forwards the drawing of that particular widget to common style. Common style unfortunately uses active style's palette to draw the widget. S60Style defines Base to be transparent (to get the theme background shine through) and common style tries to use Base to draw lineEdit. End result is transparent lineEdit on webpage. This fix makes more educated deduction when it tries to see if style has been changed. This is related to QTBUG-4885. Task-number: QTBUG-4885 Reviewed-by: Janne Koskinen --- src/gui/styles/qs60style.cpp | 64 +++++++++++++++++++++++++++----------------- src/gui/styles/qs60style_p.h | 4 +++ 2 files changed, 43 insertions(+), 25 deletions(-) diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index 7c3e11f..467cc84 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -867,6 +867,13 @@ QSize QS60StylePrivate::partSize(QS60StyleEnums::SkinParts part, SkinElementFlag return result; } +bool QS60StylePrivate::canDrawThemeBackground(const QBrush &backgroundBrush) +{ + //If brush is not changed from style's default values, draw theme graphics. + return (backgroundBrush.color() == Qt::transparent || + backgroundBrush.style() == Qt::NoBrush) ? true : false; +} + /*! \class QS60Style \brief The QS60Style class provides a look and feel suitable for applications on S60. @@ -1380,8 +1387,10 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option, highlightRect = option->rect.adjusted(xBeginning, yBeginning, xEnd, yEnd); } if (vopt->showDecorationSelected && - (vopt->palette.highlight().color() == d->themePalette()->highlight().color())) + (vopt->palette.highlight().color() == QS60StylePrivate::themePalette()->highlight().color())) QS60StylePrivate::drawSkinElement(QS60StylePrivate::SE_ListHighlight, painter, highlightRect, flags); + else + painter->fillRect(highlightRect, vopt->palette.highlight()); } // draw the icon @@ -1853,7 +1862,7 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option, case CE_ShapedFrame: if (const QTextEdit *textEdit = qobject_cast(widget)) { const QStyleOptionFrame *frame = qstyleoption_cast(option); - if (frame->palette.base().color()==Qt::transparent) + if (QS60StylePrivate::canDrawThemeBackground(frame->palette.base())) QS60StylePrivate::drawSkinElement(QS60StylePrivate::SE_Editor, painter, option->rect, flags); else QCommonStyle::drawControl(element, option, painter, widget); @@ -1927,7 +1936,7 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option, if (option->state & State_Sunken && option->state & State_Enabled) { painter->save(); painter->setOpacity(0.5); - painter->setBrush(d->themePalette()->light()); + painter->setBrush(QS60StylePrivate::themePalette()->light()); painter->setRenderHint(QPainter::Antialiasing); const qreal roundRectRadius = 4 * goldenRatio; painter->drawRoundedRect(option->rect, roundRectRadius, roundRectRadius); @@ -1946,6 +1955,8 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti { Q_D(const QS60Style); const QS60StylePrivate::SkinElementFlags flags = (option->state & State_Enabled) ? QS60StylePrivate::SF_StateEnabled : QS60StylePrivate::SF_StateDisabled; + bool commonStyleDraws = false; + switch (element) { #ifndef QT_NO_LINEEDIT case PE_PanelLineEdit: @@ -1954,12 +1965,10 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti if (widget && qobject_cast(widget->parentWidget())) break; #endif - QBrush editBrush = option->palette.brush(QPalette::Base); - if (editBrush.color() == Qt::transparent) - QS60StylePrivate::drawSkinElement(QS60StylePrivate::SE_FrameLineEdit, - painter, option->rect, flags); + if (QS60StylePrivate::canDrawThemeBackground(option->palette.base())) + QS60StylePrivate::drawSkinElement(QS60StylePrivate::SE_FrameLineEdit, painter, option->rect, flags); else - QCommonStyle::drawPrimitive(element, option, painter, widget); + commonStyleDraws = true; } break; #endif // QT_NO_LINEEDIT @@ -1969,10 +1978,13 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti const QS60StyleEnums::SkinParts skinPart = (option->state & QStyle::State_On) ? QS60StyleEnums::SP_QgnIndiCheckboxOn : QS60StyleEnums::SP_QgnIndiCheckboxOff; painter->save(); - QColor themeColor = d->s60Color(QS60StyleEnums::CL_QsnIconColors, 13, option); - QColor buttonTextColor = option->palette.buttonText().color(); - if (themeColor != buttonTextColor) - painter->setPen(buttonTextColor); + + QColor themeColor = QS60StylePrivate::themePalette()->windowText().color(); + QColor windowTextColor = option->palette.windowText().color(); + + if (themeColor != windowTextColor) + painter->setPen(windowTextColor); + QS60StylePrivate::drawSkinPart(skinPart, painter, option->rect, flags | QS60StylePrivate::SF_ColorSkinned ); painter->restore(); } @@ -2019,6 +2031,8 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti QColor buttonTextColor = option->palette.buttonText().color(); if (themeColor != buttonTextColor) painter->setPen(buttonTextColor); + else + painter->setPen(themeColor); // Draw radiobutton indicator as color skinned graphics. QS60StyleEnums::SkinParts skinPart = (option->state & QStyle::State_On) ? @@ -2032,14 +2046,13 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti case PE_PanelButtonTool: case PE_PanelButtonBevel: case PE_FrameButtonBevel: { - QBrush editBrush = option->palette.brush(QPalette::Base); - if (editBrush.color() == Qt::transparent) { + if (QS60StylePrivate::canDrawThemeBackground(option->palette.base())) { const bool isPressed = option->state & QStyle::State_Sunken; const QS60StylePrivate::SkinElements skinElement = isPressed ? QS60StylePrivate::SE_ButtonPressed : QS60StylePrivate::SE_ButtonNormal; QS60StylePrivate::drawSkinElement(skinElement, painter, option->rect, flags); } else { - QCommonStyle::drawPrimitive(element, option, painter, widget); + commonStyleDraws = true; } } break; @@ -2067,7 +2080,7 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti case PE_IndicatorSpinUp: if (const QStyleOptionSpinBox *spinBox = qstyleoption_cast(option)) { QStyleOptionSpinBox optionSpinBox = *spinBox; - if (optionSpinBox.palette.base().color()==Qt::transparent) { + if (QS60StylePrivate::canDrawThemeBackground(optionSpinBox.palette.base())) { const QS60StyleEnums::SkinParts part = (element == PE_IndicatorSpinUp) ? QS60StyleEnums::SP_QgnGrafScrollArrowUp : QS60StyleEnums::SP_QgnGrafScrollArrowDown; @@ -2075,12 +2088,12 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti optionSpinBox.rect.translate(0, (element == PE_IndicatorSpinDown) ? adjustment : -adjustment ); QS60StylePrivate::drawSkinPart(part, painter, optionSpinBox.rect,flags); } else { - QCommonStyle::drawPrimitive(element, &optionSpinBox, painter, widget); + commonStyleDraws = true; } } #ifndef QT_NO_COMBOBOX else if (const QStyleOptionFrame *cmb = qstyleoption_cast(option)) { - if (cmb->palette.base().color()==Qt::transparent) { + if (QS60StylePrivate::canDrawThemeBackground( option->palette.base())) { // We want to draw down arrow here for comboboxes as well. const QS60StyleEnums::SkinParts part = QS60StyleEnums::SP_QgnGrafScrollArrowDown; QStyleOptionFrame comboBox = *cmb; @@ -2088,7 +2101,7 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti comboBox.rect.translate(0, (element == PE_IndicatorSpinDown) ? adjustment : -adjustment ); QS60StylePrivate::drawSkinPart(part, painter, comboBox.rect,flags); } else { - QCommonStyle::drawPrimitive(element, cmb, painter, widget); + commonStyleDraws = true; } } #endif //QT_NO_COMBOBOX @@ -2119,12 +2132,10 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti || qobject_cast (widget) #endif //QT_NO_MENU ) { - if (option->palette.base().color()==Qt::transparent) { - QS60StylePrivate::SkinElements skinElement = QS60StylePrivate::SE_OptionsMenu; - QS60StylePrivate::drawSkinElement(skinElement, painter, option->rect, flags); - } else { - QCommonStyle::drawPrimitive(element, option, painter, widget); - } + if (QS60StylePrivate::canDrawThemeBackground(option->palette.base())) + QS60StylePrivate::drawSkinElement(QS60StylePrivate::SE_OptionsMenu, painter, option->rect, flags); + else + commonStyleDraws = true; } break; case PE_FrameWindow: @@ -2256,6 +2267,9 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti #endif //QT_NO_COLUMNVIEW case PE_FrameTabBarBase: // since tabs are in S60 always in navipane, let's use common style for tab base in Qt. default: + commonStyleDraws = true; + } + if (commonStyleDraws) { QCommonStyle::drawPrimitive(element, option, painter, widget); } } diff --git a/src/gui/styles/qs60style_p.h b/src/gui/styles/qs60style_p.h index cfe87ac..ea86bb2 100644 --- a/src/gui/styles/qs60style_p.h +++ b/src/gui/styles/qs60style_p.h @@ -453,6 +453,10 @@ public: static QSize naviPaneSize(); + //Checks that the current brush is transparent or has BrushStyle NoBrush, + //so that theme graphic background can be drawn. + static bool canDrawThemeBackground(const QBrush &backgroundBrush); + private: static void drawPart(QS60StyleEnums::SkinParts part, QPainter *painter, const QRect &rect, SkinElementFlags flags = KDefaultSkinElementFlags); -- cgit v0.12 From 53112dfd0b20abcf0448fbc25728f8b8534ba81b Mon Sep 17 00:00:00 2001 From: Frans Englich Date: Mon, 16 Nov 2009 16:47:10 +0100 Subject: Document the state of support in Symbian. The content was compiled primarily by asking the members of the S60 team. Reviewed-by: David Boddie --- doc/src/platforms/supported-platforms.qdoc | 2 +- doc/src/platforms/symbian-support.qdoc | 126 +++++++++++++++++++++++++++++ 2 files changed, 127 insertions(+), 1 deletion(-) create mode 100644 doc/src/platforms/symbian-support.qdoc diff --git a/doc/src/platforms/supported-platforms.qdoc b/doc/src/platforms/supported-platforms.qdoc index 560ddfe..2b4792f 100644 --- a/doc/src/platforms/supported-platforms.qdoc +++ b/doc/src/platforms/supported-platforms.qdoc @@ -89,7 +89,7 @@ \o gcc (\l{http://www.codesourcery.com/}{Codesourcery version)} \row \o Windows CE 5.0 (ARMv4i, x86, MIPS) \o MSVC 2005 WinCE 5.0 Standard (x86, pocket, smart, mipsii) - \row \o Symbian (S60 3.1, 3.2 and 5.0) + \row \o \l {Qt for Symbian} {Symbian (S60 3.1, 3.2 and 5.0)} \o RVCT, GCCE, WINSCW \endtable diff --git a/doc/src/platforms/symbian-support.qdoc b/doc/src/platforms/symbian-support.qdoc new file mode 100644 index 0000000..f0109a9 --- /dev/null +++ b/doc/src/platforms/symbian-support.qdoc @@ -0,0 +1,126 @@ +/**************************************************************************** +** +** 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 symbian-support.html + \title Qt for Symbian + \ingroup platform-specific + \brief Information about the state of support for the Symbian platform. + + Qt for Symbian is not yet fully on a par with other platforms with respect + to stability and feature support. This page documents the current shortcomings + of the Symbian port. + + \section1 Source Compatibility + + Qt for Symbian provides the same level of source compatibility guarantee as + given for other platforms.  That is, a program which compiles against a + given version of Qt for Symbian will also compile against all future versions. + + \section1 Binary Compatibility + + As with every supported platform, we will strive to maintain + application behavior and binary compatibility throughout the lifetime of + the Qt 4.x series. However, due to the fact that Symbian support is + newly added in 4.6.0, it is possible that minor corrections to the + behavior and to the ABI in 4.6.1 will be required in order to ensure + compatibility going forward. + + + \section1 Supported Devices + + Qt should work on all phones which run one of the following versions of S60: + + \table + \header \o S60 version + \row \o 3.1 + \row \o 3.2 + \row \o 5.0 + \endtable + + Qt has received Tier 1 testing on the following phone models: + + \table + \header \o Phone + \row \o Nokia E71 + \row \o Nokia E72 + \row \o Nokia 5800 + \endtable + + \section1 Supported Functionality + + The following technologies and classes are not supported: + + \table + \header \o Technology + \o Note + \row \o QtConcurrent + \o + \row \o QtDBus + \o Will never be supported. + \row \o QtOpenGL + \o Support for OpenGL ES may arrive in a future release. + \row \o Printing support + \o + \row \o Backend for QtMultimedia + \o Although the module itself is supported, no backend for Symbian + is available. However, there is a backend available for Phonon. + \row \o Qt3Support + \o Will never be supported. + \row \o QtSql: SQLite as driver + \o The only driver supported is SQLite. + \row \o Developer Tools + \o Developer tools such as Designer, Assistant and Creator do not + run on Symbian OS. + \endtable + + + \section1 Known Issues + + Known issues can be found by visiting the + \l{http://qt.gitorious.org/qt/pages/Qt460KnownIssues}{wiki page} with an + up-to-date list of known known issues, or by + \l{http://bugreports.qt.nokia.com/browse/QTBUG/component/19171}{browsing} the + S60 component in Qt's public task tracker, located at + \l{http://bugreports.qt.nokia.com/}{http://bugreports.qt.nokia.com/}. + +*/ + -- cgit v0.12 From 97143d9c719951b85964a31c5e19bfeaddce9bae Mon Sep 17 00:00:00 2001 From: Frans Englich Date: Tue, 17 Nov 2009 13:04:17 +0100 Subject: Fix typo. Reviewed-by: TrustMe --- doc/src/platforms/symbian-support.qdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/src/platforms/symbian-support.qdoc b/doc/src/platforms/symbian-support.qdoc index f0109a9..9362aea 100644 --- a/doc/src/platforms/symbian-support.qdoc +++ b/doc/src/platforms/symbian-support.qdoc @@ -117,7 +117,7 @@ Known issues can be found by visiting the \l{http://qt.gitorious.org/qt/pages/Qt460KnownIssues}{wiki page} with an - up-to-date list of known known issues, or by + up-to-date list of known issues, or by \l{http://bugreports.qt.nokia.com/browse/QTBUG/component/19171}{browsing} the S60 component in Qt's public task tracker, located at \l{http://bugreports.qt.nokia.com/}{http://bugreports.qt.nokia.com/}. -- cgit v0.12 From 4297b85a83408f86f2bd4df0f3b7bc98bf900fbe Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Tue, 17 Nov 2009 13:25:49 +0100 Subject: Fix pixel alignment of glyphs when using raster engine on Mac Cocoa The left bearing of the glyph has to be rounded before truncated, otherwise the subpixel positioning of the glyph will be lost. The visible consequence of this was on Mac Cocoa where certain pairs of glyphs would get an extra pixel of space between them when running with graphics system raster. With small fonts it would look pretty bad. Task-number: QTBUG-5430 Reviewed-by: Trond --- src/gui/painting/qtextureglyphcache.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/painting/qtextureglyphcache.cpp b/src/gui/painting/qtextureglyphcache.cpp index a192e87..46fbaa9 100644 --- a/src/gui/painting/qtextureglyphcache.cpp +++ b/src/gui/painting/qtextureglyphcache.cpp @@ -101,7 +101,7 @@ void QTextureGlyphCache::populate(const QTextItemInt &ti, Coord c = { 0, 0, // will be filled in later glyph_width, glyph_height, // texture coords - metrics.x.truncate(), + metrics.x.round().truncate(), -metrics.y.truncate() }; // baseline for horizontal scripts listItemCoordinates.insert(glyph, c); -- cgit v0.12 From cfa2c8edab18e810749ad7df29c0b3b4f83f7140 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Trond=20Kjern=C3=A5sen?= Date: Tue, 17 Nov 2009 15:37:25 +0100 Subject: Fixed a crash on Mac in QPixmap when loading pixmaps of different sizes. The size of the original pixmap data block wasn't retained, which would result in out-of-bound reads in the memcpy() call. Task-number: QTBUG-5070 Reviewed-by: Kim --- src/gui/image/qpixmap_mac.cpp | 7 ++++--- src/gui/image/qpixmap_mac_p.h | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/gui/image/qpixmap_mac.cpp b/src/gui/image/qpixmap_mac.cpp index 6175931..365c271 100644 --- a/src/gui/image/qpixmap_mac.cpp +++ b/src/gui/image/qpixmap_mac.cpp @@ -160,8 +160,8 @@ QSet QMacPixmapData::validDataPointers; QMacPixmapData::QMacPixmapData(PixelType type) : QPixmapData(type, MacClass), has_alpha(0), has_mask(0), - uninit(true), pixels(0), pixelsToFree(0), bytesPerRow(0), - cg_data(0), cg_dataBeingReleased(0), cg_mask(0), + uninit(true), pixels(0), pixelsSize(0), pixelsToFree(0), + bytesPerRow(0), cg_data(0), cg_dataBeingReleased(0), cg_mask(0), pengine(0) { } @@ -637,8 +637,9 @@ void QMacPixmapData::macCreatePixels() } if (pixels) - memcpy(base_pixels, pixels, numBytes); + memcpy(base_pixels, pixels, pixelsSize); pixels = base_pixels; + pixelsSize = numBytes; } #if 0 diff --git a/src/gui/image/qpixmap_mac_p.h b/src/gui/image/qpixmap_mac_p.h index a3fb95f..45ab8e2 100644 --- a/src/gui/image/qpixmap_mac_p.h +++ b/src/gui/image/qpixmap_mac_p.h @@ -107,6 +107,7 @@ private: pixelsToFree later on instead of malloc'ing memory. */ quint32 *pixels; + uint pixelsSize; quint32 *pixelsToFree; uint bytesPerRow; QRectF cg_mask_rect; -- cgit v0.12 From 6ae54df86262a8128f15deb067dd1117a14e715e Mon Sep 17 00:00:00 2001 From: axis Date: Tue, 17 Nov 2009 15:56:59 +0100 Subject: Removed drilldown from fluidlauncher demo. It has too many problems at the moment, like taking up too much space and not being able to close the popup window. RevBy: Alessandro Portale --- demos/embedded/fluidlauncher/config_s60/config.xml | 1 - demos/embedded/fluidlauncher/fluidlauncher.pro | 3 --- .../fluidlauncher/screenshots/drilldown_s60.png | Bin 47687 -> 0 bytes 3 files changed, 4 deletions(-) delete mode 100644 demos/embedded/fluidlauncher/screenshots/drilldown_s60.png diff --git a/demos/embedded/fluidlauncher/config_s60/config.xml b/demos/embedded/fluidlauncher/config_s60/config.xml index 2c61baf..176f52e 100644 --- a/demos/embedded/fluidlauncher/config_s60/config.xml +++ b/demos/embedded/fluidlauncher/config_s60/config.xml @@ -11,7 +11,6 @@ - diff --git a/demos/embedded/fluidlauncher/fluidlauncher.pro b/demos/embedded/fluidlauncher/fluidlauncher.pro index dd931e6..30f59c3 100644 --- a/demos/embedded/fluidlauncher/fluidlauncher.pro +++ b/demos/embedded/fluidlauncher/fluidlauncher.pro @@ -70,7 +70,6 @@ symbian { saxbookmarks.exe \ desktopservices.exe \ fridgemagnets.exe \ - drilldown.exe \ softkeys.exe \ raycasting.exe \ flickable.exe \ @@ -89,7 +88,6 @@ symbian { $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/saxbookmarks_reg.rsc \ $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/desktopservices_reg.rsc \ $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/fridgemagnets_reg.rsc \ - $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/drilldown_reg.rsc \ $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/softkeys_reg.rsc \ $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/raycasting_reg.rsc \ $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/flickable_reg.rsc \ @@ -113,7 +111,6 @@ symbian { $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/saxbookmarks.rsc \ $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/desktopservices.rsc \ $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/fridgemagnets.rsc \ - $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/drilldown.rsc \ $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/softkeys.rsc \ $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/raycasting.rsc \ $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/flickable.rsc \ diff --git a/demos/embedded/fluidlauncher/screenshots/drilldown_s60.png b/demos/embedded/fluidlauncher/screenshots/drilldown_s60.png deleted file mode 100644 index d4fd44f..0000000 Binary files a/demos/embedded/fluidlauncher/screenshots/drilldown_s60.png and /dev/null differ -- cgit v0.12 From 39463ccddd6f8c071da90e995ba5e76518738f94 Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Tue, 17 Nov 2009 16:20:28 +0100 Subject: Mouse wheel wouldn't scroll the itemview when over header views The mouse wheel event was not being relayed to the parent (supposedly QAbstractScrollArea) widget. Auto-test included. Reviewed-by: Olivier Task-number: QTBUG-5237 --- src/gui/itemviews/qheaderview.cpp | 7 ++++++- tests/auto/qtableview/tst_qtableview.cpp | 17 +++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/src/gui/itemviews/qheaderview.cpp b/src/gui/itemviews/qheaderview.cpp index 6f2cff9..5df8481 100644 --- a/src/gui/itemviews/qheaderview.cpp +++ b/src/gui/itemviews/qheaderview.cpp @@ -2396,7 +2396,12 @@ bool QHeaderView::viewportEvent(QEvent *e) d->state = QHeaderViewPrivate::NoState; d->pressed = d->section = d->target = -1; d->updateSectionIndicator(d->section, -1); - } + break; } + case QEvent::Wheel: { + QAbstractScrollArea *asa = qobject_cast(parentWidget()); + if (asa) + return QApplication::sendEvent(asa->viewport(), e); + break; } default: break; } diff --git a/tests/auto/qtableview/tst_qtableview.cpp b/tests/auto/qtableview/tst_qtableview.cpp index f571e8a..33c7067 100644 --- a/tests/auto/qtableview/tst_qtableview.cpp +++ b/tests/auto/qtableview/tst_qtableview.cpp @@ -198,6 +198,7 @@ private slots: void task191545_dragSelectRows(); void taskQTBUG_5062_spansInconsistency(); void taskQTBUG_4516_clickOnRichTextLabel(); + void taskQTBUG_5237_wheelEventOnHeader(); void mouseWheel_data(); void mouseWheel(); @@ -3922,6 +3923,22 @@ void tst_QTableView::changeHeaderData() QVERIFY(view.verticalHeader()->width() > textWidth); } +void tst_QTableView::taskQTBUG_5237_wheelEventOnHeader() +{ + QTableView view; + QStandardItemModel model(500,5); + view.setModel(&model); + view.show(); + QTest::qWaitForWindowShown(&view); + + int sbValueBefore = view.verticalScrollBar()->value(); + QHeaderView *header = view.verticalHeader(); + QTest::mouseMove(header); + QWheelEvent wheelEvent(header->geometry().center(), -720, 0, 0); + QApplication::sendEvent(header->viewport(), &wheelEvent); + int sbValueAfter = view.verticalScrollBar()->value(); + QVERIFY(sbValueBefore != sbValueAfter); +} QTEST_MAIN(tst_QTableView) #include "tst_qtableview.moc" -- cgit v0.12 From 7bb7914a183694be43029ed4c39651f3d95cfe67 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Tue, 17 Nov 2009 16:19:53 +0100 Subject: Warning Fixes --- src/gui/painting/qblendfunctions.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/gui/painting/qblendfunctions.cpp b/src/gui/painting/qblendfunctions.cpp index b92c5c2..1d15dac 100644 --- a/src/gui/painting/qblendfunctions.cpp +++ b/src/gui/painting/qblendfunctions.cpp @@ -739,10 +739,6 @@ template void qt_scale_image_32bit(uchar *destPixels, int dbpl, quint32 basex; quint32 srcy; - const int dstx = qCeil((tx1 + 0.5 - qMin(targetRect.left(), targetRect.right())) * ix) - 1; - const int dsty = qCeil((ty1 + 0.5 - qMin(targetRect.top(), targetRect.bottom())) * iy) - 1; - - if (sx < 0) { int dstx = qFloor((tx1 + qreal(0.5) - targetRect.right()) * ix) + 1; basex = quint32(srcRect.right() * 65536) + dstx; -- cgit v0.12 From a380c528344d35a20078c7cc37bcbac3b607e618 Mon Sep 17 00:00:00 2001 From: Marius Bugge Monsen Date: Tue, 17 Nov 2009 16:45:44 +0100 Subject: Fix compile issues on AIX with the XLC compiler. The compiler is not smart enough to figure out the type of arguments in QCOMPARE, so we have to explicitly cast. This is also a problem with the Metrowerks compiler, and the cast is safe, so remove the #ifdef and always cast. Reviewer-by: Olivier Goffart --- tests/auto/qcombobox/tst_qcombobox.cpp | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/tests/auto/qcombobox/tst_qcombobox.cpp b/tests/auto/qcombobox/tst_qcombobox.cpp index e903ab5..af71961 100644 --- a/tests/auto/qcombobox/tst_qcombobox.cpp +++ b/tests/auto/qcombobox/tst_qcombobox.cpp @@ -2290,11 +2290,8 @@ void tst_QComboBox::setItemDelegate() QComboBox comboBox; QStyledItemDelegate *itemDelegate = new QStyledItemDelegate; comboBox.setItemDelegate(itemDelegate); -#ifdef Q_CC_MWERKS + // the cast is a workaround for the XLC and Metrowerks compilers QCOMPARE(static_cast(comboBox.itemDelegate()), itemDelegate); -#else - QCOMPARE(comboBox.itemDelegate(), itemDelegate); -#endif } void tst_QComboBox::task253944_itemDelegateIsReset() @@ -2303,19 +2300,13 @@ void tst_QComboBox::task253944_itemDelegateIsReset() QStyledItemDelegate *itemDelegate = new QStyledItemDelegate; comboBox.setItemDelegate(itemDelegate); + // the casts are workarounds for the XLC and Metrowerks compilers + comboBox.setEditable(true); -#ifdef Q_CC_MWERKS QCOMPARE(static_cast(comboBox.itemDelegate()), itemDelegate); -#else - QCOMPARE(comboBox.itemDelegate(), itemDelegate); -#endif comboBox.setStyleSheet("QComboBox { border: 1px solid gray; }"); -#ifdef Q_CC_MWERKS QCOMPARE(static_cast(comboBox.itemDelegate()), itemDelegate); -#else - QCOMPARE(comboBox.itemDelegate(), itemDelegate); -#endif } -- cgit v0.12