summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-06-09 03:01:40 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-06-09 03:01:40 (GMT)
commit3d4fe3845c0c6f30908001175492c0c3afa50a88 (patch)
tree86cff0acf2b07000859904a838ae3a44fa92f0ea /src
parente6e173b457d41ea232c30c6582493cb54ee8f7c9 (diff)
parentbb8b5d7005a1125fd677b32f3381e9b64f0857ff (diff)
downloadQt-3d4fe3845c0c6f30908001175492c0c3afa50a88.zip
Qt-3d4fe3845c0c6f30908001175492c0c3afa50a88.tar.gz
Qt-3d4fe3845c0c6f30908001175492c0c3afa50a88.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2: QVarLenghtArray: Add typedefs for stl compatibility. prefer QElapsedTimer over QTime Allow to build Qt in static with mingw Protected call to glXChooseFBConfig with appropriate defines. Use the new OpenGL 3.* context/profile if asked with X11/GLX. Splitted attrib_list generation into buildSpec from QGLContext::tryVisual. Fix QTransform::map(const QPainterPath &) not working with paths that
Diffstat (limited to 'src')
-rw-r--r--src/corelib/kernel/qeventloop.cpp4
-rw-r--r--src/corelib/tools/qvarlengtharray.h7
-rw-r--r--src/corelib/tools/qvarlengtharray.qdoc49
-rw-r--r--src/declarative/qml/parser/qdeclarativejslexer.cpp2
-rw-r--r--src/gui/kernel/qapplication.cpp2
-rw-r--r--src/gui/kernel/qwhatsthis.cpp2
-rw-r--r--src/gui/painting/qtransform.cpp2
-rw-r--r--src/opengl/qgl_x11.cpp367
-rw-r--r--src/script/api/qscriptengine.cpp4
-rw-r--r--src/script/parser/qscriptlexer.cpp2
-rw-r--r--src/xmlpatterns/data/qdecimal_p.h2
11 files changed, 289 insertions, 154 deletions
diff --git a/src/corelib/kernel/qeventloop.cpp b/src/corelib/kernel/qeventloop.cpp
index 628afa7..c19f718 100644
--- a/src/corelib/kernel/qeventloop.cpp
+++ b/src/corelib/kernel/qeventloop.cpp
@@ -43,7 +43,7 @@
#include "qabstracteventdispatcher.h"
#include "qcoreapplication.h"
-#include "qdatetime.h"
+#include "qelapsedtimer.h"
#include "qobject_p.h"
#include <private/qthread_p.h>
@@ -247,7 +247,7 @@ void QEventLoop::processEvents(ProcessEventsFlags flags, int maxTime)
if (!d->threadData->eventDispatcher)
return;
- QTime start;
+ QElapsedTimer start;
start.start();
if (flags & DeferredDeletion)
QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);
diff --git a/src/corelib/tools/qvarlengtharray.h b/src/corelib/tools/qvarlengtharray.h
index bfede94..4a6bb4b 100644
--- a/src/corelib/tools/qvarlengtharray.h
+++ b/src/corelib/tools/qvarlengtharray.h
@@ -127,6 +127,13 @@ public:
inline T *data() { return ptr; }
inline const T *data() const { return ptr; }
inline const T * constData() const { return ptr; }
+ typedef int size_type;
+ typedef T value_type;
+ typedef value_type *pointer;
+ typedef const value_type *const_pointer;
+ typedef value_type &reference;
+ typedef const value_type &const_reference;
+ typedef qptrdiff difference_type;
private:
friend class QPodList<T, Prealloc>;
diff --git a/src/corelib/tools/qvarlengtharray.qdoc b/src/corelib/tools/qvarlengtharray.qdoc
index 38901e5..ef2dc58 100644
--- a/src/corelib/tools/qvarlengtharray.qdoc
+++ b/src/corelib/tools/qvarlengtharray.qdoc
@@ -302,3 +302,52 @@
\a defaultValue.
*/
+/*!
+ \typedef QVarLengthArray::size_type
+ \since 4.7
+
+ Typedef for int. Provided for STL compatibility.
+*/
+
+/*!
+ \typedef QVarLengthArray::value_type
+ \since 4.7
+
+ Typedef for T. Provided for STL compatibility.
+*/
+
+/*!
+ \typedef QVarLengthArray::difference_type
+ \since 4.7
+
+ Typedef for ptrdiff_t. Provided for STL compatibility.
+*/
+
+/*!
+ \typedef QVarLengthArray::pointer
+ \since 4.7
+
+ Typedef for T *. Provided for STL compatibility.
+*/
+
+/*!
+ \typedef QVarLengthArray::const_pointer
+ \since 4.7
+
+ Typedef for const T *. Provided for STL compatibility.
+*/
+
+/*!
+ \typedef QVarLengthArray::reference
+ \since 4.7
+
+ Typedef for T &. Provided for STL compatibility.
+*/
+
+/*!
+ \typedef QVarLengthArray::const_reference
+ \since 4.7
+
+ Typedef for const T &. Provided for STL compatibility.
+*/
+
diff --git a/src/declarative/qml/parser/qdeclarativejslexer.cpp b/src/declarative/qml/parser/qdeclarativejslexer.cpp
index 975ad4c..fcaaece 100644
--- a/src/declarative/qml/parser/qdeclarativejslexer.cpp
+++ b/src/declarative/qml/parser/qdeclarativejslexer.cpp
@@ -57,7 +57,7 @@
#include <string.h>
QT_BEGIN_NAMESPACE
-Q_DECL_IMPORT extern double qstrtod(const char *s00, char const **se, bool *ok);
+Q_CORE_EXPORT double qstrtod(const char *s00, char const **se, bool *ok);
QT_END_NAMESPACE
QT_QML_BEGIN_NAMESPACE
diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp
index c9a3e8b..02d732b 100644
--- a/src/gui/kernel/qapplication.cpp
+++ b/src/gui/kernel/qapplication.cpp
@@ -146,7 +146,7 @@ static void initResources()
QT_BEGIN_NAMESPACE
-Q_DECL_IMPORT extern void qt_call_post_routines();
+Q_CORE_EXPORT void qt_call_post_routines();
int QApplicationPrivate::app_compile_version = 0x040000; //we don't know exactly, but it's at least 4.0.0
diff --git a/src/gui/kernel/qwhatsthis.cpp b/src/gui/kernel/qwhatsthis.cpp
index 6181b62..ff4641e 100644
--- a/src/gui/kernel/qwhatsthis.cpp
+++ b/src/gui/kernel/qwhatsthis.cpp
@@ -143,7 +143,7 @@ QT_BEGIN_NAMESPACE
\sa QToolTip
*/
-Q_DECL_IMPORT extern void qDeleteInEventHandler(QObject *o);
+Q_CORE_EXPORT void qDeleteInEventHandler(QObject *o);
class QWhatsThat : public QWidget
{
diff --git a/src/gui/painting/qtransform.cpp b/src/gui/painting/qtransform.cpp
index 423cce9..47b7758 100644
--- a/src/gui/painting/qtransform.cpp
+++ b/src/gui/painting/qtransform.cpp
@@ -1626,7 +1626,7 @@ static QPainterPath mapProjective(const QTransform &transform, const QPainterPat
QPainterPath QTransform::map(const QPainterPath &path) const
{
TransformationType t = inline_type();
- if (t == TxNone || path.isEmpty())
+ if (t == TxNone || path.elementCount() == 0)
return path;
if (t >= TxProject)
diff --git a/src/opengl/qgl_x11.cpp b/src/opengl/qgl_x11.cpp
index 9491f14..3e71a48 100644
--- a/src/opengl/qgl_x11.cpp
+++ b/src/opengl/qgl_x11.cpp
@@ -115,6 +115,20 @@ extern const QX11Info *qt_x11Info(const QPaintDevice *pd);
#define GLX_FRONT_LEFT_EXT 0x20DE
#endif
+#ifndef GLX_ARB_create_context
+#define GLX_CONTEXT_DEBUG_BIT_ARB 0x00000001
+#define GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x00000002
+#define GLX_CONTEXT_MAJOR_VERSION_ARB 0x2091
+#define GLX_CONTEXT_MINOR_VERSION_ARB 0x2092
+#define GLX_CONTEXT_FLAGS_ARB 0x2094
+#endif
+
+#ifndef GLX_ARB_create_context_profile
+#define GLX_CONTEXT_CORE_PROFILE_BIT_ARB 0x00000001
+#define GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB 0x00000002
+#define GLX_CONTEXT_PROFILE_MASK_ARB 0x9126
+#endif
+
/*
The qt_gl_choose_cmap function is internal and used by QGLWidget::setContext()
and GLX (not Windows). If the application can't find any sharable
@@ -401,6 +415,148 @@ bool QGLFormat::hasOpenGLOverlays()
return trans_colors.size() > 0;
}
+static bool buildSpec(int* spec, const QGLFormat& f, QPaintDevice* paintDevice,
+ int bufDepth, bool onlyFBConfig = false)
+{
+ int i = 0;
+ spec[i++] = GLX_LEVEL;
+ spec[i++] = f.plane();
+ const QX11Info *xinfo = qt_x11Info(paintDevice);
+ bool useFBConfig = onlyFBConfig;
+
+#if defined(GLX_VERSION_1_3) && !defined(QT_NO_XRENDER) && !defined(Q_OS_HPUX)
+ /*
+ HPUX defines GLX_VERSION_1_3 but does not implement the corresponding functions.
+ Specifically glXChooseFBConfig and glXGetVisualFromFBConfig are not implemented.
+ */
+ QWidget* widget = 0;
+ if (paintDevice->devType() == QInternal::Widget)
+ widget = static_cast<QWidget*>(paintDevice);
+
+ // Only use glXChooseFBConfig for widgets if we're trying to get an ARGB visual
+ if (widget && widget->testAttribute(Qt::WA_TranslucentBackground) && X11->use_xrender)
+ useFBConfig = true;
+#endif
+
+#if defined(GLX_VERSION_1_1) && defined(GLX_EXT_visual_info)
+ static bool useTranspExt = false;
+ static bool useTranspExtChecked = false;
+ if (f.plane() && !useTranspExtChecked && paintDevice) {
+ QGLExtensionMatcher extensions(glXQueryExtensionsString(xinfo->display(), xinfo->screen()));
+ useTranspExt = extensions.match("GLX_EXT_visual_info");
+ //# (A bit simplistic; that could theoretically be a substring)
+ if (useTranspExt) {
+ QByteArray cstr(glXGetClientString(xinfo->display(), GLX_VENDOR));
+ useTranspExt = !cstr.contains("Xi Graphics"); // bug workaround
+ if (useTranspExt) {
+ // bug workaround - some systems (eg. FireGL) refuses to return an overlay
+ // visual if the GLX_TRANSPARENT_TYPE_EXT attribute is specified, even if
+ // the implementation supports transparent overlays
+ int tmpSpec[] = { GLX_LEVEL, f.plane(), GLX_TRANSPARENT_TYPE_EXT,
+ f.rgba() ? GLX_TRANSPARENT_RGB_EXT : GLX_TRANSPARENT_INDEX_EXT,
+ XNone };
+ XVisualInfo * vinf = glXChooseVisual(xinfo->display(), xinfo->screen(), tmpSpec);
+ if (!vinf) {
+ useTranspExt = false;
+ }
+ }
+ }
+
+ useTranspExtChecked = true;
+ }
+ if (f.plane() && useTranspExt && !useFBConfig) {
+ // Required to avoid non-transparent overlay visual(!) on some systems
+ spec[i++] = GLX_TRANSPARENT_TYPE_EXT;
+ spec[i++] = f.rgba() ? GLX_TRANSPARENT_RGB_EXT : GLX_TRANSPARENT_INDEX_EXT;
+ }
+#endif
+
+#if defined(GLX_VERSION_1_3) && !defined(Q_OS_HPUX)
+ // GLX_RENDER_TYPE is only in glx >=1.3
+ if (useFBConfig) {
+ spec[i++] = GLX_RENDER_TYPE;
+ spec[i++] = f.rgba() ? GLX_RGBA_BIT : GLX_COLOR_INDEX_BIT;
+ }
+#endif
+
+ if (f.doubleBuffer())
+ spec[i++] = GLX_DOUBLEBUFFER;
+ if (useFBConfig)
+ spec[i++] = True;
+ if (f.depth()) {
+ spec[i++] = GLX_DEPTH_SIZE;
+ spec[i++] = f.depthBufferSize() == -1 ? 1 : f.depthBufferSize();
+ }
+ if (f.stereo()) {
+ spec[i++] = GLX_STEREO;
+ if (useFBConfig)
+ spec[i++] = True;
+ }
+ if (f.stencil()) {
+ spec[i++] = GLX_STENCIL_SIZE;
+ spec[i++] = f.stencilBufferSize() == -1 ? 1 : f.stencilBufferSize();
+ }
+ if (f.rgba()) {
+ if (!useFBConfig)
+ spec[i++] = GLX_RGBA;
+ spec[i++] = GLX_RED_SIZE;
+ spec[i++] = f.redBufferSize() == -1 ? 1 : f.redBufferSize();
+ spec[i++] = GLX_GREEN_SIZE;
+ spec[i++] = f.greenBufferSize() == -1 ? 1 : f.greenBufferSize();
+ spec[i++] = GLX_BLUE_SIZE;
+ spec[i++] = f.blueBufferSize() == -1 ? 1 : f.blueBufferSize();
+ if (f.alpha()) {
+ spec[i++] = GLX_ALPHA_SIZE;
+ spec[i++] = f.alphaBufferSize() == -1 ? 1 : f.alphaBufferSize();
+ }
+ if (f.accum()) {
+ spec[i++] = GLX_ACCUM_RED_SIZE;
+ spec[i++] = f.accumBufferSize() == -1 ? 1 : f.accumBufferSize();
+ spec[i++] = GLX_ACCUM_GREEN_SIZE;
+ spec[i++] = f.accumBufferSize() == -1 ? 1 : f.accumBufferSize();
+ spec[i++] = GLX_ACCUM_BLUE_SIZE;
+ spec[i++] = f.accumBufferSize() == -1 ? 1 : f.accumBufferSize();
+ if (f.alpha()) {
+ spec[i++] = GLX_ACCUM_ALPHA_SIZE;
+ spec[i++] = f.accumBufferSize() == -1 ? 1 : f.accumBufferSize();
+ }
+ }
+ } else {
+ spec[i++] = GLX_BUFFER_SIZE;
+ spec[i++] = bufDepth;
+ }
+
+ if (f.sampleBuffers()) {
+ spec[i++] = GLX_SAMPLE_BUFFERS_ARB;
+ spec[i++] = 1;
+ spec[i++] = GLX_SAMPLES_ARB;
+ spec[i++] = f.samples() == -1 ? 4 : f.samples();
+ }
+
+#if defined(GLX_VERSION_1_3) && !defined(Q_OS_HPUX)
+ if (useFBConfig) {
+ spec[i++] = GLX_DRAWABLE_TYPE;
+ switch(paintDevice->devType()) {
+ case QInternal::Pixmap:
+ spec[i++] = GLX_PIXMAP_BIT;
+ break;
+ case QInternal::Pbuffer:
+ spec[i++] = GLX_PBUFFER_BIT;
+ break;
+ default:
+ qWarning("QGLContext: Unknown paint device type %d", paintDevice->devType());
+ // Fall-through & assume it's a window
+ case QInternal::Widget:
+ spec[i++] = GLX_WINDOW_BIT;
+ break;
+ };
+ }
+#endif
+
+ spec[i] = XNone;
+ return useFBConfig;
+}
+
/*****************************************************************************
QGLContext UNIX/GLX-specific code
*****************************************************************************/
@@ -493,21 +649,81 @@ bool QGLContext::chooseContext(const QGLContext* shareContext)
shareContext = 0;
}
+ const int major = d->reqFormat.majorVersion();
+ const int minor = d->reqFormat.minorVersion();
+ const int profile = d->reqFormat.profile() == QGLFormat::CompatibilityProfile
+ ? GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB
+ : GLX_CONTEXT_CORE_PROFILE_BIT_ARB;
+
d->cx = 0;
- if (shareContext) {
+
+#if defined(GLX_VERSION_1_3) && !defined(Q_OS_HPUX)
+ /*
+ HPUX defines GLX_VERSION_1_3 but does not implement the corresponding functions.
+ Specifically glXChooseFBConfig and glXGetVisualFromFBConfig are not implemented.
+ */
+ if ((major == 3 && minor >= 2) || major > 3) {
+ QGLTemporaryContext *tmpContext = 0;
+ if (!QGLContext::currentContext())
+ tmpContext = new QGLTemporaryContext;
+
+ int attributes[] = { GLX_CONTEXT_MAJOR_VERSION_ARB, major,
+ GLX_CONTEXT_MINOR_VERSION_ARB, minor,
+ GLX_CONTEXT_PROFILE_MASK_ARB, profile,
+ 0 };
+
+ PFNGLXCREATECONTEXTATTRIBSARBPROC glXCreateContextAttribs =
+ (PFNGLXCREATECONTEXTATTRIBSARBPROC) qglx_getProcAddress("glXCreateContextAttribsARB");
+
+ if (glXCreateContextAttribs) {
+ int spec[45];
+ glXGetConfig(disp, (XVisualInfo*)d->vi, GLX_BUFFER_SIZE, &res);
+ buildSpec(spec, format(), d->paintDevice, res, true);
+
+ GLXFBConfig *configs;
+ int configCount = 0;
+ configs = glXChooseFBConfig(disp, xinfo->screen(), spec, &configCount);
+
+ if (configs && configCount > 0) {
+ d->cx = glXCreateContextAttribs(disp, configs[0],
+ shareContext ? (GLXContext)shareContext->d_func()->cx : 0, direct, attributes);
+ if (!d->cx && shareContext) {
+ shareContext = 0;
+ d->cx = glXCreateContextAttribs(disp, configs[0], 0, direct, attributes);
+ }
+ d->screen = ((XVisualInfo*)d->vi)->screen;
+ }
+ XFree(configs);
+ } else {
+ qWarning("QGLContext::chooseContext(): OpenGL %d.%d is not supported", major, minor);
+ }
+
+ if (tmpContext)
+ delete tmpContext;
+ }
+#else
+ Q_UNUSED(major);
+ Q_UNUSED(minor);
+ Q_UNUSED(profile);
+#endif
+
+ if (!d->cx && shareContext) {
d->cx = glXCreateContext(disp, (XVisualInfo *)d->vi,
(GLXContext)shareContext->d_func()->cx, direct);
d->screen = ((XVisualInfo*)d->vi)->screen;
- if (d->cx) {
- QGLContext *share = const_cast<QGLContext *>(shareContext);
- d->sharing = true;
- share->d_func()->sharing = true;
- }
}
if (!d->cx) {
d->cx = glXCreateContext(disp, (XVisualInfo *)d->vi, NULL, direct);
d->screen = ((XVisualInfo*)d->vi)->screen;
+ shareContext = 0;
+ }
+
+ if (shareContext && d->cx) {
+ QGLContext *share = const_cast<QGLContext *>(shareContext);
+ d->sharing = true;
+ share->d_func()->sharing = true;
}
+
if (!d->cx)
return false;
d->glFormat.setDirectRendering(glXIsDirect(disp, (GLXContext)d->cx));
@@ -606,143 +822,8 @@ void *QGLContext::tryVisual(const QGLFormat& f, int bufDepth)
{
Q_D(QGLContext);
int spec[45];
- int i = 0;
- spec[i++] = GLX_LEVEL;
- spec[i++] = f.plane();
const QX11Info *xinfo = qt_x11Info(d->paintDevice);
- bool useFBConfig = false;
-
-#if defined(GLX_VERSION_1_3) && !defined(QT_NO_XRENDER) && !defined(Q_OS_HPUX)
- /*
- HPUX defines GLX_VERSION_1_3 but does not implement the corresponding functions.
- Specifically glXChooseFBConfig and glXGetVisualFromFBConfig are not implemented.
- */
- QWidget* widget = 0;
- if (d->paintDevice->devType() == QInternal::Widget)
- widget = static_cast<QWidget*>(d->paintDevice);
-
- // Only use glXChooseFBConfig for widgets if we're trying to get an ARGB visual
- if (widget && widget->testAttribute(Qt::WA_TranslucentBackground) && X11->use_xrender)
- useFBConfig = true;
-#endif
-
-#if defined(GLX_VERSION_1_1) && defined(GLX_EXT_visual_info)
- static bool useTranspExt = false;
- static bool useTranspExtChecked = false;
- if (f.plane() && !useTranspExtChecked && d->paintDevice) {
- QGLExtensionMatcher extensions(glXQueryExtensionsString(xinfo->display(), xinfo->screen()));
- useTranspExt = extensions.match("GLX_EXT_visual_info");
- //# (A bit simplistic; that could theoretically be a substring)
- if (useTranspExt) {
- QByteArray cstr(glXGetClientString(xinfo->display(), GLX_VENDOR));
- useTranspExt = !cstr.contains("Xi Graphics"); // bug workaround
- if (useTranspExt) {
- // bug workaround - some systems (eg. FireGL) refuses to return an overlay
- // visual if the GLX_TRANSPARENT_TYPE_EXT attribute is specified, even if
- // the implementation supports transparent overlays
- int tmpSpec[] = { GLX_LEVEL, f.plane(), GLX_TRANSPARENT_TYPE_EXT,
- f.rgba() ? GLX_TRANSPARENT_RGB_EXT : GLX_TRANSPARENT_INDEX_EXT,
- XNone };
- XVisualInfo * vinf = glXChooseVisual(xinfo->display(), xinfo->screen(), tmpSpec);
- if (!vinf) {
- useTranspExt = false;
- }
- }
- }
-
- useTranspExtChecked = true;
- }
- if (f.plane() && useTranspExt && !useFBConfig) {
- // Required to avoid non-transparent overlay visual(!) on some systems
- spec[i++] = GLX_TRANSPARENT_TYPE_EXT;
- spec[i++] = f.rgba() ? GLX_TRANSPARENT_RGB_EXT : GLX_TRANSPARENT_INDEX_EXT;
- }
-#endif
-
-#if defined(GLX_VERSION_1_3) && !defined(Q_OS_HPUX)
- // GLX_RENDER_TYPE is only in glx >=1.3
- if (useFBConfig) {
- spec[i++] = GLX_RENDER_TYPE;
- spec[i++] = f.rgba() ? GLX_RGBA_BIT : GLX_COLOR_INDEX_BIT;
- }
-#endif
-
- if (f.doubleBuffer())
- spec[i++] = GLX_DOUBLEBUFFER;
- if (useFBConfig)
- spec[i++] = True;
- if (f.depth()) {
- spec[i++] = GLX_DEPTH_SIZE;
- spec[i++] = f.depthBufferSize() == -1 ? 1 : f.depthBufferSize();
- }
- if (f.stereo()) {
- spec[i++] = GLX_STEREO;
- if (useFBConfig)
- spec[i++] = True;
- }
- if (f.stencil()) {
- spec[i++] = GLX_STENCIL_SIZE;
- spec[i++] = f.stencilBufferSize() == -1 ? 1 : f.stencilBufferSize();
- }
- if (f.rgba()) {
- if (!useFBConfig)
- spec[i++] = GLX_RGBA;
- spec[i++] = GLX_RED_SIZE;
- spec[i++] = f.redBufferSize() == -1 ? 1 : f.redBufferSize();
- spec[i++] = GLX_GREEN_SIZE;
- spec[i++] = f.greenBufferSize() == -1 ? 1 : f.greenBufferSize();
- spec[i++] = GLX_BLUE_SIZE;
- spec[i++] = f.blueBufferSize() == -1 ? 1 : f.blueBufferSize();
- if (f.alpha()) {
- spec[i++] = GLX_ALPHA_SIZE;
- spec[i++] = f.alphaBufferSize() == -1 ? 1 : f.alphaBufferSize();
- }
- if (f.accum()) {
- spec[i++] = GLX_ACCUM_RED_SIZE;
- spec[i++] = f.accumBufferSize() == -1 ? 1 : f.accumBufferSize();
- spec[i++] = GLX_ACCUM_GREEN_SIZE;
- spec[i++] = f.accumBufferSize() == -1 ? 1 : f.accumBufferSize();
- spec[i++] = GLX_ACCUM_BLUE_SIZE;
- spec[i++] = f.accumBufferSize() == -1 ? 1 : f.accumBufferSize();
- if (f.alpha()) {
- spec[i++] = GLX_ACCUM_ALPHA_SIZE;
- spec[i++] = f.accumBufferSize() == -1 ? 1 : f.accumBufferSize();
- }
- }
- } else {
- spec[i++] = GLX_BUFFER_SIZE;
- spec[i++] = bufDepth;
- }
-
- if (f.sampleBuffers()) {
- spec[i++] = GLX_SAMPLE_BUFFERS_ARB;
- spec[i++] = 1;
- spec[i++] = GLX_SAMPLES_ARB;
- spec[i++] = f.samples() == -1 ? 4 : f.samples();
- }
-
-#if defined(GLX_VERSION_1_3) && !defined(Q_OS_HPUX)
- if (useFBConfig) {
- spec[i++] = GLX_DRAWABLE_TYPE;
- switch(d->paintDevice->devType()) {
- case QInternal::Pixmap:
- spec[i++] = GLX_PIXMAP_BIT;
- break;
- case QInternal::Pbuffer:
- spec[i++] = GLX_PBUFFER_BIT;
- break;
- default:
- qWarning("QGLContext: Unknown paint device type %d", d->paintDevice->devType());
- // Fall-through & assume it's a window
- case QInternal::Widget:
- spec[i++] = GLX_WINDOW_BIT;
- break;
- };
- }
-#endif
-
- spec[i] = XNone;
-
+ bool useFBConfig = buildSpec(spec, f, d->paintDevice, bufDepth, false);
XVisualInfo* chosenVisualInfo = 0;
@@ -755,7 +836,7 @@ void *QGLContext::tryVisual(const QGLFormat& f, int bufDepth)
if (!configs)
break; // fallback to trying glXChooseVisual
- for (i = 0; i < configCount; ++i) {
+ for (int i = 0; i < configCount; ++i) {
XVisualInfo* vi;
vi = glXGetVisualFromFBConfig(xinfo->display(), configs[i]);
if (!vi)
diff --git a/src/script/api/qscriptengine.cpp b/src/script/api/qscriptengine.cpp
index 86915bb..f02ea52 100644
--- a/src/script/api/qscriptengine.cpp
+++ b/src/script/api/qscriptengine.cpp
@@ -1525,7 +1525,7 @@ void QScriptEnginePrivate::detachAllRegisteredScriptStrings()
#ifndef QT_NO_REGEXP
-Q_DECL_IMPORT extern QString qt_regexp_toCanonical(const QString &, QRegExp::PatternSyntax);
+Q_CORE_EXPORT QString qt_regexp_toCanonical(const QString &, QRegExp::PatternSyntax);
JSC::JSValue QScriptEnginePrivate::newRegExp(JSC::ExecState *exec, const QRegExp &regexp)
{
@@ -2020,8 +2020,6 @@ QScriptValue QScriptEngine::newFunction(QScriptEngine::FunctionSignature fun,
#ifndef QT_NO_REGEXP
-Q_DECL_IMPORT extern QString qt_regexp_toCanonical(const QString &, QRegExp::PatternSyntax);
-
/*!
Creates a QtScript object of class RegExp with the given
\a regexp.
diff --git a/src/script/parser/qscriptlexer.cpp b/src/script/parser/qscriptlexer.cpp
index ca64776..3ddc3aa 100644
--- a/src/script/parser/qscriptlexer.cpp
+++ b/src/script/parser/qscriptlexer.cpp
@@ -31,7 +31,7 @@
QT_BEGIN_NAMESPACE
-Q_DECL_IMPORT extern double qstrtod(const char *s00, char const **se, bool *ok);
+Q_CORE_EXPORT double qstrtod(const char *s00, char const **se, bool *ok);
#define shiftWindowsLineBreak() \
do { \
diff --git a/src/xmlpatterns/data/qdecimal_p.h b/src/xmlpatterns/data/qdecimal_p.h
index d17b647..2a5e0b3 100644
--- a/src/xmlpatterns/data/qdecimal_p.h
+++ b/src/xmlpatterns/data/qdecimal_p.h
@@ -61,7 +61,7 @@ QT_BEGIN_NAMESPACE
/**
* Defined in QtCore's qlocale.cpp.
*/
-Q_DECL_IMPORT extern char *qdtoa(double d, int mode, int ndigits, int *decpt, int *sign, char **rve, char **resultp);
+Q_CORE_EXPORT char *qdtoa(double d, int mode, int ndigits, int *decpt, int *sign, char **rve, char **resultp);
namespace QPatternist
{