From 74ce3dea8b3ea06d61cef4e729f6a95f670461fe Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Tue, 23 Mar 2010 16:41:42 +0100 Subject: Sort indicators displayed incorrectly in GTK style Reviewed-by: Thierry Task-number: QTBUG-9299 --- src/gui/styles/qgtkstyle.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/styles/qgtkstyle.cpp b/src/gui/styles/qgtkstyle.cpp index e2de43a..0d8a589 100644 --- a/src/gui/styles/qgtkstyle.cpp +++ b/src/gui/styles/qgtkstyle.cpp @@ -769,9 +769,9 @@ void QGtkStyle::drawPrimitive(PrimitiveElement element, GtkArrowType type = GTK_ARROW_UP; QRect r = header->rect; QImage arrow; - if (header->sortIndicator & QStyleOptionHeader::SortUp) + if (header->sortIndicator & QStyleOptionHeader::SortDown) type = GTK_ARROW_UP; - else if (header->sortIndicator & QStyleOptionHeader::SortDown) + else if (header->sortIndicator & QStyleOptionHeader::SortUp) type = GTK_ARROW_DOWN; gtkPainter.paintArrow(gtkTreeHeader, "button", option->rect.adjusted(1, 1, -1, -1), type, state, -- cgit v0.12 From 6b072a0c0a756a099d8dfd7827918be5adf7bf1f Mon Sep 17 00:00:00 2001 From: Thierry Bastian Date: Tue, 23 Mar 2010 15:09:01 +0100 Subject: compile fix for mingw (also removes some warnings) --- src/corelib/io/qwindowspipewriter.cpp | 3 +-- src/corelib/kernel/qcoreapplication_win.cpp | 10 +++++----- src/gui/dialogs/qwizard_win_p.h | 1 - src/gui/kernel/qapplication_win.cpp | 2 +- src/gui/painting/qdrawhelper.cpp | 20 ++++++++++---------- src/gui/text/qtextengine.cpp | 5 ++--- tools/configure/configureapp.cpp | 27 ++++++++++++++++----------- tools/configure/environment.cpp | 4 ++-- tools/shared/windows/registry.cpp | 2 +- 9 files changed, 38 insertions(+), 36 deletions(-) diff --git a/src/corelib/io/qwindowspipewriter.cpp b/src/corelib/io/qwindowspipewriter.cpp index 394323f..da992d0 100644 --- a/src/corelib/io/qwindowspipewriter.cpp +++ b/src/corelib/io/qwindowspipewriter.cpp @@ -100,8 +100,7 @@ qint64 QWindowsPipeWriter::write(const char *ptr, qint64 maxlen) void QWindowsPipeWriter::run() { - OVERLAPPED overl = {0, 0, 0, 0, NULL}; - overl.hEvent = CreateEvent(NULL, TRUE, FALSE, NULL); + OVERLAPPED overl = {0, 0, { {0, 0 } }, CreateEvent(NULL, TRUE, FALSE, NULL)}; forever { lock.lock(); while(data.isEmpty() && (!quitNow)) { diff --git a/src/corelib/kernel/qcoreapplication_win.cpp b/src/corelib/kernel/qcoreapplication_win.cpp index 566626d..c1925e7 100644 --- a/src/corelib/kernel/qcoreapplication_win.cpp +++ b/src/corelib/kernel/qcoreapplication_win.cpp @@ -1022,12 +1022,12 @@ QString decodeMSG(const MSG& msg) if (!winPos) break; QString hwndAfter = valueCheck(quint64(winPos->hwndInsertAfter), - FLAG_STRING((quintptr)HWND_BOTTOM, "HWND_BOTTOM"), - FLAG_STRING((quintptr)HWND_NOTOPMOST, "HWND_NOTOPMOST"), - FLAG_STRING((quintptr)HWND_TOP, "HWND_TOP"), - FLAG_STRING((quintptr)HWND_TOPMOST, "HWND_TOPMOST"), + FLAG_STRING((qptrdiff)HWND_BOTTOM, "HWND_BOTTOM"), + FLAG_STRING((qptrdiff)HWND_NOTOPMOST, "HWND_NOTOPMOST"), + FLAG_STRING((qptrdiff)HWND_TOP, "HWND_TOP"), + FLAG_STRING((qptrdiff)HWND_TOPMOST, "HWND_TOPMOST"), FLAG_STRING()); - if (hwndAfter.size() == 0) + if (hwndAfter.isEmpty()) hwndAfter = QString::number((quintptr)winPos->hwndInsertAfter, 16); QString flags = flagCheck(winPos->flags, FLGSTR(SWP_DRAWFRAME), diff --git a/src/gui/dialogs/qwizard_win_p.h b/src/gui/dialogs/qwizard_win_p.h index fe01587..5f3b6c2 100644 --- a/src/gui/dialogs/qwizard_win_p.h +++ b/src/gui/dialogs/qwizard_win_p.h @@ -82,7 +82,6 @@ class QWizard; class QVistaHelper : public QObject { - Q_OBJECT public: QVistaHelper(QWizard *wizard); ~QVistaHelper(); diff --git a/src/gui/kernel/qapplication_win.cpp b/src/gui/kernel/qapplication_win.cpp index ae9b34c..715b4c4 100644 --- a/src/gui/kernel/qapplication_win.cpp +++ b/src/gui/kernel/qapplication_win.cpp @@ -2278,7 +2278,7 @@ extern "C" LRESULT QT_WIN_CALLBACK QtWndProc(HWND hwnd, UINT message, WPARAM wPa case WM_GETOBJECT: { // Ignoring all requests while starting up - if (QApplication::startingUp() || QApplication::closingDown() || (DWORD)lParam != OBJID_CLIENT) { + if (QApplication::startingUp() || QApplication::closingDown() || (LONG)lParam != OBJID_CLIENT) { result = false; break; } diff --git a/src/gui/painting/qdrawhelper.cpp b/src/gui/painting/qdrawhelper.cpp index 71e2e3b..1f75ec7 100644 --- a/src/gui/painting/qdrawhelper.cpp +++ b/src/gui/painting/qdrawhelper.cpp @@ -3884,8 +3884,8 @@ inline void interpolate_pixel_unaligned_2(DST *dest, const SRC *src, template inline void interpolate_pixel_2(DST *dest, const SRC *src, quint16 alpha) { - Q_ASSERT((long(dest) & 0x3) == 0); - Q_ASSERT((long(src) & 0x3) == 0); + Q_ASSERT((quintptr(dest) & 0x3) == 0); + Q_ASSERT((quintptr(src) & 0x3) == 0); const quint16 a = eff_alpha_2(alpha, dest); const quint16 ia = eff_ialpha_2(alpha, dest); @@ -3958,8 +3958,8 @@ template inline void interpolate_pixel_2(DST *dest, quint8 a, const SRC *src, quint8 b) { - Q_ASSERT((long(dest) & 0x3) == 0); - Q_ASSERT((long(src) & 0x3) == 0); + Q_ASSERT((quintptr(dest) & 0x3) == 0); + Q_ASSERT((quintptr(src) & 0x3) == 0); Q_ASSERT(!SRC::hasAlpha()); @@ -4007,8 +4007,8 @@ inline void interpolate_pixel_2(qrgb444 *dest, quint8 a, template inline void interpolate_pixel_4(DST *dest, const SRC *src, quint32 alpha) { - Q_ASSERT((long(dest) & 0x3) == 0); - Q_ASSERT((long(src) & 0x3) == 0); + Q_ASSERT((quintptr(dest) & 0x3) == 0); + Q_ASSERT((quintptr(src) & 0x3) == 0); const quint32 a = eff_alpha_4(alpha, dest); const quint32 ia = eff_ialpha_4(alpha, dest); @@ -4411,7 +4411,7 @@ void QT_FASTCALL blendUntransformed_dest16(DST *dest, const SRC *src, { Q_ASSERT(sizeof(DST) == 2); Q_ASSERT(sizeof(SRC) == 2); - Q_ASSERT((long(dest) & 0x3) == (long(src) & 0x3)); + Q_ASSERT((quintptr(dest) & 0x3) == (quintptr(src) & 0x3)); Q_ASSERT(coverage > 0); const int align = quintptr(dest) & 0x3; @@ -4479,8 +4479,8 @@ void QT_FASTCALL blendUntransformed_dest16(DST *dest, const SRC *src, } while (length >= 2) { - Q_ASSERT((long(dest) & 3) == 0); - Q_ASSERT((long(src) & 3) == 0); + Q_ASSERT((quintptr(dest) & 3) == 0); + Q_ASSERT((quintptr(src) & 3) == 0); const quint16 a = alpha_2(src); if (a == 0xffff) { @@ -4511,7 +4511,7 @@ template void QT_FASTCALL blendUntransformed_dest24(DST *dest, const SRC *src, quint8 coverage, int length) { - Q_ASSERT((long(dest) & 0x3) == (long(src) & 0x3)); + Q_ASSERT((quintptr(dest) & 0x3) == (quintptr(src) & 0x3)); Q_ASSERT(sizeof(DST) == 3); Q_ASSERT(coverage > 0); diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp index b826588..8dded4e 100644 --- a/src/gui/text/qtextengine.cpp +++ b/src/gui/text/qtextengine.cpp @@ -1124,14 +1124,13 @@ void QTextEngine::shapeTextWithHarfbuzz(int item) const bool kerningEnabled = this->font(si).d->kerning; HB_ShaperItem entire_shaper_item; - entire_shaper_item.kerning_applied = false; + qMemSet(&entire_shaper_item, 0, sizeof(entire_shaper_item)); entire_shaper_item.string = reinterpret_cast(layoutData->string.constData()); entire_shaper_item.stringLength = layoutData->string.length(); entire_shaper_item.item.script = (HB_Script)si.analysis.script; entire_shaper_item.item.pos = si.position; entire_shaper_item.item.length = length(item); entire_shaper_item.item.bidiLevel = si.analysis.bidiLevel; - entire_shaper_item.glyphIndicesPresent = false; HB_UChar16 upperCased[256]; // XXX what about making this 4096, so we don't have to extend it ever. if (si.analysis.flags == QScriptAnalysis::SmallCaps || si.analysis.flags == QScriptAnalysis::Uppercase @@ -2467,7 +2466,7 @@ void QTextEngine::splitItem(int item, int pos) const if (pos <= 0) return; - layoutData->items.insert(item + 1, QScriptItem(layoutData->items[item])); + layoutData->items.insert(item + 1, layoutData->items[item]); QScriptItem &oldItem = layoutData->items[item]; QScriptItem &newItem = layoutData->items[item+1]; newItem.position += pos; diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index 0aca545..0b14cba 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -1886,7 +1886,7 @@ bool Configure::findFile( const QString &fileName ) const QString file = fileName.toLower(); const QString pathEnvVar = QString::fromLocal8Bit(getenv("PATH")); const QString mingwPath = dictionary["QMAKESPEC"].endsWith("-g++") ? - findFileInPaths("mingw32-g++.exe", pathEnvVar) : QString(); + findFileInPaths("g++.exe", pathEnvVar) : QString(); QString paths; if (file.endsWith(".h")) { @@ -1978,7 +1978,7 @@ bool Configure::checkAvailability(const QString &part) { bool available = false; if (part == "STYLE_WINDOWSXP") - available = (findFile("uxtheme.h")); + available = findFile("uxtheme.h"); else if (part == "ZLIB") available = findFile("zlib.h"); @@ -3508,14 +3508,15 @@ void Configure::buildQmake() args += makefile; cout << "Creating qmake..." << endl; - int exitCode = 0; - if( exitCode = Environment::execute(args, QStringList(), QStringList()) ) { + int exitCode = Environment::execute(args, QStringList(), QStringList()); + if( exitCode ) { args.clear(); args += dictionary[ "MAKE" ]; args += "-f"; args += makefile; args += "clean"; - if( exitCode = Environment::execute(args, QStringList(), QStringList())) { + exitCode = Environment::execute(args, QStringList(), QStringList()); + if(exitCode) { cout << "Cleaning qmake failed, return code " << exitCode << endl << endl; dictionary[ "DONE" ] = "error"; } else { @@ -3523,7 +3524,8 @@ void Configure::buildQmake() args += dictionary[ "MAKE" ]; args += "-f"; args += makefile; - if (exitCode = Environment::execute(args, QStringList(), QStringList())) { + exitCode = Environment::execute(args, QStringList(), QStringList()); + if (exitCode) { cout << "Building qmake failed, return code " << exitCode << endl << endl; dictionary[ "DONE" ] = "error"; } @@ -3567,8 +3569,8 @@ void Configure::buildHostTools() QDir().mkpath(toolBuildPath); QDir::setCurrent(toolSourcePath); - int exitCode = 0; - if (exitCode = Environment::execute(args, QStringList(), QStringList())) { + int exitCode = Environment::execute(args, QStringList(), QStringList()); + if (exitCode) { cout << "qmake failed, return code " << exitCode << endl << endl; dictionary["DONE"] = "error"; break; @@ -3578,18 +3580,21 @@ void Configure::buildHostTools() args.clear(); args += dictionary["MAKE"]; QDir::setCurrent(toolBuildPath); - if (exitCode = Environment::execute(args, QStringList(), QStringList())) { + exitCode = Environment::execute(args, QStringList(), QStringList()); + if (exitCode) { args.clear(); args += dictionary["MAKE"]; args += "clean"; - if(exitCode = Environment::execute(args, QStringList(), QStringList())) { + exitCode = Environment::execute(args, QStringList(), QStringList()); + if(exitCode) { cout << "Cleaning " << hostToolsDirs.at(i) << " failed, return code " << exitCode << endl << endl; dictionary["DONE"] = "error"; break; } else { args.clear(); args += dictionary["MAKE"]; - if (exitCode = Environment::execute(args, QStringList(), QStringList())) { + exitCode = Environment::execute(args, QStringList(), QStringList()); + if (exitCode) { cout << "Building " << hostToolsDirs.at(i) << " failed, return code " << exitCode << endl << endl; dictionary["DONE"] = "error"; break; diff --git a/tools/configure/environment.cpp b/tools/configure/environment.cpp index e93f9a0..74bebb2 100644 --- a/tools/configure/environment.cpp +++ b/tools/configure/environment.cpp @@ -357,7 +357,7 @@ int Environment::execute(QStringList arguments, const QStringList &additionalEnv QString args = qt_create_commandline(program, arguments); QByteArray envlist = qt_create_environment(fullEnv); - DWORD exitCode = -1; + DWORD exitCode = DWORD(-1); PROCESS_INFORMATION procInfo; memset(&procInfo, 0, sizeof(procInfo)); @@ -378,7 +378,7 @@ int Environment::execute(QStringList arguments, const QStringList &additionalEnv } - if (exitCode == -1) { + if (exitCode == DWORD(-1)) { switch(GetLastError()) { case E2BIG: cerr << "execute: Argument list exceeds 1024 bytes" << endl; diff --git a/tools/shared/windows/registry.cpp b/tools/shared/windows/registry.cpp index d342d78..67d9b56 100644 --- a/tools/shared/windows/registry.cpp +++ b/tools/shared/windows/registry.cpp @@ -148,7 +148,7 @@ QString readRegistryKey(HKEY parentHandle, const QString &rSubkey) } default: - qWarning("QSettings: unknown data %d type in windows registry", dataType); + qWarning("QSettings: unknown data %u type in windows registry", quint32(dataType)); break; } -- cgit v0.12 From 4e3d2f716e89879ce62376450218f7418eccd0aa Mon Sep 17 00:00:00 2001 From: Thierry Bastian Date: Tue, 23 Mar 2010 17:15:17 +0100 Subject: Fix warnings in the declarative module --- src/declarative/qml/qdeclarativecompiledbindings_p.h | 2 +- src/declarative/qml/qdeclarativecompiler.cpp | 2 +- src/declarative/qml/qdeclarativemetatype_p.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/declarative/qml/qdeclarativecompiledbindings_p.h b/src/declarative/qml/qdeclarativecompiledbindings_p.h index 84a5df9..8776c08 100644 --- a/src/declarative/qml/qdeclarativecompiledbindings_p.h +++ b/src/declarative/qml/qdeclarativecompiledbindings_p.h @@ -60,7 +60,7 @@ QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -class QDeclarativeBindingCompilerPrivate; +struct QDeclarativeBindingCompilerPrivate; class QDeclarativeBindingCompiler { public: diff --git a/src/declarative/qml/qdeclarativecompiler.cpp b/src/declarative/qml/qdeclarativecompiler.cpp index 42d2950..2ea7bff 100644 --- a/src/declarative/qml/qdeclarativecompiler.cpp +++ b/src/declarative/qml/qdeclarativecompiler.cpp @@ -2094,7 +2094,7 @@ bool QDeclarativeCompiler::buildPropertyOnAssignment(QDeclarativeParser::Propert buildDynamicMeta(baseObj, ForceCreation); v->type = isPropertyValue ? Value::ValueSource : Value::ValueInterceptor; } else { - COMPILE_EXCEPTION(v, QCoreApplication::translate("QDeclarativeCompiler","\"%1\" cannot operate on \"%2\"").arg(v->object->typeName.constData()).arg(prop->name.constData())); + COMPILE_EXCEPTION(v, QCoreApplication::translate("QDeclarativeCompiler","\"%1\" cannot operate on \"%2\"").arg(QString::fromLatin1(v->object->typeName)).arg(QString::fromLatin1(prop->name.constData()))); } return true; diff --git a/src/declarative/qml/qdeclarativemetatype_p.h b/src/declarative/qml/qdeclarativemetatype_p.h index 1a36f10..d41323d 100644 --- a/src/declarative/qml/qdeclarativemetatype_p.h +++ b/src/declarative/qml/qdeclarativemetatype_p.h @@ -136,7 +136,7 @@ public: int index() const; private: friend class QDeclarativeTypePrivate; - friend class QDeclarativeMetaTypeData; + friend struct QDeclarativeMetaTypeData; friend int QDeclarativePrivate::registerType(const QDeclarativePrivate::RegisterInterface &); friend int QDeclarativePrivate::registerType(const QDeclarativePrivate::RegisterType &); QDeclarativeType(int, const QDeclarativePrivate::RegisterInterface &); -- cgit v0.12 From fad919fa0fe976facc94685fd1460b4961b72c4e Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Wed, 24 Mar 2010 10:26:53 +0100 Subject: Revert "Sort indicators displayed incorrectly in GTK style" This reverts commit 74ce3dea8b3ea06d61cef4e729f6a95f670461fe. The sorting order is intentional. --- src/gui/styles/qgtkstyle.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/styles/qgtkstyle.cpp b/src/gui/styles/qgtkstyle.cpp index 0d8a589..e2de43a 100644 --- a/src/gui/styles/qgtkstyle.cpp +++ b/src/gui/styles/qgtkstyle.cpp @@ -769,9 +769,9 @@ void QGtkStyle::drawPrimitive(PrimitiveElement element, GtkArrowType type = GTK_ARROW_UP; QRect r = header->rect; QImage arrow; - if (header->sortIndicator & QStyleOptionHeader::SortDown) + if (header->sortIndicator & QStyleOptionHeader::SortUp) type = GTK_ARROW_UP; - else if (header->sortIndicator & QStyleOptionHeader::SortUp) + else if (header->sortIndicator & QStyleOptionHeader::SortDown) type = GTK_ARROW_DOWN; gtkPainter.paintArrow(gtkTreeHeader, "button", option->rect.adjusted(1, 1, -1, -1), type, state, -- cgit v0.12 From 994e381f417464489dd2e6c9c1de163b576adfea Mon Sep 17 00:00:00 2001 From: Thierry Bastian Date: Wed, 24 Mar 2010 10:33:00 +0100 Subject: Fix compilation for winCE --- src/corelib/io/qwindowspipewriter.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/corelib/io/qwindowspipewriter.cpp b/src/corelib/io/qwindowspipewriter.cpp index da992d0..eb42c20 100644 --- a/src/corelib/io/qwindowspipewriter.cpp +++ b/src/corelib/io/qwindowspipewriter.cpp @@ -100,7 +100,8 @@ qint64 QWindowsPipeWriter::write(const char *ptr, qint64 maxlen) void QWindowsPipeWriter::run() { - OVERLAPPED overl = {0, 0, { {0, 0 } }, CreateEvent(NULL, TRUE, FALSE, NULL)}; + OVERLAPPED overl = {0, 0, {{ 0 }}, 0}; + overl.hEvent = CreateEvent(NULL, TRUE, FALSE, NULL); forever { lock.lock(); while(data.isEmpty() && (!quitNow)) { -- cgit v0.12 From 11f246ba81e74984a51964f0e91d233597697860 Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Wed, 24 Mar 2010 10:30:56 +0100 Subject: Inverted sorting arrows on QHeaderViews is intentional on GNOME It follows the GNOME HIG as specified in http://library.gnome.org/devel/hig-book/stable/controls-lists.html.en Ammending commit reversion fad919fa0fe976facc94685fd1460b4961b72c4e. Reviewed-by: jbache Task-number: QTBUG-9299 --- src/gui/styles/qgtkstyle.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gui/styles/qgtkstyle.cpp b/src/gui/styles/qgtkstyle.cpp index e2de43a..bd87ca4 100644 --- a/src/gui/styles/qgtkstyle.cpp +++ b/src/gui/styles/qgtkstyle.cpp @@ -769,6 +769,8 @@ void QGtkStyle::drawPrimitive(PrimitiveElement element, GtkArrowType type = GTK_ARROW_UP; QRect r = header->rect; QImage arrow; + // This sorting indicator inversion is intentional, and follows the GNOME HIG. + // See http://library.gnome.org/devel/hig-book/stable/controls-lists.html.en#controls-lists-sortable if (header->sortIndicator & QStyleOptionHeader::SortUp) type = GTK_ARROW_UP; else if (header->sortIndicator & QStyleOptionHeader::SortDown) -- cgit v0.12 From 38db6eba54534207126915f6f195c8af9f772833 Mon Sep 17 00:00:00 2001 From: Alan Alpert Date: Wed, 24 Mar 2010 13:59:02 +0100 Subject: Help qt-qml integrate. Git seems to be having trouble with the merge, this might make it easier. --- tests/auto/declarative/qdeclarativedom/data/importlib/sublib/Foo.qml | 2 ++ .../declarative/qdeclarativedom/data/importlib/sublib/qmldir/Foo.qml | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) create mode 100644 tests/auto/declarative/qdeclarativedom/data/importlib/sublib/Foo.qml delete mode 100644 tests/auto/declarative/qdeclarativedom/data/importlib/sublib/qmldir/Foo.qml diff --git a/tests/auto/declarative/qdeclarativedom/data/importlib/sublib/Foo.qml b/tests/auto/declarative/qdeclarativedom/data/importlib/sublib/Foo.qml new file mode 100644 index 0000000..2d1a4a3 --- /dev/null +++ b/tests/auto/declarative/qdeclarativedom/data/importlib/sublib/Foo.qml @@ -0,0 +1,2 @@ +import Qt 4.6 + diff --git a/tests/auto/declarative/qdeclarativedom/data/importlib/sublib/qmldir/Foo.qml b/tests/auto/declarative/qdeclarativedom/data/importlib/sublib/qmldir/Foo.qml deleted file mode 100644 index 2d1a4a3..0000000 --- a/tests/auto/declarative/qdeclarativedom/data/importlib/sublib/qmldir/Foo.qml +++ /dev/null @@ -1,2 +0,0 @@ -import Qt 4.6 - -- cgit v0.12