diff options
author | Frans Englich <frans.englich@nokia.com> | 2009-08-12 13:40:12 (GMT) |
---|---|---|
committer | Frans Englich <frans.englich@nokia.com> | 2009-08-12 13:40:12 (GMT) |
commit | 3368eea602d394812283d437b5e9d786e1af64e3 (patch) | |
tree | 422b7bc9f6aae4f37908627a9b9f56768f1b9a75 /src | |
parent | 598ee0994a7ca14ef0bc4265dab99d716ba6f189 (diff) | |
parent | f888b7c0934069771812c458faaad12bb72d3971 (diff) | |
download | Qt-3368eea602d394812283d437b5e9d786e1af64e3.zip Qt-3368eea602d394812283d437b5e9d786e1af64e3.tar.gz Qt-3368eea602d394812283d437b5e9d786e1af64e3.tar.bz2 |
Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qt-s60-public
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/graphicsview/qgraphicsitem.cpp | 21 | ||||
-rw-r--r-- | src/gui/kernel/qapplication_s60.cpp | 4 | ||||
-rw-r--r-- | src/gui/styles/qs60style.h | 7 | ||||
-rw-r--r-- | src/gui/styles/qs60style_p.h | 5 | ||||
-rw-r--r-- | src/gui/styles/qs60style_s60.cpp | 20 | ||||
-rw-r--r-- | src/gui/text/qfont.cpp | 4 | ||||
-rw-r--r-- | src/gui/widgets/qlinecontrol.cpp | 39 | ||||
-rw-r--r-- | src/gui/widgets/qlineedit.cpp | 2 | ||||
-rw-r--r-- | src/gui/widgets/qlineedit_p.h | 4 | ||||
-rw-r--r-- | src/network/access/qhttpnetworkconnection_p.h | 2 | ||||
-rw-r--r-- | src/network/access/qnetworkcookie.cpp | 37 | ||||
-rw-r--r-- | src/network/access/qnetworkcookie.h | 4 | ||||
-rw-r--r-- | src/network/access/qnetworkrequest.cpp | 12 | ||||
-rw-r--r-- | src/network/access/qnetworkrequest.h | 4 | ||||
-rw-r--r-- | src/sql/kernel/qsqlfield.cpp | 11 | ||||
-rw-r--r-- | src/sql/kernel/qsqlfield.h | 6 | ||||
-rw-r--r-- | src/sql/kernel/qsqlresult.cpp | 4 |
17 files changed, 82 insertions, 104 deletions
diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp index 1e7708c..7091b5d 100644 --- a/src/gui/graphicsview/qgraphicsitem.cpp +++ b/src/gui/graphicsview/qgraphicsitem.cpp @@ -938,6 +938,17 @@ void QGraphicsItemPrivate::setParentItemHelper(QGraphicsItem *newParent) parent->itemChange(QGraphicsItem::ItemChildRemovedChange, thisPointerVariant); } + // Auto-update focus proxy. Any ancestor that has this as focus proxy + //needs to be nulled. + QGraphicsItem *p = parent; + while (p) { + if ((p->d_ptr->flags & QGraphicsItem::ItemAutoDetectsFocusProxy) && + (p->focusProxy() == q)) { + p->setFocusProxy(0); + } + p = p->d_ptr->parent; + } + // Update toplevelitem list. If this item is being deleted, its parent // will be 0 but we don't want to register/unregister it in the TLI list. if (scene && !inDestructor) { @@ -1016,7 +1027,7 @@ void QGraphicsItemPrivate::setParentItemHelper(QGraphicsItem *newParent) // Auto-update focus proxy. The closest parent that detects // focus proxies is updated as the proxy gains or loses focus. - QGraphicsItem *p = newParent; + p = newParent; while (p) { if (p->d_ptr->flags & QGraphicsItem::ItemAutoDetectsFocusProxy) { p->setFocusProxy(q); @@ -9092,10 +9103,12 @@ void QGraphicsTextItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) if (event->button() == Qt::LeftButton && qApp->autoSipEnabled() && (!dd->clickCausedFocus || qApp->autoSipOnMouseFocus())) { QEvent _event(QEvent::RequestSoftwareInputPanel); - QApplication::sendEvent(event->widget(), &_event); - } else { - QGraphicsItem::mouseReleaseEvent(event); + QWidget *receiver = event->widget(); + if(receiver) { + QApplication::sendEvent(receiver, &_event); + } } + dd->clickCausedFocus = 0; dd->sendControlEvent(event); } diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp index d2183d2..db78349 100644 --- a/src/gui/kernel/qapplication_s60.cpp +++ b/src/gui/kernel/qapplication_s60.cpp @@ -1100,7 +1100,7 @@ void QApplication::symbianResourceChange(int type) s60Style = qobject_cast<QS60Style*>(QApplication::style()); if (s60Style) - s60Style->handleDynamicLayoutVariantSwitch(); + s60Style->d_func()->handleDynamicLayoutVariantSwitch(); #endif } break; @@ -1108,7 +1108,7 @@ void QApplication::symbianResourceChange(int type) #ifndef QT_NO_STYLE_S60 case KAknsMessageSkinChange: if (QS60Style *s60Style = qobject_cast<QS60Style*>(QApplication::style())) - s60Style->handleSkinChange(); + s60Style->d_func()->handleSkinChange(); break; #endif #endif // Q_WS_S60 diff --git a/src/gui/styles/qs60style.h b/src/gui/styles/qs60style.h index bdd8c8a..7711b19 100644 --- a/src/gui/styles/qs60style.h +++ b/src/gui/styles/qs60style.h @@ -89,12 +89,6 @@ public: bool saveS60ThemeToBlob(const QString &blobFile) const; #endif // !Q_WS_S60 -#ifdef Q_WS_S60 -public Q_SLOTS: - void handleDynamicLayoutVariantSwitch(); - void handleSkinChange(); -#endif // Q_WS_S60 - protected Q_SLOTS: QIcon standardIconImplementation( StandardPixmap standardIcon, const QStyleOption * option = 0, const QWidget * widget = 0 ) const; @@ -102,6 +96,7 @@ protected Q_SLOTS: private: Q_DISABLE_COPY(QS60Style) friend class QStyleFactory; + friend class QApplication; }; #endif // QT_NO_STYLE_S60 diff --git a/src/gui/styles/qs60style_p.h b/src/gui/styles/qs60style_p.h index 0cd2310..680d787 100644 --- a/src/gui/styles/qs60style_p.h +++ b/src/gui/styles/qs60style_p.h @@ -455,6 +455,11 @@ public: SkinElementFlags flags = KDefaultSkinElementFlags); static QPixmap backgroundTexture(); +#ifdef Q_WS_S60 + void handleDynamicLayoutVariantSwitch(); + void handleSkinChange(); +#endif // Q_WS_S60 + private: static void drawPart(QS60StyleEnums::SkinParts part, QPainter *painter, const QRect &rect, SkinElementFlags flags = KDefaultSkinElementFlags); diff --git a/src/gui/styles/qs60style_s60.cpp b/src/gui/styles/qs60style_s60.cpp index 635442b..45be2eb 100644 --- a/src/gui/styles/qs60style_s60.cpp +++ b/src/gui/styles/qs60style_s60.cpp @@ -1358,26 +1358,24 @@ QS60Style::QS60Style() { } -void QS60Style::handleDynamicLayoutVariantSwitch() +void QS60StylePrivate::handleDynamicLayoutVariantSwitch() { - Q_D(QS60Style); - d->clearCaches(QS60StylePrivate::CC_LayoutChange); - d->setActiveLayout(); - d->refreshUI(); - d->setBackgroundTexture(qApp); + clearCaches(QS60StylePrivate::CC_LayoutChange); + setActiveLayout(); + refreshUI(); + setBackgroundTexture(qApp); foreach (QWidget *widget, QApplication::allWidgets()) widget->ensurePolished(); } -void QS60Style::handleSkinChange() +void QS60StylePrivate::handleSkinChange() { - Q_D(QS60Style); - d->clearCaches(QS60StylePrivate::CC_ThemeChange); - d->setThemePalette(qApp); + clearCaches(QS60StylePrivate::CC_ThemeChange); + setThemePalette(qApp); foreach (QWidget *topLevelWidget, QApplication::allWidgets()){ QEvent e(QEvent::StyleChange); QApplication::sendEvent(topLevelWidget, &e); - d->setThemePalette(topLevelWidget); + setThemePalette(topLevelWidget); topLevelWidget->ensurePolished(); } } diff --git a/src/gui/text/qfont.cpp b/src/gui/text/qfont.cpp index a575199..c47a834 100644 --- a/src/gui/text/qfont.cpp +++ b/src/gui/text/qfont.cpp @@ -775,7 +775,9 @@ QFont::QFont() Constructs a font object with the specified \a family, \a pointSize, \a weight and \a italic settings. - If \a pointSize is <= 0, it is set to 12. + If \a pointSize is zero or negative, the point size of the font + is set to a system-dependent default value. Generally, this is + 12 points, except on Symbian where it is 7 points. The \a family name may optionally also include a foundry name, e.g. "Helvetica [Cronyx]". If the \a family is diff --git a/src/gui/widgets/qlinecontrol.cpp b/src/gui/widgets/qlinecontrol.cpp index f4a2348..80215e1 100644 --- a/src/gui/widgets/qlinecontrol.cpp +++ b/src/gui/widgets/qlinecontrol.cpp @@ -400,8 +400,17 @@ void QLineControl::moveCursor(int pos, bool mark) */ void QLineControl::processInputMethodEvent(QInputMethodEvent *event) { - int priorState = m_undoState; - removeSelectedText(); + int priorState = 0; + bool isGettingInput = !event->commitString().isEmpty() || !event->preeditString().isEmpty() + || event->replacementLength() > 0; + bool cursorPositionChanged = false; + + if (isGettingInput) { + // If any text is being input, remove selected text. + priorState = m_undoState; + removeSelectedText(); + } + int c = m_cursor; // cursor position after insertion of commit string if (event->replacementStart() <= 0) @@ -415,11 +424,30 @@ void QLineControl::processInputMethodEvent(QInputMethodEvent *event) m_selend = m_selstart + event->replacementLength(); removeSelectedText(); } - if (!event->commitString().isEmpty()) + if (!event->commitString().isEmpty()) { insert(event->commitString()); + cursorPositionChanged = true; + } m_cursor = qMin(c, m_text.length()); + for (int i = 0; i < event->attributes().size(); ++i) { + const QInputMethodEvent::Attribute &a = event->attributes().at(i); + if (a.type == QInputMethodEvent::Selection) { + m_cursor = qBound(0, a.start + a.length, m_text.length()); + if (a.length) { + m_selstart = qMax(0, qMin(a.start, m_text.length())); + m_selend = m_cursor; + if (m_selend < m_selstart) { + qSwap(m_selstart, m_selend); + } + } else { + m_selstart = m_selend = 0; + } + cursorPositionChanged = true; + } + } + setPreeditArea(m_cursor, event->preeditString()); m_preeditCursor = event->preeditString().length(); m_hideCursor = false; @@ -442,9 +470,10 @@ void QLineControl::processInputMethodEvent(QInputMethodEvent *event) } m_textLayout.setAdditionalFormats(formats); updateDisplayText(); - if (!event->commitString().isEmpty()) + if (cursorPositionChanged) emitCursorPositionChanged(); - finishChange(priorState); + if (isGettingInput) + finishChange(priorState); } /*! diff --git a/src/gui/widgets/qlineedit.cpp b/src/gui/widgets/qlineedit.cpp index 5b04616..cd9666d 100644 --- a/src/gui/widgets/qlineedit.cpp +++ b/src/gui/widgets/qlineedit.cpp @@ -1657,7 +1657,7 @@ QVariant QLineEdit::inputMethodQuery(Qt::InputMethodQuery property) const case Qt::ImFont: return font(); case Qt::ImCursorPosition: - return QVariant(d->control->hasSelectedText() ? d->control->selectionEnd() : d->control->cursor()); + return QVariant(d->control->cursor()); case Qt::ImSurroundingText: return QVariant(text()); case Qt::ImCurrentSelection: diff --git a/src/gui/widgets/qlineedit_p.h b/src/gui/widgets/qlineedit_p.h index b21820c..2c0d08f 100644 --- a/src/gui/widgets/qlineedit_p.h +++ b/src/gui/widgets/qlineedit_p.h @@ -76,7 +76,7 @@ public: QLineEditPrivate() : control(0), frame(1), contextMenuEnabled(1), cursorVisible(0), - dragEnabled(0), hscroll(0), vscroll(0), clickCausedFocus(0), + dragEnabled(0), clickCausedFocus(0), hscroll(0), vscroll(0), alignment(Qt::AlignLeading | Qt::AlignVCenter), leftTextMargin(0), topTextMargin(0), rightTextMargin(0), bottomTextMargin(0) { @@ -101,7 +101,7 @@ public: inline bool shouldEnableInputMethod() const { - return !control->isReadOnly() && (control->echoMode() == QLineEdit::Normal || control->echoMode() == QLineEdit::PasswordEchoOnEdit); + return !control->isReadOnly(); } QPoint tripleClick; diff --git a/src/network/access/qhttpnetworkconnection_p.h b/src/network/access/qhttpnetworkconnection_p.h index d6b0325..33c72b4 100644 --- a/src/network/access/qhttpnetworkconnection_p.h +++ b/src/network/access/qhttpnetworkconnection_p.h @@ -65,7 +65,7 @@ #include <private/qhttpnetworkrequest_p.h> #include <private/qhttpnetworkreply_p.h> -#include "qhttpnetworkconnectionchannel_p.h" +#include <private/qhttpnetworkconnectionchannel_p.h> #ifndef QT_NO_HTTP diff --git a/src/network/access/qnetworkcookie.cpp b/src/network/access/qnetworkcookie.cpp index dd5edb0..854bd17 100644 --- a/src/network/access/qnetworkcookie.cpp +++ b/src/network/access/qnetworkcookie.cpp @@ -97,43 +97,6 @@ QT_BEGIN_NAMESPACE /*! Create a new QNetworkCookie object, initializing the cookie name - and its value to empty QByteArray - - A cookie is only valid if it has a name. However, the value is - opaque to the application and being empty may have significance to - the remote server. -*/ -QNetworkCookie::QNetworkCookie() - : d(new QNetworkCookiePrivate) -{ - qRegisterMetaType<QNetworkCookie>(); - qRegisterMetaType<QList<QNetworkCookie> >(); - - d->name = QByteArray(); - d->value = QByteArray(); -} - -/*! - Create a new QNetworkCookie object, initializing the cookie name - to \a name and its value to empty QByteArray. - - A cookie is only valid if it has a name. However, the value is - opaque to the application and being empty may have significance to - the remote server. -*/ -QNetworkCookie::QNetworkCookie( const QByteArray &name ) - : d(new QNetworkCookiePrivate) -{ - qRegisterMetaType<QNetworkCookie>(); - qRegisterMetaType<QList<QNetworkCookie> >(); - - d->name = name; - d->value = QByteArray(); -} - - -/*! - Create a new QNetworkCookie object, initializing the cookie name to \a name and its value to \a value. A cookie is only valid if it has a name. However, the value is diff --git a/src/network/access/qnetworkcookie.h b/src/network/access/qnetworkcookie.h index 35c7095..ef309a8 100644 --- a/src/network/access/qnetworkcookie.h +++ b/src/network/access/qnetworkcookie.h @@ -67,9 +67,7 @@ public: Full }; - QNetworkCookie(); - QNetworkCookie(const QByteArray &name ); - QNetworkCookie(const QByteArray &name, const QByteArray &value ); + QNetworkCookie(const QByteArray &name = QByteArray(), const QByteArray &value = QByteArray()); QNetworkCookie(const QNetworkCookie &other); ~QNetworkCookie(); QNetworkCookie &operator=(const QNetworkCookie &other); diff --git a/src/network/access/qnetworkrequest.cpp b/src/network/access/qnetworkrequest.cpp index caa8669..d6d76f7 100644 --- a/src/network/access/qnetworkrequest.cpp +++ b/src/network/access/qnetworkrequest.cpp @@ -242,18 +242,6 @@ public: }; /*! - Constructs a QNetworkRequest object with empty QUrl. - - \sa url(), setUrl() -*/ -QNetworkRequest::QNetworkRequest() - : d(new QNetworkRequestPrivate) -{ - d->url = QUrl(); -} - - -/*! Constructs a QNetworkRequest object with \a url as the URL to be requested. diff --git a/src/network/access/qnetworkrequest.h b/src/network/access/qnetworkrequest.h index cf06f7c..1ea7934 100644 --- a/src/network/access/qnetworkrequest.h +++ b/src/network/access/qnetworkrequest.h @@ -87,9 +87,7 @@ public: AlwaysCache }; - - explicit QNetworkRequest(); - explicit QNetworkRequest(const QUrl &url); + explicit QNetworkRequest(const QUrl &url = QUrl()); QNetworkRequest(const QNetworkRequest &other); ~QNetworkRequest(); QNetworkRequest &operator=(const QNetworkRequest &other); diff --git a/src/sql/kernel/qsqlfield.cpp b/src/sql/kernel/qsqlfield.cpp index 4bb56a3..b528850 100644 --- a/src/sql/kernel/qsqlfield.cpp +++ b/src/sql/kernel/qsqlfield.cpp @@ -159,20 +159,11 @@ public: \sa setRequiredStatus() setLength() setPrecision() setDefaultValue() setGenerated() setReadOnly() */ -QSqlField::QSqlField() -{ - d = new QSqlFieldPrivate(QString(), QVariant::Invalid); -} - -QSqlField::QSqlField(const QString& fieldName) -{ - d = new QSqlFieldPrivate(fieldName, QVariant::Invalid); -} - QSqlField::QSqlField(const QString& fieldName, QVariant::Type type) { d = new QSqlFieldPrivate(fieldName, type); } + /*! Constructs a copy of \a other. */ diff --git a/src/sql/kernel/qsqlfield.h b/src/sql/kernel/qsqlfield.h index d70af15..2c3b52a 100644 --- a/src/sql/kernel/qsqlfield.h +++ b/src/sql/kernel/qsqlfield.h @@ -58,9 +58,9 @@ class Q_SQL_EXPORT QSqlField public: enum RequiredStatus { Unknown = -1, Optional = 0, Required = 1 }; - QSqlField(); - QSqlField(const QString& fieldName); - QSqlField(const QString& fieldName, QVariant::Type type); + QSqlField(const QString& fieldName = QString(), + QVariant::Type type = QVariant::Invalid); + QSqlField(const QSqlField& other); QSqlField& operator=(const QSqlField& other); bool operator==(const QSqlField& other) const; diff --git a/src/sql/kernel/qsqlresult.cpp b/src/sql/kernel/qsqlresult.cpp index 2a1ba64..93c9d9f 100644 --- a/src/sql/kernel/qsqlresult.cpp +++ b/src/sql/kernel/qsqlresult.cpp @@ -53,9 +53,7 @@ QT_BEGIN_NAMESPACE struct QHolder { - QHolder(): holderName(QString()), holderPos(-1) {} - QHolder(const QString& hldr): holderName(hldr), holderPos(-1) {} - QHolder(const QString& hldr, int index): holderName(hldr), holderPos(index) {} + QHolder(const QString& hldr = QString(), int index = -1): holderName(hldr), holderPos(index) {} bool operator==(const QHolder& h) const { return h.holderPos == holderPos && h.holderName == holderName; } bool operator!=(const QHolder& h) const { return h.holderPos != holderPos || h.holderName != holderName; } QString holderName; |