summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorThierry Bastian <thierry.bastian@nokia.com>2010-11-19 23:00:13 (GMT)
committerThierry Bastian <thierry.bastian@nokia.com>2010-11-19 23:00:13 (GMT)
commitbcba1271a09c48e0bfd5477dd6cf0955ba55b077 (patch)
tree528bc50c5f98b98bd3ad34b0e8f92cc33e73877d /src/gui
parent2530a8b70da9b172ccd041a347f2556c3140c147 (diff)
parent0cfa6daa4776cd78370e644fae3005ae432b83c7 (diff)
downloadQt-bcba1271a09c48e0bfd5477dd6cf0955ba55b077.zip
Qt-bcba1271a09c48e0bfd5477dd6cf0955ba55b077.tar.gz
Qt-bcba1271a09c48e0bfd5477dd6cf0955ba55b077.tar.bz2
Merge branch '4.7-upstream' into 4.7-water
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/graphicsview/qgraphicstransform.cpp2
-rw-r--r--src/gui/kernel/qapplication_win.cpp4
-rw-r--r--src/gui/kernel/qclipboard_mac.cpp2
-rw-r--r--src/gui/kernel/qevent.cpp2
-rw-r--r--src/gui/kernel/qgesturemanager.cpp2
-rw-r--r--src/gui/kernel/qgesturemanager_p.h2
-rw-r--r--src/gui/kernel/qguiplatformplugin.cpp2
-rw-r--r--src/gui/kernel/qkeymapper_mac.cpp2
-rw-r--r--src/gui/kernel/qkeysequence.cpp2
-rw-r--r--src/gui/kernel/qwidget.cpp4
-rw-r--r--src/gui/kernel/qwidget_s60.cpp2
-rw-r--r--src/gui/kernel/qx11embed_x11.cpp2
-rw-r--r--src/gui/painting/qtextureglyphcache.cpp24
-rw-r--r--src/gui/painting/qtextureglyphcache_p.h4
-rw-r--r--src/gui/util/qundostack.cpp2
15 files changed, 34 insertions, 24 deletions
diff --git a/src/gui/graphicsview/qgraphicstransform.cpp b/src/gui/graphicsview/qgraphicstransform.cpp
index 1f155c6..d495da2 100644
--- a/src/gui/graphicsview/qgraphicstransform.cpp
+++ b/src/gui/graphicsview/qgraphicstransform.cpp
@@ -54,7 +54,7 @@
instances to one QGraphicsItem. Each QGraphicsTransform is applied in
order, one at a time, to the QGraphicsItem it's assigned to.
- QGraphicsTransform is particularily useful for animations. Whereas
+ QGraphicsTransform is particularly useful for animations. Whereas
QGraphicsItem::setTransform() lets you assign any transform directly to an
item, there is no direct way to interpolate between two different
transformations (e.g., when transitioning between two states, each for
diff --git a/src/gui/kernel/qapplication_win.cpp b/src/gui/kernel/qapplication_win.cpp
index 78028eb..10c4ed6 100644
--- a/src/gui/kernel/qapplication_win.cpp
+++ b/src/gui/kernel/qapplication_win.cpp
@@ -3269,7 +3269,7 @@ bool QETWidget::translateMouseEvent(const MSG &msg)
if (type == QEvent::MouseButtonPress
&& QApplication::activePopupWidget() != activePopupWidget
&& replayPopupMouseEvent) {
- // the popup dissappeared. Replay the event
+ // the popup disappeared. Replay the event
QWidget* w = QApplication::widgetAt(gpos.x, gpos.y);
if (w && !QApplicationPrivate::isBlockedByModal(w)) {
Q_ASSERT(w->testAttribute(Qt::WA_WState_Created));
@@ -3506,7 +3506,7 @@ static void tabletInit(const quint64 uniqueId, const UINT csr_type, HCTX hTab)
}
#endif // QT_NO_TABLETEVENT
-// Update the "dynamic" informations of a cursor device (pen, airbrush, etc).
+// Update the "dynamic" information of a cursor device (pen, airbrush, etc).
// The dynamic information is the information of QTabletDeviceData that can change
// in time (eraser or pen if a device is turned around).
#ifndef QT_NO_TABLETEVENT
diff --git a/src/gui/kernel/qclipboard_mac.cpp b/src/gui/kernel/qclipboard_mac.cpp
index 49a6cc8..482a3a3 100644
--- a/src/gui/kernel/qclipboard_mac.cpp
+++ b/src/gui/kernel/qclipboard_mac.cpp
@@ -623,7 +623,7 @@ QMacPasteboard::sync() const
#ifdef DEBUG_PASTEBOARD
if(fromGlobal)
- qDebug("Pasteboard: Syncronize!");
+ qDebug("Pasteboard: Synchronize!");
#endif
return fromGlobal;
}
diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp
index eade02e..7fdb926 100644
--- a/src/gui/kernel/qevent.cpp
+++ b/src/gui/kernel/qevent.cpp
@@ -1970,7 +1970,7 @@ void QInputMethodEvent::setCommitString(const QString &commitString, int replace
is usually given by a wheel on 4D mouse. If the device does not support a
Z-axis, pass zero here.
- The \a tangentialPressure paramater contins the tangential pressure of an air
+ The \a tangentialPressure parameter contins the tangential pressure of an air
brush. If the device does not support tangential pressure, pass 0 here.
\a rotation contains the device's rotation in degrees. 4D mice support
diff --git a/src/gui/kernel/qgesturemanager.cpp b/src/gui/kernel/qgesturemanager.cpp
index 9519447..46450b1 100644
--- a/src/gui/kernel/qgesturemanager.cpp
+++ b/src/gui/kernel/qgesturemanager.cpp
@@ -189,7 +189,7 @@ void QGestureManager::cleanupCachedGestures(QObject *target, Qt::GestureType typ
QGesture *QGestureManager::getState(QObject *object, QGestureRecognizer *recognizer, Qt::GestureType type)
{
// if the widget is being deleted we should be careful not to
- // create a new state, as it will create QWeakPointer which doesnt work
+ // create a new state, as it will create QWeakPointer which doesn't work
// from the destructor.
if (object->isWidgetType()) {
if (static_cast<QWidget *>(object)->d_func()->data.in_destructor)
diff --git a/src/gui/kernel/qgesturemanager_p.h b/src/gui/kernel/qgesturemanager_p.h
index a5a3482..92310f5 100644
--- a/src/gui/kernel/qgesturemanager_p.h
+++ b/src/gui/kernel/qgesturemanager_p.h
@@ -101,7 +101,7 @@ private:
NotGesture,
MaybeGesture // this means timers are up and waiting for some
// more events, and input events are handled by
- // gesture recognizer explicitely
+ // gesture recognizer explicitly
} state;
struct ObjectGesture
diff --git a/src/gui/kernel/qguiplatformplugin.cpp b/src/gui/kernel/qguiplatformplugin.cpp
index 2dd251b..c80c6d3 100644
--- a/src/gui/kernel/qguiplatformplugin.cpp
+++ b/src/gui/kernel/qguiplatformplugin.cpp
@@ -187,7 +187,7 @@ QString QGuiPlatformPlugin::styleName()
#endif
}
-/* return an aditional default palette (only work on X11) */
+/* return an additional default palette (only work on X11) */
QPalette QGuiPlatformPlugin::palette()
{
#ifdef Q_WS_X11
diff --git a/src/gui/kernel/qkeymapper_mac.cpp b/src/gui/kernel/qkeymapper_mac.cpp
index 300e5ca..b8f08bf 100644
--- a/src/gui/kernel/qkeymapper_mac.cpp
+++ b/src/gui/kernel/qkeymapper_mac.cpp
@@ -765,7 +765,7 @@ bool QKeyMapperPrivate::translateKeyEvent(QWidget *widget, EventHandlerCallRef e
&handled_event) == false)
return handled_event;
QString text(ourChar);
- /* This is actually wrong - but unfortunatly it is the best that can be
+ /* This is actually wrong - but unfortunately it is the best that can be
done for now because of the Control/Meta mapping problems */
if (modifiers & (Qt::ControlModifier | Qt::MetaModifier)
&& !qApp->testAttribute(Qt::AA_MacDontSwapCtrlAndMeta)) {
diff --git a/src/gui/kernel/qkeysequence.cpp b/src/gui/kernel/qkeysequence.cpp
index 50b2354..bf3eddd 100644
--- a/src/gui/kernel/qkeysequence.cpp
+++ b/src/gui/kernel/qkeysequence.cpp
@@ -1105,7 +1105,7 @@ QKeySequence QKeySequence::mnemonic(const QString &text)
#else
found = true;
} else {
- qWarning("QKeySequence::mnemonic: \"%s\" contains multiple occurences of '&'", qPrintable(text));
+ qWarning("QKeySequence::mnemonic: \"%s\" contains multiple occurrences of '&'", qPrintable(text));
#endif
}
}
diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp
index e22ec55..39c734e 100644
--- a/src/gui/kernel/qwidget.cpp
+++ b/src/gui/kernel/qwidget.cpp
@@ -8836,7 +8836,7 @@ void QWidget::mousePressEvent(QMouseEvent *event)
QWidget* w;
while ((w = QApplication::activePopupWidget()) && w != this){
w->close();
- if (QApplication::activePopupWidget() == w) // widget does not want to dissappear
+ if (QApplication::activePopupWidget() == w) // widget does not want to disappear
w->hide(); // hide at least
}
if (!rect().contains(event->pos())){
@@ -9305,7 +9305,7 @@ void QWidget::setInputMethodHints(Qt::InputMethodHints hints)
#ifndef QT_NO_IM
Q_D(QWidget);
d->imHints = hints;
- // Optimisation to update input context only it has already been created.
+ // Optimization to update input context only it has already been created.
if (d->ic || qApp->d_func()->inputContext) {
QInputContext *ic = inputContext();
if (ic)
diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp
index cf4bdf1..97917ba 100644
--- a/src/gui/kernel/qwidget_s60.cpp
+++ b/src/gui/kernel/qwidget_s60.cpp
@@ -57,7 +57,7 @@
#include <eikbtgpc.h>
#endif
-// This is necessary in order to be able to perform delayed invokation on slots
+// This is necessary in order to be able to perform delayed invocation on slots
// which take arguments of type WId. One example is
// QWidgetPrivate::_q_delayedDestroy, which is used to delay destruction of
// CCoeControl objects until after the CONE event handler has finished running.
diff --git a/src/gui/kernel/qx11embed_x11.cpp b/src/gui/kernel/qx11embed_x11.cpp
index 9f1b1f8..e6e3bfb 100644
--- a/src/gui/kernel/qx11embed_x11.cpp
+++ b/src/gui/kernel/qx11embed_x11.cpp
@@ -1136,7 +1136,7 @@ void QX11EmbedContainer::paintEvent(QPaintEvent *)
/*! \internal
- Returns wether or not the windows' embedded flag is set.
+ Returns whether or not the windows' embedded flag is set.
*/
bool QX11EmbedContainerPrivate::isEmbedded() const
{
diff --git a/src/gui/painting/qtextureglyphcache.cpp b/src/gui/painting/qtextureglyphcache.cpp
index b609f7b..2daa1f0 100644
--- a/src/gui/painting/qtextureglyphcache.cpp
+++ b/src/gui/painting/qtextureglyphcache.cpp
@@ -65,7 +65,7 @@ static inline int qt_next_power_of_two(int v)
return v;
}
-void QTextureGlyphCache::populate(QFontEngine *fontEngine, int numGlyphs, const glyph_t *glyphs,
+bool QTextureGlyphCache::populate(QFontEngine *fontEngine, int numGlyphs, const glyph_t *glyphs,
const QFixedPoint *)
{
#ifdef CACHE_DEBUG
@@ -119,7 +119,7 @@ void QTextureGlyphCache::populate(QFontEngine *fontEngine, int numGlyphs, const
rowHeight = qMax(rowHeight, glyph_height);
}
if (listItemCoordinates.isEmpty())
- return;
+ return true;
rowHeight += margin * 2 + paddingDoubled;
if (isNull())
@@ -150,6 +150,13 @@ void QTextureGlyphCache::populate(QFontEngine *fontEngine, int numGlyphs, const
int new_height = m_h*2;
while (new_height < m_cy + c.h)
new_height *= 2;
+
+ if (maxTextureHeight() > 0 && new_height > maxTextureHeight()) {
+ // We can't make a new texture of the required size, so
+ // bail out
+ return false;
+ }
+
// if no room in the current texture - realloc a larger texture
resizeTextureData(m_w, new_height);
m_h = new_height;
@@ -165,7 +172,7 @@ void QTextureGlyphCache::populate(QFontEngine *fontEngine, int numGlyphs, const
++iter;
}
-
+ return true;
}
QImage QTextureGlyphCache::textureMapForGlyph(glyph_t g) const
@@ -259,11 +266,14 @@ void QImageTextureGlyphCache::fillTexture(const Coord &c, glyph_t g)
}
#endif
- if (m_type == QFontEngineGlyphCache::Raster_RGBMask) {
- QPainter p(&m_image);
+ if (m_type == QFontEngineGlyphCache::Raster_RGBMask) {
+ QImage ref(m_image.bits() + (c.x * 4 + c.y * m_image.bytesPerLine()),
+ qMax(mask.width(), c.w), qMax(mask.height(), c.h), m_image.bytesPerLine(),
+ m_image.format());
+ QPainter p(&ref);
p.setCompositionMode(QPainter::CompositionMode_Source);
- p.fillRect(c.x, c.y, c.w, c.h, QColor(0,0,0,0)); // TODO optimize this
- p.drawImage(c.x, c.y, mask);
+ p.fillRect(0, 0, c.w, c.h, QColor(0,0,0,0)); // TODO optimize this
+ p.drawImage(0, 0, mask);
p.end();
} else if (m_type == QFontEngineGlyphCache::Raster_Mono) {
if (mask.depth() > 1) {
diff --git a/src/gui/painting/qtextureglyphcache_p.h b/src/gui/painting/qtextureglyphcache_p.h
index e6d2b22..94cb555 100644
--- a/src/gui/painting/qtextureglyphcache_p.h
+++ b/src/gui/painting/qtextureglyphcache_p.h
@@ -96,7 +96,7 @@ public:
int baseLineY;
};
- void populate(QFontEngine *fontEngine, int numGlyphs, const glyph_t *glyphs,
+ bool populate(QFontEngine *fontEngine, int numGlyphs, const glyph_t *glyphs,
const QFixedPoint *positions);
virtual void createTextureData(int width, int height) = 0;
@@ -118,7 +118,7 @@ public:
QImage textureMapForGlyph(glyph_t g) const;
virtual int maxTextureWidth() const { return QT_DEFAULT_TEXTURE_GLYPH_CACHE_WIDTH; }
- virtual int maxTextureHeight() const { return 32768; }
+ virtual int maxTextureHeight() const { return -1; }
protected:
QFontEngine *m_current_fontengine;
diff --git a/src/gui/util/qundostack.cpp b/src/gui/util/qundostack.cpp
index 919ac3c..04cfca9 100644
--- a/src/gui/util/qundostack.cpp
+++ b/src/gui/util/qundostack.cpp
@@ -441,7 +441,7 @@ bool QUndoStackPrivate::checkUndoLimit()
/*!
Constructs an empty undo stack with the parent \a parent. The
- stack will initally be in the clean state. If \a parent is a
+ stack will initially be in the clean state. If \a parent is a
QUndoGroup object, the stack is automatically added to the group.
\sa push()