From 52e46af04738af62ad0da0daa161de707ff855e0 Mon Sep 17 00:00:00 2001 From: Prasanth Ullattil Date: Tue, 9 Feb 2010 18:12:12 +0100 Subject: Cannot drag actions in Designer on Mac OS X/Cocoa. QMimeData sub classes reimplementing the formats() might not expose the temporary "application/x-qt-mime-type-name" mimetype used by DnD. So make sure that the NSDragPboard PasteBoard will contain this dummy mime type. Task-number: QTBUG-7981 Reviewed-by: mortens --- src/gui/kernel/qclipboard_mac.cpp | 12 ++++++++++++ src/gui/kernel/qcocoaview_mac.mm | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/gui/kernel/qclipboard_mac.cpp b/src/gui/kernel/qclipboard_mac.cpp index f3a971d..49a6cc8 100644 --- a/src/gui/kernel/qclipboard_mac.cpp +++ b/src/gui/kernel/qclipboard_mac.cpp @@ -388,6 +388,18 @@ QMacPasteboard::setMimeData(QMimeData *mime_src) clear_helper(); QStringList formats = mime_src->formats(); +#ifdef QT_MAC_USE_COCOA + // QMimeData sub classes reimplementing the formats() might not expose the + // temporary "application/x-qt-mime-type-name" mimetype. So check the existence + // of this mime type while doing drag and drop. + QString dummyMimeType(QLatin1String("application/x-qt-mime-type-name")); + if (!formats.contains(dummyMimeType)) { + QByteArray dummyType = mime_src->data(dummyMimeType); + if (!dummyType.isEmpty()) { + formats.append(dummyMimeType); + } + } +#endif for(int f = 0; f < formats.size(); ++f) { QString mimeType = formats.at(f); for (QList::Iterator it = availableConverters.begin(); it != availableConverters.end(); ++it) { diff --git a/src/gui/kernel/qcocoaview_mac.mm b/src/gui/kernel/qcocoaview_mac.mm index 2c35be2..756cf92 100644 --- a/src/gui/kernel/qcocoaview_mac.mm +++ b/src/gui/kernel/qcocoaview_mac.mm @@ -1404,7 +1404,7 @@ Qt::DropAction QDragManager::drag(QDrag *o) // setup the data QMacPasteboard dragBoard((CFStringRef) NSDragPboard, QMacPasteboardMime::MIME_DND); - dragPrivate()->data->setData(QLatin1String("application/x-qt-mime-type-name"), QByteArray()); + dragPrivate()->data->setData(QLatin1String("application/x-qt-mime-type-name"), QByteArray("dummy")); dragBoard.setMimeData(dragPrivate()->data); // create the image -- cgit v0.12 From 3930b896eba50eb657c88923b2922a2fba0d6385 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Wed, 10 Feb 2010 10:27:32 +0100 Subject: Updated WebKit from /home/shausman/src/webkit/trunk to qtwebkit/qtwebkit-4.6 ( 36fe058a9001e6d47f0fd41c6304cdfdf3a735ed ) Changes in WebKit/qt since the last update: * Missing fileSystemPath() method in Qt KURL implementation --- src/3rdparty/webkit/VERSION | 2 +- src/3rdparty/webkit/WebCore/ChangeLog | 12 ++++++++++++ src/3rdparty/webkit/WebCore/platform/qt/KURLQt.cpp | 6 ++++-- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/src/3rdparty/webkit/VERSION b/src/3rdparty/webkit/VERSION index 4348cbc..2b39e81 100644 --- a/src/3rdparty/webkit/VERSION +++ b/src/3rdparty/webkit/VERSION @@ -8,4 +8,4 @@ The commit imported was from the and has the sha1 checksum - da5d96a26e80162027bc95ce7e5725fe4b277ff7 + 36fe058a9001e6d47f0fd41c6304cdfdf3a735ed diff --git a/src/3rdparty/webkit/WebCore/ChangeLog b/src/3rdparty/webkit/WebCore/ChangeLog index 1f6f290..61c2227 100644 --- a/src/3rdparty/webkit/WebCore/ChangeLog +++ b/src/3rdparty/webkit/WebCore/ChangeLog @@ -1,3 +1,15 @@ +2010-01-14 Diego Gonzalez + + Reviewed by Kenneth Christiansen. + + [Qt] Missing fileSystemPath() method in Qt KURL implementation + https://bugs.webkit.org/show_bug.cgi?id=33614 + + No new tests. + + * platform/qt/KURLQt.cpp: + (WebCore::KURL::fileSystemPath): + 2010-02-01 Andreas Kling Reviewed by Kenneth Rohde Christiansen. diff --git a/src/3rdparty/webkit/WebCore/platform/qt/KURLQt.cpp b/src/3rdparty/webkit/WebCore/platform/qt/KURLQt.cpp index 0763fe0..1f62006 100644 --- a/src/3rdparty/webkit/WebCore/platform/qt/KURLQt.cpp +++ b/src/3rdparty/webkit/WebCore/platform/qt/KURLQt.cpp @@ -95,8 +95,10 @@ KURL::operator QUrl() const String KURL::fileSystemPath() const { - notImplemented(); - return String(); + if (!isValid() || !protocolIs("file")) + return String(); + + return String(path()); } } -- cgit v0.12 From 8c8aabdfac1518f9d62097ea5c80cea3d50131a3 Mon Sep 17 00:00:00 2001 From: Jedrzej Nowacki Date: Tue, 9 Feb 2010 16:32:10 +0200 Subject: Fix an unhandled exception in QScriptValue's test generator. $QT_END_LICENSE was interpreted as a template key by Template() object, causing substitute() call to throw a KeyError exception. The bug was introduced in 9962e2d96a212c518054220167eb6f61e1052bcc. Reviewed-by: TrustMe --- tests/auto/qscriptvalue/testgen/gen.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/auto/qscriptvalue/testgen/gen.py b/tests/auto/qscriptvalue/testgen/gen.py index 7161e6b..b3c81b9 100755 --- a/tests/auto/qscriptvalue/testgen/gen.py +++ b/tests/auto/qscriptvalue/testgen/gen.py @@ -231,7 +231,7 @@ if __name__ == '__main__': row_esc = escape(row) out.append(qsvTempl.substitute(expr = row, expr_esc = row_esc)) - result = mainTempl.substitute(dump= "".join(out) \ + result = mainTempl.safe_substitute(dump= "".join(out) \ , values = (11 * ' ' + '<< ').join(qsv) \ , count = len(qsv) \ , dataTags = (11 * ' ' + '<< ').join(map(lambda w: '"' + escape(w.replace('\n','')) + '"\n', qsv))) -- cgit v0.12 From e6f401fb1a25f133bd3476ff327b2ba45fd741b7 Mon Sep 17 00:00:00 2001 From: Jedrzej Nowacki Date: Tue, 9 Feb 2010 16:39:03 +0200 Subject: Add new test values to QScriptValue test generator. Two new values were added; results from QScriptEngine::nullValue() and QScriptEngine::undefinedValue(). Reviewed-by: Kent Hansen --- tests/auto/qscriptvalue/testgen/data.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/auto/qscriptvalue/testgen/data.txt b/tests/auto/qscriptvalue/testgen/data.txt index 8e7026e..a041c9b 100644 --- a/tests/auto/qscriptvalue/testgen/data.txt +++ b/tests/auto/qscriptvalue/testgen/data.txt @@ -114,3 +114,7 @@ engine->evaluate("/foo/") engine->evaluate("new Object()") engine->evaluate("new Array()") engine->evaluate("new Error()") + +#other +engine->nullValue() +engine->undefinedValue() \ No newline at end of file -- cgit v0.12 From caf93a2b6d3df012055ab70ad4bba1bb7b29141d Mon Sep 17 00:00:00 2001 From: Jedrzej Nowacki Date: Tue, 9 Feb 2010 16:47:51 +0200 Subject: Apply newly generated test values. Apply test results for values created directly from QScriptEngine (results of nullValue() and undefinedValue()) Reviewed-by: Kent Hansen --- .../qscriptvalue/tst_qscriptvalue_generated.cpp | 127 +++++++++++++++++++++ 1 file changed, 127 insertions(+) diff --git a/tests/auto/qscriptvalue/tst_qscriptvalue_generated.cpp b/tests/auto/qscriptvalue/tst_qscriptvalue_generated.cpp index 1d105b4..4e621b3 100644 --- a/tests/auto/qscriptvalue/tst_qscriptvalue_generated.cpp +++ b/tests/auto/qscriptvalue/tst_qscriptvalue_generated.cpp @@ -152,6 +152,8 @@ void tst_QScriptValue::initScriptValues() DEFINE_TEST_VALUE(engine->evaluate("new Object()")); DEFINE_TEST_VALUE(engine->evaluate("new Array()")); DEFINE_TEST_VALUE(engine->evaluate("new Error()")); + DEFINE_TEST_VALUE(engine->nullValue()); + DEFINE_TEST_VALUE(engine->undefinedValue()); } @@ -267,6 +269,8 @@ void tst_QScriptValue::isValid_makeData(const char* expr) << "engine->evaluate(\"new Object()\")" << "engine->evaluate(\"new Array()\")" << "engine->evaluate(\"new Error()\")" + << "engine->nullValue()" + << "engine->undefinedValue()" ; } newRow(expr) << isValid.contains(expr); @@ -453,6 +457,7 @@ void tst_QScriptValue::isNull_makeData(const char* expr) isNull << "QScriptValue(QScriptValue::NullValue)" << "QScriptValue(0, QScriptValue::NullValue)" << "QScriptValue(engine, QScriptValue::NullValue)" + << "engine->nullValue()" ; } newRow(expr) << isNull.contains(expr); @@ -535,6 +540,7 @@ void tst_QScriptValue::isUndefined_makeData(const char* expr) << "QScriptValue(0, QScriptValue::UndefinedValue)" << "QScriptValue(engine, QScriptValue::UndefinedValue)" << "engine->evaluate(\"{}\")" + << "engine->undefinedValue()" ; } newRow(expr) << isUndefined.contains(expr); @@ -810,6 +816,8 @@ void tst_QScriptValue::toString_makeData(const char* expr) toString.insert("engine->evaluate(\"new Object()\")", "[object Object]"); toString.insert("engine->evaluate(\"new Array()\")", ""); toString.insert("engine->evaluate(\"new Error()\")", "Error: Unknown error"); + toString.insert("engine->nullValue()", "null"); + toString.insert("engine->undefinedValue()", "undefined"); } newRow(expr) << toString.value(expr); } @@ -936,6 +944,8 @@ void tst_QScriptValue::toNumber_makeData(const char* expr) toNumber.insert("engine->evaluate(\"new Object()\")", qQNaN()); toNumber.insert("engine->evaluate(\"new Array()\")", 0); toNumber.insert("engine->evaluate(\"new Error()\")", qQNaN()); + toNumber.insert("engine->nullValue()", 0); + toNumber.insert("engine->undefinedValue()", qQNaN()); } newRow(expr) << toNumber.value(expr); } @@ -1070,6 +1080,8 @@ void tst_QScriptValue::toBool_makeData(const char* expr) toBool.insert("engine->evaluate(\"new Object()\")", true); toBool.insert("engine->evaluate(\"new Array()\")", true); toBool.insert("engine->evaluate(\"new Error()\")", true); + toBool.insert("engine->nullValue()", false); + toBool.insert("engine->undefinedValue()", false); } newRow(expr) << toBool.value(expr); } @@ -1196,6 +1208,8 @@ void tst_QScriptValue::toBoolean_makeData(const char* expr) toBoolean.insert("engine->evaluate(\"new Object()\")", true); toBoolean.insert("engine->evaluate(\"new Array()\")", true); toBoolean.insert("engine->evaluate(\"new Error()\")", true); + toBoolean.insert("engine->nullValue()", false); + toBoolean.insert("engine->undefinedValue()", false); } newRow(expr) << toBoolean.value(expr); } @@ -1322,6 +1336,8 @@ void tst_QScriptValue::toInteger_makeData(const char* expr) toInteger.insert("engine->evaluate(\"new Object()\")", 0); toInteger.insert("engine->evaluate(\"new Array()\")", 0); toInteger.insert("engine->evaluate(\"new Error()\")", 0); + toInteger.insert("engine->nullValue()", 0); + toInteger.insert("engine->undefinedValue()", 0); } newRow(expr) << toInteger.value(expr); } @@ -1452,6 +1468,8 @@ void tst_QScriptValue::toInt32_makeData(const char* expr) toInt32.insert("engine->evaluate(\"new Object()\")", 0); toInt32.insert("engine->evaluate(\"new Array()\")", 0); toInt32.insert("engine->evaluate(\"new Error()\")", 0); + toInt32.insert("engine->nullValue()", 0); + toInt32.insert("engine->undefinedValue()", 0); } newRow(expr) << toInt32.value(expr); } @@ -1578,6 +1596,8 @@ void tst_QScriptValue::toUInt32_makeData(const char* expr) toUInt32.insert("engine->evaluate(\"new Object()\")", 0); toUInt32.insert("engine->evaluate(\"new Array()\")", 0); toUInt32.insert("engine->evaluate(\"new Error()\")", 0); + toUInt32.insert("engine->nullValue()", 0); + toUInt32.insert("engine->undefinedValue()", 0); } newRow(expr) << toUInt32.value(expr); } @@ -1704,6 +1724,8 @@ void tst_QScriptValue::toUInt16_makeData(const char* expr) toUInt16.insert("engine->evaluate(\"new Object()\")", 0); toUInt16.insert("engine->evaluate(\"new Array()\")", 0); toUInt16.insert("engine->evaluate(\"new Error()\")", 0); + toUInt16.insert("engine->nullValue()", 0); + toUInt16.insert("engine->undefinedValue()", 0); } newRow(expr) << toUInt16.value(expr); } @@ -1736,6 +1758,8 @@ void tst_QScriptValue::equals_makeData(const char *expr) equals.insert("QScriptValue(QScriptValue::UndefinedValue) <=> QScriptValue(engine, QScriptValue::UndefinedValue)"); equals.insert("QScriptValue(QScriptValue::UndefinedValue) <=> QScriptValue(engine, QScriptValue::NullValue)"); equals.insert("QScriptValue(QScriptValue::UndefinedValue) <=> engine->evaluate(\"{}\")"); + equals.insert("QScriptValue(QScriptValue::UndefinedValue) <=> engine->nullValue()"); + equals.insert("QScriptValue(QScriptValue::UndefinedValue) <=> engine->undefinedValue()"); equals.insert("QScriptValue(QScriptValue::NullValue) <=> QScriptValue(QScriptValue::UndefinedValue)"); equals.insert("QScriptValue(QScriptValue::NullValue) <=> QScriptValue(QScriptValue::NullValue)"); equals.insert("QScriptValue(QScriptValue::NullValue) <=> QScriptValue(0, QScriptValue::UndefinedValue)"); @@ -1743,6 +1767,8 @@ void tst_QScriptValue::equals_makeData(const char *expr) equals.insert("QScriptValue(QScriptValue::NullValue) <=> QScriptValue(engine, QScriptValue::UndefinedValue)"); equals.insert("QScriptValue(QScriptValue::NullValue) <=> QScriptValue(engine, QScriptValue::NullValue)"); equals.insert("QScriptValue(QScriptValue::NullValue) <=> engine->evaluate(\"{}\")"); + equals.insert("QScriptValue(QScriptValue::NullValue) <=> engine->nullValue()"); + equals.insert("QScriptValue(QScriptValue::NullValue) <=> engine->undefinedValue()"); equals.insert("QScriptValue(true) <=> QScriptValue(true)"); equals.insert("QScriptValue(true) <=> QScriptValue(0, true)"); equals.insert("QScriptValue(true) <=> QScriptValue(engine, true)"); @@ -1937,6 +1963,8 @@ void tst_QScriptValue::equals_makeData(const char *expr) equals.insert("QScriptValue(0, QScriptValue::UndefinedValue) <=> QScriptValue(engine, QScriptValue::UndefinedValue)"); equals.insert("QScriptValue(0, QScriptValue::UndefinedValue) <=> QScriptValue(engine, QScriptValue::NullValue)"); equals.insert("QScriptValue(0, QScriptValue::UndefinedValue) <=> engine->evaluate(\"{}\")"); + equals.insert("QScriptValue(0, QScriptValue::UndefinedValue) <=> engine->nullValue()"); + equals.insert("QScriptValue(0, QScriptValue::UndefinedValue) <=> engine->undefinedValue()"); equals.insert("QScriptValue(0, QScriptValue::NullValue) <=> QScriptValue(QScriptValue::UndefinedValue)"); equals.insert("QScriptValue(0, QScriptValue::NullValue) <=> QScriptValue(QScriptValue::NullValue)"); equals.insert("QScriptValue(0, QScriptValue::NullValue) <=> QScriptValue(0, QScriptValue::UndefinedValue)"); @@ -1944,6 +1972,8 @@ void tst_QScriptValue::equals_makeData(const char *expr) equals.insert("QScriptValue(0, QScriptValue::NullValue) <=> QScriptValue(engine, QScriptValue::UndefinedValue)"); equals.insert("QScriptValue(0, QScriptValue::NullValue) <=> QScriptValue(engine, QScriptValue::NullValue)"); equals.insert("QScriptValue(0, QScriptValue::NullValue) <=> engine->evaluate(\"{}\")"); + equals.insert("QScriptValue(0, QScriptValue::NullValue) <=> engine->nullValue()"); + equals.insert("QScriptValue(0, QScriptValue::NullValue) <=> engine->undefinedValue()"); equals.insert("QScriptValue(0, true) <=> QScriptValue(true)"); equals.insert("QScriptValue(0, true) <=> QScriptValue(0, true)"); equals.insert("QScriptValue(0, true) <=> QScriptValue(engine, true)"); @@ -2138,6 +2168,8 @@ void tst_QScriptValue::equals_makeData(const char *expr) equals.insert("QScriptValue(engine, QScriptValue::UndefinedValue) <=> QScriptValue(engine, QScriptValue::UndefinedValue)"); equals.insert("QScriptValue(engine, QScriptValue::UndefinedValue) <=> QScriptValue(engine, QScriptValue::NullValue)"); equals.insert("QScriptValue(engine, QScriptValue::UndefinedValue) <=> engine->evaluate(\"{}\")"); + equals.insert("QScriptValue(engine, QScriptValue::UndefinedValue) <=> engine->nullValue()"); + equals.insert("QScriptValue(engine, QScriptValue::UndefinedValue) <=> engine->undefinedValue()"); equals.insert("QScriptValue(engine, QScriptValue::NullValue) <=> QScriptValue(QScriptValue::UndefinedValue)"); equals.insert("QScriptValue(engine, QScriptValue::NullValue) <=> QScriptValue(QScriptValue::NullValue)"); equals.insert("QScriptValue(engine, QScriptValue::NullValue) <=> QScriptValue(0, QScriptValue::UndefinedValue)"); @@ -2145,6 +2177,8 @@ void tst_QScriptValue::equals_makeData(const char *expr) equals.insert("QScriptValue(engine, QScriptValue::NullValue) <=> QScriptValue(engine, QScriptValue::UndefinedValue)"); equals.insert("QScriptValue(engine, QScriptValue::NullValue) <=> QScriptValue(engine, QScriptValue::NullValue)"); equals.insert("QScriptValue(engine, QScriptValue::NullValue) <=> engine->evaluate(\"{}\")"); + equals.insert("QScriptValue(engine, QScriptValue::NullValue) <=> engine->nullValue()"); + equals.insert("QScriptValue(engine, QScriptValue::NullValue) <=> engine->undefinedValue()"); equals.insert("QScriptValue(engine, true) <=> QScriptValue(true)"); equals.insert("QScriptValue(engine, true) <=> QScriptValue(0, true)"); equals.insert("QScriptValue(engine, true) <=> QScriptValue(engine, true)"); @@ -2355,6 +2389,8 @@ void tst_QScriptValue::equals_makeData(const char *expr) equals.insert("engine->evaluate(\"{}\") <=> QScriptValue(engine, QScriptValue::UndefinedValue)"); equals.insert("engine->evaluate(\"{}\") <=> QScriptValue(engine, QScriptValue::NullValue)"); equals.insert("engine->evaluate(\"{}\") <=> engine->evaluate(\"{}\")"); + equals.insert("engine->evaluate(\"{}\") <=> engine->nullValue()"); + equals.insert("engine->evaluate(\"{}\") <=> engine->undefinedValue()"); equals.insert("engine->evaluate(\"Object.prototype\") <=> engine->evaluate(\"Object.prototype\")"); equals.insert("engine->evaluate(\"Date.prototype\") <=> engine->evaluate(\"Date.prototype\")"); equals.insert("engine->evaluate(\"Array.prototype\") <=> QScriptValue(false)"); @@ -2401,6 +2437,24 @@ void tst_QScriptValue::equals_makeData(const char *expr) equals.insert("engine->evaluate(\"new Array()\") <=> QScriptValue(engine, QString())"); equals.insert("engine->evaluate(\"new Array()\") <=> engine->evaluate(\"new Array()\")"); equals.insert("engine->evaluate(\"new Error()\") <=> engine->evaluate(\"new Error()\")"); + equals.insert("engine->nullValue() <=> QScriptValue(QScriptValue::UndefinedValue)"); + equals.insert("engine->nullValue() <=> QScriptValue(QScriptValue::NullValue)"); + equals.insert("engine->nullValue() <=> QScriptValue(0, QScriptValue::UndefinedValue)"); + equals.insert("engine->nullValue() <=> QScriptValue(0, QScriptValue::NullValue)"); + equals.insert("engine->nullValue() <=> QScriptValue(engine, QScriptValue::UndefinedValue)"); + equals.insert("engine->nullValue() <=> QScriptValue(engine, QScriptValue::NullValue)"); + equals.insert("engine->nullValue() <=> engine->evaluate(\"{}\")"); + equals.insert("engine->nullValue() <=> engine->nullValue()"); + equals.insert("engine->nullValue() <=> engine->undefinedValue()"); + equals.insert("engine->undefinedValue() <=> QScriptValue(QScriptValue::UndefinedValue)"); + equals.insert("engine->undefinedValue() <=> QScriptValue(QScriptValue::NullValue)"); + equals.insert("engine->undefinedValue() <=> QScriptValue(0, QScriptValue::UndefinedValue)"); + equals.insert("engine->undefinedValue() <=> QScriptValue(0, QScriptValue::NullValue)"); + equals.insert("engine->undefinedValue() <=> QScriptValue(engine, QScriptValue::UndefinedValue)"); + equals.insert("engine->undefinedValue() <=> QScriptValue(engine, QScriptValue::NullValue)"); + equals.insert("engine->undefinedValue() <=> engine->evaluate(\"{}\")"); + equals.insert("engine->undefinedValue() <=> engine->nullValue()"); + equals.insert("engine->undefinedValue() <=> engine->undefinedValue()"); } QHash::const_iterator it; for (it = m_values.constBegin(); it != m_values.constEnd(); ++it) { @@ -2435,9 +2489,11 @@ void tst_QScriptValue::strictlyEquals_makeData(const char *expr) equals.insert("QScriptValue(QScriptValue::UndefinedValue) <=> QScriptValue(0, QScriptValue::UndefinedValue)"); equals.insert("QScriptValue(QScriptValue::UndefinedValue) <=> QScriptValue(engine, QScriptValue::UndefinedValue)"); equals.insert("QScriptValue(QScriptValue::UndefinedValue) <=> engine->evaluate(\"{}\")"); + equals.insert("QScriptValue(QScriptValue::UndefinedValue) <=> engine->undefinedValue()"); equals.insert("QScriptValue(QScriptValue::NullValue) <=> QScriptValue(QScriptValue::NullValue)"); equals.insert("QScriptValue(QScriptValue::NullValue) <=> QScriptValue(0, QScriptValue::NullValue)"); equals.insert("QScriptValue(QScriptValue::NullValue) <=> QScriptValue(engine, QScriptValue::NullValue)"); + equals.insert("QScriptValue(QScriptValue::NullValue) <=> engine->nullValue()"); equals.insert("QScriptValue(true) <=> QScriptValue(true)"); equals.insert("QScriptValue(true) <=> QScriptValue(0, true)"); equals.insert("QScriptValue(true) <=> QScriptValue(engine, true)"); @@ -2530,9 +2586,11 @@ void tst_QScriptValue::strictlyEquals_makeData(const char *expr) equals.insert("QScriptValue(0, QScriptValue::UndefinedValue) <=> QScriptValue(0, QScriptValue::UndefinedValue)"); equals.insert("QScriptValue(0, QScriptValue::UndefinedValue) <=> QScriptValue(engine, QScriptValue::UndefinedValue)"); equals.insert("QScriptValue(0, QScriptValue::UndefinedValue) <=> engine->evaluate(\"{}\")"); + equals.insert("QScriptValue(0, QScriptValue::UndefinedValue) <=> engine->undefinedValue()"); equals.insert("QScriptValue(0, QScriptValue::NullValue) <=> QScriptValue(QScriptValue::NullValue)"); equals.insert("QScriptValue(0, QScriptValue::NullValue) <=> QScriptValue(0, QScriptValue::NullValue)"); equals.insert("QScriptValue(0, QScriptValue::NullValue) <=> QScriptValue(engine, QScriptValue::NullValue)"); + equals.insert("QScriptValue(0, QScriptValue::NullValue) <=> engine->nullValue()"); equals.insert("QScriptValue(0, true) <=> QScriptValue(true)"); equals.insert("QScriptValue(0, true) <=> QScriptValue(0, true)"); equals.insert("QScriptValue(0, true) <=> QScriptValue(engine, true)"); @@ -2625,9 +2683,11 @@ void tst_QScriptValue::strictlyEquals_makeData(const char *expr) equals.insert("QScriptValue(engine, QScriptValue::UndefinedValue) <=> QScriptValue(0, QScriptValue::UndefinedValue)"); equals.insert("QScriptValue(engine, QScriptValue::UndefinedValue) <=> QScriptValue(engine, QScriptValue::UndefinedValue)"); equals.insert("QScriptValue(engine, QScriptValue::UndefinedValue) <=> engine->evaluate(\"{}\")"); + equals.insert("QScriptValue(engine, QScriptValue::UndefinedValue) <=> engine->undefinedValue()"); equals.insert("QScriptValue(engine, QScriptValue::NullValue) <=> QScriptValue(QScriptValue::NullValue)"); equals.insert("QScriptValue(engine, QScriptValue::NullValue) <=> QScriptValue(0, QScriptValue::NullValue)"); equals.insert("QScriptValue(engine, QScriptValue::NullValue) <=> QScriptValue(engine, QScriptValue::NullValue)"); + equals.insert("QScriptValue(engine, QScriptValue::NullValue) <=> engine->nullValue()"); equals.insert("QScriptValue(engine, true) <=> QScriptValue(true)"); equals.insert("QScriptValue(engine, true) <=> QScriptValue(0, true)"); equals.insert("QScriptValue(engine, true) <=> QScriptValue(engine, true)"); @@ -2721,6 +2781,7 @@ void tst_QScriptValue::strictlyEquals_makeData(const char *expr) equals.insert("engine->evaluate(\"{}\") <=> QScriptValue(0, QScriptValue::UndefinedValue)"); equals.insert("engine->evaluate(\"{}\") <=> QScriptValue(engine, QScriptValue::UndefinedValue)"); equals.insert("engine->evaluate(\"{}\") <=> engine->evaluate(\"{}\")"); + equals.insert("engine->evaluate(\"{}\") <=> engine->undefinedValue()"); equals.insert("engine->evaluate(\"Object.prototype\") <=> engine->evaluate(\"Object.prototype\")"); equals.insert("engine->evaluate(\"Date.prototype\") <=> engine->evaluate(\"Date.prototype\")"); equals.insert("engine->evaluate(\"Array.prototype\") <=> engine->evaluate(\"Array.prototype\")"); @@ -2737,6 +2798,15 @@ void tst_QScriptValue::strictlyEquals_makeData(const char *expr) equals.insert("engine->evaluate(\"new Object()\") <=> engine->evaluate(\"new Object()\")"); equals.insert("engine->evaluate(\"new Array()\") <=> engine->evaluate(\"new Array()\")"); equals.insert("engine->evaluate(\"new Error()\") <=> engine->evaluate(\"new Error()\")"); + equals.insert("engine->nullValue() <=> QScriptValue(QScriptValue::NullValue)"); + equals.insert("engine->nullValue() <=> QScriptValue(0, QScriptValue::NullValue)"); + equals.insert("engine->nullValue() <=> QScriptValue(engine, QScriptValue::NullValue)"); + equals.insert("engine->nullValue() <=> engine->nullValue()"); + equals.insert("engine->undefinedValue() <=> QScriptValue(QScriptValue::UndefinedValue)"); + equals.insert("engine->undefinedValue() <=> QScriptValue(0, QScriptValue::UndefinedValue)"); + equals.insert("engine->undefinedValue() <=> QScriptValue(engine, QScriptValue::UndefinedValue)"); + equals.insert("engine->undefinedValue() <=> engine->evaluate(\"{}\")"); + equals.insert("engine->undefinedValue() <=> engine->undefinedValue()"); } QHash::const_iterator it; for (it = m_values.constBegin(); it != m_values.constEnd(); ++it) { @@ -3090,6 +3160,7 @@ void tst_QScriptValue::lessThan_makeData(const char *expr) equals.insert("QScriptValue(-6.37e-8) <=> engine->evaluate(\"[]\")"); equals.insert("QScriptValue(-6.37e-8) <=> engine->evaluate(\"Array.prototype\")"); equals.insert("QScriptValue(-6.37e-8) <=> engine->evaluate(\"new Array()\")"); + equals.insert("QScriptValue(-6.37e-8) <=> engine->nullValue()"); equals.insert("QScriptValue(0x43211234) <=> QScriptValue(qInf())"); equals.insert("QScriptValue(0x43211234) <=> QScriptValue(\"Infinity\")"); equals.insert("QScriptValue(0x43211234) <=> QScriptValue(0, qInf())"); @@ -3180,6 +3251,7 @@ void tst_QScriptValue::lessThan_makeData(const char *expr) equals.insert("QScriptValue(-qInf()) <=> engine->evaluate(\"[]\")"); equals.insert("QScriptValue(-qInf()) <=> engine->evaluate(\"Array.prototype\")"); equals.insert("QScriptValue(-qInf()) <=> engine->evaluate(\"new Array()\")"); + equals.insert("QScriptValue(-qInf()) <=> engine->nullValue()"); equals.insert("QScriptValue(\"NaN\") <=> QScriptValue(\"ciao\")"); equals.insert("QScriptValue(\"NaN\") <=> QScriptValue(QString::fromLatin1(\"ciao\"))"); equals.insert("QScriptValue(\"NaN\") <=> QScriptValue(0, \"ciao\")"); @@ -3291,6 +3363,7 @@ void tst_QScriptValue::lessThan_makeData(const char *expr) equals.insert("QScriptValue(\"-Infinity\") <=> engine->evaluate(\"/foo/\")"); equals.insert("QScriptValue(\"-Infinity\") <=> engine->evaluate(\"new Object()\")"); equals.insert("QScriptValue(\"-Infinity\") <=> engine->evaluate(\"new Error()\")"); + equals.insert("QScriptValue(\"-Infinity\") <=> engine->nullValue()"); equals.insert("QScriptValue(\"ciao\") <=> engine->evaluate(\"Function.prototype\")"); equals.insert("QScriptValue(\"ciao\") <=> engine->evaluate(\"Object\")"); equals.insert("QScriptValue(\"ciao\") <=> engine->evaluate(\"Array\")"); @@ -3903,6 +3976,7 @@ void tst_QScriptValue::lessThan_makeData(const char *expr) equals.insert("QScriptValue(0, -6.37e-8) <=> engine->evaluate(\"[]\")"); equals.insert("QScriptValue(0, -6.37e-8) <=> engine->evaluate(\"Array.prototype\")"); equals.insert("QScriptValue(0, -6.37e-8) <=> engine->evaluate(\"new Array()\")"); + equals.insert("QScriptValue(0, -6.37e-8) <=> engine->nullValue()"); equals.insert("QScriptValue(0, 0x43211234) <=> QScriptValue(qInf())"); equals.insert("QScriptValue(0, 0x43211234) <=> QScriptValue(\"Infinity\")"); equals.insert("QScriptValue(0, 0x43211234) <=> QScriptValue(0, qInf())"); @@ -3993,6 +4067,7 @@ void tst_QScriptValue::lessThan_makeData(const char *expr) equals.insert("QScriptValue(0, -qInf()) <=> engine->evaluate(\"[]\")"); equals.insert("QScriptValue(0, -qInf()) <=> engine->evaluate(\"Array.prototype\")"); equals.insert("QScriptValue(0, -qInf()) <=> engine->evaluate(\"new Array()\")"); + equals.insert("QScriptValue(0, -qInf()) <=> engine->nullValue()"); equals.insert("QScriptValue(0, \"NaN\") <=> QScriptValue(\"ciao\")"); equals.insert("QScriptValue(0, \"NaN\") <=> QScriptValue(QString::fromLatin1(\"ciao\"))"); equals.insert("QScriptValue(0, \"NaN\") <=> QScriptValue(0, \"ciao\")"); @@ -4104,6 +4179,7 @@ void tst_QScriptValue::lessThan_makeData(const char *expr) equals.insert("QScriptValue(0, \"-Infinity\") <=> engine->evaluate(\"/foo/\")"); equals.insert("QScriptValue(0, \"-Infinity\") <=> engine->evaluate(\"new Object()\")"); equals.insert("QScriptValue(0, \"-Infinity\") <=> engine->evaluate(\"new Error()\")"); + equals.insert("QScriptValue(0, \"-Infinity\") <=> engine->nullValue()"); equals.insert("QScriptValue(0, \"ciao\") <=> engine->evaluate(\"Function.prototype\")"); equals.insert("QScriptValue(0, \"ciao\") <=> engine->evaluate(\"Object\")"); equals.insert("QScriptValue(0, \"ciao\") <=> engine->evaluate(\"Array\")"); @@ -4717,6 +4793,7 @@ void tst_QScriptValue::lessThan_makeData(const char *expr) equals.insert("QScriptValue(engine, -6.37e-8) <=> engine->evaluate(\"[]\")"); equals.insert("QScriptValue(engine, -6.37e-8) <=> engine->evaluate(\"Array.prototype\")"); equals.insert("QScriptValue(engine, -6.37e-8) <=> engine->evaluate(\"new Array()\")"); + equals.insert("QScriptValue(engine, -6.37e-8) <=> engine->nullValue()"); equals.insert("QScriptValue(engine, 0x43211234) <=> QScriptValue(qInf())"); equals.insert("QScriptValue(engine, 0x43211234) <=> QScriptValue(\"Infinity\")"); equals.insert("QScriptValue(engine, 0x43211234) <=> QScriptValue(0, qInf())"); @@ -4807,6 +4884,7 @@ void tst_QScriptValue::lessThan_makeData(const char *expr) equals.insert("QScriptValue(engine, -qInf()) <=> engine->evaluate(\"[]\")"); equals.insert("QScriptValue(engine, -qInf()) <=> engine->evaluate(\"Array.prototype\")"); equals.insert("QScriptValue(engine, -qInf()) <=> engine->evaluate(\"new Array()\")"); + equals.insert("QScriptValue(engine, -qInf()) <=> engine->nullValue()"); equals.insert("QScriptValue(engine, \"NaN\") <=> QScriptValue(\"ciao\")"); equals.insert("QScriptValue(engine, \"NaN\") <=> QScriptValue(QString::fromLatin1(\"ciao\"))"); equals.insert("QScriptValue(engine, \"NaN\") <=> QScriptValue(0, \"ciao\")"); @@ -4918,6 +4996,7 @@ void tst_QScriptValue::lessThan_makeData(const char *expr) equals.insert("QScriptValue(engine, \"-Infinity\") <=> engine->evaluate(\"/foo/\")"); equals.insert("QScriptValue(engine, \"-Infinity\") <=> engine->evaluate(\"new Object()\")"); equals.insert("QScriptValue(engine, \"-Infinity\") <=> engine->evaluate(\"new Error()\")"); + equals.insert("QScriptValue(engine, \"-Infinity\") <=> engine->nullValue()"); equals.insert("QScriptValue(engine, \"ciao\") <=> engine->evaluate(\"Function.prototype\")"); equals.insert("QScriptValue(engine, \"ciao\") <=> engine->evaluate(\"Object\")"); equals.insert("QScriptValue(engine, \"ciao\") <=> engine->evaluate(\"Array\")"); @@ -5533,6 +5612,42 @@ void tst_QScriptValue::lessThan_makeData(const char *expr) equals.insert("engine->evaluate(\"new Error()\") <=> engine->evaluate(\"(function() { return 'ciao'; })\")"); equals.insert("engine->evaluate(\"new Error()\") <=> engine->evaluate(\"(function() { throw new Error('foo'); })\")"); equals.insert("engine->evaluate(\"new Error()\") <=> engine->evaluate(\"new Object()\")"); + equals.insert("engine->nullValue() <=> QScriptValue(true)"); + equals.insert("engine->nullValue() <=> QScriptValue(int(122))"); + equals.insert("engine->nullValue() <=> QScriptValue(uint(124))"); + equals.insert("engine->nullValue() <=> QScriptValue(123.0)"); + equals.insert("engine->nullValue() <=> QScriptValue(6.37e-8)"); + equals.insert("engine->nullValue() <=> QScriptValue(0x43211234)"); + equals.insert("engine->nullValue() <=> QScriptValue(0x10000)"); + equals.insert("engine->nullValue() <=> QScriptValue(0x10001)"); + equals.insert("engine->nullValue() <=> QScriptValue(qInf())"); + equals.insert("engine->nullValue() <=> QScriptValue(\"Infinity\")"); + equals.insert("engine->nullValue() <=> QScriptValue(QString(\"123\"))"); + equals.insert("engine->nullValue() <=> QScriptValue(QString(\"12.4\"))"); + equals.insert("engine->nullValue() <=> QScriptValue(0, true)"); + equals.insert("engine->nullValue() <=> QScriptValue(0, int(122))"); + equals.insert("engine->nullValue() <=> QScriptValue(0, uint(124))"); + equals.insert("engine->nullValue() <=> QScriptValue(0, 123.0)"); + equals.insert("engine->nullValue() <=> QScriptValue(0, 6.37e-8)"); + equals.insert("engine->nullValue() <=> QScriptValue(0, 0x43211234)"); + equals.insert("engine->nullValue() <=> QScriptValue(0, 0x10000)"); + equals.insert("engine->nullValue() <=> QScriptValue(0, 0x10001)"); + equals.insert("engine->nullValue() <=> QScriptValue(0, qInf())"); + equals.insert("engine->nullValue() <=> QScriptValue(0, \"Infinity\")"); + equals.insert("engine->nullValue() <=> QScriptValue(0, QString(\"123\"))"); + equals.insert("engine->nullValue() <=> QScriptValue(0, QString(\"12.3\"))"); + equals.insert("engine->nullValue() <=> QScriptValue(engine, true)"); + equals.insert("engine->nullValue() <=> QScriptValue(engine, int(122))"); + equals.insert("engine->nullValue() <=> QScriptValue(engine, uint(124))"); + equals.insert("engine->nullValue() <=> QScriptValue(engine, 123.0)"); + equals.insert("engine->nullValue() <=> QScriptValue(engine, 6.37e-8)"); + equals.insert("engine->nullValue() <=> QScriptValue(engine, 0x43211234)"); + equals.insert("engine->nullValue() <=> QScriptValue(engine, 0x10000)"); + equals.insert("engine->nullValue() <=> QScriptValue(engine, 0x10001)"); + equals.insert("engine->nullValue() <=> QScriptValue(engine, qInf())"); + equals.insert("engine->nullValue() <=> QScriptValue(engine, \"Infinity\")"); + equals.insert("engine->nullValue() <=> QScriptValue(engine, QString(\"123\"))"); + equals.insert("engine->nullValue() <=> QScriptValue(engine, QString(\"1.23\"))"); } QHash::const_iterator it; for (it = m_values.constBegin(); it != m_values.constEnd(); ++it) { @@ -5718,6 +5833,8 @@ void tst_QScriptValue::qscriptvalue_castQString_makeData(const char* expr) value.insert("engine->evaluate(\"new Object()\")", "[object Object]"); value.insert("engine->evaluate(\"new Array()\")", ""); value.insert("engine->evaluate(\"new Error()\")", "Error: Unknown error"); + value.insert("engine->nullValue()", ""); + value.insert("engine->undefinedValue()", ""); } newRow(expr) << value.value(expr); } @@ -5844,6 +5961,8 @@ void tst_QScriptValue::qscriptvalue_castqsreal_makeData(const char* expr) value.insert("engine->evaluate(\"new Object()\")", qQNaN()); value.insert("engine->evaluate(\"new Array()\")", 0); value.insert("engine->evaluate(\"new Error()\")", qQNaN()); + value.insert("engine->nullValue()", 0); + value.insert("engine->undefinedValue()", qQNaN()); } newRow(expr) << value.value(expr); } @@ -5978,6 +6097,8 @@ void tst_QScriptValue::qscriptvalue_castbool_makeData(const char* expr) value.insert("engine->evaluate(\"new Object()\")", true); value.insert("engine->evaluate(\"new Array()\")", true); value.insert("engine->evaluate(\"new Error()\")", true); + value.insert("engine->nullValue()", false); + value.insert("engine->undefinedValue()", false); } newRow(expr) << value.value(expr); } @@ -6104,6 +6225,8 @@ void tst_QScriptValue::qscriptvalue_castqint32_makeData(const char* expr) value.insert("engine->evaluate(\"new Object()\")", 0); value.insert("engine->evaluate(\"new Array()\")", 0); value.insert("engine->evaluate(\"new Error()\")", 0); + value.insert("engine->nullValue()", 0); + value.insert("engine->undefinedValue()", 0); } newRow(expr) << value.value(expr); } @@ -6230,6 +6353,8 @@ void tst_QScriptValue::qscriptvalue_castquint32_makeData(const char* expr) value.insert("engine->evaluate(\"new Object()\")", 0); value.insert("engine->evaluate(\"new Array()\")", 0); value.insert("engine->evaluate(\"new Error()\")", 0); + value.insert("engine->nullValue()", 0); + value.insert("engine->undefinedValue()", 0); } newRow(expr) << value.value(expr); } @@ -6356,6 +6481,8 @@ void tst_QScriptValue::qscriptvalue_castquint16_makeData(const char* expr) value.insert("engine->evaluate(\"new Object()\")", 0); value.insert("engine->evaluate(\"new Array()\")", 0); value.insert("engine->evaluate(\"new Error()\")", 0); + value.insert("engine->nullValue()", 0); + value.insert("engine->undefinedValue()", 0); } newRow(expr) << value.value(expr); } -- cgit v0.12 From 37ffa8f59c5dc1f4a1174a07e0a6df6e266d40c0 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Wed, 10 Feb 2010 10:05:41 +0100 Subject: Stabilize QListView test on Mac --- tests/auto/qlistview/tst_qlistview.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/auto/qlistview/tst_qlistview.cpp b/tests/auto/qlistview/tst_qlistview.cpp index 2c31d8b..d2181f8 100644 --- a/tests/auto/qlistview/tst_qlistview.cpp +++ b/tests/auto/qlistview/tst_qlistview.cpp @@ -779,6 +779,7 @@ void tst_QListView::batchedMode() view.resize(200,400); view.show(); QTest::qWaitForWindowShown(&view); + QTest::qWait(100); #if defined(Q_OS_WINCE) QTest::qWait(2000); @@ -1846,6 +1847,7 @@ void tst_QListView::taskQTBUG_2233_scrollHiddenItems() view.setRowHidden(i, true); } QApplication::processEvents(); + QTest::qWait(50); QCOMPARE(bar->value(), bar->maximum()); QCOMPARE(bar->maximum(), rowCount/4 - nbVisibleItem); } -- cgit v0.12 From 31ba9218c63b6c0177fabae3ff33cc5f3c2df8d5 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 10 Feb 2010 11:05:59 +0100 Subject: Fix warnings ~QX11PixmapData(): QPixmap objects must be destroyed.. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit in the property browser solution. Reviewed-by: Trond Kjernåsen Task-number: QTBUG-8046 --- .../qtpropertybrowser/qtpropertybrowserutils.cpp | 16 +++-- .../qtpropertybrowser/qtpropertybrowserutils_p.h | 1 + .../shared/qtpropertybrowser/qtpropertymanager.cpp | 82 +++++++++++++--------- 3 files changed, 61 insertions(+), 38 deletions(-) diff --git a/tools/shared/qtpropertybrowser/qtpropertybrowserutils.cpp b/tools/shared/qtpropertybrowser/qtpropertybrowserutils.cpp index b84de11..0b14292 100644 --- a/tools/shared/qtpropertybrowser/qtpropertybrowserutils.cpp +++ b/tools/shared/qtpropertybrowser/qtpropertybrowserutils.cpp @@ -93,15 +93,23 @@ QtCursorDatabase::QtCursorDatabase() QApplication::UnicodeUTF8), QIcon(QLatin1String(":/trolltech/qtpropertybrowser/images/cursor-busy.png"))); } +void QtCursorDatabase::clear() +{ + m_cursorNames.clear(); + m_cursorIcons.clear(); + m_valueToCursorShape.clear(); + m_cursorShapeToValue.clear(); +} + void QtCursorDatabase::appendCursor(Qt::CursorShape shape, const QString &name, const QIcon &icon) { if (m_cursorShapeToValue.contains(shape)) return; - int value = m_cursorNames.count(); + const int value = m_cursorNames.count(); m_cursorNames.append(name); - m_cursorIcons[value] = icon; - m_valueToCursorShape[value] = shape; - m_cursorShapeToValue[shape] = value; + m_cursorIcons.insert(value, icon); + m_valueToCursorShape.insert(value, shape); + m_cursorShapeToValue.insert(shape, value); } QStringList QtCursorDatabase::cursorShapeNames() const diff --git a/tools/shared/qtpropertybrowser/qtpropertybrowserutils_p.h b/tools/shared/qtpropertybrowser/qtpropertybrowserutils_p.h index b60fb94..baa7a4a 100644 --- a/tools/shared/qtpropertybrowser/qtpropertybrowserutils_p.h +++ b/tools/shared/qtpropertybrowser/qtpropertybrowserutils_p.h @@ -68,6 +68,7 @@ class QtCursorDatabase { public: QtCursorDatabase(); + void clear(); QStringList cursorShapeNames() const; QMap cursorShapeIcons() const; diff --git a/tools/shared/qtpropertybrowser/qtpropertymanager.cpp b/tools/shared/qtpropertybrowser/qtpropertymanager.cpp index 67ab2fb..d9ff10a 100644 --- a/tools/shared/qtpropertybrowser/qtpropertymanager.cpp +++ b/tools/shared/qtpropertybrowser/qtpropertymanager.cpp @@ -1391,16 +1391,54 @@ void QtStringPropertyManager::uninitializeProperty(QtProperty *property) } // QtBoolPropertyManager +// Return an icon containing a check box indicator +static QIcon drawCheckBox(bool value) +{ + QStyleOptionButton opt; + opt.state |= value ? QStyle::State_On : QStyle::State_Off; + opt.state |= QStyle::State_Enabled; + const QStyle *style = QApplication::style(); + // Figure out size of an indicator and make sure it is not scaled down in a list view item + // by making the pixmap as big as a list view icon and centering the indicator in it. + // (if it is smaller, it can't be helped) + const int indicatorWidth = style->pixelMetric(QStyle::PM_IndicatorWidth, &opt); + const int indicatorHeight = style->pixelMetric(QStyle::PM_IndicatorHeight, &opt); + const int listViewIconSize = indicatorWidth; + const int pixmapWidth = indicatorWidth; + const int pixmapHeight = qMax(indicatorHeight, listViewIconSize); + + opt.rect = QRect(0, 0, indicatorWidth, indicatorHeight); + QPixmap pixmap = QPixmap(pixmapWidth, pixmapHeight); + pixmap.fill(Qt::transparent); + { + // Center? + const int xoff = (pixmapWidth > indicatorWidth) ? (pixmapWidth - indicatorWidth) / 2 : 0; + const int yoff = (pixmapHeight > indicatorHeight) ? (pixmapHeight - indicatorHeight) / 2 : 0; + QPainter painter(&pixmap); + painter.translate(xoff, yoff); + style->drawPrimitive(QStyle::PE_IndicatorCheckBox, &opt, &painter); + } + return QIcon(pixmap); +} class QtBoolPropertyManagerPrivate { QtBoolPropertyManager *q_ptr; Q_DECLARE_PUBLIC(QtBoolPropertyManager) public: + QtBoolPropertyManagerPrivate(); QMap m_values; + const QIcon m_checkedIcon; + const QIcon m_uncheckedIcon; }; +QtBoolPropertyManagerPrivate::QtBoolPropertyManagerPrivate() : + m_checkedIcon(drawCheckBox(true)), + m_uncheckedIcon(drawCheckBox(false)) +{ +} + /*! \class QtBoolPropertyManager \internal @@ -1471,36 +1509,6 @@ QString QtBoolPropertyManager::valueText(const QtProperty *property) const return it.value() ? trueText : falseText; } -// Return an icon containing a check box indicator -static QIcon drawCheckBox(bool value) -{ - QStyleOptionButton opt; - opt.state |= value ? QStyle::State_On : QStyle::State_Off; - opt.state |= QStyle::State_Enabled; - const QStyle *style = QApplication::style(); - // Figure out size of an indicator and make sure it is not scaled down in a list view item - // by making the pixmap as big as a list view icon and centering the indicator in it. - // (if it is smaller, it can't be helped) - const int indicatorWidth = style->pixelMetric(QStyle::PM_IndicatorWidth, &opt); - const int indicatorHeight = style->pixelMetric(QStyle::PM_IndicatorHeight, &opt); - const int listViewIconSize = indicatorWidth; - const int pixmapWidth = indicatorWidth; - const int pixmapHeight = qMax(indicatorHeight, listViewIconSize); - - opt.rect = QRect(0, 0, indicatorWidth, indicatorHeight); - QPixmap pixmap = QPixmap(pixmapWidth, pixmapHeight); - pixmap.fill(Qt::transparent); - { - // Center? - const int xoff = (pixmapWidth > indicatorWidth) ? (pixmapWidth - indicatorWidth) / 2 : 0; - const int yoff = (pixmapHeight > indicatorHeight) ? (pixmapHeight - indicatorHeight) / 2 : 0; - QPainter painter(&pixmap); - painter.translate(xoff, yoff); - style->drawPrimitive(QStyle::PE_IndicatorCheckBox, &opt, &painter); - } - return QIcon(pixmap); -} - /*! \reimp */ @@ -1510,9 +1518,7 @@ QIcon QtBoolPropertyManager::valueIcon(const QtProperty *property) const if (it == d_ptr->m_values.constEnd()) return QIcon(); - static const QIcon checkedIcon = drawCheckBox(true); - static const QIcon uncheckedIcon = drawCheckBox(false); - return it.value() ? checkedIcon : uncheckedIcon; + return it.value() ? d_ptr->m_checkedIcon : d_ptr->m_uncheckedIcon; } /*! @@ -6287,7 +6293,15 @@ void QtColorPropertyManager::uninitializeProperty(QtProperty *property) // QtCursorPropertyManager -Q_GLOBAL_STATIC(QtCursorDatabase, cursorDatabase) +// Make sure icons are removed as soon as QApplication is destroyed, otherwise, +// handles are leaked on X11. +static void clearCursorDatabase(); +Q_GLOBAL_STATIC_WITH_INITIALIZER(QtCursorDatabase, cursorDatabase, qAddPostRoutine(clearCursorDatabase)) + +static void clearCursorDatabase() +{ + cursorDatabase()->clear(); +} class QtCursorPropertyManagerPrivate { -- cgit v0.12 From de88b9663c01691c64e2677444aab5c1b806c4c2 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Wed, 10 Feb 2010 12:12:00 +0200 Subject: Removed dependency to moc.exe from Symbian builds Having dependency to moc.exe makes no sense since we cannot build it anyway when building with Symbian toolchain. Task-number: QTBUG-7836 Reviewed-by: Janne Koskinen --- mkspecs/features/moc.prf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkspecs/features/moc.prf b/mkspecs/features/moc.prf index 42ce1bc..e4b7dae 100644 --- a/mkspecs/features/moc.prf +++ b/mkspecs/features/moc.prf @@ -97,7 +97,7 @@ equals(MOC_DIR, .) { } #auto depend on moc -unix:!no_mocdepend { +unix:!symbian:!no_mocdepend { moc_source.depends += $$first(QMAKE_MOC) moc_header.depends += $$first(QMAKE_MOC) !contains(TARGET, moc) { #auto build moc -- cgit v0.12 From d7f8be6ec47bc8c241df95f7d13547a60362677b Mon Sep 17 00:00:00 2001 From: Thomas Zander Date: Wed, 10 Feb 2010 11:24:27 +0100 Subject: Make compile Reviewed-By: Alessandro Portale --- src/gui/text/qfontengine_s60.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/text/qfontengine_s60.cpp b/src/gui/text/qfontengine_s60.cpp index 9dd4af7..3ea084b 100644 --- a/src/gui/text/qfontengine_s60.cpp +++ b/src/gui/text/qfontengine_s60.cpp @@ -44,7 +44,7 @@ #include "qglobal.h" #include #include "qimage.h" -#include "qt_s60_p.h" +#include #include #include -- cgit v0.12 From 72b510e78973e47c31ae60070cb74b41f291b1ec Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Wed, 10 Feb 2010 12:18:39 +0100 Subject: Updated WebKit from /home/shausman/src/webkit/trunk to qtwebkit/qtwebkit-4.6 ( ffae5e11181a3961193fa21ea405851cad714d4b ) Changes in WebKit/qt since the last update: * https://bugs.webkit.org/show_bug.cgi?id=34170 -- [Qt] Javascript undefined > 0 returns true on Symbian --- src/3rdparty/webkit/JavaScriptCore/ChangeLog | 13 +++++++++++++ src/3rdparty/webkit/JavaScriptCore/runtime/JSValue.cpp | 4 ++++ src/3rdparty/webkit/VERSION | 2 +- 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/3rdparty/webkit/JavaScriptCore/ChangeLog b/src/3rdparty/webkit/JavaScriptCore/ChangeLog index b943840..6446773 100644 --- a/src/3rdparty/webkit/JavaScriptCore/ChangeLog +++ b/src/3rdparty/webkit/JavaScriptCore/ChangeLog @@ -1,3 +1,16 @@ +2010-02-09 Janne Koskinen + + Reviewed by Laszlo Gombos. + + [Qt] use nanval() for Symbian as nonInlineNaN + https://bugs.webkit.org/show_bug.cgi?id=34170 + + numeric_limits::quiet_NaN is broken in Symbian + causing NaN to be evaluated as a number. + + * runtime/JSValue.cpp: + (JSC::nonInlineNaN): + 2010-01-07 Norbert Leser Reviewed by NOBODY (OOPS!). diff --git a/src/3rdparty/webkit/JavaScriptCore/runtime/JSValue.cpp b/src/3rdparty/webkit/JavaScriptCore/runtime/JSValue.cpp index 699c1cd..502312c 100644 --- a/src/3rdparty/webkit/JavaScriptCore/runtime/JSValue.cpp +++ b/src/3rdparty/webkit/JavaScriptCore/runtime/JSValue.cpp @@ -174,7 +174,11 @@ uint32_t toUInt32SlowCase(double d, bool& ok) NEVER_INLINE double nonInlineNaN() { +#if OS(SYMBIAN) + return nanval(); +#else return std::numeric_limits::quiet_NaN(); +#endif } } // namespace JSC diff --git a/src/3rdparty/webkit/VERSION b/src/3rdparty/webkit/VERSION index 2b39e81..cc0e04f 100644 --- a/src/3rdparty/webkit/VERSION +++ b/src/3rdparty/webkit/VERSION @@ -8,4 +8,4 @@ The commit imported was from the and has the sha1 checksum - 36fe058a9001e6d47f0fd41c6304cdfdf3a735ed + ffae5e11181a3961193fa21ea405851cad714d4b -- cgit v0.12 From 64233a38fe5a1755a6426caf55eaf8abbd4187ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Trond=20Kjern=C3=A5sen?= Date: Wed, 10 Feb 2010 12:48:55 +0100 Subject: Clarify QFont::rawName() docs. Task-number: related to QTBUG-8038 Reviewed-by: Kim --- src/gui/text/qfont.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gui/text/qfont.cpp b/src/gui/text/qfont.cpp index bbd35f1..dd9e69e 100644 --- a/src/gui/text/qfont.cpp +++ b/src/gui/text/qfont.cpp @@ -629,8 +629,9 @@ QFontEngineData::~QFontEngineData() Returns the name of the font within the underlying window system. - Only on X11 when Qt was built without FontConfig support the XLFD (X Logical Font Description) - is returned; otherwise an empty string. + On X11, this function will return an empty string if Qt is built with + FontConfig support; otherwise the XLFD (X Logical Font Description) is + returned. Using the return value of this function is usually \e not \e portable. -- cgit v0.12 From 709a3a4b96f4cc483e63958494adbc5efdf6c57d Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Wed, 10 Feb 2010 14:08:17 +0200 Subject: License update as requested by legal for file relicensed from S60. Rev-By: TrustMe --- src/3rdparty/s60/eiksoftkeyimage.h | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/src/3rdparty/s60/eiksoftkeyimage.h b/src/3rdparty/s60/eiksoftkeyimage.h index 84f6108a..a658421 100644 --- a/src/3rdparty/s60/eiksoftkeyimage.h +++ b/src/3rdparty/s60/eiksoftkeyimage.h @@ -39,23 +39,6 @@ ** ****************************************************************************/ -/* -* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Changes cba button's label to image. -* -*/ - #ifndef EIKSOFTKEYIMAGE_H #define EIKSOFTKEYIMAGE_H -- cgit v0.12 From f04f014835e9fd4c41e9113e8036ba71ff884ae9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Wed, 10 Feb 2010 13:11:01 +0100 Subject: Prevented assert when using drop shadow effect in the GL 2 engine. The GL 2 pixmap filter uses Indexed8 images in the drop shadow case. Reviewed-by: Tom Cooksey --- src/gui/image/qpixmapfilter.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gui/image/qpixmapfilter.cpp b/src/gui/image/qpixmapfilter.cpp index 7cf942c..2792e45 100644 --- a/src/gui/image/qpixmapfilter.cpp +++ b/src/gui/image/qpixmapfilter.cpp @@ -713,7 +713,8 @@ void expblur(QImage &img, qreal radius, bool improvedQuality = false, int transp radius *= qreal(0.5); Q_ASSERT(img.format() == QImage::Format_ARGB32_Premultiplied - || img.format() == QImage::Format_RGB32); + || img.format() == QImage::Format_RGB32 + || img.format() == QImage::Format_Indexed8); // choose the alpha such that pixels at radius distance from a fully // saturated pixel will have an alpha component of no greater than -- cgit v0.12 From 0d1e1f26cd9c29e960117e23c57a84055f1cc9e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Trond=20Kjern=C3=A5sen?= Date: Wed, 10 Feb 2010 13:26:21 +0100 Subject: Fixed drawing pixmaps onto bitmaps on X11 w/o Xrender support. Task-number: QTBUG-8032 Reviewed-by: Kim --- src/gui/painting/qpaintengine_x11.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gui/painting/qpaintengine_x11.cpp b/src/gui/painting/qpaintengine_x11.cpp index 147491e..da48fcb 100644 --- a/src/gui/painting/qpaintengine_x11.cpp +++ b/src/gui/painting/qpaintengine_x11.cpp @@ -1989,6 +1989,9 @@ void QX11PaintEngine::drawPixmap(const QRectF &r, const QPixmap &px, const QRect } XFillRectangle(d->dpy, d->hd, d->gc, x, y, sw, sh); restore_clip = true; + } else if (mono_dst && !mono_src) { + QBitmap bitmap(pixmap); + XCopyArea(d->dpy, bitmap.handle(), d->hd, d->gc, sx, sy, sw, sh, x, y); } else { XCopyArea(d->dpy, pixmap.handle(), d->hd, d->gc, sx, sy, sw, sh, x, y); } -- cgit v0.12 From e950fad2ab8b0c93da176ce2f07a4d45a3185cb4 Mon Sep 17 00:00:00 2001 From: Pierre Rossi Date: Wed, 10 Feb 2010 14:00:57 +0100 Subject: Take into account the solaris-cc-64-stlport mkspec Reviewed-by: Simon Hausmann --- src/corelib/arch/sparc/arch.pri | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/arch/sparc/arch.pri b/src/corelib/arch/sparc/arch.pri index 3113dd3..9bb3a88 100644 --- a/src/corelib/arch/sparc/arch.pri +++ b/src/corelib/arch/sparc/arch.pri @@ -1,7 +1,7 @@ # # SPARC architecture # -*-64 { +*-64* { SOURCES += $$QT_ARCH_CPP/qatomic64.s } else { -- cgit v0.12 From 0d27306664188a61571d31a38fec1d9040aae5f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Trond=20Kjern=C3=A5sen?= Date: Wed, 10 Feb 2010 14:19:08 +0100 Subject: Fixed drawing QPixmaps on QGLWidgets on different X11 screens. Don't try to use the texture_from_pixmap extension when drawing a pixmap from one X11 screen onto a different X11 screen in the GL 2 engine. For that to work, the pixmap will have to be re-created on the new screen, which is exactly what the default bind method does (via QImage conversion). Task-number: QTBUG-8054 Reviewed-by: Kim --- src/opengl/qgl.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp index fce9fdb..0a89412 100644 --- a/src/opengl/qgl.cpp +++ b/src/opengl/qgl.cpp @@ -104,6 +104,10 @@ QT_BEGIN_NAMESPACE QGLExtensionFuncs QGLContextPrivate::qt_extensionFuncs; #endif +#ifdef Q_WS_X11 +extern const QX11Info *qt_x11Info(const QPaintDevice *pd); +#endif + struct QGLThreadContext { QGLContext *context; }; @@ -2350,7 +2354,10 @@ QGLTexture *QGLContextPrivate::bindTexture(const QPixmap &pixmap, GLenum target, #if defined(Q_WS_X11) // Try to use texture_from_pixmap - if (pd->classId() == QPixmapData::X11Class && pd->pixelType() == QPixmapData::PixmapType) { + const QX11Info *xinfo = qt_x11Info(paintDevice); + if (pd->classId() == QPixmapData::X11Class && pd->pixelType() == QPixmapData::PixmapType + && xinfo && xinfo->screen() == pixmap.x11Info().screen()) + { texture = bindTextureFromNativePixmap(pd, key, options); if (texture) { texture->options |= QGLContext::MemoryManagedBindOption; -- cgit v0.12 From 358bbd707bb5e0ce255559e45f8dedb9e9243a9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Trond=20Kjern=C3=A5sen?= Date: Wed, 10 Feb 2010 14:37:58 +0100 Subject: Fixed usage of QGLPixelBuffer with share widgets on other X11 screens. When trying to share the internal pbo context with a widget context, the pbo context needs to be created on the same X11 screen as the widget context. Task-number: QTBUG-8047 Reviewed-by: Kim --- src/opengl/qglpixelbuffer_x11.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/opengl/qglpixelbuffer_x11.cpp b/src/opengl/qglpixelbuffer_x11.cpp index 5b34cbb..32a42a2 100644 --- a/src/opengl/qglpixelbuffer_x11.cpp +++ b/src/opengl/qglpixelbuffer_x11.cpp @@ -181,7 +181,11 @@ bool QGLPixelBufferPrivate::init(const QSize &size, const QGLFormat &f, QGLWidge qt_format_to_attrib_list(f, attribs); - GLXFBConfig *configs = glXChooseFBConfig(X11->display, X11->defaultScreen, attribs, &num_configs); + int screen = X11->defaultScreen; + if (shareWidget) + screen = shareWidget->x11Info().screen(); + + GLXFBConfig *configs = glXChooseFBConfig(X11->display, screen, attribs, &num_configs); if (configs && num_configs) { int res; glXGetFBConfigAttrib(X11->display, configs[0], GLX_LEVEL, &res); -- cgit v0.12 From 5ab191af20bf2b1fed2b8886ac247c2953087c14 Mon Sep 17 00:00:00 2001 From: Denis Dzyubenko Date: Tue, 9 Feb 2010 12:33:52 +0100 Subject: Fixed compilation with QT_NO_WHEELEVENT Reviewed-by: Prasanth --- src/gui/kernel/qapplication_mac.mm | 6 ++++++ src/gui/kernel/qapplication_p.h | 2 ++ src/gui/kernel/qapplication_x11.cpp | 8 ++++++++ src/gui/kernel/qcocoaview_mac.mm | 3 +++ src/gui/util/qsystemtrayicon_p.h | 2 ++ src/gui/util/qsystemtrayicon_x11.cpp | 2 ++ src/gui/widgets/qabstractslider.cpp | 6 +++++- src/gui/widgets/qabstractspinbox.h | 2 ++ src/gui/widgets/qcombobox.h | 2 ++ src/gui/widgets/qmenu.h | 2 ++ src/gui/widgets/qscrollbar.cpp | 2 ++ 11 files changed, 36 insertions(+), 1 deletion(-) diff --git a/src/gui/kernel/qapplication_mac.mm b/src/gui/kernel/qapplication_mac.mm index e8b821af..54a4901 100644 --- a/src/gui/kernel/qapplication_mac.mm +++ b/src/gui/kernel/qapplication_mac.mm @@ -2143,6 +2143,7 @@ QApplicationPrivate::globalEventProcessor(EventHandlerCallRef er, EventRef event } if (wheel_deltaX || wheel_deltaY) { +#ifndef QT_NO_WHEELEVENT if (wheel_deltaX) { QWheelEvent qwe(plocal, p, wheel_deltaX, buttons, modifiers, Qt::Horizontal); QApplication::sendSpontaneousEvent(widget, &qwe); @@ -2165,6 +2166,7 @@ QApplicationPrivate::globalEventProcessor(EventHandlerCallRef er, EventRef event handled_event = false; } } +#endif // QT_NO_WHEELEVENT } else { #ifdef QMAC_SPEAK_TO_ME const int speak_keys = Qt::AltModifier | Qt::ShiftModifier; @@ -2717,6 +2719,7 @@ int QApplication::keyboardInputInterval() return QApplicationPrivate::keyboard_input_time; } +#ifndef QT_NO_WHEELEVENT void QApplication::setWheelScrollLines(int n) { QApplicationPrivate::wheel_scroll_lines = n; @@ -2726,6 +2729,7 @@ int QApplication::wheelScrollLines() { return QApplicationPrivate::wheel_scroll_lines; } +#endif void QApplication::setEffectEnabled(Qt::UIEffect effect, bool enable) { @@ -2888,9 +2892,11 @@ bool QApplicationPrivate::qt_mac_apply_settings() QApplication::cursorFlashTime()).toInt(); QApplication::setCursorFlashTime(num); +#ifndef QT_NO_WHEELEVENT num = settings.value(QLatin1String("wheelScrollLines"), QApplication::wheelScrollLines()).toInt(); QApplication::setWheelScrollLines(num); +#endif QString colorspec = settings.value(QLatin1String("colorSpec"), QVariant(QLatin1String("default"))).toString(); diff --git a/src/gui/kernel/qapplication_p.h b/src/gui/kernel/qapplication_p.h index 9c001ab..b3ec732 100644 --- a/src/gui/kernel/qapplication_p.h +++ b/src/gui/kernel/qapplication_p.h @@ -427,7 +427,9 @@ public: static int cursor_flash_time; static int mouse_double_click_time; static int keyboard_input_time; +#ifndef QT_NO_WHEELEVENT static int wheel_scroll_lines; +#endif static bool animate_ui; static bool animate_menu; diff --git a/src/gui/kernel/qapplication_x11.cpp b/src/gui/kernel/qapplication_x11.cpp index 2a1f655..afd927b 100644 --- a/src/gui/kernel/qapplication_x11.cpp +++ b/src/gui/kernel/qapplication_x11.cpp @@ -944,10 +944,12 @@ bool QApplicationPrivate::x11_apply_settings() QApplication::cursorFlashTime()).toInt(); QApplication::setCursorFlashTime(num); +#ifndef QT_NO_WHEELEVENT num = settings.value(QLatin1String("wheelScrollLines"), QApplication::wheelScrollLines()).toInt(); QApplication::setWheelScrollLines(num); +#endif QString colorspec = settings.value(QLatin1String("colorSpec"), QVariant(QLatin1String("default"))).toString(); @@ -4401,8 +4403,10 @@ bool QETWidget::translateWheelEvent(int global_x, int global_y, int delta, QWidget* popup = qApp->activePopupWidget(); if (popup && window() != popup) popup->close(); +#ifndef QT_NO_WHEELEVENT QWheelEvent e(pos, globalPos, delta, buttons, modifiers, orient); if (QApplication::sendSpontaneousEvent(widget, &e)) +#endif return true; } @@ -4413,8 +4417,10 @@ bool QETWidget::translateWheelEvent(int global_x, int global_y, int delta, QWidget* popup = qApp->activePopupWidget(); if (popup && widget != popup) popup->hide(); +#ifndef QT_NO_WHEELEVENT QWheelEvent e(pos, globalPos, delta, buttons, modifiers, orient); if (QApplication::sendSpontaneousEvent(widget, &e)) +#endif return true; } return false; @@ -5313,6 +5319,7 @@ int QApplication::keyboardInputInterval() return QApplicationPrivate::keyboard_input_time; } +#ifndef QT_NO_WHEELEVENT void QApplication::setWheelScrollLines(int n) { QApplicationPrivate::wheel_scroll_lines = n; @@ -5322,6 +5329,7 @@ int QApplication::wheelScrollLines() { return QApplicationPrivate::wheel_scroll_lines; } +#endif void QApplication::setEffectEnabled(Qt::UIEffect effect, bool enable) { diff --git a/src/gui/kernel/qcocoaview_mac.mm b/src/gui/kernel/qcocoaview_mac.mm index 756cf92..ad64a91 100644 --- a/src/gui/kernel/qcocoaview_mac.mm +++ b/src/gui/kernel/qcocoaview_mac.mm @@ -828,6 +828,7 @@ extern "C" { deltaZ = qBound(-120, int([theEvent deltaZ] * 10000), 120); } +#ifndef QT_NO_WHEELEVENT if (deltaX != 0) { QWheelEvent qwe(qlocal, qglobal, deltaX, buttons, keyMods, Qt::Horizontal); qt_sendSpontaneousEvent(widgetToGetMouse, &qwe); @@ -868,6 +869,8 @@ extern "C" { wheelOK = qwe2.isAccepted(); } } +#endif //QT_NO_WHEELEVENT + if (!wheelOK) { return [super scrollWheel:theEvent]; } diff --git a/src/gui/util/qsystemtrayicon_p.h b/src/gui/util/qsystemtrayicon_p.h index b881f68..e8bf197 100644 --- a/src/gui/util/qsystemtrayicon_p.h +++ b/src/gui/util/qsystemtrayicon_p.h @@ -164,7 +164,9 @@ protected: bool x11Event(XEvent *event); void mousePressEvent(QMouseEvent *event); void mouseDoubleClickEvent(QMouseEvent *event); +#ifndef QT_NO_WHEELEVENT void wheelEvent(QWheelEvent *event); +#endif bool event(QEvent *e); private: diff --git a/src/gui/util/qsystemtrayicon_x11.cpp b/src/gui/util/qsystemtrayicon_x11.cpp index a645050..82b4325 100644 --- a/src/gui/util/qsystemtrayicon_x11.cpp +++ b/src/gui/util/qsystemtrayicon_x11.cpp @@ -308,10 +308,12 @@ void QSystemTrayIconSys::mouseDoubleClickEvent(QMouseEvent *ev) emit q->activated(QSystemTrayIcon::DoubleClick); } +#ifndef QT_NO_WHEELEVENT void QSystemTrayIconSys::wheelEvent(QWheelEvent *e) { QApplication::sendEvent(q, e); } +#endif bool QSystemTrayIconSys::event(QEvent *e) { diff --git a/src/gui/widgets/qabstractslider.cpp b/src/gui/widgets/qabstractslider.cpp index 73c17db..4bd7b5a 100644 --- a/src/gui/widgets/qabstractslider.cpp +++ b/src/gui/widgets/qabstractslider.cpp @@ -705,7 +705,11 @@ bool QAbstractSliderPrivate::scrollByDelta(Qt::Orientation orientation, Qt::Keyb // Calculate how many lines to scroll. Depending on what delta is (and // offset), we might end up with a fraction (e.g. scroll 1.3 lines). We can // only scroll whole lines, so we keep the reminder until next event. - qreal stepsToScrollF = offset * QApplication::wheelScrollLines() * effectiveSingleStep(); + qreal stepsToScrollF = +#ifndef QT_NO_WHEELEVENT + QApplication::wheelScrollLines() * +#endif + offset * effectiveSingleStep(); // Check if wheel changed direction since last event: if (offset_accumulated != 0 && (offset / offset_accumulated) < 0) offset_accumulated = 0; diff --git a/src/gui/widgets/qabstractspinbox.h b/src/gui/widgets/qabstractspinbox.h index 059943a..6c062c0 100644 --- a/src/gui/widgets/qabstractspinbox.h +++ b/src/gui/widgets/qabstractspinbox.h @@ -137,7 +137,9 @@ protected: void resizeEvent(QResizeEvent *event); void keyPressEvent(QKeyEvent *event); void keyReleaseEvent(QKeyEvent *event); +#ifndef QT_NO_WHEELEVENT void wheelEvent(QWheelEvent *event); +#endif void focusInEvent(QFocusEvent *event); void focusOutEvent(QFocusEvent *event); void contextMenuEvent(QContextMenuEvent *event); diff --git a/src/gui/widgets/qcombobox.h b/src/gui/widgets/qcombobox.h index f332d31..9b19a66 100644 --- a/src/gui/widgets/qcombobox.h +++ b/src/gui/widgets/qcombobox.h @@ -245,7 +245,9 @@ protected: void mouseReleaseEvent(QMouseEvent *e); void keyPressEvent(QKeyEvent *e); void keyReleaseEvent(QKeyEvent *e); +#ifndef QT_NO_WHEELEVENT void wheelEvent(QWheelEvent *e); +#endif void contextMenuEvent(QContextMenuEvent *e); void inputMethodEvent(QInputMethodEvent *); QVariant inputMethodQuery(Qt::InputMethodQuery) const; diff --git a/src/gui/widgets/qmenu.h b/src/gui/widgets/qmenu.h index 5a6a5c7..47dff2b 100644 --- a/src/gui/widgets/qmenu.h +++ b/src/gui/widgets/qmenu.h @@ -162,7 +162,9 @@ protected: void mouseReleaseEvent(QMouseEvent *); void mousePressEvent(QMouseEvent *); void mouseMoveEvent(QMouseEvent *); +#ifndef QT_NO_WHEELEVENT void wheelEvent(QWheelEvent *); +#endif void enterEvent(QEvent *); void leaveEvent(QEvent *); void hideEvent(QHideEvent *); diff --git a/src/gui/widgets/qscrollbar.cpp b/src/gui/widgets/qscrollbar.cpp index 3eed3a9..4eff260 100644 --- a/src/gui/widgets/qscrollbar.cpp +++ b/src/gui/widgets/qscrollbar.cpp @@ -521,6 +521,7 @@ bool QScrollBar::event(QEvent *event) if (const QHoverEvent *he = static_cast(event)) d_func()->updateHoverControl(he->pos()); break; +#ifndef QT_NO_WHEELEVENT case QEvent::Wheel: { // override wheel event without adding virtual function override QWheelEvent *ev = static_cast(event); @@ -537,6 +538,7 @@ bool QScrollBar::event(QEvent *event) event->accept(); return true; } +#endif default: break; } -- cgit v0.12 From 620dd47c3b790b99f76793f4b4e6f22e3984558e Mon Sep 17 00:00:00 2001 From: Prasanth Ullattil Date: Wed, 10 Feb 2010 17:26:24 +0100 Subject: Blinking cursors are 2 pixels wide on Mac OS X/Cocoa. Blinking cursors drawn in positions other than zero, can become 2 pixel wide. This is caused by a rendering bug in the paint engine used by Cocoa. If a fillRect() is called in a nox pixel boundary this engine draws them 2 pixels wide instead of one. So make sure this is always on a pixel boundary. Task-number: QTBUG-8100 Reviewed-by: Trond --- src/gui/text/qtextlayout.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/gui/text/qtextlayout.cpp b/src/gui/text/qtextlayout.cpp index 26c7c1e..af91603 100644 --- a/src/gui/text/qtextlayout.cpp +++ b/src/gui/text/qtextlayout.cpp @@ -1331,7 +1331,7 @@ void QTextLayout::drawCursor(QPainter *p, const QPointF &pos, int cursorPosition QTextLine l(line, d); const QScriptLine &sl = d->lines[line]; - const qreal x = position.x() + l.cursorToX(cursorPosition); + qreal x = position.x() + l.cursorToX(cursorPosition); int itm = d->findItem(cursorPosition - 1); QFixed base = sl.base(); @@ -1350,6 +1350,10 @@ void QTextLayout::drawCursor(QPainter *p, const QPointF &pos, int cursorPosition && (p->transform().type() > QTransform::TxTranslate); if (toggleAntialiasing) p->setRenderHint(QPainter::Antialiasing); +#if defined(QT_MAC_USE_COCOA) + // Always draw the cursor aligned to pixel boundary. + x = qRound(x); +#endif p->fillRect(QRectF(x, y, qreal(width), (base + descent + 1).toReal()), p->pen().brush()); if (toggleAntialiasing) p->setRenderHint(QPainter::Antialiasing, false); -- cgit v0.12 From 1407f3c1815addf6b9cac7503d38b670bbeab895 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Wed, 10 Feb 2010 17:39:59 +0100 Subject: Fix the WebKit build It's PLATFORM(SYMBIAN) in 4.x, not OS() like in the trunk Reviewed-by: Trust me --- src/3rdparty/webkit/JavaScriptCore/runtime/JSValue.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/3rdparty/webkit/JavaScriptCore/runtime/JSValue.cpp b/src/3rdparty/webkit/JavaScriptCore/runtime/JSValue.cpp index 502312c..bafb85b 100644 --- a/src/3rdparty/webkit/JavaScriptCore/runtime/JSValue.cpp +++ b/src/3rdparty/webkit/JavaScriptCore/runtime/JSValue.cpp @@ -174,7 +174,7 @@ uint32_t toUInt32SlowCase(double d, bool& ok) NEVER_INLINE double nonInlineNaN() { -#if OS(SYMBIAN) +#if PLATFORM(SYMBIAN) return nanval(); #else return std::numeric_limits::quiet_NaN(); -- cgit v0.12 From 24239b56ab563a30facde3a5217536e7276f9bb8 Mon Sep 17 00:00:00 2001 From: Anders Bakken Date: Mon, 14 Dec 2009 10:23:39 -0800 Subject: Export a function to get dfb-surface from a pixmap This function is only exported when DirectFB is built as part of libQtGui. Reviewed-by: Jervey Kong --- src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp index f27440e..ba50329 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp @@ -593,6 +593,17 @@ void QDirectFBPixmapData::invalidate() imageFormat = QImage::Format_Invalid; } +#ifndef QT_DIRECTFB_PLUGIN +Q_GUI_EXPORT IDirectFBSurface *qt_directfb_surface_for_pixmap(const QPixmap &pixmap) +{ + const QPixmapData *data = pixmap.pixmapData(); + if (!data || data->classId() != QPixmapData::DirectFBClass) + return 0; + const QDirectFBPixmapData *dfbData = static_cast(data); + return dfbData->directFBSurface(); +} +#endif + QT_END_NAMESPACE #endif // QT_NO_QWS_DIRECTFB -- cgit v0.12 From 84ef315a9ff6014056d7b6313cf9b1f8bdf06cdc Mon Sep 17 00:00:00 2001 From: Bill King Date: Thu, 11 Feb 2010 10:29:13 +1000 Subject: Revert "(ODBC) Use wchar_t instead of assuming 2 bytes." This reverts commit 4935ec52fc07d4aaa7ae594cfe9986e25ca62dcb. --- src/sql/drivers/odbc/qsql_odbc.cpp | 37 ++++++++++--------------------------- 1 file changed, 10 insertions(+), 27 deletions(-) diff --git a/src/sql/drivers/odbc/qsql_odbc.cpp b/src/sql/drivers/odbc/qsql_odbc.cpp index 4d3663e..2049a76 100644 --- a/src/sql/drivers/odbc/qsql_odbc.cpp +++ b/src/sql/drivers/odbc/qsql_odbc.cpp @@ -144,7 +144,6 @@ public: QSqlRecord rInf; QVector fieldCache; - QVector paramCache; int fieldCacheIdx; int disconnectCount; bool hasSQLFetchScroll; @@ -203,7 +202,7 @@ static QString qWarnODBCHandle(int handleType, SQLHANDLE handle, int *nativeCode *nativeCode = nativeCode_; QString tmpstore; #ifdef UNICODE - tmpstore = QString::fromWCharArray((const wchar_t*)description_, msgLen); + tmpstore = QString((const QChar*)description_.data(), msgLen); #else tmpstore = QString::fromLocal8Bit((const char*)description_.data(), msgLen); #endif @@ -333,7 +332,7 @@ static QString qGetStringData(SQLHANDLE hStmt, int column, int colSize, bool uni } else { colSize++; // make sure there is room for more than the 0 termination if (unicode) { - colSize *= sizeof(wchar_t); // a tiny bit faster, since it saves a SQLGetData() call + colSize *= 2; // a tiny bit faster, since it saves a SQLGetData() call } } QVarLengthArray buf(colSize); @@ -354,9 +353,9 @@ static QString qGetStringData(SQLHANDLE hStmt, int column, int colSize, bool uni // contain the number of bytes returned - it contains the // total number of bytes that CAN be fetched // colSize-1: remove 0 termination when there is more data to fetch - int rSize = (r == SQL_SUCCESS_WITH_INFO) ? (unicode ? colSize-sizeof(wchar_t) : colSize-1) : lengthIndicator; + int rSize = (r == SQL_SUCCESS_WITH_INFO) ? (unicode ? colSize-2 : colSize-1) : lengthIndicator; if (unicode) { - fieldVal += QString::fromWCharArray((wchar_t*)buf.constData(), rSize / sizeof(wchar_t)); + fieldVal += QString((const QChar*) buf.constData(), rSize / 2); } else { fieldVal += QString::fromAscii(buf.constData(), rSize); } @@ -552,7 +551,7 @@ static QSqlField qMakeFieldInfo(const QODBCPrivate* p, int i ) } #ifdef UNICODE - QString qColName = QString::fromWCharArray((const wchar_t*)colName, colNameLen); + QString qColName((const QChar*)colName, colNameLen); #else QString qColName = QString::fromLocal8Bit((const char*)colName); #endif @@ -1271,12 +1270,9 @@ bool QODBCResult::exec() // bind parameters - only positional binding allowed QVector& values = boundValues(); - QVector wcharstorage; - int i; SQLRETURN r; for (i = 0; i < values.count(); ++i) { - wcharstorage.append(NULL); if (bindValueType(i) & QSql::Out) values[i].detach(); const QVariant &val = values.at(i); @@ -1439,14 +1435,13 @@ bool QODBCResult::exec() #ifndef Q_ODBC_VERSION_2 if (d->unicode) { QString str = val.toString(); - int strSize = str.length() * sizeof(wchar_t); + str.utf16(); if (*ind != SQL_NULL_DATA) - *ind = strSize; + *ind = str.length() * sizeof(QChar); + int strSize = str.length() * sizeof(QChar); if (bindValueType(i) & QSql::Out) { - wchar_t *temp=new wchar_t[str.capacity()*sizeof(wchar_t)]; - str.toWCharArray(temp); - QByteArray ba((char*)temp, str.capacity() * sizeof(wchar_t)); + QByteArray ba((char*)str.constData(), str.capacity() * sizeof(QChar)); r = SQLBindParameter(d->hStmt, i + 1, qParamType[(QFlag)(bindValueType(i)) & QSql::InOut], @@ -1458,13 +1453,9 @@ bool QODBCResult::exec() ba.size(), ind); tmpStorage.append(ba); - wcharstorage.replace(i,temp); break; } - wchar_t *temp=new wchar_t[(1+str.length())*sizeof(wchar_t)]; - str.toWCharArray(temp); - temp[str.length()]=0; r = SQLBindParameter(d->hStmt, i + 1, qParamType[(QFlag)(bindValueType(i)) & QSql::InOut], @@ -1472,10 +1463,9 @@ bool QODBCResult::exec() strSize > 254 ? SQL_WLONGVARCHAR : SQL_WVARCHAR, strSize, 0, - (void *)temp, + (void *)str.constData(), strSize, ind); - wcharstorage.replace(i,temp); break; } else @@ -1525,13 +1515,6 @@ bool QODBCResult::exec() } } r = SQLExecute(d->hStmt); - - for(int i=0;i Date: Thu, 11 Feb 2010 13:26:22 +0100 Subject: Speed up custom bitmap brushes on X11 without Xrender support. There's no need to fall back and go via draw_helper() if we're using a bitmap brush that's drawn using a solid color. Task-number: QTBUG-8140 Reviewed-by: Kim --- src/gui/painting/qpainter.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp index 3bcaf8c..075c457 100644 --- a/src/gui/painting/qpainter.cpp +++ b/src/gui/painting/qpainter.cpp @@ -708,13 +708,14 @@ void QPainterPrivate::updateEmulationSpecifier(QPainterState *s) bool penTextureAlpha = false; if (penBrush.style() == Qt::TexturePattern) penTextureAlpha = qHasPixmapTexture(penBrush) - ? penBrush.texture().hasAlpha() + ? (penBrush.texture().depth() > 1) && penBrush.texture().hasAlpha() : penBrush.textureImage().hasAlphaChannel(); bool brushTextureAlpha = false; - if (s->brush.style() == Qt::TexturePattern) + if (s->brush.style() == Qt::TexturePattern) { brushTextureAlpha = qHasPixmapTexture(s->brush) - ? s->brush.texture().hasAlpha() + ? (s->brush.texture().depth() > 1) && s->brush.texture().hasAlpha() : s->brush.textureImage().hasAlphaChannel(); + } if (((penBrush.style() == Qt::TexturePattern && penTextureAlpha) || (s->brush.style() == Qt::TexturePattern && brushTextureAlpha)) && !engine->hasFeature(QPaintEngine::MaskedBrush)) -- cgit v0.12