summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2009-09-24 15:26:10 (GMT)
committerSimon Hausmann <simon.hausmann@nokia.com>2009-09-24 15:26:10 (GMT)
commit270c374c178ec5a532d37168b018cd7ebc844558 (patch)
treea1f3b19daae4a40c296f127b0f8af64107c2c29a
parent4d593220a8521c75821609560a3f7e09e28988c5 (diff)
parent9e4f5f2133b542cdf6f32f2fc96dccd864e68420 (diff)
downloadQt-270c374c178ec5a532d37168b018cd7ebc844558.zip
Qt-270c374c178ec5a532d37168b018cd7ebc844558.tar.gz
Qt-270c374c178ec5a532d37168b018cd7ebc844558.tar.bz2
Merge branch '4.5' of scm.dev.nokia.troll.no:qt/qt into 4.6
Conflicts: examples/webkit/formextractor/formextractor.pro mkspecs/features/qt.prf src/gui/painting/qpaintengineex.cpp
-rw-r--r--examples/graphicsview/elasticnodes/node.cpp2
-rw-r--r--examples/painting/svgviewer/svgview.cpp1
-rw-r--r--src/gui/itemviews/qstandarditemmodel.cpp9
-rw-r--r--src/gui/itemviews/qstandarditemmodel_p.h2
-rw-r--r--src/gui/kernel/qwidget_mac.mm2
-rw-r--r--src/gui/painting/qpaintengineex.cpp7
-rw-r--r--src/gui/styles/qwindowsxpstyle.cpp11
-rw-r--r--src/gui/text/qfontengine_mac.mm2
-rw-r--r--tests/auto/qmenu/tst_qmenu.cpp2
9 files changed, 15 insertions, 23 deletions
diff --git a/examples/graphicsview/elasticnodes/node.cpp b/examples/graphicsview/elasticnodes/node.cpp
index f8a0f9e..5694756 100644
--- a/examples/graphicsview/elasticnodes/node.cpp
+++ b/examples/graphicsview/elasticnodes/node.cpp
@@ -54,7 +54,7 @@ Node::Node(GraphWidget *graphWidget)
setFlag(ItemIsMovable);
setFlag(ItemSendsGeometryChanges);
setCacheMode(DeviceCoordinateCache);
- setZValue(1);
+ setZValue(-1);
}
void Node::addEdge(Edge *edge)
diff --git a/examples/painting/svgviewer/svgview.cpp b/examples/painting/svgviewer/svgview.cpp
index 0938ff8..76c6469 100644
--- a/examples/painting/svgviewer/svgview.cpp
+++ b/examples/painting/svgviewer/svgview.cpp
@@ -62,6 +62,7 @@ SvgView::SvgView(QWidget *parent)
setScene(new QGraphicsScene(this));
setTransformationAnchor(AnchorUnderMouse);
setDragMode(ScrollHandDrag);
+ setViewportUpdateMode(FullViewportUpdate);
// Prepare background check-board pattern
QPixmap tilePixmap(64, 64);
diff --git a/src/gui/itemviews/qstandarditemmodel.cpp b/src/gui/itemviews/qstandarditemmodel.cpp
index e8b7d08..3924a41 100644
--- a/src/gui/itemviews/qstandarditemmodel.cpp
+++ b/src/gui/itemviews/qstandarditemmodel.cpp
@@ -2971,7 +2971,7 @@ QMimeData *QStandardItemModel::mimeData(const QModelIndexList &indexes) const
Used by QStandardItemModel::dropMimeData
stream out an item and his children
*/
-static void decodeDataRecursive(QDataStream &stream, QStandardItem *item)
+void QStandardItemModelPrivate::decodeDataRecursive(QDataStream &stream, QStandardItem *item)
{
int colCount, childCount;
stream >> *item;
@@ -2982,7 +2982,7 @@ static void decodeDataRecursive(QDataStream &stream, QStandardItem *item)
while(childPos > 0) {
childPos--;
- QStandardItem *child = new QStandardItem;
+ QStandardItem *child = createItem();
decodeDataRecursive(stream, child);
item->setChild( childPos / colCount, childPos % colCount, child);
}
@@ -2995,6 +2995,7 @@ static void decodeDataRecursive(QDataStream &stream, QStandardItem *item)
bool QStandardItemModel::dropMimeData(const QMimeData *data, Qt::DropAction action,
int row, int column, const QModelIndex &parent)
{
+ Q_D(QStandardItemModel);
// check if the action is supported
if (!data || !(action == Qt::CopyAction || action == Qt::MoveAction))
return false;
@@ -3026,9 +3027,9 @@ bool QStandardItemModel::dropMimeData(const QMimeData *data, Qt::DropAction acti
while (!stream.atEnd()) {
int r, c;
- QStandardItem *item = new QStandardItem;
+ QStandardItem *item = d->createItem();
stream >> r >> c;
- decodeDataRecursive(stream, item);
+ d->decodeDataRecursive(stream, item);
rows.append(r);
columns.append(c);
diff --git a/src/gui/itemviews/qstandarditemmodel_p.h b/src/gui/itemviews/qstandarditemmodel_p.h
index 53ee6e3..3f6e0ca 100644
--- a/src/gui/itemviews/qstandarditemmodel_p.h
+++ b/src/gui/itemviews/qstandarditemmodel_p.h
@@ -176,6 +176,8 @@ public:
void _q_emitItemChanged(const QModelIndex &topLeft,
const QModelIndex &bottomRight);
+ void decodeDataRecursive(QDataStream &stream, QStandardItem *item);
+
QVector<QStandardItem*> columnHeaderItems;
QVector<QStandardItem*> rowHeaderItems;
QScopedPointer<QStandardItem> root;
diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm
index 6b040bc..c966aa3 100644
--- a/src/gui/kernel/qwidget_mac.mm
+++ b/src/gui/kernel/qwidget_mac.mm
@@ -3617,7 +3617,7 @@ void QWidgetPrivate::raise_sys()
QMacCocoaAutoReleasePool pool;
if (isRealWindow()) {
// Calling orderFront shows the window on Cocoa too.
- if (!q->testAttribute(Qt::WA_DontShowOnScreen)) {
+ if (!q->testAttribute(Qt::WA_DontShowOnScreen) && q->isVisible()) {
[qt_mac_window_for(q) orderFront:qt_mac_window_for(q)];
}
if (qt_mac_raise_process) { //we get to be the active process now
diff --git a/src/gui/painting/qpaintengineex.cpp b/src/gui/painting/qpaintengineex.cpp
index e5da392..60e4df6 100644
--- a/src/gui/painting/qpaintengineex.cpp
+++ b/src/gui/painting/qpaintengineex.cpp
@@ -416,8 +416,8 @@ void QPaintEngineEx::stroke(const QVectorPath &path, const QPen &pen)
if (d->stroker.capStyle() == Qt::RoundCap || d->stroker.joinStyle() == Qt::RoundJoin)
flags |= QVectorPath::CurvedShapeHint;
- qreal txscale = 1;
- if (!(pen.isCosmetic() || (qt_scaleForTransform(state()->matrix, &txscale) && txscale != 1))) {
+ // ### Perspective Xforms are currently not supported...
+ if (!pen.isCosmetic()) {
// We include cosmetic pens in this case to avoid having to
// change the current transform. Normal transformed,
// non-cosmetic pens will be transformed as part of fill
@@ -474,8 +474,6 @@ void QPaintEngineEx::stroke(const QVectorPath &path, const QPen &pen)
flags);
fill(strokePath, pen.brush());
} else {
- const qreal strokeWidth = d->stroker.strokeWidth();
- d->stroker.setStrokeWidth(strokeWidth * txscale);
// For cosmetic pens we need a bit of trickery... We to process xform the input points
if (state()->matrix.type() >= QTransform::TxProject) {
QPainterPath painterPath = state()->matrix.map(path.convertToPainterPath());
@@ -535,7 +533,6 @@ void QPaintEngineEx::stroke(const QVectorPath &path, const QPen &pen)
d->activeStroker->end();
}
- d->stroker.setStrokeWidth(strokeWidth);
QVectorPath strokePath(d->strokeHandler->pts.data(),
d->strokeHandler->types.size(),
d->strokeHandler->types.data(),
diff --git a/src/gui/styles/qwindowsxpstyle.cpp b/src/gui/styles/qwindowsxpstyle.cpp
index 9c374d8..9ef30e5 100644
--- a/src/gui/styles/qwindowsxpstyle.cpp
+++ b/src/gui/styles/qwindowsxpstyle.cpp
@@ -3299,17 +3299,6 @@ int QWindowsXPStyle::pixelMetric(PixelMetric pm, const QStyleOption *option, con
}
break;
- case PM_MenuButtonIndicator:
- {
- XPThemeData theme(widget, 0, QLatin1String("TOOLBAR"), TP_SPLITBUTTONDROPDOWN);
- if (theme.isValid()) {
- SIZE size;
- pGetThemePartSize(theme.handle(), 0, theme.partId, theme.stateId, 0, TS_TRUE, &size);
- res = size.cx;
- }
- }
- break;
-
case PM_TitleBarHeight:
{
#ifdef QT3_SUPPORT
diff --git a/src/gui/text/qfontengine_mac.mm b/src/gui/text/qfontengine_mac.mm
index 1703ac8..40db7b4 100644
--- a/src/gui/text/qfontengine_mac.mm
+++ b/src/gui/text/qfontengine_mac.mm
@@ -1014,6 +1014,8 @@ bool QFontEngineMacMulti::stringToCMapInternal(const QChar *str, int len, QGlyph
| kATSLineDisableAllJustification
;
+ layopts |= kATSLineUseDeviceMetrics;
+
if (fontDef.styleStrategy & QFont::NoAntialias)
layopts |= kATSLineNoAntiAliasing;
diff --git a/tests/auto/qmenu/tst_qmenu.cpp b/tests/auto/qmenu/tst_qmenu.cpp
index d7f453e..e467229 100644
--- a/tests/auto/qmenu/tst_qmenu.cpp
+++ b/tests/auto/qmenu/tst_qmenu.cpp
@@ -676,7 +676,7 @@ void tst_QMenu::task242454_sizeHint()
QMenu menu;
QString s = QLatin1String("foo\nfoo\nfoo\nfoo");
menu.addAction(s);
- QVERIFY(menu.sizeHint().width() > menu.fontMetrics().width(s));
+ QVERIFY(menu.sizeHint().width() > menu.fontMetrics().boundingRect(QRect(), Qt::TextSingleLine, s).width());
}