From 41754fdb11a4d78b7b756b82d4ead235b6618687 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sami=20Meril=C3=A4?= Date: Mon, 7 Dec 2009 14:59:07 +0200 Subject: FEP returns the wrong foreground color in GetFormatOfFepInlineText When using T9, FEP is always using black text color. This is due to that we use default parameters for TFontPresentation. If we change the text color according to style, before calling GetFormatOfFepInlineText, it uses color value from style. Task-number: QTBUG-4072 Reviewed-by: axis --- src/gui/inputmethod/qcoefepinputcontext_s60.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp index bdff5e7..a295d66 100644 --- a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp +++ b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp @@ -437,6 +437,10 @@ void QCoeFepInputContext::applyHints(Qt::InputMethodHints hints) void QCoeFepInputContext::applyFormat(QList *attributes) { TCharFormat cFormat; + QColor styleTextColor = QApplication::palette("QLineEdit").text().color(); + TLogicalRgb tontColor(TRgb(styleTextColor.red(), styleTextColor.green(), styleTextColor.blue(), styleTextColor.alpha())); + cFormat.iFontPresentation.iTextColor = tontColor; + TInt numChars = 0; TInt charPos = 0; int oldSize = attributes->size(); -- cgit v0.12 From 05d4b4c72a5089885c1515833e34177607c2c511 Mon Sep 17 00:00:00 2001 From: Rhys Weatherley Date: Tue, 8 Dec 2009 11:02:46 +1000 Subject: Fix GL_BGRA formats under OpenGL/ES systems OpenGL/ES requires that the internal and external formats be the same when calling glTexImage2D(). This caused problems with devices that had the GL_EXT_bgra extension. This change makes the formats the same just before the upload and also makes sure that the pixel type is GL_UNSIGNED_BYTE when GL_BGRA is used. No change for desktop systems. Reviewed-by: Donald Carr --- src/opengl/qgl.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp index 1ff102f..967ba48 100644 --- a/src/opengl/qgl.cpp +++ b/src/opengl/qgl.cpp @@ -2234,6 +2234,14 @@ QGLTexture* QGLContextPrivate::bindTexture(const QImage &image, GLenum target, G } } } +#ifdef QT_OPENGL_ES + // OpenGL/ES requires that the internal and external formats be identical. + // This is typically used to convert GL_RGBA into GL_BGRA. + // Also, we need to use GL_UNSIGNED_BYTE when the format is GL_BGRA. + internalFormat = externalFormat; + if (pixel_type == GL_UNSIGNED_INT_8_8_8_8_REV) + pixel_type = GL_UNSIGNED_BYTE; +#endif #ifdef QGL_BIND_TEXTURE_DEBUG printf(" - uploading, image.format=%d, externalFormat=0x%x, internalFormat=0x%x, pixel_type=0x%x\n", img.format(), externalFormat, internalFormat, pixel_type); -- cgit v0.12 From 854d8960b98a691094ac51ad69b60d6a3a798ac2 Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Tue, 8 Dec 2009 09:57:08 +0200 Subject: Minor fixes to softkey dimming support (commit 245c9cc0). In Qt invisible actions are disabled by default, and our "Options" softkey is set to invisible in order that it is not show in context menu. Thus we need don't want to dim in softkey even it is disabled. Additionally, QDialogButtonEnabledProxy need to set the initial enabled state for proxy action from button. Fixes bugs in commit: 245c9cc0 Reviewed-by: TrustMe --- src/gui/kernel/qsoftkeymanager.cpp | 6 +++++- src/gui/widgets/qdialogbuttonbox.cpp | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/gui/kernel/qsoftkeymanager.cpp b/src/gui/kernel/qsoftkeymanager.cpp index 464a250..0e98f39 100644 --- a/src/gui/kernel/qsoftkeymanager.cpp +++ b/src/gui/kernel/qsoftkeymanager.cpp @@ -250,13 +250,17 @@ void QSoftKeyManagerPrivate::updateSoftKeys_sys(const QList &softkeys) ? EAknSoftkeyOptions : s60CommandStart + index; + // _q_menuSoftKeyAction action is set to "invisible" and all invisible actions are by default + // disabled. However we never want to dim options softkey, even it is set to "invisible" + bool dimmed = (command == EAknSoftkeyOptions) ? false : !softKeyAction->isEnabled(); + if (position != -1) { const int underlineShortCut = QApplication::style()->styleHint(QStyle::SH_UnderlineShortcut); QString iconText = softKeyAction->iconText(); TPtrC text = qt_QString2TPtrC( underlineShortCut ? softKeyAction->text() : iconText); QT_TRAP_THROWING( nativeContainer->SetCommandL(position, command, text); - nativeContainer->DimCommand(command, !softKeyAction->isEnabled()); + nativeContainer->DimCommand(command, dimmed); ); } } diff --git a/src/gui/widgets/qdialogbuttonbox.cpp b/src/gui/widgets/qdialogbuttonbox.cpp index 56cf545..9512785 100644 --- a/src/gui/widgets/qdialogbuttonbox.cpp +++ b/src/gui/widgets/qdialogbuttonbox.cpp @@ -265,6 +265,7 @@ public: QDialogButtonEnabledProxy(QObject *parent, QWidget *src, QAction *trg) : QObject(parent), source(src), target(trg) { source->installEventFilter(this); + target->setEnabled(source->isEnabled()); } ~QDialogButtonEnabledProxy() { -- cgit v0.12 From 2e110daa8fb3889036db330837884a6aa61a92a1 Mon Sep 17 00:00:00 2001 From: Alan Alpert Date: Tue, 8 Dec 2009 09:32:49 +0100 Subject: Remove id property from QGraphicsObject It is not actually useful (exact same READ/WRITE as objectName) and is confusing when used in QML. Task-number: QTBUG-6580 Reviewed-by: andreas Reviewed-by: alexis Reviewed-by: ogoffart --- src/gui/graphicsview/qgraphicsitem.cpp | 7 ------- src/gui/graphicsview/qgraphicsitem.h | 1 - 2 files changed, 8 deletions(-) diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp index 9e8d587..9846dbb 100644 --- a/src/gui/graphicsview/qgraphicsitem.cpp +++ b/src/gui/graphicsview/qgraphicsitem.cpp @@ -7292,13 +7292,6 @@ void QGraphicsObject::ungrabGesture(Qt::GestureType gesture) */ /*! - \property QGraphicsObject::id - \brief the id of of the item - - \sa QObject::objectName(), QObject::setObjectName() -*/ - -/*! \property QGraphicsObject::opacity \brief the opacity of the item diff --git a/src/gui/graphicsview/qgraphicsitem.h b/src/gui/graphicsview/qgraphicsitem.h index 8bbe9f1..8818a0b 100644 --- a/src/gui/graphicsview/qgraphicsitem.h +++ b/src/gui/graphicsview/qgraphicsitem.h @@ -537,7 +537,6 @@ class Q_GUI_EXPORT QGraphicsObject : public QObject, public QGraphicsItem { Q_OBJECT Q_PROPERTY(QGraphicsObject * parent READ parentObject WRITE setParentItem NOTIFY parentChanged DESIGNABLE false) - Q_PROPERTY(QString id READ objectName WRITE setObjectName) Q_PROPERTY(qreal opacity READ opacity WRITE setOpacity NOTIFY opacityChanged FINAL) Q_PROPERTY(bool enabled READ isEnabled WRITE setEnabled NOTIFY enabledChanged) Q_PROPERTY(bool visible READ isVisible WRITE setVisible NOTIFY visibleChanged FINAL) -- cgit v0.12 From 4f6dc78fb05026608ffb03dfae905c23a48aac43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Nilsen?= Date: Tue, 8 Dec 2009 11:39:31 +0100 Subject: Doc: Explicitly mention that QWidget/QGraphicsItem takes ownership of effects. --- src/gui/graphicsview/qgraphicsitem.cpp | 2 ++ src/gui/kernel/qwidget.cpp | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp index 9846dbb..90cc132 100644 --- a/src/gui/graphicsview/qgraphicsitem.cpp +++ b/src/gui/graphicsview/qgraphicsitem.cpp @@ -2554,6 +2554,8 @@ QGraphicsEffect *QGraphicsItem::graphicsEffect() const If \a effect is the installed on a different item, setGraphicsEffect() will remove the effect from the item and install it on this item. + QGraphicsItem takes ownership of \a effect. + \note This function will apply the effect on itself and all its children. \since 4.6 diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index 00c7dc0..21aae3e 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -5046,6 +5046,8 @@ QGraphicsEffect *QWidget::graphicsEffect() const If \a effect is the installed on a different widget, setGraphicsEffect() will remove the effect from the widget and install it on this widget. + QWidget takes ownership of \a effect. + \note This function will apply the effect on itself and all its children. \since 4.6 -- cgit v0.12 From 85cd6e646376af5828e66d9df1812759fcf55f03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Nilsen?= Date: Tue, 8 Dec 2009 11:52:20 +0100 Subject: Fixes broken graphics effect auto tests. This broke after commit: fb78a402b512b017c850e7410745c4d20da04a7c Effects and auto-tests are now in line with the documentation. --- tests/auto/qgraphicseffect/tst_qgraphicseffect.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/auto/qgraphicseffect/tst_qgraphicseffect.cpp b/tests/auto/qgraphicseffect/tst_qgraphicseffect.cpp index d216924..259df4d 100644 --- a/tests/auto/qgraphicseffect/tst_qgraphicseffect.cpp +++ b/tests/auto/qgraphicseffect/tst_qgraphicseffect.cpp @@ -196,8 +196,8 @@ void tst_QGraphicsEffect::source() // Uninstall effect on QGraphicsItem. effect->reset(); item->setGraphicsEffect(0); - QVERIFY(!effect->source()); - QVERIFY(effect->m_sourceChangedFlags & QGraphicsEffect::SourceDetached); + QVERIFY(!effect); + effect = new CustomEffect; // The item takes ownership and should delete the effect when destroyed. item->setGraphicsEffect(effect); @@ -249,10 +249,10 @@ void tst_QGraphicsEffect::boundingRect() QCOMPARE(effect->boundingRect(), effect->boundingRectFor(itemRect)); // Uninstall effect on QGraphicsItem. + QPointer ptr = effect; item->setGraphicsEffect(0); - QCOMPARE(effect->boundingRect(), QRectF()); + QVERIFY(!ptr); - delete effect; delete item; } @@ -343,11 +343,11 @@ void tst_QGraphicsEffect::draw() QCOMPARE(item->numRepaints, 0); // Make sure uninstalling an effect triggers a repaint. + QPointer ptr = effect; item->setGraphicsEffect(0); + QVERIFY(!ptr); QTest::qWait(50); - QCOMPARE(effect->numRepaints, 0); QCOMPARE(item->numRepaints, 1); - delete effect; } void tst_QGraphicsEffect::opacity() -- cgit v0.12