Skip to content

Commit 896db16

Browse files
committed
Merge remote-tracking branch 'origin/4.7' into qt-4.8-from-4.7
Conflicts: src/opengl/qwindowsurface_gl.cpp src/s60installs/eabi/QtGuiu.def
2 parents 7a73de7 + f8fea6f commit 896db16

22 files changed

+396
-90
lines changed

doc/src/platforms/platform-notes.qdoc

+8-24
Original file line numberDiff line numberDiff line change
@@ -708,28 +708,8 @@
708708

709709
\section1 Supported Devices
710710

711-
Qt is designed to work on any device which runs one of the following
712-
versions of Symbian:
713-
714-
\table
715-
\header \o Symbian Version
716-
\row \o S60 3.1
717-
\row \o S60 3.2
718-
\row \o S60 5.0 (Symbian ^1)
719-
\endtable
720-
721-
Qt has received \l{Tier 1 Platforms}{Tier 1} testing on the following phone models:
722-
723-
\table
724-
\header \o Phone
725-
\row \o Nokia 5800
726-
\row \o Nokia E71
727-
\row \o Nokia E72
728-
\row \o Nokia N78
729-
\row \o Nokia N95
730-
\row \o Nokia N97
731-
\row \o Samsung i8910
732-
\endtable
711+
See the list of supported devices at
712+
http://wiki.forum.nokia.com/index.php/Nokia_Smart_Installer_for_Symbian#Supported_Devices
733713

734714
\section1 Supported Functionality
735715

@@ -742,8 +722,6 @@
742722
\o Planned for future release.
743723
\row \o QtDBus
744724
\o No current plans to support this feature.
745-
\row \o QtOpenGL ES
746-
\o Planned for future release.
747725
\row \o Printing support
748726
\o No current plans to support this feature.
749727
\row \o Qt3Support
@@ -837,6 +815,12 @@
837815
plugin. If the Helix plugin fails to load, the MMF plugin, if present on
838816
the device, will be loaded instead.
839817

818+
\section1 QtOpenGL Support
819+
820+
Qt 4.7 introduces the QtOpenGL module to Symbian^3. QtOpenGL is supported on
821+
devices which support OpenGL ES 2.0. Symbian platforms prior to Symbian^3
822+
are not supported.
823+
840824
\section1 UI Performance in devices prior to Symbian^3
841825

842826
Qt uses the QPainter class to perform low-level painting on widgets and

src/declarative/graphicsitems/qdeclarativepathview.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -1525,6 +1525,8 @@ void QDeclarativePathView::itemsRemoved(int modelIndex, int count)
15251525
} else {
15261526
d->regenerate();
15271527
d->updateCurrent();
1528+
if (!d->flicking && !d->moving && d->haveHighlightRange && d->highlightRangeMode == QDeclarativePathView::StrictlyEnforceRange)
1529+
d->snapToCurrent();
15281530
}
15291531
if (changedOffset)
15301532
emit offsetChanged();

src/declarative/graphicsitems/qdeclarativetextinput.cpp

+13-4
Original file line numberDiff line numberDiff line change
@@ -949,6 +949,8 @@ void QDeclarativeTextInput::setCursorDelegate(QDeclarativeComponent* c)
949949
//note that the components are owned by something else
950950
disconnect(d->control, SIGNAL(cursorPositionChanged(int,int)),
951951
this, SLOT(moveCursor()));
952+
disconnect(d->control, SIGNAL(updateMicroFocus()),
953+
this, SLOT(moveCursor()));
952954
delete d->cursorItem;
953955
}else{
954956
d->startCreatingCursor();
@@ -961,7 +963,9 @@ void QDeclarativeTextInputPrivate::startCreatingCursor()
961963
{
962964
Q_Q(QDeclarativeTextInput);
963965
q->connect(control, SIGNAL(cursorPositionChanged(int,int)),
964-
q, SLOT(moveCursor()));
966+
q, SLOT(moveCursor()), Qt::UniqueConnection);
967+
q->connect(control, SIGNAL(updateMicroFocus()),
968+
q, SLOT(moveCursor()), Qt::UniqueConnection);
965969
if(cursorComponent->isReady()){
966970
q->createCursor();
967971
}else if(cursorComponent->isLoading()){
@@ -1164,9 +1168,10 @@ void QDeclarativeTextInput::mousePressEvent(QGraphicsSceneMouseEvent *event)
11641168
}
11651169
if (d->selectByMouse) {
11661170
setKeepMouseGrab(false);
1171+
d->selectPressed = true;
11671172
d->pressPos = event->pos();
11681173
}
1169-
bool mark = event->modifiers() & Qt::ShiftModifier;
1174+
bool mark = (event->modifiers() & Qt::ShiftModifier) && d->selectByMouse;
11701175
int cursor = d->xToPos(event->pos().x());
11711176
d->control->moveCursor(cursor, mark);
11721177
event->setAccepted(true);
@@ -1177,7 +1182,7 @@ void QDeclarativeTextInput::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
11771182
Q_D(QDeclarativeTextInput);
11781183
if (d->sendMouseEventToInputContext(event, QEvent::MouseMove))
11791184
return;
1180-
if (d->selectByMouse) {
1185+
if (d->selectPressed) {
11811186
if (qAbs(int(event->pos().x() - d->pressPos.x())) > QApplication::startDragDistance())
11821187
setKeepMouseGrab(true);
11831188
moveCursorSelection(d->xToPos(event->pos().x()), d->mouseSelectionMode);
@@ -1196,8 +1201,10 @@ void QDeclarativeTextInput::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
11961201
Q_D(QDeclarativeTextInput);
11971202
if (d->sendMouseEventToInputContext(event, QEvent::MouseButtonRelease))
11981203
return;
1199-
if (d->selectByMouse)
1204+
if (d->selectPressed) {
1205+
d->selectPressed = false;
12001206
setKeepMouseGrab(false);
1207+
}
12011208
if (!d->showInputPanelOnFocus) { // input panel on click
12021209
if (d->focusOnPress && !isReadOnly() && boundingRect().contains(event->pos())) {
12031210
if (QGraphicsView * view = qobject_cast<QGraphicsView*>(qApp->focusWidget())) {
@@ -1253,8 +1260,10 @@ bool QDeclarativeTextInputPrivate::sendMouseEventToInputContext(
12531260

12541261
bool QDeclarativeTextInput::sceneEvent(QEvent *event)
12551262
{
1263+
Q_D(QDeclarativeTextInput);
12561264
bool rv = QDeclarativeItem::sceneEvent(event);
12571265
if (event->type() == QEvent::UngrabMouse) {
1266+
d->selectPressed = false;
12581267
setKeepMouseGrab(false);
12591268
}
12601269
return rv;

src/declarative/graphicsitems/qdeclarativetextinput_p_p.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ class Q_AUTOTEST_EXPORT QDeclarativeTextInputPrivate : public QDeclarativeImplic
7676
mouseSelectionMode(QDeclarativeTextInput::SelectCharacters), inputMethodHints(Qt::ImhNone),
7777
hscroll(0), oldScroll(0), oldValidity(false), focused(false), focusOnPress(true),
7878
showInputPanelOnFocus(true), clickCausedFocus(false), cursorVisible(false),
79-
autoScroll(true), selectByMouse(false), canPaste(false), hAlignImplicit(true)
79+
autoScroll(true), selectByMouse(false), canPaste(false), hAlignImplicit(true),
80+
selectPressed(false)
8081
{
8182
#ifdef Q_OS_SYMBIAN
8283
if (QSysInfo::symbianVersion() == QSysInfo::SV_SF_1 || QSysInfo::symbianVersion() == QSysInfo::SV_SF_3) {
@@ -142,6 +143,7 @@ class Q_AUTOTEST_EXPORT QDeclarativeTextInputPrivate : public QDeclarativeImplic
142143
bool selectByMouse:1;
143144
bool canPaste:1;
144145
bool hAlignImplicit:1;
146+
bool selectPressed:1;
145147

146148
static inline QDeclarativeTextInputPrivate *get(QDeclarativeTextInput *t) {
147149
return t->d_func();

src/declarative/graphicsitems/qdeclarativetextlayout.cpp

+13-2
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ void QDeclarativeTextLayout::clearLayout()
296296
QTextLayout::clearLayout();
297297
}
298298

299-
void QDeclarativeTextLayout::prepare()
299+
void QDeclarativeTextLayout::prepare(QPainter *painter)
300300
{
301301
if (!d || !d->cached) {
302302

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

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

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

327+
// Defined in qpainter.cpp
328+
extern Q_GUI_EXPORT void qt_draw_decoration_for_glyphs(QPainter *painter, const glyph_t *glyphArray,
329+
const QFixedPoint *positions, int glyphCount,
330+
QFontEngine *fontEngine, const QFont &font,
331+
const QTextCharFormat &charFormat);
332+
326333
void QDeclarativeTextLayout::draw(QPainter *painter, const QPointF &p)
327334
{
328335
QPainterPrivate *priv = QPainterPrivate::get(painter);
@@ -337,7 +344,7 @@ void QDeclarativeTextLayout::draw(QPainter *painter, const QPointF &p)
337344
return;
338345
}
339346

340-
prepare();
347+
prepare(painter);
341348

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

@@ -368,6 +375,10 @@ void QDeclarativeTextLayout::draw(QPainter *painter, const QPointF &p)
368375
currentColor = item.color;
369376
}
370377
priv->extended->drawStaticTextItem(&item);
378+
379+
qt_draw_decoration_for_glyphs(painter, item.glyphs, item.glyphPositions,
380+
item.numGlyphs, item.fontEngine(), painter->font(),
381+
QTextCharFormat());
371382
}
372383
if (currentColor != oldPen.color())
373384
painter->setPen(oldPen);

src/declarative/graphicsitems/qdeclarativetextlayout_p.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class QDeclarativeTextLayout : public QTextLayout
6161
void beginLayout();
6262
void clearLayout();
6363

64-
void prepare();
64+
void prepare(QPainter *);
6565
void draw(QPainter *, const QPointF & = QPointF());
6666

6767
private:

src/gui/inputmethod/qcoefepinputcontext_s60.cpp

+9-4
Original file line numberDiff line numberDiff line change
@@ -255,9 +255,13 @@ bool QCoeFepInputContext::filterEvent(const QEvent *event)
255255
// fall through intended
256256
case QEvent::KeyRelease:
257257
const QKeyEvent *keyEvent = static_cast<const QKeyEvent *>(event);
258+
//If proxy exists, always use hints from proxy.
259+
QWidget *proxy = focusWidget()->focusProxy();
260+
Qt::InputMethodHints currentHints = proxy ? proxy->inputMethodHints() : focusWidget()->inputMethodHints();
261+
258262
switch (keyEvent->key()) {
259263
case Qt::Key_F20:
260-
Q_ASSERT(m_lastImHints == focusWidget()->inputMethodHints());
264+
Q_ASSERT(m_lastImHints == currentHints);
261265
if (m_lastImHints & Qt::ImhHiddenText) {
262266
// Special case in Symbian. On editors with secret text, F20 is for some reason
263267
// considered to be a backspace.
@@ -287,7 +291,7 @@ bool QCoeFepInputContext::filterEvent(const QEvent *event)
287291
}
288292

289293
if (keyEvent->type() == QEvent::KeyPress
290-
&& focusWidget()->inputMethodHints() & Qt::ImhHiddenText
294+
&& currentHints & Qt::ImhHiddenText
291295
&& !keyEvent->text().isEmpty()) {
292296
// Send some temporary preedit text in order to make text visible for a moment.
293297
m_preeditString = keyEvent->text();
@@ -588,9 +592,10 @@ void QCoeFepInputContext::updateHints(bool mustUpdateInputCapabilities)
588592
{
589593
QWidget *w = focusWidget();
590594
if (w) {
591-
Qt::InputMethodHints hints = w->inputMethodHints();
595+
QWidget *proxy = w->focusProxy();
596+
Qt::InputMethodHints hints = proxy ? proxy->inputMethodHints() : w->inputMethodHints();
592597

593-
// Since splitview support works like an input method hint, yet it is private flag,
598+
// Since splitview support works like an input method hint, yet it is private flag,
594599
// we need to update its state separately.
595600
if (QSysInfo::s60Version() > QSysInfo::SV_S60_5_0) {
596601
TInt currentFlags = m_fepState->Flags();

src/gui/painting/qpainter.cpp

+11-11
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,10 @@ static void drawTextItemDecoration(QPainter *painter, const QPointF &pos, const
9898
QTextItem::RenderFlags flags, qreal width,
9999
const QTextCharFormat &charFormat);
100100
// Helper function to calculate left most position, width and flags for decoration drawing
101-
static void drawDecorationForGlyphs(QPainter *painter, const glyph_t *glyphArray,
102-
const QFixedPoint *positions, int glyphCount,
103-
QFontEngine *fontEngine, const QFont &font,
104-
const QTextCharFormat &charFormat);
101+
Q_GUI_EXPORT void qt_draw_decoration_for_glyphs(QPainter *painter, const glyph_t *glyphArray,
102+
const QFixedPoint *positions, int glyphCount,
103+
QFontEngine *fontEngine, const QFont &font,
104+
const QTextCharFormat &charFormat);
105105

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

6063-
drawDecorationForGlyphs(this, item->glyphs, item->glyphPositions,
6064-
item->numGlyphs, item->fontEngine(), staticText_d->font,
6065-
QTextCharFormat());
6063+
qt_draw_decoration_for_glyphs(this, item->glyphs, item->glyphPositions,
6064+
item->numGlyphs, item->fontEngine(), staticText_d->font,
6065+
QTextCharFormat());
60666066
}
60676067
if (currentColor != oldPen.color())
60686068
setPen(oldPen);
@@ -6507,10 +6507,10 @@ static void drawTextItemDecoration(QPainter *painter, const QPointF &pos, const
65076507
painter->setBrush(oldBrush);
65086508
}
65096509

6510-
static void drawDecorationForGlyphs(QPainter *painter, const glyph_t *glyphArray,
6511-
const QFixedPoint *positions, int glyphCount,
6512-
QFontEngine *fontEngine, const QFont &font,
6513-
const QTextCharFormat &charFormat)
6510+
Q_GUI_EXPORT void qt_draw_decoration_for_glyphs(QPainter *painter, const glyph_t *glyphArray,
6511+
const QFixedPoint *positions, int glyphCount,
6512+
QFontEngine *fontEngine, const QFont &font,
6513+
const QTextCharFormat &charFormat)
65146514
{
65156515
if (!(font.underline() || font.strikeOut() || font.overline()))
65166516
return;

src/gui/text/qtextcontrol.cpp

+6-10
Original file line numberDiff line numberDiff line change
@@ -1519,7 +1519,7 @@ void QTextControlPrivate::mousePressEvent(QEvent *e, Qt::MouseButton button, con
15191519
const QTextCursor oldSelection = cursor;
15201520
const int oldCursorPos = cursor.position();
15211521

1522-
mousePressed = true;
1522+
mousePressed = (interactionFlags & Qt::TextSelectableByMouse);
15231523
#ifndef QT_NO_DRAGANDDROP
15241524
mightStartDrag = false;
15251525
#endif
@@ -1608,13 +1608,11 @@ void QTextControlPrivate::mouseMoveEvent(QEvent *e, Qt::MouseButton button, cons
16081608
if (!(buttons & Qt::LeftButton))
16091609
return;
16101610

1611-
const bool selectable = interactionFlags & Qt::TextSelectableByMouse;
16121611
const bool editable = interactionFlags & Qt::TextEditable;
16131612

1614-
if (!selectable && !editable)
1615-
return;
1616-
16171613
if (!(mousePressed
1614+
|| editable
1615+
|| mightStartDrag
16181616
|| selectedWordOnDoubleClick.hasSelection()
16191617
|| selectedBlockOnTrippleClick.hasSelection()))
16201618
return;
@@ -1628,7 +1626,7 @@ void QTextControlPrivate::mouseMoveEvent(QEvent *e, Qt::MouseButton button, cons
16281626
return;
16291627
}
16301628

1631-
if (!selectable)
1629+
if (!mousePressed)
16321630
return;
16331631

16341632
const qreal mouseX = qreal(mousePos.x());
@@ -1696,10 +1694,8 @@ void QTextControlPrivate::mouseReleaseEvent(QEvent *e, Qt::MouseButton button, c
16961694
if (mousePressed) {
16971695
mousePressed = false;
16981696
#ifndef QT_NO_CLIPBOARD
1699-
if (interactionFlags & Qt::TextSelectableByMouse) {
1700-
setClipboardSelection();
1701-
selectionChanged(true);
1702-
}
1697+
setClipboardSelection();
1698+
selectionChanged(true);
17031699
} else if (button == Qt::MidButton
17041700
&& (interactionFlags & Qt::TextEditable)
17051701
&& QApplication::clipboard()->supportsSelection()) {

src/opengl/qwindowsurface_gl.cpp

+16-32
Original file line numberDiff line numberDiff line change
@@ -717,7 +717,6 @@ void QGLWindowSurface::flush(QWidget *widget, const QRegion &rgn, const QPoint &
717717
} else {
718718
glFlush();
719719
}
720-
721720
return;
722721
}
723722

@@ -874,8 +873,22 @@ void QGLWindowSurface::updateGeometry() {
874873

875874
bool hijack(true);
876875
QWidgetPrivate *wd = window()->d_func();
877-
if (wd->extraData() && wd->extraData()->glContext)
878-
hijack = false; // we already have gl context for widget
876+
if (wd->extraData() && wd->extraData()->glContext) {
877+
#ifdef Q_OS_SYMBIAN // Symbian needs to recreate the context when native window size changes
878+
if (d_ptr->size != geometry().size()) {
879+
if (window() != qt_gl_share_widget())
880+
--(_qt_gl_share_widget()->widgetRefCount);
881+
882+
delete wd->extraData()->glContext;
883+
wd->extraData()->glContext = 0;
884+
d_ptr->ctx = 0;
885+
}
886+
else
887+
#endif
888+
{
889+
hijack = false; // we already have gl context for widget
890+
}
891+
}
879892

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

897910
d_ptr->size = surfSize;
898911

899-
#ifdef Q_OS_SYMBIAN
900-
if (!hijack) { // Symbian needs to recreate EGL surface when native window size changes
901-
if (ctx->d_func()->eglSurface != EGL_NO_SURFACE) {
902-
eglDestroySurface(ctx->d_func()->eglContext->display(),
903-
ctx->d_func()->eglSurface);
904-
}
905-
906-
ctx->d_func()->eglSurface = QEgl::createSurface(ctx->device(),
907-
ctx->d_func()->eglContext->config());
908-
909-
eglGetError(); // Clear error state.
910-
if (!d_ptr->destructive_swap_buffers) {
911-
eglSurfaceAttrib(ctx->d_func()->eglContext->display(),
912-
ctx->d_func()->eglSurface,
913-
EGL_SWAP_BEHAVIOR, EGL_BUFFER_PRESERVED);
914-
915-
if (eglGetError() != EGL_SUCCESS)
916-
qWarning("QGLWindowSurface: could not enable preserved swap behaviour");
917-
} else {
918-
eglSurfaceAttrib(ctx->d_func()->eglContext->display(),
919-
ctx->d_func()->eglSurface,
920-
EGL_SWAP_BEHAVIOR, EGL_BUFFER_DESTROYED);
921-
922-
if (eglGetError() != EGL_SUCCESS)
923-
qWarning("QGLWindowSurface: could not enable destroyed swap behaviour");
924-
}
925-
}
926-
#endif
927-
928912
if (d_ptr->ctx) {
929913
#ifndef QT_OPENGL_ES_2
930914
if (d_ptr->destructive_swap_buffers)

0 commit comments

Comments
 (0)