Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/4.7' into qt-4.8-from-4.7
Browse files Browse the repository at this point in the history
Conflicts:
	src/opengl/qwindowsurface_gl.cpp
	src/s60installs/eabi/QtGuiu.def
  • Loading branch information
ogoffart committed Apr 27, 2011
2 parents 7a73de7 + f8fea6f commit 896db16
Show file tree
Hide file tree
Showing 22 changed files with 396 additions and 90 deletions.
32 changes: 8 additions & 24 deletions doc/src/platforms/platform-notes.qdoc
Original file line number Diff line number Diff line change
Expand Up @@ -708,28 +708,8 @@

\section1 Supported Devices

Qt is designed to work on any device which runs one of the following
versions of Symbian:

\table
\header \o Symbian Version
\row \o S60 3.1
\row \o S60 3.2
\row \o S60 5.0 (Symbian ^1)
\endtable

Qt has received \l{Tier 1 Platforms}{Tier 1} testing on the following phone models:

\table
\header \o Phone
\row \o Nokia 5800
\row \o Nokia E71
\row \o Nokia E72
\row \o Nokia N78
\row \o Nokia N95
\row \o Nokia N97
\row \o Samsung i8910
\endtable
See the list of supported devices at
http://wiki.forum.nokia.com/index.php/Nokia_Smart_Installer_for_Symbian#Supported_Devices

\section1 Supported Functionality

Expand All @@ -742,8 +722,6 @@
\o Planned for future release.
\row \o QtDBus
\o No current plans to support this feature.
\row \o QtOpenGL ES
\o Planned for future release.
\row \o Printing support
\o No current plans to support this feature.
\row \o Qt3Support
Expand Down Expand Up @@ -837,6 +815,12 @@
plugin. If the Helix plugin fails to load, the MMF plugin, if present on
the device, will be loaded instead.

\section1 QtOpenGL Support

Qt 4.7 introduces the QtOpenGL module to Symbian^3. QtOpenGL is supported on
devices which support OpenGL ES 2.0. Symbian platforms prior to Symbian^3
are not supported.

\section1 UI Performance in devices prior to Symbian^3

Qt uses the QPainter class to perform low-level painting on widgets and
Expand Down
2 changes: 2 additions & 0 deletions src/declarative/graphicsitems/qdeclarativepathview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1525,6 +1525,8 @@ void QDeclarativePathView::itemsRemoved(int modelIndex, int count)
} else {
d->regenerate();
d->updateCurrent();
if (!d->flicking && !d->moving && d->haveHighlightRange && d->highlightRangeMode == QDeclarativePathView::StrictlyEnforceRange)
d->snapToCurrent();
}
if (changedOffset)
emit offsetChanged();
Expand Down
17 changes: 13 additions & 4 deletions src/declarative/graphicsitems/qdeclarativetextinput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -949,6 +949,8 @@ void QDeclarativeTextInput::setCursorDelegate(QDeclarativeComponent* c)
//note that the components are owned by something else
disconnect(d->control, SIGNAL(cursorPositionChanged(int,int)),
this, SLOT(moveCursor()));
disconnect(d->control, SIGNAL(updateMicroFocus()),
this, SLOT(moveCursor()));
delete d->cursorItem;
}else{
d->startCreatingCursor();
Expand All @@ -961,7 +963,9 @@ void QDeclarativeTextInputPrivate::startCreatingCursor()
{
Q_Q(QDeclarativeTextInput);
q->connect(control, SIGNAL(cursorPositionChanged(int,int)),
q, SLOT(moveCursor()));
q, SLOT(moveCursor()), Qt::UniqueConnection);
q->connect(control, SIGNAL(updateMicroFocus()),
q, SLOT(moveCursor()), Qt::UniqueConnection);
if(cursorComponent->isReady()){
q->createCursor();
}else if(cursorComponent->isLoading()){
Expand Down Expand Up @@ -1164,9 +1168,10 @@ void QDeclarativeTextInput::mousePressEvent(QGraphicsSceneMouseEvent *event)
}
if (d->selectByMouse) {
setKeepMouseGrab(false);
d->selectPressed = true;
d->pressPos = event->pos();
}
bool mark = event->modifiers() & Qt::ShiftModifier;
bool mark = (event->modifiers() & Qt::ShiftModifier) && d->selectByMouse;
int cursor = d->xToPos(event->pos().x());
d->control->moveCursor(cursor, mark);
event->setAccepted(true);
Expand All @@ -1177,7 +1182,7 @@ void QDeclarativeTextInput::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
Q_D(QDeclarativeTextInput);
if (d->sendMouseEventToInputContext(event, QEvent::MouseMove))
return;
if (d->selectByMouse) {
if (d->selectPressed) {
if (qAbs(int(event->pos().x() - d->pressPos.x())) > QApplication::startDragDistance())
setKeepMouseGrab(true);
moveCursorSelection(d->xToPos(event->pos().x()), d->mouseSelectionMode);
Expand All @@ -1196,8 +1201,10 @@ void QDeclarativeTextInput::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
Q_D(QDeclarativeTextInput);
if (d->sendMouseEventToInputContext(event, QEvent::MouseButtonRelease))
return;
if (d->selectByMouse)
if (d->selectPressed) {
d->selectPressed = false;
setKeepMouseGrab(false);
}
if (!d->showInputPanelOnFocus) { // input panel on click
if (d->focusOnPress && !isReadOnly() && boundingRect().contains(event->pos())) {
if (QGraphicsView * view = qobject_cast<QGraphicsView*>(qApp->focusWidget())) {
Expand Down Expand Up @@ -1253,8 +1260,10 @@ bool QDeclarativeTextInputPrivate::sendMouseEventToInputContext(

bool QDeclarativeTextInput::sceneEvent(QEvent *event)
{
Q_D(QDeclarativeTextInput);
bool rv = QDeclarativeItem::sceneEvent(event);
if (event->type() == QEvent::UngrabMouse) {
d->selectPressed = false;
setKeepMouseGrab(false);
}
return rv;
Expand Down
4 changes: 3 additions & 1 deletion src/declarative/graphicsitems/qdeclarativetextinput_p_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ class Q_AUTOTEST_EXPORT QDeclarativeTextInputPrivate : public QDeclarativeImplic
mouseSelectionMode(QDeclarativeTextInput::SelectCharacters), inputMethodHints(Qt::ImhNone),
hscroll(0), oldScroll(0), oldValidity(false), focused(false), focusOnPress(true),
showInputPanelOnFocus(true), clickCausedFocus(false), cursorVisible(false),
autoScroll(true), selectByMouse(false), canPaste(false), hAlignImplicit(true)
autoScroll(true), selectByMouse(false), canPaste(false), hAlignImplicit(true),
selectPressed(false)
{
#ifdef Q_OS_SYMBIAN
if (QSysInfo::symbianVersion() == QSysInfo::SV_SF_1 || QSysInfo::symbianVersion() == QSysInfo::SV_SF_3) {
Expand Down Expand Up @@ -142,6 +143,7 @@ class Q_AUTOTEST_EXPORT QDeclarativeTextInputPrivate : public QDeclarativeImplic
bool selectByMouse:1;
bool canPaste:1;
bool hAlignImplicit:1;
bool selectPressed:1;

static inline QDeclarativeTextInputPrivate *get(QDeclarativeTextInput *t) {
return t->d_func();
Expand Down
15 changes: 13 additions & 2 deletions src/declarative/graphicsitems/qdeclarativetextlayout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ void QDeclarativeTextLayout::clearLayout()
QTextLayout::clearLayout();
}

void QDeclarativeTextLayout::prepare()
void QDeclarativeTextLayout::prepare(QPainter *painter)
{
if (!d || !d->cached) {

Expand All @@ -305,6 +305,7 @@ void QDeclarativeTextLayout::prepare()

InertTextPainter *itp = inertTextPainter();
itp->device.begin(d);
itp->painter.setPen(painter->pen());
QTextLayout::draw(&itp->painter, QPointF(0, 0));

glyph_t *glyphPool = d->glyphs.data();
Expand All @@ -323,6 +324,12 @@ void QDeclarativeTextLayout::prepare()
}
}

// Defined in qpainter.cpp
extern Q_GUI_EXPORT void qt_draw_decoration_for_glyphs(QPainter *painter, const glyph_t *glyphArray,
const QFixedPoint *positions, int glyphCount,
QFontEngine *fontEngine, const QFont &font,
const QTextCharFormat &charFormat);

void QDeclarativeTextLayout::draw(QPainter *painter, const QPointF &p)
{
QPainterPrivate *priv = QPainterPrivate::get(painter);
Expand All @@ -337,7 +344,7 @@ void QDeclarativeTextLayout::draw(QPainter *painter, const QPointF &p)
return;
}

prepare();
prepare(painter);

int itemCount = d->items.count();

Expand Down Expand Up @@ -368,6 +375,10 @@ void QDeclarativeTextLayout::draw(QPainter *painter, const QPointF &p)
currentColor = item.color;
}
priv->extended->drawStaticTextItem(&item);

qt_draw_decoration_for_glyphs(painter, item.glyphs, item.glyphPositions,
item.numGlyphs, item.fontEngine(), painter->font(),
QTextCharFormat());
}
if (currentColor != oldPen.color())
painter->setPen(oldPen);
Expand Down
2 changes: 1 addition & 1 deletion src/declarative/graphicsitems/qdeclarativetextlayout_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class QDeclarativeTextLayout : public QTextLayout
void beginLayout();
void clearLayout();

void prepare();
void prepare(QPainter *);
void draw(QPainter *, const QPointF & = QPointF());

private:
Expand Down
13 changes: 9 additions & 4 deletions src/gui/inputmethod/qcoefepinputcontext_s60.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -255,9 +255,13 @@ bool QCoeFepInputContext::filterEvent(const QEvent *event)
// fall through intended
case QEvent::KeyRelease:
const QKeyEvent *keyEvent = static_cast<const QKeyEvent *>(event);
//If proxy exists, always use hints from proxy.
QWidget *proxy = focusWidget()->focusProxy();
Qt::InputMethodHints currentHints = proxy ? proxy->inputMethodHints() : focusWidget()->inputMethodHints();

switch (keyEvent->key()) {
case Qt::Key_F20:
Q_ASSERT(m_lastImHints == focusWidget()->inputMethodHints());
Q_ASSERT(m_lastImHints == currentHints);
if (m_lastImHints & Qt::ImhHiddenText) {
// Special case in Symbian. On editors with secret text, F20 is for some reason
// considered to be a backspace.
Expand Down Expand Up @@ -287,7 +291,7 @@ bool QCoeFepInputContext::filterEvent(const QEvent *event)
}

if (keyEvent->type() == QEvent::KeyPress
&& focusWidget()->inputMethodHints() & Qt::ImhHiddenText
&& currentHints & Qt::ImhHiddenText
&& !keyEvent->text().isEmpty()) {
// Send some temporary preedit text in order to make text visible for a moment.
m_preeditString = keyEvent->text();
Expand Down Expand Up @@ -588,9 +592,10 @@ void QCoeFepInputContext::updateHints(bool mustUpdateInputCapabilities)
{
QWidget *w = focusWidget();
if (w) {
Qt::InputMethodHints hints = w->inputMethodHints();
QWidget *proxy = w->focusProxy();
Qt::InputMethodHints hints = proxy ? proxy->inputMethodHints() : w->inputMethodHints();

// Since splitview support works like an input method hint, yet it is private flag,
// Since splitview support works like an input method hint, yet it is private flag,
// we need to update its state separately.
if (QSysInfo::s60Version() > QSysInfo::SV_S60_5_0) {
TInt currentFlags = m_fepState->Flags();
Expand Down
22 changes: 11 additions & 11 deletions src/gui/painting/qpainter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,10 @@ static void drawTextItemDecoration(QPainter *painter, const QPointF &pos, const
QTextItem::RenderFlags flags, qreal width,
const QTextCharFormat &charFormat);
// Helper function to calculate left most position, width and flags for decoration drawing
static void drawDecorationForGlyphs(QPainter *painter, const glyph_t *glyphArray,
const QFixedPoint *positions, int glyphCount,
QFontEngine *fontEngine, const QFont &font,
const QTextCharFormat &charFormat);
Q_GUI_EXPORT void qt_draw_decoration_for_glyphs(QPainter *painter, const glyph_t *glyphArray,
const QFixedPoint *positions, int glyphCount,
QFontEngine *fontEngine, const QFont &font,
const QTextCharFormat &charFormat);

static inline QGradient::CoordinateMode coordinateMode(const QBrush &brush)
{
Expand Down Expand Up @@ -6060,9 +6060,9 @@ void QPainter::drawStaticText(const QPointF &topLeftPosition, const QStaticText
}
d->extended->drawStaticTextItem(item);

drawDecorationForGlyphs(this, item->glyphs, item->glyphPositions,
item->numGlyphs, item->fontEngine(), staticText_d->font,
QTextCharFormat());
qt_draw_decoration_for_glyphs(this, item->glyphs, item->glyphPositions,
item->numGlyphs, item->fontEngine(), staticText_d->font,
QTextCharFormat());
}
if (currentColor != oldPen.color())
setPen(oldPen);
Expand Down Expand Up @@ -6507,10 +6507,10 @@ static void drawTextItemDecoration(QPainter *painter, const QPointF &pos, const
painter->setBrush(oldBrush);
}

static void drawDecorationForGlyphs(QPainter *painter, const glyph_t *glyphArray,
const QFixedPoint *positions, int glyphCount,
QFontEngine *fontEngine, const QFont &font,
const QTextCharFormat &charFormat)
Q_GUI_EXPORT void qt_draw_decoration_for_glyphs(QPainter *painter, const glyph_t *glyphArray,
const QFixedPoint *positions, int glyphCount,
QFontEngine *fontEngine, const QFont &font,
const QTextCharFormat &charFormat)
{
if (!(font.underline() || font.strikeOut() || font.overline()))
return;
Expand Down
16 changes: 6 additions & 10 deletions src/gui/text/qtextcontrol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1519,7 +1519,7 @@ void QTextControlPrivate::mousePressEvent(QEvent *e, Qt::MouseButton button, con
const QTextCursor oldSelection = cursor;
const int oldCursorPos = cursor.position();

mousePressed = true;
mousePressed = (interactionFlags & Qt::TextSelectableByMouse);
#ifndef QT_NO_DRAGANDDROP
mightStartDrag = false;
#endif
Expand Down Expand Up @@ -1608,13 +1608,11 @@ void QTextControlPrivate::mouseMoveEvent(QEvent *e, Qt::MouseButton button, cons
if (!(buttons & Qt::LeftButton))
return;

const bool selectable = interactionFlags & Qt::TextSelectableByMouse;
const bool editable = interactionFlags & Qt::TextEditable;

if (!selectable && !editable)
return;

if (!(mousePressed
|| editable
|| mightStartDrag
|| selectedWordOnDoubleClick.hasSelection()
|| selectedBlockOnTrippleClick.hasSelection()))
return;
Expand All @@ -1628,7 +1626,7 @@ void QTextControlPrivate::mouseMoveEvent(QEvent *e, Qt::MouseButton button, cons
return;
}

if (!selectable)
if (!mousePressed)
return;

const qreal mouseX = qreal(mousePos.x());
Expand Down Expand Up @@ -1696,10 +1694,8 @@ void QTextControlPrivate::mouseReleaseEvent(QEvent *e, Qt::MouseButton button, c
if (mousePressed) {
mousePressed = false;
#ifndef QT_NO_CLIPBOARD
if (interactionFlags & Qt::TextSelectableByMouse) {
setClipboardSelection();
selectionChanged(true);
}
setClipboardSelection();
selectionChanged(true);
} else if (button == Qt::MidButton
&& (interactionFlags & Qt::TextEditable)
&& QApplication::clipboard()->supportsSelection()) {
Expand Down
48 changes: 16 additions & 32 deletions src/opengl/qwindowsurface_gl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -717,7 +717,6 @@ void QGLWindowSurface::flush(QWidget *widget, const QRegion &rgn, const QPoint &
} else {
glFlush();
}

return;
}

Expand Down Expand Up @@ -874,8 +873,22 @@ void QGLWindowSurface::updateGeometry() {

bool hijack(true);
QWidgetPrivate *wd = window()->d_func();
if (wd->extraData() && wd->extraData()->glContext)
hijack = false; // we already have gl context for widget
if (wd->extraData() && wd->extraData()->glContext) {
#ifdef Q_OS_SYMBIAN // Symbian needs to recreate the context when native window size changes
if (d_ptr->size != geometry().size()) {
if (window() != qt_gl_share_widget())
--(_qt_gl_share_widget()->widgetRefCount);

delete wd->extraData()->glContext;
wd->extraData()->glContext = 0;
d_ptr->ctx = 0;
}
else
#endif
{
hijack = false; // we already have gl context for widget
}
}

if (hijack)
hijackWindow(window());
Expand All @@ -896,35 +909,6 @@ void QGLWindowSurface::updateGeometry() {

d_ptr->size = surfSize;

#ifdef Q_OS_SYMBIAN
if (!hijack) { // Symbian needs to recreate EGL surface when native window size changes
if (ctx->d_func()->eglSurface != EGL_NO_SURFACE) {
eglDestroySurface(ctx->d_func()->eglContext->display(),
ctx->d_func()->eglSurface);
}

ctx->d_func()->eglSurface = QEgl::createSurface(ctx->device(),
ctx->d_func()->eglContext->config());

eglGetError(); // Clear error state.
if (!d_ptr->destructive_swap_buffers) {
eglSurfaceAttrib(ctx->d_func()->eglContext->display(),
ctx->d_func()->eglSurface,
EGL_SWAP_BEHAVIOR, EGL_BUFFER_PRESERVED);

if (eglGetError() != EGL_SUCCESS)
qWarning("QGLWindowSurface: could not enable preserved swap behaviour");
} else {
eglSurfaceAttrib(ctx->d_func()->eglContext->display(),
ctx->d_func()->eglSurface,
EGL_SWAP_BEHAVIOR, EGL_BUFFER_DESTROYED);

if (eglGetError() != EGL_SUCCESS)
qWarning("QGLWindowSurface: could not enable destroyed swap behaviour");
}
}
#endif

if (d_ptr->ctx) {
#ifndef QT_OPENGL_ES_2
if (d_ptr->destructive_swap_buffers)
Expand Down
Loading

0 comments on commit 896db16

Please sign in to comment.