diff -rau qt-everywhere-opensource-src-4.8.5/configure qt-adsk-4.8.5/configure --- qt-everywhere-opensource-src-4.8.5/configure 2013-06-07 13:16:41.000000000 +0800 +++ qt-adsk-4.8.5/configure 2013-09-22 09:31:41.000000000 +0800 @@ -4997,7 +4997,7 @@ done fi if [ "$BUILD_ON_MAC" = "yes" ]; then - echo "export MACOSX_DEPLOYMENT_TARGET = 10.5" >> "$mkfile" + echo "export MACOSX_DEPLOYMENT_TARGET = 10.8" >> "$mkfile" echo "CARBON_LFLAGS =-framework ApplicationServices" >>"$mkfile" echo "CARBON_CFLAGS =-fconstant-cfstrings" >>"$mkfile" EXTRA_LFLAGS="$EXTRA_LFLAGS \$(CARBON_LFLAGS)" @@ -7182,7 +7182,7 @@ case "$PLATFORM,$CFG_MAC_COCOA" in macx*,yes) # Cocoa - QMakeVar set QMAKE_MACOSX_DEPLOYMENT_TARGET 10.5 + QMakeVar set QMAKE_MACOSX_DEPLOYMENT_TARGET 10.8 ;; macx*,no) # gcc, Carbon @@ -7942,10 +7942,10 @@ QMakeVar add QMAKE_OBJECTIVE_CFLAGS_PPC "-arch ppc -Xarch_ppc -mmacosx-version-min=10.4" fi if echo "$CFG_MAC_ARCHS" | grep '\' > /dev/null 2>&1; then - QMakeVar add QMAKE_CFLAGS "-Xarch_x86_64 -mmacosx-version-min=10.5" - QMakeVar add QMAKE_CXXFLAGS "-Xarch_x86_64 -mmacosx-version-min=10.5" - QMakeVar add QMAKE_LFLAGS "-Xarch_x86_64 -mmacosx-version-min=10.5" - QMakeVar add QMAKE_OBJECTIVE_CFLAGS_X86_64 "-arch x86_64 -Xarch_x86_64 -mmacosx-version-min=10.5" + QMakeVar add QMAKE_CFLAGS "-Xarch_x86_64 -mmacosx-version-min=10.8" + QMakeVar add QMAKE_CXXFLAGS "-Xarch_x86_64 -mmacosx-version-min=10.8" + QMakeVar add QMAKE_LFLAGS "-Xarch_x86_64 -mmacosx-version-min=10.8" + QMakeVar add QMAKE_OBJECTIVE_CFLAGS_X86_64 "-arch x86_64 -Xarch_x86_64 -mmacosx-version-min=10.8" fi if echo "$CFG_MAC_ARCHS" | grep '\' > /dev/null 2>&1; then QMakeVar add QMAKE_CFLAGS "-Xarch_ppc64 -mmacosx-version-min=10.5" Only in qt-adsk-4.8.5/mkspecs/common: g++-base-adsk.conf diff -rau qt-everywhere-opensource-src-4.8.5/mkspecs/common/gcc-base-unix.conf qt-adsk-4.8.5/mkspecs/common/gcc-base-unix.conf --- qt-everywhere-opensource-src-4.8.5/mkspecs/common/gcc-base-unix.conf 2013-06-07 13:17:00.000000000 +0800 +++ qt-adsk-4.8.5/mkspecs/common/gcc-base-unix.conf 2013-09-22 09:31:41.000000000 +0800 @@ -10,6 +10,10 @@ include(gcc-base.conf) +# Autodesk change to use relative RPATH linking, used in QMAKE_LFLAGS below +DOLLAR = $ +QMAKE_LFLAGS += -Wl,--enable-new-dtags,-rpath,\\$${DOLLAR}$${DOLLAR}\\ORIGIN:\\$${DOLLAR}$${DOLLAR}\\ORIGIN/../lib:\\$${DOLLAR}$${DOLLAR}\\ORIGIN/../../lib + QMAKE_LFLAGS_SHLIB += -shared QMAKE_LFLAGS_PLUGIN += $$QMAKE_LFLAGS_SHLIB QMAKE_LFLAGS_SONAME += -Wl,-soname, diff -rau qt-everywhere-opensource-src-4.8.5/mkspecs/common/g++-macx.conf qt-adsk-4.8.5/mkspecs/common/g++-macx.conf --- qt-everywhere-opensource-src-4.8.5/mkspecs/common/g++-macx.conf 2013-06-07 13:17:00.000000000 +0800 +++ qt-adsk-4.8.5/mkspecs/common/g++-macx.conf 2013-10-01 02:29:18.000000000 +0800 @@ -16,8 +16,8 @@ QMAKE_LFLAGS_STATIC_LIB += -all_load -QMAKE_CFLAGS_X86_64 += -Xarch_x86_64 -mmacosx-version-min=10.5 -QMAKE_CFLAGS_PPC_64 += -Xarch_ppc64 -mmacosx-version-min=10.5 +QMAKE_CFLAGS_X86_64 += -Xarch_x86_64 -mmacosx-version-min=10.8 +QMAKE_CFLAGS_PPC_64 += -Xarch_ppc64 -mmacosx-version-min=10.8 QMAKE_CXXFLAGS_X86_64 = $$QMAKE_CFLAGS_X86_64 QMAKE_CXXFLAGS_PPC_64 = $$QMAKE_CFLAGS_PPC_64 diff -rau qt-everywhere-opensource-src-4.8.5/mkspecs/common/g++-unix.conf qt-adsk-4.8.5/mkspecs/common/g++-unix.conf --- qt-everywhere-opensource-src-4.8.5/mkspecs/common/g++-unix.conf 2013-06-07 13:17:00.000000000 +0800 +++ qt-adsk-4.8.5/mkspecs/common/g++-unix.conf 2013-09-22 09:31:41.000000000 +0800 @@ -8,7 +8,7 @@ # you can use the manual test in tests/manual/mkspecs. # -include(g++-base.conf) +include(g++-base-adsk.conf) QMAKE_LFLAGS_RELEASE += -Wl,-O1 QMAKE_LFLAGS_NOUNDEF += -Wl,--no-undefined diff -rau qt-everywhere-opensource-src-4.8.5/mkspecs/common/mac.conf qt-adsk-4.8.5/mkspecs/common/mac.conf --- qt-everywhere-opensource-src-4.8.5/mkspecs/common/mac.conf 2013-06-07 13:17:00.000000000 +0800 +++ qt-adsk-4.8.5/mkspecs/common/mac.conf 2013-11-29 10:08:52.000000000 +0800 @@ -38,7 +38,8 @@ QMAKE_DEL_DIR = rmdir QMAKE_CHK_DIR_EXISTS = test -d QMAKE_MKDIR = mkdir -p -QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.4 # overridden to 10.5 for Cocoa on the compiler command line +QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.8 # overridden to 10.5 for Cocoa on the compiler command line +DEFINES += QT_NO_IMPORT_QT47_QML include(unix.conf) Only in qt-adsk-4.8.5/mkspecs/unsupported: macx-clang-libc++ diff -rau qt-everywhere-opensource-src-4.8.5/mkspecs/win32-msvc2008/qmake.conf qt-adsk-4.8.5/mkspecs/win32-msvc2008/qmake.conf --- qt-everywhere-opensource-src-4.8.5/mkspecs/win32-msvc2008/qmake.conf 2013-06-07 13:17:00.000000000 +0800 +++ qt-adsk-4.8.5/mkspecs/win32-msvc2008/qmake.conf 2013-09-22 09:31:41.000000000 +0800 @@ -3,6 +3,8 @@ # # Written for Microsoft Visual C++ 2008 # +# Modified Autodesk build changes +# enable debug symbols for release build MAKEFILE_GENERATOR = MSVC.NET TEMPLATE = app @@ -19,7 +21,7 @@ QMAKE_CFLAGS = -nologo -Zm200 -Zc:wchar_t- QMAKE_CFLAGS_WARN_ON = -W3 QMAKE_CFLAGS_WARN_OFF = -W0 -QMAKE_CFLAGS_RELEASE = -O2 -MD +QMAKE_CFLAGS_RELEASE = -O2 -MD -Zi QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += -O2 -MD -Zi QMAKE_CFLAGS_DEBUG = -Zi -MDd QMAKE_CFLAGS_YACC = diff -rau qt-everywhere-opensource-src-4.8.5/mkspecs/win32-msvc2010/qmake.conf qt-adsk-4.8.5/mkspecs/win32-msvc2010/qmake.conf --- qt-everywhere-opensource-src-4.8.5/mkspecs/win32-msvc2010/qmake.conf 2013-06-07 13:17:00.000000000 +0800 +++ qt-adsk-4.8.5/mkspecs/win32-msvc2010/qmake.conf 2013-09-22 09:31:41.000000000 +0800 @@ -16,10 +16,10 @@ QMAKE_LEXFLAGS = QMAKE_YACC = byacc QMAKE_YACCFLAGS = -d -QMAKE_CFLAGS = -nologo -Zm200 -Zc:wchar_t- +QMAKE_CFLAGS = -nologo -Zm200 -Zc:wchar_t QMAKE_CFLAGS_WARN_ON = -W3 QMAKE_CFLAGS_WARN_OFF = -W0 -QMAKE_CFLAGS_RELEASE = -O2 -MD +QMAKE_CFLAGS_RELEASE = -O2 -MD -Zi QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += -O2 -MD -Zi QMAKE_CFLAGS_DEBUG = -Zi -MDd QMAKE_CFLAGS_YACC = @@ -56,7 +56,7 @@ QMAKE_LINK = link QMAKE_LFLAGS = /NOLOGO /DYNAMICBASE /NXCOMPAT -QMAKE_LFLAGS_RELEASE = /INCREMENTAL:NO +QMAKE_LFLAGS_RELEASE = /INCREMENTAL:NO /DEBUG QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO = /DEBUG /OPT:REF QMAKE_LFLAGS_DEBUG = /DEBUG QMAKE_LFLAGS_CONSOLE = /SUBSYSTEM:CONSOLE diff -rau qt-everywhere-opensource-src-4.8.5/mkspecs/win32-msvc2012/qmake.conf qt-adsk-4.8.5/mkspecs/win32-msvc2012/qmake.conf --- qt-everywhere-opensource-src-4.8.5/mkspecs/win32-msvc2012/qmake.conf 2013-06-07 13:17:00.000000000 +0800 +++ qt-adsk-4.8.5/mkspecs/win32-msvc2012/qmake.conf 2013-11-26 14:41:48.000000000 +0800 @@ -8,7 +8,7 @@ TEMPLATE = app CONFIG += qt warn_on release incremental flat link_prl precompile_header autogen_precompile_source copy_dir_files debug_and_release debug_and_release_target embed_manifest_dll embed_manifest_exe QT += core gui -DEFINES += UNICODE WIN32 +DEFINES += UNICODE WIN32 QT_NO_IMPORT_QT47_QML QMAKE_COMPILER_DEFINES += _MSC_VER=1700 WIN32 QMAKE_CC = cl @@ -16,10 +16,10 @@ QMAKE_LEXFLAGS = QMAKE_YACC = byacc QMAKE_YACCFLAGS = -d -QMAKE_CFLAGS = -nologo -Zm200 -Zc:wchar_t- +QMAKE_CFLAGS = -nologo -Zm200 -Zc:wchar_t QMAKE_CFLAGS_WARN_ON = -W3 QMAKE_CFLAGS_WARN_OFF = -W0 -QMAKE_CFLAGS_RELEASE = -O2 -MD +QMAKE_CFLAGS_RELEASE = -O2 -MD -Zi QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += -O2 -MD -Zi QMAKE_CFLAGS_DEBUG = -Zi -MDd QMAKE_CFLAGS_YACC = @@ -56,7 +56,7 @@ QMAKE_LINK = link QMAKE_LFLAGS = /NOLOGO /DYNAMICBASE /NXCOMPAT -QMAKE_LFLAGS_RELEASE = /INCREMENTAL:NO +QMAKE_LFLAGS_RELEASE = /INCREMENTAL:NO /DEBUG QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO = /DEBUG /OPT:REF QMAKE_LFLAGS_DEBUG = /DEBUG QMAKE_LFLAGS_CONSOLE = /SUBSYSTEM:CONSOLE diff -rau qt-everywhere-opensource-src-4.8.5/qmake/generators/win32/winmakefile.cpp qt-adsk-4.8.5/qmake/generators/win32/winmakefile.cpp --- qt-everywhere-opensource-src-4.8.5/qmake/generators/win32/winmakefile.cpp 2013-06-07 13:17:01.000000000 +0800 +++ qt-adsk-4.8.5/qmake/generators/win32/winmakefile.cpp 2013-09-22 09:31:41.000000000 +0800 @@ -458,6 +458,7 @@ ts << "\t\t\t\tVALUE \"LegalCopyright\", \"" << copyright << "\\0\"" << endl; ts << "\t\t\t\tVALUE \"OriginalFilename\", \"" << originalName << "\\0\"" << endl; ts << "\t\t\t\tVALUE \"ProductName\", \"" << productName << "\\0\"" << endl; + ts << "\t\t\t\tVALUE \"ProductVersion\", \"" << versionString << "\\0\"" << endl; ts << "\t\t\tEND" << endl; ts << "\t\tEND" << endl; ts << "\t\tBLOCK \"VarFileInfo\"" << endl; diff -rau qt-everywhere-opensource-src-4.8.5/src/3rdparty/clucene/src/CLucene/StdHeader.h qt-adsk-4.8.5/src/3rdparty/clucene/src/CLucene/StdHeader.h --- qt-everywhere-opensource-src-4.8.5/src/3rdparty/clucene/src/CLucene/StdHeader.h 2013-06-07 13:16:58.000000000 +0800 +++ qt-adsk-4.8.5/src/3rdparty/clucene/src/CLucene/StdHeader.h 2013-09-22 09:31:41.000000000 +0800 @@ -463,8 +463,16 @@ //use std namespace #ifndef LUCENE_NO_STDC_NAMESPACE +#ifdef _LIBCPP_VERSION +// clang's libc++ pulls in cwchar, clucene pulls in wchar.h and the entire std +// namespace which causes ambiguity between ::wcschar() and std::wcschar(), but +// clucene is only using std::min() and std::max() +using std::min; +using std::max; +#else using namespace std; #endif +#endif //////////////////////////////////////////////////////// diff -rau qt-everywhere-opensource-src-4.8.5/src/3rdparty/javascriptcore/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp qt-adsk-4.8.5/src/3rdparty/javascriptcore/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp --- qt-everywhere-opensource-src-4.8.5/src/3rdparty/javascriptcore/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp 2013-06-07 13:16:58.000000000 +0800 +++ qt-adsk-4.8.5/src/3rdparty/javascriptcore/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp 2013-09-22 09:31:41.000000000 +0800 @@ -1835,9 +1835,9 @@ RegisterID* BytecodeGenerator::emitCatch(RegisterID* targetRegister, Label* start, Label* end) { #if ENABLE(JIT) - HandlerInfo info = { start->bind(0, 0), end->bind(0, 0), instructions().size(), m_dynamicScopeDepth + m_baseScopeDepth, CodeLocationLabel() }; + HandlerInfo info = { (uint32_t)start->bind(0, 0), (uint32_t)end->bind(0, 0), (uint32_t)instructions().size(), (uint32_t)(m_dynamicScopeDepth + m_baseScopeDepth), CodeLocationLabel() }; #else - HandlerInfo info = { start->bind(0, 0), end->bind(0, 0), instructions().size(), m_dynamicScopeDepth + m_baseScopeDepth }; + HandlerInfo info = { (uint32_t)start->bind(0, 0), (uint32_t)end->bind(0, 0), (uint32_t)instructions().size(), (uint32_t)(m_dynamicScopeDepth + m_baseScopeDepth) }; #endif m_codeBlock->addExceptionHandler(info); @@ -1889,7 +1889,7 @@ void BytecodeGenerator::beginSwitch(RegisterID* scrutineeRegister, SwitchInfo::SwitchType type) { - SwitchInfo info = { instructions().size(), type }; + SwitchInfo info = { (uint32_t)instructions().size(), type }; switch (type) { case SwitchInfo::SwitchImmediate: emitOpcode(op_switch_imm); diff -rau qt-everywhere-opensource-src-4.8.5/src/3rdparty/javascriptcore/JavaScriptCore/bytecompiler/BytecodeGenerator.h qt-adsk-4.8.5/src/3rdparty/javascriptcore/JavaScriptCore/bytecompiler/BytecodeGenerator.h --- qt-everywhere-opensource-src-4.8.5/src/3rdparty/javascriptcore/JavaScriptCore/bytecompiler/BytecodeGenerator.h 2013-06-07 13:16:58.000000000 +0800 +++ qt-adsk-4.8.5/src/3rdparty/javascriptcore/JavaScriptCore/bytecompiler/BytecodeGenerator.h 2013-09-22 09:31:41.000000000 +0800 @@ -176,7 +176,7 @@ // Node::emitCode assumes that dst, if provided, is either a local or a referenced temporary. ASSERT(!dst || dst == ignoredResult() || !dst->isTemporary() || dst->refCount()); if (!m_codeBlock->numberOfLineInfos() || m_codeBlock->lastLineInfo().lineNumber != n->lineNo()) { - LineInfo info = { instructions().size(), n->lineNo() }; + LineInfo info = { (uint32_t)instructions().size(), n->lineNo() }; m_codeBlock->addLineInfo(info); } if (m_emitNodeDepth >= s_maxEmitNodeDepth) @@ -195,7 +195,7 @@ void emitNodeInConditionContext(ExpressionNode* n, Label* trueTarget, Label* falseTarget, bool fallThroughMeansTrue) { if (!m_codeBlock->numberOfLineInfos() || m_codeBlock->lastLineInfo().lineNumber != n->lineNo()) { - LineInfo info = { instructions().size(), n->lineNo() }; + LineInfo info = { (uint32_t)instructions().size(), n->lineNo() }; m_codeBlock->addLineInfo(info); } if (m_emitNodeDepth >= s_maxEmitNodeDepth) diff -rau qt-everywhere-opensource-src-4.8.5/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Collector.cpp qt-adsk-4.8.5/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Collector.cpp --- qt-everywhere-opensource-src-4.8.5/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Collector.cpp 2013-06-07 13:16:58.000000000 +0800 +++ qt-adsk-4.8.5/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Collector.cpp 2013-09-22 09:31:41.000000000 +0800 @@ -52,6 +52,8 @@ #include #include #include +// clang's libc++ headers does not pull in pthread.h (but libstdc++ does) +#include #elif OS(WINDOWS) diff -rau qt-everywhere-opensource-src-4.8.5/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Identifier.cpp qt-adsk-4.8.5/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Identifier.cpp --- qt-everywhere-opensource-src-4.8.5/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Identifier.cpp 2013-06-07 13:16:58.000000000 +0800 +++ qt-adsk-4.8.5/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Identifier.cpp 2013-10-01 05:17:10.000000000 +0800 @@ -195,7 +195,7 @@ UString::Rep::empty().hash(); return &UString::Rep::empty(); } - UCharBuffer buf = {s, length}; + UCharBuffer buf = {s, (unsigned int)length}; pair::iterator, bool> addResult = globalData->identifierTable->add(buf); // If the string is newly-translated, then we need to adopt it. diff -rau qt-everywhere-opensource-src-4.8.5/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Structure.cpp qt-adsk-4.8.5/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Structure.cpp --- qt-everywhere-opensource-src-4.8.5/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Structure.cpp 2013-06-07 13:16:58.000000000 +0800 +++ qt-adsk-4.8.5/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Structure.cpp 2013-09-22 09:31:41.000000000 +0800 @@ -157,7 +157,7 @@ { if (m_previous) { if (m_nameInPrevious) - m_previous->table.remove(StructureTransitionTableHash::Key(RefPtr(m_nameInPrevious.get()), m_attributesInPrevious), m_specificValueInPrevious); + m_previous->table.remove(StructureTransitionTableHash::Key(RefPtr(m_nameInPrevious.get()), +m_attributesInPrevious), m_specificValueInPrevious); else m_previous->table.removeAnonymousSlotTransition(m_anonymousSlotsInPrevious); diff -rau qt-everywhere-opensource-src-4.8.5/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Structure.h qt-adsk-4.8.5/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Structure.h --- qt-everywhere-opensource-src-4.8.5/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Structure.h 2013-06-07 13:16:58.000000000 +0800 +++ qt-adsk-4.8.5/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Structure.h 2013-10-01 05:15:54.000000000 +0800 @@ -317,7 +317,7 @@ TransitionTable* transitionTable = new TransitionTable; setTransitionTable(transitionTable); if (existingTransition) - add(StructureTransitionTableHash::Key(RefPtr(existingTransition->m_nameInPrevious.get()), existingTransition->m_attributesInPrevious), existingTransition, existingTransition->m_specificValueInPrevious); + add(StructureTransitionTableHash::Key(RefPtr(existingTransition->m_nameInPrevious.get()), +existingTransition->m_attributesInPrevious), existingTransition, existingTransition->m_specificValueInPrevious); } } // namespace JSC diff -rau qt-everywhere-opensource-src-4.8.5/src/3rdparty/javascriptcore/JavaScriptCore/wtf/HashTable.h qt-adsk-4.8.5/src/3rdparty/javascriptcore/JavaScriptCore/wtf/HashTable.h --- qt-everywhere-opensource-src-4.8.5/src/3rdparty/javascriptcore/JavaScriptCore/wtf/HashTable.h 2013-06-07 13:16:58.000000000 +0800 +++ qt-adsk-4.8.5/src/3rdparty/javascriptcore/JavaScriptCore/wtf/HashTable.h 2013-09-22 09:31:41.000000000 +0800 @@ -257,8 +257,8 @@ using std::swap; -#if !COMPILER(MSVC) && !OS(QNX) - // The Dinkumware C++ library (used by MSVC and QNX) has a swap for pairs defined. +#if !COMPILER(MSVC) && !OS(QNX) && !defined(_LIBCPP_VERSION) + // The Dinkumware C++ library (used by MSVC and QNX) and clang's libc++ have a swap for pairs defined. // swap pairs by component, in case of pair members that specialize swap template inline void swap(pair& a, pair& b) diff -rau qt-everywhere-opensource-src-4.8.5/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Threading.h qt-adsk-4.8.5/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Threading.h --- qt-everywhere-opensource-src-4.8.5/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Threading.h 2013-06-07 13:16:58.000000000 +0800 +++ qt-adsk-4.8.5/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Threading.h 2013-09-22 09:31:41.000000000 +0800 @@ -71,18 +71,10 @@ #if OS(WINDOWS) && !OS(WINCE) #include -#elif OS(DARWIN) -#include #elif OS(ANDROID) #include #elif OS(QNX) #include -#elif COMPILER(GCC) && !OS(SYMBIAN) -#if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 2)) -#include -#else -#include -#endif #endif #if USE(PTHREADS) @@ -230,12 +222,6 @@ inline int atomicDecrement(int volatile* addend) { return InterlockedDecrement(reinterpret_cast(addend)); } #endif -#elif OS(DARWIN) -#define WTF_USE_LOCKFREE_THREADSAFESHARED 1 - -inline int atomicIncrement(int volatile* addend) { return OSAtomicIncrement32Barrier(const_cast(addend)); } -inline int atomicDecrement(int volatile* addend) { return OSAtomicDecrement32Barrier(const_cast(addend)); } - #elif OS(ANDROID) inline int atomicIncrement(int volatile* addend) { return android_atomic_inc(addend); } @@ -250,8 +236,8 @@ #elif COMPILER(GCC) && !CPU(SPARC64) && !OS(SYMBIAN) // sizeof(_Atomic_word) != sizeof(int) on sparc64 gcc #define WTF_USE_LOCKFREE_THREADSAFESHARED 1 -inline int atomicIncrement(int volatile* addend) { return __gnu_cxx::__exchange_and_add(addend, 1) + 1; } -inline int atomicDecrement(int volatile* addend) { return __gnu_cxx::__exchange_and_add(addend, -1) - 1; } +inline int atomicIncrement(int volatile* addend) { return __sync_add_and_fetch(addend, 1); } +inline int atomicDecrement(int volatile* addend) { return __sync_sub_and_fetch(addend, 1); } #endif diff -rau qt-everywhere-opensource-src-4.8.5/src/3rdparty/libpng/pngconf.h qt-adsk-4.8.5/src/3rdparty/libpng/pngconf.h --- qt-everywhere-opensource-src-4.8.5/src/3rdparty/libpng/pngconf.h 2013-06-07 13:16:58.000000000 +0800 +++ qt-adsk-4.8.5/src/3rdparty/libpng/pngconf.h 2013-09-22 09:31:41.000000000 +0800 @@ -270,6 +270,11 @@ # define PNG_IMPEXP PNG_DLL_IMPORT # endif +/* Avoid exporting libpng symbols from Qt DLL on Windows */ +# if defined (_MSC_VER) && defined(PNG_IMPEXP) +# undef PNG_IMPEXP +# endif + # ifndef PNG_IMPEXP # define PNG_IMPEXP # endif diff -rau qt-everywhere-opensource-src-4.8.5/src/3rdparty/webkit/Source/JavaScriptCore/wtf/Atomics.h qt-adsk-4.8.5/src/3rdparty/webkit/Source/JavaScriptCore/wtf/Atomics.h --- qt-everywhere-opensource-src-4.8.5/src/3rdparty/webkit/Source/JavaScriptCore/wtf/Atomics.h 2013-06-07 13:16:54.000000000 +0800 +++ qt-adsk-4.8.5/src/3rdparty/webkit/Source/JavaScriptCore/wtf/Atomics.h 2013-09-22 09:31:41.000000000 +0800 @@ -63,18 +63,10 @@ #if OS(WINDOWS) #include -#elif OS(DARWIN) -#include #elif OS(ANDROID) #include #elif OS(QNX) #include -#elif COMPILER(GCC) && !OS(SYMBIAN) -#if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 2)) -#include -#else -#include -#endif #endif namespace WTF { @@ -90,12 +82,6 @@ inline int atomicDecrement(int volatile* addend) { return InterlockedDecrement(reinterpret_cast(addend)); } #endif -#elif OS(DARWIN) -#define WTF_USE_LOCKFREE_THREADSAFEREFCOUNTED 1 - -inline int atomicIncrement(int volatile* addend) { return OSAtomicIncrement32Barrier(const_cast(addend)); } -inline int atomicDecrement(int volatile* addend) { return OSAtomicDecrement32Barrier(const_cast(addend)); } - #elif OS(ANDROID) inline int atomicIncrement(int volatile* addend) { return android_atomic_inc(addend); } @@ -109,8 +95,8 @@ #elif COMPILER(GCC) && !CPU(SPARC64) && !OS(SYMBIAN) // sizeof(_Atomic_word) != sizeof(int) on sparc64 gcc #define WTF_USE_LOCKFREE_THREADSAFEREFCOUNTED 1 -inline int atomicIncrement(int volatile* addend) { return __gnu_cxx::__exchange_and_add(addend, 1) + 1; } -inline int atomicDecrement(int volatile* addend) { return __gnu_cxx::__exchange_and_add(addend, -1) - 1; } +inline int atomicIncrement(int volatile* addend) { return __sync_add_and_fetch(addend, 1); } +inline int atomicDecrement(int volatile* addend) { return __sync_sub_and_fetch(addend, 1); } #endif diff -rau qt-everywhere-opensource-src-4.8.5/src/3rdparty/webkit/Source/JavaScriptCore/wtf/HashSet.h qt-adsk-4.8.5/src/3rdparty/webkit/Source/JavaScriptCore/wtf/HashSet.h --- qt-everywhere-opensource-src-4.8.5/src/3rdparty/webkit/Source/JavaScriptCore/wtf/HashSet.h 2013-06-07 13:16:54.000000000 +0800 +++ qt-adsk-4.8.5/src/3rdparty/webkit/Source/JavaScriptCore/wtf/HashSet.h 2013-09-22 09:31:41.000000000 +0800 @@ -175,10 +175,18 @@ } template - inline pair::iterator, bool> HashSet::add(const ValueType& value) +#if defined(_WIN32) + inline pair::const_iterator, bool> HashSet::add(const ValueType &value) + { + auto p= m_impl.add(value); + return make_pair(typename HashSet::const_iterator(p.first), p.second); + } +#else + inline pair::iterator, bool> HashSet::add(const ValueType &value) { return m_impl.add(value); } +#endif template template @@ -186,7 +194,13 @@ HashSet::add(const T& value) { typedef HashSetTranslatorAdapter Adapter; +#if defined(_WIN32) + typedef typename HashSet::iterator iter_type; + auto& temp = m_impl.template addPassingHashCode(value, value); + return make_pair((iter_type)temp.first, temp.second); +#else return m_impl.template addPassingHashCode(value, value); +#endif } template diff -rau qt-everywhere-opensource-src-4.8.5/src/3rdparty/webkit/Source/JavaScriptCore/wtf/NullPtr.h qt-adsk-4.8.5/src/3rdparty/webkit/Source/JavaScriptCore/wtf/NullPtr.h --- qt-everywhere-opensource-src-4.8.5/src/3rdparty/webkit/Source/JavaScriptCore/wtf/NullPtr.h 2013-06-07 13:16:54.000000000 +0800 +++ qt-adsk-4.8.5/src/3rdparty/webkit/Source/JavaScriptCore/wtf/NullPtr.h 2013-09-22 09:31:41.000000000 +0800 @@ -35,7 +35,7 @@ #define __has_feature(feature) 0 #endif -#if __has_feature(cxx_nullptr) || (GCC_VERSION_AT_LEAST(4, 6, 0) && defined(__GXX_EXPERIMENTAL_CXX0X__)) || (defined(_MSC_VER) && _MSC_VER >= 1600 && !COMPILER(INTEL)) +#if __has_feature(cxx_nullptr) || defined( _LIBCPP_VERSION ) || (GCC_VERSION_AT_LEAST(4, 6, 0) && defined(__GXX_EXPERIMENTAL_CXX0X__)) || (defined(_MSC_VER) && _MSC_VER >= 1600 && !COMPILER(INTEL)) #define HAVE_NULLPTR 1 diff -rau qt-everywhere-opensource-src-4.8.5/src/3rdparty/webkit/Source/WebCore/platform/DefaultLocalizationStrategy.cpp qt-adsk-4.8.5/src/3rdparty/webkit/Source/WebCore/platform/DefaultLocalizationStrategy.cpp --- qt-everywhere-opensource-src-4.8.5/src/3rdparty/webkit/Source/WebCore/platform/DefaultLocalizationStrategy.cpp 2013-06-07 13:16:55.000000000 +0800 +++ qt-adsk-4.8.5/src/3rdparty/webkit/Source/WebCore/platform/DefaultLocalizationStrategy.cpp 2013-09-22 09:31:41.000000000 +0800 @@ -324,7 +324,7 @@ RetainPtr selectedCFString(AdoptCF, truncatedStringForLookupMenuItem(selectedString).createCFString()); return formatLocalizedString(WEB_UI_STRING("Look Up “%@”", "Look Up context menu item with selected word"), selectedCFString.get()); #else - return WEB_UI_STRING("Look Up “”", "Look Up context menu item with selected word").replace("", truncatedStringForLookupMenuItem(selectedString)); + return WEB_UI_STRING("Look Up \"\"", "Look Up context menu item with selected word").replace("", truncatedStringForLookupMenuItem(selectedString)); #endif #endif } diff -rau qt-everywhere-opensource-src-4.8.5/src/3rdparty/webkit/Source/WebCore/platform/text/TextEncodingRegistry.cpp qt-adsk-4.8.5/src/3rdparty/webkit/Source/WebCore/platform/text/TextEncodingRegistry.cpp --- qt-everywhere-opensource-src-4.8.5/src/3rdparty/webkit/Source/WebCore/platform/text/TextEncodingRegistry.cpp 2013-06-07 13:16:56.000000000 +0800 +++ qt-adsk-4.8.5/src/3rdparty/webkit/Source/WebCore/platform/text/TextEncodingRegistry.cpp 2013-09-22 09:31:41.000000000 +0800 @@ -74,11 +74,20 @@ char c1; char c2; do { +#if defined(_MSC_VER) && _MSC_VER == 1700 + // Workaround for a bug in the VS2012 Update1 and Update2 optimizer, remove once the fix is released. + // https://connect.microsoft.com/VisualStudio/feedback/details/781189/vs2012-update-ctp4-c-optimizing-bug + c1 = toASCIILower(*s1++); + c2 = toASCIILower(*s2++); + if (c1 != c2) + return false; +#else c1 = *s1++; c2 = *s2++; if (toASCIILower(c1) != toASCIILower(c2)) return false; - } while (c1 && c2); +#endif + } while (c1 && c2); return !c1 && !c2; } diff -rau qt-everywhere-opensource-src-4.8.5/src/3rdparty/webkit/Source/WebKit/qt/ChangeLog qt-adsk-4.8.5/src/3rdparty/webkit/Source/WebKit/qt/ChangeLog --- qt-everywhere-opensource-src-4.8.5/src/3rdparty/webkit/Source/WebKit/qt/ChangeLog 2013-06-07 13:16:58.000000000 +0800 +++ qt-adsk-4.8.5/src/3rdparty/webkit/Source/WebKit/qt/ChangeLog 2013-09-22 09:31:41.000000000 +0800 @@ -1,3 +1,17 @@ +2012-05-17 Tsarko Yaroslav + + Reviewed by NOBODY (OOPS!). + + Bug 71271: [Qt] Web Inspector: local inspector client UI becomes unresponsive on debugger pause during + https://bugs.webkit.org/show_bug.cgi?id=71271 + + Web Inspector should not belong to any other page groups since it is a specialized debugger window. + The reason for this change is when debugger pauses web page it pauses all the pages in the page group of debuggee. + This leads that Web Inspector front-end is paused too leading to locked Web Inspector GUI (bugzilla ticket 71271). + + * WebCoreSupport/InspectorClientQt.cpp: + (WebCore::InspectorClientQt::openInspectorFrontend): + 2012-04-02 Casper van Donderen Qt: Doc: Fix typo which marks document to be printed in console font. diff -rau qt-everywhere-opensource-src-4.8.5/src/3rdparty/webkit/Source/WebKit/qt/QtWebKit.pro qt-adsk-4.8.5/src/3rdparty/webkit/Source/WebKit/qt/QtWebKit.pro --- qt-everywhere-opensource-src-4.8.5/src/3rdparty/webkit/Source/WebKit/qt/QtWebKit.pro 2013-06-07 13:16:58.000000000 +0800 +++ qt-adsk-4.8.5/src/3rdparty/webkit/Source/WebKit/qt/QtWebKit.pro 2013-09-22 09:31:41.000000000 +0800 @@ -255,6 +255,8 @@ LIBS += $$SOURCE_DIR/../WebKitLibraries/libWebKitSystemInterfaceLion.a } else: equals(DARWIN_MAJOR_VERSION, "12") | contains(QMAKE_MAC_SDK, ".*MacOSX10.8.sdk") { LIBS += $$SOURCE_DIR/../WebKitLibraries/libWebKitSystemInterfaceMountainLion.a + } else: equals(DARWIN_MAJOR_VERSION, "13") | contains(QMAKE_MAC_SDK, ".*MacOSX10.9.sdk") { + LIBS += $$SOURCE_DIR/../WebKitLibraries/libWebKitSystemInterfaceMountainLion.a } } } diff -rau qt-everywhere-opensource-src-4.8.5/src/3rdparty/webkit/Source/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp qt-adsk-4.8.5/src/3rdparty/webkit/Source/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp --- qt-everywhere-opensource-src-4.8.5/src/3rdparty/webkit/Source/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp 2013-06-07 13:16:58.000000000 +0800 +++ qt-adsk-4.8.5/src/3rdparty/webkit/Source/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp 2013-09-22 09:31:41.000000000 +0800 @@ -235,6 +235,9 @@ m_frontendClient = new InspectorFrontendClientQt(m_inspectedWebPage, inspectorView, this); inspectorView->page()->d->page->inspectorController()->setInspectorFrontendClient(m_frontendClient); m_frontendWebPage = inspectorPage; + + // Web Inspector should not belong to any other page groups since it is a specialized debugger window. + m_frontendWebPage->handle()->page->setGroupName("__WebInspectorPageGroup__"); #endif } diff -rau qt-everywhere-opensource-src-4.8.5/src/corelib/global/qglobal.cpp qt-adsk-4.8.5/src/corelib/global/qglobal.cpp --- qt-everywhere-opensource-src-4.8.5/src/corelib/global/qglobal.cpp 2013-06-07 13:16:52.000000000 +0800 +++ qt-adsk-4.8.5/src/corelib/global/qglobal.cpp 2013-10-01 07:01:06.000000000 +0800 @@ -1144,6 +1144,8 @@ \value WV_5_2 Operating system version 5.2, corresponds to Windows Server 2003, Windows Server 2003 R2, Windows Home Server, and Windows XP Professional x64 Edition \value WV_6_0 Operating system version 6.0, corresponds to Windows Vista and Windows Server 2008 \value WV_6_1 Operating system version 6.1, corresponds to Windows 7 and Windows Server 2008 R2 + \value WV_6_2 Operating system version 6.2, corresponds to Windows 8 + \value WV_6_3 Operating system version 6.3, corresponds to Windows 8.1 CE-based versions: @@ -1180,6 +1182,7 @@ \value MV_10_6 Mac OS X 10.6 \value MV_10_7 Mac OS X 10.7 \value MV_10_8 Mac OS X 10.8 + \value MV_10_9 Mac OS X 10.9 \value MV_Unknown An unknown and currently unsupported platform \value MV_CHEETAH Apple codename for MV_10_0 @@ -1191,6 +1194,7 @@ \value MV_SNOWLEOPARD Apple codename for MV_10_6 \value MV_LION Apple codename for MV_10_7 \value MV_MOUNTAINLION Apple codename for MV_10_8 + \value MV_MAVERICKS Apple codename for MV_10_9 \sa WinVersion, SymbianVersion */ @@ -1749,6 +1753,8 @@ winver = QSysInfo::WV_WINDOWS7; } else if (osver.dwMajorVersion == 6 && osver.dwMinorVersion == 2) { winver = QSysInfo::WV_WINDOWS8; + } else if (osver.dwMajorVersion == 6 && osver.dwMinorVersion == 3) { + winver = QSysInfo::WV_WINDOWS81; } else { qWarning("Qt: Untested Windows version %d.%d detected!", int(osver.dwMajorVersion), int(osver.dwMinorVersion)); @@ -1782,6 +1788,8 @@ winver = QSysInfo::WV_WINDOWS7; else if (override == "WINDOWS8") winver = QSysInfo::WV_WINDOWS8; + else if (override == "WINDOWS81") + winver = QSysInfo::WV_WINDOWS81; } #endif diff -rau qt-everywhere-opensource-src-4.8.5/src/corelib/global/qglobal.h qt-adsk-4.8.5/src/corelib/global/qglobal.h --- qt-everywhere-opensource-src-4.8.5/src/corelib/global/qglobal.h 2013-06-07 13:16:52.000000000 +0800 +++ qt-adsk-4.8.5/src/corelib/global/qglobal.h 2013-10-01 05:43:04.000000000 +0800 @@ -58,6 +58,8 @@ #define QT_PACKAGE_TAG "0529dc9b2542dcb46c2e2cc1a3422fc83c6ae6ef" +#define QT_BUILD_INTERNAL + #if !defined(QT_BUILD_MOC) #include #endif @@ -327,7 +329,10 @@ # if !defined(MAC_OS_X_VERSION_10_8) # define MAC_OS_X_VERSION_10_8 MAC_OS_X_VERSION_10_7 + 1 # endif -# if (MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_8) +# if !defined(MAC_OS_X_VERSION_10_9) +# define MAC_OS_X_VERSION_10_9 MAC_OS_X_VERSION_10_8 + 1 +# endif +# if (MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_9) # warning "This version of Mac OS X is unsupported" # endif #endif @@ -789,6 +794,11 @@ # error "Qt has not been tested with this compiler - talk to qt-bugs@trolltech.com" #endif + // ADSK Check for Intel support of c++0x is wrong comment it out so it doesn't cause more problems + // Qt for Maya is currently built with gcc 4.1.2 which doesn't support these C++0x features, + // comment out so files compiled with Intel using Qt don't assume Qt supports these + // plus the #if #elif check is backwards >= 1200 will never get checked but that is Nokia's problem + // should probably be a #if #endif, then 2nd #if #endif #ifdef Q_CC_INTEL # if __INTEL_COMPILER < 1200 @@ -796,9 +806,9 @@ # endif # if defined(__GXX_EXPERIMENTAL_CXX0X__) || defined(__GXX_EXPERIMENTAL_CPP0X__) # if __INTEL_COMPILER >= 1100 -# define Q_COMPILER_RVALUE_REFS -# define Q_COMPILER_EXTERN_TEMPLATES -# define Q_COMPILER_DECLTYPE +//# define Q_COMPILER_RVALUE_REFS +//# define Q_COMPILER_EXTERN_TEMPLATES +//# define Q_COMPILER_DECLTYPE # elif __INTEL_COMPILER >= 1200 # define Q_COMPILER_VARIADIC_TEMPLATES # define Q_COMPILER_AUTO_TYPE @@ -1589,6 +1599,7 @@ WV_VISTA = 0x0080, WV_WINDOWS7 = 0x0090, WV_WINDOWS8 = 0x00a0, + WV_WINDOWS81 = 0x00b0, WV_NT_based = 0x00f0, /* version numbers */ @@ -1599,6 +1610,7 @@ WV_6_0 = WV_VISTA, WV_6_1 = WV_WINDOWS7, WV_6_2 = WV_WINDOWS8, + WV_6_3 = WV_WINDOWS81, WV_CE = 0x0100, WV_CENET = 0x0200, @@ -1625,6 +1637,7 @@ MV_10_6 = 0x0008, MV_10_7 = 0x0009, MV_10_8 = 0x000A, + MV_10_9 = 0x000B, /* codenames */ MV_CHEETAH = MV_10_0, @@ -1635,7 +1648,8 @@ MV_LEOPARD = MV_10_5, MV_SNOWLEOPARD = MV_10_6, MV_LION = MV_10_7, - MV_MOUNTAINLION = MV_10_8 + MV_MOUNTAINLION = MV_10_8, + MV_MAVERICKS = MV_10_9 }; static const MacVersion MacintoshVersion; #endif @@ -2188,8 +2202,8 @@ Q_DECLARE_SHARED(type); where 'type' is the name of the type to specialize. NOTE: shared - types must declare a 'bool isDetached(void) const;' member for this - to work. + types must define a member-swap, and be defined in the same + namespace as Qt for this to work. */ #ifdef QT_NO_STL #define Q_DECLARE_SHARED_STL(TYPE) @@ -2198,7 +2212,7 @@ QT_END_NAMESPACE \ namespace std { \ template<> inline void swap(QT_PREPEND_NAMESPACE(TYPE) &value1, QT_PREPEND_NAMESPACE(TYPE) &value2) \ - { swap(value1.data_ptr(), value2.data_ptr()); } \ + { value1.swap(value2); } \ } \ QT_BEGIN_NAMESPACE #endif @@ -2206,7 +2220,7 @@ #define Q_DECLARE_SHARED(TYPE) \ template <> inline bool qIsDetached(TYPE &t) { return t.isDetached(); } \ template <> inline void qSwap(TYPE &value1, TYPE &value2) \ -{ qSwap(value1.data_ptr(), value2.data_ptr()); } \ +{ value1.swap(value2); } \ Q_DECLARE_SHARED_STL(TYPE) /* diff -rau qt-everywhere-opensource-src-4.8.5/src/corelib/global/qnamespace.h qt-adsk-4.8.5/src/corelib/global/qnamespace.h --- qt-everywhere-opensource-src-4.8.5/src/corelib/global/qnamespace.h 2013-06-07 13:16:52.000000000 +0800 +++ qt-adsk-4.8.5/src/corelib/global/qnamespace.h 2013-09-22 09:31:41.000000000 +0800 @@ -547,6 +547,7 @@ AA_S60DisablePartialScreenInputMode = 9, AA_X11InitThreads = 10, AA_CaptureMultimediaKeys = 11, + AA_UseHighDpiPixmaps = 12, // Add new attributes before this line AA_AttributeCount diff -rau qt-everywhere-opensource-src-4.8.5/src/corelib/global/qnamespace.qdoc qt-adsk-4.8.5/src/corelib/global/qnamespace.qdoc --- qt-everywhere-opensource-src-4.8.5/src/corelib/global/qnamespace.qdoc 2013-06-07 13:16:52.000000000 +0800 +++ qt-adsk-4.8.5/src/corelib/global/qnamespace.qdoc 2013-09-22 09:31:41.000000000 +0800 @@ -180,6 +180,14 @@ be set before QApplication is constructed. This attribute is only supported in Symbian platform. + \value AA_UseHighDpiPixmaps Make QIcon::pixmap() generate high-dpi pixmaps + that can be larger than the requested size. Such pixmaps will have + devicePixelRatio set to a value higher than 1. + + After setting this attribute application code that uses pixmap + sizes in layout geometry calculations should typically divide by + QPixmap::devicePixelRatio() to get device-independent layout geometry. + \omitvalue AA_AttributeCount */ diff -rau qt-everywhere-opensource-src-4.8.5/src/corelib/io/qfilesystementry_p.h qt-adsk-4.8.5/src/corelib/io/qfilesystementry_p.h --- qt-everywhere-opensource-src-4.8.5/src/corelib/io/qfilesystementry_p.h 2013-06-07 13:16:52.000000000 +0800 +++ qt-adsk-4.8.5/src/corelib/io/qfilesystementry_p.h 2013-09-22 09:31:41.000000000 +0800 @@ -62,7 +62,7 @@ QT_BEGIN_NAMESPACE -class QFileSystemEntry +class Q_AUTOTEST_EXPORT QFileSystemEntry { public: diff -rau qt-everywhere-opensource-src-4.8.5/src/corelib/io/qprocess.cpp qt-adsk-4.8.5/src/corelib/io/qprocess.cpp --- qt-everywhere-opensource-src-4.8.5/src/corelib/io/qprocess.cpp 2013-06-07 13:16:52.000000000 +0800 +++ qt-adsk-4.8.5/src/corelib/io/qprocess.cpp 2013-10-21 15:42:51.000000000 +0800 @@ -1681,10 +1681,10 @@ bool QProcess::waitForStarted(int msecs) { Q_D(QProcess); - if (d->processState == QProcess::Running) - return true; + if (d->processState == QProcess::Starting) + return d->waitForStarted(msecs); - return d->waitForStarted(msecs); + return d->processState == QProcess::Running; } /*! \reimp diff -rau qt-everywhere-opensource-src-4.8.5/src/corelib/io/qprocess_unix.cpp qt-adsk-4.8.5/src/corelib/io/qprocess_unix.cpp --- qt-everywhere-opensource-src-4.8.5/src/corelib/io/qprocess_unix.cpp 2013-06-07 13:16:52.000000000 +0800 +++ qt-adsk-4.8.5/src/corelib/io/qprocess_unix.cpp 2013-09-22 09:31:41.000000000 +0800 @@ -141,13 +141,6 @@ oldAction(signum); } -static inline void add_fd(int &nfds, int fd, fd_set *fdset) -{ - FD_SET(fd, fdset); - if ((fd) > nfds) - nfds = fd; -} - struct QProcessInfo { QProcess *process; int deathPipe; @@ -233,9 +226,9 @@ void QProcessManager::run() { forever { - fd_set readset; - FD_ZERO(&readset); - FD_SET(qt_qprocess_deadChild_pipe[0], &readset); + pollfd fd; + fd.fd = qt_qprocess_deadChild_pipe[0]; + fd.events = POLLIN; #if defined (QPROCESS_DEBUG) qDebug() << "QProcessManager::run() waiting for children to die"; @@ -244,8 +237,8 @@ // block forever, or until activity is detected on the dead child // pipe. the only other peers are the SIGCHLD signal handler, and the // QProcessManager destructor. - int nselect = select(qt_qprocess_deadChild_pipe[0] + 1, &readset, 0, 0, 0); - if (nselect < 0) { + int ret = qt_safe_poll(&fd, 1, -1, /* retry_eintr */ false); + if (ret < 0) { if (errno == EINTR) continue; break; @@ -1002,17 +995,6 @@ ::kill(pid_t(pid), SIGKILL); } -static int select_msecs(int nfds, fd_set *fdread, fd_set *fdwrite, int timeout) -{ - if (timeout < 0) - return qt_safe_select(nfds, fdread, fdwrite, 0, 0); - - struct timeval tv; - tv.tv_sec = timeout / 1000; - tv.tv_usec = (timeout % 1000) * 1000; - return qt_safe_select(nfds, fdread, fdwrite, 0, &tv); -} - /* Returns the difference between msecs and elapsed. If msecs is -1, however, -1 is returned. @@ -1035,10 +1017,10 @@ childStartedPipe[0]); #endif - fd_set fds; - FD_ZERO(&fds); - FD_SET(childStartedPipe[0], &fds); - if (select_msecs(childStartedPipe[0] + 1, &fds, 0, msecs) == 0) { + pollfd fd; + fd.fd = childStartedPipe[0]; + fd.events = POLLIN; + if (qt_safe_poll(&fd, 1, msecs) == 0) { processError = QProcess::Timedout; q->setErrorString(QProcess::tr("Process operation timed out")); #if defined (QPROCESS_DEBUG) @@ -1054,6 +1036,47 @@ return startedEmitted; } +class QProcessFDSet { + pollfd fds[5]; + + const size_t size() + { + return sizeof(fds)/sizeof(fds[0]); + } + +public: + QProcessFDSet(QProcessPrivate &proc) + { + for (size_t i = 0; i < size(); ++i) { + fds[i].fd = -1; + fds[i].events = POLLIN; + } + death().fd = proc.deathPipe[0]; + + if (proc.processState == QProcess::Starting) + started().fd = proc.childStartedPipe[0]; + + stdout().fd = proc.stdoutChannel.pipe[0]; + stderr().fd = proc.stderrChannel.pipe[0]; + + if (!proc.writeBuffer.isEmpty()) { + stdin().fd = proc.stdinChannel.pipe[1]; + stdin().events = POLLOUT; + } + } + + int poll(int timeout) + { + return qt_safe_poll(fds, size(), timeout); + } + + pollfd &death() { return fds[0]; } + pollfd &started() { return fds[1]; } + pollfd &stdout() { return fds[2]; } + pollfd &stderr() { return fds[3]; } + pollfd &stdin() { return fds[4]; } +}; + bool QProcessPrivate::waitForReadyRead(int msecs) { Q_Q(QProcess); @@ -1065,28 +1088,9 @@ stopWatch.start(); forever { - fd_set fdread; - fd_set fdwrite; - - FD_ZERO(&fdread); - FD_ZERO(&fdwrite); - - int nfds = deathPipe[0]; - FD_SET(deathPipe[0], &fdread); - - if (processState == QProcess::Starting) - add_fd(nfds, childStartedPipe[0], &fdread); - - if (stdoutChannel.pipe[0] != -1) - add_fd(nfds, stdoutChannel.pipe[0], &fdread); - if (stderrChannel.pipe[0] != -1) - add_fd(nfds, stderrChannel.pipe[0], &fdread); - - if (!writeBuffer.isEmpty() && stdinChannel.pipe[1] != -1) - add_fd(nfds, stdinChannel.pipe[1], &fdwrite); - + QProcessFDSet fdset(*this); int timeout = qt_timeout_value(msecs, stopWatch.elapsed()); - int ret = select_msecs(nfds + 1, &fdread, &fdwrite, timeout); + int ret = fdset.poll(timeout); if (ret < 0) { break; } @@ -1096,18 +1100,18 @@ return false; } - if (childStartedPipe[0] != -1 && FD_ISSET(childStartedPipe[0], &fdread)) { + if (qt_readable(fdset.started())) { if (!_q_startupNotification()) return false; } bool readyReadEmitted = false; - if (stdoutChannel.pipe[0] != -1 && FD_ISSET(stdoutChannel.pipe[0], &fdread)) { + if (qt_readable(fdset.stdout())) { bool canRead = _q_canReadStandardOutput(); if (processChannel == QProcess::StandardOutput && canRead) readyReadEmitted = true; } - if (stderrChannel.pipe[0] != -1 && FD_ISSET(stderrChannel.pipe[0], &fdread)) { + if (qt_readable(fdset.stderr())) { bool canRead = _q_canReadStandardError(); if (processChannel == QProcess::StandardError && canRead) readyReadEmitted = true; @@ -1115,13 +1119,13 @@ if (readyReadEmitted) return true; - if (stdinChannel.pipe[1] != -1 && FD_ISSET(stdinChannel.pipe[1], &fdwrite)) + if (qt_writable(fdset.stdin())) _q_canWrite(); - if (deathPipe[0] == -1 || FD_ISSET(deathPipe[0], &fdread)) { + if (qt_readable(fdset.death())) { if (_q_processDied()) return false; - } + } } return false; } @@ -1137,29 +1141,9 @@ stopWatch.start(); while (!writeBuffer.isEmpty()) { - fd_set fdread; - fd_set fdwrite; - - FD_ZERO(&fdread); - FD_ZERO(&fdwrite); - - int nfds = deathPipe[0]; - FD_SET(deathPipe[0], &fdread); - - if (processState == QProcess::Starting) - add_fd(nfds, childStartedPipe[0], &fdread); - - if (stdoutChannel.pipe[0] != -1) - add_fd(nfds, stdoutChannel.pipe[0], &fdread); - if (stderrChannel.pipe[0] != -1) - add_fd(nfds, stderrChannel.pipe[0], &fdread); - - - if (!writeBuffer.isEmpty() && stdinChannel.pipe[1] != -1) - add_fd(nfds, stdinChannel.pipe[1], &fdwrite); - + QProcessFDSet fdset(*this); int timeout = qt_timeout_value(msecs, stopWatch.elapsed()); - int ret = select_msecs(nfds + 1, &fdread, &fdwrite, timeout); + int ret = fdset.poll(timeout); if (ret < 0) { break; } @@ -1170,24 +1154,24 @@ return false; } - if (childStartedPipe[0] != -1 && FD_ISSET(childStartedPipe[0], &fdread)) { + if (qt_readable(fdset.started())) { if (!_q_startupNotification()) return false; } - if (stdinChannel.pipe[1] != -1 && FD_ISSET(stdinChannel.pipe[1], &fdwrite)) + if (qt_writable(fdset.stdin())) return _q_canWrite(); - if (stdoutChannel.pipe[0] != -1 && FD_ISSET(stdoutChannel.pipe[0], &fdread)) + if (qt_readable(fdset.stdout())) _q_canReadStandardOutput(); - if (stderrChannel.pipe[0] != -1 && FD_ISSET(stderrChannel.pipe[0], &fdread)) + if (qt_readable(fdset.stderr())) _q_canReadStandardError(); - if (deathPipe[0] == -1 || FD_ISSET(deathPipe[0], &fdread)) { - if (_q_processDied()) - return false; - } + if (qt_readable(fdset.death())) { + if (_q_processDied()) + return false; + } } return false; @@ -1204,29 +1188,9 @@ stopWatch.start(); forever { - fd_set fdread; - fd_set fdwrite; - int nfds = -1; - - FD_ZERO(&fdread); - FD_ZERO(&fdwrite); - - if (processState == QProcess::Starting) - add_fd(nfds, childStartedPipe[0], &fdread); - - if (stdoutChannel.pipe[0] != -1) - add_fd(nfds, stdoutChannel.pipe[0], &fdread); - if (stderrChannel.pipe[0] != -1) - add_fd(nfds, stderrChannel.pipe[0], &fdread); - - if (processState == QProcess::Running) - add_fd(nfds, deathPipe[0], &fdread); - - if (!writeBuffer.isEmpty() && stdinChannel.pipe[1] != -1) - add_fd(nfds, stdinChannel.pipe[1], &fdwrite); - + QProcessFDSet fdset(*this); int timeout = qt_timeout_value(msecs, stopWatch.elapsed()); - int ret = select_msecs(nfds + 1, &fdread, &fdwrite, timeout); + int ret = fdset.poll(timeout); if (ret < 0) { break; } @@ -1236,20 +1200,20 @@ return false; } - if (childStartedPipe[0] != -1 && FD_ISSET(childStartedPipe[0], &fdread)) { + if (qt_readable(fdset.started())) { if (!_q_startupNotification()) return false; } - if (stdinChannel.pipe[1] != -1 && FD_ISSET(stdinChannel.pipe[1], &fdwrite)) + if (qt_writable(fdset.stdin())) _q_canWrite(); - if (stdoutChannel.pipe[0] != -1 && FD_ISSET(stdoutChannel.pipe[0], &fdread)) + if (qt_readable(fdset.stdout())) _q_canReadStandardOutput(); - if (stderrChannel.pipe[0] != -1 && FD_ISSET(stderrChannel.pipe[0], &fdread)) + if (qt_readable(fdset.stderr())) _q_canReadStandardError(); - if (deathPipe[0] == -1 || FD_ISSET(deathPipe[0], &fdread)) { + if (qt_readable(fdset.death())) { if (_q_processDied()) return true; } @@ -1259,10 +1223,10 @@ bool QProcessPrivate::waitForWrite(int msecs) { - fd_set fdwrite; - FD_ZERO(&fdwrite); - FD_SET(stdinChannel.pipe[1], &fdwrite); - return select_msecs(stdinChannel.pipe[1] + 1, 0, &fdwrite, msecs < 0 ? 0 : msecs) == 1; + pollfd fd; + fd.fd = stdinChannel.pipe[1]; + fd.events = POLLIN; + return qt_safe_poll(&fd, 1, msecs); } void QProcessPrivate::findExitCode() diff -rau qt-everywhere-opensource-src-4.8.5/src/corelib/io/qurl.cpp qt-adsk-4.8.5/src/corelib/io/qurl.cpp --- qt-everywhere-opensource-src-4.8.5/src/corelib/io/qurl.cpp 2013-06-07 13:16:52.000000000 +0800 +++ qt-adsk-4.8.5/src/corelib/io/qurl.cpp 2013-09-22 09:31:41.000000000 +0800 @@ -2404,11 +2404,12 @@ int l = 1; while (l < 4 && entry->mapping[l]) ++l; - if (l > 1) { + if (l > 1 || uc > 0xffff) { if (uc <= 0xffff) str->replace(i, 1, reinterpret_cast(&entry->mapping[0]), l); else - str->replace(i-1, 2, reinterpret_cast(&entry->mapping[0]), l); + str->replace(--i, 2, reinterpret_cast(&entry->mapping[0]), l); + i += l - 1; d = 0; } else { if (!d) @@ -2437,18 +2438,20 @@ } -static void stripProhibitedOutput(QString *str, int from) +static bool containsProhibitedOuptut(const QString *str, int from) { - ushort *out = (ushort *)str->data() + from; - const ushort *in = out; + const ushort *in = reinterpret_cast(str->begin() + from); const ushort *end = (ushort *)str->data() + str->size(); - while (in < end) { + for ( ; in < end; ++in) { uint uc = *in; if (QChar(uc).isHighSurrogate() && in < end - 1) { ushort low = *(in + 1); if (QChar(low).isLowSurrogate()) { ++in; uc = QChar::surrogateToUcs4(uc, low); + } else { + // unpaired surrogates are prohibited + return true; } } if (uc <= 0xFFFF) { @@ -2473,7 +2476,7 @@ || (uc >= 0xFDD0 && uc <= 0xFDEF) || uc == 0xFEFF || (uc >= 0xFFF9 && uc <= 0xFFFF))) { - *out++ = *in; + continue; } } else { if (!((uc >= 0x1D173 && uc <= 0x1D17A) @@ -2497,14 +2500,12 @@ || (uc >= 0xFFFFE && uc <= 0xFFFFF) || (uc >= 0x100000 && uc <= 0x10FFFD) || (uc >= 0x10FFFE && uc <= 0x10FFFF))) { - *out++ = QChar::highSurrogate(uc); - *out++ = QChar::lowSurrogate(uc); + continue; } } - ++in; + return true; } - if (in != out) - str->truncate(out - str->utf16()); + return false; } static bool isBidirectionalRorAL(uint uc) @@ -2974,7 +2975,7 @@ for ( ; out < e; ++out) { register ushort uc = out->unicode(); - if (uc > 0x80) { + if (uc >= 0x80) { break; } else if (uc >= 'A' && uc <= 'Z') { *out = QChar(uc | 0x20); @@ -3011,8 +3012,8 @@ if (uc <= 0xFFFF) { *out++ = *in; } else { - *out++ = QChar::highSurrogate(uc); - *out++ = QChar::lowSurrogate(uc); + *out++ = in[-1]; + *out++ = in[0]; } } } @@ -3029,7 +3030,10 @@ firstNonAscii > from ? firstNonAscii - 1 : from); // Strip prohibited output - stripProhibitedOutput(source, firstNonAscii); + if (containsProhibitedOuptut(source, firstNonAscii)) { + source->resize(from); + return; + } // Check for valid bidirectional characters bool containsLCat = false; diff -rau qt-everywhere-opensource-src-4.8.5/src/corelib/kernel/qcoreapplication_win.cpp qt-adsk-4.8.5/src/corelib/kernel/qcoreapplication_win.cpp --- qt-everywhere-opensource-src-4.8.5/src/corelib/kernel/qcoreapplication_win.cpp 2013-06-07 13:16:52.000000000 +0800 +++ qt-adsk-4.8.5/src/corelib/kernel/qcoreapplication_win.cpp 2014-01-08 12:50:18.000000000 +0800 @@ -875,6 +875,11 @@ } break; #endif +#ifdef WM_INPUTLANGCHANGE + case WM_INPUTLANGCHANGE: + parameters = QLatin1String("Keyboard layout changed"); + break; +#endif // WM_INPUTLANGCHANGE #ifdef WM_NCACTIVATE case WM_NCACTIVATE: { diff -rau qt-everywhere-opensource-src-4.8.5/src/corelib/kernel/qcorecmdlineargs_p.h qt-adsk-4.8.5/src/corelib/kernel/qcorecmdlineargs_p.h --- qt-everywhere-opensource-src-4.8.5/src/corelib/kernel/qcorecmdlineargs_p.h 2013-06-07 13:16:52.000000000 +0800 +++ qt-adsk-4.8.5/src/corelib/kernel/qcorecmdlineargs_p.h 2013-09-22 09:31:41.000000000 +0800 @@ -103,11 +103,8 @@ } } if (*p == '\\') { // escape char? - p++; - if (*p == Char('\"') || *p == Char('\'')) - ; // yes - else - p--; // treat \ literally + if (*(p+1) == quote) + p++; } else { if (!quote && (*p == Char('\"') || *p == Char('\''))) { // " or ' quote quote = *p++; diff -rau qt-everywhere-opensource-src-4.8.5/src/corelib/kernel/qcore_mac_p.h qt-adsk-4.8.5/src/corelib/kernel/qcore_mac_p.h --- qt-everywhere-opensource-src-4.8.5/src/corelib/kernel/qcore_mac_p.h 2013-06-07 13:16:52.000000000 +0800 +++ qt-adsk-4.8.5/src/corelib/kernel/qcore_mac_p.h 2013-10-21 16:18:09.000000000 +0800 @@ -125,6 +125,7 @@ return *this; } inline T *operator&() { return &type; } + template X as() const { return reinterpret_cast(type); } static QCFType constructFromGet(const T &t) { CFRetain(t); diff -rau qt-everywhere-opensource-src-4.8.5/src/corelib/kernel/qcore_unix.cpp qt-adsk-4.8.5/src/corelib/kernel/qcore_unix.cpp --- qt-everywhere-opensource-src-4.8.5/src/corelib/kernel/qcore_unix.cpp 2013-06-07 13:16:52.000000000 +0800 +++ qt-adsk-4.8.5/src/corelib/kernel/qcore_unix.cpp 2013-09-22 09:31:41.000000000 +0800 @@ -103,4 +103,138 @@ } } +#ifndef Q_OS_VXWORKS + +int qt_safe_poll(struct pollfd *fds, int nfds, int timeout_ms, bool retry_eintr) +{ + timeval previous = qt_gettime(); + timeval deadline = previous; + deadline.tv_sec += timeout_ms / 1000; + deadline.tv_usec += (timeout_ms % 1000) * 1000; + if (deadline.tv_usec >= 1000000) { + ++deadline.tv_sec; + deadline.tv_usec -= 1000000; + } + int remaining = timeout_ms; + + // Retry on ret == 0 if the deadline has not yet passed because + // Linux can return early from the syscall, without setting EINTR. + forever { + int ret = ::poll(fds, nfds, remaining); + if (ret > 0) + return ret; + timeval now = qt_gettime(); + if ((now.tv_sec > deadline.tv_sec // past deadline + || (now.tv_sec == deadline.tv_sec + && now.tv_usec >= deadline.tv_usec)) + || (now.tv_sec < previous.tv_sec // time warp + || (now.tv_sec == previous.tv_sec + && now.tv_usec < previous.tv_usec)) + || (ret < 0 && (errno != EINTR || !retry_eintr))) // other error + return ret; + if (ret == 0 && !retry_eintr) { + errno = EINTR; + return -1; + } + remaining = (deadline.tv_sec - now.tv_sec) * 1000 + + (deadline.tv_usec - now.tv_usec) / 1000; + previous = now; + } +} + +#else + +// Poll emulation for VxWorks. + +static int mark_bad_descriptors(pollfd *fds, int nfds) +{ + fd_set r; + FD_ZERO(&r); + struct timeval tv; + tv.tv_sec = 0; + tv.tv_usec = 0; + int ret = 0; + + // Check each descriptor invidually for badness. + for (int i = 0; i < nfds; ++i) { + pollfd &fd(fds[i]); + if (fd.fd >= 0) { + FD_SET(fd.fd, &r); + int ret = qt_safe_select(fd.fd + 1, &r, NULL, NULL, &tv); + FD_CLR(fd.fd, &r); + if (ret < 0 && errno == EBADF) { + fd.revents = POLLNVAL; + ++ret; + } + } + } + Q_ASSERT(ret > 0); + return ret; +} + +int qt_safe_poll(pollfd *fds, int nfds, int timeout, bool retry_eintr) +{ + fd_set r, w; + FD_ZERO(&r); + FD_ZERO(&w); + int maxfd = -1; + + // Extract the watched descriptors. + for (int i = 0; i < nfds; ++i) { + pollfd &fd(fds[i]); + if (fd.fd >= 0 && fd.fd < FD_SETSIZE) { + if (fd.events & POLLIN) { + FD_SET(fd.fd, &r); + if (fd.fd > maxfd) + maxfd = fd.fd; + } + if (fd.events & POLLOUT) { + FD_SET(fd.fd, &w); + if (fd.fd > maxfd) + maxfd = fd.fd; + } + } + } + + // If timeout is negative, wait indefinitely for activity. + timeval tv; + timeval *ptv; + if (timeout >= 0) { + tv.tv_sec = timeout / 1000; + tv.tv_usec = (timeout % 1000) * 1000; + ptv = &tv; + } else + ptv = NULL; + + int ret; + if (retry_eintr) + ret = qt_safe_select(maxfd + 1, &r, &w, NULL, ptv); + else + ret = ::select(maxfd + 1, &r, &w, NULL, ptv); + if (ret < 0 && errno == EBADF) { + return mark_bad_descriptors(fds, nfds); + } + if (ret <= 0) + return ret; + + // Set the revents flags. + ret = 0; + for (int i = 0; i < nfds; ++i) { + pollfd &fd(fds[i]); + fd.revents = 0; + if (fd.fd >= 0 && fd.fd < FD_SETSIZE) { + if ((fd.events & POLLIN) && FD_ISSET(fd.fd, &r)) + fd.revents |= POLLIN; + if ((fd.events & POLLOUT) && FD_ISSET(fd.fd, &w)) + fd.revents |= POLLOUT; + if (fd.revents) + ++ret; + } + } + Q_ASSERT(ret > 0); + return ret; +} + +#endif + QT_END_NAMESPACE diff -rau qt-everywhere-opensource-src-4.8.5/src/corelib/kernel/qcore_unix_p.h qt-adsk-4.8.5/src/corelib/kernel/qcore_unix_p.h --- qt-everywhere-opensource-src-4.8.5/src/corelib/kernel/qcore_unix_p.h 2013-06-07 13:16:52.000000000 +0800 +++ qt-adsk-4.8.5/src/corelib/kernel/qcore_unix_p.h 2013-09-22 09:31:41.000000000 +0800 @@ -345,9 +345,42 @@ timeval qt_gettime(); // in qelapsedtimer_mac.cpp or qtimestamp_unix.cpp +// Deprecated due to FD_SETSIZE limitation, use qt_safe_poll instead. Q_CORE_EXPORT int qt_safe_select(int nfds, fd_set *fdread, fd_set *fdwrite, fd_set *fdexcept, const struct timeval *tv); +#ifndef Q_OS_VXWORKS +#include +#else + +// Poll emulation for VxWorks. + +struct pollfd { + int fd; + short events; + short revents; +}; + +#define POLLIN 1 +#define POLLOUT 2 +#define POLLERR 4 +#define POLLHUP 8 +#define POLLNVAL 16 +#endif + +inline bool qt_readable(const pollfd &fd) +{ + return fd.fd >= 0 && (fd.revents & (POLLIN | POLLHUP | POLLERR | POLLNVAL)) != 0; +} + +inline bool qt_writable(const pollfd &fd) +{ + return fd.fd >= 0 && (fd.revents & (POLLOUT | POLLHUP | POLLERR | POLLNVAL)) != 0; +} + +Q_CORE_EXPORT int qt_safe_poll(pollfd *fds, int nfds, int timeout, + bool retry_eintr = true); + // according to X/OPEN we have to define semun ourselves // we use prefix as on some systems sem.h will have it struct semid_ds; diff -rau qt-everywhere-opensource-src-4.8.5/src/corelib/kernel/qeventdispatcher_win.cpp qt-adsk-4.8.5/src/corelib/kernel/qeventdispatcher_win.cpp --- qt-everywhere-opensource-src-4.8.5/src/corelib/kernel/qeventdispatcher_win.cpp 2013-06-07 13:16:52.000000000 +0800 +++ qt-adsk-4.8.5/src/corelib/kernel/qeventdispatcher_win.cpp 2013-09-22 09:31:41.000000000 +0800 @@ -326,11 +326,7 @@ #else QSystemLibrary library(QLatin1String("winmm")); #endif - if ( -#if defined(_MSC_VER) && _MSC_VER >= 1700 // QTBUG-27266, Disable when running MSVC2012-built code on pre-Windows - QSysInfo::WindowsVersion >= QSysInfo::WV_WINDOWS8 && -#endif - library.load()) { + if (library.load()) { qtimeSetEvent = (ptimeSetEvent)library.resolve("timeSetEvent"); qtimeKillEvent = (ptimeKillEvent)library.resolve("timeKillEvent"); } @@ -509,6 +505,18 @@ return DefWindowProc(hwnd, message, wp, lp); } +static inline UINT inputTimerMask() +{ + UINT result = QS_TIMER | QS_INPUT | QS_RAWINPUT; + // QTBUG 28513, QTBUG-29097, QTBUG-29435: QS_TOUCH, QS_POINTER became part of + // QS_INPUT in Windows Kit 8. They should not be used when running on pre-Windows 8. +#if defined(_MSC_VER) && _MSC_VER >= 1700 + if (QSysInfo::WindowsVersion < QSysInfo::WV_WINDOWS8) + result &= ~(QS_TOUCH | QS_POINTER); +#endif // _MSC_VER >= 1700 + return result; +} + LRESULT QT_WIN_CALLBACK qt_GetMessageHook(int code, WPARAM wp, LPARAM lp) { if (wp == PM_REMOVE) { @@ -518,7 +526,8 @@ MSG *msg = (MSG *) lp; QEventDispatcherWin32Private *d = q->d_func(); int localSerialNumber = d->serialNumber; - if (HIWORD(GetQueueStatus(QS_TIMER | QS_INPUT | QS_RAWINPUT)) == 0) { + static const UINT mask = inputTimerMask(); + if (HIWORD(GetQueueStatus(mask)) == 0) { // no more input or timer events in the message queue, we can allow posted events to be sent normally now if (d->sendPostedEventsWindowsTimerId != 0) { // stop the timer to send posted events, since we now allow the WM_QT_SENDPOSTEDEVENTS message diff -rau qt-everywhere-opensource-src-4.8.5/src/corelib/kernel/qobject.cpp qt-adsk-4.8.5/src/corelib/kernel/qobject.cpp --- qt-everywhere-opensource-src-4.8.5/src/corelib/kernel/qobject.cpp 2013-06-07 13:16:52.000000000 +0800 +++ qt-adsk-4.8.5/src/corelib/kernel/qobject.cpp 2013-09-22 09:31:41.000000000 +0800 @@ -130,6 +130,11 @@ QObjectData::~QObjectData() {} +//ADSK: hash of names to objects which have names. Object objects with +// names are added to the hash + +QMultiHash *QObjectPrivate::namedObjects = 0; + QObjectPrivate::QObjectPrivate(int version) : threadData(0), connectionLists(0), senders(0), currentSender(0), currentChildBeingDeleted(0) { @@ -427,7 +432,8 @@ more = true; } if (!more) - QObjectPrivate::get(*ptr)->hasGuards = false; + if (QObjectPrivate::get(*ptr)) + QObjectPrivate::get(*ptr)->hasGuards = false; } /*!\internal @@ -457,7 +463,8 @@ more = true; } if (!more) - QObjectPrivate::get(*ptr)->hasGuards = false; + if (QObjectPrivate::get(*ptr)) + QObjectPrivate::get(*ptr)->hasGuards = false; } *ptr = o; } @@ -837,6 +844,10 @@ delete d->sharedRefcount; } + //ADSK: keep hash up to date + if (QObjectPrivate::namedObjects) { + QObjectPrivate::namedObjects->remove(d->objectName, this); + } if (d->isSignalConnected(0)) { QT_TRY { @@ -1072,6 +1083,12 @@ Q_D(QObject); bool objectNameChanged = d->declarativeData && d->objectName != name; + //ADSK: update hash table + if (QObjectPrivate::namedObjects) { + QObjectPrivate::namedObjects->remove(d->objectName, this); + QObjectPrivate::namedObjects->insert(name, this); + } + d->objectName = name; if (objectNameChanged) diff -rau qt-everywhere-opensource-src-4.8.5/src/corelib/kernel/qobjectdefs.h qt-adsk-4.8.5/src/corelib/kernel/qobjectdefs.h --- qt-everywhere-opensource-src-4.8.5/src/corelib/kernel/qobjectdefs.h 2013-06-07 13:16:52.000000000 +0800 +++ qt-adsk-4.8.5/src/corelib/kernel/qobjectdefs.h 2013-09-22 09:31:41.000000000 +0800 @@ -138,7 +138,7 @@ /* tmake ignore Q_OBJECT */ #define Q_OBJECT_CHECK \ template inline void qt_check_for_QOBJECT_macro(const T &_q_argument) const \ - { int i = qYouForgotTheQ_OBJECT_Macro(this, &_q_argument); i = i; } + { int i = qYouForgotTheQ_OBJECT_Macro(this, &_q_argument); i = i + 1; } template inline int qYouForgotTheQ_OBJECT_Macro(T, T) { return 0; } diff -rau qt-everywhere-opensource-src-4.8.5/src/corelib/kernel/qobject_p.h qt-adsk-4.8.5/src/corelib/kernel/qobject_p.h --- qt-everywhere-opensource-src-4.8.5/src/corelib/kernel/qobject_p.h 2013-06-07 13:16:52.000000000 +0800 +++ qt-adsk-4.8.5/src/corelib/kernel/qobject_p.h 2013-09-22 09:31:41.000000000 +0800 @@ -220,6 +220,7 @@ #ifdef QT_JAMBI_BUILD int *deleteWatch; #endif + static QMultiHash *namedObjects; }; diff -rau qt-everywhere-opensource-src-4.8.5/src/corelib/thread/qthread_unix.cpp qt-adsk-4.8.5/src/corelib/thread/qthread_unix.cpp --- qt-everywhere-opensource-src-4.8.5/src/corelib/thread/qthread_unix.cpp 2013-06-07 13:16:52.000000000 +0800 +++ qt-adsk-4.8.5/src/corelib/thread/qthread_unix.cpp 2013-09-22 09:31:41.000000000 +0800 @@ -171,6 +171,12 @@ { pthread_once(¤t_thread_data_once, create_current_thread_data_key); pthread_key_delete(current_thread_data_key); + + // Reset current_thread_data_once in case we end up recreating + // the thread-data in the rare case of QObject construction + // after destroying the QThreadData. + pthread_once_t pthread_once_init = PTHREAD_ONCE_INIT; + current_thread_data_once = pthread_once_init; } Q_DESTRUCTOR_FUNCTION(destroy_current_thread_data_key) diff -rau qt-everywhere-opensource-src-4.8.5/src/corelib/tools/qalgorithms.h qt-adsk-4.8.5/src/corelib/tools/qalgorithms.h --- qt-everywhere-opensource-src-4.8.5/src/corelib/tools/qalgorithms.h 2013-06-07 13:16:52.000000000 +0800 +++ qt-adsk-4.8.5/src/corelib/tools/qalgorithms.h 2013-09-22 09:31:41.000000000 +0800 @@ -337,8 +337,15 @@ namespace QAlgorithmsPrivate { template +#ifndef QT_NO_STL +Q_OUTOFLINE_TEMPLATE void qSortHelper(RandomAccessIterator start, RandomAccessIterator end, const T & , LessThan lessThan) +#else Q_OUTOFLINE_TEMPLATE void qSortHelper(RandomAccessIterator start, RandomAccessIterator end, const T &t, LessThan lessThan) +#endif { +#ifndef QT_NO_STL + std::sort(start, end, lessThan); +#else top: int span = int(end - start); if (span < 2) @@ -387,6 +394,7 @@ start = low + 1; ++end; goto top; +#endif } template @@ -447,8 +455,15 @@ } template +#ifndef QT_NO_STL +Q_OUTOFLINE_TEMPLATE void qStableSortHelper(RandomAccessIterator begin, RandomAccessIterator end, const T & , LessThan lessThan) +#else Q_OUTOFLINE_TEMPLATE void qStableSortHelper(RandomAccessIterator begin, RandomAccessIterator end, const T &t, LessThan lessThan) +#endif { +#ifndef QT_NO_STL + std::stable_sort(begin, end, lessThan); +#else const int span = end - begin; if (span < 2) return; @@ -457,6 +472,7 @@ qStableSortHelper(begin, middle, t, lessThan); qStableSortHelper(middle, end, t, lessThan); qMerge(begin, middle, end, t, lessThan); +#endif } template diff -rau qt-everywhere-opensource-src-4.8.5/src/corelib/tools/qbytearray.h qt-adsk-4.8.5/src/corelib/tools/qbytearray.h --- qt-everywhere-opensource-src-4.8.5/src/corelib/tools/qbytearray.h 2013-06-07 13:16:52.000000000 +0800 +++ qt-adsk-4.8.5/src/corelib/tools/qbytearray.h 2013-09-22 09:31:41.000000000 +0800 @@ -39,6 +39,11 @@ ** ****************************************************************************/ + +// Autodesk modified names of parameters to avoid defined name conflicts +// aSize => asize +// aPos => apos + #ifndef QBYTEARRAY_H #define QBYTEARRAY_H @@ -439,8 +444,8 @@ inline QByteArray::QByteArray(const QByteArray &a) : d(a.d) { d->ref.ref(); } #ifdef QT3_SUPPORT -inline QByteArray::QByteArray(int aSize) : d(&shared_null) -{ d->ref.ref(); if (aSize > 0) fill('\0', aSize); } +inline QByteArray::QByteArray(int asize) : d(&shared_null) +{ d->ref.ref(); if (asize > 0) fill('\0', asize); } #endif inline int QByteArray::capacity() const diff -rau qt-everywhere-opensource-src-4.8.5/src/corelib/tools/qchar.cpp qt-adsk-4.8.5/src/corelib/tools/qchar.cpp --- qt-everywhere-opensource-src-4.8.5/src/corelib/tools/qchar.cpp 2013-06-07 13:16:52.000000000 +0800 +++ qt-adsk-4.8.5/src/corelib/tools/qchar.cpp 2013-09-22 09:31:41.000000000 +0800 @@ -1550,8 +1550,8 @@ return; // the loop can partly ignore high Unicode as all ligatures are in the BMP - int starter = 0; - int lastCombining = 0; + int starter = -2; // to prevent starter == pos -1 + int lastCombining = 255; // to prevent combining > lastCombining int pos = from; while (pos < s.length()) { uint uc = s.at(pos).unicode(); @@ -1570,8 +1570,7 @@ continue; } int combining = p->combiningClass; - if (starter == pos - 1 || combining > lastCombining) { - Q_ASSERT(starter >= from); + if ((starter == pos - 1 || combining > lastCombining) && starter >= from) { // allowed to form ligature with S QChar ligature = ligatureHelper(s.at(starter).unicode(), uc); if (ligature.unicode()) { diff -rau qt-everywhere-opensource-src-4.8.5/src/corelib/tools/qlist.h qt-adsk-4.8.5/src/corelib/tools/qlist.h --- qt-everywhere-opensource-src-4.8.5/src/corelib/tools/qlist.h 2013-06-07 13:16:52.000000000 +0800 +++ qt-adsk-4.8.5/src/corelib/tools/qlist.h 2013-09-22 09:31:41.000000000 +0800 @@ -369,8 +369,15 @@ template Q_INLINE_TEMPLATE void QList::node_construct(Node *n, const T &t) { - if (QTypeInfo::isLarge || QTypeInfo::isStatic) n->v = new T(t); - else if (QTypeInfo::isComplex) new (n) T(t); + if (QTypeInfo::isLarge || QTypeInfo::isStatic) + { + void *memory = qMallocAligned(sizeof(T), 16); + n->v = new (memory) T(t); + } + else if (QTypeInfo::isComplex) + { + new (n) T(t); + } #if (defined(__GNUC__) || defined(__INTEL_COMPILER) || defined(__IBMCPP__)) && !defined(__OPTIMIZE__) // This violates pointer aliasing rules, but it is known to be safe (and silent) // in unoptimized GCC builds (-fno-strict-aliasing). The other compilers which @@ -385,8 +392,12 @@ template Q_INLINE_TEMPLATE void QList::node_destruct(Node *n) { - if (QTypeInfo::isLarge || QTypeInfo::isStatic) delete reinterpret_cast(n->v); - else if (QTypeInfo::isComplex) reinterpret_cast(n)->~T(); + if (QTypeInfo::isLarge || QTypeInfo::isStatic) + { + reinterpret_cast(n->v)->~T(); + qFreeAligned(n->v); + } + else if (QTypeInfo::isComplex) reinterpret_cast(n)->~T(); } template @@ -395,14 +406,22 @@ Node *current = from; if (QTypeInfo::isLarge || QTypeInfo::isStatic) { QT_TRY { - while(current != to) { - current->v = new T(*reinterpret_cast(src->v)); + while(current != to) + { + void *memory = qMallocAligned(sizeof(T), 16); + + current->v = new (memory) T(*reinterpret_cast(src->v)); + ++current; ++src; } } QT_CATCH(...) { while (current-- != from) - delete reinterpret_cast(current->v); + { + reinterpret_cast(current->v)->~T(); + qFreeAligned(current->v); + } + QT_RETHROW; } @@ -428,7 +447,14 @@ Q_INLINE_TEMPLATE void QList::node_destruct(Node *from, Node *to) { if (QTypeInfo::isLarge || QTypeInfo::isStatic) - while(from != to) --to, delete reinterpret_cast(to->v); + { + while(from != to) + { + --to; + reinterpret_cast(to->v)->~T(); + qFreeAligned(to->v); + } + } else if (QTypeInfo::isComplex) while (from != to) --to, reinterpret_cast(to)->~T(); } diff -rau qt-everywhere-opensource-src-4.8.5/src/corelib/tools/qlocale_mac.mm qt-adsk-4.8.5/src/corelib/tools/qlocale_mac.mm --- qt-everywhere-opensource-src-4.8.5/src/corelib/tools/qlocale_mac.mm 2013-06-07 13:16:52.000000000 +0800 +++ qt-adsk-4.8.5/src/corelib/tools/qlocale_mac.mm 2013-10-21 16:19:48.000000000 +0800 @@ -436,18 +436,29 @@ case CurrencyToString: return macFormatCurrency(in.value()); case UILanguages: { - QCFType languages = (CFArrayRef)CFPreferencesCopyValue( + QCFType languages = (CFArrayRef)CFPreferencesCopyValue( CFSTR("AppleLanguages"), kCFPreferencesAnyApplication, kCFPreferencesCurrentUser, kCFPreferencesAnyHost); - const int cnt = languages == NULL ? 0 : CFArrayGetCount(languages); QStringList result; - result.reserve(cnt); - for (int i = 0; i < cnt; ++i) { - const QString lang = QCFString::toQString( - static_cast(CFArrayGetValueAtIndex(languages, i))); - result.append(lang); + if (!languages) + return QVariant(result); + + CFTypeID typeId = CFGetTypeID(languages); + if (typeId == CFArrayGetTypeID()) { + const int cnt = CFArrayGetCount(languages.as()); + result.reserve(cnt); + for (int i = 0; i < cnt; ++i) { + const QString lang = QCFString::toQString( + static_cast(CFArrayGetValueAtIndex(languages.as(), i))); + result.append(lang); + } + } else if (typeId == CFStringGetTypeID()) { + result = QStringList(QCFString::toQString(languages.as())); + } else { + qWarning("QLocale::uiLanguages(): CFPreferencesCopyValue returned unhandled type \"%s\"; please report to http://bugreports.qt-project.org", + qPrintable(QCFString::toQString(CFCopyTypeIDDescription(typeId)))); } return QVariant(result); } diff -rau qt-everywhere-opensource-src-4.8.5/src/corelib/tools/qstring.h qt-adsk-4.8.5/src/corelib/tools/qstring.h --- qt-everywhere-opensource-src-4.8.5/src/corelib/tools/qstring.h 2013-06-07 13:16:52.000000000 +0800 +++ qt-adsk-4.8.5/src/corelib/tools/qstring.h 2013-09-22 09:31:41.000000000 +0800 @@ -39,6 +39,11 @@ ** ****************************************************************************/ + +// Autodesk modified names of parameters to avoid defined name conflicts +// aSize => asize +// aPos => apos + #ifndef QSTRING_H #define QSTRING_H @@ -563,8 +568,8 @@ inline QT3_SUPPORT QString upper() const { return toUpper(); } inline QT3_SUPPORT QString stripWhiteSpace() const { return trimmed(); } inline QT3_SUPPORT QString simplifyWhiteSpace() const { return simplified(); } - inline QT3_SUPPORT QString &setUnicodeCodes(const ushort *unicode_as_ushorts, int aSize) - { return setUtf16(unicode_as_ushorts, aSize); } + inline QT3_SUPPORT QString &setUnicodeCodes(const ushort *unicode_as_ushorts, int asize) + { return setUtf16(unicode_as_ushorts, asize); } inline QT3_SUPPORT const ushort *ucs2() const { return utf16(); } inline static QT3_SUPPORT QString fromUcs2(const ushort *unicode, int size = -1) { return fromUtf16(unicode, size); } @@ -1085,8 +1090,8 @@ class QConstString : public QString { public: - inline QT3_SUPPORT_CONSTRUCTOR QConstString(const QChar *aUnicode, int aSize) - :QString(aUnicode, aSize){} // cannot use fromRawData() due to changed semantics + inline QT3_SUPPORT_CONSTRUCTOR QConstString(const QChar *aUnicode, int asize) + :QString(aUnicode, asize){} // cannot use fromRawData() due to changed semantics inline QT3_SUPPORT const QString &string() const { return *this; } }; #endif @@ -1193,8 +1198,8 @@ inline QStringRef &QStringRef::operator=(const QString *aString) { m_string = aString; m_position = 0; m_size = aString?aString->size():0; return *this; } -inline QStringRef::QStringRef(const QString *aString, int aPosition, int aSize) - :m_string(aString), m_position(aPosition), m_size(aSize){} +inline QStringRef::QStringRef(const QString *aString, int aposition, int asize) + :m_string(aString), m_position(aposition), m_size(asize){} inline QStringRef::QStringRef(const QString *aString) :m_string(aString), m_position(0), m_size(aString?aString->size() : 0){} diff -rau qt-everywhere-opensource-src-4.8.5/src/declarative/qml/qdeclarativeengine_p.h qt-adsk-4.8.5/src/declarative/qml/qdeclarativeengine_p.h --- qt-everywhere-opensource-src-4.8.5/src/declarative/qml/qdeclarativeengine_p.h 2013-06-07 13:16:58.000000000 +0800 +++ qt-adsk-4.8.5/src/declarative/qml/qdeclarativeengine_p.h 2013-09-22 09:31:41.000000000 +0800 @@ -311,7 +311,7 @@ static QScriptValue formatTime(QScriptContext*, QScriptEngine*); static QScriptValue formatDateTime(QScriptContext*, QScriptEngine*); #endif - static QScriptEngine *getScriptEngine(QDeclarativeEngine *e) { return &e->d_func()->scriptEngine; } + static QScriptEngine *getScriptEngine(QDeclarativeEngine *e) { if (!e) return 0; return &e->d_func()->scriptEngine; } static QDeclarativeEngine *getEngine(QScriptEngine *e) { return static_cast(e)->p->q_func(); } static QDeclarativeEnginePrivate *get(QDeclarativeEngine *e) { return e->d_func(); } static QDeclarativeEnginePrivate *get(QDeclarativeContext *c) { return (c && c->engine()) ? QDeclarativeEnginePrivate::get(c->engine()) : 0; } diff -rau qt-everywhere-opensource-src-4.8.5/src/declarative/qml/qdeclarativeprivate.h qt-adsk-4.8.5/src/declarative/qml/qdeclarativeprivate.h --- qt-everywhere-opensource-src-4.8.5/src/declarative/qml/qdeclarativeprivate.h 2013-06-07 13:16:58.000000000 +0800 +++ qt-adsk-4.8.5/src/declarative/qml/qdeclarativeprivate.h 2013-09-22 09:31:41.000000000 +0800 @@ -239,7 +239,7 @@ }; struct RegisterComponent { - const QUrl &url; + QUrl url; const char *uri; const char *typeName; int majorVersion; diff -rau qt-everywhere-opensource-src-4.8.5/src/gui/dialogs/qcolordialog.cpp qt-adsk-4.8.5/src/gui/dialogs/qcolordialog.cpp --- qt-everywhere-opensource-src-4.8.5/src/gui/dialogs/qcolordialog.cpp 2013-06-07 13:16:59.000000000 +0800 +++ qt-adsk-4.8.5/src/gui/dialogs/qcolordialog.cpp 2013-09-22 09:31:41.000000000 +0800 @@ -1902,6 +1902,7 @@ } else { if (d->delegate) { d->closeCocoaColorPanel(); + QColorDialogPrivate::sharedColorPanelAvailable = true; setAttribute(Qt::WA_DontShowOnScreen, false); } } diff -rau qt-everywhere-opensource-src-4.8.5/src/gui/dialogs/qcolordialog_mac.mm qt-adsk-4.8.5/src/gui/dialogs/qcolordialog_mac.mm --- qt-everywhere-opensource-src-4.8.5/src/gui/dialogs/qcolordialog_mac.mm 2013-06-07 13:16:59.000000000 +0800 +++ qt-adsk-4.8.5/src/gui/dialogs/qcolordialog_mac.mm 2013-10-21 15:32:21.000000000 +0800 @@ -120,6 +120,11 @@ mDialogIsExecuting = false; mResultSet = false; +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7 + if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_7) + [mColorPanel setRestorable:NO]; +#endif + if (mHackedPanel) { [self relayout]; diff -rau qt-everywhere-opensource-src-4.8.5/src/gui/dialogs/qfiledialog.cpp qt-adsk-4.8.5/src/gui/dialogs/qfiledialog.cpp --- qt-everywhere-opensource-src-4.8.5/src/gui/dialogs/qfiledialog.cpp 2013-06-07 13:16:59.000000000 +0800 +++ qt-adsk-4.8.5/src/gui/dialogs/qfiledialog.cpp 2013-09-22 09:31:41.000000000 +0800 @@ -58,6 +58,8 @@ #include #include #include +#include "qmimedata.h" +#include "qclipboard.h" #if !defined(Q_WS_WINCE) && !defined(Q_OS_SYMBIAN) #include "ui_qfiledialog.h" #else @@ -309,6 +311,25 @@ #endif QT_END_INCLUDE_NAMESPACE +const char *qt_file_dialog_wildcard_symbols = + "[\\?\\*]"; + +//const char *qt_file_dialog_filter_reg_exp = +// "^([^()]*)\\(([a-zA-Z0-9_.*? +;#\\-\\[\\]@\\{\\}/!<>\\$%&=^~:\\|]*)\\)$"; +const char *qt_file_dialog_filter_reg_exp = +"^(.*)\\(([a-zA-Z0-9_.*? +;#\\-\\[\\]@\\{\\}/!<>\\$%&=^~:\\|]*)\\)$"; + +// Makes a list of filters from a normal filter string "Image Files (*.png *.jpg)" +QStringList qt_clean_filter_list(const QString &filter) +{ + QRegExp regexp(QString::fromLatin1(qt_file_dialog_filter_reg_exp)); + QString f = filter; + int i = regexp.indexIn(f); + if (i >= 0) + f = regexp.cap(2); + return f.split(QLatin1Char(' '), QString::SkipEmptyParts); +} + /*! \fn QFileDialog::QFileDialog(QWidget *parent, Qt::WindowFlags flags) @@ -400,9 +421,6 @@ static const qint32 QFileDialogMagic = 0xbe; -const char *qt_file_dialog_filter_reg_exp = -"^(.*)\\(([a-zA-Z0-9_.*? +;#\\-\\[\\]@\\{\\}/!<>\\$%&=^~:\\|]*)\\)$"; - /*! \since 4.3 Saves the state of the dialog's layout, history and current directory. @@ -582,6 +600,8 @@ } /* MENU ACTIONS */ + copyAction->setText(QFileDialog::tr("&Copy")); + pasteAction->setText(QFileDialog::tr("&Paste")); renameAction->setText(QFileDialog::tr("&Rename")); deleteAction->setText(QFileDialog::tr("&Delete")); showHiddenAction->setText(QFileDialog::tr("Show &hidden files")); @@ -677,6 +697,8 @@ bool ro = (options & ReadOnly); d->model->setReadOnly(ro); d->qFileDialogUi->newFolderButton->setEnabled(!ro); + d->copyAction->setEnabled(!ro); + d->pasteAction->setEnabled(!ro); d->renameAction->setEnabled(!ro); d->deleteAction->setEnabled(!ro); } @@ -965,22 +987,33 @@ QStringList files; for (int i=0; iqFileDialogUi->fileNameEdit->blockSignals(block); return; } + + QRegExp wildcardRegExp(QString::fromLatin1(qt_file_dialog_wildcard_symbols)); + if (lineEditText.contains(wildcardRegExp)) + { + QRegExp re(lineEditText, Qt::CaseInsensitive, QRegExp::Wildcard); + if (re.isValid()) + { + QStringList newNameFilters = qt_clean_filter_list(lineEditText); + d->model->setNameFilters(newNameFilters); + return; + } + } switch (d->fileMode) { case DirectoryOnly: @@ -2577,7 +2622,17 @@ QObject::connect(goToParent, SIGNAL(triggered()), q, SLOT(_q_navigateToParent())); q->addAction(goToParent); - renameAction = new QAction(q); + copyAction = new QAction(q); + copyAction->setEnabled(false); + copyAction->setObjectName(QLatin1String("qt_copy_action")); + QObject::connect(copyAction, SIGNAL(triggered()), q, SLOT(_q_copyCurrent())); + + pasteAction = new QAction(q); + pasteAction->setEnabled(false); + pasteAction->setObjectName(QLatin1String("qt_paste_action")); + QObject::connect(pasteAction, SIGNAL(triggered()), q, SLOT(_q_pasteFromClipboard())); + + renameAction = new QAction(q); renameAction->setEnabled(false); renameAction->setObjectName(QLatin1String("qt_rename_action")); QObject::connect(renameAction, SIGNAL(triggered()), q, SLOT(_q_renameCurrent())); @@ -2753,12 +2808,23 @@ if (index.isValid()) { // file context menu QFile::Permissions p(index.parent().data(QFileSystemModel::FilePermissions).toInt()); + copyAction->setEnabled(p & QFile::ReadUser); + menu.addAction(copyAction); renameAction->setEnabled(p & QFile::WriteUser); menu.addAction(renameAction); deleteAction->setEnabled(p & QFile::WriteUser); menu.addAction(deleteAction); menu.addSeparator(); } + + QClipboard * clipboard = QApplication::clipboard(); + const QMimeData *mimeData = clipboard->mimeData(); + if (mimeData && mimeData->hasUrls()) + { + pasteAction->setEnabled(true); + menu.addAction(pasteAction); + } + menu.addAction(showHiddenAction); if (qFileDialogUi->newFolderButton->isVisible()) { newFolderAction->setEnabled(qFileDialogUi->newFolderButton->isEnabled()); @@ -2771,6 +2837,52 @@ /*! \internal */ + +void QFileDialogPrivate::_q_copyCurrent() +{ + QModelIndex index = qFileDialogUi->listView->currentIndex(); + + QModelIndexList indexList; + indexList << index; + + QClipboard * clipboard = QApplication::clipboard(); + clipboard->setMimeData(model->mimeData(indexList)); +} + +void QFileDialogPrivate::_q_pasteFromClipboard() +{ + QClipboard * clipboard = QApplication::clipboard(); + const QMimeData *mimeData = clipboard->mimeData(); + + if (mimeData && mimeData->hasUrls()) + { + QDir currentDir = model->rootDirectory(); + + QUrl url; + QList urlList = mimeData->urls(); + foreach (url, urlList) + { + QFileInfo toCopyInfo(url.toLocalFile()); + if (toCopyInfo.isFile() && toCopyInfo.isReadable()) + { + int i = 1; + QString fileName = toCopyInfo.fileName(); + QFileInfo toPasteInfo(currentDir, fileName); + while (toPasteInfo.exists()) + { + QString generatedName(toCopyInfo.baseName() + QLatin1String("_") + QString::number(i) + + QLatin1String(".") + toCopyInfo.completeSuffix()); + + toPasteInfo.setFile(currentDir, generatedName); + i++; + } + + QFile::copy(toCopyInfo.absoluteFilePath(), toPasteInfo.absoluteFilePath()); + } + } + } +} + void QFileDialogPrivate::_q_renameCurrent() { Q_Q(QFileDialog); @@ -3045,17 +3157,6 @@ } } -// Makes a list of filters from a normal filter string "Image Files (*.png *.jpg)" -QStringList qt_clean_filter_list(const QString &filter) -{ - QRegExp regexp(QString::fromLatin1(qt_file_dialog_filter_reg_exp)); - QString f = filter; - int i = regexp.indexIn(f); - if (i >= 0) - f = regexp.cap(2); - return f.split(QLatin1Char(' '), QString::SkipEmptyParts); -} - /*! \internal diff -rau qt-everywhere-opensource-src-4.8.5/src/gui/dialogs/qfiledialog.h qt-adsk-4.8.5/src/gui/dialogs/qfiledialog.h --- qt-everywhere-opensource-src-4.8.5/src/gui/dialogs/qfiledialog.h 2013-06-07 13:16:59.000000000 +0800 +++ qt-adsk-4.8.5/src/gui/dialogs/qfiledialog.h 2013-09-22 09:31:41.000000000 +0800 @@ -296,6 +296,8 @@ Q_PRIVATE_SLOT(d_func(), void _q_showListView()) Q_PRIVATE_SLOT(d_func(), void _q_showDetailsView()) Q_PRIVATE_SLOT(d_func(), void _q_showContextMenu(const QPoint &)) + Q_PRIVATE_SLOT(d_func(), void _q_copyCurrent()) + Q_PRIVATE_SLOT(d_func(), void _q_pasteFromClipboard()) Q_PRIVATE_SLOT(d_func(), void _q_renameCurrent()) Q_PRIVATE_SLOT(d_func(), void _q_deleteCurrent()) Q_PRIVATE_SLOT(d_func(), void _q_showHidden()) diff -rau qt-everywhere-opensource-src-4.8.5/src/gui/dialogs/qfiledialog_mac.mm qt-adsk-4.8.5/src/gui/dialogs/qfiledialog_mac.mm --- qt-everywhere-opensource-src-4.8.5/src/gui/dialogs/qfiledialog_mac.mm 2013-06-07 13:16:59.000000000 +0800 +++ qt-adsk-4.8.5/src/gui/dialogs/qfiledialog_mac.mm 2013-09-22 09:31:41.000000000 +0800 @@ -170,7 +170,7 @@ mSelectedNameFilter = new QStringList([self findStrippedFilterWithVisualFilterName:selectedVisualNameFilter]); QFileInfo sel(selectFile); - if (sel.isDir()){ + if (sel.isDir() && !sel.isBundle()){ mCurrentDir = [qt_mac_QStringToNSString(sel.absoluteFilePath()) retain]; mCurrentSelection = new QString; } else { diff -rau qt-everywhere-opensource-src-4.8.5/src/gui/dialogs/qfiledialog_p.h qt-adsk-4.8.5/src/gui/dialogs/qfiledialog_p.h --- qt-everywhere-opensource-src-4.8.5/src/gui/dialogs/qfiledialog_p.h 2013-06-07 13:16:59.000000000 +0800 +++ qt-adsk-4.8.5/src/gui/dialogs/qfiledialog_p.h 2013-09-22 09:31:41.000000000 +0800 @@ -210,6 +210,8 @@ void _q_showListView(); void _q_showDetailsView(); void _q_showContextMenu(const QPoint &position); + void _q_copyCurrent(); + void _q_pasteFromClipboard(); void _q_renameCurrent(); void _q_deleteCurrent(); void _q_showHidden(); @@ -247,6 +249,8 @@ QStringList currentHistory; int currentHistoryLocation; + QAction *copyAction; + QAction *pasteAction; QAction *renameAction; QAction *deleteAction; QAction *showHiddenAction; diff -rau qt-everywhere-opensource-src-4.8.5/src/gui/dialogs/qfontdialog_mac.mm qt-adsk-4.8.5/src/gui/dialogs/qfontdialog_mac.mm --- qt-everywhere-opensource-src-4.8.5/src/gui/dialogs/qfontdialog_mac.mm 2013-06-07 13:16:59.000000000 +0800 +++ qt-adsk-4.8.5/src/gui/dialogs/qfontdialog_mac.mm 2013-10-21 15:27:34.000000000 +0800 @@ -176,6 +176,11 @@ mReturnCode = -1; mAppModal = false; +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7 + if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_7) + [mFontPanel setRestorable:NO]; +#endif + if (mPanelHackedWithButtons) { [self relayout]; diff -rau qt-everywhere-opensource-src-4.8.5/src/gui/image/qicon.cpp qt-adsk-4.8.5/src/gui/image/qicon.cpp --- qt-everywhere-opensource-src-4.8.5/src/gui/image/qicon.cpp 2013-06-07 13:16:59.000000000 +0800 +++ qt-adsk-4.8.5/src/gui/image/qicon.cpp 2013-09-22 09:31:41.000000000 +0800 @@ -115,6 +115,35 @@ qtIconCache()->clear(); } +/*! \internal + + Returns the effective device pixel ratio. + New public API should set a QWindow pointer, and will get the + the devicePixelRatio for that window. + + Old API won't have a window pointer and qApp->devicePixelRatio() + will be used, if Qt::AA_UseHighDpiPixmaps is set to prevent + breaking old code. +*/ +static qreal qt_effective_device_pixel_ratio() +{ + bool enableHighdpi = !qgetenv("QT_HIGHDPI_AWARE").isEmpty(); + static bool hasWarned = false; + if (!hasWarned && enableHighdpi) { + qWarning("QT_HIGHDPI_AWARE is deprecated, use qApp->setAttribute(Qt::AA_UseHighDpiPixmaps) instead."); + hasWarned = true; + } + +#ifdef Q_WS_MAC + if (enableHighdpi || qApp->testAttribute(Qt::AA_UseHighDpiPixmaps)) { + extern CGFloat qt_mac_get_scalefactor(QWidget *); + return qt_mac_get_scalefactor(0); + } +#endif + + return qreal(1.0); +} + QIconPrivate::QIconPrivate() : engine(0), ref(1), serialNum(serialNumCounter.fetchAndAddRelaxed(1)), @@ -139,11 +168,8 @@ void QPixmapIconEngine::paint(QPainter *painter, const QRect &rect, QIcon::Mode mode, QIcon::State state) { - QSize pixmapSize = rect.size(); -#if defined(Q_WS_MAC) - pixmapSize *= qt_mac_get_scalefactor(); -#endif - painter->drawPixmap(rect, pixmap(pixmapSize, mode, state)); + QSize targetRectSize = rect.size(); + painter->drawPixmap(rect, pixmap(targetRectSize, mode, state)); } static inline int area(const QSize &s) { return s.width() * s.height(); } @@ -238,9 +264,14 @@ return pe; } -QPixmap QPixmapIconEngine::pixmap(const QSize &size, QIcon::Mode mode, QIcon::State state) +QPixmap QPixmapIconEngine::pixmap(const QSize &inSize, QIcon::Mode mode, QIcon::State state) { QPixmap pm; + QSize size = inSize; +#ifdef Q_WS_MAC + size *= qt_effective_device_pixel_ratio(); +#endif + QPixmapIconEngineEntry *pe = bestMatch(size, mode, state, false); if (pe) pm = pe->pixmap; @@ -294,11 +325,20 @@ } QPixmapCache::insert(key % HexString(mode), pm); } + +#ifdef Q_WS_MAC + if (qt_effective_device_pixel_ratio() > 1 && pm.size().width() > inSize.width()) // detect high-dpi pixmap + pm.setDevicePixelRatio(qMax(qreal(1.0), qreal(pm.size().width()) / qreal(inSize.width()))); +#endif return pm; } -QSize QPixmapIconEngine::actualSize(const QSize &size, QIcon::Mode mode, QIcon::State state) +QSize QPixmapIconEngine::actualSize(const QSize &inSize, QIcon::Mode mode, QIcon::State state) { + QSize size = inSize; +#ifdef Q_WS_MAC + size *= qt_effective_device_pixel_ratio(); +#endif QSize actualSize; if (QPixmapIconEngineEntry *pe = bestMatch(size, mode, state, true)) actualSize = pe->size; @@ -343,6 +383,9 @@ } if (pe->size == QSize() && pe->pixmap.isNull()) { pe->pixmap = QPixmap(pe->fileName); + // Reset the devicePixelRatio. The pixmap may be loaded from a @2x file, + // but be used as a 1x pixmap by QIcon. + pe->pixmap.setDevicePixelRatio(1.0); pe->size = pe->pixmap.size(); } if(pe->size == size) { @@ -672,16 +715,23 @@ /*! Returns a pixmap with the requested \a size, \a mode, and \a - state, generating one if necessary. The pixmap might be smaller than - requested, but never larger. + state, generating one if necessary. + + This function has two modes. By default, the returned pixmap might + be smaller than requested, but never larger. Setting the Qt::AA_UseHighDpiPixmaps + application attributes enables support for high-dpi pixmaps and this function + may then return pixmaps that are larger than the requested size, + with a corresponding dpi scale factor. - \sa actualSize(), paint() + \sa actualSize(), paint(), QPixmap::devicePixelRatio() */ QPixmap QIcon::pixmap(const QSize &size, Mode mode, State state) const { if (!d) return QPixmap(); - return d->engine->pixmap(size, mode, state); + + QPixmap pm = d->engine->pixmap(size, mode, state); + return pm; } /*! @@ -691,6 +741,10 @@ Returns a pixmap of size QSize(\a w, \a h). The pixmap might be smaller than requested, but never larger. + + Setting the Qt::AA_UseHighDpiPixmaps application attribute enables this + function to return pixmaps that are larger than the requested size. Such + images will have a devicePixelRation larger than 1. */ /*! @@ -700,12 +754,20 @@ Returns a pixmap of size QSize(\a extent, \a extent). The pixmap might be smaller than requested, but never larger. + + Setting the Qt::AA_UseHighDpiPixmaps application attribute enables this + function to return pixmaps that are larger than the requested size. Such + images will have a devicePixelRation larger than 1. */ -/*! Returns the actual size of the icon for the requested \a size, \a +/*! + Returns the actual size of the icon for the requested \a size, \a mode, and \a state. The result might be smaller than requested, but never larger. + Setting the Qt::AA_UseHighDpiPixmaps application attributes enables this + function to return sizes that are larger than the requested size. + \sa pixmap(), paint() */ QSize QIcon::actualSize(const QSize &size, Mode mode, State state) const @@ -726,7 +788,15 @@ { if (!d || !painter) return; + + // High-dpi pixmaps do not need alignment. Clamp actualSize to the + // passed in destination rect. + QSize actualSize = d->engine->actualSize(rect.size(), mode, state); + actualSize.setWidth(qMin(rect.width(), actualSize.width())); + actualSize.setHeight(qMin(rect.width(), actualSize.height())); + QRect alignedRect = QStyle::alignedRect(painter->layoutDirection(), alignment, d->engine->actualSize(rect.size(), mode, state), rect); + d->engine->paint(painter, alignedRect, mode, state); } @@ -1161,7 +1231,8 @@ int i = 0; if (which == QIcon::Large) i = 1; - return QSize(widths[i], heights[i]); + return QSize(widths[i] * qt_effective_device_pixel_ratio(), + heights[i] * qt_effective_device_pixel_ratio()); } /*! diff -rau qt-everywhere-opensource-src-4.8.5/src/gui/image/qimage.cpp qt-adsk-4.8.5/src/gui/image/qimage.cpp --- qt-everywhere-opensource-src-4.8.5/src/gui/image/qimage.cpp 2013-06-07 13:16:59.000000000 +0800 +++ qt-adsk-4.8.5/src/gui/image/qimage.cpp 2013-09-22 09:31:41.000000000 +0800 @@ -127,7 +127,7 @@ QBasicAtomicInt qimage_serial_number = Q_BASIC_ATOMIC_INITIALIZER(1); QImageData::QImageData() - : ref(0), width(0), height(0), depth(0), nbytes(0), data(0), + : ref(0), width(0), height(0), depth(0), nbytes(0), devicePixelRatio(1.0), data(0), #ifdef QT3_SUPPORT jumptable(0), #endif @@ -1500,6 +1500,7 @@ image.d->dpmx = dotsPerMeterX(); image.d->dpmy = dotsPerMeterY(); + image.d->devicePixelRatio = devicePixelRatio(); image.d->offset = offset(); image.d->has_alpha_clut = d->has_alpha_clut; #ifndef QT_NO_IMAGE_TEXT @@ -1728,6 +1729,48 @@ return d ? d->colortable : QVector(); } +/*! + Returns the current dpi scale factor for the image. + + Common values for the scale factor is 1.0(the default), + and 2.0 for images intended for display on High DPI displayes. + + Use this function when calculating layouts based on the + image size. Layout size is pixel size divided by the scale + factor. + + \sa setScaleFactor() +*/ +qreal QImage::devicePixelRatio() const +{ + if (!d) + return qreal(1.0); + return d->devicePixelRatio; +} + +/*! + Sets the dpi scale factor for the image. + + The scale factor is typically set to 2.0 when producing + images for high-dpi displays. This informs layout code + paths in Qt which use the image size that the image is + a high-resolution image. and not a large image. + + Qt supports using the "@2x" suffix when loading + images from files. Loading "myicon@2x.png" will result + in an image with a 2x scale factor. + + Setting the scale factor will also change the dpi information + returned by QPaintDevice::metric(): Physical dpi will logical dpi + multiplied by the scale factor. + + \sa scaleFactor() +*/ +void QImage::setDevicePixelRatio(qreal scale) +{ + detach(); + d->devicePixelRatio = scale; +} /*! \obsolete @@ -3894,6 +3937,7 @@ image.setDotsPerMeterY(dotsPerMeterY()); image.setDotsPerMeterX(dotsPerMeterX()); + image.setDevicePixelRatio(devicePixelRatio()); #if !defined(QT_NO_IMAGE_TEXT) image.d->text = d->text; @@ -3944,6 +3988,7 @@ QImage dest(src.size(), format); QIMAGE_SANITYCHECK_MEMORY(dest); dest.setColorTable(clut); + dest.setDevicePixelRatio(src.devicePixelRatio()); #if !defined(QT_NO_IMAGE_TEXT) QString textsKeys = src.text(); @@ -4305,8 +4350,8 @@ image.setDotsPerMeterX(dotsPerMeterX()); image.setDotsPerMeterY(dotsPerMeterY()); - image.d->colortable = d->colortable; + image.setDevicePixelRatio(devicePixelRatio()); return image; } #endif @@ -4802,6 +4847,7 @@ result.d->colortable = d->colortable; result.d->has_alpha_clut = d->has_alpha_clut; + result.d->devicePixelRatio = d->devicePixelRatio; if (depth() == 1) w = (w+7)/8; @@ -5845,11 +5891,11 @@ break; case PdmPhysicalDpiX: - return qRound(d->dpmx * 0.0254); + return qRound(d->dpmx * 0.0254 * d->devicePixelRatio); break; case PdmPhysicalDpiY: - return qRound(d->dpmy * 0.0254); + return qRound(d->dpmy * 0.0254 * d->devicePixelRatio); break; default: @@ -6642,6 +6688,7 @@ dImage.d->dpmx = dotsPerMeterX(); dImage.d->dpmy = dotsPerMeterY(); + dImage.d->devicePixelRatio = devicePixelRatio(); switch (bpp) { // initizialize the data diff -rau qt-everywhere-opensource-src-4.8.5/src/gui/image/qimage.h qt-adsk-4.8.5/src/gui/image/qimage.h --- qt-everywhere-opensource-src-4.8.5/src/gui/image/qimage.h 2013-06-07 13:16:59.000000000 +0800 +++ qt-adsk-4.8.5/src/gui/image/qimage.h 2013-09-22 09:31:41.000000000 +0800 @@ -215,6 +215,9 @@ QVector colorTable() const; void setColorTable(const QVector colors); + qreal devicePixelRatio() const; + void setDevicePixelRatio(qreal scale); + void fill(uint pixel); void fill(const QColor &color); void fill(Qt::GlobalColor color); diff -rau qt-everywhere-opensource-src-4.8.5/src/gui/image/qimage_p.h qt-adsk-4.8.5/src/gui/image/qimage_p.h --- qt-everywhere-opensource-src-4.8.5/src/gui/image/qimage_p.h 2013-06-07 13:16:59.000000000 +0800 +++ qt-adsk-4.8.5/src/gui/image/qimage_p.h 2013-09-22 09:31:41.000000000 +0800 @@ -77,6 +77,7 @@ int height; int depth; int nbytes; // number of bytes data + qreal devicePixelRatio; QVector colortable; uchar *data; #ifdef QT3_SUPPORT diff -rau qt-everywhere-opensource-src-4.8.5/src/gui/image/qimagepixmapcleanuphooks.cpp qt-adsk-4.8.5/src/gui/image/qimagepixmapcleanuphooks.cpp --- qt-everywhere-opensource-src-4.8.5/src/gui/image/qimagepixmapcleanuphooks.cpp 2013-06-07 13:16:59.000000000 +0800 +++ qt-adsk-4.8.5/src/gui/image/qimagepixmapcleanuphooks.cpp 2013-09-22 09:31:41.000000000 +0800 @@ -125,8 +125,14 @@ void QImagePixmapCleanupHooks::executeImageHooks(qint64 key) { - for (int i = 0; i < qt_image_and_pixmap_cleanup_hooks()->imageHooks.count(); ++i) - qt_image_and_pixmap_cleanup_hooks()->imageHooks[i](key); + QImagePixmapCleanupHooks *h = qt_image_and_pixmap_cleanup_hooks(); + // the global destructor for the pixmap and image hooks might have + // been called already if the app is "leaking" global + // pixmaps/images + if (!h) + return; + for (int i = 0; i < h->imageHooks.count(); ++i) + h->imageHooks[i](key); if (qt_image_cleanup_hook_64) qt_image_cleanup_hook_64(key); diff -rau qt-everywhere-opensource-src-4.8.5/src/gui/image/qimagereader.cpp qt-adsk-4.8.5/src/gui/image/qimagereader.cpp --- qt-everywhere-opensource-src-4.8.5/src/gui/image/qimagereader.cpp 2013-06-07 13:16:59.000000000 +0800 +++ qt-adsk-4.8.5/src/gui/image/qimagereader.cpp 2013-09-22 09:31:41.000000000 +0800 @@ -128,6 +128,7 @@ #include #include #include +#include // factory loader #include @@ -1263,6 +1264,10 @@ } } + // successful read; check for "@2x" suffix and set scale factor + if (QFileInfo(fileName()).baseName().endsWith("@2x")) { + image->setDevicePixelRatio(2.0); + } return true; } diff -rau qt-everywhere-opensource-src-4.8.5/src/gui/image/qnativeimage.cpp qt-adsk-4.8.5/src/gui/image/qnativeimage.cpp --- qt-everywhere-opensource-src-4.8.5/src/gui/image/qnativeimage.cpp 2013-06-07 13:16:59.000000000 +0800 +++ qt-adsk-4.8.5/src/gui/image/qnativeimage.cpp 2013-09-22 09:31:41.000000000 +0800 @@ -117,11 +117,25 @@ Q_ASSERT(bitmap); Q_ASSERT(bits); - null_bitmap = (HBITMAP)SelectObject(hdc, bitmap); - image = QImage(bits, width, height, format); - - Q_ASSERT(image.paintEngine()->type() == QPaintEngine::Raster); - static_cast(image.paintEngine())->setDC(hdc); + if (bitmap && bits) + { + null_bitmap = (HBITMAP)SelectObject(hdc, bitmap); + image = QImage(bits, width, height, format); + + Q_ASSERT(image.paintEngine()->type() == QPaintEngine::Raster); + static_cast(image.paintEngine())->setDC(hdc); + } + //Add code to handle fail case of CreateDIBSection. + else + { + if (hdc) + { + if (null_bitmap) + SelectObject(hdc, null_bitmap); + DeleteDC(hdc); + hdc = 0; + } + } #ifndef Q_WS_WINCE GdiFlush(); diff -rau qt-everywhere-opensource-src-4.8.5/src/gui/image/qpixmap.cpp qt-adsk-4.8.5/src/gui/image/qpixmap.cpp --- qt-everywhere-opensource-src-4.8.5/src/gui/image/qpixmap.cpp 2013-06-07 13:16:59.000000000 +0800 +++ qt-adsk-4.8.5/src/gui/image/qpixmap.cpp 2013-09-22 09:31:41.000000000 +0800 @@ -779,6 +779,49 @@ data->setMask(mask); } +/*! + Returns the current dpi scale factor for the pixmap. + + common values for the scale factor is 1.0(the default), + and 2.0 for images intended for display on High DPI displays. + + Use this function when calculating layouts based on the + pixmap size. Layout size is pixel size divided by the scale + factor. + + \sa setScaleFactor(), QIcon::pixmap() +*/ +qreal QPixmap::devicePixelRatio() const +{ + if (!data) + return qreal(1.0); + return data->devicePixelRatio; +} + +/*! + Sets the dpi scale factor for the pixmap. + + The scale factor is typically set to 2.0 when producing + pixmap for high-dpi displays. This informs ayout code + paths in Qt which use the image size that the image is + a high-resolution image, and not a large image. + + Qt supports using the "@2x" suffix when loading + pixmap from files. Loading "myicon@2x.png" will result + in an image with a 2x scale factor. + + Setting the scale factor will also change the dpi information + returned by QPaintDevice::metric(): Physical dpi is logical dpi + multiplied by the scale factor. + + \sa scaleFactor(); +*/ +void QPixmap::setDevicePixelRatio(qreal scaleFactor) +{ + detach(); + data->devicePixelRatio = scaleFactor; +} + #ifndef QT_NO_IMAGE_HEURISTIC_MASK /*! Creates and returns a heuristic mask for this pixmap. diff -rau qt-everywhere-opensource-src-4.8.5/src/gui/image/qpixmapdata.cpp qt-adsk-4.8.5/src/gui/image/qpixmapdata.cpp --- qt-everywhere-opensource-src-4.8.5/src/gui/image/qpixmapdata.cpp 2013-06-07 13:16:59.000000000 +0800 +++ qt-adsk-4.8.5/src/gui/image/qpixmapdata.cpp 2013-09-22 09:31:41.000000000 +0800 @@ -70,6 +70,7 @@ h(0), d(0), is_null(true), + devicePixelRatio(1.0), ref(0), detach_no(0), type(pixelType), diff -rau qt-everywhere-opensource-src-4.8.5/src/gui/image/qpixmapdata_p.h qt-adsk-4.8.5/src/gui/image/qpixmapdata_p.h --- qt-everywhere-opensource-src-4.8.5/src/gui/image/qpixmapdata_p.h 2013-06-07 13:16:59.000000000 +0800 +++ qt-adsk-4.8.5/src/gui/image/qpixmapdata_p.h 2013-09-22 09:31:41.000000000 +0800 @@ -155,6 +155,7 @@ int h; int d; bool is_null; + qreal devicePixelRatio; private: friend class QPixmap; diff -rau qt-everywhere-opensource-src-4.8.5/src/gui/image/qpixmap.h qt-adsk-4.8.5/src/gui/image/qpixmap.h --- qt-everywhere-opensource-src-4.8.5/src/gui/image/qpixmap.h 2013-06-07 13:16:59.000000000 +0800 +++ qt-adsk-4.8.5/src/gui/image/qpixmap.h 2013-09-22 09:31:41.000000000 +0800 @@ -108,6 +108,9 @@ QBitmap mask() const; void setMask(const QBitmap &); + + qreal devicePixelRatio() const; + void setDevicePixelRatio(qreal scaleFactor); #ifdef QT_DEPRECATED QT_DEPRECATED QPixmap alphaChannel() const; @@ -271,6 +274,7 @@ friend IconRef qt_mac_create_iconref(const QPixmap&); friend quint32 *qt_mac_pixmap_get_base(const QPixmap*); friend int qt_mac_pixmap_get_bytes_per_line(const QPixmap*); + friend void qt_mac_set_pixmap_scale(QPixmap *pixmap, int scale); #endif friend class QPixmapData; friend class QX11PixmapData; diff -rau qt-everywhere-opensource-src-4.8.5/src/gui/image/qpixmap_mac.cpp qt-adsk-4.8.5/src/gui/image/qpixmap_mac.cpp --- qt-everywhere-opensource-src-4.8.5/src/gui/image/qpixmap_mac.cpp 2013-06-07 13:16:59.000000000 +0800 +++ qt-adsk-4.8.5/src/gui/image/qpixmap_mac.cpp 2013-09-22 09:31:41.000000000 +0800 @@ -240,6 +240,7 @@ h = img.height(); is_null = (w <= 0 || h <= 0); d = (pixelType() == BitmapType ? 1 : img.depth()); + devicePixelRatio = img.devicePixelRatio(); QImage image = img; int dd = QPixmap::defaultDepth(); @@ -391,6 +392,7 @@ // exit if image was not created (out of memory) if (image.isNull()) return image; + image.setDevicePixelRatio(devicePixelRatio); quint32 *sptr = pixels, *srow; const uint sbpr = bytesPerRow; if (format == QImage::Format_MonoLSB) { @@ -487,6 +489,9 @@ int QMacPixmapData::metric(QPaintDevice::PaintDeviceMetric theMetric) const { + extern float qt_mac_defaultDpi_x(); //qpaintdevice_mac.cpps + extern float qt_mac_defaultDpi_y(); //qpaintdevice_mac.cpp + switch (theMetric) { case QPaintDevice::PdmWidth: return w; @@ -499,14 +504,14 @@ case QPaintDevice::PdmNumColors: return 1 << d; case QPaintDevice::PdmDpiX: - case QPaintDevice::PdmPhysicalDpiX: { - extern float qt_mac_defaultDpi_x(); //qpaintdevice_mac.cpp return int(qt_mac_defaultDpi_x()); + case QPaintDevice::PdmPhysicalDpiX: { + return int(qt_mac_defaultDpi_x() * devicePixelRatio); } case QPaintDevice::PdmDpiY: - case QPaintDevice::PdmPhysicalDpiY: { - extern float qt_mac_defaultDpi_y(); //qpaintdevice_mac.cpp return int(qt_mac_defaultDpi_y()); + case QPaintDevice::PdmPhysicalDpiY: { + return int(qt_mac_defaultDpi_y() * devicePixelRatio); } case QPaintDevice::PdmDepth: return d; @@ -890,7 +895,7 @@ const CGRect cgRect = CGRectMake(rect.x(), rect.y(), rect.width(), rect.height()); const CGDisplayErr err = CGGetDisplaysWithRect(cgRect, maxDisplays, displays, &displayCount); - extern CGFloat qt_mac_get_scalefactor(); + //extern CGFloat qt_mac_get_scalefactor(QWidget*); QRect scaledRect = QRect(rect.topLeft(), rect.size() * qt_mac_get_scalefactor()); if (err && displayCount == 0) @@ -1200,6 +1205,7 @@ has_alpha = macData->has_alpha; has_mask = macData->has_mask; uninit = false; + devicePixelRatio = macData->devicePixelRatio; const int x = rect.x(); const int y = rect.y(); diff -rau qt-everywhere-opensource-src-4.8.5/src/gui/image/qpixmap_mac_p.h qt-adsk-4.8.5/src/gui/image/qpixmap_mac_p.h --- qt-everywhere-opensource-src-4.8.5/src/gui/image/qpixmap_mac_p.h 2013-06-07 13:16:59.000000000 +0800 +++ qt-adsk-4.8.5/src/gui/image/qpixmap_mac_p.h 2013-09-22 09:31:41.000000000 +0800 @@ -126,6 +126,7 @@ friend void qt_mac_cgimage_data_free(void *, const void*, size_t); friend IconRef qt_mac_create_iconref(const QPixmap&); friend CGContextRef qt_mac_cg_context(const QPaintDevice*); + friend void qt_mac_set_pixmap_scale(QPixmap *pixmap, int devicePixelRatio); friend QColor qcolorForThemeTextColor(ThemeTextColor themeColor); }; diff -rau qt-everywhere-opensource-src-4.8.5/src/gui/itemviews/qitemdelegate.cpp qt-adsk-4.8.5/src/gui/itemviews/qitemdelegate.cpp --- qt-everywhere-opensource-src-4.8.5/src/gui/itemviews/qitemdelegate.cpp 2013-06-07 13:16:59.000000000 +0800 +++ qt-adsk-4.8.5/src/gui/itemviews/qitemdelegate.cpp 2013-09-22 09:31:41.000000000 +0800 @@ -1084,10 +1084,12 @@ switch (value.type()) { case QVariant::Invalid: break; - case QVariant::Pixmap: - return QRect(QPoint(0, 0), qvariant_cast(value).size()); - case QVariant::Image: - return QRect(QPoint(0, 0), qvariant_cast(value).size()); + case QVariant::Pixmap: { + const QPixmap &pixmap = qvariant_cast(value); + return QRect(QPoint(0, 0), pixmap.size() / pixmap.devicePixelRatio()); } + case QVariant::Image: { + const QImage &image = qvariant_cast(value); + return QRect(QPoint(0, 0), image.size() / image.devicePixelRatio()); } case QVariant::Icon: { QIcon::Mode mode = d->iconMode(option.state); QIcon::State state = d->iconState(option.state); diff -rau qt-everywhere-opensource-src-4.8.5/src/gui/itemviews/qstyleditemdelegate.cpp qt-adsk-4.8.5/src/gui/itemviews/qstyleditemdelegate.cpp --- qt-everywhere-opensource-src-4.8.5/src/gui/itemviews/qstyleditemdelegate.cpp 2013-06-07 13:16:59.000000000 +0800 +++ qt-adsk-4.8.5/src/gui/itemviews/qstyleditemdelegate.cpp 2013-09-22 09:31:41.000000000 +0800 @@ -356,7 +356,9 @@ else mode = QIcon::Normal; QIcon::State state = option->state & QStyle::State_Open ? QIcon::On : QIcon::Off; - v4->decorationSize = v4->icon.actualSize(option->decorationSize, mode, state); + QSize actualSize = v4->icon.actualSize(option->decorationSize, mode, state); + v4->decorationSize = QSize(qMin(v4->decorationSize.width(), actualSize.width()), qMin(v4->decorationSize.height(), actualSize.height())); + break; } case QVariant::Color: { diff -rau qt-everywhere-opensource-src-4.8.5/src/gui/kernel/qapplication.cpp qt-adsk-4.8.5/src/gui/kernel/qapplication.cpp --- qt-everywhere-opensource-src-4.8.5/src/gui/kernel/qapplication.cpp 2013-06-07 13:16:59.000000000 +0800 +++ qt-adsk-4.8.5/src/gui/kernel/qapplication.cpp 2013-09-22 09:31:41.000000000 +0800 @@ -215,6 +215,9 @@ ignore_cursor = 0; #endif + //ADSK: create the namedObjects hash + QObjectPrivate::namedObjects = new QMultiHash; + if (!self) self = this; } @@ -1132,6 +1135,9 @@ w->destroy(true, true); } delete mySet; + //ADSK: clean up hash + delete QObjectPrivate::namedObjects; + QObjectPrivate::namedObjects = 0; } delete qt_desktopWidget; @@ -2137,6 +2143,18 @@ } /*! + Returns the hash of named Objects. Might be NULL. + + \sa allWidgets() +*/ +QMultiHash* QApplication::namedObjects() +{ + return QObjectPrivate::namedObjects; +} + + + +/*! Returns a list of the top-level widgets (windows) in the application. \note Some of the top-level widgets may be hidden, for example a tooltip if @@ -4547,6 +4565,10 @@ widget->setAttribute(Qt::WA_UnderMouse, true); else if (e->type() == QEvent::Leave || e->type() == QEvent::DragLeave) widget->setAttribute(Qt::WA_UnderMouse, false); +#if defined(Q_OS_MAC) || defined(Q_OS_WIN) + else if (e->type() == QEvent::Drop) + QApplicationPrivate::mouse_buttons &= ~(Qt::LeftButton | Qt::MidButton | Qt::RightButton); +#endif #endif if (QLayout *layout=widget->d_func()->layout) { diff -rau qt-everywhere-opensource-src-4.8.5/src/gui/kernel/qapplication.h qt-adsk-4.8.5/src/gui/kernel/qapplication.h --- qt-everywhere-opensource-src-4.8.5/src/gui/kernel/qapplication.h 2013-06-07 13:16:59.000000000 +0800 +++ qt-adsk-4.8.5/src/gui/kernel/qapplication.h 2013-09-22 09:31:41.000000000 +0800 @@ -88,6 +88,9 @@ class QSymbianEvent; #endif +//ADSK: +template class QMultiHash; + class QApplication; class QApplicationPrivate; #if defined(qApp) @@ -178,6 +181,9 @@ static QWidgetList allWidgets(); static QWidgetList topLevelWidgets(); +//ADSK: added + static QMultiHash* namedObjects(); + static QDesktopWidget *desktop(); static QWidget *activePopupWidget(); diff -rau qt-everywhere-opensource-src-4.8.5/src/gui/kernel/qapplication_mac.mm qt-adsk-4.8.5/src/gui/kernel/qapplication_mac.mm --- qt-everywhere-opensource-src-4.8.5/src/gui/kernel/qapplication_mac.mm 2013-06-07 13:16:59.000000000 +0800 +++ qt-adsk-4.8.5/src/gui/kernel/qapplication_mac.mm 2013-09-22 09:31:41.000000000 +0800 @@ -887,6 +887,7 @@ InstallEventLoopTimer(GetMainEventLoop(), 0, 0, request_activate_pending.timerUPP, 0, &request_activate_pending.timer); } +#define ADSK_USE_RAW_EVENT /* menubars */ #ifndef QT_MAC_USE_COCOA @@ -2231,6 +2232,7 @@ #endif Qt::MouseButton buttonToSend = button; static bool lastButtonTranslated = false; +#if !defined(ADSK_USE_RAW_EVENT) if(ekind == kEventMouseDown && button == Qt::LeftButton && (modifiers & Qt::MetaModifier)) { buttonToSend = Qt::RightButton; @@ -2239,6 +2241,7 @@ buttonToSend = Qt::RightButton; lastButtonTranslated = false; } +#endif QMouseEvent qme(etype, plocal, p, buttonToSend, buttons, modifiers); QApplication::sendSpontaneousEvent(widget, &qme); if(!qme.isAccepted() || inNonClientArea) diff -rau qt-everywhere-opensource-src-4.8.5/src/gui/kernel/qapplication_win.cpp qt-adsk-4.8.5/src/gui/kernel/qapplication_win.cpp --- qt-everywhere-opensource-src-4.8.5/src/gui/kernel/qapplication_win.cpp 2013-06-07 13:16:59.000000000 +0800 +++ qt-adsk-4.8.5/src/gui/kernel/qapplication_win.cpp 2013-11-26 15:00:05.000000000 +0800 @@ -260,6 +260,7 @@ static PACKET localPacketBuf[QT_TABLET_NPACKETQSIZE]; // our own tablet packet queue. HCTX qt_tablet_context; // the hardware context for the tablet (like a window handle) bool qt_tablet_tilt_support; +QPointF oldHiResTabletGlobalPosF; // flags for extensions for special Languages, currently only for RTL languages bool qt_use_rtl_extensions = false; @@ -3607,6 +3608,19 @@ int z = 0; qreal rotation = 0.0; qreal tangentialPressure; + // The tablet can be used in 2 different modes, depending on it settings: + // 1) Absolute (pen) mode: + // The coordinates are scaled to the virtual desktop (by default). The user + // can also choose to scale to the monitor or a region of the screen. + // When entering proximity, the tablet driver snaps the mouse pointer to the + // tablet position scaled to that area and keeps it in sync. + // 2) Relative (mouse) mode: + // The pen follows the mouse. The constant 'absoluteRange' specifies the + // manhattanLength difference for detecting if a tablet input device is in this mode, + // in which case we snap the position to the mouse position. + // It seems there is no way to find out the mode programmatically, the LOGCONTEXT orgX/Y/Ext + // area is always the virtual desktop. + enum { absoluteRange = 20 }; // the most common event that we get... t = QEvent::TabletMove; @@ -3629,9 +3643,13 @@ #endif // QT_NO_TABLETEVENT prsNew = 0.0; QRect desktopArea = QApplication::desktop()->geometry(); - QPointF hiResGlobal = currentTabletPointer.scaleCoord(ptNew.x, ptNew.y, desktopArea.left(), - desktopArea.width(), desktopArea.top(), - desktopArea.height()); + + // This code is to delay the tablet data one cycle to sync with the mouse location. + QPointF hiResTabletGlobalPosF = oldHiResTabletGlobalPosF; + oldHiResTabletGlobalPosF = + currentTabletPointer.scaleCoord(ptNew.x, ptNew.y, desktopArea.left(), + desktopArea.width(), desktopArea.top(), + desktopArea.height()); if (btnNew) { #ifndef QT_NO_TABLETEVENT @@ -3647,7 +3665,21 @@ t = QEvent::TabletRelease; button_pressed = false; } - QPoint globalPos(qRound(hiResGlobal.x()), qRound(hiResGlobal.y())); + QPoint globalPos = hiResTabletGlobalPosF.toPoint(); + + // Get Mouse Position and compare to tablet info + // Positions should be almost the same if we are in absolute + // mode. If they are not, use the mouse location. +#ifndef Q_WS_WINCE + POINT mouseLocationP; + if (GetCursorPos(&mouseLocationP)) { + const QPoint mouseLocation(mouseLocationP.x, mouseLocationP.y); + if ((mouseLocation - globalPos).manhattanLength() > absoluteRange) { + globalPos = mouseLocation; + hiResTabletGlobalPosF = globalPos; + } + } +#endif // !Q_WS_WINCE if (t == QEvent::TabletPress) { @@ -3714,7 +3746,7 @@ rotation = ort.orTwist; } #ifndef QT_NO_TABLETEVENT - QTabletEvent e(t, localPos, globalPos, hiResGlobal, currentTabletPointer.currentDevice, + QTabletEvent e(t, localPos, globalPos, hiResTabletGlobalPosF, currentTabletPointer.currentDevice, currentTabletPointer.currentPointerType, prsNew, tiltX, tiltY, tangentialPressure, rotation, z, QApplication::keyboardModifiers(), currentTabletPointer.llId); sendEvent = QApplication::sendSpontaneousEvent(w, &e); @@ -3747,6 +3779,38 @@ #endif // QT_NO_TABLETEVENT +// Adsk function to determine if running on Win7/Vista with Aero off + +typedef HRESULT (WINAPI *PtrDwmIsCompositionEnabled)(BOOL* pfEnabled); +static PtrDwmIsCompositionEnabled pDwmIsCompositionEnabled = NULL; + +static bool adsk_DwmIsCompositionEnabled() +{ + static bool first = true; + bool AeroOn = false; // Assume Aero off + + if (first) { + // If we can load Dwm and compositing is enabled, then it's Aero + // do this part only once + if (NULL == pDwmIsCompositionEnabled) { + QSystemLibrary dwmLib(QLatin1String("dwmapi")); // object unloaded on process end + pDwmIsCompositionEnabled = + (PtrDwmIsCompositionEnabled)dwmLib.resolve("DwmIsCompositionEnabled"); + } + first = false; + } + + // Now check to see if Aero is On + if (pDwmIsCompositionEnabled) { + BOOL bEnabled; + HRESULT hr = pDwmIsCompositionEnabled(&bEnabled); + AeroOn = (S_OK == hr) && bEnabled; + } + + // We know the current statue + return AeroOn; +} + // // Paint event translation // @@ -3767,8 +3831,10 @@ setAttribute(Qt::WA_PendingUpdate, false); - if (d_func()->isGLWidget) { - if (d_func()->usesDoubleBufferedGLContext) + if (QSysInfo::windowsVersion() >= QSysInfo::WV_VISTA && + !adsk_DwmIsCompositionEnabled() && + (inherits("QmayaGLWidget") || inherits("QmayaDXWidget") || d_func()->isGLWidget) ) { + //if (d_func()->usesDoubleBufferedGLContext) InvalidateRect(internalWinId(), 0, false); } else { const QRegion dirtyInBackingStore(qt_dirtyRegion(this)); diff -rau qt-everywhere-opensource-src-4.8.5/src/gui/kernel/qapplication_x11.cpp qt-adsk-4.8.5/src/gui/kernel/qapplication_x11.cpp --- qt-everywhere-opensource-src-4.8.5/src/gui/kernel/qapplication_x11.cpp 2013-06-07 13:16:59.000000000 +0800 +++ qt-adsk-4.8.5/src/gui/kernel/qapplication_x11.cpp 2013-09-22 13:20:33.000000000 +0800 @@ -326,6 +326,7 @@ // Tablet "STYLUS\0" "ERASER\0" + "TABLET\0" }; Q_GUI_EXPORT QX11Data *qt_x11Data = 0; @@ -2462,7 +2463,8 @@ gotStylus = true; } #else - if (devs->type == ATOM(XWacomStylus) || devs->type == ATOM(XTabletStylus)) { + // qDebug() << "found input device" << devs->name << "type" << devs->type << XGetAtomName(X11->display, devs->type); + if (devs->type == ATOM(XWacomStylus) || devs->type == ATOM(XTabletStylus) || devs->type == ATOM(XTablet)) { deviceType = QTabletEvent::Stylus; if (wacomDeviceName()->isEmpty()) wacomDeviceName()->append(devs->name); diff -rau qt-everywhere-opensource-src-4.8.5/src/gui/kernel/qcocoaview_mac.mm qt-adsk-4.8.5/src/gui/kernel/qcocoaview_mac.mm --- qt-everywhere-opensource-src-4.8.5/src/gui/kernel/qcocoaview_mac.mm 2013-06-07 13:16:59.000000000 +0800 +++ qt-adsk-4.8.5/src/gui/kernel/qcocoaview_mac.mm 2013-09-22 09:31:41.000000000 +0800 @@ -1284,8 +1284,14 @@ return Qt::IgnoreAction; /* At the moment it seems clear that Mac OS X does not want to drag with a non-left button so we just bail early to prevent it */ - if(!(GetCurrentEventButtonState() & kEventMouseButtonPrimary)) +#if 0 + // ADSK: Commented out as this does seem to work, and we expect it to + if (!(GetCurrentEventButtonState() & kEventMouseButtonPrimary)) { + o->setMimeData(0); + o->deleteLater(); return Qt::IgnoreAction; + } +#endif if(object) { dragPrivate()->source->removeEventFilter(this); @@ -1342,7 +1348,6 @@ // Convert the image to NSImage: NSImage *image = (NSImage *)qt_mac_create_nsimage(pix); - [image retain]; DnDParams *dndParams = macCurrentDnDParameters(); QT_MANGLE_NAMESPACE(QCocoaView) *theView = static_cast(dndParams->view); diff -rau qt-everywhere-opensource-src-4.8.5/src/gui/kernel/qcursor_mac.mm qt-adsk-4.8.5/src/gui/kernel/qcursor_mac.mm --- qt-everywhere-opensource-src-4.8.5/src/gui/kernel/qcursor_mac.mm 2013-06-07 13:16:59.000000000 +0800 +++ qt-adsk-4.8.5/src/gui/kernel/qcursor_mac.mm 2013-09-22 09:31:41.000000000 +0800 @@ -181,8 +181,11 @@ if (w && !w->testAttribute(Qt::WA_SetCursor)) w = 0; - lastWidgetUnderMouse = widgetUnderMouse; - lastMouseCursorWidget = w; + // ADSK this assignment causes problems - deleted window/widgets + // crashes later in qt_mac_set_cursor() + // mostly for optimiztion, disable for now + //lastWidgetUnderMouse = widgetUnderMouse; + //lastMouseCursorWidget = w; } } diff -rau qt-everywhere-opensource-src-4.8.5/src/gui/kernel/qdnd_mac.mm qt-adsk-4.8.5/src/gui/kernel/qdnd_mac.mm --- qt-everywhere-opensource-src-4.8.5/src/gui/kernel/qdnd_mac.mm 2013-06-07 13:16:59.000000000 +0800 +++ qt-adsk-4.8.5/src/gui/kernel/qdnd_mac.mm 2013-09-22 09:31:41.000000000 +0800 @@ -538,8 +538,9 @@ return Qt::IgnoreAction; /* At the moment it seems clear that Mac OS X does not want to drag with a non-left button so we just bail early to prevent it */ - if(!(GetCurrentEventButtonState() & kEventMouseButtonPrimary)) - return Qt::IgnoreAction; +// ADSK: Commented out +// if(!(GetCurrentEventButtonState() & kEventMouseButtonPrimary)) +// return Qt::IgnoreAction; if(object) { dragPrivate()->source->removeEventFilter(this); diff -rau qt-everywhere-opensource-src-4.8.5/src/gui/kernel/qkeymapper_win.cpp qt-adsk-4.8.5/src/gui/kernel/qkeymapper_win.cpp --- qt-everywhere-opensource-src-4.8.5/src/gui/kernel/qkeymapper_win.cpp 2013-06-07 13:16:59.000000000 +0800 +++ qt-adsk-4.8.5/src/gui/kernel/qkeymapper_win.cpp 2014-01-23 14:38:30.060348755 +0800 @@ -86,6 +86,12 @@ return true; } #endif + +// We not only need the scancode itself but also the extended bit of key messag +// the additional bit when masking the scancode. +enum { scancodeBitmask = 0x1ff }; + + // Key recorder ------------------------------------------------------------------------[ start ] -- struct KeyRecord { KeyRecord(int c, int a, int s, const QString &t) : code(c), ascii(a), state(s), text(t) {} @@ -662,7 +668,7 @@ { unsigned char kbdBuffer[256]; // Will hold the complete keyboard state GetKeyboardState(kbdBuffer); - quint32 scancode = (msg.lParam >> 16) & 0xfff; + const quint32 scancode = (msg.lParam >> 16) & scancodeBitmask; updatePossibleKeyCodes(kbdBuffer, scancode, msg.wParam); } @@ -725,8 +731,8 @@ } keyLayout[vk_key]->qtKey[8] = fallbackKey; - // If this vk_key a Dead Key - if (MapVirtualKey(vk_key, 2) & 0x80000000) { + // If this vk_key makes a dead key with any combination of modifiers + if (keyLayout[vk_key]->deadkeys) { // Push a Space, then the original key through the low-level ToAscii functions. // We do this because these functions (ToAscii / ToUnicode) will alter the internal state of // the keyboard driver By doing the following, we set the keyboard driver state back to what @@ -797,10 +803,15 @@ bool k0 = false; bool k1 = false; int msgType = msg.message; + // WM_CHAR messages already contain the character in question so there is + // no need to fiddle with our key map. In any other case add this key to th + // keymap if it is not present yet. + if (msg.message != WM_CHAR) + updateKeyMap(msg); + + const quint32 scancode = (msg.lParam >> 16) & scancodeBitmask; + const quint32 vk_key = msg.wParam; - quint32 scancode = (msg.lParam >> 16) & 0xfff; - quint32 vk_key = MapVirtualKey(scancode, 1); - bool isNumpad = (msg.wParam >= VK_NUMPAD0 && msg.wParam <= VK_NUMPAD9); quint32 nModifiers = 0; #if defined(Q_OS_WINCE) @@ -835,10 +846,6 @@ state |= (nModifiers & AltAny ? int(Qt::AltModifier) : 0); state |= (nModifiers & MetaAny ? int(Qt::MetaModifier) : 0); - // Now we know enough to either have MapVirtualKey or our own keymap tell us if it's a deadkey - bool isDeadKey = isADeadKey(msg.wParam, state) - || MapVirtualKey(msg.wParam, 2) & 0x80000000; - // A multi-character key not found by our look-ahead if (msgType == WM_CHAR) { QString s; @@ -921,23 +928,12 @@ return true; // Translate VK_* (native) -> Key_* (Qt) keys - // If it's a dead key, we cannot use the toKeyOrUnicode() function, since that will change - // the internal state of the keyboard driver, resulting in that dead keys no longer works. - // ..also if we're typing numbers on the keypad, while holding down the Alt modifier. - int code = 0; - if (isNumpad && (nModifiers & AltAny)) { - code = winceKeyBend(msg.wParam); - } else if (!isDeadKey) { - // QTBUG-8764, QTBUG-10032 - // Can't call toKeyOrUnicode because that would call ToUnicode, and, if a dead key - // is pressed at the moment, Windows would NOT use it to compose a character for the next - // WM_CHAR event. - - // Instead, use MapVirtualKey, which will provide adequate values. - code = MapVirtualKey(msg.wParam, MAPVK_VK_TO_CHAR); - if (code < 0x20 || code == 0x7f) // The same logic as in toKeyOrUnicode() - code = winceKeyBend(msg.wParam); - } + int modifiersIndex = 0; + modifiersIndex |= (nModifiers & ShiftAny ? 0x1 : 0); + modifiersIndex |= (nModifiers & ControlAny ? 0x2 : 0); + modifiersIndex |= (nModifiers & AltAny ? 0x4 : 0); + + int code = keyLayout[vk_key]->qtKey[modifiersIndex]; // Invert state logic: // If the key actually pressed is a modifier key, then we remove its modifier key from the diff -rau qt-everywhere-opensource-src-4.8.5/src/gui/kernel/qkeymapper_x11.cpp qt-adsk-4.8.5/src/gui/kernel/qkeymapper_x11.cpp --- qt-everywhere-opensource-src-4.8.5/src/gui/kernel/qkeymapper_x11.cpp 2013-06-07 13:16:59.000000000 +0800 +++ qt-adsk-4.8.5/src/gui/kernel/qkeymapper_x11.cpp 2013-10-21 15:20:17.000000000 +0800 @@ -282,12 +282,9 @@ // first, translate key only using lock modifiers (there are no Qt equivalents for these, so we must // always use them when determining the baseKeySym) - // Note: the Xkb group to be used for the conversion keycode->keysym has to be given to - // XkbLookupKeySym(). This information is contained in the bits 8 to 15 of xmodifiers. - // See https://bugreports.qt-project.org/browse/QTBUG-15319 . KeySym baseKeySym; uint consumedModifiers; - if (!XkbLookupKeySym(X11->display, xkeycode, (xmodifiers & (0xff00 | LockMask | qt_num_lock_mask)), + if (!XkbLookupKeySym(X11->display, xkeycode, (xmodifiers & (LockMask | qt_num_lock_mask)), &consumedModifiers, &baseKeySym)) return QList(); diff -rau qt-everywhere-opensource-src-4.8.5/src/gui/kernel/qt_cocoa_helpers_mac.mm qt-adsk-4.8.5/src/gui/kernel/qt_cocoa_helpers_mac.mm --- qt-everywhere-opensource-src-4.8.5/src/gui/kernel/qt_cocoa_helpers_mac.mm 2013-06-07 13:16:59.000000000 +0800 +++ qt-adsk-4.8.5/src/gui/kernel/qt_cocoa_helpers_mac.mm 2013-09-22 09:31:41.000000000 +0800 @@ -91,6 +91,8 @@ #include #include +#define ADSK_USE_RAW_EVENT + QT_BEGIN_NAMESPACE #ifdef QT_MAC_USE_COCOA @@ -998,15 +1000,19 @@ if (clickCount % 2 == 0) eventType = (!fakeMouseEvents) ? QEvent::NonClientAreaMouseButtonDblClick : QEvent::MouseButtonDblClick; +#if !defined(ADSK_USE_RAW_EVENT) if (button == Qt::LeftButton && (keyMods & Qt::MetaModifier)) { button = Qt::RightButton; qt_leftButtonIsRightButton = true; } +#endif } else if (eventType == QEvent::NonClientAreaMouseButtonRelease || eventType == QEvent::MouseButtonRelease) { +#if !defined(ADSK_USE_RAW_EVENT) if (button == Qt::LeftButton && qt_leftButtonIsRightButton) { button = Qt::RightButton; qt_leftButtonIsRightButton = false; } +#endif } Qt::MouseButtons buttons = 0; @@ -1243,17 +1249,23 @@ qt_button_down = widgetUnderMouse; if (clickCount % 2 == 0 && (previousButton == Qt::NoButton || previousButton == button)) eventType = QEvent::MouseButtonDblClick; +#if !defined(ADSK_USE_RAW_EVENT) if (button == Qt::LeftButton && (keyMods & Qt::MetaModifier)) { button = Qt::RightButton; qt_leftButtonIsRightButton = true; } +#endif break; case QEvent::MouseButtonRelease: +#if !defined(ADSK_USE_RAW_EVENT) if (button == Qt::LeftButton && qt_leftButtonIsRightButton) { button = Qt::RightButton; qt_leftButtonIsRightButton = false; } - qt_button_down = 0; +#endif + if(!buttons) + qt_button_down = 0; + break; } @@ -1280,7 +1292,8 @@ // released. We therefore need to re-check if should send (delayed) enter leave events: // qt_button_down has now become NULL since the call at the top of the function. Also, since // the relase might have closed a window, we dont give the nativeWidget hint - qt_mac_getTargetForMouseEvent(0, QEvent::None, localPoint, globalPoint, nativeWidget, &widgetUnderMouse); + // ADSK implement change suggested by QTBUG-26761 passing NULL instead of nativeWidget to fix crashes + qt_mac_getTargetForMouseEvent(0, QEvent::None, localPoint, globalPoint, NULL, &widgetUnderMouse); qt_mac_checkEnterLeaveForNativeWidgets(widgetUnderMouse); } @@ -1555,19 +1568,40 @@ #endif } -CGFloat qt_mac_get_scalefactor() -{ #ifndef QT_MAC_USE_COCOA +CGFloat qt_mac_get_scalefactor(QWidget *window) +{ + Q_UNUSED(window); return HIGetScaleFactor(); +} #endif +#ifdef QT_MAC_USE_COCOA +CGFloat qt_mac_get_scalefactor(QWidget *window) +{ + // No high-dpi support on 10.6 and below #if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7) - NSScreen *mainScreen = [NSScreen mainScreen]; - if ([mainScreen respondsToSelector:@selector(backingScaleFactor)]) - return [mainScreen backingScaleFactor]; + if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_7) { + if (window == 0) { + // If there is no window given we answer the question + // "Are there any HiDPI screens connected?" by returning + // the highest scale factor found. + CGFloat highestScaleFactor = 1.0; + NSArray *screens = [NSScreen screens]; + for (id screen in screens) { + highestScaleFactor = qMax(highestScaleFactor, [screen backingScaleFactor]); + } + return highestScaleFactor; + } else { + return [qt_mac_window_for(window) backingScaleFactor]; + } + } else #endif - return 1.0; + { + return 1.0; // return 1.0 when compiled on or running on 10.6 and lower. + } } +#endif QString qt_mac_get_pasteboardString(OSPasteboardRef paste) { diff -rau qt-everywhere-opensource-src-4.8.5/src/gui/kernel/qt_cocoa_helpers_mac_p.h qt-adsk-4.8.5/src/gui/kernel/qt_cocoa_helpers_mac_p.h --- qt-everywhere-opensource-src-4.8.5/src/gui/kernel/qt_cocoa_helpers_mac_p.h 2013-06-07 13:16:59.000000000 +0800 +++ qt-adsk-4.8.5/src/gui/kernel/qt_cocoa_helpers_mac_p.h 2013-09-22 09:31:41.000000000 +0800 @@ -204,7 +204,7 @@ void qt_syncCocoaTitleBarButtons(OSWindowRef window, QWidget *widgetForWindow); -CGFloat qt_mac_get_scalefactor(); +Q_GUI_EXPORT CGFloat qt_mac_get_scalefactor(QWidget *window = 0); QString qt_mac_get_pasteboardString(OSPasteboardRef paste); #ifdef __OBJC__ diff -rau qt-everywhere-opensource-src-4.8.5/src/gui/kernel/qt_x11_p.h qt-adsk-4.8.5/src/gui/kernel/qt_x11_p.h --- qt-everywhere-opensource-src-4.8.5/src/gui/kernel/qt_x11_p.h 2013-06-07 13:16:59.000000000 +0800 +++ qt-adsk-4.8.5/src/gui/kernel/qt_x11_p.h 2013-09-22 10:52:46.000000000 +0800 @@ -688,6 +688,7 @@ XTabletStylus, XTabletEraser, + XTablet, NPredefinedAtoms, diff -rau qt-everywhere-opensource-src-4.8.5/src/gui/kernel/qwidget.cpp qt-adsk-4.8.5/src/gui/kernel/qwidget.cpp --- qt-everywhere-opensource-src-4.8.5/src/gui/kernel/qwidget.cpp 2013-06-07 13:16:59.000000000 +0800 +++ qt-adsk-4.8.5/src/gui/kernel/qwidget.cpp 2013-09-22 09:31:41.000000000 +0800 @@ -68,6 +68,8 @@ # include "qt_cocoa_helpers_mac_p.h" # include "qmainwindow.h" # include "qtoolbar.h" +# include "qtoolbutton.h" +# include "qpushbutton.h" # include #endif #if defined(Q_WS_QWS) @@ -1387,6 +1389,8 @@ if (++QWidgetPrivate::instanceCounter > QWidgetPrivate::maxInstances) QWidgetPrivate::maxInstances = QWidgetPrivate::instanceCounter; +//ADSK: add total instance operation counter + ++QWidgetPrivate::instanceOperationsCounter; if (QApplicationPrivate::app_compile_version < 0x040200 || QApplicationPrivate::testAttribute(Qt::AA_ImmediateWidgetCreation)) @@ -1414,6 +1418,30 @@ } +// Adsk enable QPushButtons as Alien widgets - performance fix for Mac +// Nokia added Alien code for Mac, but didn't enable it. something for Qt 4.8 +// Qt 4.8 has default Alien code for all +bool shouldMakeAlien(QWidget *widget) +{ +#ifdef Q_WS_MAC + static int adsk_alienWidgetEnable = qgetenv("MAYA_ALIEN_WIDGETS").toInt(); + + if (adsk_alienWidgetEnable < 0 ) + return false; // -1 no alien widgets + if (adsk_alienWidgetEnable > 0 ) + return true; // +1 all alien widgets + + // else not set or is zero - default just pushbutton derived + + while (widget) { + if (qobject_cast(widget)) + return true; + widget = widget->parentWidget(); + } + return false; +#endif + return true; +} /*! @@ -1491,7 +1519,17 @@ setAttribute(Qt::WA_PaintOnScreen); if (QApplicationPrivate::testAttribute(Qt::AA_NativeWindows)) - setAttribute(Qt::WA_NativeWindow); + { + // force native by Qt Env Var + setAttribute(Qt::WA_NativeWindow); +#ifdef Q_WS_MAC + } else { + // Adsk: on Mac check if widget is a pushButton family else native + if (!shouldMakeAlien(this)) { + setAttribute(Qt::WA_NativeWindow); + } +#endif + } #ifdef ALIEN_DEBUG qDebug() << "QWidget::create:" << this << "parent:" << parentWidget() @@ -1690,6 +1728,8 @@ // if this fails we can't do anything about it but at least we are not allowed to throw. } --QWidgetPrivate::instanceCounter; +//ADSK: increment total operations counter + ++QWidgetPrivate::instanceOperationsCounter; if (QWidgetPrivate::allWidgets) // might have been deleted by ~QApplication QWidgetPrivate::allWidgets->remove(this); @@ -1704,6 +1744,8 @@ int QWidgetPrivate::instanceCounter = 0; // Current number of widget instances int QWidgetPrivate::maxInstances = 0; // Maximum number of widget instances +//ADSK: define total operations counter +int QWidgetPrivate::instanceOperationsCounter = 0; // Has number of widget instances changed? void QWidgetPrivate::setWinId(WId id) // set widget identifier { @@ -2493,6 +2535,28 @@ } +//ADSK: added functions +/*! + Returns total number of widgets in application. +*/ + +/*static*/ +int QWidget::instanceCounter() +{ + return QWidgetPrivate::instanceCounter; +} + +/*! + Returns combined number of create/delete operations on widget. +*/ + +/*static*/ +int QWidget::instanceOperationsCounter() +{ + return QWidgetPrivate::instanceOperationsCounter; +} +//ADSK: end of added functions + /*! \fn WId QWidget::internalWinId() const @@ -4261,7 +4325,8 @@ QPoint p = pos; if (parent) { const QWidget * w = this; - while (w != parent) { + // adsk: TODO don't worry about this just now - crashes on PaneLayout setup for splitter + while (w != parent && w != NULL) { Q_ASSERT_X(w, "QWidget::mapTo(QWidget *parent, const QPoint &pos)", "parent must be in parent hierarchy"); p = w->mapToParent(p); @@ -8348,9 +8413,10 @@ case QEvent::TouchUpdate: case QEvent::TouchEnd: case QEvent::ContextMenu: -#ifndef QT_NO_WHEELEVENT - case QEvent::Wheel: -#endif +// ADSK commented out - want wheel event propagate from disabled widgets to parents +//#ifndef QT_NO_WHEELEVENT +// case QEvent::Wheel: +//#endif return false; default: break; diff -rau qt-everywhere-opensource-src-4.8.5/src/gui/kernel/qwidget.h qt-adsk-4.8.5/src/gui/kernel/qwidget.h --- qt-everywhere-opensource-src-4.8.5/src/gui/kernel/qwidget.h 2013-06-07 13:16:59.000000000 +0800 +++ qt-adsk-4.8.5/src/gui/kernel/qwidget.h 2013-09-22 09:31:41.000000000 +0800 @@ -591,6 +591,10 @@ inline Qt::WindowType windowType() const; static QWidget *find(WId); +//ADSK: added functions + static int instanceCounter(); + static int instanceOperationsCounter(); +//ADSK: end of change #ifdef QT3_SUPPORT static QT3_SUPPORT QWidgetMapper *wmapper(); #endif diff -rau qt-everywhere-opensource-src-4.8.5/src/gui/kernel/qwidget_mac.mm qt-adsk-4.8.5/src/gui/kernel/qwidget_mac.mm --- qt-everywhere-opensource-src-4.8.5/src/gui/kernel/qwidget_mac.mm 2013-06-07 13:16:59.000000000 +0800 +++ qt-adsk-4.8.5/src/gui/kernel/qwidget_mac.mm 2013-09-22 09:31:41.000000000 +0800 @@ -2882,6 +2882,10 @@ if (set && ![qwin isVisible]) return; + // ADSK Maya doesn't want this added functionality including Windows and Dialogs + // we just return early + return; + if (QWidget *parent = q->parentWidget()) { if (NSWindow *pwin = [qt_mac_nativeview_for(parent) window]) { if (set) { @@ -3279,8 +3283,7 @@ if (icon.isNull()) { [iconButton setImage:nil]; } else { - QPixmap scaled = pm->scaled(QSize(16,16), Qt::KeepAspectRatio, Qt::SmoothTransformation); - NSImage *image = static_cast(qt_mac_create_nsimage(scaled)); + NSImage *image = static_cast(qt_mac_create_nsimage(*pm)); [iconButton setImage:image]; [image release]; } @@ -3651,6 +3654,8 @@ if(!keepFullScreen) qt_mac_set_fullscreen_mode(false); } + setSubWindowStacking(true); + #endif toggleDrawers(false); qt_mac_update_cursor(); @@ -3866,7 +3871,14 @@ d->updateFrameStrut(); // In theory the dirty would work, but it's optimized out if the window is not visible :( } // Everything should be handled by Cocoa. - [window zoom:window]; + if (!windowFlags() & Qt::FramelessWindowHint) { + [window zoom:window]; + } else { + QDesktopWidget *dsk = QApplication::desktop(); + QRect avail = dsk->availableGeometry(dsk->screenNumber(this)); + setGeometry(avail); + } + #endif needSendStateChange = oldstate == windowState(); // Zoom didn't change flags. } else if(oldstate & Qt::WindowMaximized && !(oldstate & Qt::WindowFullScreen)) { @@ -4716,14 +4728,12 @@ // Scroll the whole widget if qscrollRect is not valid: QRect validScrollRect = qscrollRect.isValid() ? qscrollRect : q->rect(); - validScrollRect &= clipRect(); // If q is overlapped by other widgets, we cannot just blit pixels since // this will move overlapping widgets as well. In case we just update: const bool overlapped = isOverlapped(validScrollRect.translated(data.crect.topLeft())); const bool accelerateScroll = accelEnv && isOpaque && !overlapped; const bool isAlien = (q->internalWinId() == 0); - const QPoint scrollDelta(dx, dy); // If qscrollRect is valid, we are _not_ supposed to scroll q's children (as documented). // But we do scroll children (and the whole of q) if qscrollRect is invalid. This case is @@ -4745,7 +4755,6 @@ }else { update_sys(qscrollRect); } - return; } #ifdef QT_MAC_USE_COCOA @@ -4762,6 +4771,7 @@ // moved when the parent is scrolled. All directly or indirectly moved // children will receive a move event before the function call returns. QWidgetList movedChildren; + const QPoint scrollDelta(dx, dy); if (scrollChildren) { QObjectList children = q->children(); diff -rau qt-everywhere-opensource-src-4.8.5/src/gui/kernel/qwidget_p.h qt-adsk-4.8.5/src/gui/kernel/qwidget_p.h --- qt-everywhere-opensource-src-4.8.5/src/gui/kernel/qwidget_p.h 2013-06-07 13:16:59.000000000 +0800 +++ qt-adsk-4.8.5/src/gui/kernel/qwidget_p.h 2013-09-22 09:31:41.000000000 +0800 @@ -748,6 +748,9 @@ signed char bottomLayoutItemMargin; static int instanceCounter; // Current number of widget instances static int maxInstances; // Maximum number of widget instances +//ADSK: added total count + static int instanceOperationsCounter; // Total number of create/delete operations on widget + Qt::HANDLE hd; QWidgetData data; QSizePolicy size_policy; diff -rau qt-everywhere-opensource-src-4.8.5/src/gui/kernel/qwidget_win.cpp qt-adsk-4.8.5/src/gui/kernel/qwidget_win.cpp --- qt-everywhere-opensource-src-4.8.5/src/gui/kernel/qwidget_win.cpp 2013-06-07 13:16:59.000000000 +0800 +++ qt-adsk-4.8.5/src/gui/kernel/qwidget_win.cpp 2013-10-21 15:48:16.000000000 +0800 @@ -1796,10 +1796,10 @@ void QWidgetPrivate::unregisterOleDnd(QWidget *widget, QOleDropTarget *dropTarget) { - dropTarget->releaseQt(); - dropTarget->Release(); Q_ASSERT(widget->testAttribute(Qt::WA_WState_Created)); if (!widget->internalWinId()) { + dropTarget->releaseQt(); + dropTarget->Release(); QWidget *nativeParent = widget->nativeParentWidget(); while (nativeParent) { QWExtra *nativeExtra = nativeParent->d_func()->extra; @@ -1828,6 +1828,8 @@ #ifndef Q_OS_WINCE CoLockObjectExternal(dropTarget, false, true); #endif + dropTarget->releaseQt(); + dropTarget->Release(); RevokeDragDrop(widget->internalWinId()); } } diff -rau qt-everywhere-opensource-src-4.8.5/src/gui/painting/qcosmeticstroker.cpp qt-adsk-4.8.5/src/gui/painting/qcosmeticstroker.cpp --- qt-everywhere-opensource-src-4.8.5/src/gui/painting/qcosmeticstroker.cpp 2013-06-07 13:16:59.000000000 +0800 +++ qt-adsk-4.8.5/src/gui/painting/qcosmeticstroker.cpp 2013-09-22 09:31:41.000000000 +0800 @@ -133,10 +133,15 @@ }; +/* + * The return value is the result of the clipLine() call performed at the start + * of each of the two functions, aka "false" means completely outside the devices + * rect. + */ template -static void drawLine(QCosmeticStroker *stroker, qreal x1, qreal y1, qreal x2, qreal y2, int caps); +static bool drawLine(QCosmeticStroker *stroker, qreal x1, qreal y1, qreal x2, qreal y2, int caps); template -static void drawLineAA(QCosmeticStroker *stroker, qreal x1, qreal y1, qreal x2, qreal y2, int caps); +static bool drawLineAA(QCosmeticStroker *stroker, qreal x1, qreal y1, qreal x2, qreal y2, int caps); inline void drawPixel(QCosmeticStroker *stroker, int x, int y, int coverage) { @@ -602,17 +607,20 @@ caps |= CapEnd; QCosmeticStroker::Point last = this->lastPixel; - stroke(this, p.x(), p.y(), p2.x(), p2.y(), caps); + bool unclipped = stroke(this, p.x(), p.y(), p2.x(), p2.y(), caps); /* fix for gaps in polylines with fastpen and aliased in a sequence of points with small distances: if current point p2 has been dropped - out, keep last non dropped point p. */ - if (fastPenAliased) { - if (last.x != lastPixel.x || last.y != lastPixel.y || - points == begin + 2 || points == end - 2 ) { - { - p = p2; - } + out, keep last non dropped point p. + + However, if the line was completely outside the devicerect, we + still need to update p to avoid drawing the line after this one from + a bad starting position. + */ + if (fastPenAliased && unclipped) { + if (last.x != lastPixel.x || last.y != lastPixel.y + || points == begin + 2 || points == end - 2) { + p = p2; } } else { p = p2; @@ -720,10 +728,10 @@ the drawing shifts from horizontal to vertical or back. */ template -static void drawLine(QCosmeticStroker *stroker, qreal rx1, qreal ry1, qreal rx2, qreal ry2, int caps) +static bool drawLine(QCosmeticStroker *stroker, qreal rx1, qreal ry1, qreal rx2, qreal ry2, int caps) { if (stroker->clipLine(rx1, ry1, rx2, ry2)) - return; + return false; static const int half = 31; int x1 = toF26Dot6(rx1) + half; @@ -813,7 +821,7 @@ } else { // horizontal if (!dx) - return; + return true; QCosmeticStroker::Direction dir = QCosmeticStroker::LeftToRight; @@ -886,14 +894,15 @@ } } stroker->lastPixel = last; + return true; } template -static void drawLineAA(QCosmeticStroker *stroker, qreal rx1, qreal ry1, qreal rx2, qreal ry2, int caps) +static bool drawLineAA(QCosmeticStroker *stroker, qreal rx1, qreal ry1, qreal rx2, qreal ry2, int caps) { if (stroker->clipLine(rx1, ry1, rx2, ry2)) - return; + return false; int x1 = toF26Dot6(rx1); int y1 = toF26Dot6(ry1); @@ -967,7 +976,7 @@ } else { // horizontal if (!dx) - return; + return true; int yinc = F16Dot16FixedDiv(dy, dx); @@ -1029,6 +1038,7 @@ drawPixel(stroker, x, (y>>16) + 1, alpha * alphaEnd >> 6); } } + return true; } QT_END_NAMESPACE diff -rau qt-everywhere-opensource-src-4.8.5/src/gui/painting/qcosmeticstroker_p.h qt-adsk-4.8.5/src/gui/painting/qcosmeticstroker_p.h --- qt-everywhere-opensource-src-4.8.5/src/gui/painting/qcosmeticstroker_p.h 2013-06-07 13:16:59.000000000 +0800 +++ qt-adsk-4.8.5/src/gui/painting/qcosmeticstroker_p.h 2013-09-22 09:31:41.000000000 +0800 @@ -56,7 +56,7 @@ class QCosmeticStroker; -typedef void (*StrokeLine)(QCosmeticStroker *stroker, qreal x1, qreal y1, qreal x2, qreal y2, int caps); +typedef bool (*StrokeLine)(QCosmeticStroker *stroker, qreal x1, qreal y1, qreal x2, qreal y2, int caps); class QCosmeticStroker { diff -rau qt-everywhere-opensource-src-4.8.5/src/gui/painting/qpaintengine_x11.cpp qt-adsk-4.8.5/src/gui/painting/qpaintengine_x11.cpp --- qt-everywhere-opensource-src-4.8.5/src/gui/painting/qpaintengine_x11.cpp 2013-06-07 13:16:59.000000000 +0800 +++ qt-adsk-4.8.5/src/gui/painting/qpaintengine_x11.cpp 2013-09-22 09:31:41.000000000 +0800 @@ -2321,7 +2321,7 @@ ft->lockFace(); int i = 0; while (i < glyphs.size()) { - QFontEngineFT::Glyph *glyph = ft->loadGlyph(glyphs[i], QFontEngineFT::Format_Mono); + QFontEngineFT::Glyph *glyph = ft->loadGlyph(glyphs[i], 0, QFontEngineFT::Format_Mono); // #### fix case where we don't get a glyph if (!glyph) break; diff -rau qt-everywhere-opensource-src-4.8.5/src/gui/painting/qpainter.cpp qt-adsk-4.8.5/src/gui/painting/qpainter.cpp --- qt-everywhere-opensource-src-4.8.5/src/gui/painting/qpainter.cpp 2013-06-07 13:16:59.000000000 +0800 +++ qt-adsk-4.8.5/src/gui/painting/qpainter.cpp 2013-09-22 09:31:41.000000000 +0800 @@ -5389,7 +5389,8 @@ x += d->state->matrix.dx(); y += d->state->matrix.dy(); } - d->engine->drawPixmap(QRectF(x, y, w, h), pm, QRectF(0, 0, w, h)); + int scale = pm.devicePixelRatio(); + d->engine->drawPixmap(QRectF(x, y, w / scale, h / scale), pm, QRectF(0, 0, w, h)); } } @@ -5419,6 +5420,11 @@ qreal sw = sr.width(); qreal sh = sr.height(); + // Get pixmap scale. Use it when calculating the target + // rect size from pixmap size. For example, a 2X 64x64 pixel + // pixmap should result in a 32x32 point target rect. + const int pmscale = pm.devicePixelRatio(); + // Sanity-check clipping if (sw <= 0) sw = pm.width() - sx; @@ -5427,9 +5433,9 @@ sh = pm.height() - sy; if (w < 0) - w = sw; + w = sw / pmscale; if (h < 0) - h = sh; + h = sh / pmscale; if (sx < 0) { qreal w_ratio = sx * w/sw; @@ -5677,7 +5683,8 @@ y += d->state->matrix.dy(); } - d->engine->drawImage(QRectF(x, y, w, h), image, QRectF(0, 0, w, h), Qt::AutoColor); + int scale = image.devicePixelRatio(); + d->engine->drawImage(QRectF(x, y, w / scale, h / scale), image, QRectF(0, 0, w, h), Qt::AutoColor); } void QPainter::drawImage(const QRectF &targetRect, const QImage &image, const QRectF &sourceRect, @@ -5696,7 +5703,8 @@ qreal sy = sourceRect.y(); qreal sw = sourceRect.width(); qreal sh = sourceRect.height(); - + int imageScale = image.devicePixelRatio(); + // Sanity-check clipping if (sw <= 0) sw = image.width() - sx; @@ -5705,9 +5713,9 @@ sh = image.height() - sy; if (w < 0) - w = sw; + w = sw / imageScale; if (h < 0) - h = sh; + h = sh / imageScale; if (sx < 0) { qreal w_ratio = sx * w/sw; diff -rau qt-everywhere-opensource-src-4.8.5/src/gui/styles/qcommonstyle.cpp qt-adsk-4.8.5/src/gui/styles/qcommonstyle.cpp --- qt-everywhere-opensource-src-4.8.5/src/gui/styles/qcommonstyle.cpp 2013-06-07 13:16:59.000000000 +0800 +++ qt-adsk-4.8.5/src/gui/styles/qcommonstyle.cpp 2013-09-22 09:31:41.000000000 +0800 @@ -1172,7 +1172,9 @@ QSize tabIconSize = opt->icon.actualSize(iconSize, (opt->state & QStyle::State_Enabled) ? QIcon::Normal : QIcon::Disabled, (opt->state & QStyle::State_Selected) ? QIcon::On : QIcon::Off ); - + // High-dpi icons do not need adjustmet; make sure tabIconSize is not larger than iconSize + tabIconSize = QSize(qMin(tabIconSize.width(), iconSize.width()), qMin(tabIconSize.height(), iconSize.height())); + *iconRect = QRect(tr.left(), tr.center().y() - tabIconSize.height() / 2, tabIconSize.width(), tabIconSize .height()); if (!verticalTabs) @@ -1253,8 +1255,11 @@ state = QIcon::On; QPixmap pixmap = button->icon.pixmap(button->iconSize, mode, state); - int labelWidth = pixmap.width(); - int labelHeight = pixmap.height(); + + int pixmapWidth = pixmap.width() / pixmap.devicePixelRatio(); + int pixmapHeight = pixmap.height() / pixmap.devicePixelRatio(); + int labelWidth = pixmapWidth; + int labelHeight = pixmapHeight; int iconSpacing = 4;//### 4 is currently hardcoded in QPushButton::sizeHint() int textWidth = button->fontMetrics.boundingRect(opt->rect, tf, button->text).width(); if (!button->text.isEmpty()) @@ -1262,7 +1267,7 @@ iconRect = QRect(textRect.x() + (textRect.width() - labelWidth) / 2, textRect.y() + (textRect.height() - labelHeight) / 2, - pixmap.width(), pixmap.height()); + pixmapWidth, pixmapHeight); iconRect = visualRect(button->direction, textRect, iconRect); @@ -1534,9 +1539,9 @@ if (!header->icon.isNull()) { QPixmap pixmap = header->icon.pixmap(proxy()->pixelMetric(PM_SmallIconSize), (header->state & State_Enabled) ? QIcon::Normal : QIcon::Disabled); - int pixw = pixmap.width(); + int pixw = pixmap.width() / pixmap.devicePixelRatio(); - QRect aligned = alignedRect(header->direction, QFlag(header->iconAlignment), pixmap.size(), rect); + QRect aligned = alignedRect(header->direction, QFlag(header->iconAlignment), pixmap.size() / pixmap.devicePixelRatio(), rect); QRect inter = aligned.intersected(rect); p->drawPixmap(inter.x(), inter.y(), pixmap, inter.x() - aligned.x(), inter.y() - aligned.y(), inter.width(), inter.height()); @@ -1591,7 +1596,7 @@ mode = QIcon::Normal; pm = toolbutton->icon.pixmap(toolbutton->rect.size().boundedTo(toolbutton->iconSize), mode, state); - pmSize = pm.size(); + pmSize = pm.size() / pm.devicePixelRatio(); } if (toolbutton->toolButtonStyle != Qt::ToolButtonIconOnly) { @@ -1814,8 +1819,8 @@ tr = cr; tr.adjust(4, 0, -8, 0); } else { - int iw = pm.width() + 4; - ih = pm.height(); + int iw = pm.width() / pm.devicePixelRatio() + 4; + ih = pm.height() / pm.devicePixelRatio(); ir = QRect(cr.left() + 4, cr.top(), iw + 2, ih); tr = QRect(ir.right(), cr.top(), cr.width() - ir.right() - 4, cr.height()); } diff -rau qt-everywhere-opensource-src-4.8.5/src/gui/styles/qmacstyle_mac.mm qt-adsk-4.8.5/src/gui/styles/qmacstyle_mac.mm --- qt-everywhere-opensource-src-4.8.5/src/gui/styles/qmacstyle_mac.mm 2013-06-07 13:16:59.000000000 +0800 +++ qt-adsk-4.8.5/src/gui/styles/qmacstyle_mac.mm 2013-09-22 09:31:41.000000000 +0800 @@ -1061,8 +1061,10 @@ bool qt_mac_buttonIsRenderedFlat(const QPushButton *pushButton, const QStyleOptionButton *option) { + // ADSK Change, temp fix, return if not mac or is flat + QMacStyle *macStyle = qobject_cast(pushButton->style()); - if (!macStyle) + if (!macStyle || pushButton->isFlat()) return true; // revert to 'flat' behavior if not Mac style HIThemeButtonDrawInfo bdi; macStyle->d->initHIThemePushButton(option, pushButton, kThemeStateActive, &bdi); @@ -3257,9 +3259,10 @@ QPixmap pixmap = header->icon.pixmap(proxy()->pixelMetric(PM_SmallIconSize), mode); QRect pixr = header->rect; - pixr.setY(header->rect.center().y() - (pixmap.height() - 1) / 2); + pixr.setY(header->rect.center().y() - (pixmap.height() / pixmap.devicePixelRatio() - 1) / 2); proxy()->drawItemPixmap(p, pixr, Qt::AlignVCenter, pixmap); - textr.translate(pixmap.width() + 2, 0); + textr.translate(pixmap.width() / pixmap.devicePixelRatio() + 2, 0); + } proxy()->drawItemText(p, textr, header->textAlignment | Qt::AlignVCenter, header->palette, @@ -3311,15 +3314,15 @@ if (tb->toolButtonStyle == Qt::ToolButtonTextUnderIcon) { QMainWindow *mw = qobject_cast(w->window()); if (mw && mw->unifiedTitleAndToolBarOnMac()) { - pr.setHeight(pixmap.size().height()); + pr.setHeight(pixmap.size().height() / pixmap.devicePixelRatio()); cr.adjust(0, pr.bottom() + 1, 0, 1); } else { - pr.setHeight(pixmap.size().height() + 6); + pr.setHeight(pixmap.size().height() / pixmap.devicePixelRatio() + 6); cr.adjust(0, pr.bottom(), 0, -3); - } + } alignment |= Qt::AlignCenter; } else { - pr.setWidth(pixmap.width() + 8); + pr.setWidth(pixmap.width() / pixmap.devicePixelRatio() + 8); cr.adjust(pr.right(), 0, 0, 0); alignment |= Qt::AlignLeft | Qt::AlignVCenter; } @@ -3510,10 +3513,12 @@ if (btn->state & State_On) state = QIcon::On; QPixmap pixmap = btn->icon.pixmap(btn->iconSize, mode, state); - contentW += pixmap.width() + QMacStylePrivate::PushButtonContentPadding; + int pixmapWidth = pixmap.width() / pixmap.devicePixelRatio(); + int pixmapHeight = pixmap.height() / pixmap.devicePixelRatio(); + contentW += pixmapWidth + QMacStylePrivate::PushButtonContentPadding; int iconLeftOffset = freeContentRect.x() + (freeContentRect.width() - contentW) / 2; - int iconTopOffset = freeContentRect.y() + (freeContentRect.height() - pixmap.height()) / 2; - QRect iconDestRect(iconLeftOffset, iconTopOffset, pixmap.width(), pixmap.height()); + int iconTopOffset = freeContentRect.y() + (freeContentRect.height() - pixmapHeight) / 2; + QRect iconDestRect(iconLeftOffset, iconTopOffset, pixmapWidth, pixmapHeight); QRect visualIconDestRect = visualRect(btn->direction, freeContentRect, iconDestRect); proxy()->drawItemPixmap(p, visualIconDestRect, Qt::AlignLeft | Qt::AlignVCenter, pixmap); int newOffset = iconDestRect.x() + iconDestRect.width() @@ -3943,8 +3948,8 @@ iconSize = comboBox->iconSize(); } QPixmap pixmap = mi->icon.pixmap(iconSize, mode); - int pixw = pixmap.width(); - int pixh = pixmap.height(); + int pixw = pixmap.width() / pixmap.devicePixelRatio(); + int pixh = pixmap.height() / pixmap.devicePixelRatio(); QRect cr(xpos, contentRect.y(), checkcol, contentRect.height()); QRect pmr(0, 0, pixw, pixh); pmr.moveCenter(cr.center()); @@ -6038,6 +6043,7 @@ QPixmap pixmap(qt_mac_toolbar_ext); if (standardIcon == SP_ToolBarVerticalExtensionButton) { QPixmap pix2(pixmap.height(), pixmap.width()); + pix2.setDevicePixelRatio(pixmap.devicePixelRatio()); pix2.fill(Qt::transparent); QPainter p(&pix2); p.translate(pix2.width(), 0); diff -rau qt-everywhere-opensource-src-4.8.5/src/gui/styles/qstyle.cpp qt-adsk-4.8.5/src/gui/styles/qstyle.cpp --- qt-everywhere-opensource-src-4.8.5/src/gui/styles/qstyle.cpp 2013-06-07 13:16:59.000000000 +0800 +++ qt-adsk-4.8.5/src/gui/styles/qstyle.cpp 2013-09-22 09:31:41.000000000 +0800 @@ -555,10 +555,12 @@ void QStyle::drawItemPixmap(QPainter *painter, const QRect &rect, int alignment, const QPixmap &pixmap) const { - QRect aligned = alignedRect(QApplication::layoutDirection(), QFlag(alignment), pixmap.size(), rect); + int scale = pixmap.devicePixelRatio(); + + QRect aligned = alignedRect(QApplication::layoutDirection(), QFlag(alignment), pixmap.size() / scale, rect); QRect inter = aligned.intersected(rect); - painter->drawPixmap(inter.x(), inter.y(), pixmap, inter.x() - aligned.x(), inter.y() - aligned.y(), inter.width(), inter.height()); + painter->drawPixmap(inter.x(), inter.y(), pixmap, inter.x() - aligned.x(), inter.y() - aligned.y(), inter.width() * scale, inter.height() * scale); } /*! diff -rau qt-everywhere-opensource-src-4.8.5/src/gui/styles/qstylehelper.cpp qt-adsk-4.8.5/src/gui/styles/qstylehelper.cpp --- qt-everywhere-opensource-src-4.8.5/src/gui/styles/qstylehelper.cpp 2013-06-07 13:16:59.000000000 +0800 +++ qt-adsk-4.8.5/src/gui/styles/qstylehelper.cpp 2013-09-22 09:31:41.000000000 +0800 @@ -91,8 +91,6 @@ ReleaseDC(0, hdcScreen); scale = dpi/96.0; } -#elif defined(Q_WS_MAC) - scale = qt_mac_get_scalefactor(); #endif } return value * scale; diff -rau qt-everywhere-opensource-src-4.8.5/src/gui/styles/qwindowsvistastyle.cpp qt-adsk-4.8.5/src/gui/styles/qwindowsvistastyle.cpp --- qt-everywhere-opensource-src-4.8.5/src/gui/styles/qwindowsvistastyle.cpp 2013-06-07 13:16:59.000000000 +0800 +++ qt-adsk-4.8.5/src/gui/styles/qwindowsvistastyle.cpp 2013-10-21 15:36:40.000000000 +0800 @@ -1842,30 +1842,31 @@ pGetThemePartSize(theme.handle(), 0, theme.partId, theme.stateId, 0, TS_TRUE, &size); int gw = size.cx, gh = size.cy; - - QRect gripperBounds; - if (flags & State_Horizontal && ((swidth - contentsMargin.cxLeftWidth - contentsMargin.cxRightWidth) > gw)) { - gripperBounds.setLeft(theme.rect.left() + swidth/2 - gw/2); - gripperBounds.setTop(theme.rect.top() + sheight/2 - gh/2); - gripperBounds.setWidth(gw); - gripperBounds.setHeight(gh); - } else if ((sheight - contentsMargin.cyTopHeight - contentsMargin.cyBottomHeight) > gh) { - gripperBounds.setLeft(theme.rect.left() + swidth/2 - gw/2); - gripperBounds.setTop(theme.rect.top() + sheight/2 - gh/2); - gripperBounds.setWidth(gw); - gripperBounds.setHeight(gh); - } - - // Draw gripper if there is enough space - if (!gripperBounds.isEmpty() && flags & State_Enabled) { - painter->save(); - XPThemeData grippBackground = theme; - grippBackground.partId = flags & State_Horizontal ? SBP_LOWERTRACKHORZ : SBP_LOWERTRACKVERT; - theme.rect = gripperBounds; - painter->setClipRegion(d->region(theme));// Only change inside the region of the gripper - d->drawBackground(grippBackground);// The gutter is the grippers background - d->drawBackground(theme); // Transparent gripper ontop of background - painter->restore(); + if (QSysInfo::WindowsVersion < QSysInfo::WV_WINDOWS8) { + QRect gripperBounds; + if (flags & State_Horizontal && ((swidth - contentsMargin.cxLeftWidth - contentsMargin.cxRightWidth) > gw)) { + gripperBounds.setLeft(theme.rect.left() + swidth/2 - gw/2); + gripperBounds.setTop(theme.rect.top() + sheight/2 - gh/2); + gripperBounds.setWidth(gw); + gripperBounds.setHeight(gh); + } else if ((sheight - contentsMargin.cyTopHeight - contentsMargin.cyBottomHeight) > gh) { + gripperBounds.setLeft(theme.rect.left() + swidth/2 - gw/2); + gripperBounds.setTop(theme.rect.top() + sheight/2 - gh/2); + gripperBounds.setWidth(gw); + gripperBounds.setHeight(gh); + } + + // Draw gripper if there is enough space + if (!gripperBounds.isEmpty() && flags & State_Enabled) { + painter->save(); + XPThemeData grippBackground = theme; + grippBackground.partId = flags & State_Horizontal ? SBP_LOWERTRACKHORZ : SBP_LOWERTRACKVERT; + theme.rect = gripperBounds; + painter->setClipRegion(d->region(theme));// Only change inside the region of the gripper + d->drawBackground(grippBackground);// The gutter is the grippers background + d->drawBackground(theme); // Transparent gripper ontop of background + painter->restore(); + } } } } diff -rau qt-everywhere-opensource-src-4.8.5/src/gui/text/qfont.cpp qt-adsk-4.8.5/src/gui/text/qfont.cpp --- qt-everywhere-opensource-src-4.8.5/src/gui/text/qfont.cpp 2013-06-07 13:16:59.000000000 +0800 +++ qt-adsk-4.8.5/src/gui/text/qfont.cpp 2013-11-26 14:52:16.000000000 +0800 @@ -1968,6 +1968,8 @@ "times new roman", "times", "courier new", "courier", "sans serif", "helvetica", +#elif defined(Q_WS_MAC) + ".lucida grande ui", "lucida grande", #elif defined(Q_WS_WIN) "times", "times new roman", "courier", "courier new", Only in qt-adsk-4.8.5/src/gui/text: ._qfontdatabase_mac.cpp diff -rau qt-everywhere-opensource-src-4.8.5/src/gui/text/qfontdatabase_mac.cpp qt-adsk-4.8.5/src/gui/text/qfontdatabase_mac.cpp --- qt-everywhere-opensource-src-4.8.5/src/gui/text/qfontdatabase_mac.cpp 2013-06-07 13:16:59.000000000 +0800 +++ qt-adsk-4.8.5/src/gui/text/qfontdatabase_mac.cpp 2013-11-29 22:12:02.000000000 +0800 @@ -325,9 +325,15 @@ for (int i = 0; i < family_list.size(); ++i) { for (int k = 0; k < db->count; ++k) { if (db->families[k]->name.compare(family_list.at(i), Qt::CaseInsensitive) == 0) { - QByteArray family_name = db->families[k]->name.toUtf8(); #if defined(QT_MAC_USE_COCOA) - QCFType ctFont = CTFontCreateWithName(QCFString(db->families[k]->name), 12, NULL); + CFStringRef familyName = QCFString::toCFStringRef(db->families[k]->name); + QCFType descriptor = CTFontDescriptorCreateWithAttributes( + QCFType(CFDictionaryCreate(kCFAllocatorDefault, + (const void**)&kCTFontFamilyNameAttribute, + (const void**)&familyName, 1, + &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks))); + CFRelease(familyName); + QCFType ctFont = CTFontCreateWithFontDescriptor(descriptor, 0, NULL); if (ctFont) { fontName = CTFontCopyFullName(ctFont); goto found; diff -rau qt-everywhere-opensource-src-4.8.5/src/gui/text/qtextdocumentlayout.cpp qt-adsk-4.8.5/src/gui/text/qtextdocumentlayout.cpp --- qt-everywhere-opensource-src-4.8.5/src/gui/text/qtextdocumentlayout.cpp 2013-06-07 13:16:59.000000000 +0800 +++ qt-adsk-4.8.5/src/gui/text/qtextdocumentlayout.cpp 2013-09-22 09:31:41.000000000 +0800 @@ -1403,7 +1403,20 @@ qreal xoff = fontMetrics.width(QLatin1Char(' ')); if (dir == Qt::LeftToRight) xoff = -xoff - size.width(); - r.translate( xoff, (fontMetrics.height() / 2 - size.height() / 2)); + r.translate( xoff, (fontMetrics.height() / 2) - (size.height() / 2)); + + // Prevent clipping the left side of the list decorator (on left to + // right layouts) and clipping the right side of the list + // decorator (on right to left layouts). + if ((r.left() < 0) && (dir == Qt::LeftToRight)) { + int horizontalOffset = -r.left(); + r.translate(horizontalOffset, 0); + layout->setPosition(layout->position() + QPointF(horizontalOffset, 0)); + } else if ((r.right() > document->pageSize().width()) && (dir == Qt::RightToLeft)) { + int horizontalOffset = r.right() - document->pageSize().width(); + r.translate(-horizontalOffset, 0); + layout->setPosition(layout->position() - QPointF(horizontalOffset, 0)); + } painter->save(); diff -rau qt-everywhere-opensource-src-4.8.5/src/gui/util/qsystemtrayicon.cpp qt-adsk-4.8.5/src/gui/util/qsystemtrayicon.cpp --- qt-everywhere-opensource-src-4.8.5/src/gui/util/qsystemtrayicon.cpp 2013-06-07 13:16:59.000000000 +0800 +++ qt-adsk-4.8.5/src/gui/util/qsystemtrayicon.cpp 2013-09-22 09:31:41.000000000 +0800 @@ -283,6 +283,22 @@ } /*! + \property QSystemTrayIcon::richTextEnabled + \brief whether the system tray's message supports rich text +*/ +void QSystemTrayIcon::enableRichText(bool richTextEnabled) +{ + Q_D(QSystemTrayIcon); + d->richTextEnabled = richTextEnabled; +} + +bool QSystemTrayIcon::isRichTextEnabled() const +{ + Q_D(const QSystemTrayIcon); + return d->richTextEnabled; +} + +/*! \reimp */ bool QSystemTrayIcon::event(QEvent *e) @@ -386,8 +402,24 @@ QSystemTrayIcon::MessageIcon icon, int msecs) { Q_D(QSystemTrayIcon); + if (d->visible) { + if (isRichTextEnabled()) + QBalloonTip::showBalloon(icon, title, msg, this, + geometry().center(), msecs, true); + else + d->showMessage_sys(title, msg, icon, msecs); + } +} + +void QSystemTrayIcon::showMessage(QBalloonTip* msgBalloon, int msecs) +{ + if (msgBalloon == 0) + return; + Q_D(QSystemTrayIcon); if (d->visible) - d->showMessage_sys(title, msg, icon, msecs); + QBalloonTip::showBalloon(msgBalloon, geometry().center(), msecs, true); + else + msgBalloon->close(); } ////////////////////////////////////////////////////////////////////// @@ -407,12 +439,38 @@ theSolitaryBalloonTip->balloon(pos, timeout, showArrow); } +void QBalloonTip::showBalloon(QBalloonTip* balloonTip, + const QPoint& pos, int timeout, bool showArrow) +{ + hideBalloon(); + if (balloonTip == 0) + return; + if ((!balloonTip->titleLabel || balloonTip->titleLabel->text().isEmpty()) && + (!balloonTip->msgLabel || balloonTip->msgLabel->text().isEmpty())) + { + balloonTip->close(); + return; + } + + theSolitaryBalloonTip = balloonTip; + if (timeout < 0) + timeout = 10000; //10 s default + theSolitaryBalloonTip->balloon(pos, timeout, showArrow); +} + void QBalloonTip::hideBalloon() { if (!theSolitaryBalloonTip) return; - theSolitaryBalloonTip->hide(); - delete theSolitaryBalloonTip; + // Original code: + // theSolitaryBalloonTip->hide(); + // delete theSolitaryBalloonTip; + // We shouldn't delete the tip here since we may come here when the tip is being closed + // (to show next balloon from messageClosed signal) and we should keep the object around + // till the close event is finished. Instead of deleting close the balloon. + // The balloon will be deleted later since it has DeleteOnClose attribute set. + // New code: + theSolitaryBalloonTip->close(); theSolitaryBalloonTip = 0; } @@ -423,12 +481,13 @@ QBalloonTip::QBalloonTip(QSystemTrayIcon::MessageIcon icon, const QString& title, const QString& message, QSystemTrayIcon *ti) - : QWidget(0, Qt::ToolTip), trayIcon(ti), timerId(-1) + : QWidget(0, Qt::ToolTip), trayIcon(ti), timerId(-1), msgLabel(0), + titleLabel(0), iconLabel(0), closeButton(0), layout(0) { setAttribute(Qt::WA_DeleteOnClose); QObject::connect(ti, SIGNAL(destroyed()), this, SLOT(close())); - QLabel *titleLabel = new QLabel; + titleLabel = new QLabel; titleLabel->installEventFilter(this); titleLabel->setText(title); QFont f = titleLabel->font(); @@ -447,21 +506,29 @@ const int closeButtonSize = 15; #endif - QPushButton *closeButton = new QPushButton; + closeButton = new QPushButton; closeButton->setIcon(style()->standardIcon(QStyle::SP_TitleBarCloseButton)); closeButton->setIconSize(QSize(closeButtonSize, closeButtonSize)); closeButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); closeButton->setFixedSize(closeButtonSize, closeButtonSize); QObject::connect(closeButton, SIGNAL(clicked()), this, SLOT(close())); - - QLabel *msgLabel = new QLabel; + QObject::connect(closeButton, SIGNAL(clicked()), trayIcon, SIGNAL(messageCloseButtonClicked())); + + msgLabel = new QLabel; #ifdef Q_WS_WINCE f.setBold(false); msgLabel->setFont(f); #endif msgLabel->installEventFilter(this); msgLabel->setText(message); - msgLabel->setTextFormat(Qt::PlainText); + + if (trayIcon->isRichTextEnabled()) { + msgLabel->setTextFormat(Qt::RichText); + bool b = connect(msgLabel, SIGNAL(linkActivated(QString)), this, SLOT(messageLinkActivated(QString))); + Q_ASSERT(b); + } else { + msgLabel->setTextFormat(Qt::PlainText); + } msgLabel->setAlignment(Qt::AlignTop | Qt::AlignLeft); // smart size for the message label @@ -507,9 +574,9 @@ break; } - QGridLayout *layout = new QGridLayout; + layout = new QGridLayout; if (!si.isNull()) { - QLabel *iconLabel = new QLabel; + iconLabel = new QLabel; iconLabel->setPixmap(si.pixmap(iconSize, iconSize)); iconLabel->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); iconLabel->setMargin(2); @@ -648,6 +715,18 @@ void QBalloonTip::mousePressEvent(QMouseEvent *e) { + if (msgLabel) { + QPoint posInLabel = msgLabel->mapFrom(this, e->pos()); + QLabelPrivate* msgLabel_p = msgLabel->d_func(); + QString link; + if (msgLabel_p && msgLabel_p->isTextLabel && msgLabel_p->layoutRect().contains(posInLabel)) + link = msgLabel_p->control->document()->documentLayout()->anchorAt( + msgLabel_p->layoutPoint(posInLabel)); + if (!link.isEmpty()) + return; + // Link clicked. messageLinkClicked signal emitted already. + } + close(); if(e->button() == Qt::LeftButton) emit trayIcon->messageClicked(); @@ -664,6 +743,19 @@ QWidget::timerEvent(e); } +void QBalloonTip::closeEvent(QCloseEvent* e) +{ + msgLabel = 0; + QWidget::closeEvent(e); + emit trayIcon->messageClosed(); +} + +void QBalloonTip::messageLinkActivated(const QString& link) +{ + close(); + emit trayIcon->messageLinkClicked(link); +} + void qtsystray_sendActivated(QSystemTrayIcon *i, int r) { emit i->activated((QSystemTrayIcon::ActivationReason)r); diff -rau qt-everywhere-opensource-src-4.8.5/src/gui/util/qsystemtrayicon.h qt-adsk-4.8.5/src/gui/util/qsystemtrayicon.h --- qt-everywhere-opensource-src-4.8.5/src/gui/util/qsystemtrayicon.h 2013-06-07 13:16:59.000000000 +0800 +++ qt-adsk-4.8.5/src/gui/util/qsystemtrayicon.h 2013-09-22 09:31:41.000000000 +0800 @@ -55,7 +55,7 @@ QT_MODULE(Gui) class QSystemTrayIconPrivate; - +class QBalloonTip; class QMenu; class QEvent; class QWheelEvent; @@ -68,6 +68,7 @@ Q_PROPERTY(QString toolTip READ toolTip WRITE setToolTip) Q_PROPERTY(QIcon icon READ icon WRITE setIcon) Q_PROPERTY(bool visible READ isVisible WRITE setVisible DESIGNABLE false) + Q_PROPERTY(bool richTextEnabled READ isRichTextEnabled WRITE enableRichText) public: QSystemTrayIcon(QObject *parent = 0); @@ -93,12 +94,16 @@ QString toolTip() const; void setToolTip(const QString &tip); + bool isRichTextEnabled() const; + void enableRichText(bool enabled); + static bool isSystemTrayAvailable(); static bool supportsMessages(); enum MessageIcon { NoIcon, Information, Warning, Critical }; void showMessage(const QString &title, const QString &msg, MessageIcon icon = Information, int msecs = 10000); + void showMessage(QBalloonTip* msgBalloon, int msecs = 10000); QRect geometry() const; bool isVisible() const; @@ -111,6 +116,9 @@ Q_SIGNALS: void activated(QSystemTrayIcon::ActivationReason reason); void messageClicked(); + void messageLinkClicked(const QString &link); + void messageClosed(); + void messageCloseButtonClicked(); protected: bool event(QEvent *event); diff -rau qt-everywhere-opensource-src-4.8.5/src/gui/util/qsystemtrayicon_p.h qt-adsk-4.8.5/src/gui/util/qsystemtrayicon_p.h --- qt-everywhere-opensource-src-4.8.5/src/gui/util/qsystemtrayicon_p.h 2013-06-07 13:16:59.000000000 +0800 +++ qt-adsk-4.8.5/src/gui/util/qsystemtrayicon_p.h 2013-09-22 09:31:41.000000000 +0800 @@ -68,13 +68,15 @@ class QSystemTrayIconSys; class QToolButton; class QLabel; +class QPushButton; +class QGridLayout; class QSystemTrayIconPrivate : public QObjectPrivate { Q_DECLARE_PUBLIC(QSystemTrayIcon) public: - QSystemTrayIconPrivate() : sys(0), visible(false) { } + QSystemTrayIconPrivate() : sys(0), visible(false), richTextEnabled(false) { } void install_sys(); void remove_sys(); @@ -92,34 +94,47 @@ QString toolTip; QSystemTrayIconSys *sys; bool visible; + bool richTextEnabled; }; -class QBalloonTip : public QWidget +class Q_GUI_EXPORT QBalloonTip : public QWidget { Q_OBJECT public: static void showBalloon(QSystemTrayIcon::MessageIcon icon, const QString& title, const QString& msg, QSystemTrayIcon *trayIcon, const QPoint& pos, int timeout, bool showArrow = true); + static void showBalloon(QBalloonTip* balloonTip, + const QPoint& pos, int timeout, bool showArrow = true); static void hideBalloon(); static bool isBalloonVisible(); -private: +private Q_SLOTS: + void messageLinkActivated(const QString& link); + +protected: QBalloonTip(QSystemTrayIcon::MessageIcon icon, const QString& title, const QString& msg, QSystemTrayIcon *trayIcon); - ~QBalloonTip(); - void balloon(const QPoint&, int, bool); + virtual ~QBalloonTip(); + +private: + virtual void balloon(const QPoint&, int, bool); protected: void paintEvent(QPaintEvent *); void resizeEvent(QResizeEvent *); void mousePressEvent(QMouseEvent *e); void timerEvent(QTimerEvent *e); + void closeEvent(QCloseEvent* e); -private: QSystemTrayIcon *trayIcon; QPixmap pixmap; int timerId; + QLabel *msgLabel; + QLabel *titleLabel; + QLabel *iconLabel; + QPushButton *closeButton; + QGridLayout *layout; }; #if defined(Q_WS_X11) diff -rau qt-everywhere-opensource-src-4.8.5/src/gui/widgets/qabstractbutton.cpp qt-adsk-4.8.5/src/gui/widgets/qabstractbutton.cpp --- qt-everywhere-opensource-src-4.8.5/src/gui/widgets/qabstractbutton.cpp 2013-06-07 13:16:59.000000000 +0800 +++ qt-adsk-4.8.5/src/gui/widgets/qabstractbutton.cpp 2013-09-22 09:31:41.000000000 +0800 @@ -1053,9 +1053,10 @@ case QEvent::HoverEnter: case QEvent::HoverLeave: case QEvent::ContextMenu: -#ifndef QT_NO_WHEELEVENT - case QEvent::Wheel: -#endif +// ADSK commented out - want wheel event propagate from disabled widgets to parents +//#ifndef QT_NO_WHEELEVENT +// case QEvent::Wheel: +//#endif return true; default: break; diff -rau qt-everywhere-opensource-src-4.8.5/src/gui/widgets/qdockarealayout.cpp qt-adsk-4.8.5/src/gui/widgets/qdockarealayout.cpp --- qt-everywhere-opensource-src-4.8.5/src/gui/widgets/qdockarealayout.cpp 2013-06-07 13:16:59.000000000 +0800 +++ qt-adsk-4.8.5/src/gui/widgets/qdockarealayout.cpp 2013-09-22 09:31:41.000000000 +0800 @@ -188,6 +188,35 @@ return QSize(-1, -1); } +//ADSK: new functions +QSize QDockAreaLayoutItem::itemSize() const +{ + if (placeHolderItem != 0) + return QSize(0, 0); + if (widgetItem != 0) { + QVariant v = widgetItem->widget()->property("savedSize"); + if(v.isValid()) { + return v.value(); + } else { + return widgetItem->sizeHint(); + } + } + if (subinfo != 0) + return subinfo->size(); + return QSize(-1, -1); +} + +void QDockAreaLayoutItem::saveCurrentSize() const +{ + if (placeHolderItem != 0) + return; + if (widgetItem != 0) + widgetItem->widget()->setProperty("savedSize", qVariantFromValue(widgetItem->widget()->size())); + if (subinfo != 0) + subinfo->saveCurrentSize(); +} +//ADSK: end of new functions + QDockAreaLayoutItem &QDockAreaLayoutItem::operator = (const QDockAreaLayoutItem &other) { @@ -248,7 +277,113 @@ QSize QDockAreaLayoutInfo::size() const { - return isEmpty() ? QSize(0, 0) : rect.size(); + if (isEmpty()) + return QSize(0, 0); + +//ADSK: new functionality + int a = 0, b = 0; + bool prev_gap = false; + bool first = true; + int min_perp = 0; + int max_perp = QWIDGETSIZE_MAX; + for (int i = 0; i < item_list.size(); ++i) { + const QDockAreaLayoutItem &item = item_list.at(i); + if (item.skip()) + continue; + + bool gap = item.flags & QDockAreaLayoutItem::GapItem; + + QSize item_size = item.itemSize(); + +#ifndef QT_NO_TABBAR + if (tabbed) { + if(tabId(item) == currentTabId()) { + a = qMax(a, gap ? item.size : pick(o, item_size)); + } else { + continue; + } + } else +#endif + { + if(item.widgetItem != 0 && item.widgetItem->widget()->isHidden()) { + continue; + } else { + if (!first && !gap && !prev_gap) + a += *sep; + a += gap ? item.size : pick(o, item_size); + } + } + b = qMax(b, perp(o, item_size)); + + min_perp = qMax(min_perp, perp(o, item.minimumSize())); + max_perp = qMin(max_perp, perp(o, item.maximumSize())); + + prev_gap = gap; + first = false; + } + + max_perp = qMax(max_perp, min_perp); + b = qMax(b, min_perp); + b = qMin(b, max_perp); + + QSize result; + rpick(o, result) = a; + rperp(o, result) = b; + +#ifndef QT_NO_TABBAR + if (tabbed) { + QSize tbh = tabBarSizeHint(); + if (!tbh.isNull()) { + switch (tabBarShape) { + case QTabBar::RoundedNorth: + case QTabBar::RoundedSouth: + result.rheight() += tbh.height(); + result.rwidth() = qMax(tbh.width(), result.width()); + break; + case QTabBar::RoundedEast: + case QTabBar::RoundedWest: + result.rheight() = qMax(tbh.height(), result.height()); + result.rwidth() += tbh.width(); + break; + default: + break; + } + } + } +#endif // QT_NO_TABBAR + + return result; +//ADSK: end of new code +} + +//ADSK: new function +void QDockAreaLayoutInfo::saveCurrentSize() const +{ + if (isEmpty()) + return; + + for (int i = 0; i < item_list.size(); ++i) { + const QDockAreaLayoutItem &item = item_list.at(i); + if (item.skip()) + continue; + +#ifndef QT_NO_TABBAR + if (tabbed) { + if(tabId(item) == currentTabId()) { + item.saveCurrentSize(); + } else { + continue; + } + } else +#endif + { + if(item.widgetItem != 0 && item.widgetItem->widget()->isHidden()) { + continue; + } else { + item.saveCurrentSize(); + } + } + } } void QDockAreaLayoutInfo::clear() @@ -271,6 +406,7 @@ if (isEmpty()) return QSize(0, 0); +//ADSK: new functionality int a = 0, b = 0; bool first = true; for (int i = 0; i < item_list.size(); ++i) { @@ -281,13 +417,21 @@ QSize min_size = item.minimumSize(); #ifndef QT_NO_TABBAR if (tabbed) { - a = qMax(a, pick(o, min_size)); + if(tabId(item) == currentTabId()) { + a = qMax(a, pick(o, min_size)); + } else { + continue; + } } else #endif { - if (!first) - a += *sep; - a += pick(o, min_size); + if(item.widgetItem != 0 && item.widgetItem->widget()->isHidden()) { + continue; + } else { + if (!first) + a += *sep; + a += pick(o, min_size); + } } b = qMax(b, perp(o, min_size)); @@ -349,16 +493,26 @@ #ifndef QT_NO_TABBAR if (tabbed) { - a = qMin(a, pick(o, max_size)); + if(tabId(item) == currentTabId()) { + a = qMin(a, pick(o, max_size)); + } else { + continue; + } } else #endif { - if (!first) - a += *sep; - a += pick(o, max_size); + if(item.widgetItem != 0 && item.widgetItem->widget()->isHidden()) { + continue; + } else { + if (!first) + a += *sep; + a += pick(o, max_size); + } } b = qMin(b, perp(o, max_size)); + min_perp = qMax(min_perp, perp(o, item.minimumSize())); + a = qMin(a, int(QWIDGETSIZE_MAX)); b = qMin(b, int(QWIDGETSIZE_MAX)); @@ -409,23 +563,33 @@ bool gap = item.flags & QDockAreaLayoutItem::GapItem; QSize size_hint = item.sizeHint(); - min_perp = qMax(min_perp, perp(o, item.minimumSize())); - max_perp = qMin(max_perp, perp(o, item.maximumSize())); #ifndef QT_NO_TABBAR if (tabbed) { - a = qMax(a, gap ? item.size : pick(o, size_hint)); + if(tabId(item) == currentTabId()) { + a = qMax(a, gap ? item.size : pick(o, size_hint)); + } else { + continue; + } } else #endif { - if (previous && !gap && !(previous->flags & QDockAreaLayoutItem::GapItem) - && !previous->hasFixedSize(o)) { - a += *sep; + if(item.widgetItem != 0 && item.widgetItem->widget()->isHidden()) { + continue; + } else { + + if (previous && !gap && !(previous->flags & QDockAreaLayoutItem::GapItem) + && !previous->hasFixedSize(o)) { + a += *sep; + } + a += gap ? item.size : pick(o, size_hint); } - a += gap ? item.size : pick(o, size_hint); } b = qMax(b, perp(o, size_hint)); + min_perp = qMax(min_perp, perp(o, item.minimumSize())); + max_perp = qMin(max_perp, perp(o, item.maximumSize())); + previous = &item; } @@ -1471,7 +1635,7 @@ continue; } - if (!(item.flags & QDockAreaLayoutItem::GapItem) && item.widgetItem->widget() == widget) { + if (!(item.flags & QDockAreaLayoutItem::GapItem) && item.widgetItem && item.widgetItem->widget() == widget) { QList result; result << i; return result; @@ -1557,6 +1721,10 @@ QDockWidget *dw = qobject_cast(w); if (!r.isValid() && geo.right() >= 0 && geo.bottom() >= 0) { dw->lower(); +//ADSK: new check + if (dw->focusWidget()) + dw->focusWidget()->clearFocus(); +//ADSK: end of check emit dw->visibilityChanged(false); } else if (r.isValid() && (geo.right() < 0 || geo.bottom() < 0)) { @@ -3044,6 +3212,14 @@ Q_ASSERT(info != 0); info->tab(path.last(), new QDockWidgetItem(second)); +//ADSK: new code + // If the dock widget being tabbed onto is collapsed, collapse + // the dock widget being tabbed into it as well + if(first->maximumSize().isNull()) { + second->setFixedSize(0,0); + } +//ADSK: end of code + QList index = indexOfPlaceHolder(second->objectName()); if (!index.isEmpty()) remove(index); @@ -3061,6 +3237,14 @@ Q_ASSERT(info != 0); info->split(path.last(), orientation, new QDockWidgetItem(dockWidget)); +//ADSK: new code + // If the dock widget being split is collapsed, collapse + // the dock widget being attached to it as well + if(after->maximumSize().isNull()) { + dockWidget->setFixedSize(0,0); + } +//ADSK: end of code + QList index = indexOfPlaceHolder(dockWidget->objectName()); if (!index.isEmpty()) remove(index); @@ -3128,6 +3312,8 @@ if (delta != 0) delta = info->separatorMove(index, delta); info->apply(false); + // Save the new size of the dock widget area + info->saveCurrentSize(); return delta; } @@ -3153,6 +3339,10 @@ setGrid(&list, 0); apply(false); +//ADSK: modified code + // Save the new size of the dock widget area + docks[index].saveCurrentSize(); +//ADSK: end of code return delta; } diff -rau qt-everywhere-opensource-src-4.8.5/src/gui/widgets/qdockarealayout_p.h qt-adsk-4.8.5/src/gui/widgets/qdockarealayout_p.h --- qt-everywhere-opensource-src-4.8.5/src/gui/widgets/qdockarealayout_p.h 2013-06-07 13:16:59.000000000 +0800 +++ qt-adsk-4.8.5/src/gui/widgets/qdockarealayout_p.h 2013-09-22 09:31:41.000000000 +0800 @@ -105,6 +105,11 @@ bool expansive(Qt::Orientation o) const; bool hasFixedSize(Qt::Orientation o) const; +//ADSK: added functions + QSize itemSize() const; + void saveCurrentSize() const; +//ADSK: end of functions + QLayoutItem *widgetItem; QDockAreaLayoutInfo *subinfo; QPlaceHolderItem *placeHolderItem; @@ -136,6 +141,9 @@ QSize sizeHint() const; QSize size() const; +//ADSK: added function + void saveCurrentSize() const; + bool insertGap(const QList &path, QLayoutItem *dockWidgetItem); QLayoutItem *plug(const QList &path); QLayoutItem *unplug(const QList &path); diff -rau qt-everywhere-opensource-src-4.8.5/src/gui/widgets/qdockwidget.cpp qt-adsk-4.8.5/src/gui/widgets/qdockwidget.cpp --- qt-everywhere-opensource-src-4.8.5/src/gui/widgets/qdockwidget.cpp 2013-06-07 13:16:59.000000000 +0800 +++ qt-adsk-4.8.5/src/gui/widgets/qdockwidget.cpp 2013-09-22 09:31:41.000000000 +0800 @@ -1167,6 +1167,8 @@ { Q_D(QDockWidget); d->init(); +//ADSK: add connection + connect(this, SIGNAL(visibilityChanged(bool)), this, SLOT(handleVisibilityChange(bool))); } /*! @@ -1186,6 +1188,8 @@ Q_D(QDockWidget); d->init(); setWindowTitle(title); +//ADSK: add connection + connect(this, SIGNAL(visibilityChanged(bool)), this, SLOT(handleVisibilityChange(bool))); } /*! @@ -1281,6 +1285,9 @@ d->endDrag(true); QRect r = d->undockedGeometry; + // Keep position when undocking for the first time. + if (floating && isVisible() && !r.isValid()) + r = QRect(mapToGlobal(QPoint(0, 0)), size()); d->setWindowState(floating, false, floating ? r : QRect()); @@ -1406,9 +1413,12 @@ d->toggleViewAction->setChecked(false); emit visibilityChanged(false); break; - case QEvent::Show: + case QEvent::Show: { d->toggleViewAction->setChecked(true); - emit visibilityChanged(geometry().right() >= 0 && geometry().bottom() >= 0); + const QPoint parentTopLeft = isWindow() ? + QApplication::desktop()->availableGeometry(this).topLeft() : QPoint(0, 0); + emit visibilityChanged(geometry().right() >= parentTopLeft.x() && geometry().bottom() >= parentTopLeft.y()); + } break; #endif case QEvent::ApplicationLayoutDirectionChange: @@ -1615,6 +1625,51 @@ return layout->widgetForRole(QDockWidgetLayout::TitleBar); } +//ADSK: added function +void QDockWidget::handleVisibilityChange(bool visible) +{ + if(!visible && maximumSize().isNull() && isHidden()) { + // Dock widget is collapsed and is being hidden + + // Find out how many visible dock widgets are left after this one + // is hidden. If there is only one left, expand all collapsed + // widgets in this dock area, since the tab bar will disappear + // and the collapsed state, which relies on the tab bar to expand + // again, can thus no longer be maintained + if(QMainWindow *win = qobject_cast(parentWidget())) { + Qt::DockWidgetArea area = win->dockWidgetArea(this); + QObjectList childrenList = win->children(); + QList visibleDWs; + QList areaDWs; + for(int i = 0; i < childrenList.count(); i++) { + QDockWidget *dw = qobject_cast(childrenList[i]); + if(dw && win->dockWidgetArea(dw) == area) { + areaDWs.append(dw); + if(!dw->isHidden()) { + visibleDWs.append(dw); + if(visibleDWs.count() > 1) return; + } + } + } + // If we reach this point, there is at most one visible dock widget + // left, so do the expansion + for(int i = 0; i < areaDWs.count(); i++) { + QDockWidget *dw = areaDWs[i]; + if(dw && dw->maximumSize().isNull()) { + dw->setMaximumSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX); + // Restore the previous size of the dock widget + QVariant v = dw->property("savedSize"); + if(v.isValid()) { + dw->resize(v.value()); + } else { + dw->resize(dw->sizeHint()); + } + } + } + } + } +} + QT_END_NAMESPACE #include "qdockwidget.moc" diff -rau qt-everywhere-opensource-src-4.8.5/src/gui/widgets/qdockwidget.h qt-adsk-4.8.5/src/gui/widgets/qdockwidget.h --- qt-everywhere-opensource-src-4.8.5/src/gui/widgets/qdockwidget.h 2013-06-07 13:16:59.000000000 +0800 +++ qt-adsk-4.8.5/src/gui/widgets/qdockwidget.h 2013-09-22 09:31:41.000000000 +0800 @@ -123,6 +123,10 @@ bool event(QEvent *event); void initStyleOption(QStyleOptionDockWidget *option) const; +//ADSK: added function +private slots: + void handleVisibilityChange(bool visible); + private: Q_DECLARE_PRIVATE(QDockWidget) Q_DISABLE_COPY(QDockWidget) diff -rau qt-everywhere-opensource-src-4.8.5/src/gui/widgets/qlabel.cpp qt-adsk-4.8.5/src/gui/widgets/qlabel.cpp --- qt-everywhere-opensource-src-4.8.5/src/gui/widgets/qlabel.cpp 2013-06-07 13:16:59.000000000 +0800 +++ qt-adsk-4.8.5/src/gui/widgets/qlabel.cpp 2013-09-22 09:31:41.000000000 +0800 @@ -644,8 +644,10 @@ int vextra = hextra; QFontMetrics fm = q->fontMetrics(); - if (pixmap && !pixmap->isNull()) + if (pixmap && !pixmap->isNull()) { br = pixmap->rect(); + br.setSize(br.size() / pixmap->devicePixelRatio()); + } #ifndef QT_NO_PICTURE else if (picture && !picture->isNull()) br = picture->boundingRect(); diff -rau qt-everywhere-opensource-src-4.8.5/src/gui/widgets/qmainwindowlayout.cpp qt-adsk-4.8.5/src/gui/widgets/qmainwindowlayout.cpp --- qt-everywhere-opensource-src-4.8.5/src/gui/widgets/qmainwindowlayout.cpp 2013-06-07 13:16:59.000000000 +0800 +++ qt-adsk-4.8.5/src/gui/widgets/qmainwindowlayout.cpp 2013-09-22 09:31:41.000000000 +0800 @@ -1307,6 +1307,8 @@ result->setElideMode(Qt::ElideRight); result->setDocumentMode(_documentMode); connect(result, SIGNAL(currentChanged(int)), this, SLOT(tabChanged())); +//ADSK: added connection + connect(result, SIGNAL(currentReselected()), this, SLOT(toggleDockWidgets())); } usedTabBars.insert(result); @@ -1337,11 +1339,66 @@ QDockAreaLayoutInfo *info = layoutState.dockAreaLayout.info(tb); if (info == 0) return; + +//ADSK: additional functionality + // If the tabbed dock widgets are currently in collapsed state, expand them again + Qt::DockWidgetArea area = toDockWidgetArea(info->dockPos); + QObjectList childrenList = layoutState.mainWindow->children(); + for(int i = 0; i < childrenList.count(); i++) { + QDockWidget *dw = qobject_cast(childrenList[i]); + if(dw && layoutState.mainWindow->dockWidgetArea(dw) == area) { + if(dw->maximumSize().isNull()) { + dw->setMaximumSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX); + // Restore the previous size of the dock widget + QVariant v = dw->property("savedSize"); + if(v.isValid()) { + dw->resize(v.value()); + } else { + dw->resize(dw->sizeHint()); + } + } + } + } +//ADSK: end of change + info->apply(false); if (QWidget *w = centralWidget()) w->raise(); } + +//ADSK: new function +void QMainWindowLayout::toggleDockWidgets() +{ + QTabBar *tb = qobject_cast(sender()); + if (tb == 0) + return; + QDockAreaLayoutInfo *info = layoutState.dockAreaLayout.info(tb); + if (info == 0) + return; + // Collapse or expand all the dock widgets tabbed on this tab bar + Qt::DockWidgetArea area = toDockWidgetArea(info->dockPos); + QObjectList childrenList = layoutState.mainWindow->children(); + for(int i = 0; i < childrenList.count(); i++) { + QDockWidget *dw = qobject_cast(childrenList[i]); + if(dw && !dw->isFloating() && layoutState.mainWindow->dockWidgetArea(dw) == area) { + if(dw->maximumSize().isNull()) { + dw->setMaximumSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX); + // Restore the previous size of the dock widget + QVariant v = dw->property("savedSize"); + if(v.isValid()) { + dw->resize(v.value()); + } else { + dw->resize(dw->sizeHint()); + } + } else { + // Save the current size of the dock widget before collapsing + dw->setProperty("savedSize", qVariantFromValue(dw->size())); + dw->setFixedSize(0,0); + } + } + } +} #endif // QT_NO_TABBAR bool QMainWindowLayout::startSeparatorMove(const QPoint &pos) diff -rau qt-everywhere-opensource-src-4.8.5/src/gui/widgets/qmainwindowlayout_p.h qt-adsk-4.8.5/src/gui/widgets/qmainwindowlayout_p.h --- qt-everywhere-opensource-src-4.8.5/src/gui/widgets/qmainwindowlayout_p.h 2013-06-07 13:16:59.000000000 +0800 +++ qt-adsk-4.8.5/src/gui/widgets/qmainwindowlayout_p.h 2013-09-22 09:31:41.000000000 +0800 @@ -305,6 +305,8 @@ #ifndef QT_NO_DOCKWIDGET #ifndef QT_NO_TABBAR void tabChanged(); +//ADSK: added function + void toggleDockWidgets(); #endif #endif private: diff -rau qt-everywhere-opensource-src-4.8.5/src/gui/widgets/qmenu.cpp qt-adsk-4.8.5/src/gui/widgets/qmenu.cpp --- qt-everywhere-opensource-src-4.8.5/src/gui/widgets/qmenu.cpp 2013-06-07 13:16:59.000000000 +0800 +++ qt-adsk-4.8.5/src/gui/widgets/qmenu.cpp 2013-11-08 03:24:52.000000000 +0800 @@ -124,6 +124,7 @@ setAttribute(Qt::WA_X11NetWmWindowTypeMenu, true); setWindowTitle(p->windowTitle()); setEnabled(p->isEnabled()); + setSeparatorsCollapsible(p->separatorsCollapsible()); //QObject::connect(this, SIGNAL(triggered(QAction*)), this, SLOT(onTrigger(QAction*))); //QObject::connect(this, SIGNAL(hovered(QAction*)), this, SLOT(onHovered(QAction*))); QList items = p->actions(); @@ -1665,6 +1666,30 @@ return false; } +//ADSK: added function +/*! + This function will forcibly show the torn off menu making it + appear on the users desktop. + + \sa hideTearOffMenu() isTearOffMenuVisible() isTearOffEnabled() +*/ +void QMenu::showTearOffMenu(QPoint *pos) +{ + if (!d_func()->tornPopup) + d_func()->tornPopup = new QTornOffMenu(this); + QSize s = sizeHint(); + QPoint p; + if(NULL != pos) { + p.setX(pos->x()); + p.setY(pos->y()); + } else { + p = QCursor::pos(); + } + d_func()->tornPopup->setGeometry(p.x(), p.y(), s.width(), s.height()); + d_func()->tornPopup->show(); +} + + /*! This function will forcibly hide the torn off menu making it disappear from the users desktop. @@ -2863,9 +2888,9 @@ d->hasHadMouse = d->hasHadMouse || rect().contains(e->pos()); QAction *action = d->actionAt(e->pos()); - if (!action) { + if (!action || action->isSeparator()) { if (d->hasHadMouse - && (!d->currentAction + && (!d->currentAction || (action && action->isSeparator()) || !(d->currentAction->menu() && d->currentAction->menu()->isVisible()))) d->setCurrentAction(0); return; diff -rau qt-everywhere-opensource-src-4.8.5/src/gui/widgets/qmenu.h qt-adsk-4.8.5/src/gui/widgets/qmenu.h --- qt-everywhere-opensource-src-4.8.5/src/gui/widgets/qmenu.h 2013-06-07 13:16:59.000000000 +0800 +++ qt-adsk-4.8.5/src/gui/widgets/qmenu.h 2013-09-22 09:31:41.000000000 +0800 @@ -111,6 +111,8 @@ bool isTearOffEnabled() const; bool isTearOffMenuVisible() const; +//ADSK: added function + void showTearOffMenu(QPoint *pos=0); void hideTearOffMenu(); void setDefaultAction(QAction *); diff -rau qt-everywhere-opensource-src-4.8.5/src/gui/widgets/qmenu_mac.mm qt-adsk-4.8.5/src/gui/widgets/qmenu_mac.mm --- qt-everywhere-opensource-src-4.8.5/src/gui/widgets/qmenu_mac.mm 2013-06-07 13:16:59.000000000 +0800 +++ qt-adsk-4.8.5/src/gui/widgets/qmenu_mac.mm 2013-09-22 09:31:41.000000000 +0800 @@ -2014,6 +2014,11 @@ void qt_mac_clear_menubar() { + // ADSK change, Maya controls custom Main Menu + if (QApplication::testAttribute(Qt::AA_DontUseNativeMenuBar)) + return; + // ADSK end change + if (QApplication::testAttribute(Qt::AA_MacPluginApplication)) return; diff -rau qt-everywhere-opensource-src-4.8.5/src/gui/widgets/qtabbar.cpp qt-adsk-4.8.5/src/gui/widgets/qtabbar.cpp --- qt-everywhere-opensource-src-4.8.5/src/gui/widgets/qtabbar.cpp 2013-06-07 13:16:59.000000000 +0800 +++ qt-adsk-4.8.5/src/gui/widgets/qtabbar.cpp 2013-09-22 09:31:41.000000000 +0800 @@ -1758,9 +1758,14 @@ QStyleOptionTabBarBaseV2 optTabBase; optTabBase.init(this); optTabBase.documentMode = d->documentMode; - if (event->type() == style()->styleHint(QStyle::SH_TabBar_SelectMouseType, &optTabBase, this)) - setCurrentIndex(d->pressedIndex); - else +//ADSK: additional check and emit code + if (event->type() == style()->styleHint(QStyle::SH_TabBar_SelectMouseType, &optTabBase, this)) { + if(d->pressedIndex == d->currentIndex) { + emit currentReselected(); + } + setCurrentIndex(d->pressedIndex); + } else +//ADSK: end of change repaint(tabRect(d->pressedIndex)); if (d->movable) { d->dragStartPosition = event->pos(); diff -rau qt-everywhere-opensource-src-4.8.5/src/gui/widgets/qtabbar.h qt-adsk-4.8.5/src/gui/widgets/qtabbar.h --- qt-everywhere-opensource-src-4.8.5/src/gui/widgets/qtabbar.h 2013-06-07 13:16:59.000000000 +0800 +++ qt-adsk-4.8.5/src/gui/widgets/qtabbar.h 2013-09-22 09:31:41.000000000 +0800 @@ -178,6 +178,8 @@ Q_SIGNALS: void currentChanged(int index); +//ADSK: added function + void currentReselected(); void tabCloseRequested(int index); void tabMoved(int from, int to); diff -rau qt-everywhere-opensource-src-4.8.5/src/gui/widgets/qtabwidget.cpp qt-adsk-4.8.5/src/gui/widgets/qtabwidget.cpp --- qt-everywhere-opensource-src-4.8.5/src/gui/widgets/qtabwidget.cpp 2013-06-07 13:16:59.000000000 +0800 +++ qt-adsk-4.8.5/src/gui/widgets/qtabwidget.cpp 2013-09-22 09:31:41.000000000 +0800 @@ -777,17 +777,21 @@ if (onlyCheck && !d->dirty) return; // nothing to do - QStyleOptionTabWidgetFrameV2 option; - initStyleOption(&option); - - // this must be done immediately, because QWidgetItem relies on it (even if !isVisible()) - d->setLayoutItemMargins(QStyle::SE_TabWidgetLayoutItem, &option); - if (!isVisible()) { + QStyleOptionTabWidgetFrame option; + initStyleOption(&option); + // this must be done immediately, because QWidgetItem relies on it (even if !isVisible()) + d->setLayoutItemMargins(QStyle::SE_TabWidgetLayoutItem, &option); + d->dirty = true; return; // we'll do it later } + QStyleOptionTabWidgetFrameV2 option; + initStyleOption(&option); + + d->setLayoutItemMargins(QStyle::SE_TabWidgetLayoutItem, &option); + QRect tabRect = style()->subElementRect(QStyle::SE_TabWidgetTabBar, &option, this); d->panelRect = style()->subElementRect(QStyle::SE_TabWidgetTabPane, &option, this); QRect contentsRect = style()->subElementRect(QStyle::SE_TabWidgetTabContents, &option, this); diff -rau qt-everywhere-opensource-src-4.8.5/src/network/access/qhttpnetworkconnectionchannel.cpp qt-adsk-4.8.5/src/network/access/qhttpnetworkconnectionchannel.cpp --- qt-everywhere-opensource-src-4.8.5/src/network/access/qhttpnetworkconnectionchannel.cpp 2013-06-07 13:17:00.000000000 +0800 +++ qt-adsk-4.8.5/src/network/access/qhttpnetworkconnectionchannel.cpp 2013-09-22 09:31:41.000000000 +0800 @@ -1063,6 +1063,9 @@ errorCode = QNetworkReply::RemoteHostClosedError; } } else if (state == QHttpNetworkConnectionChannel::ReadingState) { + if (!reply) + break; + if (!reply->d_func()->expectContent()) { // No content expected, this is a valid way to have the connection closed by the server return; diff -rau qt-everywhere-opensource-src-4.8.5/src/network/access/qnetworkaccesshttpbackend.cpp qt-adsk-4.8.5/src/network/access/qnetworkaccesshttpbackend.cpp --- qt-everywhere-opensource-src-4.8.5/src/network/access/qnetworkaccesshttpbackend.cpp 2013-06-07 13:17:00.000000000 +0800 +++ qt-adsk-4.8.5/src/network/access/qnetworkaccesshttpbackend.cpp 2013-09-22 09:31:41.000000000 +0800 @@ -480,6 +480,14 @@ // commented this out since it will be called later anyway // by copyFinished() //QNetworkAccessBackend::finished(); + + ///Yongfu Ren --> Fix the synchoronus http request issue + /// that when the content is cached, this thread never gets released + if(isSynchronous()) + thread->quit(); + ///Yongfu ren <-- + + return; // no need to send the request! :) } diff -rau qt-everywhere-opensource-src-4.8.5/src/network/access/qnetworkrequest.cpp qt-adsk-4.8.5/src/network/access/qnetworkrequest.cpp --- qt-everywhere-opensource-src-4.8.5/src/network/access/qnetworkrequest.cpp 2013-06-07 13:17:00.000000000 +0800 +++ qt-adsk-4.8.5/src/network/access/qnetworkrequest.cpp 2013-09-22 09:31:41.000000000 +0800 @@ -715,7 +715,9 @@ static QNetworkRequest::KnownHeaders parseHeaderName(const QByteArray &headerName) { - // headerName is not empty here + if (headerName.isEmpty()) + return QNetworkRequest::KnownHeaders(-1); + switch (tolower(headerName.at(0))) { case 'c': diff -rau qt-everywhere-opensource-src-4.8.5/src/network/kernel/qauthenticator.cpp qt-adsk-4.8.5/src/network/kernel/qauthenticator.cpp --- qt-everywhere-opensource-src-4.8.5/src/network/kernel/qauthenticator.cpp 2013-06-07 13:17:00.000000000 +0800 +++ qt-adsk-4.8.5/src/network/kernel/qauthenticator.cpp 2013-09-22 09:31:41.000000000 +0800 @@ -52,6 +52,14 @@ #include #include +#ifdef Q_OS_WIN +#include +#include +#include +#define SECURITY_WIN32 1 +#include +#endif + //#define NTLMV1_CLIENT QT_BEGIN_NAMESPACE @@ -62,6 +70,10 @@ static QByteArray qNtlmPhase1(); static QByteArray qNtlmPhase3(QAuthenticatorPrivate *ctx, const QByteArray& phase2data); +#ifdef Q_OS_WIN +static QByteArray qNtlmPhase1_SSPI(QAuthenticatorPrivate *ctx); +static QByteArray qNtlmPhase3_SSPI(QAuthenticatorPrivate *ctx, const QByteArray& phase2data); +#endif /*! \class QAuthenticator @@ -81,9 +93,9 @@ QAuthenticator supports the following authentication methods: \list - \o Basic - \o NTLM version 2 - \o Digest-MD5 + \li Basic + \li NTLM version 2 + \li Digest-MD5 \endlist \section1 Options @@ -105,8 +117,8 @@ \section2 Basic \table - \header \o Option \o Direction \o Description - \row \o \tt{realm} \o Incoming \o Contains the realm of the authentication, the same as realm() + \header \li Option \li Direction \li Description + \row \li \tt{realm} \li Incoming \li Contains the realm of the authentication, the same as realm() \endtable The Basic authentication mechanism supports no outgoing options. @@ -114,12 +126,14 @@ \section2 NTLM version 2 The NTLM authentication mechanism currently supports no incoming or outgoing options. + On Windows, if no \a user has been set, domain\user credentials will be searched for on the + local system to enable Single-Sign-On functionality. \section2 Digest-MD5 \table - \header \o Option \o Direction \o Description - \row \o \tt{realm} \o Incoming \o Contains the realm of the authentication, the same as realm() + \header \li Option \li Direction \li Description + \row \li \tt{realm} \li Incoming \li Contains the realm of the authentication, the same as realm() \endtable The Digest-MD5 authentication mechanism supports no outgoing options. @@ -242,6 +256,8 @@ /*! Sets the \a password used for authentication. + + \sa QNetworkAccessManager::authenticationRequired() */ void QAuthenticator::setPassword(const QString &password) { @@ -321,18 +337,38 @@ return !d; } +#ifdef Q_OS_WIN +class QNtlmWindowsHandles +{ + public: + CredHandle credHandle; + CtxtHandle ctxHandle; +}; +#endif + QAuthenticatorPrivate::QAuthenticatorPrivate() : ref(0) , method(None) , hasFailed(false) , phase(Start) , nonceCount(0) +#ifdef Q_OS_WIN + , ntlmWindowsHandles(0) +#endif { cnonce = QCryptographicHash::hash(QByteArray::number(qrand(), 16) + QByteArray::number(qrand(), 16), QCryptographicHash::Md5).toHex(); nonceCount = 0; } +QAuthenticatorPrivate::~QAuthenticatorPrivate() + { +#ifdef Q_OS_WIN + if (ntlmWindowsHandles) + delete ntlmWindowsHandles; +#endif +} + #ifndef QT_NO_HTTP void QAuthenticatorPrivate::parseHttpResponse(const QHttpResponseHeader &header, bool isProxy) { @@ -448,14 +484,36 @@ case QAuthenticatorPrivate::Ntlm: methodString = "NTLM "; if (challenge.isEmpty()) { - response = qNtlmPhase1().toBase64(); - if (user.isEmpty()) - phase = Done; - else +#ifdef Q_OS_WIN + QByteArray phase1Token; + if (user.isEmpty()) // Only pull from system if no user was specified in authenticator + phase1Token = qNtlmPhase1_SSPI(this); + if (!phase1Token.isEmpty()) { + response = phase1Token.toBase64(); phase = Phase2; + } else +#endif + { + response = qNtlmPhase1().toBase64(); + if (user.isEmpty()) + phase = Done; + else + phase = Phase2; + } } else { - response = qNtlmPhase3(this, QByteArray::fromBase64(challenge)).toBase64(); - phase = Done; +#ifdef Q_OS_WIN + QByteArray phase3Token; + if (ntlmWindowsHandles) + phase3Token = qNtlmPhase3_SSPI(this, QByteArray::fromBase64(challenge)); + if (!phase3Token.isEmpty()) { + response = phase3Token.toBase64(); + phase = Done; + } else +#endif + { + response = qNtlmPhase3(this, QByteArray::fromBase64(challenge)).toBase64(); + phase = Done; + } } break; @@ -921,7 +979,7 @@ QNtlmPhase1Block() { qstrncpy(magic, "NTLMSSP", 8); type = 1; - flags = NTLMSSP_NEGOTIATE_UNICODE | NTLMSSP_NEGOTIATE_NTLM | NTLMSSP_REQUEST_TARGET; + flags = NTLMSSP_NEGOTIATE_UNICODE | NTLMSSP_NEGOTIATE_NTLM | NTLMSSP_REQUEST_TARGET | NTLMSSP_NEGOTIATE_ALWAYS_SIGN | NTLMSSP_NEGOTIATE_NTLM2; } // extracted @@ -949,7 +1007,7 @@ QNtlmPhase3Block() { qstrncpy(magic, "NTLMSSP", 8); type = 3; - flags = NTLMSSP_NEGOTIATE_UNICODE | NTLMSSP_NEGOTIATE_NTLM | NTLMSSP_NEGOTIATE_TARGET_INFO; + flags = NTLMSSP_NEGOTIATE_NTLM | NTLMSSP_REQUEST_TARGET; } // extracted @@ -1335,7 +1393,7 @@ ds >> ch.targetInfo; if (ch.targetName.len > 0) { - if (ch.targetName.len + ch.targetName.offset >= (unsigned)data.size()) + if (ch.targetName.len + ch.targetName.offset > (unsigned)data.size()) return false; ch.targetNameStr = qStringFromUcs2Le(data.mid(ch.targetName.offset, ch.targetName.len)); @@ -1363,9 +1421,16 @@ ds.setByteOrder(QDataStream::LittleEndian); QNtlmPhase3Block pb; + // set NTLMv2 + if (ch.flags & NTLMSSP_NEGOTIATE_NTLM2) + pb.flags |= NTLMSSP_NEGOTIATE_NTLM2; + + // set Always Sign + if (ch.flags & NTLMSSP_NEGOTIATE_ALWAYS_SIGN) + pb.flags |= NTLMSSP_NEGOTIATE_ALWAYS_SIGN; + bool unicode = ch.flags & NTLMSSP_NEGOTIATE_UNICODE; - pb.flags = NTLMSSP_NEGOTIATE_NTLM; if (unicode) pb.flags |= NTLMSSP_NEGOTIATE_UNICODE; else @@ -1375,14 +1440,8 @@ int offset = QNtlmPhase3BlockBase::Size; Q_ASSERT(QNtlmPhase3BlockBase::Size == sizeof(QNtlmPhase3BlockBase)); - // for kerberos style user@domain logins, NTLM domain string should be left empty - if (ctx->userDomain.isEmpty() && !ctx->extractedUser.contains(QLatin1Char('@'))) { - offset = qEncodeNtlmString(pb.domain, offset, ch.targetNameStr, unicode); - pb.domainStr = ch.targetNameStr; - } else { - offset = qEncodeNtlmString(pb.domain, offset, ctx->userDomain, unicode); - pb.domainStr = ctx->userDomain; - } + offset = qEncodeNtlmString(pb.domain, offset, ctx->userDomain, unicode); + pb.domainStr = ctx->userDomain; offset = qEncodeNtlmString(pb.user, offset, ctx->extractedUser, unicode); pb.userStr = ctx->extractedUser; @@ -1417,6 +1476,165 @@ return rc; } +#ifdef Q_OS_WIN +// See http://davenport.sourceforge.net/ntlm.html +// and libcurl http_ntlm.c + +// Handle of secur32.dll +static HMODULE securityDLLHandle = NULL; +// Pointer to SSPI dispatch table +static PSecurityFunctionTable pSecurityFunctionTable = NULL; + + +static bool q_NTLM_SSPI_library_load() +{ + QMutexLocker locker(QMutexPool::globalInstanceGet((void *)&pSecurityFunctionTable)); + + // Initialize security interface + if (pSecurityFunctionTable == NULL) { + securityDLLHandle = LoadLibrary(L"secur32.dll"); + if (securityDLLHandle != NULL) { +#if defined(Q_OS_WINCE) + INIT_SECURITY_INTERFACE pInitSecurityInterface = + (INIT_SECURITY_INTERFACE)GetProcAddress(securityDLLHandle, + L"InitSecurityInterfaceW"); +#else + INIT_SECURITY_INTERFACE pInitSecurityInterface = + (INIT_SECURITY_INTERFACE)GetProcAddress(securityDLLHandle, + "InitSecurityInterfaceW"); +#endif + if (pInitSecurityInterface != NULL) + pSecurityFunctionTable = pInitSecurityInterface(); + } + } + + if (pSecurityFunctionTable == NULL) + return false; + + return true; +} + +#ifdef Q_OS_WIN +// Phase 1: +static QByteArray qNtlmPhase1_SSPI(QAuthenticatorPrivate *ctx) +{ + QByteArray result; + + if (!q_NTLM_SSPI_library_load()) + return result; + + // 1. The client obtains a representation of the credential set + // for the user via the SSPI AcquireCredentialsHandle function. + if (!ctx->ntlmWindowsHandles) + ctx->ntlmWindowsHandles = new QNtlmWindowsHandles; + memset(&ctx->ntlmWindowsHandles->credHandle, 0, sizeof(CredHandle)); + TimeStamp tsDummy; + SECURITY_STATUS secStatus = pSecurityFunctionTable->AcquireCredentialsHandle( + NULL, (SEC_WCHAR*)L"NTLM", SECPKG_CRED_OUTBOUND, NULL, NULL, + NULL, NULL, &ctx->ntlmWindowsHandles->credHandle, &tsDummy); + if (secStatus != SEC_E_OK) { + delete ctx->ntlmWindowsHandles; + ctx->ntlmWindowsHandles = 0; + return result; + } + + // 2. The client calls the SSPI InitializeSecurityContext function + // to obtain an authentication request token (in our case, a Type 1 message). + // The client sends this token to the server. + SecBufferDesc desc; + SecBuffer buf; + desc.ulVersion = SECBUFFER_VERSION; + desc.cBuffers = 1; + desc.pBuffers = &buf; + buf.cbBuffer = 0; + buf.BufferType = SECBUFFER_TOKEN; + buf.pvBuffer = NULL; + ULONG attrs; + + secStatus = pSecurityFunctionTable->InitializeSecurityContext(&ctx->ntlmWindowsHandles->credHandle, NULL, + const_cast(L"") /* host */, + ISC_REQ_ALLOCATE_MEMORY, + 0, SECURITY_NETWORK_DREP, + NULL, 0, + &ctx->ntlmWindowsHandles->ctxHandle, &desc, + &attrs, &tsDummy); + if (secStatus == SEC_I_COMPLETE_AND_CONTINUE || + secStatus == SEC_I_CONTINUE_NEEDED) { + pSecurityFunctionTable->CompleteAuthToken(&ctx->ntlmWindowsHandles->ctxHandle, &desc); + } else if (secStatus != SEC_E_OK) { + if ((const char*)buf.pvBuffer) + pSecurityFunctionTable->FreeContextBuffer(buf.pvBuffer); + pSecurityFunctionTable->FreeCredentialsHandle(&ctx->ntlmWindowsHandles->credHandle); + delete ctx->ntlmWindowsHandles; + ctx->ntlmWindowsHandles = 0; + return result; + } + + result = QByteArray((const char*)buf.pvBuffer, buf.cbBuffer); + pSecurityFunctionTable->FreeContextBuffer(buf.pvBuffer); + return result; +} + +// Phase 2: +// 3. The server receives the token from the client, and uses it as input to the +// AcceptSecurityContext SSPI function. This creates a local security context on +// the server to represent the client, and yields an authentication response token +// (the Type 2 message), which is sent to the client. + +// Phase 3: +static QByteArray qNtlmPhase3_SSPI(QAuthenticatorPrivate *ctx, const QByteArray& phase2data) +{ + // 4. The client receives the response token from the server and calls + // InitializeSecurityContext again, passing the server's token as input. + // This provides us with another authentication request token (the Type 3 message). + // The return value indicates that the security context was successfully initialized; + // the token is sent to the server. + + QByteArray result; + + if (pSecurityFunctionTable == NULL) + return result; + + SecBuffer type_2, type_3; + SecBufferDesc type_2_desc, type_3_desc; + ULONG attrs; + TimeStamp tsDummy; // For Windows 9x compatibility of SPPI calls + + type_2_desc.ulVersion = type_3_desc.ulVersion = SECBUFFER_VERSION; + type_2_desc.cBuffers = type_3_desc.cBuffers = 1; + type_2_desc.pBuffers = &type_2; + type_3_desc.pBuffers = &type_3; + + type_2.BufferType = SECBUFFER_TOKEN; + type_2.pvBuffer = (PVOID)phase2data.data(); + type_2.cbBuffer = phase2data.length(); + type_3.BufferType = SECBUFFER_TOKEN; + type_3.pvBuffer = 0; + type_3.cbBuffer = 0; + + SECURITY_STATUS secStatus = pSecurityFunctionTable->InitializeSecurityContext(&ctx->ntlmWindowsHandles->credHandle, + &ctx->ntlmWindowsHandles->ctxHandle, + const_cast(L"") /* host */, + ISC_REQ_ALLOCATE_MEMORY, + 0, SECURITY_NETWORK_DREP, &type_2_desc, + 0, &ctx->ntlmWindowsHandles->ctxHandle, &type_3_desc, + &attrs, &tsDummy); + + if (secStatus == SEC_E_OK && ((const char*)type_3.pvBuffer)) { + result = QByteArray((const char*)type_3.pvBuffer, type_3.cbBuffer); + pSecurityFunctionTable->FreeContextBuffer(type_3.pvBuffer); + } + + pSecurityFunctionTable->FreeCredentialsHandle(&ctx->ntlmWindowsHandles->credHandle); + pSecurityFunctionTable->DeleteSecurityContext(&ctx->ntlmWindowsHandles->ctxHandle); + delete ctx->ntlmWindowsHandles; + ctx->ntlmWindowsHandles = 0; + return result; +} +#endif // Q_OS_WIN + +#endif QT_END_NAMESPACE + diff -rau qt-everywhere-opensource-src-4.8.5/src/network/kernel/qauthenticator_p.h qt-adsk-4.8.5/src/network/kernel/qauthenticator_p.h --- qt-everywhere-opensource-src-4.8.5/src/network/kernel/qauthenticator_p.h 2013-06-07 13:17:00.000000000 +0800 +++ qt-adsk-4.8.5/src/network/kernel/qauthenticator_p.h 2013-09-22 09:31:41.000000000 +0800 @@ -63,11 +63,16 @@ class QHttpResponseHeader; +#ifdef Q_OS_WIN +class QNtlmWindowsHandles; +#endif + class Q_AUTOTEST_EXPORT QAuthenticatorPrivate { public: enum Method { None, Basic, Plain, Login, Ntlm, CramMd5, DigestMd5 }; QAuthenticatorPrivate(); + ~QAuthenticatorPrivate(); QAtomicInt ref; QString user; @@ -77,6 +82,9 @@ Method method; QString realm; QByteArray challenge; +#ifdef Q_OS_WIN + QNtlmWindowsHandles *ntlmWindowsHandles; +#endif bool hasFailed; //credentials have been tried but rejected by server. enum Phase { diff -rau qt-everywhere-opensource-src-4.8.5/src/network/socket/qlocalserver_unix.cpp qt-adsk-4.8.5/src/network/socket/qlocalserver_unix.cpp --- qt-everywhere-opensource-src-4.8.5/src/network/socket/qlocalserver_unix.cpp 2013-06-07 13:17:00.000000000 +0800 +++ qt-adsk-4.8.5/src/network/socket/qlocalserver_unix.cpp 2013-09-22 09:31:41.000000000 +0800 @@ -208,16 +208,11 @@ void QLocalServerPrivate::waitForNewConnection(int msec, bool *timedOut) { - fd_set readfds; - FD_ZERO(&readfds); - FD_SET(listenSocket, &readfds); - - timeval timeout; - timeout.tv_sec = msec / 1000; - timeout.tv_usec = (msec % 1000) * 1000; + struct pollfd fd; + fd.fd = listenSocket; + fd.events = POLLIN; - int result = -1; - result = qt_safe_select(listenSocket + 1, &readfds, 0, 0, (msec == -1) ? 0 : &timeout); + int result = qt_safe_poll(&fd, 1, msec); if (-1 == result) { setError(QLatin1String("QLocalServer::waitForNewConnection")); closeServer(); diff -rau qt-everywhere-opensource-src-4.8.5/src/network/socket/qlocalsocket_unix.cpp qt-adsk-4.8.5/src/network/socket/qlocalsocket_unix.cpp --- qt-everywhere-opensource-src-4.8.5/src/network/socket/qlocalsocket_unix.cpp 2013-06-07 13:17:00.000000000 +0800 +++ qt-adsk-4.8.5/src/network/socket/qlocalsocket_unix.cpp 2013-09-22 09:31:41.000000000 +0800 @@ -56,10 +56,6 @@ #include #include -#ifdef Q_OS_VXWORKS -# include -#endif - #define QT_CONNECT_TIMEOUT 30000 QT_BEGIN_NAMESPACE @@ -520,32 +516,17 @@ if (state() != ConnectingState) return (state() == ConnectedState); - fd_set fds; - FD_ZERO(&fds); - FD_SET(d->connectingSocket, &fds); - - timeval timeout; - timeout.tv_sec = msec / 1000; - timeout.tv_usec = (msec % 1000) * 1000; - - // timeout can not be 0 or else select will return an error. - if (0 == msec) - timeout.tv_usec = 1000; + pollfd fd; + fd.fd = d->connectingSocket; + fd.events = POLLIN | POLLOUT; int result = -1; // on Linux timeout will be updated by select, but _not_ on other systems. QElapsedTimer timer; + int remaining = msec; timer.start(); - while (state() == ConnectingState - && (-1 == msec || timer.elapsed() < msec)) { -#ifdef Q_OS_SYMBIAN - // On Symbian, ready-to-write is signaled when non-blocking socket - // connect is finised. Is ready-to-read really used on other - // UNIX paltforms when using non-blocking AF_UNIX socket? - result = ::select(d->connectingSocket + 1, 0, &fds, 0, &timeout); -#else - result = ::select(d->connectingSocket + 1, &fds, 0, 0, &timeout); -#endif + while (state() == ConnectingState) { + result = qt_safe_poll(&fd, 1, remaining, /* retry_eintr */ false); if (-1 == result && errno != EINTR) { d->errorOccurred( QLocalSocket::UnknownSocketError, QLatin1String("QLocalSocket::waitForConnected")); @@ -553,6 +534,11 @@ } if (result > 0) d->_q_connectToSocket(); + if (msec >= 0) { + remaining = timer.elapsed() - msec; + if (remaining < 0) + break; + } } return (state() == ConnectedState); diff -rau qt-everywhere-opensource-src-4.8.5/src/network/socket/qnativesocketengine_unix.cpp qt-adsk-4.8.5/src/network/socket/qnativesocketengine_unix.cpp --- qt-everywhere-opensource-src-4.8.5/src/network/socket/qnativesocketengine_unix.cpp 2013-06-07 13:17:00.000000000 +0800 +++ qt-adsk-4.8.5/src/network/socket/qnativesocketengine_unix.cpp 2013-09-22 09:31:41.000000000 +0800 @@ -1068,48 +1068,40 @@ int QNativeSocketEnginePrivate::nativeSelect(int timeout, bool selectForRead) const { - fd_set fds; - FD_ZERO(&fds); - FD_SET(socketDescriptor, &fds); - - struct timeval tv; - tv.tv_sec = timeout / 1000; - tv.tv_usec = (timeout % 1000) * 1000; - - int retval; - if (selectForRead) - retval = qt_safe_select(socketDescriptor + 1, &fds, 0, 0, timeout < 0 ? 0 : &tv); - else - retval = qt_safe_select(socketDescriptor + 1, 0, &fds, 0, timeout < 0 ? 0 : &tv); - - return retval; + struct pollfd fd; + fd.fd = socketDescriptor; + if (selectForRead) { + fd.events = POLLIN; + } else { + fd.events = POLLOUT; + } + return qt_safe_poll(&fd, 1, timeout); } int QNativeSocketEnginePrivate::nativeSelect(int timeout, bool checkRead, bool checkWrite, bool *selectForRead, bool *selectForWrite) const { - fd_set fdread; - FD_ZERO(&fdread); + struct pollfd fd; + fd.fd = socketDescriptor; if (checkRead) - FD_SET(socketDescriptor, &fdread); - - fd_set fdwrite; - FD_ZERO(&fdwrite); + fd.events = POLLIN; + else + fd.events = 0; if (checkWrite) - FD_SET(socketDescriptor, &fdwrite); - - struct timeval tv; - tv.tv_sec = timeout / 1000; - tv.tv_usec = (timeout % 1000) * 1000; - - int ret; - ret = qt_safe_select(socketDescriptor + 1, &fdread, &fdwrite, 0, timeout < 0 ? 0 : &tv); - + fd.events |= POLLOUT; + int ret = qt_safe_poll(&fd, 1, timeout); if (ret <= 0) - return ret; - *selectForRead = FD_ISSET(socketDescriptor, &fdread); - *selectForWrite = FD_ISSET(socketDescriptor, &fdwrite); - + return ret; + bool r = (fd.revents & (POLLIN | POLLHUP | POLLERR)) != 0; + bool w = (fd.revents & (POLLOUT | POLLHUP | POLLERR)) != 0; + // Emulate the return value from select(2). + ret = 0; + if (r) + ++ret; + if (w) + ++ret; + *selectForRead = r; + *selectForWrite = w; return ret; } diff -rau qt-everywhere-opensource-src-4.8.5/src/network/ssl/qsslsocket_openssl.cpp qt-adsk-4.8.5/src/network/ssl/qsslsocket_openssl.cpp --- qt-everywhere-opensource-src-4.8.5/src/network/ssl/qsslsocket_openssl.cpp 2013-06-07 13:17:00.000000000 +0800 +++ qt-adsk-4.8.5/src/network/ssl/qsslsocket_openssl.cpp 2013-09-22 09:31:41.000000000 +0800 @@ -357,18 +357,22 @@ } } - bool addExpiredCerts = true; + //bool addExpiredCerts = true; #if defined(Q_OS_MAC) && (MAC_OS_X_VERSION_MAX_ALLOWED == MAC_OS_X_VERSION_10_5) + bool addExpiredCerts = true; //On Leopard SSL does not work if we add the expired certificates. if (QSysInfo::MacintoshVersion == QSysInfo::MV_10_5) addExpiredCerts = false; #endif + // ECO-30-029 (http://psebshare/sites/platform/technology/Lists/FY13%20Requests/DispForm.aspx?ID=570&ContentTypeId=0x01002730D7F1F4571E4580829266E2A1C4A1) + // Modified on 8/16/2011 4:05:58 PM by Gao Yang (yangga) + // Description: Comment out the following four lines that encloses a foreach loop. // now add the expired certs - if (addExpiredCerts) { - foreach (const QSslCertificate &caCertificate, expiredCerts) { - q_X509_STORE_add_cert(ctx->cert_store, (X509 *)caCertificate.handle()); - } - } + //if (addExpiredCerts) { + // foreach (const QSslCertificate &caCertificate, expiredCerts) { + // q_X509_STORE_add_cert(ctx->cert_store, (X509 *)caCertificate.handle()); + // } + //} if (s_loadRootCertsOnDemand && allowRootCertOnDemandLoading) { // tell OpenSSL the directories where to look up the root certs on demand diff -rau qt-everywhere-opensource-src-4.8.5/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp qt-adsk-4.8.5/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp --- qt-everywhere-opensource-src-4.8.5/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp 2013-06-07 13:17:00.000000000 +0800 +++ qt-adsk-4.8.5/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp 2013-09-22 09:31:41.000000000 +0800 @@ -568,6 +568,7 @@ #ifndef QT_OPENGL_ES_2 const QGLFormat &fmt = d->device->format(); if (fmt.majorVersion() < 3 || (fmt.majorVersion() == 3 && fmt.minorVersion() < 1) + || (fmt.majorVersion() == 3 && fmt.minorVersion() == 1 && d->hasCompatibilityExtension) || fmt.profile() == QGLFormat::CompatibilityProfile) { // be nice to people who mix OpenGL 1.x code with QPainter commands @@ -2139,6 +2140,9 @@ d->device->beginPaint(); #if !defined(QT_OPENGL_ES_2) + QGLExtensionMatcher extensions; + d->hasCompatibilityExtension = extensions.match("GL_ARB_compatibility"); + bool success = qt_resolve_version_2_0_functions(d->ctx) && qt_resolve_buffer_extensions(d->ctx) && (!QGLFramebufferObject::hasOpenGLFramebufferObjects() diff -rau qt-everywhere-opensource-src-4.8.5/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h qt-adsk-4.8.5/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h --- qt-everywhere-opensource-src-4.8.5/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h 2013-06-07 13:17:00.000000000 +0800 +++ qt-adsk-4.8.5/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h 2013-09-22 09:31:41.000000000 +0800 @@ -187,7 +187,8 @@ snapToPixelGrid(false), nativePaintingActive(false), inverseScale(1), - lastMaskTextureUsed(0) + lastMaskTextureUsed(0), + hasCompatibilityExtension(false) { } ~QGL2PaintEngineExPrivate(); @@ -318,6 +319,8 @@ QVector unusedIBOSToClean; const GLfloat *vertexAttribPointers[3]; + + bool hasCompatibilityExtension; }; diff -rau qt-everywhere-opensource-src-4.8.5/src/opengl/qgl.h qt-adsk-4.8.5/src/opengl/qgl.h --- qt-everywhere-opensource-src-4.8.5/src/opengl/qgl.h 2013-06-07 13:17:00.000000000 +0800 +++ qt-adsk-4.8.5/src/opengl/qgl.h 2013-11-08 03:25:32.000000000 +0800 @@ -153,6 +153,7 @@ HasOverlay = 0x0100, SampleBuffers = 0x0200, DeprecatedFunctions = 0x0400, + DebugContext = 0x0800, SingleBuffer = DoubleBuffer << 16, NoDepthBuffer = DepthBuffer << 16, ColorIndex = Rgba << 16, @@ -163,7 +164,8 @@ IndirectRendering = DirectRendering << 16, NoOverlay = HasOverlay << 16, NoSampleBuffers = SampleBuffers << 16, - NoDeprecatedFunctions = DeprecatedFunctions << 16 + NoDeprecatedFunctions = DeprecatedFunctions << 16, + NoDebugContext = DebugContext << 16 }; Q_DECLARE_FLAGS(FormatOptions, FormatOption) } @@ -390,6 +392,8 @@ QColor overlayTransparentColor() const; static const QGLContext* currentContext(); +//ADSK: added function + void * getContext(); #ifdef Q_WS_QPA static QGLContext *fromPlatformGLContext(QPlatformGLContext *platformContext); diff -rau qt-everywhere-opensource-src-4.8.5/src/opengl/qgl_mac.mm qt-adsk-4.8.5/src/opengl/qgl_mac.mm --- qt-everywhere-opensource-src-4.8.5/src/opengl/qgl_mac.mm 2013-06-07 13:17:00.000000000 +0800 +++ qt-adsk-4.8.5/src/opengl/qgl_mac.mm 2013-11-08 03:26:17.000000000 +0800 @@ -187,6 +187,16 @@ return false; } +//ADSK: new function +void * QGLContext::getContext() +{ + Q_D(QGLContext); + if (d) + return (void *)d->cx; + else + return NULL; +} + bool QGLContext::chooseContext(const QGLContext *shareContext) { QMacCocoaAutoReleasePool pool; @@ -350,7 +360,7 @@ void *QGLContextPrivate::tryFormat(const QGLFormat &format) { - static const int Max = 40; + static const int Max = 42; #ifndef QT_MAC_USE_COCOA GLint attribs[Max], cnt = 0; bool device_is_pixmap = (paintDevice->devType() == QInternal::Pixmap); @@ -436,6 +446,18 @@ if (format.doubleBuffer()) attribs[cnt++] = NSOpenGLPFADoubleBuffer; } + if (format.profile() == QGLFormat::CoreProfile) { +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7 + if ((format.majorVersion() == 3 && format.minorVersion() >= 2) + || format.majorVersion() > 3 ) { + attribs[cnt++] = NSOpenGLPFAOpenGLProfile; + // Will open a 4.1 profile on OS/X 10.9 even though the enum mentions 3.2 + attribs[cnt++] = NSOpenGLProfileVersion3_2Core; + } +#else + qWarning("Mac OSX >= 10.7 is needed for OpenGL Core Profile support"); +#endif + } if (glFormat.stereo()) attribs[cnt++] = NSOpenGLPFAStereo; if (device_is_pixmap || format.alpha()) { diff -rau qt-everywhere-opensource-src-4.8.5/src/opengl/qgl_win.cpp qt-adsk-4.8.5/src/opengl/qgl_win.cpp --- qt-everywhere-opensource-src-4.8.5/src/opengl/qgl_win.cpp 2013-06-07 13:17:00.000000000 +0800 +++ qt-adsk-4.8.5/src/opengl/qgl_win.cpp 2013-11-08 03:26:43.000000000 +0800 @@ -714,7 +714,7 @@ PFNWGLCREATECONTEXTATTRIBSARB wglCreateContextAttribsARB = (PFNWGLCREATECONTEXTATTRIBSARB) wglGetProcAddress("wglCreateContextAttribsARB"); if (wglCreateContextAttribsARB) { - int attributes[11]; + int attributes[13]; int attribIndex = 0; const int major = d->reqFormat.majorVersion(); const int minor = d->reqFormat.minorVersion(); @@ -746,6 +746,11 @@ } } + if (d->reqFormat.testOption(QGL::DebugContext)) { + attributes[attribIndex++] = WGL_CONTEXT_FLAGS_ARB; + attributes[attribIndex++] = WGL_CONTEXT_DEBUG_BIT_ARB; + } + if (d->reqFormat.plane() != 0) { attributes[attribIndex++] = WGL_CONTEXT_LAYER_PLANE_ARB; attributes[attribIndex++] = d->reqFormat.plane(); @@ -814,6 +819,17 @@ } } +//ADSK: added function +void * QGLContext::getContext() +{ + Q_D(QGLContext); + if (d) + return (void *)d->rc; + else + return NULL; +} + + bool QGLContext::chooseContext(const QGLContext* shareContext) { QGLContextPrivate *share = shareContext ? const_cast(shareContext)->d_func() : 0; diff -rau qt-everywhere-opensource-src-4.8.5/src/opengl/qgl_x11.cpp qt-adsk-4.8.5/src/opengl/qgl_x11.cpp --- qt-everywhere-opensource-src-4.8.5/src/opengl/qgl_x11.cpp 2013-06-07 13:17:00.000000000 +0800 +++ qt-adsk-4.8.5/src/opengl/qgl_x11.cpp 2013-11-08 03:27:12.000000000 +0800 @@ -564,6 +564,17 @@ QGLContext UNIX/GLX-specific code *****************************************************************************/ +// ADSK: added function +void * QGLContext::getContext() +{ + Q_D(QGLContext); + if (d) + return (void *)d->cx; + else + return NULL; +} + + bool QGLContext::chooseContext(const QGLContext* shareContext) { Q_D(QGLContext); @@ -673,7 +684,12 @@ int attributes[] = { GLX_CONTEXT_MAJOR_VERSION_ARB, major, GLX_CONTEXT_MINOR_VERSION_ARB, minor, GLX_CONTEXT_PROFILE_MASK_ARB, profile, - 0 }; + 0, 0, 0 }; + + if (d->reqFormat.testOption(QGL::DebugContext)) { + attributes[6] = GLX_CONTEXT_FLAGS_ARB; + attributes[7] = GLX_CONTEXT_DEBUG_BIT_ARB; + } typedef GLXContext ( * Q_PFNGLXCREATECONTEXTATTRIBSARBPROC) (Display* dpy, GLXFBConfig config, GLXContext share_context, Bool direct, const int *attrib_list); diff -rau qt-everywhere-opensource-src-4.8.5/src/plugins/accessible/compat/compat.pro qt-adsk-4.8.5/src/plugins/accessible/compat/compat.pro --- qt-everywhere-opensource-src-4.8.5/src/plugins/accessible/compat/compat.pro 2013-06-07 13:17:00.000000000 +0800 +++ qt-adsk-4.8.5/src/plugins/accessible/compat/compat.pro 2013-09-22 09:31:41.000000000 +0800 @@ -1,4 +1,4 @@ -TARGET = qtaccessiblecompatwidgets +TARGET = qtaccessiblecompatwidgets$${QT_LIBINFIX} CONFIG += qt_no_compat_warning include(../../qpluginbase.pri) include (../qaccessiblebase.pri) diff -rau qt-everywhere-opensource-src-4.8.5/src/plugins/accessible/widgets/widgets.pro qt-adsk-4.8.5/src/plugins/accessible/widgets/widgets.pro --- qt-everywhere-opensource-src-4.8.5/src/plugins/accessible/widgets/widgets.pro 2013-06-07 13:17:00.000000000 +0800 +++ qt-adsk-4.8.5/src/plugins/accessible/widgets/widgets.pro 2013-09-22 09:31:41.000000000 +0800 @@ -1,4 +1,4 @@ -TARGET = qtaccessiblewidgets +TARGET = qtaccessiblewidgets$${QT_LIBINFIX} include(../../qpluginbase.pri) include (../qaccessiblebase.pri) diff -rau qt-everywhere-opensource-src-4.8.5/src/plugins/bearer/connman/connman.pro qt-adsk-4.8.5/src/plugins/bearer/connman/connman.pro --- qt-everywhere-opensource-src-4.8.5/src/plugins/bearer/connman/connman.pro 2013-06-07 13:17:00.000000000 +0800 +++ qt-adsk-4.8.5/src/plugins/bearer/connman/connman.pro 2013-09-22 09:31:41.000000000 +0800 @@ -1,4 +1,4 @@ -TARGET = qconnmanbearer +TARGET = qconnmanbearer$${QT_LIBINFIX} include(../../qpluginbase.pri) QT = core network dbus diff -rau qt-everywhere-opensource-src-4.8.5/src/plugins/bearer/corewlan/corewlan.pro qt-adsk-4.8.5/src/plugins/bearer/corewlan/corewlan.pro --- qt-everywhere-opensource-src-4.8.5/src/plugins/bearer/corewlan/corewlan.pro 2013-06-07 13:17:00.000000000 +0800 +++ qt-adsk-4.8.5/src/plugins/bearer/corewlan/corewlan.pro 2013-09-22 09:31:41.000000000 +0800 @@ -1,11 +1,11 @@ -TARGET = qcorewlanbearer +TARGET = qcorewlanbearer$${QT_LIBINFIX} include(../../qpluginbase.pri) QT = core network LIBS += -framework Foundation -framework SystemConfiguration contains(QT_CONFIG, corewlan) { - isEmpty(QMAKE_MAC_SDK)|contains(QMAKE_MAC_SDK, "/Developer/SDKs/MacOSX10\.[67]\.sdk") { + isEmpty(QMAKE_MAC_SDK)|contains(QMAKE_MAC_SDK, "/Developer/SDKs/MacOSX10\.[67]\.sdk")|contains(QMAKE_MAC_SDK, "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10\.[678].sdk") { LIBS += -framework CoreWLAN -framework Security } } diff -rau qt-everywhere-opensource-src-4.8.5/src/plugins/bearer/generic/generic.pro qt-adsk-4.8.5/src/plugins/bearer/generic/generic.pro --- qt-everywhere-opensource-src-4.8.5/src/plugins/bearer/generic/generic.pro 2013-06-07 13:17:00.000000000 +0800 +++ qt-adsk-4.8.5/src/plugins/bearer/generic/generic.pro 2013-09-22 09:31:41.000000000 +0800 @@ -1,4 +1,4 @@ -TARGET = qgenericbearer +TARGET = qgenericbearer$${QT_LIBINFIX} include(../../qpluginbase.pri) QT = core network diff -rau qt-everywhere-opensource-src-4.8.5/src/plugins/bearer/icd/icd.pro qt-adsk-4.8.5/src/plugins/bearer/icd/icd.pro --- qt-everywhere-opensource-src-4.8.5/src/plugins/bearer/icd/icd.pro 2013-06-07 13:17:00.000000000 +0800 +++ qt-adsk-4.8.5/src/plugins/bearer/icd/icd.pro 2013-09-22 09:31:41.000000000 +0800 @@ -1,4 +1,4 @@ -TARGET = qicdbearer +TARGET = qicdbearer$${QT_LIBINFIX} include(../../qpluginbase.pri) QT = core network dbus diff -rau qt-everywhere-opensource-src-4.8.5/src/plugins/bearer/nativewifi/nativewifi.pro qt-adsk-4.8.5/src/plugins/bearer/nativewifi/nativewifi.pro --- qt-everywhere-opensource-src-4.8.5/src/plugins/bearer/nativewifi/nativewifi.pro 2013-06-07 13:17:00.000000000 +0800 +++ qt-adsk-4.8.5/src/plugins/bearer/nativewifi/nativewifi.pro 2013-09-22 09:31:41.000000000 +0800 @@ -1,4 +1,4 @@ -TARGET = qnativewifibearer +TARGET = qnativewifibearer$${QT_LIBINFIX} include(../../qpluginbase.pri) QT = core network diff -rau qt-everywhere-opensource-src-4.8.5/src/plugins/bearer/networkmanager/networkmanager.pro qt-adsk-4.8.5/src/plugins/bearer/networkmanager/networkmanager.pro --- qt-everywhere-opensource-src-4.8.5/src/plugins/bearer/networkmanager/networkmanager.pro 2013-06-07 13:17:00.000000000 +0800 +++ qt-adsk-4.8.5/src/plugins/bearer/networkmanager/networkmanager.pro 2013-09-22 09:31:41.000000000 +0800 @@ -1,4 +1,4 @@ -TARGET = qnmbearer +TARGET = qnmbearer$${QT_LIBINFIX} include(../../qpluginbase.pri) QT = core network dbus diff -rau qt-everywhere-opensource-src-4.8.5/src/plugins/bearer/nla/nla.pro qt-adsk-4.8.5/src/plugins/bearer/nla/nla.pro --- qt-everywhere-opensource-src-4.8.5/src/plugins/bearer/nla/nla.pro 2013-06-07 13:17:00.000000000 +0800 +++ qt-adsk-4.8.5/src/plugins/bearer/nla/nla.pro 2013-09-22 09:31:41.000000000 +0800 @@ -1,4 +1,4 @@ -TARGET = qnlabearer +TARGET = qnlabearer$${QT_LIBINFIX} include(../../qpluginbase.pri) QT = core network diff -rau qt-everywhere-opensource-src-4.8.5/src/plugins/bearer/symbian/3_1/3_1.pro qt-adsk-4.8.5/src/plugins/bearer/symbian/3_1/3_1.pro --- qt-everywhere-opensource-src-4.8.5/src/plugins/bearer/symbian/3_1/3_1.pro 2013-06-07 13:17:00.000000000 +0800 +++ qt-adsk-4.8.5/src/plugins/bearer/symbian/3_1/3_1.pro 2013-09-22 09:31:41.000000000 +0800 @@ -5,5 +5,5 @@ } else { LIBS += -lAPEngine } -TARGET = $${TARGET}_3_1 +TARGET = $${TARGET}_3_1$${QT_LIBINFIX} TARGET.UID3 = 0x2002131C diff -rau qt-everywhere-opensource-src-4.8.5/src/plugins/bearer/symbian/3_2/3_2.pro qt-adsk-4.8.5/src/plugins/bearer/symbian/3_2/3_2.pro --- qt-everywhere-opensource-src-4.8.5/src/plugins/bearer/symbian/3_2/3_2.pro 2013-06-07 13:17:00.000000000 +0800 +++ qt-adsk-4.8.5/src/plugins/bearer/symbian/3_2/3_2.pro 2013-09-22 09:31:41.000000000 +0800 @@ -13,5 +13,5 @@ } } -TARGET = $${TARGET}_3_2 +TARGET = $${TARGET}_3_2$${QT_LIBINFIX} TARGET.UID3 = 0x2002131D diff -rau qt-everywhere-opensource-src-4.8.5/src/plugins/codecs/cn/cn.pro qt-adsk-4.8.5/src/plugins/codecs/cn/cn.pro --- qt-everywhere-opensource-src-4.8.5/src/plugins/codecs/cn/cn.pro 2013-06-07 13:17:00.000000000 +0800 +++ qt-adsk-4.8.5/src/plugins/codecs/cn/cn.pro 2013-09-22 09:31:41.000000000 +0800 @@ -1,4 +1,4 @@ -TARGET = qcncodecs +TARGET = qcncodecs$${QT_LIBINFIX} include(../../qpluginbase.pri) CONFIG += warn_on diff -rau qt-everywhere-opensource-src-4.8.5/src/plugins/codecs/jp/jp.pro qt-adsk-4.8.5/src/plugins/codecs/jp/jp.pro --- qt-everywhere-opensource-src-4.8.5/src/plugins/codecs/jp/jp.pro 2013-06-07 13:17:00.000000000 +0800 +++ qt-adsk-4.8.5/src/plugins/codecs/jp/jp.pro 2013-09-22 09:31:41.000000000 +0800 @@ -1,4 +1,4 @@ -TARGET = qjpcodecs +TARGET = qjpcodecs$${QT_LIBINFIX} include(../../qpluginbase.pri) CONFIG += warn_on diff -rau qt-everywhere-opensource-src-4.8.5/src/plugins/codecs/kr/kr.pro qt-adsk-4.8.5/src/plugins/codecs/kr/kr.pro --- qt-everywhere-opensource-src-4.8.5/src/plugins/codecs/kr/kr.pro 2013-06-07 13:17:00.000000000 +0800 +++ qt-adsk-4.8.5/src/plugins/codecs/kr/kr.pro 2013-09-22 09:31:41.000000000 +0800 @@ -1,4 +1,4 @@ -TARGET = qkrcodecs +TARGET = qkrcodecs$${QT_LIBINFIX} include(../../qpluginbase.pri) CONFIG += warn_on diff -rau qt-everywhere-opensource-src-4.8.5/src/plugins/codecs/tw/tw.pro qt-adsk-4.8.5/src/plugins/codecs/tw/tw.pro --- qt-everywhere-opensource-src-4.8.5/src/plugins/codecs/tw/tw.pro 2013-06-07 13:17:00.000000000 +0800 +++ qt-adsk-4.8.5/src/plugins/codecs/tw/tw.pro 2013-09-22 09:31:41.000000000 +0800 @@ -1,4 +1,4 @@ -TARGET = qtwcodecs +TARGET = qtwcodecs$${QT_LIBINFIX} include(../../qpluginbase.pri) CONFIG += warn_on diff -rau qt-everywhere-opensource-src-4.8.5/src/plugins/decorations/default/default.pro qt-adsk-4.8.5/src/plugins/decorations/default/default.pro --- qt-everywhere-opensource-src-4.8.5/src/plugins/decorations/default/default.pro 2013-06-07 13:17:00.000000000 +0800 +++ qt-adsk-4.8.5/src/plugins/decorations/default/default.pro 2013-09-22 09:31:41.000000000 +0800 @@ -1,4 +1,4 @@ -TARGET = qdecorationdefault +TARGET = qdecorationdefault$${QT_LIBINFIX} include(../../qpluginbase.pri) HEADERS = $$QT_SOURCE_TREE/src/gui/embedded/qdecorationdefault_qws.h diff -rau qt-everywhere-opensource-src-4.8.5/src/plugins/decorations/styled/styled.pro qt-adsk-4.8.5/src/plugins/decorations/styled/styled.pro --- qt-everywhere-opensource-src-4.8.5/src/plugins/decorations/styled/styled.pro 2013-06-07 13:17:00.000000000 +0800 +++ qt-adsk-4.8.5/src/plugins/decorations/styled/styled.pro 2013-09-22 09:31:41.000000000 +0800 @@ -1,4 +1,4 @@ -TARGET = qdecorationstyled +TARGET = qdecorationstyled$${QT_LIBINFIX} include(../../qpluginbase.pri) QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/decorations diff -rau qt-everywhere-opensource-src-4.8.5/src/plugins/decorations/windows/windows.pro qt-adsk-4.8.5/src/plugins/decorations/windows/windows.pro --- qt-everywhere-opensource-src-4.8.5/src/plugins/decorations/windows/windows.pro 2013-06-07 13:17:00.000000000 +0800 +++ qt-adsk-4.8.5/src/plugins/decorations/windows/windows.pro 2013-09-22 09:31:41.000000000 +0800 @@ -1,4 +1,4 @@ -TARGET = qdecorationwindows +TARGET = qdecorationwindows$${QT_LIBINFIX} include(../../qpluginbase.pri) HEADERS = $$QT_SOURCE_TREE/src/gui/embedded/qdecorationwindows_qws.h diff -rau qt-everywhere-opensource-src-4.8.5/src/plugins/generic/linuxinput/linuxinput.pro qt-adsk-4.8.5/src/plugins/generic/linuxinput/linuxinput.pro --- qt-everywhere-opensource-src-4.8.5/src/plugins/generic/linuxinput/linuxinput.pro 2013-06-07 13:17:00.000000000 +0800 +++ qt-adsk-4.8.5/src/plugins/generic/linuxinput/linuxinput.pro 2013-09-22 09:31:41.000000000 +0800 @@ -1,4 +1,4 @@ -TARGET = qlinuxinputplugin +TARGET = qlinuxinputplugin$${QT_LIBINFIX} include(../../qpluginbase.pri) QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/generic diff -rau qt-everywhere-opensource-src-4.8.5/src/plugins/generic/tslib/tslib.pro qt-adsk-4.8.5/src/plugins/generic/tslib/tslib.pro --- qt-everywhere-opensource-src-4.8.5/src/plugins/generic/tslib/tslib.pro 2013-06-07 13:17:00.000000000 +0800 +++ qt-adsk-4.8.5/src/plugins/generic/tslib/tslib.pro 2013-09-22 09:31:41.000000000 +0800 @@ -1,4 +1,4 @@ -TARGET = qtslibplugin +TARGET = qtslibplugin$${QT_LIBINFIX} include(../../qpluginbase.pri) QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/generic diff -rau qt-everywhere-opensource-src-4.8.5/src/plugins/gfxdrivers/ahi/ahi.pro qt-adsk-4.8.5/src/plugins/gfxdrivers/ahi/ahi.pro --- qt-everywhere-opensource-src-4.8.5/src/plugins/gfxdrivers/ahi/ahi.pro 2013-06-07 13:17:00.000000000 +0800 +++ qt-adsk-4.8.5/src/plugins/gfxdrivers/ahi/ahi.pro 2013-09-22 09:31:41.000000000 +0800 @@ -1,4 +1,4 @@ -TARGET = qahiscreen +TARGET = qahiscreen$${QT_LIBINFIX} include(../../qpluginbase.pri) QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/gfxdrivers diff -rau qt-everywhere-opensource-src-4.8.5/src/plugins/gfxdrivers/directfb/directfb.pro qt-adsk-4.8.5/src/plugins/gfxdrivers/directfb/directfb.pro --- qt-everywhere-opensource-src-4.8.5/src/plugins/gfxdrivers/directfb/directfb.pro 2013-06-07 13:17:00.000000000 +0800 +++ qt-adsk-4.8.5/src/plugins/gfxdrivers/directfb/directfb.pro 2013-09-22 09:31:41.000000000 +0800 @@ -1,4 +1,4 @@ -TARGET = qdirectfbscreen +TARGET = qdirectfbscreen$${QT_LIBINFIX} include(../../qpluginbase.pri) include($$QT_SOURCE_TREE/src/gui/embedded/directfb.pri) diff -rau qt-everywhere-opensource-src-4.8.5/src/plugins/gfxdrivers/eglnullws/eglnullws.pro qt-adsk-4.8.5/src/plugins/gfxdrivers/eglnullws/eglnullws.pro --- qt-everywhere-opensource-src-4.8.5/src/plugins/gfxdrivers/eglnullws/eglnullws.pro 2013-06-07 13:17:00.000000000 +0800 +++ qt-adsk-4.8.5/src/plugins/gfxdrivers/eglnullws/eglnullws.pro 2013-09-22 09:31:41.000000000 +0800 @@ -1,4 +1,4 @@ -TARGET = qeglnullws +TARGET = qeglnullws$${QT_LIBINFIX} include(../../qpluginbase.pri) CONFIG += warn_on diff -rau qt-everywhere-opensource-src-4.8.5/src/plugins/gfxdrivers/linuxfb/linuxfb.pro qt-adsk-4.8.5/src/plugins/gfxdrivers/linuxfb/linuxfb.pro --- qt-everywhere-opensource-src-4.8.5/src/plugins/gfxdrivers/linuxfb/linuxfb.pro 2013-06-07 13:17:00.000000000 +0800 +++ qt-adsk-4.8.5/src/plugins/gfxdrivers/linuxfb/linuxfb.pro 2013-09-22 09:31:41.000000000 +0800 @@ -1,4 +1,4 @@ -TARGET = qscreenlinuxfb +TARGET = qscreenlinuxfb$${QT_LIBINFIX} include(../../qpluginbase.pri) QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/gfxdrivers diff -rau qt-everywhere-opensource-src-4.8.5/src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglscreen.pro qt-adsk-4.8.5/src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglscreen.pro --- qt-everywhere-opensource-src-4.8.5/src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglscreen.pro 2013-06-07 13:17:00.000000000 +0800 +++ qt-adsk-4.8.5/src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglscreen.pro 2013-09-22 09:31:41.000000000 +0800 @@ -1,5 +1,5 @@ TEMPLATE = lib -TARGET = qgfxpvregl +TARGET = qgfxpvregl$${QT_LIBINFIX} CONFIG += qt plugin warn_on QT += opengl @@ -24,4 +24,4 @@ target.path = $$[QT_INSTALL_PLUGINS]/gfxdrivers INSTALLS += target -include(../powervr.pri) \ No newline at end of file +include(../powervr.pri) diff -rau qt-everywhere-opensource-src-4.8.5/src/plugins/gfxdrivers/powervr/QWSWSEGL/QWSWSEGL.pro qt-adsk-4.8.5/src/plugins/gfxdrivers/powervr/QWSWSEGL/QWSWSEGL.pro --- qt-everywhere-opensource-src-4.8.5/src/plugins/gfxdrivers/powervr/QWSWSEGL/QWSWSEGL.pro 2013-06-07 13:17:00.000000000 +0800 +++ qt-adsk-4.8.5/src/plugins/gfxdrivers/powervr/QWSWSEGL/QWSWSEGL.pro 2013-09-22 09:31:41.000000000 +0800 @@ -1,5 +1,5 @@ TEMPLATE = lib -TARGET = pvrQWSWSEGL +TARGET = pvrQWSWSEGL$${QT_LIBINFIX} CONFIG += dll warn_on CONFIG -= qt @@ -23,4 +23,4 @@ target.path = $$[QT_INSTALL_LIBS] INSTALLS += target -include(../powervr.pri) \ No newline at end of file +include(../powervr.pri) diff -rau qt-everywhere-opensource-src-4.8.5/src/plugins/gfxdrivers/qvfb/qvfb.pro qt-adsk-4.8.5/src/plugins/gfxdrivers/qvfb/qvfb.pro --- qt-everywhere-opensource-src-4.8.5/src/plugins/gfxdrivers/qvfb/qvfb.pro 2013-06-07 13:17:00.000000000 +0800 +++ qt-adsk-4.8.5/src/plugins/gfxdrivers/qvfb/qvfb.pro 2013-09-22 09:31:41.000000000 +0800 @@ -1,4 +1,4 @@ -TARGET = qscreenvfb +TARGET = qscreenvfb$${QT_LIBINFIX} include(../../qpluginbase.pri) DEFINES += QT_QWS_QVFB QT_QWS_MOUSE_QVFB QT_QWS_KBD_QVFB diff -rau qt-everywhere-opensource-src-4.8.5/src/plugins/gfxdrivers/transformed/transformed.pro qt-adsk-4.8.5/src/plugins/gfxdrivers/transformed/transformed.pro --- qt-everywhere-opensource-src-4.8.5/src/plugins/gfxdrivers/transformed/transformed.pro 2013-06-07 13:17:00.000000000 +0800 +++ qt-adsk-4.8.5/src/plugins/gfxdrivers/transformed/transformed.pro 2013-09-22 09:31:41.000000000 +0800 @@ -1,4 +1,4 @@ -TARGET = qgfxtransformed +TARGET = qgfxtransformed$${QT_LIBINFIX} include(../../qpluginbase.pri) DEFINES += QT_QWS_TRANSFORMED diff -rau qt-everywhere-opensource-src-4.8.5/src/plugins/gfxdrivers/vnc/vnc.pro qt-adsk-4.8.5/src/plugins/gfxdrivers/vnc/vnc.pro --- qt-everywhere-opensource-src-4.8.5/src/plugins/gfxdrivers/vnc/vnc.pro 2013-06-07 13:17:00.000000000 +0800 +++ qt-adsk-4.8.5/src/plugins/gfxdrivers/vnc/vnc.pro 2013-09-22 09:31:41.000000000 +0800 @@ -1,4 +1,4 @@ -TARGET = qgfxvnc +TARGET = qgfxvnc$${QT_LIBINFIX} include(../../qpluginbase.pri) DEFINES += QT_QWS_VNC diff -rau qt-everywhere-opensource-src-4.8.5/src/plugins/graphicssystems/meego/meego.pro qt-adsk-4.8.5/src/plugins/graphicssystems/meego/meego.pro --- qt-everywhere-opensource-src-4.8.5/src/plugins/graphicssystems/meego/meego.pro 2013-06-07 13:17:00.000000000 +0800 +++ qt-adsk-4.8.5/src/plugins/graphicssystems/meego/meego.pro 2013-09-22 09:31:41.000000000 +0800 @@ -1,4 +1,4 @@ -TARGET = qmeegographicssystem +TARGET = qmeegographicssystem$${QT_LIBINFIX} include(../../qpluginbase.pri) QT += gui opengl diff -rau qt-everywhere-opensource-src-4.8.5/src/plugins/graphicssystems/opengl/opengl.pro qt-adsk-4.8.5/src/plugins/graphicssystems/opengl/opengl.pro --- qt-everywhere-opensource-src-4.8.5/src/plugins/graphicssystems/opengl/opengl.pro 2013-06-07 13:17:00.000000000 +0800 +++ qt-adsk-4.8.5/src/plugins/graphicssystems/opengl/opengl.pro 2013-09-22 09:31:41.000000000 +0800 @@ -1,4 +1,4 @@ -TARGET = qglgraphicssystem +TARGET = qglgraphicssystem$${QT_LIBINFIX} include(../../qpluginbase.pri) QT += opengl diff -rau qt-everywhere-opensource-src-4.8.5/src/plugins/graphicssystems/openvg/openvg.pro qt-adsk-4.8.5/src/plugins/graphicssystems/openvg/openvg.pro --- qt-everywhere-opensource-src-4.8.5/src/plugins/graphicssystems/openvg/openvg.pro 2013-06-07 13:17:00.000000000 +0800 +++ qt-adsk-4.8.5/src/plugins/graphicssystems/openvg/openvg.pro 2013-09-22 09:31:41.000000000 +0800 @@ -1,4 +1,4 @@ -TARGET = qvggraphicssystem +TARGET = qvggraphicssystem$${QT_LIBINFIX} include(../../qpluginbase.pri) QT += openvg diff -rau qt-everywhere-opensource-src-4.8.5/src/plugins/graphicssystems/shivavg/shivavg.pro qt-adsk-4.8.5/src/plugins/graphicssystems/shivavg/shivavg.pro --- qt-everywhere-opensource-src-4.8.5/src/plugins/graphicssystems/shivavg/shivavg.pro 2013-06-07 13:17:00.000000000 +0800 +++ qt-adsk-4.8.5/src/plugins/graphicssystems/shivavg/shivavg.pro 2013-09-22 09:31:41.000000000 +0800 @@ -1,4 +1,4 @@ -TARGET = qshivavggraphicssystem +TARGET = qshivavggraphicssystem$${QT_LIBINFIX} include(../../qpluginbase.pri) QT += openvg diff -rau qt-everywhere-opensource-src-4.8.5/src/plugins/graphicssystems/trace/trace.pro qt-adsk-4.8.5/src/plugins/graphicssystems/trace/trace.pro --- qt-everywhere-opensource-src-4.8.5/src/plugins/graphicssystems/trace/trace.pro 2013-06-07 13:17:00.000000000 +0800 +++ qt-adsk-4.8.5/src/plugins/graphicssystems/trace/trace.pro 2013-09-22 09:31:41.000000000 +0800 @@ -1,4 +1,4 @@ -TARGET = qtracegraphicssystem +TARGET = qtracegraphicssystem$${QT_LIBINFIX} include(../../qpluginbase.pri) QT += network diff -rau qt-everywhere-opensource-src-4.8.5/src/plugins/iconengines/svgiconengine/svgiconengine.pro qt-adsk-4.8.5/src/plugins/iconengines/svgiconengine/svgiconengine.pro --- qt-everywhere-opensource-src-4.8.5/src/plugins/iconengines/svgiconengine/svgiconengine.pro 2013-06-07 13:17:00.000000000 +0800 +++ qt-adsk-4.8.5/src/plugins/iconengines/svgiconengine/svgiconengine.pro 2013-09-22 09:31:41.000000000 +0800 @@ -1,4 +1,4 @@ -TARGET = qsvgicon +TARGET = qsvgicon$${QT_LIBINFIX} include(../../qpluginbase.pri) HEADERS += qsvgiconengine.h diff -rau qt-everywhere-opensource-src-4.8.5/src/plugins/imageformats/gif/gif.pro qt-adsk-4.8.5/src/plugins/imageformats/gif/gif.pro --- qt-everywhere-opensource-src-4.8.5/src/plugins/imageformats/gif/gif.pro 2013-06-07 13:17:00.000000000 +0800 +++ qt-adsk-4.8.5/src/plugins/imageformats/gif/gif.pro 2013-09-22 09:31:41.000000000 +0800 @@ -1,4 +1,4 @@ -TARGET = qgif +TARGET = qgif$${QT_LIBINFIX} include(../../qpluginbase.pri) include(../../../gui/image/qgifhandler.pri) diff -rau qt-everywhere-opensource-src-4.8.5/src/plugins/imageformats/ico/ico.pro qt-adsk-4.8.5/src/plugins/imageformats/ico/ico.pro --- qt-everywhere-opensource-src-4.8.5/src/plugins/imageformats/ico/ico.pro 2013-06-07 13:17:00.000000000 +0800 +++ qt-adsk-4.8.5/src/plugins/imageformats/ico/ico.pro 2013-09-22 09:31:41.000000000 +0800 @@ -1,4 +1,4 @@ -TARGET = qico +TARGET = qico$${QT_LIBINFIX} include(../../qpluginbase.pri) QTDIR_build:REQUIRES = "!contains(QT_CONFIG, no-ico)" diff -rau qt-everywhere-opensource-src-4.8.5/src/plugins/imageformats/jpeg/jpeg.pro qt-adsk-4.8.5/src/plugins/imageformats/jpeg/jpeg.pro --- qt-everywhere-opensource-src-4.8.5/src/plugins/imageformats/jpeg/jpeg.pro 2013-06-07 13:17:00.000000000 +0800 +++ qt-adsk-4.8.5/src/plugins/imageformats/jpeg/jpeg.pro 2013-09-22 09:31:41.000000000 +0800 @@ -1,4 +1,4 @@ -TARGET = qjpeg +TARGET = qjpeg$${QT_LIBINFIX} include(../../qpluginbase.pri) QTDIR_build:REQUIRES = "!contains(QT_CONFIG, no-jpeg)" diff -rau qt-everywhere-opensource-src-4.8.5/src/plugins/imageformats/mng/mng.pro qt-adsk-4.8.5/src/plugins/imageformats/mng/mng.pro --- qt-everywhere-opensource-src-4.8.5/src/plugins/imageformats/mng/mng.pro 2013-06-07 13:17:00.000000000 +0800 +++ qt-adsk-4.8.5/src/plugins/imageformats/mng/mng.pro 2013-09-22 09:31:41.000000000 +0800 @@ -1,4 +1,4 @@ -TARGET = qmng +TARGET = qmng$${QT_LIBINFIX} include(../../qpluginbase.pri) QTDIR_build:REQUIRES = "!contains(QT_CONFIG, no-mng)" diff -rau qt-everywhere-opensource-src-4.8.5/src/plugins/imageformats/svg/svg.pro qt-adsk-4.8.5/src/plugins/imageformats/svg/svg.pro --- qt-everywhere-opensource-src-4.8.5/src/plugins/imageformats/svg/svg.pro 2013-06-07 13:17:00.000000000 +0800 +++ qt-adsk-4.8.5/src/plugins/imageformats/svg/svg.pro 2013-09-22 09:31:41.000000000 +0800 @@ -1,4 +1,4 @@ -TARGET = qsvg +TARGET = qsvg$${QT_LIBINFIX} include(../../qpluginbase.pri) HEADERS += qsvgiohandler.h diff -rau qt-everywhere-opensource-src-4.8.5/src/plugins/imageformats/tga/tga.pro qt-adsk-4.8.5/src/plugins/imageformats/tga/tga.pro --- qt-everywhere-opensource-src-4.8.5/src/plugins/imageformats/tga/tga.pro 2013-06-07 13:17:00.000000000 +0800 +++ qt-adsk-4.8.5/src/plugins/imageformats/tga/tga.pro 2013-09-22 09:31:41.000000000 +0800 @@ -1,4 +1,4 @@ -TARGET = qtga +TARGET = qtga$${QT_LIBINFIX} include(../../qpluginbase.pri) QTDIR_build:REQUIRES = "!contains(QT_CONFIG, no-tga)" diff -rau qt-everywhere-opensource-src-4.8.5/src/plugins/imageformats/tiff/tiff.pro qt-adsk-4.8.5/src/plugins/imageformats/tiff/tiff.pro --- qt-everywhere-opensource-src-4.8.5/src/plugins/imageformats/tiff/tiff.pro 2013-06-07 13:17:00.000000000 +0800 +++ qt-adsk-4.8.5/src/plugins/imageformats/tiff/tiff.pro 2013-09-22 09:31:41.000000000 +0800 @@ -1,4 +1,4 @@ -TARGET = qtiff +TARGET = qtiff$${QT_LIBINFIX} include(../../qpluginbase.pri) QTDIR_build:REQUIRES = "!contains(QT_CONFIG, no-tiff)" diff -rau qt-everywhere-opensource-src-4.8.5/src/plugins/inputmethods/imsw-multi/imsw-multi.pro qt-adsk-4.8.5/src/plugins/inputmethods/imsw-multi/imsw-multi.pro --- qt-everywhere-opensource-src-4.8.5/src/plugins/inputmethods/imsw-multi/imsw-multi.pro 2013-06-07 13:17:00.000000000 +0800 +++ qt-adsk-4.8.5/src/plugins/inputmethods/imsw-multi/imsw-multi.pro 2013-09-22 09:31:41.000000000 +0800 @@ -1,4 +1,4 @@ -TARGET = qimsw-multi +TARGET = qimsw-multi$${QT_LIBINFIX} include(../../qpluginbase.pri) CONFIG += warn_on diff -rau qt-everywhere-opensource-src-4.8.5/src/plugins/kbddrivers/linuxinput/linuxinput.pro qt-adsk-4.8.5/src/plugins/kbddrivers/linuxinput/linuxinput.pro --- qt-everywhere-opensource-src-4.8.5/src/plugins/kbddrivers/linuxinput/linuxinput.pro 2013-06-07 13:17:00.000000000 +0800 +++ qt-adsk-4.8.5/src/plugins/kbddrivers/linuxinput/linuxinput.pro 2013-09-22 09:31:41.000000000 +0800 @@ -1,4 +1,4 @@ -TARGET = qlinuxinputkbddriver +TARGET = qlinuxinputkbddriver$${QT_LIBINFIX} include(../../qpluginbase.pri) QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/kbddrivers diff -rau qt-everywhere-opensource-src-4.8.5/src/plugins/mousedrivers/linuxtp/linuxtp.pro qt-adsk-4.8.5/src/plugins/mousedrivers/linuxtp/linuxtp.pro --- qt-everywhere-opensource-src-4.8.5/src/plugins/mousedrivers/linuxtp/linuxtp.pro 2013-06-07 13:17:00.000000000 +0800 +++ qt-adsk-4.8.5/src/plugins/mousedrivers/linuxtp/linuxtp.pro 2013-09-22 09:31:41.000000000 +0800 @@ -1,4 +1,4 @@ -TARGET = qlinuxtpmousedriver +TARGET = qlinuxtpmousedriver$${QT_LIBINFIX} include(../../qpluginbase.pri) QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/mousedrivers diff -rau qt-everywhere-opensource-src-4.8.5/src/plugins/mousedrivers/pc/pc.pro qt-adsk-4.8.5/src/plugins/mousedrivers/pc/pc.pro --- qt-everywhere-opensource-src-4.8.5/src/plugins/mousedrivers/pc/pc.pro 2013-06-07 13:17:00.000000000 +0800 +++ qt-adsk-4.8.5/src/plugins/mousedrivers/pc/pc.pro 2013-09-22 09:31:41.000000000 +0800 @@ -1,4 +1,4 @@ -TARGET = qpcmousedriver +TARGET = qpcmousedriver$${QT_LIBINFIX} include(../../qpluginbase.pri) QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/mousedrivers diff -rau qt-everywhere-opensource-src-4.8.5/src/plugins/mousedrivers/tslib/tslib.pro qt-adsk-4.8.5/src/plugins/mousedrivers/tslib/tslib.pro --- qt-everywhere-opensource-src-4.8.5/src/plugins/mousedrivers/tslib/tslib.pro 2013-06-07 13:17:00.000000000 +0800 +++ qt-adsk-4.8.5/src/plugins/mousedrivers/tslib/tslib.pro 2013-09-22 09:31:41.000000000 +0800 @@ -1,4 +1,4 @@ -TARGET = qtslibmousedriver +TARGET = qtslibmousedriver$${QT_LIBINFIX} include(../../qpluginbase.pri) QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/mousedrivers diff -rau qt-everywhere-opensource-src-4.8.5/src/plugins/phonon/ds9/ds9.pro qt-adsk-4.8.5/src/plugins/phonon/ds9/ds9.pro --- qt-everywhere-opensource-src-4.8.5/src/plugins/phonon/ds9/ds9.pro 2013-06-07 13:17:00.000000000 +0800 +++ qt-adsk-4.8.5/src/plugins/phonon/ds9/ds9.pro 2013-09-22 09:31:41.000000000 +0800 @@ -4,7 +4,7 @@ win32:!wince*:LIBS += -lgdi32 win32-msvc2005:DEFINES += _CRT_SECURE_NO_WARNINGS LIBS += -lstrmiids -ldmoguids -luuid -lmsdmo -lole32 -loleaut32 -TARGET = phonon_ds9 +TARGET = phonon_ds9$${QT_LIBINFIX} DEFINES += PHONON_MAKE_QT_ONLY_BACKEND PHONON_DS9_DIR = $$QT_SOURCE_TREE/src/3rdparty/phonon/ds9 diff -rau qt-everywhere-opensource-src-4.8.5/src/plugins/phonon/gstreamer/gstreamer.pro qt-adsk-4.8.5/src/plugins/phonon/gstreamer/gstreamer.pro --- qt-everywhere-opensource-src-4.8.5/src/plugins/phonon/gstreamer/gstreamer.pro 2013-06-07 13:17:00.000000000 +0800 +++ qt-adsk-4.8.5/src/plugins/phonon/gstreamer/gstreamer.pro 2013-09-22 09:31:41.000000000 +0800 @@ -1,4 +1,4 @@ -TARGET = phonon_gstreamer +TARGET = phonon_gstreamer$${QT_LIBINFIX} DESTDIR = $$QT_BUILD_TREE/plugins/phonon_backend DEPENDPATH += . diff -rau qt-everywhere-opensource-src-4.8.5/src/plugins/phonon/mmf/mmf.pro qt-adsk-4.8.5/src/plugins/phonon/mmf/mmf.pro --- qt-everywhere-opensource-src-4.8.5/src/plugins/phonon/mmf/mmf.pro 2013-06-07 13:17:00.000000000 +0800 +++ qt-adsk-4.8.5/src/plugins/phonon/mmf/mmf.pro 2013-09-22 09:31:41.000000000 +0800 @@ -1,7 +1,7 @@ # MMF Phonon backend symbian { QT += phonon - TARGET = phonon_mmf + TARGET = phonon_mmf$${QT_LIBINFIX} PHONON_MMF_DIR = $$QT_SOURCE_TREE/src/3rdparty/phonon/mmf # Uncomment the following line in order to use the CDrmPlayerUtility client diff -rau qt-everywhere-opensource-src-4.8.5/src/plugins/phonon/qt7/qt7.pro qt-adsk-4.8.5/src/plugins/phonon/qt7/qt7.pro --- qt-everywhere-opensource-src-4.8.5/src/plugins/phonon/qt7/qt7.pro 2013-06-07 13:17:00.000000000 +0800 +++ qt-adsk-4.8.5/src/plugins/phonon/qt7/qt7.pro 2013-09-22 09:31:41.000000000 +0800 @@ -1,5 +1,5 @@ QT += opengl phonon -TARGET = phonon_qt7 +TARGET = phonon_qt7$${QT_LIBINFIX} DESTDIR = $$QT_BUILD_TREE/plugins/phonon_backend # The Quicktime framework is only awailable for 32-bit builds, so we diff -rau qt-everywhere-opensource-src-4.8.5/src/plugins/phonon/waveout/waveout.pro qt-adsk-4.8.5/src/plugins/phonon/waveout/waveout.pro --- qt-everywhere-opensource-src-4.8.5/src/plugins/phonon/waveout/waveout.pro 2013-06-07 13:17:00.000000000 +0800 +++ qt-adsk-4.8.5/src/plugins/phonon/waveout/waveout.pro 2013-09-22 09:31:41.000000000 +0800 @@ -1,7 +1,7 @@ DESTDIR = $$QT_BUILD_TREE/plugins/phonon_backend QT += phonon win32-msvc2005:DEFINES += _CRT_SECURE_NO_WARNINGS -TARGET = phonon_waveout +TARGET = phonon_waveout$${QT_LIBINFIX} DEFINES += PHONON_MAKE_QT_ONLY_BACKEND PHONON_WAVEOUT_DIR = $$QT_SOURCE_TREE/src/3rdparty/phonon/waveout diff -rau qt-everywhere-opensource-src-4.8.5/src/plugins/platforms/blackberry/blackberry.pro qt-adsk-4.8.5/src/plugins/platforms/blackberry/blackberry.pro --- qt-everywhere-opensource-src-4.8.5/src/plugins/platforms/blackberry/blackberry.pro 2013-06-07 13:17:00.000000000 +0800 +++ qt-adsk-4.8.5/src/plugins/platforms/blackberry/blackberry.pro 2013-09-22 09:31:41.000000000 +0800 @@ -1,4 +1,4 @@ -TARGET = blackberry +TARGET = blackberry$${QT_LIBINFIX} include(../../qpluginbase.pri) QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/platforms diff -rau qt-everywhere-opensource-src-4.8.5/src/plugins/platforms/cocoa/cocoa.pro qt-adsk-4.8.5/src/plugins/platforms/cocoa/cocoa.pro --- qt-everywhere-opensource-src-4.8.5/src/plugins/platforms/cocoa/cocoa.pro 2013-06-07 13:17:00.000000000 +0800 +++ qt-adsk-4.8.5/src/plugins/platforms/cocoa/cocoa.pro 2013-09-22 09:31:41.000000000 +0800 @@ -1,4 +1,4 @@ -TARGET = qcocoa +TARGET = qcocoa$${QT_LIBINFIX} include(../../qpluginbase.pri) QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/platforms diff -rau qt-everywhere-opensource-src-4.8.5/src/plugins/platforms/cocoa/qcocoawindow.mm qt-adsk-4.8.5/src/plugins/platforms/cocoa/qcocoawindow.mm --- qt-everywhere-opensource-src-4.8.5/src/plugins/platforms/cocoa/qcocoawindow.mm 2013-06-07 13:17:00.000000000 +0800 +++ qt-adsk-4.8.5/src/plugins/platforms/cocoa/qcocoawindow.mm 2013-10-21 15:51:42.000000000 +0800 @@ -67,6 +67,11 @@ [m_nsWindow makeKeyAndOrderFront:nil]; [m_nsWindow setAcceptsMouseMovedEvents:YES]; + +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7 + if ([m_nsWindow respondsToSelector:@selector(setRestorable:)]) + [m_nsWindow setRestorable: NO]; +#endif } QCocoaWindow::~QCocoaWindow() diff -rau qt-everywhere-opensource-src-4.8.5/src/plugins/platforms/directfb/directfb.pro qt-adsk-4.8.5/src/plugins/platforms/directfb/directfb.pro --- qt-everywhere-opensource-src-4.8.5/src/plugins/platforms/directfb/directfb.pro 2013-06-07 13:17:00.000000000 +0800 +++ qt-adsk-4.8.5/src/plugins/platforms/directfb/directfb.pro 2013-09-22 09:31:41.000000000 +0800 @@ -1,4 +1,4 @@ -TARGET = qdirectfb +TARGET = qdirectfb$${QT_LIBINFIX} include(../../qpluginbase.pri) QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/platforms diff -rau qt-everywhere-opensource-src-4.8.5/src/plugins/platforms/eglfs/eglfs.pro qt-adsk-4.8.5/src/plugins/platforms/eglfs/eglfs.pro --- qt-everywhere-opensource-src-4.8.5/src/plugins/platforms/eglfs/eglfs.pro 2013-06-07 13:17:00.000000000 +0800 +++ qt-adsk-4.8.5/src/plugins/platforms/eglfs/eglfs.pro 2013-09-22 09:31:41.000000000 +0800 @@ -1,4 +1,4 @@ -TARGET = qeglfs +TARGET = qeglfs$${QT_LIBINFIX} TEMPLATE = lib CONFIG += plugin diff -rau qt-everywhere-opensource-src-4.8.5/src/plugins/platforms/fb_base/fb_base.pro qt-adsk-4.8.5/src/plugins/platforms/fb_base/fb_base.pro --- qt-everywhere-opensource-src-4.8.5/src/plugins/platforms/fb_base/fb_base.pro 2013-06-07 13:17:00.000000000 +0800 +++ qt-adsk-4.8.5/src/plugins/platforms/fb_base/fb_base.pro 2013-09-22 09:31:41.000000000 +0800 @@ -5,7 +5,7 @@ #------------------------------------------------- #QT -= core gui -TARGET = fb_base +TARGET = fb_base$${QT_LIBINFIX} #include(../../qpluginbase.pri) QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/graphicssystems diff -rau qt-everywhere-opensource-src-4.8.5/src/plugins/platforms/linuxfb/linuxfb.pro qt-adsk-4.8.5/src/plugins/platforms/linuxfb/linuxfb.pro --- qt-everywhere-opensource-src-4.8.5/src/plugins/platforms/linuxfb/linuxfb.pro 2013-06-07 13:17:00.000000000 +0800 +++ qt-adsk-4.8.5/src/plugins/platforms/linuxfb/linuxfb.pro 2013-09-22 09:31:41.000000000 +0800 @@ -1,4 +1,4 @@ -TARGET = qlinuxfbgraphicssystem +TARGET = qlinuxfbgraphicssystem$${QT_LIBINFIX} include(../../qpluginbase.pri) QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/platforms diff -rau qt-everywhere-opensource-src-4.8.5/src/plugins/platforms/minimal/minimal.pro qt-adsk-4.8.5/src/plugins/platforms/minimal/minimal.pro --- qt-everywhere-opensource-src-4.8.5/src/plugins/platforms/minimal/minimal.pro 2013-06-07 13:17:00.000000000 +0800 +++ qt-adsk-4.8.5/src/plugins/platforms/minimal/minimal.pro 2013-09-22 09:31:41.000000000 +0800 @@ -1,4 +1,4 @@ -TARGET = qminimal +TARGET = qminimal$${QT_LIBINFIX} include(../../qpluginbase.pri) QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/platforms diff -rau qt-everywhere-opensource-src-4.8.5/src/plugins/platforms/openkode/openkode.pro qt-adsk-4.8.5/src/plugins/platforms/openkode/openkode.pro --- qt-everywhere-opensource-src-4.8.5/src/plugins/platforms/openkode/openkode.pro 2013-06-07 13:17:00.000000000 +0800 +++ qt-adsk-4.8.5/src/plugins/platforms/openkode/openkode.pro 2013-09-22 09:31:41.000000000 +0800 @@ -1,4 +1,4 @@ -TARGET = qopenkodeintegration +TARGET = qopenkodeintegration$${QT_LIBINFIX} include(../../qpluginbase.pri) QT += opengl diff -rau qt-everywhere-opensource-src-4.8.5/src/plugins/platforms/qvfb/qvfb.pro qt-adsk-4.8.5/src/plugins/platforms/qvfb/qvfb.pro --- qt-everywhere-opensource-src-4.8.5/src/plugins/platforms/qvfb/qvfb.pro 2013-06-07 13:17:00.000000000 +0800 +++ qt-adsk-4.8.5/src/plugins/platforms/qvfb/qvfb.pro 2013-09-22 09:31:41.000000000 +0800 @@ -1,4 +1,4 @@ -TARGET = qvfbintegration +TARGET = qvfbintegration$${QT_LIBINFIX} include(../../qpluginbase.pri) QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/platforms diff -rau qt-everywhere-opensource-src-4.8.5/src/plugins/platforms/uikit/phonon_av/phonon_av.pro qt-adsk-4.8.5/src/plugins/platforms/uikit/phonon_av/phonon_av.pro --- qt-everywhere-opensource-src-4.8.5/src/plugins/platforms/uikit/phonon_av/phonon_av.pro 2013-06-07 13:17:00.000000000 +0800 +++ qt-adsk-4.8.5/src/plugins/platforms/uikit/phonon_av/phonon_av.pro 2013-09-22 09:31:41.000000000 +0800 @@ -1,6 +1,6 @@ DESTDIR = $$QT_BUILD_TREE/plugins/phonon_backend QT += phonon -TARGET = phonon_av +TARGET = phonon_av$${QT_LIBINFIX} include(../../../qpluginbase.pri) DEFINES += PHONON_MAKE_QT_ONLY_BACKEND diff -rau qt-everywhere-opensource-src-4.8.5/src/plugins/platforms/uikit/platform.pro qt-adsk-4.8.5/src/plugins/platforms/uikit/platform.pro --- qt-everywhere-opensource-src-4.8.5/src/plugins/platforms/uikit/platform.pro 2013-06-07 13:17:00.000000000 +0800 +++ qt-adsk-4.8.5/src/plugins/platforms/uikit/platform.pro 2013-09-22 09:31:41.000000000 +0800 @@ -1,4 +1,4 @@ -TARGET = quikit +TARGET = quikit$${QT_LIBINFIX} include(../../qpluginbase.pri) QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/platforms diff -rau qt-everywhere-opensource-src-4.8.5/src/plugins/platforms/vnc/vnc.pro qt-adsk-4.8.5/src/plugins/platforms/vnc/vnc.pro --- qt-everywhere-opensource-src-4.8.5/src/plugins/platforms/vnc/vnc.pro 2013-06-07 13:17:00.000000000 +0800 +++ qt-adsk-4.8.5/src/plugins/platforms/vnc/vnc.pro 2013-09-22 09:31:41.000000000 +0800 @@ -1,4 +1,4 @@ -TARGET = qvncgraphicssystem +TARGET = qvncgraphicssystem$${QT_LIBINFIX} include(../../qpluginbase.pri) QT += network diff -rau qt-everywhere-opensource-src-4.8.5/src/plugins/platforms/wayland/wayland.pro qt-adsk-4.8.5/src/plugins/platforms/wayland/wayland.pro --- qt-everywhere-opensource-src-4.8.5/src/plugins/platforms/wayland/wayland.pro 2013-06-07 13:17:00.000000000 +0800 +++ qt-adsk-4.8.5/src/plugins/platforms/wayland/wayland.pro 2013-09-22 09:31:41.000000000 +0800 @@ -1,4 +1,4 @@ -TARGET = qwayland +TARGET = qwayland$${QT_LIBINFIX} include(../../qpluginbase.pri) QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/platforms diff -rau qt-everywhere-opensource-src-4.8.5/src/plugins/platforms/xcb/xcb.pro qt-adsk-4.8.5/src/plugins/platforms/xcb/xcb.pro --- qt-everywhere-opensource-src-4.8.5/src/plugins/platforms/xcb/xcb.pro 2013-06-07 13:17:00.000000000 +0800 +++ qt-adsk-4.8.5/src/plugins/platforms/xcb/xcb.pro 2013-09-22 09:31:41.000000000 +0800 @@ -1,4 +1,4 @@ -TARGET = xcb +TARGET = xcb$${QT_LIBINFIX} include(../../qpluginbase.pri) QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/platforms diff -rau qt-everywhere-opensource-src-4.8.5/src/plugins/platforms/xlib/xlib.pro qt-adsk-4.8.5/src/plugins/platforms/xlib/xlib.pro --- qt-everywhere-opensource-src-4.8.5/src/plugins/platforms/xlib/xlib.pro 2013-06-07 13:17:00.000000000 +0800 +++ qt-adsk-4.8.5/src/plugins/platforms/xlib/xlib.pro 2013-09-22 09:31:41.000000000 +0800 @@ -1,4 +1,4 @@ -TARGET = qxlib +TARGET = qxlib$${QT_LIBINFIX} include(../../qpluginbase.pri) QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/platforms diff -rau qt-everywhere-opensource-src-4.8.5/src/plugins/qmltooling/qmldbg_inspector/qmldbg_inspector.pro qt-adsk-4.8.5/src/plugins/qmltooling/qmldbg_inspector/qmldbg_inspector.pro --- qt-everywhere-opensource-src-4.8.5/src/plugins/qmltooling/qmldbg_inspector/qmldbg_inspector.pro 2013-06-07 13:17:00.000000000 +0800 +++ qt-adsk-4.8.5/src/plugins/qmltooling/qmldbg_inspector/qmldbg_inspector.pro 2013-09-22 09:31:41.000000000 +0800 @@ -1,4 +1,4 @@ -TARGET = qmldbg_inspector +TARGET = qmldbg_inspector$${QT_LIBINFIX} QT += declarative include(../../qpluginbase.pri) diff -rau qt-everywhere-opensource-src-4.8.5/src/plugins/qmltooling/qmldbg_ost/qmldbg_ost.pro qt-adsk-4.8.5/src/plugins/qmltooling/qmldbg_ost/qmldbg_ost.pro --- qt-everywhere-opensource-src-4.8.5/src/plugins/qmltooling/qmldbg_ost/qmldbg_ost.pro 2013-06-07 13:17:00.000000000 +0800 +++ qt-adsk-4.8.5/src/plugins/qmltooling/qmldbg_ost/qmldbg_ost.pro 2013-09-22 09:31:41.000000000 +0800 @@ -1,4 +1,4 @@ -TARGET = qmldbg_ost +TARGET = qmldbg_ost$${QT_LIBINFIX} QT += declarative network include(../../qpluginbase.pri) diff -rau qt-everywhere-opensource-src-4.8.5/src/plugins/script/qtdbus/qtdbus.pro qt-adsk-4.8.5/src/plugins/script/qtdbus/qtdbus.pro --- qt-everywhere-opensource-src-4.8.5/src/plugins/script/qtdbus/qtdbus.pro 2013-06-07 13:17:00.000000000 +0800 +++ qt-adsk-4.8.5/src/plugins/script/qtdbus/qtdbus.pro 2013-09-22 09:31:41.000000000 +0800 @@ -1,4 +1,4 @@ -TARGET = qtscriptdbus +TARGET = qtscriptdbus$${QT_LIBINFIX} include(../../qpluginbase.pri) QT = core gui script CONFIG += qdbus diff -rau qt-everywhere-opensource-src-4.8.5/src/plugins/sqldrivers/db2/db2.pro qt-adsk-4.8.5/src/plugins/sqldrivers/db2/db2.pro --- qt-everywhere-opensource-src-4.8.5/src/plugins/sqldrivers/db2/db2.pro 2013-06-07 13:17:00.000000000 +0800 +++ qt-adsk-4.8.5/src/plugins/sqldrivers/db2/db2.pro 2013-09-22 09:31:41.000000000 +0800 @@ -1,4 +1,4 @@ -TARGET = qsqldb2 +TARGET = qsqldb2$${QT_LIBINFIX} SOURCES = main.cpp include(../../../sql/drivers/db2/qsql_db2.pri) diff -rau qt-everywhere-opensource-src-4.8.5/src/plugins/sqldrivers/ibase/ibase.pro qt-adsk-4.8.5/src/plugins/sqldrivers/ibase/ibase.pro --- qt-everywhere-opensource-src-4.8.5/src/plugins/sqldrivers/ibase/ibase.pro 2013-06-07 13:17:00.000000000 +0800 +++ qt-adsk-4.8.5/src/plugins/sqldrivers/ibase/ibase.pro 2013-09-22 09:31:41.000000000 +0800 @@ -1,4 +1,4 @@ -TARGET = qsqlibase +TARGET = qsqlibase$${QT_LIBINFIX} SOURCES = main.cpp include(../../../sql/drivers/ibase/qsql_ibase.pri) diff -rau qt-everywhere-opensource-src-4.8.5/src/plugins/sqldrivers/mysql/mysql.pro qt-adsk-4.8.5/src/plugins/sqldrivers/mysql/mysql.pro --- qt-everywhere-opensource-src-4.8.5/src/plugins/sqldrivers/mysql/mysql.pro 2013-06-07 13:17:00.000000000 +0800 +++ qt-adsk-4.8.5/src/plugins/sqldrivers/mysql/mysql.pro 2013-09-22 09:31:41.000000000 +0800 @@ -1,4 +1,4 @@ -TARGET = qsqlmysql +TARGET = qsqlmysql$${QT_LIBINFIX} SOURCES = main.cpp include(../../../sql/drivers/mysql/qsql_mysql.pri) diff -rau qt-everywhere-opensource-src-4.8.5/src/plugins/sqldrivers/oci/oci.pro qt-adsk-4.8.5/src/plugins/sqldrivers/oci/oci.pro --- qt-everywhere-opensource-src-4.8.5/src/plugins/sqldrivers/oci/oci.pro 2013-06-07 13:17:00.000000000 +0800 +++ qt-adsk-4.8.5/src/plugins/sqldrivers/oci/oci.pro 2013-09-22 09:31:41.000000000 +0800 @@ -1,4 +1,4 @@ -TARGET = qsqloci +TARGET = qsqloci$${QT_LIBINFIX} SOURCES = main.cpp include(../../../sql/drivers/oci/qsql_oci.pri) diff -rau qt-everywhere-opensource-src-4.8.5/src/plugins/sqldrivers/odbc/odbc.pro qt-adsk-4.8.5/src/plugins/sqldrivers/odbc/odbc.pro --- qt-everywhere-opensource-src-4.8.5/src/plugins/sqldrivers/odbc/odbc.pro 2013-06-07 13:17:00.000000000 +0800 +++ qt-adsk-4.8.5/src/plugins/sqldrivers/odbc/odbc.pro 2013-09-22 09:31:41.000000000 +0800 @@ -1,4 +1,4 @@ -TARGET = qsqlodbc +TARGET = qsqlodbc$${QT_LIBINFIX} SOURCES = main.cpp include(../../../sql/drivers/odbc/qsql_odbc.pri) diff -rau qt-everywhere-opensource-src-4.8.5/src/plugins/sqldrivers/psql/psql.pro qt-adsk-4.8.5/src/plugins/sqldrivers/psql/psql.pro --- qt-everywhere-opensource-src-4.8.5/src/plugins/sqldrivers/psql/psql.pro 2013-06-07 13:17:00.000000000 +0800 +++ qt-adsk-4.8.5/src/plugins/sqldrivers/psql/psql.pro 2013-09-22 09:31:41.000000000 +0800 @@ -1,4 +1,4 @@ -TARGET = qsqlpsql +TARGET = qsqlpsql$${QT_LIBINFIX} SOURCES = main.cpp include(../../../sql/drivers/psql/qsql_psql.pri) diff -rau qt-everywhere-opensource-src-4.8.5/src/plugins/sqldrivers/sqlite/sqlite.pro qt-adsk-4.8.5/src/plugins/sqldrivers/sqlite/sqlite.pro --- qt-everywhere-opensource-src-4.8.5/src/plugins/sqldrivers/sqlite/sqlite.pro 2013-06-07 13:17:00.000000000 +0800 +++ qt-adsk-4.8.5/src/plugins/sqldrivers/sqlite/sqlite.pro 2013-09-22 09:31:41.000000000 +0800 @@ -1,4 +1,4 @@ -TARGET = qsqlite +TARGET = qsqlite$${QT_LIBINFIX} SOURCES = smain.cpp include(../../../sql/drivers/sqlite/qsql_sqlite.pri) diff -rau qt-everywhere-opensource-src-4.8.5/src/plugins/sqldrivers/sqlite2/sqlite2.pro qt-adsk-4.8.5/src/plugins/sqldrivers/sqlite2/sqlite2.pro --- qt-everywhere-opensource-src-4.8.5/src/plugins/sqldrivers/sqlite2/sqlite2.pro 2013-06-07 13:17:00.000000000 +0800 +++ qt-adsk-4.8.5/src/plugins/sqldrivers/sqlite2/sqlite2.pro 2013-09-22 09:31:41.000000000 +0800 @@ -1,4 +1,4 @@ -TARGET = qsqlite2 +TARGET = qsqlite2$${QT_LIBINFIX} SOURCES = smain.cpp include(../../../sql/drivers/sqlite2/qsql_sqlite2.pri) diff -rau qt-everywhere-opensource-src-4.8.5/src/plugins/sqldrivers/symsql/symsql.pro qt-adsk-4.8.5/src/plugins/sqldrivers/symsql/symsql.pro --- qt-everywhere-opensource-src-4.8.5/src/plugins/sqldrivers/symsql/symsql.pro 2013-06-07 13:17:00.000000000 +0800 +++ qt-adsk-4.8.5/src/plugins/sqldrivers/symsql/symsql.pro 2013-09-22 09:31:41.000000000 +0800 @@ -1,4 +1,4 @@ -TARGET = qsymsql +TARGET = qsymsql$${QT_LIBINFIX} PLUGIN_TYPE = sqldrivers SOURCES = main.cpp diff -rau qt-everywhere-opensource-src-4.8.5/src/plugins/sqldrivers/tds/tds.pro qt-adsk-4.8.5/src/plugins/sqldrivers/tds/tds.pro --- qt-everywhere-opensource-src-4.8.5/src/plugins/sqldrivers/tds/tds.pro 2013-06-07 13:17:00.000000000 +0800 +++ qt-adsk-4.8.5/src/plugins/sqldrivers/tds/tds.pro 2013-09-22 09:31:41.000000000 +0800 @@ -1,4 +1,4 @@ -TARGET = qsqltds +TARGET = qsqltds$${QT_LIBINFIX} SOURCES = main.cpp include(../../../sql/drivers/tds/qsql_tds.pri) diff -rau qt-everywhere-opensource-src-4.8.5/src/qt3support/network/q3socketdevice_unix.cpp qt-adsk-4.8.5/src/qt3support/network/q3socketdevice_unix.cpp --- qt-everywhere-opensource-src-4.8.5/src/qt3support/network/q3socketdevice_unix.cpp 2013-06-07 13:16:59.000000000 +0800 +++ qt-adsk-4.8.5/src/qt3support/network/q3socketdevice_unix.cpp 2013-09-22 09:31:41.000000000 +0800 @@ -68,6 +68,7 @@ #endif #include "q3socketdevice.h" +#include "private/qcore_unix_p.h" #ifndef QT_NO_NETWORK @@ -588,19 +589,10 @@ { if ( !isValid() ) return -1; - if ( fd >= FD_SETSIZE ) - return -1; - - fd_set fds; - struct timeval tv; - - FD_ZERO( &fds ); - FD_SET( fd, &fds ); - - tv.tv_sec = msecs / 1000; - tv.tv_usec = (msecs % 1000) * 1000; - int rv = select( fd+1, &fds, 0, 0, msecs < 0 ? 0 : &tv ); + pollfd pfd; + pfd.fd = fd; + int rv = qt_safe_poll(&pfd, 1, msecs, /* retry_eintr */ false); if ( rv < 0 ) return -1; diff -rau qt-everywhere-opensource-src-4.8.5/src/qt3support/other/q3process_unix.cpp qt-adsk-4.8.5/src/qt3support/other/q3process_unix.cpp --- qt-everywhere-opensource-src-4.8.5/src/qt3support/other/q3process_unix.cpp 2013-06-07 13:16:58.000000000 +0800 +++ qt-adsk-4.8.5/src/qt3support/other/q3process_unix.cpp 2013-09-22 09:31:41.000000000 +0800 @@ -981,13 +981,10 @@ // On heavy processing, the socket notifier for the sigchild might not // have found time to fire yet. if ( d->procManager && d->procManager->sigchldFd[1] < FD_SETSIZE ) { - fd_set fds; - struct timeval tv; - FD_ZERO( &fds ); - FD_SET( d->procManager->sigchldFd[1], &fds ); - tv.tv_sec = 0; - tv.tv_usec = 0; - if ( ::select( d->procManager->sigchldFd[1]+1, &fds, 0, 0, &tv ) > 0 ) + pollfd fd; + fd.fd = d->procManager->sigchldFd[1]; + fd.events = POLLIN; + if ( qt_safe_poll(&fd, 1, 0, /* retry_eintr */ false) > 0 ) d->procManager->sigchldHnd( d->procManager->sigchldFd[1] ); } @@ -1124,29 +1121,21 @@ } } - if ( fd < FD_SETSIZE ) { - fd_set fds; - struct timeval tv; - FD_ZERO( &fds ); - FD_SET( fd, &fds ); - tv.tv_sec = 0; - tv.tv_usec = 0; - while ( ::select( fd+1, &fds, 0, 0, &tv ) > 0 ) { - // prepare for the next round - FD_ZERO( &fds ); - FD_SET( fd, &fds ); - // read data - ba = new QByteArray( basize ); - n = ::read( fd, ba->data(), basize ); - if ( n > 0 ) { - ba->resize( n ); - buffer->append( ba ); - ba = 0; - } else { - delete ba; - ba = 0; - break; - } + pollfd pfd; + pfd.fd = fd; + pfd.events = POLLIN; + while (qt_safe_poll(&pfd, 1, 0)) { + // read data + ba = new QByteArray( basize ); + n = ::read( fd, ba->data(), basize ); + if ( n > 0 ) { + ba->resize( n ); + buffer->append( ba ); + ba = 0; + } else { + delete ba; + ba = 0; + break; } } diff -rau qt-everywhere-opensource-src-4.8.5/src/sql/kernel/qsqlcachedresult.cpp qt-adsk-4.8.5/src/sql/kernel/qsqlcachedresult.cpp --- qt-everywhere-opensource-src-4.8.5/src/sql/kernel/qsqlcachedresult.cpp 2013-06-07 13:17:00.000000000 +0800 +++ qt-adsk-4.8.5/src/sql/kernel/qsqlcachedresult.cpp 2013-09-22 09:31:41.000000000 +0800 @@ -253,7 +253,7 @@ bool QSqlCachedResult::isNull(int i) { int idx = d->forwardOnly ? i : at() * d->colCount + i; - if (i > d->colCount || i < 0 || at() < 0 || idx >= d->rowCacheEnd) + if (i >= d->colCount || i < 0 || at() < 0 || idx >= d->rowCacheEnd) return true; return d->cache.at(idx).isNull(); diff -rau qt-everywhere-opensource-src-4.8.5/src/testlib/3rdparty/cycle_p.h qt-adsk-4.8.5/src/testlib/3rdparty/cycle_p.h --- qt-everywhere-opensource-src-4.8.5/src/testlib/3rdparty/cycle_p.h 2013-06-07 13:16:58.000000000 +0800 +++ qt-adsk-4.8.5/src/testlib/3rdparty/cycle_p.h 2013-09-22 09:31:41.000000000 +0800 @@ -23,7 +23,7 @@ * */ -/* $Id: cycle.h,v 1.52 2006-02-08 02:36:47 athena Exp $ */ +/* $Id: //depot/external_toolkit_source/Qt/4.8.2/src/testlib/3rdparty/cycle_p.h#1 $ */ /* machine-dependent cycle counters code. Needs to be inlined. */ diff -rau qt-everywhere-opensource-src-4.8.5/translations/qt_ja.ts qt-adsk-4.8.5/translations/qt_ja.ts --- qt-everywhere-opensource-src-4.8.5/translations/qt_ja.ts 2013-06-07 13:16:41.000000000 +0800 +++ qt-adsk-4.8.5/translations/qt_ja.ts 2013-09-22 09:31:41.000000000 +0800 @@ -2544,6 +2544,14 @@ 削除(&D) + &Copy + コピー(&C) + + + &Paste + 貼り付け(&P) + + Show &hidden files 隠しファイルの表示(&H) @@ -5578,19 +5586,19 @@ Left - + Left Up - + Up Right - + Right Down - + Down PgUp diff -rau qt-everywhere-opensource-src-4.8.5/translations/qt_zh_CN.ts qt-adsk-4.8.5/translations/qt_zh_CN.ts --- qt-everywhere-opensource-src-4.8.5/translations/qt_zh_CN.ts 2013-06-07 13:16:41.000000000 +0800 +++ qt-adsk-4.8.5/translations/qt_zh_CN.ts 2013-09-22 09:31:41.000000000 +0800 @@ -1549,6 +1549,14 @@ 删除(&D) + &Copy + 复制(&C) + + + &Paste + 粘贴(&P) + + Show &hidden files 显示隐藏文件(&H)