diff options
Diffstat (limited to 'src')
85 files changed, 896 insertions, 258 deletions
diff --git a/src/3rdparty/angle/include/KHR/khrplatform.h b/src/3rdparty/angle/include/KHR/khrplatform.h index 8ec0d199ff..56c676c77b 100644 --- a/src/3rdparty/angle/include/KHR/khrplatform.h +++ b/src/3rdparty/angle/include/KHR/khrplatform.h @@ -221,10 +221,17 @@ typedef signed char khronos_int8_t; typedef unsigned char khronos_uint8_t; typedef signed short int khronos_int16_t; typedef unsigned short int khronos_uint16_t; +#ifdef _WIN64 +typedef signed long long int khronos_intptr_t; +typedef unsigned long long int khronos_uintptr_t; +typedef signed long long int khronos_ssize_t; +typedef unsigned long long int khronos_usize_t; +#else typedef signed long int khronos_intptr_t; typedef unsigned long int khronos_uintptr_t; typedef signed long int khronos_ssize_t; typedef unsigned long int khronos_usize_t; +#endif #if KHRONOS_SUPPORT_FLOAT /* diff --git a/src/3rdparty/angle/src/libEGL/libEGL_mingw.def b/src/3rdparty/angle/src/libEGL/libEGL_mingw.def new file mode 100644 index 0000000000..8128e7c4f0 --- /dev/null +++ b/src/3rdparty/angle/src/libEGL/libEGL_mingw.def @@ -0,0 +1,36 @@ +LIBRARY libEGL +EXPORTS + eglBindAPI@4 @14 + eglBindTexImage@12 @20 + eglChooseConfig@20 @7 + eglCopyBuffers@12 @33 + eglCreateContext@16 @23 + eglCreatePbufferFromClientBuffer@20 @18 + eglCreatePbufferSurface@12 @10 + eglCreatePixmapSurface@16 @11 + eglCreateWindowSurface@16 @9 + eglDestroyContext@8 @24 + eglDestroySurface@8 @12 + eglGetConfigAttrib@16 @8 + eglGetConfigs@16 @6 + eglGetCurrentContext@0 @26 + eglGetCurrentDisplay@0 @28 + eglGetCurrentSurface@4 @27 + eglGetDisplay@4 @2 + eglGetError@0 @1 + eglGetProcAddress@4 @34 + eglInitialize@12 @3 + eglMakeCurrent@16 @25 + eglQueryAPI@0 @15 + eglQueryContext@16 @29 + eglQueryString@8 @5 + eglQuerySurface@16 @13 + eglReleaseTexImage@12 @21 + eglReleaseThread@0 @17 + eglSurfaceAttrib@16 @19 + eglSwapBuffers@8 @32 + eglSwapInterval@8 @22 + eglTerminate@4 @4 + eglWaitClient@0 @16 + eglWaitGL@0 @30 + eglWaitNative@4 @31 diff --git a/src/3rdparty/angle/src/libEGL/libEGLd_mingw.def b/src/3rdparty/angle/src/libEGL/libEGLd_mingw.def new file mode 100644 index 0000000000..1c72413f89 --- /dev/null +++ b/src/3rdparty/angle/src/libEGL/libEGLd_mingw.def @@ -0,0 +1,36 @@ +LIBRARY libEGLd +EXPORTS + eglBindAPI@4 @14 + eglBindTexImage@12 @20 + eglChooseConfig@20 @7 + eglCopyBuffers@12 @33 + eglCreateContext@16 @23 + eglCreatePbufferFromClientBuffer@20 @18 + eglCreatePbufferSurface@12 @10 + eglCreatePixmapSurface@16 @11 + eglCreateWindowSurface@16 @9 + eglDestroyContext@8 @24 + eglDestroySurface@8 @12 + eglGetConfigAttrib@16 @8 + eglGetConfigs@16 @6 + eglGetCurrentContext@0 @26 + eglGetCurrentDisplay@0 @28 + eglGetCurrentSurface@4 @27 + eglGetDisplay@4 @2 + eglGetError@0 @1 + eglGetProcAddress@4 @34 + eglInitialize@12 @3 + eglMakeCurrent@16 @25 + eglQueryAPI@0 @15 + eglQueryContext@16 @29 + eglQueryString@8 @5 + eglQuerySurface@16 @13 + eglReleaseTexImage@12 @21 + eglReleaseThread@0 @17 + eglSurfaceAttrib@16 @19 + eglSwapBuffers@8 @32 + eglSwapInterval@8 @22 + eglTerminate@4 @4 + eglWaitClient@0 @16 + eglWaitGL@0 @30 + eglWaitNative@4 @31 diff --git a/src/3rdparty/angle/src/libGLESv2/libGLESv2_mingw.def b/src/3rdparty/angle/src/libGLESv2/libGLESv2_mingw.def new file mode 100644 index 0000000000..dc5900854a --- /dev/null +++ b/src/3rdparty/angle/src/libGLESv2/libGLESv2_mingw.def @@ -0,0 +1,182 @@ +LIBRARY libGLESv2 +EXPORTS + glActiveTexture@4 @1 + glAttachShader@8 @2 + glBindAttribLocation@12 @3 + glBindBuffer@8 @4 + glBindFramebuffer@8 @5 + glBindRenderbuffer@8 @6 + glBindTexture@8 @7 + glBlendColor@16 @8 + glBlendEquation@4 @9 + glBlendEquationSeparate@8 @10 + glBlendFunc@8 @11 + glBlendFuncSeparate@16 @12 + glBufferData@16 @13 + glBufferSubData@16 @14 + glCheckFramebufferStatus@4 @15 + glClear@4 @16 + glClearColor@16 @17 + glClearDepthf@4 @18 + glClearStencil@4 @19 + glColorMask@16 @20 + glCompileShader@4 @21 + glCompressedTexImage2D@32 @22 + glCompressedTexSubImage2D@36 @23 + glCopyTexImage2D@32 @24 + glCopyTexSubImage2D@32 @25 + glCreateProgram@0 @26 + glCreateShader@4 @27 + glCullFace@4 @28 + glDeleteBuffers@8 @29 + glDeleteFramebuffers@8 @30 + glDeleteProgram@4 @32 + glDeleteRenderbuffers@8 @33 + glDeleteShader@4 @34 + glDeleteTextures@8 @31 + glDepthFunc@4 @36 + glDepthMask@4 @37 + glDepthRangef@8 @38 + glDetachShader@8 @35 + glDisable@4 @39 + glDisableVertexAttribArray@4 @40 + glDrawArrays@12 @41 + glDrawElements@16 @42 + glEnable@4 @43 + glEnableVertexAttribArray@4 @44 + glFinish@0 @45 + glFlush@0 @46 + glFramebufferRenderbuffer@16 @47 + glFramebufferTexture2D@20 @48 + glFrontFace@4 @49 + glGenBuffers@8 @50 + glGenFramebuffers@8 @52 + glGenRenderbuffers@8 @53 + glGenTextures@8 @54 + glGenerateMipmap@4 @51 + glGetActiveAttrib@28 @55 + glGetActiveUniform@28 @56 + glGetAttachedShaders@16 @57 + glGetAttribLocation@8 @58 + glGetBooleanv@8 @59 + glGetBufferParameteriv@12 @60 + glGetError@0 @61 + glGetFloatv@8 @62 + glGetFramebufferAttachmentParameteriv@16 @63 + glGetIntegerv@8 @64 + glGetProgramInfoLog@16 @66 + glGetProgramiv@12 @65 + glGetRenderbufferParameteriv@12 @67 + glGetShaderInfoLog@16 @69 + glGetShaderPrecisionFormat@16 @70 + glGetShaderSource@16 @71 + glGetShaderiv@12 @68 + glGetString@4 @72 + glGetTexParameterfv@12 @73 + glGetTexParameteriv@12 @74 + glGetUniformLocation@8 @77 + glGetUniformfv@12 @75 + glGetUniformiv@12 @76 + glGetVertexAttribPointerv@12 @80 + glGetVertexAttribfv@12 @78 + glGetVertexAttribiv@12 @79 + glHint@8 @81 + glIsBuffer@4 @82 + glIsEnabled@4 @83 + glIsFramebuffer@4 @84 + glIsProgram@4 @85 + glIsRenderbuffer@4 @86 + glIsShader@4 @87 + glIsTexture@4 @88 + glLineWidth@4 @89 + glLinkProgram@4 @90 + glPixelStorei@8 @91 + glPolygonOffset@8 @92 + glReadPixels@28 @93 + glReleaseShaderCompiler@0 @94 + glRenderbufferStorage@16 @95 + glSampleCoverage@8 @96 + glScissor@16 @97 + glShaderBinary@20 @98 + glShaderSource@16 @99 + glStencilFunc@12 @100 + glStencilFuncSeparate@16 @101 + glStencilMask@4 @102 + glStencilMaskSeparate@8 @103 + glStencilOp@12 @104 + glStencilOpSeparate@16 @105 + glTexImage2D@36 @106 + glTexParameterf@12 @107 + glTexParameterfv@12 @108 + glTexParameteri@12 @109 + glTexParameteriv@12 @110 + glTexSubImage2D@36 @111 + glUniform1f@8 @112 + glUniform1fv@12 @113 + glUniform1i@8 @114 + glUniform1iv@12 @115 + glUniform2f@12 @116 + glUniform2fv@12 @117 + glUniform2i@12 @118 + glUniform2iv@12 @119 + glUniform3f@16 @120 + glUniform3fv@12 @121 + glUniform3i@16 @122 + glUniform3iv@12 @123 + glUniform4f@20 @124 + glUniform4fv@12 @125 + glUniform4i@20 @126 + glUniform4iv@12 @127 + glUniformMatrix2fv@16 @128 + glUniformMatrix3fv@16 @129 + glUniformMatrix4fv@16 @130 + glUseProgram@4 @131 + glValidateProgram@4 @132 + glVertexAttrib1f@8 @133 + glVertexAttrib1fv@8 @134 + glVertexAttrib2f@12 @135 + glVertexAttrib2fv@8 @136 + glVertexAttrib3f@16 @137 + glVertexAttrib3fv@8 @138 + glVertexAttrib4f@20 @139 + glVertexAttrib4fv@8 @140 + glVertexAttribPointer@24 @141 + glViewport@16 @142 + + ; Extensions + glTexImage3DOES@40 @143 + glBlitFramebufferANGLE@40 @149 + glRenderbufferStorageMultisampleANGLE@20 @150 + glDeleteFencesNV@8 @151 + glFinishFenceNV@4 @152 + glGenFencesNV@8 @153 + glGetFenceivNV@12 @154 + glIsFenceNV@4 @155 + glSetFenceNV@8 @156 + glTestFenceNV@4 @157 + glGetTranslatedShaderSourceANGLE@16 @159 + glTexStorage2DEXT@20 @160 + glGetGraphicsResetStatusEXT@0 @161 + glReadnPixelsEXT@32 @162 + glGetnUniformfvEXT@16 @163 + glGetnUniformivEXT@16 @164 + glGenQueriesEXT@8 @165 + glDeleteQueriesEXT@8 @166 + glIsQueryEXT@4 @167 + glBeginQueryEXT@8 @168 + glEndQueryEXT@4 @169 + glGetQueryivEXT@12 @170 + glGetQueryObjectuivEXT@12 @171 + glVertexAttribDivisorANGLE@8 @172 + glDrawArraysInstancedANGLE@16 @173 + glDrawElementsInstancedANGLE@20 @174 + glProgramBinaryOES@16 @175 + glGetProgramBinaryOES@20 @176 + + ; EGL dependencies + glCreateContext @144 NONAME + glDestroyContext @145 NONAME + glMakeCurrent @146 NONAME + glGetCurrentContext @147 NONAME + glGetProcAddress@4 @148 NONAME + glBindTexImage@4 @158 NONAME diff --git a/src/3rdparty/angle/src/libGLESv2/libGLESv2d_mingw.def b/src/3rdparty/angle/src/libGLESv2/libGLESv2d_mingw.def new file mode 100644 index 0000000000..610e5e1173 --- /dev/null +++ b/src/3rdparty/angle/src/libGLESv2/libGLESv2d_mingw.def @@ -0,0 +1,182 @@ +LIBRARY libGLESv2d +EXPORTS + glActiveTexture@4 @1 + glAttachShader@8 @2 + glBindAttribLocation@12 @3 + glBindBuffer@8 @4 + glBindFramebuffer@8 @5 + glBindRenderbuffer@8 @6 + glBindTexture@8 @7 + glBlendColor@16 @8 + glBlendEquation@4 @9 + glBlendEquationSeparate@8 @10 + glBlendFunc@8 @11 + glBlendFuncSeparate@16 @12 + glBufferData@16 @13 + glBufferSubData@16 @14 + glCheckFramebufferStatus@4 @15 + glClear@4 @16 + glClearColor@16 @17 + glClearDepthf@4 @18 + glClearStencil@4 @19 + glColorMask@16 @20 + glCompileShader@4 @21 + glCompressedTexImage2D@32 @22 + glCompressedTexSubImage2D@36 @23 + glCopyTexImage2D@32 @24 + glCopyTexSubImage2D@32 @25 + glCreateProgram@0 @26 + glCreateShader@4 @27 + glCullFace@4 @28 + glDeleteBuffers@8 @29 + glDeleteFramebuffers@8 @30 + glDeleteProgram@4 @32 + glDeleteRenderbuffers@8 @33 + glDeleteShader@4 @34 + glDeleteTextures@8 @31 + glDepthFunc@4 @36 + glDepthMask@4 @37 + glDepthRangef@8 @38 + glDetachShader@8 @35 + glDisable@4 @39 + glDisableVertexAttribArray@4 @40 + glDrawArrays@12 @41 + glDrawElements@16 @42 + glEnable@4 @43 + glEnableVertexAttribArray@4 @44 + glFinish@0 @45 + glFlush@0 @46 + glFramebufferRenderbuffer@16 @47 + glFramebufferTexture2D@20 @48 + glFrontFace@4 @49 + glGenBuffers@8 @50 + glGenFramebuffers@8 @52 + glGenRenderbuffers@8 @53 + glGenTextures@8 @54 + glGenerateMipmap@4 @51 + glGetActiveAttrib@28 @55 + glGetActiveUniform@28 @56 + glGetAttachedShaders@16 @57 + glGetAttribLocation@8 @58 + glGetBooleanv@8 @59 + glGetBufferParameteriv@12 @60 + glGetError@0 @61 + glGetFloatv@8 @62 + glGetFramebufferAttachmentParameteriv@16 @63 + glGetIntegerv@8 @64 + glGetProgramInfoLog@16 @66 + glGetProgramiv@12 @65 + glGetRenderbufferParameteriv@12 @67 + glGetShaderInfoLog@16 @69 + glGetShaderPrecisionFormat@16 @70 + glGetShaderSource@16 @71 + glGetShaderiv@12 @68 + glGetString@4 @72 + glGetTexParameterfv@12 @73 + glGetTexParameteriv@12 @74 + glGetUniformLocation@8 @77 + glGetUniformfv@12 @75 + glGetUniformiv@12 @76 + glGetVertexAttribPointerv@12 @80 + glGetVertexAttribfv@12 @78 + glGetVertexAttribiv@12 @79 + glHint@8 @81 + glIsBuffer@4 @82 + glIsEnabled@4 @83 + glIsFramebuffer@4 @84 + glIsProgram@4 @85 + glIsRenderbuffer@4 @86 + glIsShader@4 @87 + glIsTexture@4 @88 + glLineWidth@4 @89 + glLinkProgram@4 @90 + glPixelStorei@8 @91 + glPolygonOffset@8 @92 + glReadPixels@28 @93 + glReleaseShaderCompiler@0 @94 + glRenderbufferStorage@16 @95 + glSampleCoverage@8 @96 + glScissor@16 @97 + glShaderBinary@20 @98 + glShaderSource@16 @99 + glStencilFunc@12 @100 + glStencilFuncSeparate@16 @101 + glStencilMask@4 @102 + glStencilMaskSeparate@8 @103 + glStencilOp@12 @104 + glStencilOpSeparate@16 @105 + glTexImage2D@36 @106 + glTexParameterf@12 @107 + glTexParameterfv@12 @108 + glTexParameteri@12 @109 + glTexParameteriv@12 @110 + glTexSubImage2D@36 @111 + glUniform1f@8 @112 + glUniform1fv@12 @113 + glUniform1i@8 @114 + glUniform1iv@12 @115 + glUniform2f@12 @116 + glUniform2fv@12 @117 + glUniform2i@12 @118 + glUniform2iv@12 @119 + glUniform3f@16 @120 + glUniform3fv@12 @121 + glUniform3i@16 @122 + glUniform3iv@12 @123 + glUniform4f@20 @124 + glUniform4fv@12 @125 + glUniform4i@20 @126 + glUniform4iv@12 @127 + glUniformMatrix2fv@16 @128 + glUniformMatrix3fv@16 @129 + glUniformMatrix4fv@16 @130 + glUseProgram@4 @131 + glValidateProgram@4 @132 + glVertexAttrib1f@8 @133 + glVertexAttrib1fv@8 @134 + glVertexAttrib2f@12 @135 + glVertexAttrib2fv@8 @136 + glVertexAttrib3f@16 @137 + glVertexAttrib3fv@8 @138 + glVertexAttrib4f@20 @139 + glVertexAttrib4fv@8 @140 + glVertexAttribPointer@24 @141 + glViewport@16 @142 + + ; Extensions + glTexImage3DOES@40 @143 + glBlitFramebufferANGLE@40 @149 + glRenderbufferStorageMultisampleANGLE@20 @150 + glDeleteFencesNV@8 @151 + glFinishFenceNV@4 @152 + glGenFencesNV@8 @153 + glGetFenceivNV@12 @154 + glIsFenceNV@4 @155 + glSetFenceNV@8 @156 + glTestFenceNV@4 @157 + glGetTranslatedShaderSourceANGLE@16 @159 + glTexStorage2DEXT@20 @160 + glGetGraphicsResetStatusEXT@0 @161 + glReadnPixelsEXT@32 @162 + glGetnUniformfvEXT@16 @163 + glGetnUniformivEXT@16 @164 + glGenQueriesEXT@8 @165 + glDeleteQueriesEXT@8 @166 + glIsQueryEXT@4 @167 + glBeginQueryEXT@8 @168 + glEndQueryEXT@4 @169 + glGetQueryivEXT@12 @170 + glGetQueryObjectuivEXT@12 @171 + glVertexAttribDivisorANGLE@8 @172 + glDrawArraysInstancedANGLE@16 @173 + glDrawElementsInstancedANGLE@20 @174 + glProgramBinaryOES@16 @175 + glGetProgramBinaryOES@20 @176 + + ; EGL dependencies + glCreateContext @144 NONAME + glDestroyContext @145 NONAME + glMakeCurrent @146 NONAME + glGetCurrentContext @147 NONAME + glGetProcAddress@4 @148 NONAME + glBindTexImage@4 @158 NONAME diff --git a/src/3rdparty/iaccessible2/iaccessible2.pri b/src/3rdparty/iaccessible2/iaccessible2.pri index 954f4c9e7c..b3cdfa9356 100644 --- a/src/3rdparty/iaccessible2/iaccessible2.pri +++ b/src/3rdparty/iaccessible2/iaccessible2.pri @@ -40,8 +40,12 @@ SOURCES += $${MIDL_GENERATED}/Accessible2_i.c \ $${MIDL_GENERATED}/AccessibleText_i.c \ $${MIDL_GENERATED}/AccessibleValue_i.c -SOURCES += $${MIDL_GENERATED}/IA2TypeLibrary_i.c \ - $${MIDL_GENERATED}/dlldata.c +SOURCES += $${MIDL_GENERATED}/IA2TypeLibrary_i.c + +# Do not add dlldata.c when building accessibility into a static library, as the COM entry points +# defined there can cause duplicate symbol errors when linking into a binary that also defines +# such entry points, e.g. anything linked against QtAxServer. +!static: SOURCES += $${MIDL_GENERATED}/dlldata.c HEADERS += $${MIDL_GENERATED}/Accessible2.h \ $${MIDL_GENERATED}/AccessibleAction.h \ diff --git a/src/angle/README.qt b/src/angle/README.qt index a8888604cc..e84d29f004 100644 --- a/src/angle/README.qt +++ b/src/angle/README.qt @@ -29,6 +29,11 @@ Since we build debug and release versions the .def files (libEGLd.def) must be created as copies with the LIBRARY name entry adapted. +MinGW-w64 32-bit requires function exports in the .def files +to be decorated. Modified versions of the .def files are created as +<library>_mingw.def. The decorated names of each function can be found +using the nm command to list the symbols in libEGL.o and libGLESv2.o. + Using a custom ANGLE ------------------------------------------------------------- Qt supports building a version of ANGLE other than the one that diff --git a/src/angle/patches/0007-ANGLE-Fix-typedefs-for-Win64.patch b/src/angle/patches/0007-ANGLE-Fix-typedefs-for-Win64.patch new file mode 100644 index 0000000000..ed744bbbd9 --- /dev/null +++ b/src/angle/patches/0007-ANGLE-Fix-typedefs-for-Win64.patch @@ -0,0 +1,38 @@ +From cf01d1953de652910734d0e01b032da99194590d Mon Sep 17 00:00:00 2001 +From: Jonathan Liu <net147@gmail.com> +Date: Tue, 18 Dec 2012 00:37:11 +1100 +Subject: [PATCH] ANGLE: Fix typedefs for Win64 + +The long int type is incorrect for Windows 64-bit as LLP64 is used +there. + +Change-Id: If4ccf49d6bb0cd7ba4ff2997cebfdbe5e7e9711c +--- + src/3rdparty/angle/include/KHR/khrplatform.h | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/src/3rdparty/angle/include/KHR/khrplatform.h b/src/3rdparty/angle/include/KHR/khrplatform.h +index 8ec0d19..56c676c 100644 +--- a/src/3rdparty/angle/include/KHR/khrplatform.h ++++ b/src/3rdparty/angle/include/KHR/khrplatform.h +@@ -221,10 +221,17 @@ typedef signed char khronos_int8_t; + typedef unsigned char khronos_uint8_t; + typedef signed short int khronos_int16_t; + typedef unsigned short int khronos_uint16_t; ++#ifdef _WIN64 ++typedef signed long long int khronos_intptr_t; ++typedef unsigned long long int khronos_uintptr_t; ++typedef signed long long int khronos_ssize_t; ++typedef unsigned long long int khronos_usize_t; ++#else + typedef signed long int khronos_intptr_t; + typedef unsigned long int khronos_uintptr_t; + typedef signed long int khronos_ssize_t; + typedef unsigned long int khronos_usize_t; ++#endif + + #if KHRONOS_SUPPORT_FLOAT + /* +-- +1.8.0.1 + diff --git a/src/angle/src/libEGL/libEGL.pro b/src/angle/src/libEGL/libEGL.pro index 524e3a9b59..cab94c4ea2 100644 --- a/src/angle/src/libEGL/libEGL.pro +++ b/src/angle/src/libEGL/libEGL.pro @@ -24,7 +24,10 @@ SOURCES += \ $$ANGLE_DIR/src/libEGL/main.cpp \ $$ANGLE_DIR/src/libEGL/Surface.cpp -msvc:DEF_FILE = $$ANGLE_DIR/src/libEGL/$${TARGET}.def +!static { + DEF_FILE = $$ANGLE_DIR/src/libEGL/$${TARGET}.def + win32-g++*: DEF_FILE = $$ANGLE_DIR/src/libEGL/$${TARGET}_mingw.def +} load(qt_installs) diff --git a/src/angle/src/libGLESv2/libGLESv2.pro b/src/angle/src/libGLESv2/libGLESv2.pro index f4cbfd0494..47c765b7ce 100644 --- a/src/angle/src/libGLESv2/libGLESv2.pro +++ b/src/angle/src/libGLESv2/libGLESv2.pro @@ -1,6 +1,5 @@ TEMPLATE = lib TARGET = $$qtLibraryTarget(libGLESv2) -DEPENDPATH += . shaders CONFIG += simd include(../common/common.pri) @@ -67,7 +66,10 @@ SOURCES += \ SSE2_SOURCES += $$ANGLE_DIR/src/libGLESv2/TextureSSE2.cpp -msvc:DEF_FILE = $$ANGLE_DIR/src/libGLESv2/$${TARGET}.def +!static { + DEF_FILE = $$ANGLE_DIR/src/libGLESv2/$${TARGET}.def + win32-g++*: DEF_FILE = $$ANGLE_DIR/src/libGLESv2/$${TARGET}_mingw.def +} float_converter.target = float_converter float_converter.commands = python $$ANGLE_DIR/src/libGLESv2/Float16ToFloat32.py \ diff --git a/src/corelib/Qt5CTestMacros.cmake b/src/corelib/Qt5CTestMacros.cmake index fc39c708f3..c5d10c9b5b 100644 --- a/src/corelib/Qt5CTestMacros.cmake +++ b/src/corelib/Qt5CTestMacros.cmake @@ -1,4 +1,7 @@ - +# +# W A R N I N G +# ------------- +# # This file is not part of the Qt API. It exists purely as an # implementation detail. This file, and its contents may change from version to # version without notice, or even be removed. diff --git a/src/corelib/doc/snippets/code/src_corelib_io_qsettings.cpp b/src/corelib/doc/snippets/code/src_corelib_io_qsettings.cpp index ab54033ef3..d3dde5be66 100644 --- a/src/corelib/doc/snippets/code/src_corelib_io_qsettings.cpp +++ b/src/corelib/doc/snippets/code/src_corelib_io_qsettings.cpp @@ -82,7 +82,7 @@ settings.value("HKEY_CURRENT_USER\\MySoft\\Star Runner\\Galaxy\\Default"); // re //! [7] -#ifdef Q_WS_MAC +#ifdef Q_OS_MAC QSettings settings("grenoullelogique.fr", "Squash"); #else QSettings settings("Grenoulle Logique", "Squash"); diff --git a/src/corelib/doc/snippets/code/src_corelib_tools_qbytearray.cpp b/src/corelib/doc/snippets/code/src_corelib_tools_qbytearray.cpp index 71c6fbd80f..eef026af75 100644 --- a/src/corelib/doc/snippets/code/src_corelib_tools_qbytearray.cpp +++ b/src/corelib/doc/snippets/code/src_corelib_tools_qbytearray.cpp @@ -251,7 +251,7 @@ ba.lastIndexOf("X"); // returns -1 //! [25] -QByteArray url("ftp://ftp.qt.nokia.com/"); +QByteArray url("ftp://ftp.qt-project.org/"); if (url.startsWith("ftp:")) ... //! [25] diff --git a/src/corelib/doc/src/statemachine.qdoc b/src/corelib/doc/src/statemachine.qdoc index b241b4aff4..e23b911f85 100644 --- a/src/corelib/doc/src/statemachine.qdoc +++ b/src/corelib/doc/src/statemachine.qdoc @@ -45,7 +45,7 @@ The State Machine framework provides classes for creating and executing state graphs. The concepts and notation are based on those from Harel's - \l{Statecharts: A visual formalism for complex systems}{Statecharts}, which + \l{http://www.wisdom.weizmann.ac.il/~dharel/SCANNED.PAPERS/Statecharts.pdf}{Statecharts: A visual formalism for complex systems}, which is also the basis of UML state diagrams. The semantics of state machine execution are based on \l{State Chart XML: State Machine Notation for Control Abstraction}{State Chart XML (SCXML)}. diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc index 363c5206b0..f09e3ce484 100644 --- a/src/corelib/global/qnamespace.qdoc +++ b/src/corelib/global/qnamespace.qdoc @@ -406,7 +406,7 @@ \value BevelJoin The triangular notch between the two lines is filled. \value RoundJoin A circular arc between the two lines is filled. \value SvgMiterJoin A miter join corresponding to the definition of - a miter join in the \l{SVG 1.2 Tiny} specification. + a miter join in the \l{http://www.w3.org/TR/SVGMobile12/}{SVG 1.2 Tiny} specification. \omitvalue MPenJoinStyle \sa QPen diff --git a/src/corelib/io/qabstractfileengine.cpp b/src/corelib/io/qabstractfileengine.cpp index 1841619400..d7cf7e3f15 100644 --- a/src/corelib/io/qabstractfileengine.cpp +++ b/src/corelib/io/qabstractfileengine.cpp @@ -155,7 +155,7 @@ QAbstractFileEngineHandler::~QAbstractFileEngineHandler() } /* - \ìnternal + \internal Handles calls to custom file engine handlers. */ diff --git a/src/corelib/io/qurl.cpp b/src/corelib/io/qurl.cpp index a7a722bc46..d231bdda61 100644 --- a/src/corelib/io/qurl.cpp +++ b/src/corelib/io/qurl.cpp @@ -3812,7 +3812,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \list \li qt.nokia.com becomes http://qt.nokia.com - \li ftp.qt.nokia.com becomes ftp://ftp.qt.nokia.com + \li ftp.qt-project.org becomes ftp://ftp.qt-project.org \li hostname becomes http://hostname \li /home/user/test.html becomes file:///home/user/test.html \endlist diff --git a/src/corelib/itemmodels/qabstractitemmodel.cpp b/src/corelib/itemmodels/qabstractitemmodel.cpp index e2361e11f9..db1db9aaed 100644 --- a/src/corelib/itemmodels/qabstractitemmodel.cpp +++ b/src/corelib/itemmodels/qabstractitemmodel.cpp @@ -1437,7 +1437,7 @@ QAbstractItemModel::~QAbstractItemModel() For example: - \snippet itemviews/simpledommodel/dommodel.cpp 2 + \snippet ../widgets/itemviews/simpledommodel/dommodel.cpp 2 \note When implementing a table based model, columnCount() should return 0 when the parent is valid. diff --git a/src/corelib/itemmodels/qsortfilterproxymodel.cpp b/src/corelib/itemmodels/qsortfilterproxymodel.cpp index 6ab32a9366..857054558f 100644 --- a/src/corelib/itemmodels/qsortfilterproxymodel.cpp +++ b/src/corelib/itemmodels/qsortfilterproxymodel.cpp @@ -1616,7 +1616,7 @@ void QSortFilterProxyModelPrivate::_q_sourceColumnsMoved( QSortFilterProxyModel and reimplementing lessThan(), which is used to compare items. For example: - \snippet itemviews/customsortfiltermodel/mysortfilterproxymodel.cpp 5 + \snippet ../widgets/itemviews/customsortfiltermodel/mysortfilterproxymodel.cpp 5 (This code snippet comes from the \l{itemviews/customsortfiltermodel}{Custom Sort/Filter Model} @@ -1659,7 +1659,7 @@ void QSortFilterProxyModelPrivate::_q_sourceColumnsMoved( the \l{QSortFilterProxyModel::filterKeyColumn}{filterKeyColumn} property and performs filtering on columns 0, 1, and 2: - \snippet itemviews/customsortfiltermodel/mysortfilterproxymodel.cpp 3 + \snippet ../widgets/itemviews/customsortfiltermodel/mysortfilterproxymodel.cpp 3 (This code snippet comes from the \l{itemviews/customsortfiltermodel}{Custom Sort/Filter Model} diff --git a/src/corelib/json/qjsonobject.cpp b/src/corelib/json/qjsonobject.cpp index e595753fec..1bdd872e78 100644 --- a/src/corelib/json/qjsonobject.cpp +++ b/src/corelib/json/qjsonobject.cpp @@ -390,13 +390,14 @@ QJsonValue QJsonObject::take(const QString &key) if (!keyExists) return QJsonValue(QJsonValue::Undefined); - QJsonPrivate::Entry *e = o->entryAt(index); + QJsonValue v(d, o, o->entryAt(index)->value); + detach(); o->removeItems(index, 1); ++d->compactionCounter; if (d->compactionCounter > 32u && d->compactionCounter >= unsigned(o->length) / 2u) compact(); - return QJsonValue(d, o, e->value); + return v; } /*! diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp index 9d0854f3a9..9091b5579e 100644 --- a/src/corelib/kernel/qobject.cpp +++ b/src/corelib/kernel/qobject.cpp @@ -1945,7 +1945,7 @@ void QObject::deleteLater() is available. Example: - \snippet mainwindows/sdi/mainwindow.cpp implicit tr context + \snippet ../widgets/mainwindows/sdi/mainwindow.cpp implicit tr context \dots If the same \a sourceText is used in different roles within the @@ -3864,9 +3864,9 @@ QDebug operator<<(QDebug dbg, const QObject *o) { Example: - \snippet tools/plugandpaintplugins/basictools/basictoolsplugin.h 1 + \snippet ../widgets/tools/plugandpaintplugins/basictools/basictoolsplugin.h 1 \dots - \snippet tools/plugandpaintplugins/basictools/basictoolsplugin.h 3 + \snippet ../widgets/tools/plugandpaintplugins/basictools/basictoolsplugin.h 3 See the \l{tools/plugandpaintplugins/basictools}{Plug & Paint Basic Tools} example for details. @@ -4293,6 +4293,16 @@ bool QObject::disconnect(const QMetaObject::Connection &connection) if (c->next) c->next->prev = c->prev; c->receiver = 0; + + // destroy the QSlotObject, if possible + if (c->isSlotObject) { + c->slotObj->destroyIfLastRef(); + c->isSlotObject = false; + } + + const_cast<QMetaObject::Connection &>(connection).d_ptr = 0; + c->deref(); // has been removed from the QMetaObject::Connection object + // disconnectNotify() not called (the signal index is unknown). return true; diff --git a/src/corelib/kernel/qtimer.cpp b/src/corelib/kernel/qtimer.cpp index 9dea666363..9126d7ea17 100644 --- a/src/corelib/kernel/qtimer.cpp +++ b/src/corelib/kernel/qtimer.cpp @@ -62,9 +62,9 @@ QT_BEGIN_NAMESPACE Example for a one second (1000 millisecond) timer (from the \l{widgets/analogclock}{Analog Clock} example): - \snippet widgets/analogclock/analogclock.cpp 4 - \snippet widgets/analogclock/analogclock.cpp 5 - \snippet widgets/analogclock/analogclock.cpp 6 + \snippet ../widgets/widgets/analogclock/analogclock.cpp 4 + \snippet ../widgets/widgets/analogclock/analogclock.cpp 5 + \snippet ../widgets/widgets/analogclock/analogclock.cpp 6 From then on, the \c update() slot is called every second. diff --git a/src/corelib/mimetypes/qmimedatabase.cpp b/src/corelib/mimetypes/qmimedatabase.cpp index 5acc290475..f3705476c3 100644 --- a/src/corelib/mimetypes/qmimedatabase.cpp +++ b/src/corelib/mimetypes/qmimedatabase.cpp @@ -604,18 +604,4 @@ QList<QMimeType> QMimeDatabase::allMimeTypes() const \value MatchContent The file content is used to look for a match */ -/*! - \fn QMimeType QMimeDatabase::mimeTypeForNameAndData(const QString &fileName, QIODevice *device) const - \obsolete - - This function is replaced by \l mimeTypeForFileNameAndData() -*/ - -/*! - \fn QMimeType QMimeDatabase::mimeTypeForNameAndData(const QString &fileName, const QByteArray &data) const - \obsolete - - This function is replaced by \l mimeTypeForFileNameAndData() -*/ - QT_END_NAMESPACE diff --git a/src/corelib/tools/qlocale.h b/src/corelib/tools/qlocale.h index 6b6beeff0a..c9cb31d03b 100644 --- a/src/corelib/tools/qlocale.h +++ b/src/corelib/tools/qlocale.h @@ -67,6 +67,7 @@ class Q_CORE_EXPORT QLocale Q_GADGET Q_ENUMS(Language) Q_ENUMS(Country) + Q_ENUMS(MeasurementSystem) friend class QString; friend class QByteArray; friend class QIntValidator; diff --git a/src/corelib/tools/qregexp.cpp b/src/corelib/tools/qregexp.cpp index 4d73fc7478..e441d5320b 100644 --- a/src/corelib/tools/qregexp.cpp +++ b/src/corelib/tools/qregexp.cpp @@ -3920,7 +3920,7 @@ static void invalidateEngine(QRegExpPrivate *priv) \value Wildcard This provides a simple pattern matching syntax similar to that used by shells (command interpreters) for "file - globbing". See \l{Wildcard Matching}. + globbing". See \l{QRegExp wildcard matching}. \value WildcardUnix This is similar to Wildcard but with the behavior of a Unix shell. The wildcard characters can be escaped @@ -4150,7 +4150,7 @@ QRegExp::PatternSyntax QRegExp::patternSyntax() const QRegExp::RegExp. Setting \a syntax to QRegExp::Wildcard enables simple shell-like - \l{wildcard matching}. For example, \b{r*.txt} matches the + \l{QRegExp wildcard matching}. For example, \b{r*.txt} matches the string \c{readme.txt} in wildcard mode, but does not match \c{readme}. diff --git a/src/dbus/doc/qtdbus.qdocconf b/src/dbus/doc/qtdbus.qdocconf index 264bd12ff3..8915e1ee2e 100644 --- a/src/dbus/doc/qtdbus.qdocconf +++ b/src/dbus/doc/qtdbus.qdocconf @@ -14,9 +14,12 @@ exampledirs += ../../../examples/dbus \ headerdirs += .. imagedirs += images -sourcedirs += .. +sourcedirs += .. \ + ../../../examples/dbus/doc/src excludedirs += ../../../examples/widgets/doc +examplesinstallpath = dbus + depends += qtcore # The following parameters are for creating a qhp file, the qhelpgenerator diff --git a/src/gui/accessible/qaccessibleobject.cpp b/src/gui/accessible/qaccessibleobject.cpp index bc108980cf..2bd5a00afb 100644 --- a/src/gui/accessible/qaccessibleobject.cpp +++ b/src/gui/accessible/qaccessibleobject.cpp @@ -165,6 +165,8 @@ QAccessibleInterface *QAccessibleObject::childAt(int x, int y) const Q_ASSERT(childIface); if (childIface->rect().contains(x,y)) { return childIface; + } else { + delete childIface; } } return 0; diff --git a/src/gui/doc/qtgui.qdocconf b/src/gui/doc/qtgui.qdocconf index 933d990c77..f58b4faf9f 100644 --- a/src/gui/doc/qtgui.qdocconf +++ b/src/gui/doc/qtgui.qdocconf @@ -40,9 +40,10 @@ depends += \ headerdirs += .. sourcedirs += .. \ - ../../../examples/gui/doc + ../../../examples/gui/doc/src exampledirs += ../../../examples/gui \ snippets -imagedirs += images +imagedirs += images \ + ../../../examples/gui/doc/images diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index 7abda84bfa..72e95c996c 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -60,6 +60,7 @@ #include <QtCore/private/qthread_p.h> #include <QtCore/qdir.h> #include <QtDebug> +#include "qaccessible.h" #include <qpalette.h> #include <qscreen.h> #include "qsessionmanager.h" @@ -1184,6 +1185,9 @@ QPlatformNativeInterface *QGuiApplication::platformNativeInterface() */ int QGuiApplication::exec() { +#ifndef QT_NO_ACCESSIBILITY + QAccessible::setRootObject(qApp); +#endif return QCoreApplication::exec(); } diff --git a/src/gui/kernel/qkeysequence.cpp b/src/gui/kernel/qkeysequence.cpp index 66baa3db95..83e7b30a52 100644 --- a/src/gui/kernel/qkeysequence.cpp +++ b/src/gui/kernel/qkeysequence.cpp @@ -349,7 +349,7 @@ void Q_GUI_EXPORT qt_set_sequence_auto_mnemonic(bool b) { qt_sequence_no_mnemoni \section1 GNU Emacs Style Key Sequences - Key sequences similar to those used in \l{GNU Emacs}, allowing up to four + Key sequences similar to those used in \l{http://www.gnu.org/software/emacs/}{GNU Emacs}, allowing up to four key codes, can be created by using the multiple argument constructor, or by passing a human-readable string of comma-separated key sequences. diff --git a/src/gui/kernel/qplatformnativeinterface.cpp b/src/gui/kernel/qplatformnativeinterface.cpp index 925b2ad3de..cf487b2235 100644 --- a/src/gui/kernel/qplatformnativeinterface.cpp +++ b/src/gui/kernel/qplatformnativeinterface.cpp @@ -100,6 +100,12 @@ QPlatformNativeInterface::NativeResourceForContextFunction QPlatformNativeInterf return 0; } +QPlatformNativeInterface::NativeResourceForScreenFunction QPlatformNativeInterface::nativeResourceFunctionForScreen(const QByteArray &resource) +{ + Q_UNUSED(resource); + return 0; +} + QPlatformNativeInterface::NativeResourceForWindowFunction QPlatformNativeInterface::nativeResourceFunctionForWindow(const QByteArray &resource) { Q_UNUSED(resource); diff --git a/src/gui/kernel/qplatformnativeinterface.h b/src/gui/kernel/qplatformnativeinterface.h index cbf997bec4..8dd661f67e 100644 --- a/src/gui/kernel/qplatformnativeinterface.h +++ b/src/gui/kernel/qplatformnativeinterface.h @@ -78,10 +78,12 @@ public: typedef void * (*NativeResourceForIntegrationFunction)(); typedef void * (*NativeResourceForContextFunction)(QOpenGLContext *context); + typedef void * (*NativeResourceForScreenFunction)(QScreen *screen); typedef void * (*NativeResourceForWindowFunction)(QWindow *window); typedef void * (*NativeResourceForBackingStoreFunction)(QBackingStore *backingStore); virtual NativeResourceForIntegrationFunction nativeResourceFunctionForIntegration(const QByteArray &resource); virtual NativeResourceForContextFunction nativeResourceFunctionForContext(const QByteArray &resource); + virtual NativeResourceForScreenFunction nativeResourceFunctionForScreen(const QByteArray &resource); virtual NativeResourceForWindowFunction nativeResourceFunctionForWindow(const QByteArray &resource); virtual NativeResourceForBackingStoreFunction nativeResourceFunctionForBackingStore(const QByteArray &resource); diff --git a/src/gui/kernel/qplatformwindow.cpp b/src/gui/kernel/qplatformwindow.cpp index 88dccdb6ce..82547b04ec 100644 --- a/src/gui/kernel/qplatformwindow.cpp +++ b/src/gui/kernel/qplatformwindow.cpp @@ -247,7 +247,12 @@ void QPlatformWindow::setParent(const QPlatformWindow *parent) } /*! - Reimplement to set the window title to \a title + Reimplement to set the window title to \a title. + + The implementation might want to append the application display name to + the window title, like Windows and Linux do. + + \sa QGuiApplication::applicationDisplayName() */ void QPlatformWindow::setWindowTitle(const QString &title) { Q_UNUSED(title); } diff --git a/src/gui/kernel/qshortcutmap.cpp b/src/gui/kernel/qshortcutmap.cpp index 43f37a900f..839cbf37e7 100644 --- a/src/gui/kernel/qshortcutmap.cpp +++ b/src/gui/kernel/qshortcutmap.cpp @@ -679,7 +679,7 @@ void QShortcutMap::dispatchEvent(QKeyEvent *e) #if defined(DEBUG_QSHORTCUTMAP) qDebug().nospace() << "QShortcutMap::dispatchEvent(): Sending QShortcutEvent(\"" - << (QString)next->keyseq << "\", " << next->id << ", " + << next->keyseq.toString() << "\", " << next->id << ", " << (bool)(enabledShortcuts>1) << ") to object(" << next->owner << ')'; #endif QShortcutEvent se(next->keyseq, next->id, enabledShortcuts>1); diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp index 68687577b3..b6d592e050 100644 --- a/src/gui/kernel/qwindow.cpp +++ b/src/gui/kernel/qwindow.cpp @@ -654,9 +654,11 @@ void QWindow::lower() void QWindow::setOpacity(qreal level) { Q_D(QWindow); - if (d->platformWindow) { + if (level == d->opacity) // #fixme: Add property for 5.1 + return; + d->opacity = level; + if (d->platformWindow) d->platformWindow->setOpacity(level); - } } /*! diff --git a/src/gui/kernel/qwindow_p.h b/src/gui/kernel/qwindow_p.h index 93179d99b6..305888d02c 100644 --- a/src/gui/kernel/qwindow_p.h +++ b/src/gui/kernel/qwindow_p.h @@ -89,6 +89,7 @@ public: , receivedExpose(false) , positionPolicy(WindowFrameExclusive) , contentOrientation(Qt::PrimaryOrientation) + , opacity(qreal(1.0)) , minimumSize(0, 0) , maximumSize(QWINDOWSIZE_MAX, QWINDOWSIZE_MAX) , modality(Qt::NonModal) @@ -135,6 +136,7 @@ public: bool receivedExpose; PositionPolicy positionPolicy; Qt::ScreenOrientation contentOrientation; + qreal opacity; QSize minimumSize; QSize maximumSize; diff --git a/src/gui/painting/qdrawhelper_ssse3.cpp b/src/gui/painting/qdrawhelper_ssse3.cpp index 09e0516dcb..9f80c70fcc 100644 --- a/src/gui/painting/qdrawhelper_ssse3.cpp +++ b/src/gui/painting/qdrawhelper_ssse3.cpp @@ -60,7 +60,7 @@ inline static void blend_pixel(quint32 &dst, const quint32 src) shift (4, 8, 12). Checking the alignment inside the loop is unfortunatelly way too slow. */ #define BLENDING_LOOP(palignrOffset, length)\ - for (; x < length-3; x += 4) { \ + for (; x-minusOffsetToAlignSrcOn16Bytes < length-7; x += 4) { \ const __m128i srcVectorLastLoaded = _mm_load_si128((__m128i *)&src[x - minusOffsetToAlignSrcOn16Bytes + 4]);\ const __m128i srcVector = _mm_alignr_epi8(srcVectorLastLoaded, srcVectorPrevLoaded, palignrOffset); \ const __m128i srcVectorAlpha = _mm_and_si128(srcVector, alphaMask); \ diff --git a/src/gui/util/qdesktopservices.cpp b/src/gui/util/qdesktopservices.cpp index ca284eecd5..94a3343164 100644 --- a/src/gui/util/qdesktopservices.cpp +++ b/src/gui/util/qdesktopservices.cpp @@ -250,6 +250,8 @@ void QDesktopServices::unsetUrlHandler(const QString &scheme) /*! \enum QDesktopServices::StandardLocation \since 4.4 + \obsolete + Use QStandardPaths::StandardLocation This enum describes the different locations that can be queried by QDesktopServices::storageLocation and QDesktopServices::displayName. diff --git a/src/network/doc/snippets/code/src_network_access_qftp.cpp b/src/network/doc/snippets/code/src_network_access_qftp.cpp index 77f5ee2df2..4fa81efd84 100644 --- a/src/network/doc/snippets/code/src_network_access_qftp.cpp +++ b/src/network/doc/snippets/code/src_network_access_qftp.cpp @@ -40,13 +40,13 @@ //! [0] QFtp *ftp = new QFtp(parent); -ftp->connectToHost("ftp.qt.nokia.com"); +ftp->connectToHost("ftp.qt-project.org"); ftp->login(); //! [0] //! [1] -ftp->connectToHost("ftp.qt.nokia.com"); // id == 1 +ftp->connectToHost("ftp.qt-project.org"); // id == 1 ftp->login(); // id == 2 ftp->cd("qt"); // id == 3 ftp->get("INSTALL"); // id == 4 diff --git a/src/network/doc/src/ssl.qdoc b/src/network/doc/src/ssl.qdoc index 0797e3f91b..751c7cd668 100644 --- a/src/network/doc/src/ssl.qdoc +++ b/src/network/doc/src/ssl.qdoc @@ -33,8 +33,8 @@ \keyword SSL The classes below provide support for secure network communication using - the Secure Sockets Layer (SSL) protocol, using the \l{www.openssl.org}{OpenSSL Toolkit} to - perform encryption and protocol handling. + the Secure Sockets Layer (SSL) protocol, using the OpenSSL Toolkit (\l{http://www.openssl.org/}) + to perform encryption and protocol handling. See the \l{General Qt Requirements} page for information about the versions of OpenSSL that are known to work with Qt. diff --git a/src/network/socket/qabstractsocket.cpp b/src/network/socket/qabstractsocket.cpp index 5ff7da9e9d..124f15e586 100644 --- a/src/network/socket/qabstractsocket.cpp +++ b/src/network/socket/qabstractsocket.cpp @@ -195,7 +195,7 @@ \fn void QAbstractSocket::disconnected() This signal is emitted when the socket has been disconnected. - + \warning If you need to delete the sender() of this signal in a slot connected to it, use the \l{QObject::deleteLater()}{deleteLater()} function. @@ -639,7 +639,7 @@ bool QAbstractSocketPrivate::initSocketLayer(QAbstractSocket::NetworkLayerProtoc socketEngine->errorString().toLatin1().constData()); #endif socketError = socketEngine->error(); - q->setErrorString(socketEngine->errorString()); + q->setErrorString(socketEngine->errorString()); return false; } diff --git a/src/network/socket/qlocalsocket_win.cpp b/src/network/socket/qlocalsocket_win.cpp index cb264a4c83..0138a96261 100644 --- a/src/network/socket/qlocalsocket_win.cpp +++ b/src/network/socket/qlocalsocket_win.cpp @@ -67,7 +67,7 @@ void QLocalSocketPrivate::_q_winError(ulong windowsError, const QString &functio Q_Q(QLocalSocket); QLocalSocket::LocalSocketState currentState = state; - // If the connectToServer fails due to WaitNamedPipe() time-out, assume ConnectionError + // If the connectToServer fails due to WaitNamedPipe() time-out, assume ConnectionError if (state == QLocalSocket::ConnectingState && windowsError == ERROR_SEM_TIMEOUT) windowsError = ERROR_NO_DATA; diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp index 69f4871c6b..9489762516 100644 --- a/src/opengl/qgl.cpp +++ b/src/opengl/qgl.cpp @@ -1477,6 +1477,11 @@ bool operator!=(const QGLFormat& a, const QGLFormat& b) } struct QGLContextGroupList { + QGLContextGroupList() + : m_mutex(QMutex::Recursive) + { + } + void append(QGLContextGroup *group) { QMutexLocker locker(&m_mutex); m_list.append(group); diff --git a/src/opengl/qgl_qpa.cpp b/src/opengl/qgl_qpa.cpp index 0e8b8abb4f..88736ecdb7 100644 --- a/src/opengl/qgl_qpa.cpp +++ b/src/opengl/qgl_qpa.cpp @@ -421,7 +421,8 @@ QOpenGLContext *QGLContext::contextHandle() const } /*! - Returns a OpenGL context for the window context specified by \a windowContext + Returns a OpenGL context for the window context specified by the \a context + parameter. */ QGLContext *QGLContext::fromOpenGLContext(QOpenGLContext *context) { diff --git a/src/platformsupport/eventdispatchers/qeventdispatcher_glib.cpp b/src/platformsupport/eventdispatchers/qeventdispatcher_glib.cpp index b8f4475d9e..3154e65ec8 100644 --- a/src/platformsupport/eventdispatchers/qeventdispatcher_glib.cpp +++ b/src/platformsupport/eventdispatchers/qeventdispatcher_glib.cpp @@ -119,8 +119,6 @@ QPAEventDispatcherGlib::~QPAEventDispatcherGlib() bool QPAEventDispatcherGlib::processEvents(QEventLoop::ProcessEventsFlags flags) { - Q_D(QPAEventDispatcherGlib); - m_flags = flags; return QEventDispatcherGlib::processEvents(m_flags); } diff --git a/src/platformsupport/linuxaccessibility/atspiadaptor.cpp b/src/platformsupport/linuxaccessibility/atspiadaptor.cpp index 1eda1dfab9..0db8e31537 100644 --- a/src/platformsupport/linuxaccessibility/atspiadaptor.cpp +++ b/src/platformsupport/linuxaccessibility/atspiadaptor.cpp @@ -99,6 +99,7 @@ AtSpiAdaptor::AtSpiAdaptor(DBusConnection *connection, QObject *parent) , sendObject_row_inserted(0) , sendObject_row_reordered(0) , sendObject_selection_changed(0) + , sendObject_state_changed(0) , sendObject_text_attributes_changed(0) , sendObject_text_bounds_changed(0) , sendObject_text_caret_moved(0) @@ -903,6 +904,14 @@ QAIPointer AtSpiAdaptor::interfaceFromPath(const QString& dbusPath) const return QAIPointer(); } +void AtSpiAdaptor::notifyStateChange(const QAIPointer &interface, const QString &state, int value) +{ + QString path = pathForInterface(interface); + QVariantList stateArgs = packDBusSignalArguments(state, value, 0, variantForPath(path)); + sendDBusSignal(path, QLatin1String(ATSPI_DBUS_INTERFACE_EVENT_OBJECT), + QLatin1String("StateChanged"), stateArgs); +} + /*! This function gets called when Qt notifies about accessibility updates. @@ -919,19 +928,13 @@ void AtSpiAdaptor::notify(QAccessibleEvent *event) break; case QAccessible::ObjectShow: { if (sendObject || sendObject_state_changed) { - QString path = pathForInterface(QAIPointer(event->accessibleInterface())); - QVariantList stateArgs = packDBusSignalArguments(QLatin1String("showing"), 1, 0, variantForPath(path)); - sendDBusSignal(path, QLatin1String(ATSPI_DBUS_INTERFACE_EVENT_OBJECT), - QLatin1String("StateChanged"), stateArgs); + notifyStateChange(QAIPointer(event->accessibleInterface()), QLatin1String("showing"), 1); } break; } case QAccessible::ObjectHide: { if (sendObject || sendObject_state_changed) { - QString path = pathForInterface(QAIPointer(event->accessibleInterface())); - QVariantList stateArgs = packDBusSignalArguments(QLatin1String("showing"), 0, 0, variantForPath(path)); - sendDBusSignal(path, QLatin1String(ATSPI_DBUS_INTERFACE_EVENT_OBJECT), - QLatin1String("StateChanged"), stateArgs); + notifyStateChange(QAIPointer(event->accessibleInterface()), QLatin1String("showing"), 0); } break; } @@ -968,7 +971,10 @@ void AtSpiAdaptor::notify(QAccessibleEvent *event) case QAccessible::TextUpdated: { if (sendObject || sendObject_text_changed) { QAIPointer iface = QAIPointer(event->accessibleInterface()); - Q_ASSERT(iface->textInterface()); + if (!iface || !iface->textInterface()) { + qAtspiDebug() << "Received text event for invalid interface."; + return; + } QString path = pathForInterface(iface); int changePosition = 0; @@ -1023,8 +1029,8 @@ void AtSpiAdaptor::notify(QAccessibleEvent *event) case QAccessible::TextCaretMoved: { if (sendObject || sendObject_text_caret_moved) { QAIPointer iface = QAIPointer(event->accessibleInterface()); - if (!iface->textInterface()) { - qWarning() << "Sending TextCaretMoved from object that does not implement text interface: " << iface << iface->object(); + if (!iface || !iface->textInterface()) { + qWarning() << "Sending TextCaretMoved from object that does not implement text interface: " << iface; return; } @@ -1051,7 +1057,11 @@ void AtSpiAdaptor::notify(QAccessibleEvent *event) case QAccessible::ValueChanged: { if (sendObject || sendObject_value_changed || sendObject_property_change_accessible_value) { QAIPointer iface = QAIPointer(event->accessibleInterface()); - Q_ASSERT(iface->valueInterface()); + if (!iface || !iface->valueInterface()) { + qWarning() << "ValueChanged event from invalid accessible: " << iface; + return; + } + QString path = pathForInterface(iface); QVariantList args = packDBusSignalArguments(QLatin1String("accessible-value"), 0, 0, variantForPath(path)); sendDBusSignal(path, QLatin1String(ATSPI_DBUS_INTERFACE_EVENT_OBJECT), @@ -1061,6 +1071,10 @@ void AtSpiAdaptor::notify(QAccessibleEvent *event) } case QAccessible::Selection: { QAIPointer iface = QAIPointer(event->accessibleInterface()); + if (!iface) { + qWarning() << "Selection event from invalid accessible."; + return; + } QString path = pathForInterface(iface); int selected = iface->state().selected ? 1 : 0; QVariantList stateArgs = packDBusSignalArguments(QLatin1String("selected"), selected, 0, variantForPath(path)); @@ -1074,14 +1088,15 @@ void AtSpiAdaptor::notify(QAccessibleEvent *event) QAccessible::State stateChange = static_cast<QAccessibleStateChangeEvent*>(event)->changedStates(); if (stateChange.checked) { QAIPointer iface = QAIPointer(event->accessibleInterface()); + if (!iface) { + qWarning() << "StateChanged event from invalid accessible."; + return; + } int checked = iface->state().checked; - QString path = pathForInterface(iface); - QVariantList args = packDBusSignalArguments(QLatin1String("checked"), checked, 0, variantForPath(path)); - sendDBusSignal(path, QLatin1String(ATSPI_DBUS_INTERFACE_EVENT_OBJECT), - QLatin1String("StateChanged"), args); + notifyStateChange(iface, QLatin1String("checked"), checked); } else if (stateChange.active) { QAIPointer iface = QAIPointer(event->accessibleInterface()); - if (!(iface->role() == QAccessible::Window && (sendWindow || sendWindow_activate))) + if (!iface || !(iface->role() == QAccessible::Window && (sendWindow || sendWindow_activate))) return; QString windowTitle = iface->text(QAccessible::Name); QDBusVariant data; @@ -1092,9 +1107,15 @@ void AtSpiAdaptor::notify(QAccessibleEvent *event) QString path = pathForInterface(iface); sendDBusSignal(path, QLatin1String(ATSPI_DBUS_INTERFACE_EVENT_WINDOW), status, args); - QVariantList stateArgs = packDBusSignalArguments(QLatin1String("active"), iface->state().active ? 1 : 0, 0, variantForPath(path)); - sendDBusSignal(path, QLatin1String(ATSPI_DBUS_INTERFACE_EVENT_OBJECT), - QLatin1String("StateChanged"), stateArgs); + int isActive = iface->state().active; + notifyStateChange(iface, QLatin1String("active"), isActive); + } else if (stateChange.disabled) { + QAIPointer iface = QAIPointer(event->accessibleInterface()); + QAccessible::State state = iface->state(); + bool enabled = !state.disabled; + + notifyStateChange(iface, QLatin1String("enabled"), enabled); + notifyStateChange(iface, QLatin1String("sensitive"), enabled); } } break; diff --git a/src/platformsupport/linuxaccessibility/atspiadaptor_p.h b/src/platformsupport/linuxaccessibility/atspiadaptor_p.h index 4a8ff23bef..5b5eb60228 100644 --- a/src/platformsupport/linuxaccessibility/atspiadaptor_p.h +++ b/src/platformsupport/linuxaccessibility/atspiadaptor_p.h @@ -111,6 +111,8 @@ private: QString pathForInterface(const QAIPointer &interface, bool inDestructor = false) const; QString pathForObject(QObject *object) const; + void notifyStateChange(const QAIPointer& interface, const QString& state, int value); + // accessible helper functions AtspiRole getRole(const QAIPointer &interface) const; QSpiRelationArray relationSet(const QAIPointer &interface, const QDBusConnection &connection) const; diff --git a/src/platformsupport/linuxaccessibility/constant_mappings.cpp b/src/platformsupport/linuxaccessibility/constant_mappings.cpp index a15355f9d3..1840868aa2 100644 --- a/src/platformsupport/linuxaccessibility/constant_mappings.cpp +++ b/src/platformsupport/linuxaccessibility/constant_mappings.cpp @@ -69,8 +69,6 @@ quint64 spiStatesFromQState(QAccessible::State state) if (state.disabled) { unsetSpiStateBit(&spiState, ATSPI_STATE_ENABLED); - unsetSpiStateBit(&spiState, ATSPI_STATE_SHOWING); - unsetSpiStateBit(&spiState, ATSPI_STATE_VISIBLE); unsetSpiStateBit(&spiState, ATSPI_STATE_SENSITIVE); } diff --git a/src/plugins/accessible/widgets/qaccessiblemenu.cpp b/src/plugins/accessible/widgets/qaccessiblemenu.cpp index 5f7d9a9c30..c7dcee78f0 100644 --- a/src/plugins/accessible/widgets/qaccessiblemenu.cpp +++ b/src/plugins/accessible/widgets/qaccessiblemenu.cpp @@ -165,7 +165,7 @@ QAccessibleMenuItem::~QAccessibleMenuItem() QAccessibleInterface *QAccessibleMenuItem::childAt(int x, int y ) const { - for (int i = childCount(); i >= 0; --i) { + for (int i = childCount() - 1; i >= 0; --i) { QAccessibleInterface *childInterface = child(i); if (childInterface->rect().contains(x,y)) { return childInterface; diff --git a/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm b/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm index df6b64443d..d5841c1983 100644 --- a/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm +++ b/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm @@ -122,7 +122,7 @@ static QAccessibleInterface *acast(void *ptr) [attributes addObject : NSAccessibilityValueAttribute]; } - return attributes; + return [attributes autorelease]; } - (id)accessibilityAttributeValue:(NSString *)attribute { @@ -139,7 +139,7 @@ static QAccessibleInterface *acast(void *ptr) [kids addObject:[QCocoaAccessibleElement elementWithInterface:(void*)childInterface parent:self]]; } - return NSAccessibilityUnignoredChildren(kids); + return kids; } else if ([attribute isEqualToString:NSAccessibilityFocusedAttribute]) { // Just check if the app thinks we're focused. id focusedElement = [NSApp accessibilityAttributeValue:NSAccessibilityFocusedUIElementAttribute]; @@ -239,6 +239,10 @@ static QAccessibleInterface *acast(void *ptr) if (!accessibleInterface) return NSAccessibilityUnignoredAncestor(self); + + if (!acast(accessibleInterface)->isValid()) + return NSAccessibilityUnignoredAncestor(self); + QAccessibleInterface *childInterface = acast(accessibleInterface)->childAt(point.x, qt_mac_flipYCoordinate(point.y)); // No child found, meaning we hit this element. diff --git a/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm b/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm index f9122f56d1..5747cc01e9 100644 --- a/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm +++ b/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm @@ -223,7 +223,7 @@ static QString strippedText(QString s) - (void)showModelessPanel { if (mOpenPanel){ - QFileInfo info(*mCurrentSelection); + QFileInfo info(!mCurrentSelection->isEmpty() ? *mCurrentSelection : QT_PREPEND_NAMESPACE(QCFString::toQString)(mCurrentDir)); NSString *filepath = QT_PREPEND_NAMESPACE(QCFString::toNSString)(info.filePath()); bool selectable = (mOptions->acceptMode() == QFileDialogOptions::AcceptSave) || [self panel:nil shouldShowFilename:filepath]; @@ -241,7 +241,7 @@ static QString strippedText(QString s) - (BOOL)runApplicationModalPanel { - QFileInfo info(*mCurrentSelection); + QFileInfo info(!mCurrentSelection->isEmpty() ? *mCurrentSelection : QT_PREPEND_NAMESPACE(QCFString::toQString)(mCurrentDir)); NSString *filepath = QT_PREPEND_NAMESPACE(QCFString::toNSString)(info.filePath()); bool selectable = (mOptions->acceptMode() == QFileDialogOptions::AcceptSave) || [self panel:nil shouldShowFilename:filepath]; @@ -266,7 +266,7 @@ static QString strippedText(QString s) - (void)showWindowModalSheet:(QWindow *)parent { - QFileInfo info(*mCurrentSelection); + QFileInfo info(!mCurrentSelection->isEmpty() ? *mCurrentSelection : QT_PREPEND_NAMESPACE(QCFString::toQString)(mCurrentDir)); NSString *filepath = QT_PREPEND_NAMESPACE(QCFString::toNSString)(info.filePath()); bool selectable = (mOptions->acceptMode() == QFileDialogOptions::AcceptSave) || [self panel:nil shouldShowFilename:filepath]; diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm index ffee8528f0..b545844a24 100644 --- a/src/plugins/platforms/cocoa/qcocoawindow.mm +++ b/src/plugins/platforms/cocoa/qcocoawindow.mm @@ -49,6 +49,7 @@ #include <QtCore/qfileinfo.h> #include <QtCore/private/qcore_mac_p.h> #include <qwindow.h> +#include <private/qwindow_p.h> #include <qpa/qwindowsysteminterface.h> #include <qpa/qplatformscreen.h> @@ -649,6 +650,10 @@ void QCocoaWindow::recreateWindow(const QPlatformWindow *parentWindow) NSRect frame = NSMakeRect(rect.x(), rect.y(), rect.width(), rect.height()); [m_contentView setFrame:frame]; } + + const qreal opacity = qt_window_private(window())->opacity; + if (!qFuzzyCompare(opacity, qreal(1.0))) + setOpacity(opacity); } NSWindow * QCocoaWindow::createNSWindow() diff --git a/src/plugins/platforms/cocoa/qnsviewaccessibility.mm b/src/plugins/platforms/cocoa/qnsviewaccessibility.mm index 6824f19489..da714d3326 100644 --- a/src/plugins/platforms/cocoa/qnsviewaccessibility.mm +++ b/src/plugins/platforms/cocoa/qnsviewaccessibility.mm @@ -80,7 +80,7 @@ [kids addObject:[QCocoaAccessibleElement elementWithInterface: m_accessibleRoot->child(i) parent:self ]]; } - return NSAccessibilityUnignoredChildren(kids); + return kids; } else { return [super accessibilityAttributeValue:attribute]; } diff --git a/src/plugins/platforms/qnx/qqnxvirtualkeyboardbps.cpp b/src/plugins/platforms/qnx/qqnxvirtualkeyboardbps.cpp index 059dcb574b..3d2f49aa6c 100644 --- a/src/plugins/platforms/qnx/qqnxvirtualkeyboardbps.cpp +++ b/src/plugins/platforms/qnx/qqnxvirtualkeyboardbps.cpp @@ -86,6 +86,11 @@ bool QQnxVirtualKeyboardBps::handleEvent(bps_event_t *event) bool QQnxVirtualKeyboardBps::showKeyboard() { qVirtualKeyboardDebug() << Q_FUNC_INFO << "current visibility=" << isVisible(); + + // They keyboard's mode is global between applications, we have to set it each time + if ( !isVisible() ) + applyKeyboardMode(keyboardMode()); + virtualkeyboard_show(); return true; } diff --git a/src/plugins/platforms/windows/accessible/comutils.cpp b/src/plugins/platforms/windows/accessible/comutils.cpp index 5e5a1ebd0f..a67e2c4534 100644 --- a/src/plugins/platforms/windows/accessible/comutils.cpp +++ b/src/plugins/platforms/windows/accessible/comutils.cpp @@ -88,7 +88,7 @@ inline uint QColorToOLEColor(const QColor &col) return qRgba(col.blue(), col.green(), col.red(), 0x00); } -bool QVariantToVARIANT(const QVariant &var, VARIANT &arg, const QByteArray &typeName, bool out) +bool QVariant2VARIANT(const QVariant &var, VARIANT &arg, const QByteArray &typeName, bool out) { QVariant qvar = var; // "type" is the expected type, so coerce if necessary @@ -107,12 +107,12 @@ bool QVariantToVARIANT(const QVariant &var, VARIANT &arg, const QByteArray &type } if (out && arg.vt == (VT_VARIANT|VT_BYREF) && arg.pvarVal) { - return QVariantToVARIANT(var, *arg.pvarVal, typeName, false); + return QVariant2VARIANT(var, *arg.pvarVal, typeName, false); } if (out && proptype == QVariant::UserType && typeName == "QVariant") { VARIANT *pVariant = new VARIANT; - QVariantToVARIANT(var, *pVariant, QByteArray(), false); + QVariant2VARIANT(var, *pVariant, QByteArray(), false); arg.vt = VT_VARIANT|VT_BYREF; arg.pvarVal = pVariant; return true; @@ -409,7 +409,7 @@ bool QVariantToVARIANT(const QVariant &var, VARIANT &arg, const QByteArray &type for (LONG j = 0; j < columnCount; ++j) { QVariant elem = columns.at(j); VariantInit(&variant); - QVariantToVARIANT(elem, variant, elem.typeName()); + QVariant2VARIANT(elem, variant, elem.typeName()); rgIndices[1] = j; SafeArrayPutElement(array, rgIndices, pElement); clearVARIANT(&variant); @@ -425,7 +425,7 @@ bool QVariantToVARIANT(const QVariant &var, VARIANT &arg, const QByteArray &type if (listType != QVariant::LastType) elem.convert(listType); VariantInit(&variant); - QVariantToVARIANT(elem, variant, elem.typeName()); + QVariant2VARIANT(elem, variant, elem.typeName()); SafeArrayPutElement(array, &index, pElement); clearVARIANT(&variant); } @@ -555,7 +555,7 @@ bool QVariantToVARIANT(const QVariant &var, VARIANT &arg, const QByteArray &type arg.pRecInfo = recordInfo, arg.pvRecord = record; if (out) { - qWarning("QVariantToVARIANT: out-parameter not supported for records"); + qWarning("QVariant2VARIANT: out-parameter not supported for records"); return false; } } @@ -574,7 +574,7 @@ bool QVariantToVARIANT(const QVariant &var, VARIANT &arg, const QByteArray &type if (arg.pdispVal) arg.pdispVal->AddRef(); if (out) { - qWarning("QVariantToVARIANT: out-parameter not supported for IDispatch"); + qWarning("QVariant2VARIANT: out-parameter not supported for IDispatch"); return false; } } else if (!qstrcmp(qvar.typeName(), "IDispatch**")) { @@ -588,7 +588,7 @@ bool QVariantToVARIANT(const QVariant &var, VARIANT &arg, const QByteArray &type if (arg.punkVal) arg.punkVal->AddRef(); if (out) { - qWarning("QVariantToVARIANT: out-parameter not supported for IUnknown"); + qWarning("QVariant2VARIANT: out-parameter not supported for IUnknown"); return false; } #ifdef QAX_SERVER @@ -602,7 +602,7 @@ bool QVariantToVARIANT(const QVariant &var, VARIANT &arg, const QByteArray &type qAxFactory()->createObjectWrapper(static_cast<QObject*>(user), &arg.pdispVal); } if (out) { - qWarning("QVariantToVARIANT: out-parameter not supported for subtype"); + qWarning("QVariant2VARIANT: out-parameter not supported for subtype"); return false; } #else @@ -612,7 +612,7 @@ bool QVariantToVARIANT(const QVariant &var, VARIANT &arg, const QByteArray &type arg.vt = VT_DISPATCH; object->queryInterface(IID_IDispatch, (void**)&arg.pdispVal); if (out) { - qWarning("QVariantToVARIANT: out-parameter not supported for subtype"); + qWarning("QVariant2VARIANT: out-parameter not supported for subtype"); return false; } #endif diff --git a/src/plugins/platforms/windows/accessible/comutils.h b/src/plugins/platforms/windows/accessible/comutils.h index c9ed2b1224..8593f68d76 100644 --- a/src/plugins/platforms/windows/accessible/comutils.h +++ b/src/plugins/platforms/windows/accessible/comutils.h @@ -52,7 +52,8 @@ QT_BEGIN_NAMESPACE class QVariant; -bool QVariantToVARIANT(const QVariant &var, VARIANT &arg, const QByteArray &typeName, bool out); +// Originally QVariantToVARIANT copied from ActiveQt - renamed to avoid conflicts in static builds. +bool QVariant2VARIANT(const QVariant &var, VARIANT &arg, const QByteArray &typeName, bool out); inline QString BSTRToQString(const BSTR &bstr) { diff --git a/src/plugins/platforms/windows/accessible/iaccessible2.cpp b/src/plugins/platforms/windows/accessible/iaccessible2.cpp index 03bb94db8f..838cd055ab 100644 --- a/src/plugins/platforms/windows/accessible/iaccessible2.cpp +++ b/src/plugins/platforms/windows/accessible/iaccessible2.cpp @@ -1425,7 +1425,7 @@ HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::get_currentValue(VARIANT *curre return E_FAIL; if (QAccessibleValueInterface *valueIface = valueInterface()) { const QVariant var = valueIface->currentValue(); - if (QVariantToVARIANT(var, *currentValue, QByteArray(), false)) + if (QVariant2VARIANT(var, *currentValue, QByteArray(), false)) return S_OK; } @@ -1456,7 +1456,7 @@ HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::get_maximumValue(VARIANT *maxim return E_FAIL; if (QAccessibleValueInterface *valueIface = valueInterface()) { const QVariant var = valueIface->maximumValue(); - if (QVariantToVARIANT(var, *maximumValue, QByteArray(), false)) + if (QVariant2VARIANT(var, *maximumValue, QByteArray(), false)) return S_OK; } maximumValue->vt = VT_EMPTY; @@ -1470,7 +1470,7 @@ HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::get_minimumValue(VARIANT *minim return E_FAIL; if (QAccessibleValueInterface *valueIface = valueInterface()) { const QVariant var = valueIface->minimumValue(); - if (QVariantToVARIANT(var, *minimumValue, QByteArray(), false)) + if (QVariant2VARIANT(var, *minimumValue, QByteArray(), false)) return S_OK; } minimumValue->vt = VT_EMPTY; diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp index 1f6253438f..3831c6b10e 100644 --- a/src/plugins/platforms/windows/qwindowswindow.cpp +++ b/src/plugins/platforms/windows/qwindowswindow.cpp @@ -55,6 +55,7 @@ #include <QtGui/QWindow> #include <QtGui/QRegion> #include <private/qwindow_p.h> +#include <private/qguiapplication_p.h> #include <qpa/qwindowsysteminterface.h> #include <QtCore/QDebug> @@ -321,7 +322,6 @@ void WindowCreationData::fromWindow(const QWindow *w, const Qt::WindowFlags flag topLevel = ((creationFlags & ForceChild) || embedded) ? false : w->isTopLevel(); if (topLevel && flags == 1) { - qWarning("Remove me: fixing toplevel window flags"); flags |= Qt::WindowTitleHint|Qt::WindowSystemMenuHint|Qt::WindowMinimizeButtonHint |Qt::WindowMaximizeButtonHint|Qt::WindowCloseButtonHint; } @@ -731,6 +731,9 @@ QWindowsWindow::QWindowsWindow(QWindow *aWindow, const WindowData &data) : if (QWindowsContext::instance()->systemInfo() & QWindowsContext::SI_SupportsTouch) QWindowsContext::user32dll.registerTouchWindow(m_data.hwnd, 0); setWindowState(aWindow->windowState()); + const qreal opacity = qt_window_private(aWindow)->opacity; + if (!qFuzzyCompare(opacity, qreal(1.0))) + setOpacity(opacity); } QWindowsWindow::~QWindowsWindow() @@ -1185,8 +1188,21 @@ void QWindowsWindow::setWindowTitle(const QString &title) { if (QWindowsContext::verboseWindows) qDebug() << __FUNCTION__ << this << window() <<title; - if (m_data.hwnd) - SetWindowText(m_data.hwnd, (const wchar_t*)title.utf16()); + if (m_data.hwnd) { + + QString fullTitle = title; + if (QGuiApplicationPrivate::displayName) { + // Append display name, if set. + if (!fullTitle.isEmpty()) + fullTitle += QStringLiteral(" - "); + fullTitle += *QGuiApplicationPrivate::displayName; + } else if (fullTitle.isEmpty()) { + // Don't let the window title be completely empty, use the app name as fallback. + fullTitle = QCoreApplication::applicationName(); + } + + SetWindowText(m_data.hwnd, (const wchar_t*)fullTitle.utf16()); + } } void QWindowsWindow::setWindowFlags(Qt::WindowFlags flags) diff --git a/src/plugins/platforms/xcb/qxcbconnection.cpp b/src/plugins/platforms/xcb/qxcbconnection.cpp index 4c4df137a3..1192894693 100644 --- a/src/plugins/platforms/xcb/qxcbconnection.cpp +++ b/src/plugins/platforms/xcb/qxcbconnection.cpp @@ -257,6 +257,7 @@ QXcbConnection::QXcbConnection(QXcbNativeInterface *nativeInterface, const char , has_shape_extension(false) , has_randr_extension(false) , has_input_shape(false) + , m_buttons(0) { #ifdef XCB_USE_XLIB Display *dpy = XOpenDisplay(m_displayName.constData()); @@ -312,6 +313,7 @@ QXcbConnection::QXcbConnection(QXcbNativeInterface *nativeInterface, const char initializeAllAtoms(); m_time = XCB_CURRENT_TIME; + m_netWmUserTime = XCB_CURRENT_TIME; initializeXRandr(); updateScreens(); @@ -662,6 +664,73 @@ void QXcbConnection::handleXcbError(xcb_generic_error_t *error) #endif } +static Qt::MouseButtons translateMouseButtons(int s) +{ + Qt::MouseButtons ret = 0; + if (s & XCB_BUTTON_MASK_1) + ret |= Qt::LeftButton; + if (s & XCB_BUTTON_MASK_2) + ret |= Qt::MidButton; + if (s & XCB_BUTTON_MASK_3) + ret |= Qt::RightButton; + return ret; +} + +static Qt::MouseButton translateMouseButton(xcb_button_t s) +{ + switch (s) { + case 1: return Qt::LeftButton; + case 2: return Qt::MidButton; + case 3: return Qt::RightButton; + // Button values 4-7 were already handled as Wheel events, and won't occur here. + case 8: return Qt::BackButton; // Also known as Qt::ExtraButton1 + case 9: return Qt::ForwardButton; // Also known as Qt::ExtraButton2 + case 10: return Qt::ExtraButton3; + case 11: return Qt::ExtraButton4; + case 12: return Qt::ExtraButton5; + case 13: return Qt::ExtraButton6; + case 14: return Qt::ExtraButton7; + case 15: return Qt::ExtraButton8; + case 16: return Qt::ExtraButton9; + case 17: return Qt::ExtraButton10; + case 18: return Qt::ExtraButton11; + case 19: return Qt::ExtraButton12; + case 20: return Qt::ExtraButton13; + case 21: return Qt::ExtraButton14; + case 22: return Qt::ExtraButton15; + case 23: return Qt::ExtraButton16; + case 24: return Qt::ExtraButton17; + case 25: return Qt::ExtraButton18; + case 26: return Qt::ExtraButton19; + case 27: return Qt::ExtraButton20; + case 28: return Qt::ExtraButton21; + case 29: return Qt::ExtraButton22; + case 30: return Qt::ExtraButton23; + case 31: return Qt::ExtraButton24; + default: return Qt::NoButton; + } +} + +void QXcbConnection::handleButtonPress(xcb_generic_event_t *ev) +{ + xcb_button_press_event_t *event = (xcb_button_press_event_t *)ev; + + // the event explicitly contains the state of the three first buttons, + // the rest we need to manage ourselves + m_buttons = (m_buttons & ~0x7) | translateMouseButtons(event->state); + m_buttons |= translateMouseButton(event->detail); +} + +void QXcbConnection::handleButtonRelease(xcb_generic_event_t *ev) +{ + xcb_button_release_event_t *event = (xcb_button_release_event_t *)ev; + + // the event explicitly contains the state of the three first buttons, + // the rest we need to manage ourselves + m_buttons = (m_buttons & ~0x7) | translateMouseButtons(event->state); + m_buttons &= ~translateMouseButton(event->detail); +} + void QXcbConnection::handleXcbEvent(xcb_generic_event_t *event) { #ifdef Q_XCB_DEBUG @@ -686,8 +755,10 @@ void QXcbConnection::handleXcbEvent(xcb_generic_event_t *event) case XCB_EXPOSE: HANDLE_PLATFORM_WINDOW_EVENT(xcb_expose_event_t, window, handleExposeEvent); case XCB_BUTTON_PRESS: + handleButtonPress(event); HANDLE_PLATFORM_WINDOW_EVENT(xcb_button_press_event_t, event, handleButtonPressEvent); case XCB_BUTTON_RELEASE: + handleButtonRelease(event); HANDLE_PLATFORM_WINDOW_EVENT(xcb_button_release_event_t, event, handleButtonReleaseEvent); case XCB_MOTION_NOTIFY: HANDLE_PLATFORM_WINDOW_EVENT(xcb_motion_notify_event_t, event, handleMotionNotifyEvent); diff --git a/src/plugins/platforms/xcb/qxcbconnection.h b/src/plugins/platforms/xcb/qxcbconnection.h index c67acb3218..464d918adf 100644 --- a/src/plugins/platforms/xcb/qxcbconnection.h +++ b/src/plugins/platforms/xcb/qxcbconnection.h @@ -370,6 +370,9 @@ public: inline xcb_timestamp_t time() const { return m_time; } inline void setTime(xcb_timestamp_t t) { if (t > m_time) m_time = t; } + inline xcb_timestamp_t netWmUserTime() const { return m_netWmUserTime; } + inline void setNetWmUserTime(xcb_timestamp_t t) { if (t > m_netWmUserTime) m_netWmUserTime = t; } + bool hasGLX() const { return has_glx_extension; } bool hasXFixes() const { return xfixes_first_event > 0; } bool hasXShape() const { return has_shape_extension; } @@ -380,6 +383,8 @@ public: xcb_timestamp_t getTimestamp(); + Qt::MouseButtons buttons() const { return m_buttons; } + private slots: void processXcbEvents(); @@ -400,6 +405,8 @@ private: QXcbScreen* findOrCreateScreen(QList<QXcbScreen *>& newScreens, int screenNumber, xcb_screen_t* xcbScreen, xcb_randr_get_output_info_reply_t *output = NULL); void updateScreens(); + void handleButtonPress(xcb_generic_event_t *event); + void handleButtonRelease(xcb_generic_event_t *event); bool m_xi2Enabled; int m_xi2Minor; @@ -448,6 +455,7 @@ private: xcb_atom_t m_allAtoms[QXcbAtom::NAtoms]; xcb_timestamp_t m_time; + xcb_timestamp_t m_netWmUserTime; QByteArray m_displayName; @@ -501,6 +509,8 @@ private: bool has_shape_extension; bool has_randr_extension; bool has_input_shape; + + Qt::MouseButtons m_buttons; }; #define DISPLAY_FROM_XCB(object) ((Display *)(object->connection()->xlib_display())) diff --git a/src/plugins/platforms/xcb/qxcbnativeinterface.cpp b/src/plugins/platforms/xcb/qxcbnativeinterface.cpp index a44e7fb959..9c360df900 100644 --- a/src/plugins/platforms/xcb/qxcbnativeinterface.cpp +++ b/src/plugins/platforms/xcb/qxcbnativeinterface.cpp @@ -71,6 +71,8 @@ public: insert("screen",QXcbNativeInterface::Screen); insert("eglcontext",QXcbNativeInterface::EglContext); insert("glxcontext",QXcbNativeInterface::GLXContext); + insert("apptime",QXcbNativeInterface::AppTime); + insert("appusertime",QXcbNativeInterface::AppUserTime); } }; @@ -109,18 +111,24 @@ void *QXcbNativeInterface::nativeResourceForScreen(const QByteArray &resource, Q const QXcbResourceMap::const_iterator it = qXcbResourceMap()->constFind(resource.toLower()); if (it == qXcbResourceMap()->constEnd() || !screen->handle()) return 0; + void *result = 0; const QXcbScreen *xcbScreen = static_cast<QXcbScreen *>(screen->handle()); switch (it.value()) { case Display: #ifdef XCB_USE_XLIB - return xcbScreen->connection()->xlib_display(); -#else - break; + result = xcbScreen->connection()->xlib_display(); #endif + break; + case AppTime: + result = appTime(xcbScreen); + break; + case AppUserTime: + result = appUserTime(xcbScreen); + break; default: break; } - return 0; + return result; } void *QXcbNativeInterface::nativeResourceForWindow(const QByteArray &resourceString, QWindow *window) @@ -151,6 +159,36 @@ void *QXcbNativeInterface::nativeResourceForWindow(const QByteArray &resourceStr return result; } +QPlatformNativeInterface::NativeResourceForScreenFunction QXcbNativeInterface::nativeResourceFunctionForScreen(const QByteArray &resource) +{ + const QByteArray lowerCaseResource = resource.toLower(); + if (lowerCaseResource == "setapptime") + return NativeResourceForScreenFunction(setAppTime); + else if (lowerCaseResource == "setappusertime") + return NativeResourceForScreenFunction(setAppUserTime); + return 0; +} + +void *QXcbNativeInterface::appTime(const QXcbScreen *screen) +{ + return reinterpret_cast<void *>(quintptr(screen->connection()->time())); +} + +void *QXcbNativeInterface::appUserTime(const QXcbScreen *screen) +{ + return reinterpret_cast<void *>(quintptr(screen->connection()->netWmUserTime())); +} + +void QXcbNativeInterface::setAppTime(QScreen* screen, xcb_timestamp_t time) +{ + static_cast<QXcbScreen *>(screen->handle())->connection()->setTime(time); +} + +void QXcbNativeInterface::setAppUserTime(QScreen* screen, xcb_timestamp_t time) +{ + static_cast<QXcbScreen *>(screen->handle())->connection()->setNetWmUserTime(time); +} + QPlatformNativeInterface::NativeResourceForContextFunction QXcbNativeInterface::nativeResourceFunctionForContext(const QByteArray &resource) { QByteArray lowerCaseResource = resource.toLower(); diff --git a/src/plugins/platforms/xcb/qxcbnativeinterface.h b/src/plugins/platforms/xcb/qxcbnativeinterface.h index a7e0a207cb..e2e03fce8f 100644 --- a/src/plugins/platforms/xcb/qxcbnativeinterface.h +++ b/src/plugins/platforms/xcb/qxcbnativeinterface.h @@ -43,11 +43,13 @@ #define QXCBNATIVEINTERFACE_H #include <qpa/qplatformnativeinterface.h> +#include <xcb/xcb.h> QT_BEGIN_NAMESPACE class QWidget; class QXcbScreen; +class QXcbConnection; class QXcbNativeInterface : public QPlatformNativeInterface { @@ -59,7 +61,9 @@ public: Screen, GraphicsDevice, EglContext, - GLXContext + GLXContext, + AppTime, + AppUserTime }; QXcbNativeInterface(); @@ -69,6 +73,7 @@ public: void *nativeResourceForWindow(const QByteArray &resourceString, QWindow *window); NativeResourceForContextFunction nativeResourceFunctionForContext(const QByteArray &resource); + NativeResourceForScreenFunction nativeResourceFunctionForScreen(const QByteArray &resource) Q_DECL_OVERRIDE; inline const QByteArray &genericEventFilterType() const { return m_genericEventFilterType; } @@ -77,6 +82,10 @@ public: void *connectionForWindow(QWindow *window); void *screenForWindow(QWindow *window); void *graphicsDeviceForWindow(QWindow *window); + void *appTime(const QXcbScreen *screen); + void *appUserTime(const QXcbScreen *screen); + static void setAppTime(QScreen *screen, xcb_timestamp_t time); + static void setAppUserTime(QScreen *screen, xcb_timestamp_t time); static void *eglContextForContext(QOpenGLContext *context); static void *glxContextForContext(QOpenGLContext *context); diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp index 0db4176607..528c4c6580 100644 --- a/src/plugins/platforms/xcb/qxcbwindow.cpp +++ b/src/plugins/platforms/xcb/qxcbwindow.cpp @@ -385,6 +385,10 @@ void QXcbWindow::create() #ifndef QT_NO_DRAGANDDROP connection()->drag()->dndEnable(this, true); #endif + + const qreal opacity = qt_window_private(window())->opacity; + if (!qFuzzyCompare(opacity, qreal(1.0))) + setOpacity(opacity); } QXcbWindow::~QXcbWindow() @@ -1024,6 +1028,7 @@ void QXcbWindow::updateNetWmStateBeforeMap() void QXcbWindow::updateNetWmUserTime(xcb_timestamp_t timestamp) { xcb_window_t wid = m_window; + connection()->setNetWmUserTime(timestamp); const bool isSupportedByWM = connection()->wmSupport()->isSupportedByWM(atom(QXcbAtom::_NET_WM_USER_TIME_WINDOW)); if (m_netWmUserTimeWindow || isSupportedByWM) { @@ -1112,7 +1117,18 @@ void QXcbWindow::setParent(const QPlatformWindow *parent) void QXcbWindow::setWindowTitle(const QString &title) { - QByteArray ba = title.toUtf8(); + QString fullTitle = title; + if (QGuiApplicationPrivate::displayName) { + // Append display name, if set. + if (!fullTitle.isEmpty()) + fullTitle += QString::fromUtf8(" \xe2\x80\x94 "); // unicode character U+2014, EM DASH + fullTitle += *QGuiApplicationPrivate::displayName; + } else if (fullTitle.isEmpty()) { + // Don't let the window title be completely empty, use the app name as fallback. + fullTitle = QCoreApplication::applicationName(); + } + const QByteArray ba = fullTitle.toUtf8(); + Q_XCB_CALL(xcb_change_property(xcb_connection(), XCB_PROP_MODE_REPLACE, m_window, @@ -1460,53 +1476,6 @@ void QXcbWindow::handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *event) } } -static Qt::MouseButtons translateMouseButtons(int s) -{ - Qt::MouseButtons ret = 0; - if (s & XCB_BUTTON_MASK_1) - ret |= Qt::LeftButton; - if (s & XCB_BUTTON_MASK_2) - ret |= Qt::MidButton; - if (s & XCB_BUTTON_MASK_3) - ret |= Qt::RightButton; - return ret; -} - -static Qt::MouseButton translateMouseButton(xcb_button_t s) -{ - switch (s) { - case 1: return Qt::LeftButton; - case 2: return Qt::MidButton; - case 3: return Qt::RightButton; - // Button values 4-7 were already handled as Wheel events, and won't occur here. - case 8: return Qt::BackButton; // Also known as Qt::ExtraButton1 - case 9: return Qt::ForwardButton; // Also known as Qt::ExtraButton2 - case 10: return Qt::ExtraButton3; - case 11: return Qt::ExtraButton4; - case 12: return Qt::ExtraButton5; - case 13: return Qt::ExtraButton6; - case 14: return Qt::ExtraButton7; - case 15: return Qt::ExtraButton8; - case 16: return Qt::ExtraButton9; - case 17: return Qt::ExtraButton10; - case 18: return Qt::ExtraButton11; - case 19: return Qt::ExtraButton12; - case 20: return Qt::ExtraButton13; - case 21: return Qt::ExtraButton14; - case 22: return Qt::ExtraButton15; - case 23: return Qt::ExtraButton16; - case 24: return Qt::ExtraButton17; - case 25: return Qt::ExtraButton18; - case 26: return Qt::ExtraButton19; - case 27: return Qt::ExtraButton20; - case 28: return Qt::ExtraButton21; - case 29: return Qt::ExtraButton22; - case 30: return Qt::ExtraButton23; - case 31: return Qt::ExtraButton24; - default: return Qt::NoButton; - } -} - void QXcbWindow::handleButtonPressEvent(const xcb_button_press_event_t *event) { updateNetWmUserTime(event->time); @@ -1528,7 +1497,7 @@ void QXcbWindow::handleButtonPressEvent(const xcb_button_press_event_t *event) return; } - handleMouseEvent(event->detail, event->state, event->time, local, global, modifiers); + handleMouseEvent(event->time, local, global, modifiers); } void QXcbWindow::handleButtonReleaseEvent(const xcb_button_release_event_t *event) @@ -1537,7 +1506,12 @@ void QXcbWindow::handleButtonReleaseEvent(const xcb_button_release_event_t *even QPoint global(event->root_x, event->root_y); Qt::KeyboardModifiers modifiers = connection()->keyboard()->translateModifiers(event->state); - handleMouseEvent(event->detail, event->state, event->time, local, global, modifiers); + if (event->detail >= 4 && event->detail <= 7) { + // mouse wheel, handled in handleButtonPressEvent() + return; + } + + handleMouseEvent(event->time, local, global, modifiers); } void QXcbWindow::handleMotionNotifyEvent(const xcb_motion_notify_event_t *event) @@ -1546,19 +1520,13 @@ void QXcbWindow::handleMotionNotifyEvent(const xcb_motion_notify_event_t *event) QPoint global(event->root_x, event->root_y); Qt::KeyboardModifiers modifiers = connection()->keyboard()->translateModifiers(event->state); - handleMouseEvent(event->detail, event->state, event->time, local, global, modifiers); + handleMouseEvent(event->time, local, global, modifiers); } -void QXcbWindow::handleMouseEvent(xcb_button_t detail, uint16_t state, xcb_timestamp_t time, const QPoint &local, const QPoint &global, Qt::KeyboardModifiers modifiers) +void QXcbWindow::handleMouseEvent(xcb_timestamp_t time, const QPoint &local, const QPoint &global, Qt::KeyboardModifiers modifiers) { connection()->setTime(time); - - Qt::MouseButtons buttons = translateMouseButtons(state); - Qt::MouseButton button = translateMouseButton(detail); - - buttons ^= button; // X event uses state *before*, Qt uses state *after* - - QWindowSystemInterface::handleMouseEvent(window(), time, local, global, buttons, modifiers); + QWindowSystemInterface::handleMouseEvent(window(), time, local, global, connection()->buttons(), modifiers); } class EnterEventChecker diff --git a/src/plugins/platforms/xcb/qxcbwindow.h b/src/plugins/platforms/xcb/qxcbwindow.h index 07ac0e0fcb..b2c637281d 100644 --- a/src/plugins/platforms/xcb/qxcbwindow.h +++ b/src/plugins/platforms/xcb/qxcbwindow.h @@ -134,11 +134,10 @@ public: void handleFocusOutEvent(const xcb_focus_out_event_t *event); void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event); - void handleMouseEvent(xcb_button_t detail, uint16_t state, xcb_timestamp_t time, const QPoint &local, const QPoint &global, Qt::KeyboardModifiers modifiers); + void handleMouseEvent(xcb_timestamp_t time, const QPoint &local, const QPoint &global, Qt::KeyboardModifiers modifiers); void updateSyncRequestCounter(); void updateNetWmUserTime(xcb_timestamp_t timestamp); - void netWmUserTime() const; #if defined(XCB_USE_EGL) QXcbEGLSurface *eglSurface() const; diff --git a/src/testlib/doc/snippets/code/doc_src_qsignalspy.cpp b/src/testlib/doc/snippets/code/doc_src_qsignalspy.cpp index a0fd16f577..6741ae7942 100644 --- a/src/testlib/doc/snippets/code/doc_src_qsignalspy.cpp +++ b/src/testlib/doc/snippets/code/doc_src_qsignalspy.cpp @@ -79,3 +79,7 @@ QModelIndex result = qvariant_cast<QModelIndex>(spy.at(0).at(0)); //! [4] QSignalSpy spy(myPushButton, SIGNAL(clicked(bool))); //! [4] + +//! [5] +QVERIFY(spy.wait(1000)); +//! [5] diff --git a/src/testlib/qsignalspy.qdoc b/src/testlib/qsignalspy.qdoc index 30ab7c8b55..d36716bf2e 100644 --- a/src/testlib/qsignalspy.qdoc +++ b/src/testlib/qsignalspy.qdoc @@ -94,4 +94,7 @@ Optionally the event loop can return earlier on a \a timeout (in milliseconds). Returns true if the signal was emitted at least once in \a timeout milliseconds, otherwise returns false. + + Example: + \snippet code/doc_src_qsignalspy.cpp 5 */ diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp index d4266c0f9d..2bfd3412c7 100644 --- a/src/testlib/qtestcase.cpp +++ b/src/testlib/qtestcase.cpp @@ -185,7 +185,7 @@ QT_BEGIN_NAMESPACE \relates QTest - Invokes QTRY_VERIFY_WITH_TIMEOUT() with a timeout of five seconds. + Checks the \a condition by invoking QTRY_VERIFY_WITH_TIMEOUT() with a timeout of five seconds. \note This macro can only be used in a test function that is invoked by the test framework. @@ -215,7 +215,8 @@ QT_BEGIN_NAMESPACE \relates QTest - Invokes QTRY_COMPARE_WITH_TIMEOUT() with a timeout of five seconds. + Performs a comparison of the \a actual and \a expected values by + invoking QTRY_COMPARE_WITH_TIMEOUT() with a timeout of five seconds. \note This macro can only be used in a test function that is invoked by the test framework. diff --git a/src/tools/bootstrap/bootstrap.pro b/src/tools/bootstrap/bootstrap.pro index f2f041b704..0d4b62fd16 100644 --- a/src/tools/bootstrap/bootstrap.pro +++ b/src/tools/bootstrap/bootstrap.pro @@ -41,16 +41,6 @@ load(qt_module) INCLUDEPATH += $$QT_BUILD_TREE/src/corelib/global -DEPENDPATH += $$INCLUDEPATH \ - ../../corelib/global \ - ../../corelib/kernel \ - ../../corelib/tools \ - ../../corelib/io \ - ../../corelib/codecs \ - ../../corelib/json \ - ../../xml/dom \ - ../../xml/sax - SOURCES += \ ../../corelib/codecs/qlatincodec.cpp \ ../../corelib/codecs/qtextcodec.cpp \ @@ -139,16 +129,6 @@ win32:LIBS += -luser32 -lole32 -ladvapi32 lib.CONFIG = dummy_install INSTALLS += lib -# Make dummy "sis" and "freeze" target to keep recursive "make sis/freeze" working. -sis_target.target = sis -sis_target.commands = -sis_target.depends = first -QMAKE_EXTRA_TARGETS += sis_target -freeze_target.target = freeze -freeze_target.commands = -freeze_target.depends = first -QMAKE_EXTRA_TARGETS += freeze_target - !build_pass { # We need the forwarding headers before their respective modules are built, # so do a minimal syncqt run. diff --git a/src/tools/moc/moc.cpp b/src/tools/moc/moc.cpp index 96d6e9e456..5fbbd57c22 100644 --- a/src/tools/moc/moc.cpp +++ b/src/tools/moc/moc.cpp @@ -831,9 +831,6 @@ static void findRequiredContainers(ClassDef *cdef, QSet<QByteArray> *requiredQtC void Moc::generate(FILE *out) { - - QDateTime dt = QDateTime::currentDateTime(); - QByteArray dstr = dt.toString().toLatin1(); QByteArray fn = filename; int i = filename.length()-1; while (i>0 && filename[i-1] != '/' && filename[i-1] != '\\') @@ -842,8 +839,7 @@ void Moc::generate(FILE *out) fn = filename.mid(i); fprintf(out, "/****************************************************************************\n" "** Meta object code from reading C++ file '%s'\n**\n" , fn.constData()); - fprintf(out, "** Created: %s\n" - "** by: The Qt Meta Object Compiler version %d (Qt %s)\n**\n" , dstr.data(), mocOutputRevision, QT_VERSION_STR); + fprintf(out, "** Created by: The Qt Meta Object Compiler version %d (Qt %s)\n**\n" , mocOutputRevision, QT_VERSION_STR); fprintf(out, "** WARNING! All changes made in this file will be lost!\n" "*****************************************************************************/\n\n"); diff --git a/src/tools/qdoc/node.h b/src/tools/qdoc/node.h index f93e777d84..88be423478 100644 --- a/src/tools/qdoc/node.h +++ b/src/tools/qdoc/node.h @@ -822,13 +822,8 @@ private: QString rt; QStringList pp; -#ifdef Q_WS_WIN Metaness met; Virtualness vir; -#else - Metaness met : 4; - Virtualness vir : 2; -#endif bool con : 1; bool sta : 1; bool ove : 1; diff --git a/src/tools/qdoc/qdoc.pro b/src/tools/qdoc/qdoc.pro index b489668059..c0f3cd70d1 100644 --- a/src/tools/qdoc/qdoc.pro +++ b/src/tools/qdoc/qdoc.pro @@ -5,9 +5,6 @@ DEFINES += QDOC2_COMPAT INCLUDEPATH += $$QT_SOURCE_TREE/src/tools/qdoc \ $$QT_SOURCE_TREE/src/tools/qdoc/qmlparser -DEPENDPATH += $$QT_SOURCE_TREE/src/tools/qdoc \ - $$QT_SOURCE_TREE/src/tools/qdoc/qmlparser - # Increase the stack size on MSVC to 4M to avoid a stack overflow win32-msvc*:{ QMAKE_LFLAGS += /STACK:4194304 diff --git a/src/tools/qdoc/qmlvisitor.cpp b/src/tools/qdoc/qmlvisitor.cpp index e0bee2e664..63a69ee0af 100644 --- a/src/tools/qdoc/qmlvisitor.cpp +++ b/src/tools/qdoc/qmlvisitor.cpp @@ -344,7 +344,7 @@ void QmlDocVisitor::applyMetacommands(QQmlJS::AST::SourceLocation, else if ((command == COMMAND_INGROUP) && !args.isEmpty()) { ArgList::ConstIterator argsIter = args.constBegin(); while (argsIter != args.constEnd()) { - DocNode* dn = QDocDatabase::qdocDB()->addToGroup(argsIter->first, node); + QDocDatabase::qdocDB()->addToGroup(argsIter->first, node); ++argsIter; } } diff --git a/src/tools/rcc/rcc.cpp b/src/tools/rcc/rcc.cpp index 969b644d84..fb952e2970 100644 --- a/src/tools/rcc/rcc.cpp +++ b/src/tools/rcc/rcc.cpp @@ -793,9 +793,7 @@ bool RCCResourceLibrary::writeHeader() writeString("/****************************************************************************\n"); writeString("** Resource object code\n"); writeString("**\n"); - writeString("** Created: "); - writeByteArray(QDateTime::currentDateTime().toString().toLatin1()); - writeString("\n** by: The Resource Compiler for Qt version "); + writeString("** Created by: The Resource Compiler for Qt version "); writeByteArray(QT_VERSION_STR); writeString("\n**\n"); writeString("** WARNING! All changes made in this file will be lost!\n"); diff --git a/src/tools/uic/uic.cpp b/src/tools/uic/uic.cpp index 38b4780ec9..1188271d99 100644 --- a/src/tools/uic/uic.cpp +++ b/src/tools/uic/uic.cpp @@ -134,8 +134,7 @@ void Uic::writeCopyrightHeader(DomUI *ui) out << "/********************************************************************************\n"; out << "** Form generated from reading UI file '" << QFileInfo(opt.inputFile).fileName() << "'\n"; out << "**\n"; - out << "** Created: " << QDateTime::currentDateTime().toString() << "\n"; - out << "** " << QString::fromLatin1("by: Qt User Interface Compiler version %1\n").arg(QLatin1String(QT_VERSION_STR)); + out << "** Created by: Qt User Interface Compiler version " << QLatin1String(QT_VERSION_STR) << "\n"; out << "**\n"; out << "** WARNING! All changes made in this file will be lost when recompiling UI file!\n"; out << "********************************************************************************/\n\n"; diff --git a/src/widgets/accessible/qaccessiblewidget.cpp b/src/widgets/accessible/qaccessiblewidget.cpp index c8a22175fc..2177b2b262 100644 --- a/src/widgets/accessible/qaccessiblewidget.cpp +++ b/src/widgets/accessible/qaccessiblewidget.cpp @@ -162,7 +162,6 @@ public: QAccessible::Role role; QString name; QStringList primarySignals; - const QAccessibleInterface *asking; }; /*! @@ -201,7 +200,6 @@ QAccessibleWidget::QAccessibleWidget(QWidget *w, QAccessible::Role role, const Q d = new QAccessibleWidgetPrivate(); d->role = role; d->name = name; - d->asking = 0; } /*! \reimp */ diff --git a/src/widgets/graphicsview/qgraphicsitem.cpp b/src/widgets/graphicsview/qgraphicsitem.cpp index f9b8cb83da..3ba9b89e34 100644 --- a/src/widgets/graphicsview/qgraphicsitem.cpp +++ b/src/widgets/graphicsview/qgraphicsitem.cpp @@ -1436,6 +1436,7 @@ QGraphicsItem::~QGraphicsItem() #endif clearFocus(); + setFocusProxy(0); // Update focus scope item ptr. QGraphicsItem *p = d_ptr->parent; diff --git a/src/widgets/itemviews/qtreeview.cpp b/src/widgets/itemviews/qtreeview.cpp index 9c4a4336b9..884b0b8f65 100644 --- a/src/widgets/itemviews/qtreeview.cpp +++ b/src/widgets/itemviews/qtreeview.cpp @@ -3743,7 +3743,7 @@ void QTreeView::currentChanged(const QModelIndex ¤t, const QModelIndex &pr } #ifndef QT_NO_ACCESSIBILITY if (QAccessible::isActive() && current.isValid()) { - int entry = (visualIndex(current) + (header()?1:0))*current.model()->columnCount()+current.column() + 1; + int entry = (visualIndex(current) + (header()?1:0))*current.model()->columnCount()+current.column(); QAccessibleEvent event(this, QAccessible::Focus); event.setChild(entry); QAccessible::updateAccessibility(&event); @@ -3763,16 +3763,16 @@ void QTreeView::selectionChanged(const QItemSelection &selected, // ### does not work properly for selection ranges. QModelIndex sel = selected.indexes().value(0); if (sel.isValid()) { - int entry = (visualIndex(sel) + (header()?1:0))*sel.model()->columnCount()+sel.column() + 1; - Q_ASSERT(entry > 0); + int entry = (visualIndex(sel) + (header()?1:0))*sel.model()->columnCount()+sel.column(); + Q_ASSERT(entry >= 0); QAccessibleEvent event(this, QAccessible::Selection); event.setChild(entry); QAccessible::updateAccessibility(&event); } QModelIndex desel = deselected.indexes().value(0); if (desel.isValid()) { - int entry = (visualIndex(desel) + (header()?1:0))*desel.model()->columnCount()+desel.column() + 1; - Q_ASSERT(entry > 0); + int entry = (visualIndex(desel) + (header()?1:0))*desel.model()->columnCount()+desel.column(); + Q_ASSERT(entry >= 0); QAccessibleEvent event(this, QAccessible::SelectionRemove); event.setChild(entry); QAccessible::updateAccessibility(&event); diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp index 4922e2e778..9d3c5f8616 100644 --- a/src/widgets/kernel/qapplication.cpp +++ b/src/widgets/kernel/qapplication.cpp @@ -41,7 +41,6 @@ #include "qplatformdefs.h" #include "qabstracteventdispatcher.h" -#include "qaccessible.h" #include "qapplication.h" #include "qclipboard.h" #include "qcursor.h" @@ -2662,9 +2661,6 @@ int QApplication::startDragDistance() */ int QApplication::exec() { -#ifndef QT_NO_ACCESSIBILITY - QAccessible::setRootObject(qApp); -#endif return QGuiApplication::exec(); } diff --git a/src/widgets/kernel/qapplication.h b/src/widgets/kernel/qapplication.h index 8a7cb24539..5800ca48b0 100644 --- a/src/widgets/kernel/qapplication.h +++ b/src/widgets/kernel/qapplication.h @@ -50,6 +50,9 @@ #ifdef QT_INCLUDE_COMPAT # include <QtWidgets/qdesktopwidget.h> #endif +#ifdef Q_NO_USING_KEYWORD +#include <QtGui/qpalette.h> +#endif #include <QtGui/qguiapplication.h> QT_BEGIN_HEADER diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index 232524bbb2..38d3198f2f 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -5474,18 +5474,6 @@ void QWidget::unsetLocale() d->resolveLocale(); } -static QString constructWindowTitleFromFilePath(const QString &filePath) -{ - QFileInfo fi(filePath); - QString windowTitle = fi.fileName() + QLatin1String("[*]"); -#ifndef Q_WS_MAC - QString appName = QApplication::applicationName(); - if (!appName.isEmpty()) - windowTitle += QLatin1Char(' ') + QChar(0x2014) + QLatin1Char(' ') + appName; -#endif - return windowTitle; -} - /*! \property QWidget::windowTitle \brief the window title (caption) @@ -5502,6 +5490,11 @@ static QString constructWindowTitleFromFilePath(const QString &filePath) windowModified property is false (the default), the placeholder is simply removed. + On some desktop platforms (including Windows and Unix), the application name + (from QGuiApplication::applicationDisplayName) is added at the end of the + window title, if set. This is done by the QPA plugin, so it is shown to the + user, but isn't part of the \l windowTitle string. + \sa windowIcon, windowIconText, windowModified, windowFilePath */ QString QWidget::windowTitle() const @@ -5511,7 +5504,7 @@ QString QWidget::windowTitle() const if (!d->extra->topextra->caption.isEmpty()) return d->extra->topextra->caption; if (!d->extra->topextra->filePath.isEmpty()) - return constructWindowTitleFromFilePath(d->extra->topextra->filePath); + return QFileInfo(d->extra->topextra->filePath).fileName() + QLatin1String("[*]"); } return QString(); } @@ -5683,24 +5676,8 @@ QString QWidget::windowIconText() const This property only makes sense for windows. It associates a file path with a window. If you set the file path, but have not set the window title, Qt - sets the window title to contain a string created using the following - components. - - On Mac OS X: - - \list - \li The file name of the specified path, obtained using QFileInfo::fileName(). - \endlist - - On Windows and X11: - - \list - \li The file name of the specified path, obtained using QFileInfo::fileName(). - \li An optional \c{*} character, if the \l windowModified property is set. - \li The \c{0x2014} unicode character, padded either side by spaces. - \li The application name, obtained from the application's - \l{QCoreApplication::}{applicationName} property. - \endlist + sets the window title to the file name of the specified path, obtained using + QFileInfo::fileName(). If the window title is set at any point, then the window title takes precedence and will be shown instead of the file path string. @@ -10266,6 +10243,7 @@ void QWidget::setWindowOpacity(qreal opacity) QTLWExtra *extra = d->topData(); extra->opacity = uint(opacity * 255); setAttribute(Qt::WA_WState_WindowOpacitySet); + d->setWindowOpacity_sys(opacity); if (!testAttribute(Qt::WA_WState_Created)) return; @@ -10280,8 +10258,6 @@ void QWidget::setWindowOpacity(qreal opacity) return; } #endif - - d->setWindowOpacity_sys(opacity); } /*! diff --git a/src/widgets/widgets/qmenu.cpp b/src/widgets/widgets/qmenu.cpp index 4d431868ac..17f9ca7911 100644 --- a/src/widgets/widgets/qmenu.cpp +++ b/src/widgets/widgets/qmenu.cpp @@ -1856,7 +1856,7 @@ void QMenu::popup(const QPoint &p, QAction *atAction) QPoint mouse = QCursor::pos(); d->mousePopupPos = mouse; - const bool snapToMouse = (QRect(p.x() - 3, p.y() - 3, 6, 6).contains(mouse)); + const bool snapToMouse = !d->causedPopup.widget && (QRect(p.x() - 3, p.y() - 3, 6, 6).contains(mouse)); const QSize menuSize(sizeHint()); if (adjustToDesktop) { diff --git a/src/widgets/widgets/qtextedit.cpp b/src/widgets/widgets/qtextedit.cpp index 9f7d66b344..70dcc5b506 100644 --- a/src/widgets/widgets/qtextedit.cpp +++ b/src/widgets/widgets/qtextedit.cpp @@ -53,6 +53,9 @@ #include <qmenu.h> #include <qstyle.h> #include <qtimer.h> +#ifndef QT_NO_ACCESSIBILITY +#include <qaccessible.h> +#endif #include "private/qtextdocumentlayout_p.h" #include "qtextdocument.h" #include "private/qtextdocument_p.h" @@ -154,7 +157,7 @@ void QTextEditPrivate::init(const QString &html) QObject::connect(control, SIGNAL(redoAvailable(bool)), q, SIGNAL(redoAvailable(bool))); QObject::connect(control, SIGNAL(copyAvailable(bool)), q, SIGNAL(copyAvailable(bool))); QObject::connect(control, SIGNAL(selectionChanged()), q, SIGNAL(selectionChanged())); - QObject::connect(control, SIGNAL(cursorPositionChanged()), q, SIGNAL(cursorPositionChanged())); + QObject::connect(control, SIGNAL(cursorPositionChanged()), q, SLOT(_q_cursorPositionChanged())); QObject::connect(control, SIGNAL(textChanged()), q, SLOT(updateMicroFocus())); @@ -206,6 +209,16 @@ void QTextEditPrivate::_q_repaintContents(const QRectF &contentsRect) viewport->update(r); } +void QTextEditPrivate::_q_cursorPositionChanged() +{ + Q_Q(QTextEdit); + emit q->cursorPositionChanged(); +#ifndef QT_NO_ACCESSIBILITY + QAccessibleTextCursorEvent event(q, q->textCursor().position()); + QAccessible::updateAccessibility(&event); +#endif +} + void QTextEditPrivate::pageUpDown(QTextCursor::MoveOperation op, QTextCursor::MoveMode moveMode) { QTextCursor cursor = control->textCursor(); diff --git a/src/widgets/widgets/qtextedit.h b/src/widgets/widgets/qtextedit.h index 178aa7b907..5df44da4cf 100644 --- a/src/widgets/widgets/qtextedit.h +++ b/src/widgets/widgets/qtextedit.h @@ -304,6 +304,7 @@ private: Q_PRIVATE_SLOT(d_func(), void _q_currentCharFormatChanged(const QTextCharFormat &)) Q_PRIVATE_SLOT(d_func(), void _q_adjustScrollbars()) Q_PRIVATE_SLOT(d_func(), void _q_ensureVisible(const QRectF &)) + Q_PRIVATE_SLOT(d_func(), void _q_cursorPositionChanged()) friend class QTextEditControl; friend class QTextDocument; friend class QWidgetTextControl; diff --git a/src/widgets/widgets/qtextedit_p.h b/src/widgets/widgets/qtextedit_p.h index d2dd81c13b..7038f16205 100644 --- a/src/widgets/widgets/qtextedit_p.h +++ b/src/widgets/widgets/qtextedit_p.h @@ -99,6 +99,7 @@ public: { control->processEvent(e, QPointF(horizontalOffset(), verticalOffset()), viewport); } void _q_currentCharFormatChanged(const QTextCharFormat &format); + void _q_cursorPositionChanged(); void updateDefaultTextOption(); diff --git a/src/winmain/winmain.pro b/src/winmain/winmain.pro index e5da5bd97f..32eae0b9fe 100644 --- a/src/winmain/winmain.pro +++ b/src/winmain/winmain.pro @@ -5,7 +5,7 @@ TEMPLATE = lib TARGET = qtmain DESTDIR = $$QT.core.libs -CONFIG += static warn_on depend_includepath +CONFIG += static QT = core contains(QT_CONFIG, build_all):CONFIG += build_all |