summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorA-Team <ateam@pad.test.qt.nokia.com>2010-12-16 23:00:15 (GMT)
committerA-Team <ateam@pad.test.qt.nokia.com>2010-12-16 23:00:15 (GMT)
commitf021555182edb4163d1bca29ed16da6748029771 (patch)
tree4e08270009ae458e698f52b4de2172e5f97b511e
parentda1b6e7199dfd63cce79af0bd875df78b4d199db (diff)
parent640aad736476f7f8a4ec92fedecae234fb2e2d2e (diff)
downloadQt-f021555182edb4163d1bca29ed16da6748029771.zip
Qt-f021555182edb4163d1bca29ed16da6748029771.tar.gz
Qt-f021555182edb4163d1bca29ed16da6748029771.tar.bz2
Merge branch '4.7-upstream' into 4.7-doc
-rw-r--r--demos/textedit/textedit.cpp6
-rw-r--r--mkspecs/linux-icc/qmake.conf2
-rw-r--r--src/corelib/kernel/qeventdispatcher_unix.cpp1
-rw-r--r--src/declarative/qml/qdeclarativeenginedebug.cpp5
-rw-r--r--src/gui/dialogs/qdialog.cpp13
-rw-r--r--src/gui/dialogs/qinputdialog.cpp2
-rw-r--r--src/gui/graphicsview/qgraphicslayoutitem.cpp3
-rw-r--r--src/gui/graphicsview/qgraphicsview.cpp2
-rw-r--r--src/gui/inputmethod/qcoefepinputcontext_s60.cpp2
-rw-r--r--src/gui/itemviews/qabstractitemview.cpp2
-rw-r--r--src/gui/kernel/qapplication_s60.cpp6
-rw-r--r--src/gui/painting/qpaintengine_raster.cpp33
-rw-r--r--src/gui/painting/qpaintengine_raster_p.h2
-rw-r--r--src/gui/styles/qs60style.cpp38
-rw-r--r--src/network/socket/qnativesocketengine_unix.cpp13
-rw-r--r--tests/auto/qgraphicsview/tst_qgraphicsview.cpp39
-rw-r--r--tests/auto/qprocess/tst_qprocess.cpp8
-rw-r--r--tests/auto/symbian/orientationchange/orientationchange.pro1
-rw-r--r--tests/auto/symbian/orientationchange/tst_orientationchange.cpp43
19 files changed, 158 insertions, 63 deletions
diff --git a/demos/textedit/textedit.cpp b/demos/textedit/textedit.cpp
index 165c97c..9fa1949 100644
--- a/demos/textedit/textedit.cpp
+++ b/demos/textedit/textedit.cpp
@@ -262,7 +262,8 @@ void TextEdit::setupEditActions()
tb->addAction(a);
menu->addAction(a);
#ifndef QT_NO_CLIPBOARD
- actionPaste->setEnabled(QApplication::clipboard()->mimeData()->hasText());
+ if (const QMimeData *md = QApplication::clipboard()->mimeData())
+ actionPaste->setEnabled(md->hasText());
#endif
}
@@ -681,7 +682,8 @@ void TextEdit::cursorPositionChanged()
void TextEdit::clipboardDataChanged()
{
#ifndef QT_NO_CLIPBOARD
- actionPaste->setEnabled(QApplication::clipboard()->mimeData()->hasText());
+ if (const QMimeData *md = QApplication::clipboard()->mimeData())
+ actionPaste->setEnabled(md->hasText());
#endif
}
diff --git a/mkspecs/linux-icc/qmake.conf b/mkspecs/linux-icc/qmake.conf
index af56a9a..ba707e23 100644
--- a/mkspecs/linux-icc/qmake.conf
+++ b/mkspecs/linux-icc/qmake.conf
@@ -23,7 +23,7 @@ QMAKE_YACC = yacc
QMAKE_YACCFLAGS = -d
QMAKE_CFLAGS = -falign-stack=maintain-16-byte
QMAKE_CFLAGS_DEPS = -M
-QMAKE_CFLAGS_WARN_ON = -w1 -Wcheck -wd654,1572,411,873,1125
+QMAKE_CFLAGS_WARN_ON = -w1 -Wcheck -wd654,1572,411,873,1125,2259
QMAKE_CFLAGS_WARN_OFF = -w
QMAKE_CFLAGS_RELEASE = -O2 -falign-functions=16 -ansi-alias -fstrict-aliasing
QMAKE_CFLAGS_DEBUG = -O0 -g
diff --git a/src/corelib/kernel/qeventdispatcher_unix.cpp b/src/corelib/kernel/qeventdispatcher_unix.cpp
index f50994c..b2ccc68 100644
--- a/src/corelib/kernel/qeventdispatcher_unix.cpp
+++ b/src/corelib/kernel/qeventdispatcher_unix.cpp
@@ -501,6 +501,7 @@ bool QTimerInfoList::unregisterTimer(int timerId)
}
}
// id not found
+ qWarning("Application asked to unregister timer 0x%x which is not registered in this thread. Fix application.", timerId);
return false;
}
diff --git a/src/declarative/qml/qdeclarativeenginedebug.cpp b/src/declarative/qml/qdeclarativeenginedebug.cpp
index bffe681..e54f7d6 100644
--- a/src/declarative/qml/qdeclarativeenginedebug.cpp
+++ b/src/declarative/qml/qdeclarativeenginedebug.cpp
@@ -146,7 +146,10 @@ QDeclarativeEngineDebugServer::propertyData(QObject *obj, int propIdx)
if (binding)
rv.binding = binding->expression();
- QVariant value = prop.read(obj);
+ QVariant value;
+ if (prop.userType() != 0) {
+ value = prop.read(obj);
+ }
rv.value = valueContents(value);
if (QDeclarativeValueTypeFactory::isValueType(prop.userType())) {
diff --git a/src/gui/dialogs/qdialog.cpp b/src/gui/dialogs/qdialog.cpp
index fbdc522..16ea045 100644
--- a/src/gui/dialogs/qdialog.cpp
+++ b/src/gui/dialogs/qdialog.cpp
@@ -901,15 +901,13 @@ bool QDialog::symbianAdjustedPosition()
QPoint p;
const bool doS60Positioning = !(isFullScreen()||isMaximized());
if (doS60Positioning) {
+ QPoint oldPos = pos();
// naive way to deduce screen orientation
if (S60->screenHeightInPixels > S60->screenWidthInPixels) {
int cbaHeight;
- const CEikButtonGroupContainer* bgContainer = S60->buttonGroupContainer();
- if (!bgContainer) {
- cbaHeight = 0;
- } else {
- cbaHeight = qt_TSize2QSize(bgContainer->Size()).height();
- }
+ TRect rect;
+ AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EControlPane, rect);
+ cbaHeight = rect.Height();
p.setY(S60->screenHeightInPixels - height() - cbaHeight);
p.setX(0);
} else {
@@ -939,7 +937,8 @@ bool QDialog::symbianAdjustedPosition()
p.setX(qMax(0,S60->screenWidthInPixels - width()));
}
}
- move(p);
+ if (oldPos != p || p.y() < 0)
+ move(p);
}
return doS60Positioning;
#else
diff --git a/src/gui/dialogs/qinputdialog.cpp b/src/gui/dialogs/qinputdialog.cpp
index ce27bd3..a29376a 100644
--- a/src/gui/dialogs/qinputdialog.cpp
+++ b/src/gui/dialogs/qinputdialog.cpp
@@ -234,6 +234,8 @@ void QInputDialogPrivate::ensureLayout()
//we want to let the input dialog grow to available size on Symbian.
#ifndef Q_OS_SYMBIAN
mainLayout->setSizeConstraint(QLayout::SetMinAndMaxSize);
+#else
+ label->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
#endif
mainLayout->addWidget(label);
mainLayout->addWidget(inputWidget);
diff --git a/src/gui/graphicsview/qgraphicslayoutitem.cpp b/src/gui/graphicsview/qgraphicslayoutitem.cpp
index df13039..0a24aae 100644
--- a/src/gui/graphicsview/qgraphicslayoutitem.cpp
+++ b/src/gui/graphicsview/qgraphicslayoutitem.cpp
@@ -129,7 +129,6 @@ void QGraphicsLayoutItemPrivate::init()
{
sizeHintCacheDirty = true;
sizeHintWithConstraintCacheDirty = true;
- sizePolicy = QSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
}
/*!
@@ -400,6 +399,7 @@ QGraphicsLayoutItem::QGraphicsLayoutItem(QGraphicsLayoutItem *parent, bool isLay
{
Q_D(QGraphicsLayoutItem);
d->init();
+ d->sizePolicy = QSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
d->q_ptr = this;
}
@@ -410,6 +410,7 @@ QGraphicsLayoutItem::QGraphicsLayoutItem(QGraphicsLayoutItemPrivate &dd)
: d_ptr(&dd)
{
Q_D(QGraphicsLayoutItem);
+ d->init();
d->q_ptr = this;
}
diff --git a/src/gui/graphicsview/qgraphicsview.cpp b/src/gui/graphicsview/qgraphicsview.cpp
index a566c8e..2acea8a 100644
--- a/src/gui/graphicsview/qgraphicsview.cpp
+++ b/src/gui/graphicsview/qgraphicsview.cpp
@@ -2494,7 +2494,7 @@ QVariant QGraphicsView::inputMethodQuery(Qt::InputMethodQuery query) const
QVariant value = d->scene->inputMethodQuery(query);
if (value.type() == QVariant::RectF)
- value = mapFromScene(value.toRectF()).boundingRect();
+ value = d->mapRectFromScene(value.toRectF());
else if (value.type() == QVariant::PointF)
value = mapFromScene(value.toPointF());
else if (value.type() == QVariant::Rect)
diff --git a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp
index 686f388..d48d63d 100644
--- a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp
+++ b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp
@@ -89,7 +89,7 @@ QCoeFepInputContext::QCoeFepInputContext(QObject *parent)
m_fepState->SetFlags(EAknEditorFlagDefault);
m_fepState->SetDefaultInputMode( EAknEditorTextInputMode );
m_fepState->SetPermittedInputModes( EAknEditorAllInputModes );
- m_fepState->SetDefaultCase( EAknEditorLowerCase );
+ m_fepState->SetDefaultCase( EAknEditorTextCase );
m_fepState->SetPermittedCases( EAknEditorAllCaseModes );
m_fepState->SetSpecialCharacterTableResourceId(R_AVKON_SPECIAL_CHARACTER_TABLE_DIALOG);
m_fepState->SetNumericKeymap( EAknEditorStandardNumberModeKeymap );
diff --git a/src/gui/itemviews/qabstractitemview.cpp b/src/gui/itemviews/qabstractitemview.cpp
index acc8deb..177b088 100644
--- a/src/gui/itemviews/qabstractitemview.cpp
+++ b/src/gui/itemviews/qabstractitemview.cpp
@@ -595,6 +595,8 @@ QAbstractItemView::QAbstractItemView(QAbstractItemViewPrivate &dd, QWidget *pare
*/
QAbstractItemView::~QAbstractItemView()
{
+ // stop this timer here before ~QObject
+ d_func()->delayedReset.stop();
}
/*!
diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp
index 6db1fa8..181fcc7 100644
--- a/src/gui/kernel/qapplication_s60.cpp
+++ b/src/gui/kernel/qapplication_s60.cpp
@@ -1174,8 +1174,10 @@ void QSymbianControl::SizeChanged()
if (!slowResize && tlwExtra)
tlwExtra->inTopLevelResize = false;
} else {
- QResizeEvent *e = new QResizeEvent(newSize, oldSize);
- QApplication::postEvent(qwidget, e);
+ if (!qwidget->testAttribute(Qt::WA_PendingResizeEvent)) {
+ QResizeEvent *e = new QResizeEvent(newSize, oldSize);
+ QApplication::postEvent(qwidget, e);
+ }
}
}
diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp
index 89202ac..4d06c9f 100644
--- a/src/gui/painting/qpaintengine_raster.cpp
+++ b/src/gui/painting/qpaintengine_raster.cpp
@@ -1212,7 +1212,7 @@ void QRasterPaintEngine::clip(const QVectorPath &path, Qt::ClipOperation op)
// There are some cases that are not supported by clip(QRect)
if (op != Qt::UniteClip && (op != Qt::IntersectClip || !s->clip
|| s->clip->hasRectClip || s->clip->hasRegionClip)) {
- if (s->matrix.type() <= QTransform::TxTranslate
+ if (s->matrix.type() <= QTransform::TxScale
&& ((path.shape() == QVectorPath::RectangleHint)
|| (isRect(points, path.elementCount())
&& (!types || (types[0] == QPainterPath::MoveToElement
@@ -1224,8 +1224,8 @@ void QRasterPaintEngine::clip(const QVectorPath &path, Qt::ClipOperation op)
#endif
QRectF r(points[0], points[1], points[4]-points[0], points[5]-points[1]);
- clip(r.toRect(), op);
- return;
+ if (setClipRectInDeviceCoords(s->matrix.mapRect(r).toRect(), op))
+ return;
}
}
@@ -1286,7 +1286,6 @@ void QRasterPaintEngine::clip(const QRect &rect, Qt::ClipOperation op)
qDebug() << "QRasterPaintEngine::clip(): " << rect << op;
#endif
- Q_D(QRasterPaintEngine);
QRasterPaintEngineState *s = state();
if (op == Qt::NoClip) {
@@ -1296,11 +1295,23 @@ void QRasterPaintEngine::clip(const QRect &rect, Qt::ClipOperation op)
QPaintEngineEx::clip(rect, op);
return;
- } else if (op == Qt::ReplaceClip || s->clip == 0) {
+ } else if (!setClipRectInDeviceCoords(s->matrix.mapRect(rect), op)) {
+ QPaintEngineEx::clip(rect, op);
+ return;
+ }
+}
+
+
+bool QRasterPaintEngine::setClipRectInDeviceCoords(const QRect &r, Qt::ClipOperation op)
+{
+ Q_D(QRasterPaintEngine);
+ QRect clipRect = r & d->deviceRect;
+ QRasterPaintEngineState *s = state();
+
+ if (op == Qt::ReplaceClip || s->clip == 0) {
// No current clip, hence we intersect with sysclip and be
// done with it...
- QRect clipRect = s->matrix.mapRect(rect) & d->deviceRect;
QRegion clipRegion = systemClip();
QClipData *clip = new QClipData(d->rasterBuffer->height());
@@ -1316,12 +1327,11 @@ void QRasterPaintEngine::clip(const QRect &rect, Qt::ClipOperation op)
s->clip->enabled = true;
s->flags.has_clip_ownership = true;
- } else { // intersect clip with current clip
+ } else if (op == Qt::IntersectClip){ // intersect clip with current clip
QClipData *base = s->clip;
Q_ASSERT(base);
if (base->hasRectClip || base->hasRegionClip) {
- QRect clipRect = s->matrix.mapRect(rect) & d->deviceRect;
if (!s->flags.has_clip_ownership) {
s->clip = new QClipData(d->rasterBuffer->height());
s->flags.has_clip_ownership = true;
@@ -1332,11 +1342,14 @@ void QRasterPaintEngine::clip(const QRect &rect, Qt::ClipOperation op)
s->clip->setClipRegion(base->clipRegion & clipRect);
s->clip->enabled = true;
} else {
- QPaintEngineEx::clip(rect, op);
- return;
+ return false;
}
+ } else {
+ return false;
}
+
qrasterpaintengine_dirty_clip(d, s);
+ return true;
}
diff --git a/src/gui/painting/qpaintengine_raster_p.h b/src/gui/painting/qpaintengine_raster_p.h
index 1016f8d..7d4d3b6 100644
--- a/src/gui/painting/qpaintengine_raster_p.h
+++ b/src/gui/painting/qpaintengine_raster_p.h
@@ -266,6 +266,8 @@ private:
void drawGlyphsS60(const QPointF &p, const QTextItemInt &ti);
#endif // Q_OS_SYMBIAN && QT_NO_FREETYPE
+ bool setClipRectInDeviceCoords(const QRect &r, Qt::ClipOperation op);
+
inline void ensureBrush(const QBrush &brush) {
if (!qbrush_fast_equals(state()->lastBrush, brush) || (brush.style() != Qt::NoBrush && state()->fillFlags))
updateBrush(brush);
diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp
index 2f09529..56d2d19 100644
--- a/src/gui/styles/qs60style.cpp
+++ b/src/gui/styles/qs60style.cpp
@@ -104,11 +104,11 @@ const int QS60StylePrivate::m_numberOfLayouts =
const short QS60StylePrivate::data[][MAX_PIXELMETRICS] = {
// *** generated pixel metrics ***
-{5,0,-909,0,0,2,0,0,-1,7,12,22,15,15,7,198,-909,-909,-909,20,13,2,0,0,21,7,18,30,3,3,1,-909,-909,0,1,0,0,12,20,15,15,18,18,1,115,18,0,-909,-909,-909,-909,0,0,16,2,-909,0,0,-909,16,-909,-909,-909,-909,32,18,55,24,55,4,4,4,9,13,-909,5,51,11,5,0,3,3,6,8,3,3,-909,2,-909,-909,-909,-909,5,5,3,1,106},
-{5,0,-909,0,0,1,0,0,-1,8,14,22,15,15,7,164,-909,-909,-909,19,15,2,0,0,21,8,27,28,4,4,1,-909,-909,0,7,6,0,13,23,17,17,21,21,7,115,21,0,-909,-909,-909,-909,0,0,15,1,-909,0,0,-909,15,-909,-909,-909,-909,32,21,65,27,65,3,3,5,10,15,-909,5,58,13,5,0,4,4,7,9,4,4,-909,2,-909,-909,-909,-909,6,6,3,1,106},
-{7,0,-909,0,0,2,0,0,-1,25,69,46,37,37,9,258,-909,-909,-909,23,19,26,0,0,32,25,72,44,5,5,2,-909,-909,0,7,21,0,17,29,22,22,27,27,7,173,29,0,-909,-909,-909,-909,0,0,25,2,-909,0,0,-909,25,-909,-909,-909,-909,87,27,77,35,77,13,3,6,8,19,-909,7,74,19,7,0,5,5,8,12,5,5,-909,3,-909,-909,-909,-909,7,7,3,1,135},
-{7,0,-909,0,0,2,0,0,-1,25,68,46,37,37,9,258,-909,-909,-909,31,19,6,0,0,32,25,60,52,5,5,2,-909,-909,0,7,32,0,17,29,22,22,27,27,7,173,29,0,-909,-909,-909,-909,0,0,26,2,-909,0,0,-909,26,-909,-909,-909,-909,87,27,96,35,96,12,3,6,8,19,-909,7,74,22,7,0,5,5,8,12,5,5,-909,3,-909,-909,-909,-909,7,7,3,1,135},
-{7,0,-909,0,0,2,0,0,-1,10,20,27,18,18,9,301,-909,-909,-909,29,18,5,0,0,35,7,32,30,5,5,2,-909,-909,0,2,8,0,16,28,21,21,26,26,2,170,26,0,-909,-909,-909,-909,0,0,21,6,-909,0,0,-909,-909,-909,-909,-909,-909,54,26,265,34,265,5,5,6,3,18,-909,7,72,19,7,0,5,6,8,11,6,5,-909,2,-909,-909,-909,-909,5,5,3,1,106}
+{5,0,-909,0,0,2,0,2,-1,7,12,22,15,15,7,198,-909,-909,-909,20,13,2,0,0,21,7,18,30,3,3,1,-909,-909,0,1,0,0,12,20,15,15,18,18,1,115,18,0,-909,-909,-909,-909,0,0,16,2,-909,0,0,-909,16,-909,-909,-909,-909,32,18,55,24,55,4,4,4,9,13,-909,5,51,11,5,0,3,3,6,8,3,3,-909,2,-909,-909,-909,-909,5,5,3,1,106},
+{5,0,-909,0,0,1,0,2,-1,8,14,22,15,15,7,164,-909,-909,-909,19,15,2,0,0,21,8,27,28,4,4,1,-909,-909,0,7,6,0,13,23,17,17,21,21,7,115,21,0,-909,-909,-909,-909,0,0,15,1,-909,0,0,-909,15,-909,-909,-909,-909,32,21,65,27,65,3,3,5,10,15,-909,5,58,13,5,0,4,4,7,9,4,4,-909,2,-909,-909,-909,-909,6,6,3,1,106},
+{7,0,-909,0,0,2,0,5,-1,25,69,46,37,37,9,258,-909,-909,-909,23,19,26,0,0,32,25,72,44,5,5,2,-909,-909,0,7,21,0,17,29,22,22,27,27,7,173,29,0,-909,-909,-909,-909,0,0,25,2,-909,0,0,-909,25,-909,-909,-909,-909,87,27,77,35,77,13,3,6,8,19,-909,7,74,19,7,0,5,5,8,12,5,5,-909,3,-909,-909,-909,-909,7,7,3,1,135},
+{7,0,-909,0,0,2,0,5,-1,25,68,46,37,37,9,258,-909,-909,-909,31,19,6,0,0,32,25,60,52,5,5,2,-909,-909,0,7,32,0,17,29,22,22,27,27,7,173,29,0,-909,-909,-909,-909,0,0,26,2,-909,0,0,-909,26,-909,-909,-909,-909,87,27,96,35,96,12,3,6,8,19,-909,7,74,22,7,0,5,5,8,12,5,5,-909,3,-909,-909,-909,-909,7,7,3,1,135},
+{7,0,-909,0,0,2,0,2,-1,10,20,27,18,18,9,301,-909,-909,-909,29,18,5,0,0,35,7,32,30,5,5,2,-909,-909,0,2,8,0,16,28,21,21,26,26,2,170,26,0,-909,-909,-909,-909,0,0,21,6,-909,0,0,-909,-909,-909,-909,-909,-909,54,26,265,34,265,5,5,6,3,18,-909,7,72,19,7,0,5,6,8,11,6,5,-909,2,-909,-909,-909,-909,5,5,3,1,106}
// *** End of generated data ***
};
@@ -1071,11 +1071,11 @@ void QS60Style::drawComplexControl(ComplexControl control, const QStyleOptionCom
// Button frame
QStyleOptionFrame buttonOption;
buttonOption.QStyleOption::operator=(*cmb);
- const int maxHeight = cmbxFrame.height();
- const int maxWidth = cmbxFrame.width() - cmbxEditField.width();
+ const int maxButtonSide = cmbxFrame.width() - cmbxEditField.width();
+ const int newTop = cmbxEditField.center().y() - maxButtonSide / 2;
const int topLeftPoint = direction ?
- (cmbxEditField.right() + 1) : (cmbxEditField.left() + 1 - maxWidth);
- const QRect buttonRect(topLeftPoint, cmbxEditField.top(), maxWidth, maxHeight);
+ (cmbxEditField.right() + 1) : (cmbxEditField.left() + 1 - maxButtonSide);
+ const QRect buttonRect(topLeftPoint, newTop, maxButtonSide, maxButtonSide);
buttonOption.rect = buttonRect;
buttonOption.state = cmb->state;
drawPrimitive(PE_PanelButtonCommand, &buttonOption, painter, widget);
@@ -2884,30 +2884,24 @@ QRect QS60Style::subControlRect(ComplexControl control, const QStyleOptionComple
ret = cmb->rect;
const int width = cmb->rect.width();
const int height = cmb->rect.height();
- const int buttonIconSize = QS60StylePrivate::pixelMetric(PM_ButtonIconSize);
const int buttonMargin = cmb->frame ? 2 : 0;
// lets use spinbox frame here as well, as no combobox specific value available.
const int frameThickness = cmb->frame ? pixelMetric(PM_SpinBoxFrameWidth, cmb, widget) : 0;
- const int buttonWidth = qMax(cmb->rect.height(), buttonIconSize);
-
+ const int buttonMinSize = QS60StylePrivate::pixelMetric(PM_ButtonIconSize) + 2 * buttonMargin;
QSize buttonSize;
- buttonSize.setWidth(buttonWidth + 2 * buttonMargin);
- buttonSize.setHeight(qMax(8, (cmb->rect.height() >> 1) - frameThickness)); //buttons should be squares
+ //allow button to grow to one fourth of the frame height, if the frame is really tall
+ buttonSize.setHeight(qMin(height, qMax(width / 4, buttonMinSize)));
+ buttonSize.setWidth(buttonSize.height());
buttonSize = buttonSize.expandedTo(QApplication::globalStrut());
switch (scontrol) {
case SC_ComboBoxArrow: {
- const int xposMod = cmb->rect.x() + width - buttonMargin - buttonWidth;
+ const int xposMod = cmb->rect.x() + width - buttonMargin - buttonSize.width();
const int ypos = cmb->rect.y();
- ret.setRect(xposMod, ypos + buttonMargin, buttonWidth, height - 2 * buttonMargin);
+ ret.setRect(xposMod, ypos + buttonMargin, buttonSize.width(), height - 2 * buttonMargin);
}
break;
case SC_ComboBoxEditField: {
- const int withFrameX = cmb->rect.x() + width - frameThickness - buttonSize.width();
- ret = QRect(
- frameThickness,
- frameThickness,
- withFrameX - frameThickness,
- height - 2 * frameThickness);
+ ret = QRect(0, 0, cmb->rect.x() + width - buttonSize.width(), height);
}
break;
case SC_ComboBoxListBoxPopup: {
diff --git a/src/network/socket/qnativesocketengine_unix.cpp b/src/network/socket/qnativesocketengine_unix.cpp
index f6bfbac..021acd0 100644
--- a/src/network/socket/qnativesocketengine_unix.cpp
+++ b/src/network/socket/qnativesocketengine_unix.cpp
@@ -202,9 +202,6 @@ bool QNativeSocketEnginePrivate::createNewSocket(QAbstractSocket::SocketType soc
return false;
}
- // Ensure that the socket is closed on exec*().
- ::fcntl(socket, F_SETFD, FD_CLOEXEC);
-
socketDescriptor = socket;
return true;
}
@@ -565,16 +562,6 @@ int QNativeSocketEnginePrivate::nativeAccept()
#else
int acceptedDescriptor = qt_safe_accept(socketDescriptor, 0, 0);
#endif
- //check if we have valid descriptor at all
- if(acceptedDescriptor > 0) {
- // Ensure that the socket is closed on exec*()
- ::fcntl(acceptedDescriptor, F_SETFD, FD_CLOEXEC);
- }
-#ifdef Q_OS_SYMBIAN
- else {
- qWarning("QNativeSocketEnginePrivate::nativeAccept() - acceptedDescriptor <= 0");
- }
-#endif
return acceptedDescriptor;
}
diff --git a/tests/auto/qgraphicsview/tst_qgraphicsview.cpp b/tests/auto/qgraphicsview/tst_qgraphicsview.cpp
index 0a9633f..e259177 100644
--- a/tests/auto/qgraphicsview/tst_qgraphicsview.cpp
+++ b/tests/auto/qgraphicsview/tst_qgraphicsview.cpp
@@ -246,6 +246,7 @@ private slots:
void QTBUG_4151_clipAndIgnore();
void QTBUG_5859_exposedRect();
void QTBUG_7438_cursor();
+ void QTBUG_16063_microFocusRect();
public slots:
void dummySlot() {}
@@ -4450,5 +4451,43 @@ void tst_QGraphicsView::QTBUG_7438_cursor()
#endif
}
+class IMItem : public QGraphicsRectItem
+{
+public:
+ IMItem(QGraphicsItem *parent = 0):
+ QGraphicsRectItem(QRectF(0, 0, 20, 20), parent)
+ {
+ setFlag(QGraphicsItem::ItemIsFocusable, true);
+ setFlag(QGraphicsItem::ItemAcceptsInputMethod, true);
+ }
+
+ QVariant inputMethodQuery(Qt::InputMethodQuery query) const
+ {
+ return mf;
+ }
+
+ static QRectF mf;
+};
+
+QRectF IMItem::mf(1.5, 1.6, 10, 10);
+
+void tst_QGraphicsView::QTBUG_16063_microFocusRect()
+{
+ QGraphicsScene scene;
+ IMItem *item = new IMItem();
+ scene.addItem(item);
+
+ QGraphicsView view(&scene);
+
+ view.setFixedSize(40, 40);
+ view.show();
+ QTest::qWaitForWindowShown(&view);
+
+ scene.setFocusItem(item);
+ view.setFocus();
+ QRectF mfv = view.inputMethodQuery(Qt::ImMicroFocus).toRectF();
+ QCOMPARE(mfv, IMItem::mf.translated(-view.mapToScene(view.sceneRect().toRect()).boundingRect().topLeft()));
+}
+
QTEST_MAIN(tst_QGraphicsView)
#include "tst_qgraphicsview.moc"
diff --git a/tests/auto/qprocess/tst_qprocess.cpp b/tests/auto/qprocess/tst_qprocess.cpp
index fd310f4..13f1d26 100644
--- a/tests/auto/qprocess/tst_qprocess.cpp
+++ b/tests/auto/qprocess/tst_qprocess.cpp
@@ -1999,11 +1999,15 @@ void tst_QProcess::spaceInName()
void tst_QProcess::lockupsInStartDetached()
{
#if !defined(Q_OS_SYMBIAN)
- // What exactly is this call supposed to achieve anyway?
+ // Check that QProcess doesn't cause a lock up at this program's
+ // exit if a thread was started and we tried to run a program that
+ // doesn't exist. Before Qt 4.2, this used to lock up on Unix due
+ // to calling ::exit instead of ::_exit if execve failed.
+
QHostInfo::lookupHost(QString("something.invalid"), 0, 0);
-#endif
QProcess::execute("yjhbrty");
QProcess::startDetached("yjhbrty");
+#endif
}
//-----------------------------------------------------------------------------
diff --git a/tests/auto/symbian/orientationchange/orientationchange.pro b/tests/auto/symbian/orientationchange/orientationchange.pro
index 08b34f9..98aa2ad 100644
--- a/tests/auto/symbian/orientationchange/orientationchange.pro
+++ b/tests/auto/symbian/orientationchange/orientationchange.pro
@@ -4,4 +4,5 @@ SOURCES += tst_orientationchange.cpp
symbian {
INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE
+ LIBS += -lcone -leikcore -lavkon # Screen orientation
}
diff --git a/tests/auto/symbian/orientationchange/tst_orientationchange.cpp b/tests/auto/symbian/orientationchange/tst_orientationchange.cpp
index eb3709d..2ac2f7f 100644
--- a/tests/auto/symbian/orientationchange/tst_orientationchange.cpp
+++ b/tests/auto/symbian/orientationchange/tst_orientationchange.cpp
@@ -45,6 +45,8 @@
#include <eikenv.h>
#include <aknappui.h>
+#include <private/qcore_symbian_p.h>
+#include <QDesktopWidget>
class tst_orientationchange : public QObject
{
@@ -151,6 +153,47 @@ void tst_orientationchange::resizeEventOnOrientationChange()
}
QCOMPARE(normalWidget->resizeEventCount, 0);
+ QDesktopWidget desktop;
+ QRect qtAvail = desktop.availableGeometry(normalWidget);
+ TRect clientRect = static_cast<CEikAppUi*>(CCoeEnv::Static()-> AppUi())->ClientRect();
+ QRect symbianAvail = qt_TRect2QRect(clientRect);
+ QCOMPARE(qtAvail, symbianAvail);
+
+ // Switch orientation back to original
+ orientation = orientation == CAknAppUi::EAppUiOrientationPortrait
+ ? CAknAppUi::EAppUiOrientationLandscape
+ : CAknAppUi::EAppUiOrientationPortrait;
+
+
+ fullScreenWidget->reset();
+ maximizedWidget->reset();
+ normalWidget->reset();
+
+ TRAP(err, appUi->SetOrientationL(orientation));
+
+ QCoreApplication::sendPostedEvents();
+ QCoreApplication::sendPostedEvents();
+
+ // setOrientationL is not guaranteed to change orientation
+ // (if emulator configured to support just portrait or landscape, then
+ // setOrientationL call shouldn't do anything).
+ // So let's ensure that we do not get resize event twice.
+
+ QVERIFY(fullScreenWidget->resizeEventCount <= 1);
+ if (fullScreenWidget->resizeEventCount) {
+ QCOMPARE(fullScreenWidget->size(), fullScreenWidget->resizeEventSize);
+ }
+ QVERIFY(maximizedWidget->resizeEventCount <= 1);
+ if (fullScreenWidget->resizeEventCount) {
+ QCOMPARE(maximizedWidget->size(), maximizedWidget->resizeEventSize);
+ }
+ QCOMPARE(normalWidget->resizeEventCount, 0);
+
+ qtAvail = desktop.availableGeometry(normalWidget);
+ clientRect = static_cast<CEikAppUi*>(CCoeEnv::Static()-> AppUi())->ClientRect();
+ symbianAvail = qt_TRect2QRect(clientRect);
+ QCOMPARE(qtAvail, symbianAvail);
+
TRAP(err, appUi->SetOrientationL(CAknAppUi::EAppUiOrientationUnspecified));
delete normalWidget;