From f74dd380f30306bb2cf93ef61bb35dc8db045a11 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Tue, 22 Sep 2009 11:45:22 +0200 Subject: fix tst_QMenu::task242454_sizeHint for Windows mobile QMenu actually doesn't use QFontMetrics::width to calculate its bounding rect but QFontMetrics::boundingRect. That's why this test failed on Windows CE. Reviewed-by: thierry --- tests/auto/qmenu/tst_qmenu.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/auto/qmenu/tst_qmenu.cpp b/tests/auto/qmenu/tst_qmenu.cpp index 174d1d7..abf8246 100644 --- a/tests/auto/qmenu/tst_qmenu.cpp +++ b/tests/auto/qmenu/tst_qmenu.cpp @@ -658,7 +658,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()); } -- cgit v0.12 From 1053d8564ca33e18a813e0f0fa1ec1f381e4a937 Mon Sep 17 00:00:00 2001 From: Jens Bache-Wiig Date: Tue, 22 Sep 2009 12:38:56 +0200 Subject: Fix broken drop-down arrows on Windows 7 This issue affects both tool buttons and buttosn with menus. The problem is that the Windows metric we were using to calculate the size changed on Windows 7. It seems not to be the correct metric so it seems more reliable to use the dpi-scaled constant 12 as we were doing in common style already. This should make appearance consistent between the windows versions. Task-number: QTBUG-4241 Reviewed-by: denis --- src/gui/styles/qwindowsxpstyle.cpp | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/src/gui/styles/qwindowsxpstyle.cpp b/src/gui/styles/qwindowsxpstyle.cpp index ed2ee8a..1a9f4f2 100644 --- a/src/gui/styles/qwindowsxpstyle.cpp +++ b/src/gui/styles/qwindowsxpstyle.cpp @@ -3276,17 +3276,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 -- cgit v0.12 From e410d2711ae2aba15b9da7b07a4f8e40a50ab9c5 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Tue, 22 Sep 2009 14:38:09 +0200 Subject: Ensure that QStandardItem::clone() is used when a prototype is set This fixes a regression introduced in Qt 4.5.0, when dragging an item within a QTreeView it would not call clone() when it was dropped even if a prototype was set on the QStandardItemModel. Reviewed-by: Marius Bugge Monsen --- src/gui/itemviews/qstandarditemmodel.cpp | 9 +++++---- src/gui/itemviews/qstandarditemmodel_p.h | 2 ++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/gui/itemviews/qstandarditemmodel.cpp b/src/gui/itemviews/qstandarditemmodel.cpp index bc25edd..8c9a2fd 100644 --- a/src/gui/itemviews/qstandarditemmodel.cpp +++ b/src/gui/itemviews/qstandarditemmodel.cpp @@ -2965,7 +2965,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; @@ -2976,7 +2976,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); } @@ -2989,6 +2989,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; @@ -3020,9 +3021,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 3d842f3..430fcb6 100644 --- a/src/gui/itemviews/qstandarditemmodel_p.h +++ b/src/gui/itemviews/qstandarditemmodel_p.h @@ -175,6 +175,8 @@ public: void _q_emitItemChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight); + void decodeDataRecursive(QDataStream &stream, QStandardItem *item); + QVector columnHeaderItems; QVector rowHeaderItems; QStandardItem *root; -- cgit v0.12 From 6d3764ee563db117d03b9c759e491b70a3c1df7d Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Wed, 23 Sep 2009 10:12:24 +0200 Subject: Make sure fontextractor example is found by qtdemo Qt Demo seems to assume the executable name is the same as the directory name, so change the name to all lower case to avoid getting the message that the example has not been built even when it has. Found by Black Team. --- examples/webkit/formextractor/formextractor.pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/webkit/formextractor/formextractor.pro b/examples/webkit/formextractor/formextractor.pro index d2cb240..e748c74 100644 --- a/examples/webkit/formextractor/formextractor.pro +++ b/examples/webkit/formextractor/formextractor.pro @@ -1,5 +1,5 @@ QT += webkit -TARGET = formExtractor +TARGET = formextractor TEMPLATE = app SOURCES += main.cpp \ formextractor.cpp \ -- cgit v0.12 From 33d104723a02297ffef53020d42b789284699534 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Wed, 23 Sep 2009 10:22:49 +0200 Subject: Paint arrow on top of node, not underneath it It looked strange that the node and its drop shadow was painted on top of the arrow. Flip the z-axis around to make sure the arrow is painted on top. Task-number: QTBUG-4544 Reviewed-by: Gunnar --- examples/graphicsview/elasticnodes/node.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/graphicsview/elasticnodes/node.cpp b/examples/graphicsview/elasticnodes/node.cpp index 3a218e7..b878011 100644 --- a/examples/graphicsview/elasticnodes/node.cpp +++ b/examples/graphicsview/elasticnodes/node.cpp @@ -53,7 +53,7 @@ Node::Node(GraphWidget *graphWidget) { setFlag(ItemIsMovable); setCacheMode(DeviceCoordinateCache); - setZValue(1); + setZValue(-1); } void Node::addEdge(Edge *edge) -- cgit v0.12 From 9262ee16906fd8e030cd5d2a81d22fe9b791b9f6 Mon Sep 17 00:00:00 2001 From: Prasanth Ullattil Date: Wed, 23 Sep 2009 12:42:58 +0200 Subject: Calling raise() on a hidden windows makes it visible on Cocoa. [NSWindow orderFront:] on a hidden window will make it visible. So raise_sys() will now check if window is visible before this method is called. Task-number: 255428 Reviewed-by: Richard Moe Gustavsen --- src/gui/kernel/qwidget_mac.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm index 987d2ae..ef71194 100644 --- a/src/gui/kernel/qwidget_mac.mm +++ b/src/gui/kernel/qwidget_mac.mm @@ -3613,7 +3613,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 -- cgit v0.12 From 94ffd7e298a4ffa0440fd18a30b1823a71c6bb77 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 23 Sep 2009 14:35:06 +0200 Subject: Try to support Qt 4.4-style Phonon includes in Qt. This introduces an undocumented "phonon_compat" subdir and also adds it to the INCLUDEPATH when QT += phonon is specified. With this, these styles of #includes should be supported: #include #include #include #include #include #include Still need to check if the headers get installed during "make install". I couldn't find where in our code that is done. BT: yes Reviewed-By: Trust Me (cherry picked from commit 0cb5038a3e5d3a6b0c33d081b89c6fe47cfc0b1b) --- bin/syncqt | 10 ++++++++-- mkspecs/features/qt.prf | 7 ++++++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/bin/syncqt b/bin/syncqt index a3addd8..edabeca 100755 --- a/bin/syncqt +++ b/bin/syncqt @@ -840,9 +840,15 @@ foreach (@modules_to_sync) { $master_contents .= "#endif\n"; unless($showonly) { - unless ($lib eq "phonon") { + my @master_includes; + if ($lib eq "phonon") { + push @master_includes, "$out_basedir/include/phonon_compat/phonon/phonon"; + push @master_includes, "$out_basedir/include/phonon/Phonon/Phonon"; + } else { + push @master_includes, "$out_basedir/include/$lib/$lib"; + } + foreach my $master_include (@master_includes) { #generate the "master" include file - my $master_include = "$out_basedir/include/$lib/$lib"; $pri_install_files .= fixPaths($master_include, "$modules{$lib}") . " "; #get the master file installed too if($master_include && -e "$master_include") { open MASTERINCLUDE, "<$master_include"; diff --git a/mkspecs/features/qt.prf b/mkspecs/features/qt.prf index 0c6e09a..dc833e7 100644 --- a/mkspecs/features/qt.prf +++ b/mkspecs/features/qt.prf @@ -149,8 +149,13 @@ for(QTLIB, $$list($$lower($$unique(QT)))) { else:isEqual(QTLIB, scripttools):qlib = QtScriptTools else:isEqual(QTLIB, testlib):qlib = QtTest else:isEqual(QTLIB, dbus):qlib = QtDBus - else:isEqual(QTLIB, phonon):qlib = phonon else:isEqual(QTLIB, webkit):qlib = QtWebKit + else:isEqual(QTLIB, phonon) { + qlib = phonon + INCLUDEPATH += $$QMAKE_INCDIR_QT/phonon_compat/phonon + INCLUDEPATH += $$QMAKE_INCDIR_QT/phonon_compat + INCLUDEPATH += $$QMAKE_INCDIR_QT/phonon/Phonon + } else:isEqual(QTLIB, webkit):qlib = QtWebKit else:message("Unknown QT: $$QTLIB"):qlib = !isEmpty(qlib) { target_qt:isEqual(TARGET, qlib) { -- cgit v0.12 From df47e0d40290f5e40054a9612f75177d9ef8537a Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 23 Sep 2009 14:51:23 +0200 Subject: Autotest: This test does requires internal builds (with autotests). Reviewed-By: TrustMe --- tests/auto/qkeysequence/qkeysequence.pro | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/auto/qkeysequence/qkeysequence.pro b/tests/auto/qkeysequence/qkeysequence.pro index bd85402..d4779af 100644 --- a/tests/auto/qkeysequence/qkeysequence.pro +++ b/tests/auto/qkeysequence/qkeysequence.pro @@ -1,4 +1,5 @@ load(qttest_p4) +requires(contains(QT_CONFIG,private_tests)) SOURCES += tst_qkeysequence.cpp RESOURCES += qkeysequence.qrc \ No newline at end of file -- cgit v0.12 From 40f2c3ffdbcd700ed65b72a8cad1e7ce2c009e68 Mon Sep 17 00:00:00 2001 From: Kim Motoyoshi Kalland Date: Wed, 23 Sep 2009 15:37:12 +0200 Subject: Fixed clipping of non-cosmetic dashed strokes in raster paint engine. Reviewed-by: Samuel --- src/gui/painting/qpaintengineex.cpp | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/gui/painting/qpaintengineex.cpp b/src/gui/painting/qpaintengineex.cpp index 7c49190..b563735 100644 --- a/src/gui/painting/qpaintengineex.cpp +++ b/src/gui/painting/qpaintengineex.cpp @@ -328,12 +328,7 @@ void QPaintEngineEx::stroke(const QVectorPath &path, const QPen &pen) flags |= QVectorPath::CurvedShapeHint; // ### Perspective Xforms are currently not supported... - qreal txscale = 1; - if (!(pen.isCosmetic() || (qt_scaleForTransform(state()->matrix, &txscale) && txscale != 1))) { - // 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 - // later, so they are also covered here.. + if (!pen.isCosmetic()) { if (types) { while (points < lastPoint) { switch (*types) { @@ -385,8 +380,6 @@ void QPaintEngineEx::stroke(const QVectorPath &path, const QPen &pen) QVectorPath::WindingFill); 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 (types) { while (points < lastPoint) { @@ -440,7 +433,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(), -- cgit v0.12 From 3ec68c8948284437b8591010bbbbe2ea97b8cc46 Mon Sep 17 00:00:00 2001 From: Kim Motoyoshi Kalland Date: Thu, 24 Sep 2009 10:33:39 +0200 Subject: Fixed background scrolling in the SVG viewer example. Reviewed-by: Trond --- examples/painting/svgviewer/svgview.cpp | 1 + 1 file changed, 1 insertion(+) 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); -- cgit v0.12 From 600cef0aa62dedafac9190809230e01e3b200356 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Thu, 24 Sep 2009 10:53:30 +0200 Subject: Revert "Autotest: This test does requires internal builds (with autotests)." This reverts commit df47e0d40290f5e40054a9612f75177d9ef8537a. There is no "private_build" in Qt 4.5 Reviewed-By: thiago --- tests/auto/qkeysequence/qkeysequence.pro | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/auto/qkeysequence/qkeysequence.pro b/tests/auto/qkeysequence/qkeysequence.pro index d4779af..bd85402 100644 --- a/tests/auto/qkeysequence/qkeysequence.pro +++ b/tests/auto/qkeysequence/qkeysequence.pro @@ -1,5 +1,4 @@ load(qttest_p4) -requires(contains(QT_CONFIG,private_tests)) SOURCES += tst_qkeysequence.cpp RESOURCES += qkeysequence.qrc \ No newline at end of file -- cgit v0.12 From d04c169e424c0feee61763764e841ef132ba359f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Trond=20Kjern=C3=A5sen?= Date: Thu, 24 Sep 2009 14:51:53 +0200 Subject: Fixed text drawing regression in Assistant. Revert parts of adf322c514a5781dcb9ec304d44229fa47d5e8b3 to get this to work as in 4.5.2 again. What the original patch fixed, we don't really know.. Reviewed-by: Simon Hausmann --- src/gui/text/qfontengine_mac.mm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gui/text/qfontengine_mac.mm b/src/gui/text/qfontengine_mac.mm index 943e3ab..007f2d4 100644 --- a/src/gui/text/qfontengine_mac.mm +++ b/src/gui/text/qfontengine_mac.mm @@ -1019,6 +1019,8 @@ bool QFontEngineMacMulti::stringToCMapInternal(const QChar *str, int len, QGlyph | kATSLineDisableAllJustification ; + layopts |= kATSLineUseDeviceMetrics; + if (fontDef.styleStrategy & QFont::NoAntialias) layopts |= kATSLineNoAntiAliasing; -- cgit v0.12 From 9e4f5f2133b542cdf6f32f2fc96dccd864e68420 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Mon, 10 Aug 2009 18:04:59 +0200 Subject: Set the QMAKE_BUNDLE_LOCATION to 'Contents/MacOS' only if it's not set This matches the logic for the 'lib' template to the one for 'app'. --- qmake/generators/unix/unixmake.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qmake/generators/unix/unixmake.cpp b/qmake/generators/unix/unixmake.cpp index 7c62e19..e99ed52 100644 --- a/qmake/generators/unix/unixmake.cpp +++ b/qmake/generators/unix/unixmake.cpp @@ -258,7 +258,7 @@ UnixMakefileGenerator::init() bundle += project->first("QMAKE_BUNDLE_EXTENSION"); else if(!bundle.endsWith(".plugin")) bundle += ".plugin"; - if(!project->isEmpty("QMAKE_BUNDLE_LOCATION")) + if(project->isEmpty("QMAKE_BUNDLE_LOCATION")) project->values("QMAKE_BUNDLE_LOCATION").append("Contents/MacOS"); } else { if(!project->isEmpty("QMAKE_FRAMEWORK_BUNDLE_NAME")) -- cgit v0.12