diff options
author | Sarah Smith <sarah.j.smith@nokia.com> | 2009-09-08 00:35:06 (GMT) |
---|---|---|
committer | Sarah Smith <sarah.j.smith@nokia.com> | 2009-09-08 00:35:06 (GMT) |
commit | 693695e5677422625d555943586d41fbd9dbe971 (patch) | |
tree | 17e70dcb11f009398b083cb0361982ca32f2ac6e /src/gui | |
parent | f4fa50c25aea68b7696ad7de289d93facac9f3e5 (diff) | |
parent | 4bb098ed9449bd3b2798000bc5394bda98c9165f (diff) | |
download | Qt-693695e5677422625d555943586d41fbd9dbe971.zip Qt-693695e5677422625d555943586d41fbd9dbe971.tar.gz Qt-693695e5677422625d555943586d41fbd9dbe971.tar.bz2 |
Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt into 4.6
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/graphicsview/qgraphicsitem.cpp | 2 | ||||
-rw-r--r-- | src/gui/itemviews/qabstractitemview.cpp | 7 | ||||
-rw-r--r-- | src/gui/kernel/qgesture.cpp | 10 | ||||
-rw-r--r-- | src/gui/kernel/qgesture.h | 2 | ||||
-rw-r--r-- | src/gui/painting/qdrawhelper.cpp | 11 | ||||
-rw-r--r-- | src/gui/styles/qcommonstyle.cpp | 56 | ||||
-rw-r--r-- | src/gui/styles/qmotifstyle.cpp | 3 | ||||
-rw-r--r-- | src/gui/styles/qplastiquestyle.cpp | 5 | ||||
-rw-r--r-- | src/gui/styles/qwindowsstyle.cpp | 3 | ||||
-rw-r--r-- | src/gui/text/qcssparser.cpp | 2 |
10 files changed, 70 insertions, 31 deletions
diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp index eae3e63..7023e9e 100644 --- a/src/gui/graphicsview/qgraphicsitem.cpp +++ b/src/gui/graphicsview/qgraphicsitem.cpp @@ -934,7 +934,7 @@ void QGraphicsItemPrivate::setParentItemHelper(QGraphicsItem *newParent) } QGraphicsItem *lastSubFocusItem = subFocusItem; - if (subFocusItem) { + if (subFocusItem && !inDestructor) { // Update the child focus chain; when reparenting an item that has a // focus child, ensure that that focus child clears its focus child // chain from our parents before it's reparented. diff --git a/src/gui/itemviews/qabstractitemview.cpp b/src/gui/itemviews/qabstractitemview.cpp index ea98cb2..52529ff 100644 --- a/src/gui/itemviews/qabstractitemview.cpp +++ b/src/gui/itemviews/qabstractitemview.cpp @@ -1537,8 +1537,7 @@ void QAbstractItemView::mousePressEvent(QMouseEvent *event) QPoint offset = d->offset(); if ((command & QItemSelectionModel::Current) == 0) d->pressedPosition = pos + offset; - - if (d->pressedPosition == QPoint(-1, -1)) + else if (!indexAt(d->pressedPosition).isValid()) d->pressedPosition = visualRect(currentIndex()).center() + offset; if (edit(index, NoEditTriggers, event)) @@ -2089,8 +2088,8 @@ void QAbstractItemView::keyPressEvent(QKeyEvent *event) // note that we don't check if the new current index is enabled because moveCursor() makes sure it is if (command & QItemSelectionModel::Current) { d->selectionModel->setCurrentIndex(newCurrent, QItemSelectionModel::NoUpdate); - if (d->pressedPosition == QPoint(-1, -1)) - d->pressedPosition = visualRect(oldCurrent).center(); + if (!indexAt(d->pressedPosition).isValid()) + d->pressedPosition = visualRect(oldCurrent).center() + d->offset(); QRect rect(d->pressedPosition - d->offset(), visualRect(newCurrent).center()); setSelection(rect, command); } else { diff --git a/src/gui/kernel/qgesture.cpp b/src/gui/kernel/qgesture.cpp index 7831893..32502db 100644 --- a/src/gui/kernel/qgesture.cpp +++ b/src/gui/kernel/qgesture.cpp @@ -131,9 +131,9 @@ private: about the gesture is contained in the signal sender object. */ -/*! \fn void QGesture::cancelled() +/*! \fn void QGesture::canceled() - The signal is emitted when the gesture is cancelled, for example the + The signal is emitted when the gesture is canceled, for example the reset() function is called while the gesture was in the process of emitting a triggered() signal. Extended information about the gesture is contained in the sender object. @@ -230,7 +230,7 @@ Qt::GestureState QGesture::state() const \a state, and it should be called after all the internal properties have been initialized. - \sa started(), triggered(), finished(), cancelled() + \sa started(), triggered(), finished(), canceled() */ void QGesture::updateState(Qt::GestureState state) { @@ -258,7 +258,7 @@ void QGesture::updateState(Qt::GestureState state) else if (state == Qt::GestureFinished) emit finished(); else if (state == Qt::NoGesture) - emit cancelled(); + emit canceled(); if (state == Qt::GestureFinished) { // gesture is finished, so we reset the internal state. @@ -301,7 +301,7 @@ QGraphicsItem* QGesture::graphicsItem() const Resets the internal state of the gesture. This function might be called by the filterEvent() implementation in a derived class, or by the user to cancel a gesture. The base class implementation calls - updateState(Qt::NoGesture) which emits the cancelled() + updateState(Qt::NoGesture) which emits the canceled() signal if the state() of the gesture indicated it was active. */ void QGesture::reset() diff --git a/src/gui/kernel/qgesture.h b/src/gui/kernel/qgesture.h index ee6f8b3..23c64b2 100644 --- a/src/gui/kernel/qgesture.h +++ b/src/gui/kernel/qgesture.h @@ -90,7 +90,7 @@ Q_SIGNALS: void started(); void triggered(); void finished(); - void cancelled(); + void canceled(); private: friend class QWidget; diff --git a/src/gui/painting/qdrawhelper.cpp b/src/gui/painting/qdrawhelper.cpp index ab192c5..e9b1bd3 100644 --- a/src/gui/painting/qdrawhelper.cpp +++ b/src/gui/painting/qdrawhelper.cpp @@ -4953,15 +4953,18 @@ Q_STATIC_TEMPLATE_FUNCTION void blendTiled(int count, const QSpan *spans, void * if (modeSource && coverage == 255) { // Copy the first texture block - length = image_width; + length = qMin(image_width,length); + int tx = x; while (length) { int l = qMin(image_width - sx, length); if (buffer_size < l) l = buffer_size; - DST *dest = ((DST*)data->rasterBuffer->scanLine(spans->y)) + x; + DST *dest = ((DST*)data->rasterBuffer->scanLine(spans->y)) + tx; const SRC *src = (SRC*)data->texture.scanLine(sy) + sx; + qt_memconvert<DST, SRC>(dest, src, l); length -= l; + tx += l; sx = 0; } @@ -4971,8 +4974,8 @@ Q_STATIC_TEMPLATE_FUNCTION void blendTiled(int count, const QSpan *spans, void * // We are dealing with one block of data // - More likely to fit in the cache // - can use memcpy - int copy_image_width = image_width; - length = spans->len - image_width; + int copy_image_width = qMin(image_width, int(spans->len)); + length = spans->len - copy_image_width; DST *src = ((DST*)data->rasterBuffer->scanLine(spans->y)) + x; DST *dest = src + copy_image_width; while (copy_image_width < length) { diff --git a/src/gui/styles/qcommonstyle.cpp b/src/gui/styles/qcommonstyle.cpp index 7fefb19..817401e 100644 --- a/src/gui/styles/qcommonstyle.cpp +++ b/src/gui/styles/qcommonstyle.cpp @@ -5126,6 +5126,9 @@ int QCommonStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget ret = Qt::LinksAccessibleByMouse; break; case SH_DialogButtonBox_ButtonsHaveIcons: +#ifdef Q_WS_X11 + return true; +#endif ret = 0; break; case SH_SpellCheckUnderlineStyle: @@ -5222,6 +5225,19 @@ QPixmap QCommonStyle::standardPixmap(StandardPixmap sp, const QStyleOption *opti if (QApplication::desktopSettingsAware() && !QIcon::themeName().isEmpty()) { switch (sp) { + case SP_DialogYesButton: + case SP_DialogOkButton: + pixmap = QIcon::fromTheme(QLatin1String("dialog-ok")).pixmap(16); + break; + case SP_DialogApplyButton: + pixmap = QIcon::fromTheme(QLatin1String("dialog-ok-apply")).pixmap(16); + break; + case SP_DialogDiscardButton: + pixmap = QIcon::fromTheme(QLatin1String("edit-delete")).pixmap(16); + break; + case SP_DialogCloseButton: + pixmap = QIcon::fromTheme(QLatin1String("dialog-close")).pixmap(16); + break; case SP_DirHomeIcon: pixmap = QIcon::fromTheme(QLatin1String("user-home")).pixmap(16); break; @@ -5336,13 +5352,15 @@ QPixmap QCommonStyle::standardPixmap(StandardPixmap sp, const QStyleOption *opti case SP_DialogHelpButton: pixmap = QIcon::fromTheme(QLatin1String("help-contents")).pixmap(24); break; + case SP_DialogNoButton: case SP_DialogCancelButton: - pixmap = QIcon::fromTheme(QLatin1String("process-stop")).pixmap(24); + pixmap = QIcon::fromTheme(QLatin1String("dialog-cancel"), + QIcon::fromTheme(QLatin1String("process-stop"))).pixmap(24); break; case SP_DialogSaveButton: pixmap = QIcon::fromTheme(QLatin1String("document-save")).pixmap(24); break; - case SP_FileLinkIcon: + case SP_FileLinkIcon: pixmap = QIcon::fromTheme(QLatin1String("emblem-symbolic-link")).pixmap(16); if (!pixmap.isNull()) { QPixmap fileIcon = QIcon::fromTheme(QLatin1String("text-x-generic")).pixmap(16); @@ -5530,6 +5548,25 @@ QIcon QCommonStyle::standardIconImplementation(StandardPixmap standardIcon, cons case SP_DirOpenIcon: icon = QIcon::fromTheme(QLatin1String("folder-open")); break; + case SP_DialogSaveButton: + icon = QIcon::fromTheme(QLatin1String("document-save")); + break; + case SP_DialogApplyButton: + icon = QIcon::fromTheme(QLatin1String("dialog-ok-apply")); + break; + case SP_DialogYesButton: + case SP_DialogOkButton: + icon = QIcon::fromTheme(QLatin1String("dialog-ok")); + break; + case SP_DialogDiscardButton: + icon = QIcon::fromTheme(QLatin1String("edit-delete")); + break; + case SP_DialogResetButton: + icon = QIcon::fromTheme(QLatin1String("edit-clear")); + break; + case SP_DialogHelpButton: + icon = QIcon::fromTheme(QLatin1String("help-contents")); + break; case SP_FileIcon: icon = QIcon::fromTheme(QLatin1String("text-x-generic")); break; @@ -5575,21 +5612,13 @@ QIcon QCommonStyle::standardIconImplementation(StandardPixmap standardIcon, cons case SP_ArrowLeft: icon = QIcon::fromTheme(QLatin1String("go-previous")); break; - case SP_DialogHelpButton: - icon = QIcon::fromTheme(QLatin1String("help-contents")); - break; case SP_DialogCancelButton: - icon = QIcon::fromTheme(QLatin1String("process-stop")); + icon = QIcon::fromTheme(QLatin1String("dialog-cancel"), + QIcon::fromTheme(QLatin1String("process-stop"))); break; case SP_DialogCloseButton: icon = QIcon::fromTheme(QLatin1String("window-close")); break; - case SP_DialogApplyButton: - icon = QIcon::fromTheme(QLatin1String("dialog-ok-apply")); - break; - case SP_DialogOkButton: - icon = QIcon::fromTheme(QLatin1String("dialog-ok")); - break; case SP_FileDialogDetailedView: icon = QIcon::fromTheme(QLatin1String("view-list-details")); break; @@ -5629,9 +5658,6 @@ QIcon QCommonStyle::standardIconImplementation(StandardPixmap standardIcon, cons case SP_MediaVolumeMuted: icon = QIcon::fromTheme(QLatin1String("audio-volume-muted")); break; - case SP_DialogResetButton: - icon = QIcon::fromTheme(QLatin1String("edit-clear")); - break; case SP_ArrowForward: if (rtl) return standardIconImplementation(SP_ArrowLeft, option, widget); diff --git a/src/gui/styles/qmotifstyle.cpp b/src/gui/styles/qmotifstyle.cpp index 3550408..904a8f56 100644 --- a/src/gui/styles/qmotifstyle.cpp +++ b/src/gui/styles/qmotifstyle.cpp @@ -2683,6 +2683,9 @@ QMotifStyle::styleHint(StyleHint hint, const QStyleOption *opt, const QWidget *w case SH_LineEdit_PasswordCharacter: ret = '*'; break; + case SH_DialogButtonBox_ButtonsHaveIcons: + ret = 0; + break; default: ret = QCommonStyle::styleHint(hint, opt, widget, returnData); break; diff --git a/src/gui/styles/qplastiquestyle.cpp b/src/gui/styles/qplastiquestyle.cpp index 8250013..bdd72b7 100644 --- a/src/gui/styles/qplastiquestyle.cpp +++ b/src/gui/styles/qplastiquestyle.cpp @@ -5435,6 +5435,11 @@ int QPlastiqueStyle::styleHint(StyleHint hint, const QStyleOption *option, const case SH_Menu_SubMenuPopupDelay: ret = 96; // from Plastik break; +#ifdef Q_WS_X11 + case SH_DialogButtonBox_ButtonsHaveIcons: + ret = true; + break; +#endif #ifndef Q_OS_WIN case SH_Menu_AllowActiveAndDisabled: ret = false; diff --git a/src/gui/styles/qwindowsstyle.cpp b/src/gui/styles/qwindowsstyle.cpp index 31f96c3..2a88578 100644 --- a/src/gui/styles/qwindowsstyle.cpp +++ b/src/gui/styles/qwindowsstyle.cpp @@ -1206,6 +1206,9 @@ int QWindowsStyle::styleHint(StyleHint hint, const QStyleOption *opt, const QWid case SH_ItemView_ArrowKeysNavigateIntoChildren: ret = true; break; + case SH_DialogButtonBox_ButtonsHaveIcons: + ret = 0; + break; default: ret = QCommonStyle::styleHint(hint, opt, widget, returnData); break; diff --git a/src/gui/text/qcssparser.cpp b/src/gui/text/qcssparser.cpp index f252444..a38f276 100644 --- a/src/gui/text/qcssparser.cpp +++ b/src/gui/text/qcssparser.cpp @@ -1171,7 +1171,7 @@ static void parseShorthandFontProperty(const QVector<Value> &values, QFont *font { font->setStyle(QFont::StyleNormal); font->setWeight(QFont::Normal); - *fontSizeAdjustment = 0; + *fontSizeAdjustment = -255; int i = 0; while (i < values.count()) { |