diff options
author | Sarah Smith <sarah.j.smith@nokia.com> | 2009-09-17 03:17:46 (GMT) |
---|---|---|
committer | Sarah Smith <sarah.j.smith@nokia.com> | 2009-09-17 03:17:46 (GMT) |
commit | 0e73159e81ae30ade45484a5ffccdf26b9d79667 (patch) | |
tree | 711051ebd87fd7f80e5bbe4c0fb7edc38258585f /src/gui | |
parent | a7c3ea93e0a1cd56f585a9ce04e6d1b99f4c7a34 (diff) | |
parent | 64e03f7ada9eb6af7c65dbea7a36ebcb3f4e67fb (diff) | |
download | Qt-0e73159e81ae30ade45484a5ffccdf26b9d79667.zip Qt-0e73159e81ae30ade45484a5ffccdf26b9d79667.tar.gz Qt-0e73159e81ae30ade45484a5ffccdf26b9d79667.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/embedded/directfb.pri | 2 | ||||
-rw-r--r-- | src/gui/image/qpixmapfilter.cpp | 9 | ||||
-rw-r--r-- | src/gui/kernel/qapplication.cpp | 2 | ||||
-rw-r--r-- | src/gui/kernel/qapplication_x11.cpp | 2 | ||||
-rw-r--r-- | src/gui/kernel/qclipboard_x11.cpp | 26 | ||||
-rw-r--r-- | src/gui/kernel/qt_x11_p.h | 2 | ||||
-rw-r--r-- | src/gui/painting/qdrawutil.cpp | 3 | ||||
-rw-r--r-- | src/gui/painting/qpaintengineex_p.h | 7 | ||||
-rw-r--r-- | src/gui/text/qfontmetrics.cpp | 10 | ||||
-rw-r--r-- | src/gui/text/qsyntaxhighlighter.cpp | 2 | ||||
-rw-r--r-- | src/gui/text/qtextengine.cpp | 6 | ||||
-rw-r--r-- | src/gui/widgets/qdockwidget.cpp | 2 |
12 files changed, 55 insertions, 18 deletions
diff --git a/src/gui/embedded/directfb.pri b/src/gui/embedded/directfb.pri index 7dae9d5..43ff0c7 100644 --- a/src/gui/embedded/directfb.pri +++ b/src/gui/embedded/directfb.pri @@ -8,7 +8,7 @@ #DEFINES += QT_DIRECTFB_IMAGECACHE #DEFINES += QT_NO_DIRECTFB_WM #DEFINES += QT_NO_DIRECTFB_LAYER -#DEFINES += QT_NO_DIRECTFB_PALETTE +#DEFINES += QT_DIRECTFB_PALETTE #DEFINES += QT_NO_DIRECTFB_PREALLOCATED #DEFINES += QT_NO_DIRECTFB_MOUSE #DEFINES += QT_NO_DIRECTFB_KEYBOARD diff --git a/src/gui/image/qpixmapfilter.cpp b/src/gui/image/qpixmapfilter.cpp index 4fa2e6c..4fb650f 100644 --- a/src/gui/image/qpixmapfilter.cpp +++ b/src/gui/image/qpixmapfilter.cpp @@ -418,13 +418,12 @@ void QPixmapConvolutionFilter::draw(QPainter *painter, const QPointF &p, const Q return; QPixmapFilter *filter = painter->paintEngine() && painter->paintEngine()->isExtended() ? - static_cast<QPaintEngineEx *>(painter->paintEngine())->createPixmapFilter(type()) : 0; + static_cast<QPaintEngineEx *>(painter->paintEngine())->pixmapFilter(type(), this) : 0; QPixmapConvolutionFilter *convolutionFilter = static_cast<QPixmapConvolutionFilter*>(filter); if (convolutionFilter) { convolutionFilter->setConvolutionKernel(d->convolutionKernel, d->kernelWidth, d->kernelHeight); convolutionFilter->d_func()->convoluteAlpha = d->convoluteAlpha; convolutionFilter->draw(painter, p, src, srcRect); - delete convolutionFilter; return; } @@ -669,13 +668,12 @@ void QPixmapBlurFilter::draw(QPainter *painter, const QPointF &p, const QPixmap } QPixmapFilter *filter = painter->paintEngine() && painter->paintEngine()->isExtended() ? - static_cast<QPaintEngineEx *>(painter->paintEngine())->createPixmapFilter(type()) : 0; + static_cast<QPaintEngineEx *>(painter->paintEngine())->pixmapFilter(type(), this) : 0; QPixmapBlurFilter *blurFilter = static_cast<QPixmapBlurFilter*>(filter); if (blurFilter) { blurFilter->setRadius(d->radius); blurFilter->setQuality(d->quality); blurFilter->draw(painter, p, src, srcRect); - delete blurFilter; return; } @@ -836,13 +834,12 @@ void QPixmapColorizeFilter::draw(QPainter *painter, const QPointF &dest, const Q { Q_D(const QPixmapColorizeFilter); QPixmapFilter *filter = painter->paintEngine() && painter->paintEngine()->isExtended() ? - static_cast<QPaintEngineEx *>(painter->paintEngine())->createPixmapFilter(type()) : 0; + static_cast<QPaintEngineEx *>(painter->paintEngine())->pixmapFilter(type(), this) : 0; QPixmapColorizeFilter *colorizeFilter = static_cast<QPixmapColorizeFilter*>(filter); if (colorizeFilter) { colorizeFilter->setColor(d->color); colorizeFilter->setStrength(d->strength); colorizeFilter->draw(painter, dest, src, srcRect); - delete colorizeFilter; return; } diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp index 1fd2d39..0ff7314 100644 --- a/src/gui/kernel/qapplication.cpp +++ b/src/gui/kernel/qapplication.cpp @@ -4773,7 +4773,7 @@ void QApplicationPrivate::emitLastWindowClosed() #ifdef QT_KEYPAD_NAVIGATION /*! - Sets what kind of focus navigation Qt should use. + Sets the kind of focus navigation Qt should use to \a mode. This feature is available in Qt for Embedded Linux, Symbian and Windows CE only. diff --git a/src/gui/kernel/qapplication_x11.cpp b/src/gui/kernel/qapplication_x11.cpp index 601cd11..bbce438 100644 --- a/src/gui/kernel/qapplication_x11.cpp +++ b/src/gui/kernel/qapplication_x11.cpp @@ -190,10 +190,12 @@ static const char * x11_atomnames = { "TARGETS\0" "MULTIPLE\0" "TIMESTAMP\0" + "SAVE_TARGETS\0" "CLIP_TEMPORARY\0" "_QT_SELECTION\0" "_QT_CLIPBOARD_SENTINEL\0" "_QT_SELECTION_SENTINEL\0" + "CLIPBOARD_MANAGER\0" "RESOURCE_MANAGER\0" diff --git a/src/gui/kernel/qclipboard_x11.cpp b/src/gui/kernel/qclipboard_x11.cpp index b2f682b..9621944 100644 --- a/src/gui/kernel/qclipboard_x11.cpp +++ b/src/gui/kernel/qclipboard_x11.cpp @@ -787,6 +787,7 @@ static Atom send_targets_selection(QClipboardData *d, Window window, Atom proper types.append(ATOM(TARGETS)); types.append(ATOM(MULTIPLE)); types.append(ATOM(TIMESTAMP)); + types.append(ATOM(SAVE_TARGETS)); XChangeProperty(X11->display, window, property, XA_ATOM, 32, PropModeReplace, (uchar *) types.data(), types.size()); @@ -911,8 +912,31 @@ bool QClipboard::event(QEvent *e) XEvent *xevent = (XEvent *)(((QClipboardEvent *)e)->data()); Display *dpy = X11->display; - if (!xevent) + if (!xevent) { + // That means application exits and we need to give clipboard + // content to the clipboard manager. + // First we check if there is a clipboard manager. + if (XGetSelectionOwner(X11->display, ATOM(CLIPBOARD_MANAGER)) == XNone + || !owner) + return true; + + Window ownerId = owner->internalWinId(); + Q_ASSERT(ownerId); + // we delete the property so the manager saves all TARGETS. + XDeleteProperty(X11->display, ownerId, ATOM(_QT_SELECTION)); + XConvertSelection(X11->display, ATOM(CLIPBOARD_MANAGER), ATOM(SAVE_TARGETS), + ATOM(_QT_SELECTION), ownerId, X11->time); + XSync(dpy, false); + + XEvent event; + // waiting until the clipboard manager fetches the content. + if (!X11->clipboardWaitForEvent(ownerId, SelectionNotify, &event, 10000)) { + qWarning("QClipboard: Unable to receive an event from the " + "clipboard manager in a reasonable time"); + } + return true; + } switch (xevent->type) { diff --git a/src/gui/kernel/qt_x11_p.h b/src/gui/kernel/qt_x11_p.h index 1b02ed3..61acbac 100644 --- a/src/gui/kernel/qt_x11_p.h +++ b/src/gui/kernel/qt_x11_p.h @@ -544,10 +544,12 @@ struct QX11Data TARGETS, MULTIPLE, TIMESTAMP, + SAVE_TARGETS, CLIP_TEMPORARY, _QT_SELECTION, _QT_CLIPBOARD_SENTINEL, _QT_SELECTION_SENTINEL, + CLIPBOARD_MANAGER, RESOURCE_MANAGER, diff --git a/src/gui/painting/qdrawutil.cpp b/src/gui/painting/qdrawutil.cpp index c4a9373..0a82a9f 100644 --- a/src/gui/painting/qdrawutil.cpp +++ b/src/gui/painting/qdrawutil.cpp @@ -1066,8 +1066,9 @@ void qDrawItem(QPainter *p, Qt::GUIStyle gs, /*! \fn void qDrawBorderPixmap(QPainter *painter, const QRect &target, const QMargins &margins, const QPixmap &pixmap) - \since 4.6 \relates <qdrawutil.h> + \since 4.6 + \overload Draws the given \a pixmap into the given \a target rectangle, using the given \a painter. The pixmap will be split into nine segments and drawn diff --git a/src/gui/painting/qpaintengineex_p.h b/src/gui/painting/qpaintengineex_p.h index 9f0d84a..a12a71f 100644 --- a/src/gui/painting/qpaintengineex_p.h +++ b/src/gui/painting/qpaintengineex_p.h @@ -207,7 +207,12 @@ public: virtual void beginNativePainting() {} virtual void endNativePainting() {} - virtual QPixmapFilter *createPixmapFilter(int /*type*/) const { return 0; } + // Return a pixmap filter of "type" that can render the parameters + // in "prototype". The returned filter is owned by the engine and + // will be destroyed when the engine is destroyed. The "prototype" + // allows the engine to pick different filters based on the parameters + // that will be requested, and not just the "type". + virtual QPixmapFilter *pixmapFilter(int /*type*/, const QPixmapFilter * /*prototype*/) { return 0; } // These flags are needed in the implementation of paint buffers. enum Flags diff --git a/src/gui/text/qfontmetrics.cpp b/src/gui/text/qfontmetrics.cpp index b2784d6..ce122aa 100644 --- a/src/gui/text/qfontmetrics.cpp +++ b/src/gui/text/qfontmetrics.cpp @@ -528,13 +528,15 @@ int QFontMetrics::rightBearing(QChar ch) const int QFontMetrics::width(const QString &text, int len) const { int pos = text.indexOf(QLatin1Char('\x9c')); - QString txt = (pos == -1) ? text : text.left(pos); - if (len < 0) - len = txt.length(); + if (pos != -1) { + len = (len < 0) ? pos : qMin(pos, len); + } else if (len < 0) { + len = text.length(); + } if (len == 0) return 0; - QTextEngine layout(txt, d); + QTextEngine layout(text, d); layout.ignoreBidi = true; return qRound(layout.width(0, len)); } diff --git a/src/gui/text/qsyntaxhighlighter.cpp b/src/gui/text/qsyntaxhighlighter.cpp index 41f4b4a..470c8e1 100644 --- a/src/gui/text/qsyntaxhighlighter.cpp +++ b/src/gui/text/qsyntaxhighlighter.cpp @@ -170,7 +170,7 @@ void QSyntaxHighlighterPrivate::_q_reformatBlocks(int from, int charsRemoved, in return; int endPosition; - QTextBlock lastBlock = doc->findBlock(from + charsAdded); + QTextBlock lastBlock = doc->findBlock(from + charsAdded + (charsRemoved > 0 ? 1 : 0)); if (lastBlock.isValid()) endPosition = lastBlock.position() + lastBlock.length(); else diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp index b43bd06..81c9142 100644 --- a/src/gui/text/qtextengine.cpp +++ b/src/gui/text/qtextengine.cpp @@ -1396,8 +1396,12 @@ void QTextEngine::itemize() const int length = layoutData->string.length(); if (!length) return; - +#if defined(Q_WS_MAC) && !defined(QT_MAC_USE_COCOA) + // ATSUI requires RTL flags to correctly identify the character stops. + bool ignore = false; +#else bool ignore = ignoreBidi; +#endif if (!ignore && option.textDirection() == Qt::LeftToRight) { ignore = true; const QChar *start = layoutData->string.unicode(); diff --git a/src/gui/widgets/qdockwidget.cpp b/src/gui/widgets/qdockwidget.cpp index 0e434be..a574262f 100644 --- a/src/gui/widgets/qdockwidget.cpp +++ b/src/gui/widgets/qdockwidget.cpp @@ -1136,7 +1136,7 @@ void QDockWidgetPrivate::setWindowState(bool floating, bool unplug, const QRect /*! \property QDockWidget::windowTitle - \internal + \brief the dock widget title (caption) By default, this property contains an empty string. */ |