summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/angle/src/common/common.pri12
-rw-r--r--src/angle/src/config.pri19
-rw-r--r--src/corelib/animation/qpropertyanimation.cpp7
-rw-r--r--src/gui/accessible/qaccessible.h2
-rw-r--r--src/gui/image/qimage.cpp5
-rw-r--r--src/gui/kernel/qguiapplication.cpp2
-rw-r--r--src/gui/opengl/qopenglframebufferobject.cpp36
-rw-r--r--src/gui/text/qfont.cpp2
-rw-r--r--src/gui/text/qtextcursor.cpp4
-rw-r--r--src/network/access/qnetworkreply.cpp9
-rw-r--r--src/network/ssl/qsslsocket.cpp10
-rw-r--r--src/opengl/qglframebufferobject.cpp4
-rw-r--r--src/plugins/platforms/cocoa/qnsview.mm9
-rw-r--r--src/plugins/platforms/windows/qwindowsglcontext.cpp21
-rw-r--r--src/plugins/platforms/xcb/qglxintegration.cpp25
-rw-r--r--src/sql/drivers/db2/qsql_db2.cpp2
-rw-r--r--src/sql/drivers/psql/qsql_psql.cpp27
-rw-r--r--src/sql/kernel/qsqlresult.cpp101
-rw-r--r--src/sql/kernel/qsqlresult_p.h10
-rw-r--r--src/tools/qdoc/config.h1
-rw-r--r--src/tools/qdoc/cppcodemarker.cpp10
-rw-r--r--src/tools/qdoc/cppcodeparser.cpp9
-rw-r--r--src/tools/qdoc/ditaxmlgenerator.cpp2
-rw-r--r--src/tools/qdoc/htmlgenerator.cpp62
-rw-r--r--src/tools/qdoc/htmlgenerator.h9
-rw-r--r--src/tools/qdoc/node.cpp2
-rw-r--r--src/tools/qdoc/node.h12
-rw-r--r--src/tools/qdoc/qdoc.pro2
-rw-r--r--src/tools/qdoc/qdocdatabase.cpp30
-rw-r--r--src/tools/qdoc/qdocdatabase.h1
-rw-r--r--src/tools/qdoc/qmlvisitor.cpp15
-rw-r--r--src/tools/qdoc/tree.cpp4
-rw-r--r--src/tools/tools.pro2
-rw-r--r--src/widgets/dialogs/qfiledialog.cpp7
-rw-r--r--src/widgets/dialogs/qfiledialog.h1
-rw-r--r--src/widgets/dialogs/qfiledialog_p.h1
-rw-r--r--src/widgets/doc/qtwidgets.qdocconf9
-rw-r--r--src/widgets/graphicsview/qgraphicsitem.cpp2
-rw-r--r--src/widgets/kernel/qwidget.cpp10
-rw-r--r--src/widgets/styles/qmacstyle_mac.mm3
-rw-r--r--src/widgets/styles/qstylehelper.cpp12
-rw-r--r--src/widgets/styles/qstylehelper_p.h2
-rw-r--r--src/widgets/util/qsystemtrayicon_qpa.cpp2
43 files changed, 329 insertions, 188 deletions
diff --git a/src/angle/src/common/common.pri b/src/angle/src/common/common.pri
index 8806c03c95..c7d2a2d5ae 100644
--- a/src/angle/src/common/common.pri
+++ b/src/angle/src/common/common.pri
@@ -15,17 +15,17 @@ win32-msvc2012 {
error("Cannot determine DirectX SDK location. Please set DXSDK_DIR environment variable.")
}
- DXINC_DIR = $$quote($${DX_DIR}Include)
+ DXINC_DIR = $${DX_DIR}Include
contains(QT_ARCH, x86_64) {
- DXLIB_DIR = $$quote($${DX_DIR}Lib\\x64)
+ DXLIB_DIR = $${DX_DIR}Lib\\x64
} else {
- DXLIB_DIR = $$quote($${DX_DIR}Lib\\x86)
+ DXLIB_DIR = $${DX_DIR}Lib\\x86
}
equals(QMAKE_TARGET.arch, x86_64) {
- FXC = "\"$${DX_DIR}Utilities\\bin\\x64\\fxc.exe\""
+ FXC = \"$${DX_DIR}Utilities\\bin\\x64\\fxc.exe\"
} else {
- FXC = "\"$${DX_DIR}Utilities\\bin\\x86\\fxc.exe\""
+ FXC = \"$${DX_DIR}Utilities\\bin\\x86\\fxc.exe\"
}
msvc {
@@ -36,7 +36,7 @@ win32-msvc2012 {
# Similarly we want the MinGW linker to use the import libraries shipped with the compiler
# instead of those from the SDK which cause a crash on startup.
- LIBS += -L$$DXLIB_DIR
+ LIBS += -L\"$$DXLIB_DIR\"
}
}
diff --git a/src/angle/src/config.pri b/src/angle/src/config.pri
index 4e52358205..73fbc2e13b 100644
--- a/src/angle/src/config.pri
+++ b/src/angle/src/config.pri
@@ -3,7 +3,7 @@
ANGLE_DIR = $$(ANGLE_DIR)
isEmpty(ANGLE_DIR) {
- ANGLE_DIR = $$PWD/../../3rdparty/angle
+ ANGLE_DIR = $$absolute_path(../../3rdparty/angle)
} else {
!build_pass:message("Using external ANGLE from $$ANGLE_DIR")
}
@@ -12,20 +12,19 @@ isEmpty(ANGLE_DIR) {
error("$$ANGLE_DIR does not contain ANGLE")
}
-win32 {
- GNUTOOLS_DIR=$$PWD/../../../../gnuwin32/bin
- exists($$GNUTOOLS_DIR/gperf.exe) {
- # Escape closing parens when expanding the variable, otherwise cmd confuses itself.
- GNUTOOLS = "(set PATH=$$replace(GNUTOOLS_DIR, [/\\\\], $${QMAKE_DIR_SEP});%PATH:)=^)%)"
+equals(QMAKE_HOST.os, Windows) {
+ gnutools.value = $$absolute_path(../../../../gnuwin32/bin)
+ exists($$gnutools.value/gperf.exe) {
+ gnutools.name = PATH
+ gnutools.CONFIG = prepend
}
}
defineReplace(addGnuPath) {
- unset(gnuPath)
gnuPath = $$1
- !isEmpty(gnuPath):!isEmpty(GNUTOOLS) {
- eval(gnuPath = $${GNUTOOLS} && $$gnuPath)
- silent: eval(gnuPath = @echo generating sources from ${QMAKE_FILE_IN} && $$val_escape($$gnuPath))
+ !isEmpty(gnuPath):!isEmpty(gnutools.name) {
+ qtAddToolEnv(gnuPath, gnutools)
+ silent: gnuPath = @echo generating sources from ${QMAKE_FILE_IN} && $$gnuPath
}
return($$gnuPath)
}
diff --git a/src/corelib/animation/qpropertyanimation.cpp b/src/corelib/animation/qpropertyanimation.cpp
index dcf779a5f1..9869d7e500 100644
--- a/src/corelib/animation/qpropertyanimation.cpp
+++ b/src/corelib/animation/qpropertyanimation.cpp
@@ -136,8 +136,11 @@ void QPropertyAnimationPrivate::updateProperty(const QVariant &newValue)
if (newValue.userType() == propertyType) {
//no conversion is needed, we directly call the QMetaObject::metacall
- void *data = const_cast<void*>(newValue.constData());
- QMetaObject::metacall(targetValue, QMetaObject::WriteProperty, propertyIndex, &data);
+ //check QMetaProperty::write for an explanation of these
+ int status = -1;
+ int flags = 0;
+ void *argv[] = { const_cast<void *>(newValue.constData()), const_cast<QVariant *>(&newValue), &status, &flags };
+ QMetaObject::metacall(targetValue, QMetaObject::WriteProperty, propertyIndex, argv);
} else {
targetValue->setProperty(propertyName.constData(), newValue);
}
diff --git a/src/gui/accessible/qaccessible.h b/src/gui/accessible/qaccessible.h
index 016e9b6d07..96fc7c031b 100644
--- a/src/gui/accessible/qaccessible.h
+++ b/src/gui/accessible/qaccessible.h
@@ -39,6 +39,7 @@
**
****************************************************************************/
+#ifndef QT_NO_ACCESSIBILITY
#ifndef QACCESSIBLE_H
#define QACCESSIBLE_H
@@ -677,3 +678,4 @@ inline void QAccessible::updateAccessibility(QObject *object, int child, Event r
QT_END_NAMESPACE
#endif // QACCESSIBLE_H
+#endif //!QT_NO_ACCESSIBILITY
diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp
index 975ef54d6b..481cb37c8c 100644
--- a/src/gui/image/qimage.cpp
+++ b/src/gui/image/qimage.cpp
@@ -4944,7 +4944,10 @@ QPaintEngine *QImage::paintEngine() const
if (!d->paintEngine) {
QPaintDevice *paintDevice = const_cast<QImage *>(this);
- QPaintEngine *paintEngine = QGuiApplicationPrivate::platformIntegration()->createImagePaintEngine(paintDevice);
+ QPaintEngine *paintEngine = 0;
+ QPlatformIntegration *platformIntegration = QGuiApplicationPrivate::platformIntegration();
+ if (platformIntegration)
+ paintEngine = platformIntegration->createImagePaintEngine(paintDevice);
d->paintEngine = paintEngine ? paintEngine : new QRasterPaintEngine(paintDevice);
}
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp
index 3a8428b332..89b3b9ab89 100644
--- a/src/gui/kernel/qguiapplication.cpp
+++ b/src/gui/kernel/qguiapplication.cpp
@@ -60,7 +60,9 @@
#include <QtCore/private/qthread_p.h>
#include <QtCore/qdir.h>
#include <QtDebug>
+#ifndef QT_NO_ACCESSIBILITY
#include "qaccessible.h"
+#endif
#include <qpalette.h>
#include <qscreen.h>
#include "qsessionmanager.h"
diff --git a/src/gui/opengl/qopenglframebufferobject.cpp b/src/gui/opengl/qopenglframebufferobject.cpp
index 8e92ab5d58..8d6b05d0b4 100644
--- a/src/gui/opengl/qopenglframebufferobject.cpp
+++ b/src/gui/opengl/qopenglframebufferobject.cpp
@@ -686,25 +686,24 @@ void QOpenGLFramebufferObjectPrivate::initAttachments(QOpenGLContext *ctx, QOpen
\ingroup painting-3D
The QOpenGLFramebufferObject class encapsulates an OpenGL framebuffer
- object, defined by the \c{GL_EXT_framebuffer_object} extension. In
- addition it provides a rendering surface that can be painted on
- with a QPainter, rendered to using native OpenGL calls, or both. This
- surface can be bound and used as a regular texture in your own OpenGL
- drawing code. By default, the QOpenGLFramebufferObject class
- generates a 2D OpenGL texture (using the \c{GL_TEXTURE_2D} target),
- which is used as the internal rendering target.
+ object, defined by the \c{GL_EXT_framebuffer_object} extension. It provides
+ a rendering surface that can be painted on with a QPainter with the help of
+ QOpenGLPaintDevice, or rendered to using native OpenGL calls. This surface
+ can be bound and used as a regular texture in your own OpenGL drawing code.
+ By default, the QOpenGLFramebufferObject class generates a 2D OpenGL
+ texture (using the \c{GL_TEXTURE_2D} target), which is used as the internal
+ rendering target.
\b{It is important to have a current OpenGL context when creating a
QOpenGLFramebufferObject, otherwise initialization will fail.}
- When using a QPainter to paint to a QOpenGLFramebufferObject you should take
- care that the QOpenGLFramebufferObject is created with the CombinedDepthStencil
- attachment for QPainter to be able to render correctly.
- Note that you need to create a QOpenGLFramebufferObject with more than one
- sample per pixel for primitives to be antialiased when drawing using a
- QPainter. To create a multisample framebuffer object you should use one of
- the constructors that take a QOpenGLFramebufferObject parameter, and set the
- QOpenGLFramebufferObject::samples() property to a non-zero value.
+ Create the QOpenGLFrameBufferObject instance with the CombinedDepthStencil
+ attachment if you want QPainter to render correctly. Note that you need to
+ create a QOpenGLFramebufferObject with more than one sample per pixel for
+ primitives to be antialiased when drawing using a QPainter. To create a
+ multisample framebuffer object you should use one of the constructors that
+ take a QOpenGLFramebufferObjectFormat parameter, and set the
+ QOpenGLFramebufferObjectFormat::samples() property to a non-zero value.
For multisample framebuffer objects a color render buffer is created,
otherwise a texture with the specified texture target is created.
@@ -716,11 +715,8 @@ void QOpenGLFramebufferObjectPrivate::initAttachments(QOpenGLContext *ctx, QOpen
as a texture, you first need to copy from it to a regular framebuffer
object using QOpenGLContext::blitFramebuffer().
- \section1 Threading
-
- As of Qt 4.8, it's possible to draw into a QOpenGLFramebufferObject
- using a QPainter in a separate thread. Note that OpenGL 2.0 or
- OpenGL ES 2.0 is required for this to work.
+ It is possible to draw into a QOpenGLFramebufferObject using QPainter and
+ QOpenGLPaintDevice in a separate thread.
*/
diff --git a/src/gui/text/qfont.cpp b/src/gui/text/qfont.cpp
index 87ca5e4cfe..279d165322 100644
--- a/src/gui/text/qfont.cpp
+++ b/src/gui/text/qfont.cpp
@@ -671,7 +671,7 @@ void QFontPrivate::detachButKeepEngineData(QFont *font)
\sa QGuiApplication::setFont(), QGuiApplication::font()
*/
QFont::QFont()
- : d(QGuiApplication::font().d.data()), resolve_mask(0)
+ : d(QGuiApplicationPrivate::instance() ? QGuiApplication::font().d.data() : new QFontPrivate()), resolve_mask(0)
{
}
diff --git a/src/gui/text/qtextcursor.cpp b/src/gui/text/qtextcursor.cpp
index 182b9ac7fd..39fca795c9 100644
--- a/src/gui/text/qtextcursor.cpp
+++ b/src/gui/text/qtextcursor.cpp
@@ -1283,7 +1283,7 @@ bool QTextCursor::movePosition(MoveOperation op, MoveMode mode, int n)
Returns true if the cursor does visual navigation; otherwise
returns false.
- Visual navigation means skipping over hidden text pragraphs. The
+ Visual navigation means skipping over hidden text paragraphs. The
default is false.
\sa setVisualNavigation(), movePosition()
@@ -1298,7 +1298,7 @@ bool QTextCursor::visualNavigation() const
Sets visual navigation to \a b.
- Visual navigation means skipping over hidden text pragraphs. The
+ Visual navigation means skipping over hidden text paragraphs. The
default is false.
\sa visualNavigation(), movePosition()
diff --git a/src/network/access/qnetworkreply.cpp b/src/network/access/qnetworkreply.cpp
index 669725b016..fd3b7760cb 100644
--- a/src/network/access/qnetworkreply.cpp
+++ b/src/network/access/qnetworkreply.cpp
@@ -680,8 +680,13 @@ void QNetworkReply::ignoreSslErrorsImplementation(const QList<QSslError> &)
connection will be ignored, including certificate validation
errors.
- Note that calling this function without restraint may pose a
- security risk for your application. Use it with care.
+ \warning Be sure to always let the user inspect the errors
+ reported by the sslErrors() signal, and only call this method
+ upon confirmation from the user that proceeding is ok.
+ If there are unexpected errors, the reply should be aborted.
+ Calling this method without inspecting the actual errors will
+ most likely pose a security risk for your application. Use it
+ with great care!
This function can be called from the slot connected to the
sslErrors() signal, which indicates which errors were
diff --git a/src/network/ssl/qsslsocket.cpp b/src/network/ssl/qsslsocket.cpp
index 712ba7aa79..c86234a5ac 100644
--- a/src/network/ssl/qsslsocket.cpp
+++ b/src/network/ssl/qsslsocket.cpp
@@ -1714,9 +1714,13 @@ void QSslSocket::startServerEncryption()
will not emit the sslErrors() signal, and it is unnecessary to
call this function.
- Ignoring errors that occur during an SSL handshake should be done
- with caution. A fundamental characteristic of secure connections
- is that they should be established with an error free handshake.
+ \warning Be sure to always let the user inspect the errors
+ reported by the sslErrors() signal, and only call this method
+ upon confirmation from the user that proceeding is ok.
+ If there are unexpected errors, the connection should be aborted.
+ Calling this method without inspecting the actual errors will
+ most likely pose a security risk for your application. Use it
+ with great care!
\sa sslErrors()
*/
diff --git a/src/opengl/qglframebufferobject.cpp b/src/opengl/qglframebufferobject.cpp
index d1b3f355c9..15880108f3 100644
--- a/src/opengl/qglframebufferobject.cpp
+++ b/src/opengl/qglframebufferobject.cpp
@@ -752,8 +752,8 @@ void QGLFramebufferObjectPrivate::init(QGLFramebufferObject *q, const QSize &sz,
Note that you need to create a QGLFramebufferObject with more than one
sample per pixel for primitives to be antialiased when drawing using a
QPainter. To create a multisample framebuffer object you should use one of
- the constructors that take a QGLFramebufferObject parameter, and set the
- QGLFramebufferObject::samples() property to a non-zero value.
+ the constructors that take a QGLFramebufferObjectFormat parameter, and set
+ the QGLFramebufferObjectFormat::samples() property to a non-zero value.
When painting to a QGLFramebufferObject using QPainter, the state of
the current GL context will be altered by the paint engine to reflect
diff --git a/src/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm
index c23d924993..cdbaa235e4 100644
--- a/src/plugins/platforms/cocoa/qnsview.mm
+++ b/src/plugins/platforms/cocoa/qnsview.mm
@@ -667,9 +667,8 @@ static QTouchDevice *touchDevice = 0;
}
#endif
-
- NSPoint windowPoint = [self convertPoint: [theEvent locationInWindow] fromView: nil];
- QPoint qt_windowPoint(windowPoint.x, windowPoint.y);
+ QPoint qt_windowPoint, qt_screenPoint;
+ [self convertFromEvent:theEvent toWindowPoint:&qt_windowPoint andScreenPoint:&qt_screenPoint];
NSTimeInterval timestamp = [theEvent timestamp];
ulong qt_timestamp = timestamp * 1000;
@@ -687,7 +686,7 @@ static QTouchDevice *touchDevice = 0;
currentWheelModifiers = [self convertKeyModifiers:[theEvent modifierFlags]];
}
- QWindowSystemInterface::handleWheelEvent(m_window, qt_timestamp, qt_windowPoint, qt_windowPoint, pixelDelta, angleDelta, currentWheelModifiers);
+ QWindowSystemInterface::handleWheelEvent(m_window, qt_timestamp, qt_windowPoint, qt_screenPoint, pixelDelta, angleDelta, currentWheelModifiers);
if (phase == NSEventPhaseEnded || phase == NSEventPhaseCancelled) {
currentWheelModifiers = Qt::NoModifier;
@@ -695,7 +694,7 @@ static QTouchDevice *touchDevice = 0;
} else
#endif
{
- QWindowSystemInterface::handleWheelEvent(m_window, qt_timestamp, qt_windowPoint, qt_windowPoint, pixelDelta, angleDelta,
+ QWindowSystemInterface::handleWheelEvent(m_window, qt_timestamp, qt_windowPoint, qt_screenPoint, pixelDelta, angleDelta,
[self convertKeyModifiers:[theEvent modifierFlags]]);
}
}
diff --git a/src/plugins/platforms/windows/qwindowsglcontext.cpp b/src/plugins/platforms/windows/qwindowsglcontext.cpp
index 0ef9f931c2..081b42ce65 100644
--- a/src/plugins/platforms/windows/qwindowsglcontext.cpp
+++ b/src/plugins/platforms/windows/qwindowsglcontext.cpp
@@ -136,6 +136,10 @@
#define GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT 0x0001
#endif
+#ifndef GL_CONTEXT_FLAG_DEBUG_BIT
+#define GL_CONTEXT_FLAG_DEBUG_BIT 0x00000002
+#endif
+
QT_BEGIN_NAMESPACE
template <class MaskType, class FlagType> inline bool testFlag(MaskType mask, FlagType flag)
@@ -696,34 +700,27 @@ QWindowsOpenGLContextFormat QWindowsOpenGLContextFormat::current()
result.version = (version.mid(0, majorDot).toInt() << 8)
+ version.mid(majorDot + 1, minorDot - majorDot - 1).toInt();
}
+ result.profile = QSurfaceFormat::NoProfile;
if (result.version < 0x0300) {
- result.profile = QSurfaceFormat::NoProfile;
result.options |= QSurfaceFormat::DeprecatedFunctions;
return result;
}
// v3 onwards
GLint value = 0;
glGetIntegerv(GL_CONTEXT_FLAGS, &value);
- if (value & GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT)
+ if (!(value & GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT))
result.options |= QSurfaceFormat::DeprecatedFunctions;
- if (value & WGL_CONTEXT_DEBUG_BIT_ARB)
+ if (value & GL_CONTEXT_FLAG_DEBUG_BIT)
result.options |= QSurfaceFormat::DebugContext;
if (result.version < 0x0302)
return result;
// v3.2 onwards: Profiles
value = 0;
glGetIntegerv(GL_CONTEXT_PROFILE_MASK, &value);
- switch (value) {
- case WGL_CONTEXT_CORE_PROFILE_BIT_ARB:
+ if (value & GL_CONTEXT_CORE_PROFILE_BIT)
result.profile = QSurfaceFormat::CoreProfile;
- break;
- case WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB:
+ else if (value & GL_CONTEXT_COMPATIBILITY_PROFILE_BIT)
result.profile = QSurfaceFormat::CompatibilityProfile;
- break;
- default:
- result.profile = QSurfaceFormat::NoProfile;
- break;
- }
return result;
}
diff --git a/src/plugins/platforms/xcb/qglxintegration.cpp b/src/plugins/platforms/xcb/qglxintegration.cpp
index 5e2731430d..854f7bcd17 100644
--- a/src/plugins/platforms/xcb/qglxintegration.cpp
+++ b/src/plugins/platforms/xcb/qglxintegration.cpp
@@ -75,6 +75,10 @@ typedef GLXContext (*glXCreateContextAttribsARBProc)(Display*, GLXFBConfig, GLXC
#define GLX_CONTEXT_PROFILE_MASK_ARB 0x9126
#endif
+#ifndef GL_CONTEXT_FLAG_DEBUG_BIT
+#define GL_CONTEXT_FLAG_DEBUG_BIT 0x00000002
+#endif
+
static Window createDummyWindow(QXcbScreen *screen, XVisualInfo *visualInfo)
{
Colormap cmap = XCreateColormap(DISPLAY_FROM_XCB(screen), screen->root(), visualInfo->visual, AllocNone);
@@ -169,6 +173,8 @@ static void updateFormatFromContext(QSurfaceFormat &format)
format.setMinorVersion(minor);
}
+ format.setProfile(QSurfaceFormat::NoProfile);
+
const int version = (major << 8) + minor;
if (version < 0x0300) {
format.setProfile(QSurfaceFormat::NoProfile);
@@ -180,9 +186,9 @@ static void updateFormatFromContext(QSurfaceFormat &format)
// a debug context
GLint value = 0;
glGetIntegerv(GL_CONTEXT_FLAGS, &value);
- if (value & ~GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT)
+ if (!(value & GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT))
format.setOption(QSurfaceFormat::DeprecatedFunctions);
- if (value & GLX_CONTEXT_DEBUG_BIT_ARB)
+ if (value & GL_CONTEXT_FLAG_DEBUG_BIT)
format.setOption(QSurfaceFormat::DebugContext);
if (version < 0x0302)
return;
@@ -190,17 +196,11 @@ static void updateFormatFromContext(QSurfaceFormat &format)
// Version 3.2 and newer have a profile
value = 0;
glGetIntegerv(GL_CONTEXT_PROFILE_MASK, &value);
- switch (value) {
- case GLX_CONTEXT_CORE_PROFILE_BIT_ARB:
+
+ if (value & GL_CONTEXT_CORE_PROFILE_BIT)
format.setProfile(QSurfaceFormat::CoreProfile);
- break;
- case GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB:
+ else if (value & GL_CONTEXT_COMPATIBILITY_PROFILE_BIT)
format.setProfile(QSurfaceFormat::CompatibilityProfile);
- break;
- default:
- format.setProfile(QSurfaceFormat::NoProfile);
- break;
- }
}
/*!
@@ -287,6 +287,7 @@ QGLXContext::QGLXContext(QXcbScreen *screen, const QSurfaceFormat &format, QPlat
glXCreateContextAttribsARB = (glXCreateContextAttribsARBProc) glXGetProcAddress((const GLubyte*)"glXCreateContextAttribsARB");
QList<QByteArray> glxExt = QByteArray(glXQueryExtensionsString(DISPLAY_FROM_XCB(m_screen), m_screen->screenNumber())).split(' ');
+ bool supportsProfiles = glxExt.contains("GLX_ARB_create_context_profile");
// Use glXCreateContextAttribsARB if is available
if (glxExt.contains("GLX_ARB_create_context") && glXCreateContextAttribsARB != 0) {
@@ -306,7 +307,7 @@ QGLXContext::QGLXContext(QXcbScreen *screen, const QSurfaceFormat &format, QPlat
<< GLX_CONTEXT_MINOR_VERSION_ARB << minorVersion;
// If asking for OpenGL 3.2 or newer we should also specify a profile
- if (m_format.majorVersion() > 3 || (m_format.majorVersion() == 3 && m_format.minorVersion() > 1)) {
+ if (supportsProfiles && (m_format.majorVersion() > 3 || (m_format.majorVersion() == 3 && m_format.minorVersion() > 1))) {
if (m_format.profile() == QSurfaceFormat::CoreProfile)
contextAttributes << GLX_CONTEXT_PROFILE_MASK_ARB << GLX_CONTEXT_CORE_PROFILE_BIT_ARB;
else
diff --git a/src/sql/drivers/db2/qsql_db2.cpp b/src/sql/drivers/db2/qsql_db2.cpp
index 537f77a8a3..9406861d4c 100644
--- a/src/sql/drivers/db2/qsql_db2.cpp
+++ b/src/sql/drivers/db2/qsql_db2.cpp
@@ -1030,7 +1030,7 @@ QVariant QDB2Result::data(int field)
v = new QVariant(qGetIntData(d->hStmt, field, isNull));
break;
case QSql::LowPrecisionInt64:
- v = new QVariant(qGetBigIntData(d->hStmt, field, isNull));
+ v = new QVariant((qint64) qGetBigIntData(d->hStmt, field, isNull));
break;
case QSql::LowPrecisionDouble:
v = new QVariant(qGetDoubleData(d->hStmt, field, isNull));
diff --git a/src/sql/drivers/psql/qsql_psql.cpp b/src/sql/drivers/psql/qsql_psql.cpp
index 1d96e9f93b..0eadceb1d1 100644
--- a/src/sql/drivers/psql/qsql_psql.cpp
+++ b/src/sql/drivers/psql/qsql_psql.cpp
@@ -53,6 +53,7 @@
#include <qsocketnotifier.h>
#include <qstringlist.h>
#include <qmutex.h>
+#include <QtSql/private/qsqlresult_p.h>
#include <libpq-fe.h>
#include <pg_config.h>
@@ -183,6 +184,7 @@ class QPSQLResultPrivate
{
public:
QPSQLResultPrivate(QPSQLResult *qq): q(qq), driver(0), result(0), currentSize(-1), preparedQueriesEnabled(false) {}
+ static QString fieldSerial(int i) { return QLatin1Char('$') + QString::number(i + 1); }
QPSQLResult *q;
const QPSQLDriverPrivate *driver;
@@ -515,29 +517,6 @@ void QPSQLResult::virtual_hook(int id, void *data)
QSqlResult::virtual_hook(id, data);
}
-static QString qReplacePlaceholderMarkers(const QString &query)
-{
- const int originalLength = query.length();
- bool inQuote = false;
- int markerIdx = 0;
- QString result;
- result.reserve(originalLength + 23);
- for (int i = 0; i < originalLength; ++i) {
- const QChar ch = query.at(i);
- if (ch == QLatin1Char('?') && !inQuote) {
- result += QLatin1Char('$');
- result += QString::number(++markerIdx);
- } else {
- if (ch == QLatin1Char('\''))
- inQuote = !inQuote;
- result += ch;
- }
- }
-
- result.squeeze();
- return result;
-}
-
static QString qCreateParamString(const QVector<QVariant> boundValues, const QSqlDriver *driver)
{
if (boundValues.isEmpty())
@@ -581,7 +560,7 @@ bool QPSQLResult::prepare(const QString &query)
qDeallocatePreparedStmt(d);
const QString stmtId = qMakePreparedStmtId();
- const QString stmt = QString::fromLatin1("PREPARE %1 AS ").arg(stmtId).append(qReplacePlaceholderMarkers(query));
+ const QString stmt = QString::fromLatin1("PREPARE %1 AS ").arg(stmtId).append(QSqlResultPrivate::positionalToNamedBinding(query, QPSQLResultPrivate::fieldSerial));
PGresult *result = d->driver->exec(stmt);
diff --git a/src/sql/kernel/qsqlresult.cpp b/src/sql/kernel/qsqlresult.cpp
index b3e7ad5b38..ea972abf50 100644
--- a/src/sql/kernel/qsqlresult.cpp
+++ b/src/sql/kernel/qsqlresult.cpp
@@ -55,15 +55,13 @@
QT_BEGIN_NAMESPACE
-static QString qFieldSerial(int);
-
QString QSqlResultPrivate::holderAt(int index) const
{
- return holders.size() > index ? holders.at(index).holderName : qFieldSerial(index);
+ return holders.size() > index ? holders.at(index).holderName : fieldSerial(index);
}
// return a unique id for bound names
-static QString qFieldSerial(int i)
+QString QSqlResultPrivate::fieldSerial(int i)
{
ushort arr[] = { ':', 'f', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
ushort *ptr = &arr[1];
@@ -83,57 +81,90 @@ static bool qIsAlnum(QChar ch)
return u - 'a' < 26 || u - 'A' < 26 || u - '0' < 10 || u == '_';
}
-QString QSqlResultPrivate::positionalToNamedBinding()
+QString QSqlResultPrivate::positionalToNamedBinding(const QString &query, QString (fieldSerialFunc)(int idx))
{
- int n = sql.size();
+ int n = query.size();
QString result;
result.reserve(n * 5 / 4);
- bool inQuote = false;
+ QChar closingQuote;
int count = 0;
for (int i = 0; i < n; ++i) {
- QChar ch = sql.at(i);
- if (ch == QLatin1Char('?') && !inQuote) {
- result += qFieldSerial(count++);
- } else {
- if (ch == QLatin1Char('\''))
- inQuote = !inQuote;
+ QChar ch = query.at(i);
+ if (!closingQuote.isNull()) {
+ if (ch == closingQuote) {
+ if (closingQuote == QLatin1Char(']')
+ && i + 1 < n && query.at(i + 1) == closingQuote) {
+ // consume the extra character. don't close.
+ ++i;
+ result += ch;
+ } else {
+ closingQuote = QChar();
+ }
+ }
result += ch;
+ } else {
+ if (ch == QLatin1Char('?')) {
+ result += fieldSerialFunc(count++);
+ } else {
+ if (ch == QLatin1Char('\'') || ch == QLatin1Char('"') || ch == QLatin1Char('`'))
+ closingQuote = ch;
+ else if (ch == QLatin1Char('['))
+ closingQuote = QLatin1Char(']');
+ result += ch;
+ }
}
}
result.squeeze();
return result;
}
-QString QSqlResultPrivate::namedToPositionalBinding()
+QString QSqlResultPrivate::namedToPositionalBinding(const QString &query)
{
- int n = sql.size();
+ int n = query.size();
QString result;
result.reserve(n);
- bool inQuote = false;
+ QChar closingQuote;
int count = 0;
int i = 0;
while (i < n) {
- QChar ch = sql.at(i);
- if (ch == QLatin1Char(':') && !inQuote
- && (i == 0 || sql.at(i - 1) != QLatin1Char(':'))
- && (i + 1 < n && qIsAlnum(sql.at(i + 1)))) {
- int pos = i + 2;
- while (pos < n && qIsAlnum(sql.at(pos)))
- ++pos;
- QString holder(sql.mid(i, pos - i));
- indexes[holder].append(count++);
- holders.append(QHolder(holder, i));
- result += QLatin1Char('?');
- i = pos;
- } else {
- if (ch == QLatin1Char('\''))
- inQuote = !inQuote;
+ QChar ch = query.at(i);
+ if (!closingQuote.isNull()) {
+ if (ch == closingQuote) {
+ if (closingQuote == QLatin1Char(']')
+ && i + 1 < n && query.at(i + 1) == closingQuote) {
+ // consume the extra character. don't close.
+ ++i;
+ result += ch;
+ } else {
+ closingQuote = QChar();
+ }
+ }
result += ch;
++i;
+ } else {
+ if (ch == QLatin1Char(':')
+ && (i == 0 || query.at(i - 1) != QLatin1Char(':'))
+ && (i + 1 < n && qIsAlnum(query.at(i + 1)))) {
+ int pos = i + 2;
+ while (pos < n && qIsAlnum(query.at(pos)))
+ ++pos;
+ QString holder(query.mid(i, pos - i));
+ indexes[holder].append(count++);
+ holders.append(QHolder(holder, i));
+ result += QLatin1Char('?');
+ i = pos;
+ } else {
+ if (ch == QLatin1Char('\'') || ch == QLatin1Char('"') || ch == QLatin1Char('`'))
+ closingQuote = ch;
+ else if (ch == QLatin1Char('['))
+ closingQuote = QLatin1Char(']');
+ result += ch;
+ ++i;
+ }
}
}
result.squeeze();
@@ -531,10 +562,10 @@ bool QSqlResult::savePrepare(const QString& query)
return prepare(query);
// parse the query to memorize parameter location
- d->executedQuery = d->namedToPositionalBinding();
+ d->executedQuery = d->namedToPositionalBinding(query);
if (driver()->hasFeature(QSqlDriver::NamedPlaceholders))
- d->executedQuery = d->positionalToNamedBinding();
+ d->executedQuery = QSqlResultPrivate::positionalToNamedBinding(query);
return prepare(d->executedQuery);
}
@@ -551,7 +582,7 @@ bool QSqlResult::prepare(const QString& query)
d->sql = query;
if (d->holders.isEmpty()) {
// parse the query to memorize parameter location
- d->namedToPositionalBinding();
+ d->namedToPositionalBinding(query);
}
return true; // fake prepares should always succeed
}
@@ -617,7 +648,7 @@ bool QSqlResult::exec()
void QSqlResult::bindValue(int index, const QVariant& val, QSql::ParamType paramType)
{
d->binds = PositionalBinding;
- d->indexes[qFieldSerial(index)].append(index);
+ d->indexes[QSqlResultPrivate::fieldSerial(index)].append(index);
if (d->values.count() <= index)
d->values.resize(index + 1);
d->values[index] = val;
diff --git a/src/sql/kernel/qsqlresult_p.h b/src/sql/kernel/qsqlresult_p.h
index 65f9be7a05..246b914ec7 100644
--- a/src/sql/kernel/qsqlresult_p.h
+++ b/src/sql/kernel/qsqlresult_p.h
@@ -106,8 +106,14 @@ public:
clearIndex();;
}
- QString positionalToNamedBinding();
- QString namedToPositionalBinding();
+ // positionalToNamedBinding uses fieldSerial() by default, which converts to Oracle-style names,
+ // because this style is used in the API. A driver can reuse positionalToNamedBinding()
+ // internally for its own naming style by supplying its own fieldSerialFunc. We cannot make
+ // fieldSerial() virtual because it would allow a driver to impose its naming style on
+ // executedQuery when set by QSqlResult::savePrepare().
+ static QString fieldSerial(int);
+ static QString positionalToNamedBinding(const QString &query, QString (fieldSerialFunc)(int idx) = fieldSerial);
+ QString namedToPositionalBinding(const QString &query);
QString holderAt(int index) const;
QSqlResult *q;
diff --git a/src/tools/qdoc/config.h b/src/tools/qdoc/config.h
index 2c655cdf23..521f1c12b8 100644
--- a/src/tools/qdoc/config.h
+++ b/src/tools/qdoc/config.h
@@ -188,6 +188,7 @@ private:
#define CONFIG_INDEXES "indexes"
#define CONFIG_LANGUAGE "language"
#define CONFIG_MACRO "macro"
+#define CONFIG_MANIFESTMETA "manifestmeta"
#define CONFIG_NATURALLANGUAGE "naturallanguage"
#define CONFIG_NOLINKERRORS "nolinkerrors"
#define CONFIG_OBSOLETELINKS "obsoletelinks"
diff --git a/src/tools/qdoc/cppcodemarker.cpp b/src/tools/qdoc/cppcodemarker.cpp
index 0bebe0d670..c85c5c64ef 100644
--- a/src/tools/qdoc/cppcodemarker.cpp
+++ b/src/tools/qdoc/cppcodemarker.cpp
@@ -1165,8 +1165,8 @@ QList<Section> CppCodeMarker::qmlSections(const QmlClassNode* qmlClassNode, Syno
}
++c;
}
- if (qcn->qmlBase() != 0) {
- qcn = static_cast<const QmlClassNode*>(qcn->qmlBase());
+ if (qcn->qmlBaseNode() != 0) {
+ qcn = static_cast<const QmlClassNode*>(qcn->qmlBaseNode());
if (!qcn->isAbstract())
qcn = 0;
}
@@ -1241,8 +1241,8 @@ QList<Section> CppCodeMarker::qmlSections(const QmlClassNode* qmlClassNode, Syno
}
++c;
}
- if (qcn->qmlBase() != 0) {
- qcn = static_cast<const QmlClassNode*>(qcn->qmlBase());
+ if (qcn->qmlBaseNode() != 0) {
+ qcn = static_cast<const QmlClassNode*>(qcn->qmlBaseNode());
if (!qcn->isAbstract())
qcn = 0;
}
@@ -1287,7 +1287,7 @@ QList<Section> CppCodeMarker::qmlSections(const QmlClassNode* qmlClassNode, Syno
}
++c;
}
- const DocNode* dn = current->qmlBase();
+ const DocNode* dn = current->qmlBaseNode();
if (dn) {
if (dn->subType() == Node::QmlClass)
current = static_cast<const QmlClassNode*>(dn);
diff --git a/src/tools/qdoc/cppcodeparser.cpp b/src/tools/qdoc/cppcodeparser.cpp
index 0af5a841eb..68edb1336a 100644
--- a/src/tools/qdoc/cppcodeparser.cpp
+++ b/src/tools/qdoc/cppcodeparser.cpp
@@ -951,11 +951,10 @@ void CppCodeParser::processOtherMetaCommand(const Doc& doc,
else if (command == COMMAND_QMLINHERITS) {
if (node->name() == arg)
doc.location().warning(tr("%1 tries to inherit itself").arg(arg));
- else {
- setLink(node, Node::InheritsLink, arg);
- if (node->subType() == Node::QmlClass) {
- QmlClassNode::addInheritedBy(arg,node);
- }
+ else if (node->subType() == Node::QmlClass) {
+ QmlClassNode *qmlClass = static_cast<QmlClassNode*>(node);
+ qmlClass->setQmlBaseName(arg);
+ QmlClassNode::addInheritedBy(arg,node);
}
}
else if (command == COMMAND_QMLINSTANTIATES) {
diff --git a/src/tools/qdoc/ditaxmlgenerator.cpp b/src/tools/qdoc/ditaxmlgenerator.cpp
index 43d3a8071d..22694dd0d3 100644
--- a/src/tools/qdoc/ditaxmlgenerator.cpp
+++ b/src/tools/qdoc/ditaxmlgenerator.cpp
@@ -4198,7 +4198,7 @@ void DitaXmlGenerator::generateQmlInherits(const QmlClassNode* qcn, CodeMarker*
{
if (!qcn)
return;
- const DocNode* base = qcn->qmlBase();
+ const DocNode* base = qcn->qmlBaseNode();
if (base) {
writeStartTag(DT_qmlInherits);
//writeStartTag(DT_qmlTypeDef);
diff --git a/src/tools/qdoc/htmlgenerator.cpp b/src/tools/qdoc/htmlgenerator.cpp
index 8052558dc6..2666f10eb4 100644
--- a/src/tools/qdoc/htmlgenerator.cpp
+++ b/src/tools/qdoc/htmlgenerator.cpp
@@ -223,6 +223,7 @@ void HtmlGenerator::initializeGenerator(const Config &config)
QString prefix = CONFIG_QHP + Config::dot + project + Config::dot;
manifestDir = "qthelp://" + config.getString(prefix + "namespace");
manifestDir += QLatin1Char('/') + config.getString(prefix + "virtualFolder") + QLatin1Char('/');
+ readManifestMetaContent(config);
examplesPath = config.getString(CONFIG_EXAMPLESINSTALLPATH);
if (!examplesPath.isEmpty())
examplesPath += QLatin1Char('/');
@@ -3869,7 +3870,7 @@ void HtmlGenerator::generateQmlInherits(const QmlClassNode* qcn, CodeMarker* mar
{
if (!qcn)
return;
- const DocNode* base = qcn->qmlBase();
+ const DocNode* base = qcn->qmlBaseNode();
if (base) {
Text text;
text << Atom::ParaLeft << "Inherits ";
@@ -3991,10 +3992,11 @@ void HtmlGenerator::generateManifestFiles()
generateManifestFile("examples", "example");
generateManifestFile("demos", "demo");
ExampleNode::exampleNodeMap.clear();
+ manifestMetaContent.clear();
}
/*!
- This function is called by generaqteManiferstFile(), once
+ This function is called by generateManifestFiles(), once
for each manifest file to be generated. \a manifest is the
type of manifest file.
*/
@@ -4086,6 +4088,36 @@ void HtmlGenerator::generateManifestFile(QString manifest, QString element)
}
if (!en->imageFileName().isEmpty())
writer.writeAttribute("imageUrl", manifestDir + en->imageFileName());
+
+ QString fullName = project + QLatin1Char('/') + en->title();
+ QSet<QString> tags;
+ for (int idx=0; idx < manifestMetaContent.size(); ++idx) {
+ foreach (const QString &name, manifestMetaContent[idx].names) {
+ bool match = false;
+ int wildcard = name.indexOf(QChar('*'));
+ switch (wildcard) {
+ case -1: // no wildcard, exact match
+ match = (fullName == name);
+ break;
+ case 0: // '*' matches all
+ match = true;
+ break;
+ default: // match with wildcard at the end
+ match = fullName.startsWith(name.left(wildcard));
+ }
+ if (match) {
+ tags += manifestMetaContent[idx].tags;
+ foreach (const QString &attr, manifestMetaContent[idx].attributes) {
+ QStringList attrList = attr.split(QLatin1Char(':'), QString::SkipEmptyParts);
+ if (attrList.count() == 1)
+ attrList.append(QStringLiteral("true"));
+ if (attrList.count() == 2)
+ writer.writeAttribute(attrList[0], attrList[1]);
+ }
+ }
+ }
+ }
+
writer.writeStartElement("description");
Text brief = en->doc().briefText();
if (!brief.isEmpty())
@@ -4093,12 +4125,11 @@ void HtmlGenerator::generateManifestFile(QString manifest, QString element)
else
writer.writeCDATA(QString("No description available"));
writer.writeEndElement(); // description
- QStringList tags = en->title().toLower().split(QLatin1Char(' '));
+ tags += QSet<QString>::fromList(en->title().toLower().split(QLatin1Char(' ')));
if (!tags.isEmpty()) {
writer.writeStartElement("tags");
bool wrote_one = false;
- for (int n=0; n<tags.size(); ++n) {
- QString tag = tags.at(n);
+ foreach (QString tag, tags) {
if (tag.at(0).isDigit())
continue;
if (tag.at(0) == '-')
@@ -4109,7 +4140,7 @@ void HtmlGenerator::generateManifestFile(QString manifest, QString element)
continue;
if (tag.endsWith(QLatin1Char(':')))
tag.chop(1);
- if (n>0 && wrote_one)
+ if (wrote_one)
writer.writeCharacters(",");
writer.writeCharacters(tag);
wrote_one = true;
@@ -4163,6 +4194,25 @@ void HtmlGenerator::generateManifestFile(QString manifest, QString element)
}
/*!
+ Reads metacontent - additional attributes and tags to apply
+ when generating manifest files, read from config. Takes the
+ configuration class \a config as a parameter.
+ */
+void HtmlGenerator::readManifestMetaContent(const Config &config)
+{
+ QStringList names = config.getStringList(CONFIG_MANIFESTMETA + Config::dot + QStringLiteral("filters"));
+
+ foreach (const QString &manifest, names) {
+ ManifestMetaFilter filter;
+ QString prefix = CONFIG_MANIFESTMETA + Config::dot + manifest + Config::dot;
+ filter.names = config.getStringSet(prefix + QStringLiteral("names"));
+ filter.attributes = config.getStringSet(prefix + QStringLiteral("attributes"));
+ filter.tags = config.getStringSet(prefix + QStringLiteral("tags"));
+ manifestMetaContent.append(filter);
+ }
+}
+
+/*!
Find global entities that have documentation but no
\e{relates} comand. Report these as errors if they
are not also marked \e {internal}.
diff --git a/src/tools/qdoc/htmlgenerator.h b/src/tools/qdoc/htmlgenerator.h
index 65d874f619..f2efab78a1 100644
--- a/src/tools/qdoc/htmlgenerator.h
+++ b/src/tools/qdoc/htmlgenerator.h
@@ -108,6 +108,7 @@ protected:
virtual QString linkForNode(const Node *node, const Node *relative);
void generateManifestFile(QString manifest, QString element);
+ void readManifestMetaContent(const Config &config);
private:
enum SubTitleSize { SmallSubTitle, LargeSubTitle };
@@ -118,6 +119,13 @@ private:
EndMark
};
+ struct ManifestMetaFilter
+ {
+ QSet<QString> names;
+ QSet<QString> attributes;
+ QSet<QString> tags;
+ };
+
const QPair<QString,QString> anchorForNode(const Node *node);
void generateBreadCrumbs(const QString& title,
const Node *node,
@@ -242,6 +250,7 @@ private:
bool obsoleteLinks;
QStack<QXmlStreamWriter*> xmlWriterStack;
static int id;
+ QList<ManifestMetaFilter> manifestMetaContent;
public:
static bool debugging_on;
static QString divNavTop;
diff --git a/src/tools/qdoc/node.cpp b/src/tools/qdoc/node.cpp
index 0fb9ccc97f..5fbdb487db 100644
--- a/src/tools/qdoc/node.cpp
+++ b/src/tools/qdoc/node.cpp
@@ -2097,7 +2097,7 @@ QmlClassNode::QmlClassNode(InnerNode *parent, const QString& name)
abstract_(false),
cnodeRequired_(false),
cnode_(0),
- base_(0)
+ baseNode_(0)
{
int i = 0;
if (name.startsWith("QML:")) {
diff --git a/src/tools/qdoc/node.h b/src/tools/qdoc/node.h
index 11c08fb659..ecb3c5771e 100644
--- a/src/tools/qdoc/node.h
+++ b/src/tools/qdoc/node.h
@@ -131,8 +131,7 @@ public:
NextLink,
PreviousLink,
ContentsLink,
- IndexLink,
- InheritsLink /*,
+ IndexLink /*,
GlossaryLink,
CopyrightLink,
ChapterLink,
@@ -546,8 +545,10 @@ public:
virtual void setAbstract(bool b) { abstract_ = b; }
const ImportList& importList() const { return importList_; }
void setImportList(const ImportList& il) { importList_ = il; }
- const DocNode* qmlBase() const { return base_; }
- void setQmlBase(DocNode* b) { base_ = b; }
+ const QString& qmlBaseName() const { return baseName_; }
+ void setQmlBaseName(const QString& name) { baseName_ = name; }
+ const DocNode* qmlBaseNode() const { return baseNode_; }
+ void setQmlBaseNode(DocNode* b) { baseNode_ = b; }
void requireCppClass() { cnodeRequired_ = true; }
bool cppClassRequired() const { return cnodeRequired_; }
static void addInheritedBy(const QString& base, Node* sub);
@@ -562,7 +563,8 @@ private:
bool abstract_;
bool cnodeRequired_;
ClassNode* cnode_;
- DocNode* base_;
+ QString baseName_;
+ DocNode* baseNode_;
ImportList importList_;
};
diff --git a/src/tools/qdoc/qdoc.pro b/src/tools/qdoc/qdoc.pro
index 9729a758f0..9df79ec718 100644
--- a/src/tools/qdoc/qdoc.pro
+++ b/src/tools/qdoc/qdoc.pro
@@ -91,3 +91,5 @@ qtPrepareTool(QHELPGENERATOR, qhelpgenerator)
QMAKE_DOCS = $$PWD/doc/config/qdoc.qdocconf
load(qt_tool)
+
+TR_EXCLUDE += $$PWD/*
diff --git a/src/tools/qdoc/qdocdatabase.cpp b/src/tools/qdoc/qdocdatabase.cpp
index 982df5bbc3..4208d529c8 100644
--- a/src/tools/qdoc/qdocdatabase.cpp
+++ b/src/tools/qdoc/qdocdatabase.cpp
@@ -623,6 +623,7 @@ const NodeMultiMap& QDocDatabase::getSinceMap(const QString& key) const
to generating documentation.
*/
void QDocDatabase::resolveIssues() {
+ resolveQmlInheritance(treeRoot());
resolveTargets(treeRoot());
tree_->resolveCppToQmlLinks();
}
@@ -822,6 +823,35 @@ QString QDocDatabase::findTarget(const QString& target, const Node* node) const
}
/*!
+ For each QML Type node in the tree beginning at \a root,
+ if it has a QML base type name but its QML base type node
+ pointer is 0, use the QML base type name to look up the
+ base type node. If the node is found in the tree, set the
+ node's QML base type node pointer.
+ */
+void QDocDatabase::resolveQmlInheritance(InnerNode* root)
+{
+ // Dop we need recursion?
+ foreach (Node* child, root->childNodes()) {
+ if (child->type() == Node::Document && child->subType() == Node::QmlClass) {
+ QmlClassNode* qcn = static_cast<QmlClassNode*>(child);
+ if ((qcn->qmlBaseNode() == 0) && !qcn->qmlBaseName().isEmpty()) {
+ QmlClassNode* bqcn = findQmlType(QString(), qcn->qmlBaseName());
+ if (bqcn) {
+ qcn->setQmlBaseNode(bqcn);
+ }
+#if 0
+ else {
+ qDebug() << "Unable to resolve QML base type:" << qcn->qmlBaseName()
+ << "for QML type:" << qcn->name();
+ }
+#endif
+ }
+ }
+ }
+}
+
+/*!
*/
void QDocDatabase::resolveTargets(InnerNode* root)
{
diff --git a/src/tools/qdoc/qdocdatabase.h b/src/tools/qdoc/qdocdatabase.h
index 857fd301bb..9c6810941d 100644
--- a/src/tools/qdoc/qdocdatabase.h
+++ b/src/tools/qdoc/qdocdatabase.h
@@ -140,6 +140,7 @@ class QDocDatabase
Tree* tree() { return tree_; }
NamespaceNode* treeRoot() { return tree_->root(); }
void resolveInheritance() { tree_->resolveInheritance(); }
+ void resolveQmlInheritance(InnerNode* root);
void resolveIssues();
void fixInheritance() { tree_->fixInheritance(); }
void resolveProperties() { tree_->resolveProperties(); }
diff --git a/src/tools/qdoc/qmlvisitor.cpp b/src/tools/qdoc/qmlvisitor.cpp
index 9dc15d56f1..15af03d9ba 100644
--- a/src/tools/qdoc/qmlvisitor.cpp
+++ b/src/tools/qdoc/qmlvisitor.cpp
@@ -106,7 +106,7 @@ QmlDocVisitor::~QmlDocVisitor()
}
/*!
- Returns the location of thre nearest comment above the \a offset.
+ Returns the location of the nearest comment above the \a offset.
*/
QQmlJS::AST::SourceLocation QmlDocVisitor::precedingComment(quint32 offset) const
{
@@ -322,11 +322,10 @@ void QmlDocVisitor::applyMetacommands(QQmlJS::AST::SourceLocation,
else if (command == COMMAND_QMLINHERITS) {
if (node->name() == args[0].first)
doc.location().warning(tr("%1 tries to inherit itself").arg(args[0].first));
- else {
- CodeParser::setLink(node, Node::InheritsLink, args[0].first);
- if (node->subType() == Node::QmlClass) {
- QmlClassNode::addInheritedBy(args[0].first,node);
- }
+ else if (node->subType() == Node::QmlClass) {
+ QmlClassNode *qmlClass = static_cast<QmlClassNode*>(node);
+ qmlClass->setQmlBaseName(args[0].first);
+ QmlClassNode::addInheritedBy(args[0].first,node);
}
}
else if (command == COMMAND_QMLDEFAULT) {
@@ -389,11 +388,9 @@ bool QmlDocVisitor::visit(QQmlJS::AST::UiObjectDefinition *definition)
QmlClassNode *component = new QmlClassNode(current, name);
component->setTitle(name);
component->setImportList(importList);
-
if (applyDocumentation(definition->firstSourceLocation(), component)) {
QmlClassNode::addInheritedBy(type, component);
- if (!component->links().contains(Node::InheritsLink))
- component->setLink(Node::InheritsLink, type, type);
+ component->setQmlBaseName(type);
}
current = component;
}
diff --git a/src/tools/qdoc/tree.cpp b/src/tools/qdoc/tree.cpp
index ea1d2a92e2..1efab11a92 100644
--- a/src/tools/qdoc/tree.cpp
+++ b/src/tools/qdoc/tree.cpp
@@ -399,10 +399,12 @@ void Tree::addPropertyFunction(PropertyNode* property,
/*!
This function resolves inheritance and reimplementation settings
- for each class node found in the namspace beginning ar \a rootNode.
+ for each C++ class node found in the namspace beginning at \a rootNode.
If it finds another namespace node in the child list of \a rootNode,
it calls itself recursively. For each child of \a rootNode that is a
class node, it calls the other resolveInheritance() function.
+
+ This function does not resolve QML inheritance.
*/
void Tree::resolveInheritance(NamespaceNode* rootNode)
{
diff --git a/src/tools/tools.pro b/src/tools/tools.pro
index c3a9ea228e..fa9ed54c50 100644
--- a/src/tools/tools.pro
+++ b/src/tools/tools.pro
@@ -41,5 +41,3 @@ SUBDIRS = $$TOOLS_SUBDIRS
bootstrap_prepare_docs.depends += $${src_tools_qdoc.target}-make_first
bootstrap_prepare_docs.target = $${src_tools_bootstrap.target}-prepare_docs
QMAKE_EXTRA_TARGETS += bootstrap_prepare_docs
-
-TR_EXCLUDE += $$PWD/*
diff --git a/src/widgets/dialogs/qfiledialog.cpp b/src/widgets/dialogs/qfiledialog.cpp
index 4442b3f00c..3320cc7c04 100644
--- a/src/widgets/dialogs/qfiledialog.cpp
+++ b/src/widgets/dialogs/qfiledialog.cpp
@@ -536,6 +536,7 @@ void QFileDialogPrivate::initHelper(QPlatformDialogHelper *h)
QObject::connect(h, SIGNAL(filesSelected(QStringList)), d, SIGNAL(filesSelected(QStringList)));
QObject::connect(h, SIGNAL(currentChanged(QString)), d, SIGNAL(currentChanged(QString)));
QObject::connect(h, SIGNAL(directoryEntered(QString)), d, SIGNAL(directoryEntered(QString)));
+ QObject::connect(h, SIGNAL(directoryEntered(QString)), d, SLOT(_q_nativeEnterDirectory(QString)));
QObject::connect(h, SIGNAL(filterSelected(QString)), d, SIGNAL(filterSelected(QString)));
static_cast<QPlatformFileDialogHelper *>(h)->setOptions(options);
}
@@ -3114,6 +3115,12 @@ void QFileDialogPrivate::_q_fileRenamed(const QString &path, const QString oldNa
}
}
+void QFileDialogPrivate::_q_nativeEnterDirectory(const QString &directory)
+{
+ if (!directory.isEmpty()) // Windows native dialogs occasionally emit signals with empty strings.
+ *lastVisitedDir() = directory;
+}
+
/*!
\internal
diff --git a/src/widgets/dialogs/qfiledialog.h b/src/widgets/dialogs/qfiledialog.h
index 6ddbb7c0d0..973bccf940 100644
--- a/src/widgets/dialogs/qfiledialog.h
+++ b/src/widgets/dialogs/qfiledialog.h
@@ -240,6 +240,7 @@ private:
Q_PRIVATE_SLOT(d_func(), void _q_updateOkButton())
Q_PRIVATE_SLOT(d_func(), void _q_currentChanged(const QModelIndex &index))
Q_PRIVATE_SLOT(d_func(), void _q_enterDirectory(const QModelIndex &index))
+ Q_PRIVATE_SLOT(d_func(), void _q_nativeEnterDirectory(const QString&))
Q_PRIVATE_SLOT(d_func(), void _q_goToDirectory(const QString &path))
Q_PRIVATE_SLOT(d_func(), void _q_useNameFilter(int index))
Q_PRIVATE_SLOT(d_func(), void _q_selectionChanged())
diff --git a/src/widgets/dialogs/qfiledialog_p.h b/src/widgets/dialogs/qfiledialog_p.h
index 304eada093..ffaa2bc6f8 100644
--- a/src/widgets/dialogs/qfiledialog_p.h
+++ b/src/widgets/dialogs/qfiledialog_p.h
@@ -204,6 +204,7 @@ public:
void _q_updateOkButton();
void _q_currentChanged(const QModelIndex &index);
void _q_enterDirectory(const QModelIndex &index);
+ void _q_nativeEnterDirectory(const QString &directory);
void _q_goToDirectory(const QString &);
void _q_useNameFilter(int index);
void _q_selectionChanged();
diff --git a/src/widgets/doc/qtwidgets.qdocconf b/src/widgets/doc/qtwidgets.qdocconf
index e960ebfeba..a989ef9363 100644
--- a/src/widgets/doc/qtwidgets.qdocconf
+++ b/src/widgets/doc/qtwidgets.qdocconf
@@ -34,6 +34,15 @@ headerdirs += ..
sourcedirs += .. \
../../../examples/widgets/doc/src
+excludefiles += ../widgets/qmacnativewidget_mac.h \
+ ../widgets/qmaccocoaviewcontainer_mac.h \
+ ../widgets/qcocoatoolbardelegate_mac_p.h \
+ ../widgets/qcocoamenu_mac_p.h \
+ ../widgets/qmaccocoaviewcontainer_mac.mm \
+ ../widgets/qcocoatoolbardelegate_mac.mm \
+ ../widgets/qmainwindowlayout_mac.mm \
+ ../widgets/qmacnativewidget_mac.mm
+
exampledirs += ../../../examples/widgets \
../../../doc/src/snippets \
../ \
diff --git a/src/widgets/graphicsview/qgraphicsitem.cpp b/src/widgets/graphicsview/qgraphicsitem.cpp
index 5dc59436ad..f04667e167 100644
--- a/src/widgets/graphicsview/qgraphicsitem.cpp
+++ b/src/widgets/graphicsview/qgraphicsitem.cpp
@@ -2178,6 +2178,8 @@ bool QGraphicsItem::hasCursor() const
*/
void QGraphicsItem::unsetCursor()
{
+ if (!d_ptr->hasCursor)
+ return;
d_ptr->unsetExtra(QGraphicsItemPrivate::ExtraCursor);
d_ptr->hasCursor = 0;
if (d_ptr->scene) {
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp
index 9112e48869..1b6f6b8f8f 100644
--- a/src/widgets/kernel/qwidget.cpp
+++ b/src/widgets/kernel/qwidget.cpp
@@ -1391,6 +1391,14 @@ QWidget::~QWidget()
QT_TRY {
+#ifndef QT_NO_GRAPHICSVIEW
+ const QWidget* w = this;
+ while (w->d_func()->extra && w->d_func()->extra->focus_proxy)
+ w = w->d_func()->extra->focus_proxy;
+ QWidget *window = w->window();
+ QWExtra *e = window ? window->d_func()->extra : 0;
+ if (!e || !e->proxyWidget)
+#endif
clearFocus();
} QT_CATCH(...) {
// swallow this problem because we are in a destructor
@@ -8414,7 +8422,7 @@ void QWidget::mouseReleaseEvent(QMouseEvent *event)
void QWidget::mouseDoubleClickEvent(QMouseEvent *event)
{
- Q_UNUSED(event);
+ event->ignore();
}
#ifndef QT_NO_WHEELEVENT
diff --git a/src/widgets/styles/qmacstyle_mac.mm b/src/widgets/styles/qmacstyle_mac.mm
index 085bf627aa..00356b7468 100644
--- a/src/widgets/styles/qmacstyle_mac.mm
+++ b/src/widgets/styles/qmacstyle_mac.mm
@@ -2705,7 +2705,8 @@ int QMacStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget *w
ret = false;
break;
case SH_ScrollBar_Transient:
- if (qobject_cast<const QScrollBar *>(w) ||
+ if ((qobject_cast<const QScrollBar *>(w) && w->parent() &&
+ qobject_cast<QAbstractScrollArea*>(w->parent()->parent())) ||
(opt && QStyleHelper::hasAncestor(opt->styleObject, QAccessible::ScrollBar))) {
ret = QSysInfo::MacintoshVersion >= QSysInfo::MV_10_7;
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7
diff --git a/src/widgets/styles/qstylehelper.cpp b/src/widgets/styles/qstylehelper.cpp
index 6d8a3ce0c3..75c74e4a88 100644
--- a/src/widgets/styles/qstylehelper.cpp
+++ b/src/widgets/styles/qstylehelper.cpp
@@ -86,17 +86,13 @@ qreal dpiScaled(qreal value)
#endif
}
+#ifndef QT_NO_ACCESSIBILITY
bool isInstanceOf(QObject *obj, QAccessible::Role role)
{
bool match = false;
-#ifndef QT_NO_ACCESSIBILITY
QAccessibleInterface *iface = QAccessible::queryAccessibleInterface(obj);
match = iface && iface->role() == role;
delete iface;
-#else
- Q_UNUSED(obj)
- Q_UNUSED(role)
-#endif // QT_NO_ACCESSIBILITY
return match;
}
@@ -104,19 +100,15 @@ bool isInstanceOf(QObject *obj, QAccessible::Role role)
bool hasAncestor(QObject *obj, QAccessible::Role role)
{
bool found = false;
-#ifndef QT_NO_ACCESSIBILITY
QObject *parent = obj ? obj->parent() : 0;
while (parent && !found) {
if (isInstanceOf(parent, role))
found = true;
parent = parent->parent();
}
-#else
- Q_UNUSED(obj)
- Q_UNUSED(role)
-#endif // QT_NO_ACCESSIBILITY
return found;
}
+#endif // QT_NO_ACCESSIBILITY
#ifndef QT_NO_DIAL
diff --git a/src/widgets/styles/qstylehelper_p.h b/src/widgets/styles/qstylehelper_p.h
index 41f823def7..01772e765c 100644
--- a/src/widgets/styles/qstylehelper_p.h
+++ b/src/widgets/styles/qstylehelper_p.h
@@ -82,8 +82,10 @@ namespace QStyleHelper
void drawBorderPixmap(const QPixmap &pixmap, QPainter *painter, const QRect &rect,
int left = 0, int top = 0, int right = 0,
int bottom = 0);
+#ifndef QT_NO_ACCESSIBILITY
bool isInstanceOf(QObject *obj, QAccessible::Role role);
bool hasAncestor(QObject *obj, QAccessible::Role role);
+#endif
}
diff --git a/src/widgets/util/qsystemtrayicon_qpa.cpp b/src/widgets/util/qsystemtrayicon_qpa.cpp
index 11d82b2332..113f0b68b2 100644
--- a/src/widgets/util/qsystemtrayicon_qpa.cpp
+++ b/src/widgets/util/qsystemtrayicon_qpa.cpp
@@ -68,7 +68,7 @@ void QSystemTrayIconPrivate::install_sys()
if (qpa_sys) {
qpa_sys->init();
QObject::connect(qpa_sys, SIGNAL(activated(QPlatformSystemTrayIcon::ActivationReason)),
- q_func(), SLOT(emitActivated(QPlatformSystemTrayIcon::ActivationReason)));
+ q_func(), SLOT(_q_emitActivated(QPlatformSystemTrayIcon::ActivationReason)));
QObject::connect(qpa_sys, SIGNAL(messageClicked()),
q_func(), SIGNAL(messageClicked()));
updateMenu_sys();