From 4204fdcc04e20eabd19704f2235ba06afa84605e Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Thu, 29 Oct 2009 17:32:57 +0100 Subject: Avoid infinite loop when laying out text with unconvertible chars When the stringToCMap() fails, it can be because it did not have enough space in the layout, or it can because of other errors. In order to implement "try-again" processing in a simple way, we had an infinite loop which assumed that stringToCMap() would always succeed in the second run (which would be the case if the only possible error was "not enough space".) Since there are other possible failures not related to the number of glyphs, you could easily get into an infinite loop here, e.g. when laying out text that contains the Byte Order Mark. The fix changes the implementation to explictly try stringToCMap() twice at max, and is also how it's implemented in the default qtextengine.cpp. Task-number: QTBUG-4680 Reviewed-by: Trond Conflicts: src/gui/text/qtextengine_mac.cpp tests/auto/qtextlayout/tst_qtextlayout.cpp --- src/gui/text/qtextengine_mac.cpp | 77 ++++++++++++++---------------- tests/auto/qtextlayout/tst_qtextlayout.cpp | 14 ++++++ 2 files changed, 51 insertions(+), 40 deletions(-) diff --git a/src/gui/text/qtextengine_mac.cpp b/src/gui/text/qtextengine_mac.cpp index 4f20094..e35f9e0 100644 --- a/src/gui/text/qtextengine_mac.cpp +++ b/src/gui/text/qtextengine_mac.cpp @@ -595,53 +595,50 @@ void QTextEngine::shapeTextMac(int item) const str = reinterpret_cast(uc); } - while (true) { - ensureSpace(num_glyphs); - num_glyphs = layoutData->glyphLayout.numGlyphs - layoutData->used; - - QGlyphLayout g = availableGlyphs(&si); - g.numGlyphs = num_glyphs; - unsigned short *log_clusters = logClusters(&si); - - if (fe->stringToCMap(str, - len, - &g, - &num_glyphs, - flags, - log_clusters, - attributes())) { - - heuristicSetGlyphAttributes(str, len, &g, log_clusters, num_glyphs); - break; - } + ensureSpace(num_glyphs); + num_glyphs = layoutData->glyphLayout.numGlyphs - layoutData->used; + + QGlyphLayout g = availableGlyphs(&si); + g.numGlyphs = num_glyphs; + unsigned short *log_clusters = logClusters(&si); + + bool stringToCMapFailed = false; + if (!fe->stringToCMap(str, len, &g, &num_glyphs, flags, log_clusters, attributes())) { + ensureSpace(num_glyphs); + stringToCMapFailed = fe->stringToCMap(str, len, &g, &num_glyphs, flags, log_clusters, + attributes()); } - si.num_glyphs = num_glyphs; + if (!stringToCMapFailed) { + heuristicSetGlyphAttributes(str, len, &g, log_clusters, num_glyphs); - layoutData->used += si.num_glyphs; + si.num_glyphs = num_glyphs; - QGlyphLayout g = shapedGlyphs(&si); + layoutData->used += si.num_glyphs; - if (si.analysis.script == QUnicodeTables::Arabic) { - QVarLengthArray props(len + 2); - QArabicProperties *properties = props.data(); - int f = si.position; - int l = len; - if (f > 0) { - --f; - ++l; - ++properties; - } - if (f + l < layoutData->string.length()) { - ++l; - } - qt_getArabicProperties((const unsigned short *)(layoutData->string.unicode()+f), l, props.data()); + QGlyphLayout g = shapedGlyphs(&si); - unsigned short *log_clusters = logClusters(&si); + if (si.analysis.script == QUnicodeTables::Arabic) { + QVarLengthArray props(len + 2); + QArabicProperties *properties = props.data(); + int f = si.position; + int l = len; + if (f > 0) { + --f; + ++l; + ++properties; + } + if (f + l < layoutData->string.length()) { + ++l; + } + qt_getArabicProperties((const unsigned short *)(layoutData->string.unicode()+f), l, props.data()); - for (int i = 0; i < len; ++i) { - int gpos = log_clusters[i]; - g.attributes[gpos].justification = properties[i].justification; + unsigned short *log_clusters = logClusters(&si); + + for (int i = 0; i < len; ++i) { + int gpos = log_clusters[i]; + g.attributes[gpos].justification = properties[i].justification; + } } } diff --git a/tests/auto/qtextlayout/tst_qtextlayout.cpp b/tests/auto/qtextlayout/tst_qtextlayout.cpp index a5fed4e..b02a704 100644 --- a/tests/auto/qtextlayout/tst_qtextlayout.cpp +++ b/tests/auto/qtextlayout/tst_qtextlayout.cpp @@ -119,6 +119,7 @@ private slots: void smallTextLengthWordWrap(); void smallTextLengthWrapAtWordBoundaryOrAnywhere(); void testLineBreakingAllSpaces(); + void lineWidthFromBOM(); private: @@ -1277,5 +1278,18 @@ void tst_QTextLayout::widthOfTabs() QCOMPARE(qRound(engine.width(0, 5)), qRound(engine.boundingBox(0, 5).width)); } +void tst_QTextLayout::lineWidthFromBOM() +{ + const QString string(QChar(0xfeff)); // BYTE ORDER MARK + QTextLayout layout(string); + layout.beginLayout(); + QTextLine line = layout.createLine(); + line.setLineWidth(INT_MAX / 256); + layout.endLayout(); + + // Don't spin into an infinite loop + } + + QTEST_MAIN(tst_QTextLayout) #include "tst_qtextlayout.moc" -- cgit v0.12 From acde9118f87ebd5aba5904072e40997a2a155d13 Mon Sep 17 00:00:00 2001 From: Rhys Weatherley Date: Mon, 2 Nov 2009 09:09:06 +1000 Subject: Make screen rotation work properly with the PowerVR screen driver Task-number: QT-2261 Reviewed-by: Tom Back port of 75719e4e06882825fe056935d782b4153bf0ac5b --- .../gfxdrivers/powervr/QWSWSEGL/pvrqwsdrawable.c | 10 ++++ .../gfxdrivers/powervr/QWSWSEGL/pvrqwsdrawable.h | 3 + .../gfxdrivers/powervr/QWSWSEGL/pvrqwsdrawable_p.h | 1 + .../gfxdrivers/powervr/QWSWSEGL/pvrqwswsegl.c | 14 ++++- src/plugins/gfxdrivers/powervr/README | 5 ++ .../powervr/pvreglscreen/pvreglscreen.cpp | 67 +++++++++++++++++++++- .../gfxdrivers/powervr/pvreglscreen/pvreglscreen.h | 9 ++- .../powervr/pvreglscreen/pvreglwindowsurface.cpp | 54 ++++++++++++++++- .../powervr/pvreglscreen/pvreglwindowsurface.h | 8 ++- 9 files changed, 162 insertions(+), 9 deletions(-) diff --git a/src/plugins/gfxdrivers/powervr/QWSWSEGL/pvrqwsdrawable.c b/src/plugins/gfxdrivers/powervr/QWSWSEGL/pvrqwsdrawable.c index ac9dc8d..c1b655a 100644 --- a/src/plugins/gfxdrivers/powervr/QWSWSEGL/pvrqwsdrawable.c +++ b/src/plugins/gfxdrivers/powervr/QWSWSEGL/pvrqwsdrawable.c @@ -617,6 +617,16 @@ void pvrQwsGetGeometry(PvrQwsDrawable *drawable, PvrQwsRect *rect) *rect = drawable->rect; } +void pvrQwsSetRotation(PvrQwsDrawable *drawable, int angle) +{ + if (drawable->rotationAngle != angle) { + drawable->rotationAngle = angle; + + /* Force the buffers to be recreated if the rotation angle changes */ + pvrQwsInvalidateBuffers(drawable); + } +} + int pvrQwsGetStride(PvrQwsDrawable *drawable) { if (drawable->backBuffersValid) diff --git a/src/plugins/gfxdrivers/powervr/QWSWSEGL/pvrqwsdrawable.h b/src/plugins/gfxdrivers/powervr/QWSWSEGL/pvrqwsdrawable.h index 952ff6f..b9e035f 100644 --- a/src/plugins/gfxdrivers/powervr/QWSWSEGL/pvrqwsdrawable.h +++ b/src/plugins/gfxdrivers/powervr/QWSWSEGL/pvrqwsdrawable.h @@ -126,6 +126,9 @@ void pvrQwsSetGeometry(PvrQwsDrawable *drawable, const PvrQwsRect *rect); /* Get the current geometry for a drawable */ void pvrQwsGetGeometry(PvrQwsDrawable *drawable, PvrQwsRect *rect); +/* Set the rotation angle in degrees */ +void pvrQwsSetRotation(PvrQwsDrawable *drawable, int angle); + /* Get the line stride for a drawable. Returns zero if the buffers are not allocated or have been invalidated */ int pvrQwsGetStride(PvrQwsDrawable *drawable); diff --git a/src/plugins/gfxdrivers/powervr/QWSWSEGL/pvrqwsdrawable_p.h b/src/plugins/gfxdrivers/powervr/QWSWSEGL/pvrqwsdrawable_p.h index cf80a90..dcd4e4f 100644 --- a/src/plugins/gfxdrivers/powervr/QWSWSEGL/pvrqwsdrawable_p.h +++ b/src/plugins/gfxdrivers/powervr/QWSWSEGL/pvrqwsdrawable_p.h @@ -114,6 +114,7 @@ struct _PvrQwsDrawable int isFullScreen; int strideBytes; int stridePixels; + int rotationAngle; PvrQwsSwapFunction swapFunction; void *userData; PvrQwsDrawable *nextWinId; diff --git a/src/plugins/gfxdrivers/powervr/QWSWSEGL/pvrqwswsegl.c b/src/plugins/gfxdrivers/powervr/QWSWSEGL/pvrqwswsegl.c index 253f39f..28b2251 100644 --- a/src/plugins/gfxdrivers/powervr/QWSWSEGL/pvrqwswsegl.c +++ b/src/plugins/gfxdrivers/powervr/QWSWSEGL/pvrqwswsegl.c @@ -132,6 +132,16 @@ static WSEGLError wseglCloseDisplay(WSEGLDisplayHandle display) return WSEGL_SUCCESS; } +static WSEGLRotationAngle wseglRotationValue(int degrees) +{ + switch (degrees) { + case 90: return WSEGL_ROTATE_90; + case 180: return WSEGL_ROTATE_180; + case 270: return WSEGL_ROTATE_270; + default: return WSEGL_ROTATE_0; + } +} + /* Create the WSEGL drawable version of a native window */ static WSEGLError wseglCreateWindowDrawable (WSEGLDisplayHandle display, WSEGLConfig *config, @@ -152,7 +162,7 @@ static WSEGLError wseglCreateWindowDrawable *drawable = (WSEGLDrawableHandle)screen; if (!pvrQwsAllocBuffers(screen)) return WSEGL_OUT_OF_MEMORY; - *rotationAngle = WSEGL_ROTATE_0; + *rotationAngle = wseglRotationValue(screen->rotationAngle); return WSEGL_SUCCESS; } @@ -163,7 +173,7 @@ static WSEGLError wseglCreateWindowDrawable /* The drawable is ready to go */ *drawable = (WSEGLDrawableHandle)draw; - *rotationAngle = WSEGL_ROTATE_0; + *rotationAngle = wseglRotationValue(draw->rotationAngle); if (!pvrQwsAllocBuffers(draw)) return WSEGL_OUT_OF_MEMORY; return WSEGL_SUCCESS; diff --git a/src/plugins/gfxdrivers/powervr/README b/src/plugins/gfxdrivers/powervr/README index 4dce87f..322a6b2 100644 --- a/src/plugins/gfxdrivers/powervr/README +++ b/src/plugins/gfxdrivers/powervr/README @@ -51,6 +51,11 @@ on the device with: hellogl_es -qws +The driver also supports screen rotation if Qt is configured with the +-qt-gfx-transformed option and the QWS_DISPLAY variable is wrapped in a +"Transformed" declaration: + + Transformed:powervr:mmWidth40:mmHeight54:Rot90:0 Know Issues: * A QGLWidget may not have window decorations if it is a top-level window. diff --git a/src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglscreen.cpp b/src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglscreen.cpp index 6696672..2e4c6d1 100644 --- a/src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglscreen.cpp +++ b/src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglscreen.cpp @@ -44,6 +44,9 @@ #include "pvrqwsdrawable_p.h" #include #include +#ifndef QT_NO_QWS_TRANSFORMED +#include +#endif #include #include #include @@ -60,6 +63,7 @@ PvrEglScreen::PvrEglScreen(int displayId) ttyfd = -1; doGraphicsMode = true; oldKdMode = KD_TEXT; + parent = 0; // Make sure that the EGL layer is initialized and the drivers loaded. EGLDisplay dpy = eglGetDisplay((EGLNativeDisplayType)EGL_DEFAULT_DISPLAY); @@ -189,7 +193,7 @@ bool PvrEglScreen::hasOpenGL() QWSWindowSurface* PvrEglScreen::createSurface(QWidget *widget) const { if (qobject_cast(widget)) - return new PvrEglWindowSurface(widget, (QScreen *)this, displayId); + return new PvrEglWindowSurface(widget, (PvrEglScreen *)this, displayId); return QScreen::createSurface(widget); } @@ -202,6 +206,67 @@ QWSWindowSurface* PvrEglScreen::createSurface(const QString &key) const return QScreen::createSurface(key); } +#ifndef QT_NO_QWS_TRANSFORMED + +static const QScreen *parentScreen + (const QScreen *current, const QScreen *lookingFor) +{ + if (!current) + return 0; + switch (current->classId()) { + case QScreen::ProxyClass: + case QScreen::TransformedClass: { + const QScreen *child = + static_cast(current)->screen(); + if (child == lookingFor) + return current; + else + return parentScreen(child, lookingFor); + } + // Not reached. + + case QScreen::MultiClass: { + QList screens = current->subScreens(); + foreach (QScreen *screen, screens) { + if (screen == lookingFor) + return current; + const QScreen *parent = parentScreen(screen, lookingFor); + if (parent) + return parent; + } + } + break; + + default: break; + } + return 0; +} + +int PvrEglScreen::transformation() const +{ + // We need to search for our parent screen, which is assumed to be + // "Transformed". If it isn't, then there is no transformation. + // There is no direct method to get the parent screen so we need + // to search every screen until we find ourselves. + if (!parent && qt_screen != this) + parent = parentScreen(qt_screen, this); + if (!parent) + return 0; + if (parent->classId() != QScreen::TransformedClass) + return 0; + return 90 * static_cast(parent) + ->transformation(); +} + +#else + +int PvrEglScreen::transformation() const +{ + return 0; +} + +#endif + void PvrEglScreen::sync() { // Put code here to synchronize 2D and 3D operations if necessary. diff --git a/src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglscreen.h b/src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglscreen.h index 8bf42c7..5769e70 100644 --- a/src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglscreen.h +++ b/src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglscreen.h @@ -46,16 +46,18 @@ #include #include "pvrqwsdrawable.h" +class PvrEglScreen; + class PvrEglScreenSurfaceFunctions : public QGLScreenSurfaceFunctions { public: - PvrEglScreenSurfaceFunctions(QScreen *s, int screenNum) + PvrEglScreenSurfaceFunctions(PvrEglScreen *s, int screenNum) : screen(s), displayId(screenNum) {} bool createNativeWindow(QWidget *widget, EGLNativeWindowType *native); private: - QScreen *screen; + PvrEglScreen *screen; int displayId; }; @@ -80,6 +82,8 @@ public: QWSWindowSurface* createSurface(QWidget *widget) const; QWSWindowSurface* createSurface(const QString &key) const; + int transformation() const; + private: void sync(); void openTty(); @@ -89,6 +93,7 @@ private: int ttyfd, oldKdMode; QString ttyDevice; bool doGraphicsMode; + mutable const QScreen *parent; }; #endif diff --git a/src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglwindowsurface.cpp b/src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglwindowsurface.cpp index 2c5ac21..4a3787f 100644 --- a/src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglwindowsurface.cpp +++ b/src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglwindowsurface.cpp @@ -46,7 +46,7 @@ #include PvrEglWindowSurface::PvrEglWindowSurface - (QWidget *widget, QScreen *screen, int screenNum) + (QWidget *widget, PvrEglScreen *screen, int screenNum) : QWSGLWindowSurface(widget) { setSurfaceFlags(QWSWindowSurface::Opaque); @@ -63,6 +63,7 @@ PvrEglWindowSurface::PvrEglWindowSurface pvrRect.y = pos.y(); pvrRect.width = size.width(); pvrRect.height = size.height(); + transformRects(&pvrRect, 1); // Try to recover a previous PvrQwsDrawable object for the widget // if there is one. This can happen when a PvrEglWindowSurface @@ -75,6 +76,7 @@ PvrEglWindowSurface::PvrEglWindowSurface pvrQwsSetGeometry(drawable, &pvrRect); else drawable = pvrQwsCreateWindow(screenNum, (long)widget, &pvrRect); + pvrQwsSetRotation(drawable, screen->transformation()); } PvrEglWindowSurface::PvrEglWindowSurface() @@ -113,7 +115,9 @@ void PvrEglWindowSurface::setGeometry(const QRect &rect) pvrRect.y = rect.y(); pvrRect.width = rect.width(); pvrRect.height = rect.height(); + transformRects(&pvrRect, 1); pvrQwsSetGeometry(drawable, &pvrRect); + pvrQwsSetRotation(drawable, screen->transformation()); } QWSGLWindowSurface::setGeometry(rect); } @@ -127,7 +131,9 @@ bool PvrEglWindowSurface::move(const QPoint &offset) pvrRect.y = rect.y(); pvrRect.width = rect.width(); pvrRect.height = rect.height(); + transformRects(&pvrRect, 1); pvrQwsSetGeometry(drawable, &pvrRect); + pvrQwsSetRotation(drawable, screen->transformation()); } return QWSGLWindowSurface::move(offset); } @@ -200,7 +206,9 @@ void PvrEglWindowSurface::setDirectRegion(const QRegion &r, int id) pvrRect.y = rect.y(); pvrRect.width = rect.width(); pvrRect.height = rect.height(); + transformRects(&pvrRect, 1); pvrQwsSetVisibleRegion(drawable, &pvrRect, 1); + pvrQwsSetRotation(drawable, screen->transformation()); if (!pvrQwsSwapBuffers(drawable, 1)) screen->solidFill(QColor(0, 0, 0), region); } else { @@ -213,9 +221,53 @@ void PvrEglWindowSurface::setDirectRegion(const QRegion &r, int id) pvrRects[index].width = rect.width(); pvrRects[index].height = rect.height(); } + transformRects(pvrRects, rects.size()); pvrQwsSetVisibleRegion(drawable, pvrRects, rects.size()); + pvrQwsSetRotation(drawable, screen->transformation()); if (!pvrQwsSwapBuffers(drawable, 1)) screen->solidFill(QColor(0, 0, 0), region); delete [] pvrRects; } } + +void PvrEglWindowSurface::transformRects(PvrQwsRect *rects, int count) const +{ + switch (screen->transformation()) { + case 0: break; + + case 90: + { + for (int index = 0; index < count; ++index) { + int x = rects[index].y; + int y = screen->height() - (rects[index].x + rects[index].width); + rects[index].x = x; + rects[index].y = y; + qSwap(rects[index].width, rects[index].height); + } + } + break; + + case 180: + { + for (int index = 0; index < count; ++index) { + int x = screen->width() - (rects[index].x + rects[index].width); + int y = screen->height() - (rects[index].y + rects[index].height); + rects[index].x = x; + rects[index].y = y; + } + } + break; + + case 270: + { + for (int index = 0; index < count; ++index) { + int x = screen->width() - (rects[index].y + rects[index].height); + int y = rects[index].x; + rects[index].x = x; + rects[index].y = y; + qSwap(rects[index].width, rects[index].height); + } + } + break; + } +} diff --git a/src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglwindowsurface.h b/src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglwindowsurface.h index 58a5fb2..b0a161c 100644 --- a/src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglwindowsurface.h +++ b/src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglwindowsurface.h @@ -45,12 +45,12 @@ #include #include "pvrqwsdrawable.h" -class QScreen; +class PvrEglScreen; class PvrEglWindowSurface : public QWSGLWindowSurface { public: - PvrEglWindowSurface(QWidget *widget, QScreen *screen, int screenNum); + PvrEglWindowSurface(QWidget *widget, PvrEglScreen *screen, int screenNum); PvrEglWindowSurface(); ~PvrEglWindowSurface(); @@ -76,8 +76,10 @@ public: private: QWidget *widget; PvrQwsDrawable *drawable; - QScreen *screen; + PvrEglScreen *screen; QPaintDevice *pdevice; + + void transformRects(PvrQwsRect *rects, int count) const; }; #endif -- cgit v0.12 From 24c05a4db9ad398139de8d660347513b301aa911 Mon Sep 17 00:00:00 2001 From: Rhys Weatherley Date: Mon, 2 Nov 2009 09:09:34 +1000 Subject: Remove unnecessary PowerVR helper functions The cross-process memory sharing code never really worked in the way we needed it to - so remove it until something better comes along. Reviewed-by: trustme Back port of 04648b44f0784223122a782320d0b09b5c1e9497 --- .../gfxdrivers/powervr/QWSWSEGL/pvrqwsdrawable.c | 60 ---------------------- .../gfxdrivers/powervr/QWSWSEGL/pvrqwsdrawable.h | 15 ------ 2 files changed, 75 deletions(-) diff --git a/src/plugins/gfxdrivers/powervr/QWSWSEGL/pvrqwsdrawable.c b/src/plugins/gfxdrivers/powervr/QWSWSEGL/pvrqwsdrawable.c index c1b655a..17345a9 100644 --- a/src/plugins/gfxdrivers/powervr/QWSWSEGL/pvrqwsdrawable.c +++ b/src/plugins/gfxdrivers/powervr/QWSWSEGL/pvrqwsdrawable.c @@ -828,63 +828,3 @@ void pvrQwsSetSwapFunction drawable->swapFunction = func; drawable->userData = userData; } - -unsigned long pvrQwsGetMemoryId(PvrQwsDrawable *drawable) -{ - unsigned long addr; - unsigned long start; - unsigned long end; - unsigned long off; - unsigned long offset; - FILE *file; - char buffer[BUFSIZ]; - char flags[16]; - - if (!drawable->backBuffersValid) - return 0; - addr = (unsigned long) - (drawable->backBuffers[drawable->currentBackBuffer]->pBase); - - /* Search /proc/self/maps for the memory region that contains "addr". - The file offset for that memory region is the identifier we need */ - file = fopen("/proc/self/maps", "r"); - if (!file) { - perror("/proc/self/maps"); - return 0; - } - offset = 0; - while (fgets(buffer, sizeof(buffer), file)) { - if (sscanf(buffer, "%lx-%lx %s %lx", - &start, &end, flags, &off) < 4) - continue; - if (start <= addr && addr < end) { - offset = off; - break; - } - } - fclose(file); - return offset; -} - -void *pvrQwsMapMemory(unsigned long id, int size) -{ - void *addr; - int fd = open("/dev/pvrsrv", O_RDWR, 0); - if (fd < 0) { - perror("/dev/pvrsrv"); - return 0; - } - addr = mmap(0, (size_t)size, PROT_READ | PROT_WRITE, - MAP_SHARED, fd, (off_t)id); - if (addr == (void *)(-1)) { - perror("mmap pvr memory region"); - addr = 0; - } - close(fd); - return addr; -} - -void pvrQwsUnmapMemory(void *addr, int size) -{ - munmap(addr, size); -} diff --git a/src/plugins/gfxdrivers/powervr/QWSWSEGL/pvrqwsdrawable.h b/src/plugins/gfxdrivers/powervr/QWSWSEGL/pvrqwsdrawable.h index b9e035f..55e0310 100644 --- a/src/plugins/gfxdrivers/powervr/QWSWSEGL/pvrqwsdrawable.h +++ b/src/plugins/gfxdrivers/powervr/QWSWSEGL/pvrqwsdrawable.h @@ -162,21 +162,6 @@ int pvrQwsSwapBuffers(PvrQwsDrawable *drawable, int repaintOnly); void pvrQwsSetSwapFunction (PvrQwsDrawable *drawable, PvrQwsSwapFunction func, void *userData); -/* Get a memory identifier for the indicated drawable's buffer. - The identifier can be passed to another process and then - passed to pvrQwsMapMemory() to map the drawable's buffer into - the other process's address space. Returns zero if the - memory identifier could not be determined. This should only - be used for pixmap drawables */ -unsigned long pvrQwsGetMemoryId(PvrQwsDrawable *drawable); - -/* Map the memory buffer of a foreign application's drawable, as - indicated by "id" and "size". Returns null if the map failed */ -void *pvrQwsMapMemory(unsigned long id, int size); - -/* Unmap the memory obtained from pvrQwsMapMemory() */ -void pvrQwsUnmapMemory(void *addr, int size); - #ifdef __cplusplus }; #endif -- cgit v0.12 From 49134383c2fd81b9253207b70aaf2530526b044d Mon Sep 17 00:00:00 2001 From: Rhys Weatherley Date: Mon, 2 Nov 2009 09:09:51 +1000 Subject: The shipped pvr2d.h/wsegl.h for PowerVR do not work with MBX Reviewed-by: trustme Back port of 4ae09215de36fcfd17dc6875aca102d784d65012 --- src/plugins/gfxdrivers/powervr/README | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/plugins/gfxdrivers/powervr/README b/src/plugins/gfxdrivers/powervr/README index 322a6b2..513e7f5 100644 --- a/src/plugins/gfxdrivers/powervr/README +++ b/src/plugins/gfxdrivers/powervr/README @@ -31,9 +31,10 @@ strictly Unix-style markers. * IMPORTANT: To build the QScreen plugin and the WSEGL library it depends * * on, the pvr2d.h, wsegl.h headers for your platform are required. You * * can find a copy of these headers in src/3rdparty/powervr for SGX based * -* platforms like the TI OMAP3xxx. They may also work on MBX platforms too * -* depending on how old your libEGL is. You can tell Qt where to find * -* these headers by setting QMAKE_INCDIR_POWERVR in the mkspec. * +* platforms like the TI OMAP3xxx. They probably will not work on MBX * +* because of differences in the layout of certain PVR2D structures. * +* You can tell Qt where to find the actual headers for your system by * +* setting QMAKE_INCDIR_POWERVR in the mkspec. * *************************************************************************** When you start a Qt/Embedded application, you should modify the QWS_DISPLAY -- cgit v0.12 From 0dc3e7f6b482d359b10bfe4e0a3032644b77c94b Mon Sep 17 00:00:00 2001 From: Rhys Weatherley Date: Mon, 2 Nov 2009 09:10:09 +1000 Subject: Increase PowerVR memory alignment from 8 to 32 for SGX systems. Increasing the alignment does not seem to affect MBX. Back port of 7997279bc22d30bf1d1a30a567bda33ecc9aeb2d --- src/plugins/gfxdrivers/powervr/QWSWSEGL/pvrqwsdrawable.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/gfxdrivers/powervr/QWSWSEGL/pvrqwsdrawable.c b/src/plugins/gfxdrivers/powervr/QWSWSEGL/pvrqwsdrawable.c index 17345a9..a9c22ef 100644 --- a/src/plugins/gfxdrivers/powervr/QWSWSEGL/pvrqwsdrawable.c +++ b/src/plugins/gfxdrivers/powervr/QWSWSEGL/pvrqwsdrawable.c @@ -662,7 +662,7 @@ int pvrQwsAllocBuffers(PvrQwsDrawable *drawable) PVR2DMemFree(pvrQwsDisplay.context, drawable->backBuffers[index]); } } - drawable->stridePixels = (drawable->rect.width + 7) & ~7; + drawable->stridePixels = (drawable->rect.width + 31) & ~31; drawable->strideBytes = drawable->stridePixels * pvrQwsDisplay.screens[drawable->screen].bytesPerPixel; -- cgit v0.12 From 5b21746da4899a7d6dd78cf949e0a918c127fd49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Luthi?= Date: Wed, 26 Aug 2009 13:13:36 +0200 Subject: Fix a freeze in QFileDialog (Mac) Running an open file dialog, for example with QFileDialog::getOpenFileName() can lead to a freeze if the user selects a folder, then selects a file in the parent folder and finally confirms the open dialog. Merge-request: 1327 Reviewed-by: Richard Moe Gustavsen --- src/gui/dialogs/qfiledialog_mac.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/dialogs/qfiledialog_mac.mm b/src/gui/dialogs/qfiledialog_mac.mm index 3914ab1..8bca025 100644 --- a/src/gui/dialogs/qfiledialog_mac.mm +++ b/src/gui/dialogs/qfiledialog_mac.mm @@ -819,8 +819,8 @@ void QFileDialogPrivate::qt_mac_filedialog_event_proc(const NavEventCallbackMess || mode == QFileDialog::ExistingFiles){ // When changing directory, the current selection is cleared if // we are supposed to be selecting files only: - fileDialogPrivate->mCurrentSelectionList.clear(); if (!fileDialogPrivate->mCurrentSelection.isEmpty()){ + fileDialogPrivate->mCurrentSelectionList.clear(); fileDialogPrivate->mCurrentSelection.clear(); emit fileDialogPrivate->q_func()->currentChanged(fileDialogPrivate->mCurrentSelection); } -- cgit v0.12 From 5f7d92b32e375aa7c2d0acf69d1fc033c6fd476a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Mon, 2 Nov 2009 14:54:23 +0100 Subject: Disable the move-by-scrolling optimization. The current implementation fails when moving the widget onto an area that has just been exposed as a part of a window resize operation. --- src/gui/kernel/qwidget_mac.mm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm index db11815..89f2d02 100644 --- a/src/gui/kernel/qwidget_mac.mm +++ b/src/gui/kernel/qwidget_mac.mm @@ -3756,7 +3756,7 @@ void QWidgetPrivate::stackUnder_sys(QWidget *w) /* Modifies the bounds for a widgets backing HIView during moves and resizes. Also updates the widget, either by scrolling its contents or repainting, depending on the WA_StaticContents - and QWidgetPrivate::isOpaque flags. + flag */ static void qt_mac_update_widget_posisiton(QWidget *q, QRect oldRect, QRect newRect) { @@ -3773,8 +3773,8 @@ static void qt_mac_update_widget_posisiton(QWidget *q, QRect oldRect, QRect newR // Perform a normal (complete repaint) update in some cases: if ( - // move-by-scroll requires QWidgetPrivate::isOpaque set - (isMove && q->testAttribute(Qt::WA_OpaquePaintEvent) == false) || + // always repaint on move. + (isMove) || // limited update on resize requires WA_StaticContents. (isResize && q->testAttribute(Qt::WA_StaticContents) == false) || -- cgit v0.12 From 8325c15b21cd49287160c8dfb31ebf56ba3090ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Tue, 3 Nov 2009 15:34:35 +0100 Subject: Fix memory leak in the Mac accessibility module. Remove duplicate AXUIElement initialization in QAElment. (The duplicate code was erroneously merged in with the cocoa port.) RevBy: Richard Moe Gustavsen --- src/gui/accessible/qaccessible_mac.mm | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/gui/accessible/qaccessible_mac.mm b/src/gui/accessible/qaccessible_mac.mm index 46ef1e5..a875a5c 100644 --- a/src/gui/accessible/qaccessible_mac.mm +++ b/src/gui/accessible/qaccessible_mac.mm @@ -504,11 +504,6 @@ QAElement::QAElement(const QAElement &element) } QAElement::QAElement(HIObjectRef object, int child) - :elementRef( -#ifndef QT_MAC_USE_COCOA - AXUIElementCreateWithHIObjectAndIdentifier(object, child) -#endif -) { #ifndef QT_MAC_USE_COCOA if (object == 0) { -- cgit v0.12 From 47546dd3cae4cb6f1ca87621fb3752524f9d050d Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Wed, 4 Nov 2009 10:06:57 +0100 Subject: Compile on Mac OS X On Mac, there are compat overloads to e.g. setInternalTextureFormat() so we need to specify which function to call to avoid ambiguity. Reviewed-by: Samuel --- src/opengl/qglpixmapfilter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/opengl/qglpixmapfilter.cpp b/src/opengl/qglpixmapfilter.cpp index 8768fbc..0eaab28 100644 --- a/src/opengl/qglpixmapfilter.cpp +++ b/src/opengl/qglpixmapfilter.cpp @@ -518,7 +518,7 @@ bool QGLPixmapBlurFilter::processGL(QPainter *painter, const QPointF &pos, const m_singlePass = false; QGLFramebufferObjectFormat format; - format.setInternalTextureFormat(GL_RGBA); + format.setInternalTextureFormat(GLenum(GL_RGBA)); QGLFramebufferObject *fbo = qgl_fbo_pool()->acquire(targetRect.size() / 2, format, true); if (!fbo) -- cgit v0.12 From 0009fa533e4d5ca1a75ba3b56af082cdcfee55cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Wed, 4 Nov 2009 11:46:37 +0100 Subject: Missing % for printf variable Reviewed-by: Friedemann Kleint --- src/network/access/qnetworkaccessdebugpipebackend.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/network/access/qnetworkaccessdebugpipebackend.cpp b/src/network/access/qnetworkaccessdebugpipebackend.cpp index 4f7f15c..fecbe83 100644 --- a/src/network/access/qnetworkaccessdebugpipebackend.cpp +++ b/src/network/access/qnetworkaccessdebugpipebackend.cpp @@ -229,7 +229,7 @@ void QNetworkAccessDebugPipeBackend::possiblyFinish() void QNetworkAccessDebugPipeBackend::closeDownstreamChannel() { - qWarning("QNetworkAccessDebugPipeBackend::closeDownstreamChannel()",operation());; + qWarning("QNetworkAccessDebugPipeBackend::closeDownstreamChannel() %d",operation());; //if (operation() == QNetworkAccessManager::GetOperation) // socket.disconnectFromHost(); } @@ -237,7 +237,7 @@ void QNetworkAccessDebugPipeBackend::closeDownstreamChannel() void QNetworkAccessDebugPipeBackend::socketError() { - qWarning("QNetworkAccessDebugPipeBackend::socketError()", socket.error()); + qWarning("QNetworkAccessDebugPipeBackend::socketError() %d",socket.error()); QNetworkReply::NetworkError code; switch (socket.error()) { case QAbstractSocket::RemoteHostClosedError: -- cgit v0.12 From dfceed4535110d345b89658729b66bbdb2c3d7ca Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Wed, 4 Nov 2009 12:05:46 +0100 Subject: Fixed crash when QImage::createAlphaMask() runs out of memory Reviewed-by: Trond --- src/gui/image/qimage.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp index 571ef9d..21ca1e3 100644 --- a/src/gui/image/qimage.cpp +++ b/src/gui/image/qimage.cpp @@ -4083,7 +4083,8 @@ QImage QImage::createAlphaMask(Qt::ImageConversionFlags flags) const } QImage mask(d->width, d->height, Format_MonoLSB); - dither_to_Mono(mask.d, d, flags, true); + if (!mask.isNull()) + dither_to_Mono(mask.d, d, flags, true); return mask; } -- cgit v0.12 From 26ded29b31c71ff43036798015cb1c77aae427e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Trond=20Kjern=C3=A5sen?= Date: Wed, 4 Nov 2009 12:22:18 +0100 Subject: Fixed compilation and linking of EGL on Windows CE. Moved duplicated and broken code for setting up the include and library paths into the egl.prf feature file, which egl.pri and opengl.pro now includes using the qmake feature system. Task-number: QTBUG-5148 Reviewed-by: Tom Cooksey --- mkspecs/common/wince/qmake.conf | 1 + mkspecs/features/egl.prf | 32 +++++++++++++++++++++++++++++--- src/gui/egl/egl.pri | 10 ++-------- src/opengl/opengl.pro | 10 ++-------- 4 files changed, 34 insertions(+), 19 deletions(-) diff --git a/mkspecs/common/wince/qmake.conf b/mkspecs/common/wince/qmake.conf index d87be02..ff99f1b 100644 --- a/mkspecs/common/wince/qmake.conf +++ b/mkspecs/common/wince/qmake.conf @@ -64,6 +64,7 @@ QMAKE_LIBS_NETWORK = ws2.lib QMAKE_LIBS_OPENGL = QMAKE_LIBS_COMPAT = +QMAKE_LIBS_EGL = libEGL.lib QMAKE_LIBS_OPENGL_ES1 = libGLES_CM.lib QMAKE_LIBS_OPENGL_ES1CL = libGLES_CL.lib QMAKE_LIBS_OPENGL_ES2 = libGLESv2.lib diff --git a/mkspecs/features/egl.prf b/mkspecs/features/egl.prf index 22002c3..00f70d3 100644 --- a/mkspecs/features/egl.prf +++ b/mkspecs/features/egl.prf @@ -1,3 +1,29 @@ -!isEmpty(QMAKE_INCDIR_EGL): INCLUDEPATH += $$QMAKE_INCDIR_EGL -!isEmpty(QMAKE_LIBDIR_EGL): LIBS += -L$$QMAKE_LIBDIR_EGL -!isEmpty(QMAKE_LIBS_EGL): LIBS += $$QMAKE_LIBS_EGL +# On UNIX, we can use config tests to figure out if egl.h is in +# EGL/egl.h or GLES/egl.h. Sadly, there are no config tests on WinCE +# so we have to assume that for GLES 1.1 (CL), the EGL header is in +# GLES/egl.h. We also assume there is no separate libEGL.lib library, +# so we use the GL library instead. + +wince*:contains(QT_CONFIG, opengles1) { + INCLUDEPATH += $$QMAKE_INCDIR_OPENGL_ES1 + LIBS_PRIVATE += $$QMAKE_LIBS_OPENGL_ES1 + for(p, QMAKE_LIBDIR_OPENGL_ES1) { + exists($$p):LIBS_PRIVATE += -L$$p + } + DEFINES += QT_GLES_EGL +} else:wince*:contains(QT_CONFIG, opengles1cl) { + INCLUDEPATH += $$QMAKE_INCDIR_OPENGL_ES1CL + LIBS_PRIVATE += $$QMAKE_LIBS_OPENGL_ES1CL + LIBS += $$QMAKE_LFLAGS_EGL + for(p, QMAKE_LIBDIR_OPENGL_ES1CL) { + exists($$p):LIBS_PRIVATE += -L$$p + } + DEFINES += QT_GLES_EGL +} else { + INCLUDEPATH += $$QMAKE_INCDIR_EGL + LIBS_PRIVATE += $$QMAKE_LIBS_EGL + LIBS += $$QMAKE_LFLAGS_EGL + for(p, QMAKE_LIBDIR_EGL) { + exists($$p):LIBS_PRIVATE += -L$$p + } +} diff --git a/src/gui/egl/egl.pri b/src/gui/egl/egl.pri index 627d511..669d311 100644 --- a/src/gui/egl/egl.pri +++ b/src/gui/egl/egl.pri @@ -1,3 +1,5 @@ +CONFIG += egl + HEADERS += \ egl/qegl_p.h \ egl/qeglproperties_p.h @@ -19,11 +21,3 @@ unix { } } } - -for(p, QMAKE_LIBDIR_EGL) { - exists($$p):LIBS_PRIVATE += -L$$p -} - -!isEmpty(QMAKE_INCDIR_EGL): INCLUDEPATH += $$QMAKE_INCDIR_EGL -!isEmpty(QMAKE_LIBS_EGL): LIBS_PRIVATE += $$QMAKE_LIBS_EGL -!isEmpty(QMAKE_LFLAGS_EGL): LIBS += $$QMAKE_LFLAGS_EGL diff --git a/src/opengl/opengl.pro b/src/opengl/opengl.pro index 7d6052b..deaf3bd 100644 --- a/src/opengl/opengl.pro +++ b/src/opengl/opengl.pro @@ -15,14 +15,7 @@ contains(QT_CONFIG, opengl):CONFIG += opengl contains(QT_CONFIG, opengles1):CONFIG += opengles1 contains(QT_CONFIG, opengles1cl):CONFIG += opengles1cl contains(QT_CONFIG, opengles2):CONFIG += opengles2 - -contains(QT_CONFIG, opengles.*) { - for(p, QMAKE_LIBDIR_EGL) { - exists($$p):LIBS_PRIVATE += -L$$p - } - !isEmpty(QMAKE_INCDIR_EGL): INCLUDEPATH += $$QMAKE_INCDIR_EGL - !isEmpty(QMAKE_LIBS_EGL): LIBS_PRIVATE += $$QMAKE_LIBS_EGL -} +contains(QT_CONFIG, egl):CONFIG += egl HEADERS += qgl.h \ qgl_p.h \ @@ -163,3 +156,4 @@ contains(QT_CONFIG,opengles1) { LIBS_PRIVATE += $$QMAKE_LIBS_OPENGL LIBS += $$QMAKE_LFLAGS_OPENGL } + -- cgit v0.12 From 5b6815ba1d6d82687b8244172482bb089210c8d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Trond=20Kjern=C3=A5sen?= Date: Wed, 4 Nov 2009 13:11:15 +0100 Subject: Fixed hardcoded GL library names on WinCE. Task-number: QTBUG-5148 Reviewed-by: Tom Cooksey --- examples/opengl/hellogl_es/hellogl_es.pro | 9 --------- examples/opengl/hellogl_es2/hellogl_es2.pro | 6 ------ mkspecs/features/win32/opengl.prf | 12 ++++++++++-- src/opengl/opengl.pro | 17 +---------------- 4 files changed, 11 insertions(+), 33 deletions(-) diff --git a/examples/opengl/hellogl_es/hellogl_es.pro b/examples/opengl/hellogl_es/hellogl_es.pro index 3168743..80ef7df 100644 --- a/examples/opengl/hellogl_es/hellogl_es.pro +++ b/examples/opengl/hellogl_es/hellogl_es.pro @@ -20,15 +20,6 @@ HEADERS += bubble.h RESOURCES += texture.qrc QT += opengl -wince*:{ - contains(QT_CONFIG,opengles1) { - QMAKE_LIBS += "libGLES_CM.lib" - } - contains(QT_CONFIG,opengles1cl) { - QMAKE_LIBS += "libGLES_CL.lib" - } -} - # install target.path = $$[QT_INSTALL_EXAMPLES]/opengl/hellogl_es sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS hellogl_es.pro diff --git a/examples/opengl/hellogl_es2/hellogl_es2.pro b/examples/opengl/hellogl_es2/hellogl_es2.pro index d5ad4b8..92b4224 100644 --- a/examples/opengl/hellogl_es2/hellogl_es2.pro +++ b/examples/opengl/hellogl_es2/hellogl_es2.pro @@ -25,9 +25,3 @@ target.path = $$[QT_INSTALL_EXAMPLES]/opengl/hellogl_es2 sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS hellogl_es2.pro sources.path = $$[QT_INSTALL_EXAMPLES]/opengl/hellogl_es2 INSTALLS += target sources - - -wince*: { - QMAKE_LIBS += "libGLESv2.lib" - -} \ No newline at end of file diff --git a/mkspecs/features/win32/opengl.prf b/mkspecs/features/win32/opengl.prf index 30af2a3..3414781 100644 --- a/mkspecs/features/win32/opengl.prf +++ b/mkspecs/features/win32/opengl.prf @@ -1,3 +1,11 @@ -QMAKE_LIBS += $$QMAKE_LIBS_OPENGL -QMAKE_LFLAGS += $$QMAKE_LFLAGS_OPENGL +# WinCE does not have a platform directory for .prf files, and the +# win32 directory is searched for .prfs by qmake on WinCE. Ideally +# there should be a features/wince/opengl.prf which contains the wince +# block below. +wince* { + include(../unix/opengl.prf) +} else { + QMAKE_LIBS += $$QMAKE_LIBS_OPENGL + QMAKE_LFLAGS += $$QMAKE_LFLAGS_OPENGL +} diff --git a/src/opengl/opengl.pro b/src/opengl/opengl.pro index deaf3bd..b2474ed 100644 --- a/src/opengl/opengl.pro +++ b/src/opengl/opengl.pro @@ -54,7 +54,7 @@ SOURCES += qgl.cpp \ gl2paintengineex/qpaintengineex_opengl2_p.h \ gl2paintengineex/qglengineshadersource_p.h \ gl2paintengineex/qglcustomshaderstage_p.h \ - gl2paintengineex/qtriangulatingstroker_p.h + gl2paintengineex/qtriangulatingstroker_p.h SOURCES += qglshaderprogram.cpp \ qglpixmapfilter.cpp \ @@ -142,18 +142,3 @@ embedded { } INCLUDEPATH += ../3rdparty/harfbuzz/src - -contains(QT_CONFIG,opengles1) { - LIBS_PRIVATE += $$QMAKE_LIBS_OPENGL_ES1 - LIBS += $$QMAKE_LFLAGS_OPENGL_ES1 -} else:contains(QT_CONFIG,opengles1cl) { - LIBS_PRIVATE += $$QMAKE_LIBS_OPENGL_ES1CL - LIBS += $$QMAKE_LFLAGS_OPENGL_ES1CL -} else:contains(QT_CONFIG,opengles2) { - LIBS_PRIVATE += $$QMAKE_LIBS_OPENGL_ES2 - LIBS += $$QMAKE_LFLAGS_OPENGL_ES2 -} else { - LIBS_PRIVATE += $$QMAKE_LIBS_OPENGL - LIBS += $$QMAKE_LFLAGS_OPENGL -} - -- cgit v0.12 From d14cf629997e6cfc454af257f6f0df8ce5224363 Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Wed, 4 Nov 2009 14:25:23 +0100 Subject: Fixed crash with nullptr in QPixmapData::transformed Reviewed-By: Trond --- src/gui/image/qpixmap_x11.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/image/qpixmap_x11.cpp b/src/gui/image/qpixmap_x11.cpp index 8a0120a..c735031 100644 --- a/src/gui/image/qpixmap_x11.cpp +++ b/src/gui/image/qpixmap_x11.cpp @@ -1916,8 +1916,8 @@ QPixmap QX11PixmapData::transformed(const QTransform &transform, free(dptr); return bm; } else { // color pixmap - QPixmap pm; - QX11PixmapData *x11Data = static_cast(pm.data.data()); + QX11PixmapData *x11Data = new QX11PixmapData(QPixmapData::PixmapType); + QPixmap pm(x11Data); x11Data->flags &= ~QX11PixmapData::Uninitialized; x11Data->xinfo = xinfo; x11Data->d = d; -- cgit v0.12 From 77e5de0865f4a3810edc57ef5c8558200215b31c Mon Sep 17 00:00:00 2001 From: Andy Nichols Date: Wed, 4 Nov 2009 14:47:30 +0100 Subject: Doc: fix broken link in QBitmap Reviewed-by: Pierre --- src/gui/image/qbitmap.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/image/qbitmap.cpp b/src/gui/image/qbitmap.cpp index e081735..4b8d4b8 100644 --- a/src/gui/image/qbitmap.cpp +++ b/src/gui/image/qbitmap.cpp @@ -86,7 +86,7 @@ QT_BEGIN_NAMESPACE object. Just like the QPixmap class, QBitmap is optimized by the use of - implicit data sharing. For more information, see the {Implicit + implicit data sharing. For more information, see the \l {Implicit Data Sharing} documentation. \sa QPixmap, QImage, QImageReader, QImageWriter -- cgit v0.12 From 106148704ee1e73c7b71c4a1a2dcb64a1ac52727 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Wed, 4 Nov 2009 15:34:29 +0100 Subject: update harfbuzz to the latest version from fd.org This corresponds to commit e8a057fb67a0242e5a125d8cb2c823ad63e01449 in harfbuzz. The changes include fixes for an out of bounds read and QTBUG-5293. Task-Number: QTBUG-5293 Reviewed-by: Eskil --- src/3rdparty/harfbuzz/src/harfbuzz-arabic.c | 2 +- src/3rdparty/harfbuzz/src/harfbuzz-gpos.c | 6 +- src/3rdparty/harfbuzz/src/harfbuzz-hebrew.c | 3 +- src/3rdparty/harfbuzz/src/harfbuzz-indic.cpp | 117 ++++++++++++++++----------- src/3rdparty/harfbuzz/src/harfbuzz-open.c | 2 + src/3rdparty/harfbuzz/src/harfbuzz-shape.h | 2 +- src/3rdparty/harfbuzz/src/harfbuzz-shaper.h | 41 +++++----- src/3rdparty/harfbuzz/tests/shaping/main.cpp | 76 ++++++++++++++--- 8 files changed, 167 insertions(+), 82 deletions(-) diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-arabic.c b/src/3rdparty/harfbuzz/src/harfbuzz-arabic.c index 0609232..4d85c19 100644 --- a/src/3rdparty/harfbuzz/src/harfbuzz-arabic.c +++ b/src/3rdparty/harfbuzz/src/harfbuzz-arabic.c @@ -1009,7 +1009,7 @@ static HB_Bool arabicSyriacOpenTypeShape(HB_ShaperItem *item, HB_Bool *ot_ok) ++l; ++properties; } - if (f + l < item->stringLength) { + if (f + l + item->item.pos < item->stringLength) { ++l; } getArabicProperties(uc+f, l, props); diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-gpos.c b/src/3rdparty/harfbuzz/src/harfbuzz-gpos.c index c932ec2..356dc01 100644 --- a/src/3rdparty/harfbuzz/src/harfbuzz-gpos.c +++ b/src/3rdparty/harfbuzz/src/harfbuzz-gpos.c @@ -2059,15 +2059,17 @@ static void Free_BaseArray( HB_BaseArray* ba, HB_BaseRecord *br; HB_Anchor *bans; - HB_UNUSED(num_classes); - if ( ba->BaseRecord ) { br = ba->BaseRecord; if ( ba->BaseCount ) { + HB_UShort i, count; + count = num_classes * ba->BaseCount; bans = br[0].BaseAnchor; + for (i = 0; i < count; i++) + Free_Anchor (&bans[i]); FREE( bans ); } diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-hebrew.c b/src/3rdparty/harfbuzz/src/harfbuzz-hebrew.c index 533a063..2bda386 100644 --- a/src/3rdparty/harfbuzz/src/harfbuzz-hebrew.c +++ b/src/3rdparty/harfbuzz/src/harfbuzz-hebrew.c @@ -56,6 +56,8 @@ HB_Bool HB_HebrewShape(HB_ShaperItem *shaper_item) assert(shaper_item->item.script == HB_Script_Hebrew); + HB_HeuristicSetGlyphAttributes(shaper_item); + #ifndef NO_OPENTYPE if (HB_SelectScript(shaper_item, hebrew_features)) { @@ -64,7 +66,6 @@ HB_Bool HB_HebrewShape(HB_ShaperItem *shaper_item) return FALSE; - HB_HeuristicSetGlyphAttributes(shaper_item); HB_OpenTypeShape(shaper_item, /*properties*/0); return HB_OpenTypePosition(shaper_item, availableGlyphs, /*doLogClusters*/TRUE); } diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-indic.cpp b/src/3rdparty/harfbuzz/src/harfbuzz-indic.cpp index 7104d2a..48f4f90 100644 --- a/src/3rdparty/harfbuzz/src/harfbuzz-indic.cpp +++ b/src/3rdparty/harfbuzz/src/harfbuzz-indic.cpp @@ -419,7 +419,7 @@ static const unsigned char indicForms[0xe00-0x900] = { Matra, Halant, Invalid, Invalid, Invalid, Invalid, Invalid, Invalid, - Invalid, Invalid, Invalid, LengthMark, + Invalid, Invalid, Invalid, Matra, Invalid, Invalid, Invalid, Invalid, Invalid, Invalid, Invalid, Invalid, @@ -1050,62 +1050,59 @@ static const IndicOrdering * const indic_order[] = { // vowel matras that have to be split into two parts. static const unsigned short split_matras[] = { - // matra, split1, split2 + // matra, split1, split2, split3 // bengalis - 0x9cb, 0x9c7, 0x9be, - 0x9cc, 0x9c7, 0x9d7, + 0x9cb, 0x9c7, 0x9be, 0x0, + 0x9cc, 0x9c7, 0x9d7, 0x0, // oriya - 0xb48, 0xb47, 0xb56, - 0xb4b, 0xb47, 0xb3e, - 0xb4c, 0xb47, 0xb57, + 0xb48, 0xb47, 0xb56, 0x0, + 0xb4b, 0xb47, 0xb3e, 0x0, + 0xb4c, 0xb47, 0xb57, 0x0, // tamil - 0xbca, 0xbc6, 0xbbe, - 0xbcb, 0xbc7, 0xbbe, - 0xbcc, 0xbc6, 0xbd7, + 0xbca, 0xbc6, 0xbbe, 0x0, + 0xbcb, 0xbc7, 0xbbe, 0x0, + 0xbcc, 0xbc6, 0xbd7, 0x0, // telugu - 0xc48, 0xc46, 0xc56, + 0xc48, 0xc46, 0xc56, 0x0, // kannada - 0xcc0, 0xcbf, 0xcd5, - 0xcc7, 0xcc6, 0xcd5, - 0xcc8, 0xcc6, 0xcd6, - 0xcca, 0xcc6, 0xcc2, - 0xccb, 0xcca, 0xcd5, + 0xcc0, 0xcbf, 0xcd5, 0x0, + 0xcc7, 0xcc6, 0xcd5, 0x0, + 0xcc8, 0xcc6, 0xcd6, 0x0, + 0xcca, 0xcc6, 0xcc2, 0x0, + 0xccb, 0xcc6, 0xcc2, 0xcd5, // malayalam - 0xd4a, 0xd46, 0xd3e, - 0xd4b, 0xd47, 0xd3e, - 0xd4c, 0xd46, 0xd57, + 0xd4a, 0xd46, 0xd3e, 0x0, + 0xd4b, 0xd47, 0xd3e, 0x0, + 0xd4c, 0xd46, 0xd57, 0x0, // sinhala - 0xdda, 0xdd9, 0xdca, - 0xddc, 0xdd9, 0xdcf, - 0xddd, 0xddc, 0xdca, - 0xdde, 0xdd9, 0xddf, + 0xdda, 0xdd9, 0xdca, 0x0, + 0xddc, 0xdd9, 0xdcf, 0x0, + 0xddd, 0xdd9, 0xdcf, 0xdca, + 0xdde, 0xdd9, 0xddf, 0x0, 0xffff }; -static inline void splitMatra(unsigned short *reordered, int matra, int &len, int &base) +static inline void splitMatra(unsigned short *reordered, int matra, int &len) { unsigned short matra_uc = reordered[matra]; //qDebug("matra=%d, reordered[matra]=%x", matra, reordered[matra]); const unsigned short *split = split_matras; while (split[0] < matra_uc) - split += 3; + split += 4; assert(*split == matra_uc); ++split; - if (indic_position(*split) == Pre) { - reordered[matra] = split[1]; - memmove(reordered + 1, reordered, len*sizeof(unsigned short)); - reordered[0] = split[0]; - base++; - } else { - memmove(reordered + matra + 1, reordered + matra, (len-matra)*sizeof(unsigned short)); - reordered[matra] = split[0]; - reordered[matra+1] = split[1]; - } - len++; + int added_chars = split[2] == 0x0 ? 1 : 2; + + memmove(reordered + matra + added_chars, reordered + matra, (len-matra)*sizeof(unsigned short)); + reordered[matra] = split[0]; + reordered[matra+1] = split[1]; + if(added_chars == 2) + reordered[matra+2] = split[2]; + len += added_chars; } #ifndef NO_OPENTYPE @@ -1130,12 +1127,23 @@ static const HB_OpenTypeFeature indic_features[] = { // #define INDIC_DEBUG #ifdef INDIC_DEBUG -#define IDEBUG qDebug +#define IDEBUG hb_debug +#include + +static void hb_debug(const char *msg, ...) +{ + va_list ap; + va_start(ap, msg); // use variable arg list + vfprintf(stderr, msg, ap); + va_end(ap); + fprintf(stderr, "\n"); +} + #else #define IDEBUG if(0) printf #endif -#ifdef INDIC_DEBUG +#if 0 //def INDIC_DEBUG static QString propertiesToString(int properties) { QString res; @@ -1386,12 +1394,12 @@ static bool indic_shape_syllable(HB_Bool openType, HB_ShaperItem *item, bool inv // to be at the beginning of the syllable, so we just move // them there now. if (matra_position == Split) { - splitMatra(uc, matra, len, base); + splitMatra(uc, matra, len); // Handle three-part matras (0xccb in Kannada) matra_position = indic_position(uc[matra]); - if (matra_position == Split) - splitMatra(uc, matra, len, base); - } else if (matra_position == Pre) { + } + + if (matra_position == Pre) { unsigned short m = uc[matra]; while (matra--) uc[matra+1] = uc[matra]; @@ -1609,11 +1617,11 @@ static bool indic_shape_syllable(HB_Bool openType, HB_ShaperItem *item, bool inv // halant always applies #ifdef INDIC_DEBUG - { - IDEBUG("OT properties:"); - for (int i = 0; i < len; ++i) - qDebug(" i: %s", ::propertiesToString(properties[i]).toLatin1().data()); - } +// { +// IDEBUG("OT properties:"); +// for (int i = 0; i < len; ++i) +// qDebug(" i: %s", ::propertiesToString(properties[i]).toLatin1().data()); +// } #endif // initialize @@ -1731,6 +1739,11 @@ static int indic_nextSyllableBoundary(HB_Script script, const HB_UChar16 *s, int if (script == HB_Script_Bengali && pos == 1 && (uc[0] == 0x0985 || uc[0] == 0x098f)) break; + // Sinhala uses the Halant as a component of certain matras. Allow these, but keep the state on Matra. + if (script == HB_Script_Sinhala && state == Matra) { + ++pos; + continue; + } goto finish; case Nukta: if (state == Consonant) @@ -1741,12 +1754,16 @@ static int indic_nextSyllableBoundary(HB_Script script, const HB_UChar16 *s, int break; // fall through case VowelMark: - if (state == Matra || state == IndependentVowel) + if (state == Matra || state == LengthMark || state == IndependentVowel) break; // fall through case Matra: if (state == Consonant || state == Nukta) break; + if (state == Matra) { + // ### needs proper testing for correct two/three part matras + break; + } // ### not sure if this is correct. If it is, does it apply only to Bengali or should // it work for all Indic languages? // the combination Independent_A + Vowel Sign AA is allowed. @@ -1762,6 +1779,10 @@ static int indic_nextSyllableBoundary(HB_Script script, const HB_UChar16 *s, int goto finish; case LengthMark: + if (state == Matra) { + // ### needs proper testing for correct two/three part matras + break; + } case IndependentVowel: case Invalid: case Other: diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-open.c b/src/3rdparty/harfbuzz/src/harfbuzz-open.c index cde5465..0fe1e4d 100644 --- a/src/3rdparty/harfbuzz/src/harfbuzz-open.c +++ b/src/3rdparty/harfbuzz/src/harfbuzz-open.c @@ -1114,6 +1114,8 @@ _HB_OPEN_Load_EmptyClassDefinition( HB_ClassDefinition* cd ) if ( ALLOC_ARRAY( cd->cd.cd1.ClassValueArray, 1, HB_UShort ) ) return error; + cd->loaded = TRUE; + return HB_Err_Ok; } diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-shape.h b/src/3rdparty/harfbuzz/src/harfbuzz-shape.h index 4f714a3..e4b5f9a 100644 --- a/src/3rdparty/harfbuzz/src/harfbuzz-shape.h +++ b/src/3rdparty/harfbuzz/src/harfbuzz-shape.h @@ -161,7 +161,7 @@ typedef enum { /* * Buffer for output */ -typedef struct _HB_GlyphBufer HB_GlyphBuffer; +typedef struct _HB_GlyphBuffer HB_GlyphBuffer; struct _HB_GlyphBuffer { int glyph_item_size; int total_glyphs; diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-shaper.h b/src/3rdparty/harfbuzz/src/harfbuzz-shaper.h index e8f5513..d2357f43 100644 --- a/src/3rdparty/harfbuzz/src/harfbuzz-shaper.h +++ b/src/3rdparty/harfbuzz/src/harfbuzz-shaper.h @@ -242,27 +242,30 @@ typedef struct HB_Font_ { void *userData; } HB_FontRec; -typedef struct { - const HB_UChar16 *string; - hb_uint32 stringLength; - HB_ScriptItem item; - HB_Font font; - HB_Face face; - int shaperFlags; /* HB_ShaperFlags */ - - HB_Bool glyphIndicesPresent; /* set to true if the glyph indicies are already setup in the glyphs array */ - hb_uint32 initialGlyphCount; - - hb_uint32 num_glyphs; /* in: available glyphs out: glyphs used/needed */ - HB_Glyph *glyphs; /* out parameter */ - HB_GlyphAttributes *attributes; /* out */ - HB_Fixed *advances; /* out */ - HB_FixedPoint *offsets; /* out */ - unsigned short *log_clusters; /* out */ +typedef struct HB_ShaperItem_ HB_ShaperItem; + +struct HB_ShaperItem_ { + const HB_UChar16 *string; /* input: the Unicode UTF16 text to be shaped */ + hb_uint32 stringLength; /* input: the length of the input in 16-bit words */ + HB_ScriptItem item; /* input: the current run to be shaped: a run of text all in the same script that is a substring of */ + HB_Font font; /* input: the font: scale, units and function pointers supplying glyph indices and metrics */ + HB_Face face; /* input: the shaper state; current script, access to the OpenType tables , etc. */ + int shaperFlags; /* input (unused) should be set to 0; intended to support flags defined in HB_ShaperFlag */ + HB_Bool glyphIndicesPresent; /* input: true if the array contains glyph indices ready to be shaped */ + hb_uint32 initialGlyphCount; /* input: if glyphIndicesPresent is true, the number of glyph indices in the array */ + + hb_uint32 num_glyphs; /* input: capacity of output arrays , , , , and ; */ + /* output: required capacity (may be larger than actual capacity) */ + + HB_Glyph *glyphs; /* output: indices of shaped glyphs */ + HB_GlyphAttributes *attributes; /* output: glyph attributes */ + HB_Fixed *advances; /* output: advances */ + HB_FixedPoint *offsets; /* output: offsets */ + unsigned short *log_clusters; /* output: for each output glyph, the index in the input of the start of its logical cluster */ /* internal */ - HB_Bool kerning_applied; /* out: kerning applied by shaper */ -} HB_ShaperItem; + HB_Bool kerning_applied; /* output: true if kerning was applied by the shaper */ +}; HB_Bool HB_ShapeItem(HB_ShaperItem *item); diff --git a/src/3rdparty/harfbuzz/tests/shaping/main.cpp b/src/3rdparty/harfbuzz/tests/shaping/main.cpp index 1a3ef4f..a7ea417 100644 --- a/src/3rdparty/harfbuzz/tests/shaping/main.cpp +++ b/src/3rdparty/harfbuzz/tests/shaping/main.cpp @@ -178,7 +178,7 @@ private slots: void telugu(); void kannada(); void malayalam(); - // sinhala missing + void sinhala(); void khmer(); void linearB(); @@ -510,6 +510,11 @@ void tst_QScriptEngine::bengali() { 0x151, 0x276, 0x172, 0x143, 0x0 } }, { { 0x9b0, 0x9cd, 0x995, 0x9be, 0x983, 0x0 }, { 0x151, 0x276, 0x172, 0x144, 0x0 } }, + // test decomposed two parts matras + { { 0x995, 0x9c7, 0x9be, 0x0 }, + { 0x179, 0x151, 0x172, 0x0 } }, + { { 0x995, 0x9c7, 0x9d7, 0x0 }, + { 0x179, 0x151, 0x17e, 0x0 } }, { {0}, {0} } }; @@ -638,15 +643,15 @@ void tst_QScriptEngine::bengali() if (face) { const ShapeTable shape_table [] = { { { 0x09a8, 0x09cd, 0x09af, 0x0 }, - { 0x0192, 0x0 } }, + { 0x01ca, 0x0 } }, { { 0x09b8, 0x09cd, 0x09af, 0x0 }, - { 0x01d6, 0x0 } }, + { 0x020e, 0x0 } }, { { 0x09b6, 0x09cd, 0x09af, 0x0 }, - { 0x01bc, 0x0 } }, + { 0x01f4, 0x0 } }, { { 0x09b7, 0x09cd, 0x09af, 0x0 }, - { 0x01c6, 0x0 } }, + { 0x01fe, 0x0 } }, { { 0x09b0, 0x09cd, 0x09a8, 0x09cd, 0x200d, 0x0 }, - { 0xd3, 0x12f, 0x0 } }, + { 0x10b, 0x167, 0x0 } }, { {0}, {0} } }; @@ -823,8 +828,9 @@ void tst_QScriptEngine::telugu() { 0xe6, 0xb3, 0x83, 0x0 } }, { { 0xc15, 0xc4d, 0xc30, 0xc48, 0x0 }, { 0xe6, 0xb3, 0x9f, 0x0 } }, - { {0}, {0} } - + { { 0xc15, 0xc46, 0xc56, 0x0 }, + { 0xe6, 0xb3, 0x0 } }, + { {0}, {0} } }; const ShapeTable *s = shape_table; @@ -867,7 +873,6 @@ void tst_QScriptEngine::kannada() { 0x0036, 0x00c1, 0x0 } }, { { 0x0cb0, 0x0ccd, 0x200d, 0x0c95, 0x0 }, { 0x0050, 0x00a7, 0x0 } }, - { {0}, {0} } }; @@ -891,6 +896,17 @@ void tst_QScriptEngine::kannada() { 0x00b0, 0x006c, 0x0 } }, { { 0x0cb7, 0x0ccd, 0x0 }, { 0x0163, 0x0 } }, + { { 0xc95, 0xcbf, 0xcd5, 0x0 }, + { 0x114, 0x73, 0x0 } }, + { { 0xc95, 0xcc6, 0xcd5, 0x0 }, + { 0x90, 0x6c, 0x73, 0x0 } }, + { { 0xc95, 0xcc6, 0xcd6, 0x0 }, + { 0x90, 0x6c, 0x74, 0x0 } }, + { { 0xc95, 0xcc6, 0xcc2, 0x0 }, + { 0x90, 0x6c, 0x69, 0x0 } }, + { { 0xc95, 0xcca, 0xcd5, 0x0 }, + { 0x90, 0x6c, 0x69, 0x73, 0x0 } }, + { {0}, {0} } }; @@ -943,7 +959,14 @@ void tst_QScriptEngine::malayalam() { 0x009e, 0x0 } }, { { 0x0d30, 0x0d4d, 0x200d, 0x0 }, { 0x009e, 0x0 } }, - + { { 0xd15, 0xd46, 0xd3e, 0x0 }, + { 0x5e, 0x34, 0x58, 0x0 } }, + { { 0xd15, 0xd47, 0xd3e, 0x0 }, + { 0x5f, 0x34, 0x58, 0x0 } }, + { { 0xd15, 0xd46, 0xd57, 0x0 }, + { 0x5e, 0x34, 0x65, 0x0 } }, + { { 0xd15, 0xd57, 0x0 }, + { 0x34, 0x65, 0x0 } }, { {0}, {0} } }; @@ -962,6 +985,39 @@ void tst_QScriptEngine::malayalam() } } +void tst_QScriptEngine::sinhala() +{ + { + FT_Face face = loadFace("FM-MalithiUW46.ttf"); + if (face) { + const ShapeTable shape_table [] = { + { { 0xd9a, 0xdd9, 0xdcf, 0x0 }, + { 0x4a, 0x61, 0x42, 0x0 } }, + { { 0xd9a, 0xdd9, 0xddf, 0x0 }, + { 0x4a, 0x61, 0x50, 0x0 } }, + { { 0xd9a, 0xdd9, 0xdca, 0x0 }, + { 0x4a, 0x62, 0x0 } }, + { { 0xd9a, 0xddc, 0xdca, 0x0 }, + { 0x4a, 0x61, 0x42, 0x41, 0x0 } }, + { { 0xd9a, 0xdda, 0x0 }, + { 0x4a, 0x62, 0x0 } }, + { { 0xd9a, 0xddd, 0x0 }, + { 0x4a, 0x61, 0x42, 0x41, 0x0 } }, + { {0}, {0} } + }; + + const ShapeTable *s = shape_table; + while (s->unicode[0]) { + QVERIFY( shaping(face, s, HB_Script_Sinhala) ); + ++s; + } + + FT_Done_Face(face); + } else { + QSKIP("couln't find FM-MalithiUW46.ttf", SkipAll); + } + } +} void tst_QScriptEngine::khmer() -- cgit v0.12 From 8734e9643c38970a3b3a4dfc1484a6ec5b9ce9f8 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Wed, 4 Nov 2009 15:18:19 +0100 Subject: updates to the test after harfbuzz update Updated the generator code to compile again on 4.6. Added test cases for QTBUG-5293, taken from harfbuzz Reviewed-by: Eskil --- tests/auto/qtextscriptengine/generate/generate.pro | 1 + tests/auto/qtextscriptengine/generate/main.cpp | 4 +- .../qtextscriptengine/tst_qtextscriptengine.cpp | 87 +++++++++++++++++++--- 3 files changed, 78 insertions(+), 14 deletions(-) diff --git a/tests/auto/qtextscriptengine/generate/generate.pro b/tests/auto/qtextscriptengine/generate/generate.pro index 355633d..354e0e5 100644 --- a/tests/auto/qtextscriptengine/generate/generate.pro +++ b/tests/auto/qtextscriptengine/generate/generate.pro @@ -5,6 +5,7 @@ TEMPLATE = app CONFIG -= moc INCLUDEPATH += . /usr/include/freetype2 +INCLUDEPATH += $$QT_SOURCE_TREE/src/3rdparty/harfbuzz/src # Input SOURCES += main.cpp diff --git a/tests/auto/qtextscriptengine/generate/main.cpp b/tests/auto/qtextscriptengine/generate/main.cpp index 853c726..15fbc47 100644 --- a/tests/auto/qtextscriptengine/generate/main.cpp +++ b/tests/auto/qtextscriptengine/generate/main.cpp @@ -40,7 +40,7 @@ ****************************************************************************/ -#include +#include #include #include #include @@ -85,7 +85,7 @@ void MyEdit::setText(const QString &str) result += "0x" + QString::number(str.at(i).unicode(), 16) + ", "; result += "0x0 },\n { "; for (int i = 0; i < e->layoutData->items[0].num_glyphs; ++i) - result += "0x" + QString::number(e->layoutData->glyphPtr[i].glyph, 16) + ", "; + result += "0x" + QString::number(e->layoutData->glyphLayout.glyphs[i], 16) + ", "; result += "0x0 } }"; setPlainText(result); diff --git a/tests/auto/qtextscriptengine/tst_qtextscriptengine.cpp b/tests/auto/qtextscriptengine/tst_qtextscriptengine.cpp index 226348a..78e0ce6 100644 --- a/tests/auto/qtextscriptengine/tst_qtextscriptengine.cpp +++ b/tests/auto/qtextscriptengine/tst_qtextscriptengine.cpp @@ -98,7 +98,7 @@ private slots: void telugu(); void kannada(); void malayalam(); - // sinhala missing + void sinhala(); void khmer(); void linearB(); @@ -379,7 +379,11 @@ void tst_QTextScriptEngine::bengali() { 0x151, 0x276, 0x172, 0x143, 0x0 } }, { { 0x9b0, 0x9cd, 0x995, 0x9be, 0x983, 0x0 }, { 0x151, 0x276, 0x172, 0x144, 0x0 } }, - + // test decomposed two parts matras + { { 0x995, 0x9c7, 0x9be, 0x0 }, + { 0x179, 0x151, 0x172, 0x0 } }, + { { 0x995, 0x9c7, 0x9d7, 0x0 }, + { 0x179, 0x151, 0x17e, 0x0 } }, { {0}, {0} } }; @@ -502,16 +506,16 @@ void tst_QTextScriptEngine::bengali() if (QFontDatabase().families(QFontDatabase::Bengali).contains("Likhan")) { QFont f("Likhan"); const ShapeTable shape_table [] = { - { { 0x09a8, 0x09cd, 0x09af, 0x0 }, - { 0x0192, 0x0 } }, + { { 0x9a8, 0x9cd, 0x9af, 0x0 }, + { 0x1ca, 0x0 } }, { { 0x09b8, 0x09cd, 0x09af, 0x0 }, - { 0x01d6, 0x0 } }, + { 0x020e, 0x0 } }, { { 0x09b6, 0x09cd, 0x09af, 0x0 }, - { 0x01bc, 0x0 } }, + { 0x01f4, 0x0 } }, { { 0x09b7, 0x09cd, 0x09af, 0x0 }, - { 0x01c6, 0x0 } }, + { 0x01fe, 0x0 } }, { { 0x09b0, 0x09cd, 0x09a8, 0x09cd, 0x200d, 0x0 }, - { 0xd3, 0x12f, 0x0 } }, + { 0x10b, 0x167, 0x0 } }, { {0}, {0} } }; @@ -647,6 +651,12 @@ void tst_QTextScriptEngine::tamil() { 0x0025, 0x0 } }, { { 0x0b83, 0x0b95, 0x0 }, { 0x0025, 0x0031, 0x0 } }, + { { 0xb95, 0xbc6, 0xbbe, 0x0 }, + { 0xa, 0x31, 0x7, 0x0 } }, + { { 0xb95, 0xbc7, 0xbbe, 0x0 }, + { 0xb, 0x31, 0x7, 0x0 } }, + { { 0xb95, 0xbc6, 0xbd7, 0x0 }, + { 0xa, 0x31, 0x40, 0x0 } }, { {0}, {0} } }; @@ -694,7 +704,9 @@ void tst_QTextScriptEngine::telugu() { 0xe6, 0xb3, 0x83, 0x0 } }, { { 0xc15, 0xc4d, 0xc30, 0xc48, 0x0 }, { 0xe6, 0xb3, 0x9f, 0x0 } }, - { {0}, {0} } + { { 0xc15, 0xc46, 0xc56, 0x0 }, + { 0xe6, 0xb3, 0x0 } }, + { {0}, {0} } }; @@ -762,7 +774,16 @@ void tst_QTextScriptEngine::kannada() { 0x00b0, 0x006c, 0x0 } }, { { 0x0cb7, 0x0ccd, 0x0 }, { 0x0163, 0x0 } }, - + { { 0xc95, 0xcbf, 0xcd5, 0x0 }, + { 0x114, 0x73, 0x0 } }, + { { 0xc95, 0xcc6, 0xcd5, 0x0 }, + { 0x90, 0x6c, 0x73, 0x0 } }, + { { 0xc95, 0xcc6, 0xcd6, 0x0 }, + { 0x90, 0x6c, 0x74, 0x0 } }, + { { 0xc95, 0xcc6, 0xcc2, 0x0 }, + { 0x90, 0x6c, 0x69, 0x0 } }, + { { 0xc95, 0xcca, 0xcd5, 0x0 }, + { 0x90, 0x6c, 0x69, 0x73, 0x0 } }, { {0}, {0} } }; @@ -816,8 +837,14 @@ void tst_QTextScriptEngine::malayalam() { 0x009e, 0x0 } }, { { 0x0d30, 0x0d4d, 0x200d, 0x0 }, { 0x009e, 0x0 } }, - - + { { 0xd15, 0xd46, 0xd3e, 0x0 }, + { 0x5e, 0x34, 0x58, 0x0 } }, + { { 0xd15, 0xd47, 0xd3e, 0x0 }, + { 0x5f, 0x34, 0x58, 0x0 } }, + { { 0xd15, 0xd46, 0xd57, 0x0 }, + { 0x5e, 0x34, 0x65, 0x0 } }, + { { 0xd15, 0xd57, 0x0 }, + { 0x34, 0x65, 0x0 } }, { {0}, {0} } }; @@ -836,6 +863,42 @@ void tst_QTextScriptEngine::malayalam() #endif } +void tst_QTextScriptEngine::sinhala() +{ +#if defined(Q_WS_X11) + { + if (QFontDatabase().families(QFontDatabase::Sinhala).contains("Malithi Web")) { + QFont f("Malithi Web"); + const ShapeTable shape_table [] = { + { { 0xd9a, 0xdd9, 0xdcf, 0x0 }, + { 0x4a, 0x61, 0x42, 0x0 } }, + { { 0xd9a, 0xdd9, 0xddf, 0x0 }, + { 0x4a, 0x61, 0x50, 0x0 } }, + { { 0xd9a, 0xdd9, 0xdca, 0x0 }, + { 0x4a, 0x62, 0x0 } }, + { { 0xd9a, 0xddc, 0xdca, 0x0 }, + { 0x4a, 0x61, 0x42, 0x41, 0x0 } }, + { { 0xd9a, 0xdda, 0x0 }, + { 0x4a, 0x62, 0x0 } }, + { { 0xd9a, 0xddd, 0x0 }, + { 0x4a, 0x61, 0x42, 0x41, 0x0 } }, + { {0}, {0} } + }; + + + const ShapeTable *s = shape_table; + while (s->unicode[0]) { + QVERIFY( shaping(f, s) ); + ++s; + } + } else { + QSKIP("couln't find Malithi Web", SkipAll); + } + } +#else + QSKIP("X11 specific test", SkipAll); +#endif +} void tst_QTextScriptEngine::khmer() -- cgit v0.12 From 4e5a1a77677540422cc69ec5c2b1341ca4b318f9 Mon Sep 17 00:00:00 2001 From: Tom Cooksey Date: Wed, 4 Nov 2009 15:23:22 +0100 Subject: Add QMacGLCompatTypes to QGLShaderProgram API --- src/opengl/qglshaderprogram.cpp | 50 +++++++++++++++++++++++++++++++++++++++++ src/opengl/qglshaderprogram.h | 11 +++++++++ 2 files changed, 61 insertions(+) diff --git a/src/opengl/qglshaderprogram.cpp b/src/opengl/qglshaderprogram.cpp index 080c3b2..e28c382 100644 --- a/src/opengl/qglshaderprogram.cpp +++ b/src/opengl/qglshaderprogram.cpp @@ -2827,4 +2827,54 @@ void QGLShaderProgram::shaderDestroyed() #endif +#ifdef Q_MAC_COMPAT_GL_FUNCTIONS +/*! \internal */ +void QGLShaderProgram::setUniformValue(int location, QMacCompatGLint value) +{ + setUniformValue(location, GLint(value)); +} + +/*! \internal */ +void QGLShaderProgram::setUniformValue(int location, QMacCompatGLuint value) +{ + setUniformValue(location, GLuint(value)); +} + +/*! \internal */ +void QGLShaderProgram::setUniformValue(const char *name, QMacCompatGLint value) +{ + setUniformValue(name, GLint(value)); +} + +/*! \internal */ +void QGLShaderProgram::setUniformValue(const char *name, QMacCompatGLuint value) +{ + setUniformValue(name, GLuint(value)); +} + +/*! \internal */ +void QGLShaderProgram::setUniformValueArray(int location, const QMacCompatGLint *values, int count) +{ + setUniformValueArray(location, (const GLint *)values, count); +} + +/*! \internal */ +void QGLShaderProgram::setUniformValueArray(int location, const QMacCompatGLuint *values, int count) +{ + setUniformValueArray(location, (const GLuint *)values, count); +} + +/*! \internal */ +void QGLShaderProgram::setUniformValueArray(const char *name, const QMacCompatGLint *values, int count) +{ + setUniformValueArray(name, (const GLint *)values, count); +} + +/*! \internal */ +void QGLShaderProgram::setUniformValueArray(const char *name, const QMacCompatGLuint *values, int count) +{ + setUniformValueArray(name, (const GLuint *)values, count); +} +#endif + QT_END_NAMESPACE diff --git a/src/opengl/qglshaderprogram.h b/src/opengl/qglshaderprogram.h index b7bd2d7..49c3364 100644 --- a/src/opengl/qglshaderprogram.h +++ b/src/opengl/qglshaderprogram.h @@ -181,6 +181,17 @@ public: int uniformLocation(const QByteArray& name) const; int uniformLocation(const QString& name) const; +#ifdef Q_MAC_COMPAT_GL_FUNCTIONS + void setUniformValue(int location, QMacCompatGLint value); + void setUniformValue(int location, QMacCompatGLuint value); + void setUniformValue(const char *name, QMacCompatGLint value); + void setUniformValue(const char *name, QMacCompatGLuint value); + void setUniformValueArray(int location, const QMacCompatGLint *values, int count); + void setUniformValueArray(int location, const QMacCompatGLuint *values, int count); + void setUniformValueArray(const char *name, const QMacCompatGLint *values, int count); + void setUniformValueArray(const char *name, const QMacCompatGLuint *values, int count); +#endif + void setUniformValue(int location, GLfloat value); void setUniformValue(int location, GLint value); void setUniformValue(int location, GLuint value); -- cgit v0.12 From 05eeb454e0fcc83db330ee7df33a800a6998fc30 Mon Sep 17 00:00:00 2001 From: Daniel Molkentin Date: Wed, 4 Nov 2009 15:39:17 +0100 Subject: eval: add key for the installer to grep for. Reviewed-By: con --- configure | 2 +- configure.exe | Bin 1171968 -> 1172480 bytes tools/configure/configureapp.cpp | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 9c3e417..611f4bf 100755 --- a/configure +++ b/configure @@ -4185,7 +4185,7 @@ fi if [ -n "$EVALKEY" ]; then cat > "$outpath/src/corelib/global/qconfig_eval.cpp" < Date: Wed, 4 Nov 2009 16:05:46 +0100 Subject: Add QT_NO_GRAPHICSEFFECT It depends on QT_NO_GRAPHICSVIEW for now, but it is possible to remove this dependency. Reviewed-by: paul --- src/corelib/global/qfeatures.h | 5 +++++ src/corelib/global/qfeatures.txt | 7 +++++++ src/gui/effects/qgraphicseffect.cpp | 2 ++ src/gui/effects/qgraphicseffect.h | 2 ++ src/gui/effects/qgraphicseffect_p.h | 2 ++ src/gui/image/qpixmapfilter.cpp | 3 +++ src/gui/image/qpixmapfilter_p.h | 2 ++ src/gui/kernel/qwidget.cpp | 19 ++++++++++++++++++- src/gui/kernel/qwidget.h | 2 ++ src/gui/kernel/qwidget_p.h | 6 ++++++ src/gui/painting/qbackingstore.cpp | 8 ++++++++ src/gui/painting/qbackingstore_p.h | 2 ++ 12 files changed, 59 insertions(+), 1 deletion(-) diff --git a/src/corelib/global/qfeatures.h b/src/corelib/global/qfeatures.h index 9b3e817..77785e8 100644 --- a/src/corelib/global/qfeatures.h +++ b/src/corelib/global/qfeatures.h @@ -632,6 +632,11 @@ #define QT_NO_COLORDIALOG #endif +// QGraphicsEffect +#if !defined(QT_NO_GRAPHICSEFFECT) && (defined(QT_NO_GRAPHICSVIEW)) +#define QT_NO_GRAPHICSEFFECT +#endif + // The Model/View Framework #if !defined(QT_NO_ITEMVIEWS) && (defined(QT_NO_RUBBERBAND) || defined(QT_NO_SCROLLAREA)) #define QT_NO_ITEMVIEWS diff --git a/src/corelib/global/qfeatures.txt b/src/corelib/global/qfeatures.txt index ff34006..ec4945f 100644 --- a/src/corelib/global/qfeatures.txt +++ b/src/corelib/global/qfeatures.txt @@ -491,6 +491,13 @@ Requires: SCROLLAREA Name: QGraphicsView SeeAlso: ??? +Feature: GRAPHICSEFFECT +Description: Supports the graphicseffect classes. +Section: Widgets +Requires: GRAPHICSVIEW +Name: QGraphicsEffect +SeeAlso: ??? + Feature: SPINWIDGET Description: Supports spinbox control widgets. Section: Widgets diff --git a/src/gui/effects/qgraphicseffect.cpp b/src/gui/effects/qgraphicseffect.cpp index 83f4f79..d7e838e 100644 --- a/src/gui/effects/qgraphicseffect.cpp +++ b/src/gui/effects/qgraphicseffect.cpp @@ -108,6 +108,7 @@ #include #include +#ifndef QT_NO_GRAPHICSEFFECT QT_BEGIN_NAMESPACE /*! @@ -1128,3 +1129,4 @@ void QGraphicsOpacityEffect::draw(QPainter *painter, QGraphicsEffectSource *sour QT_END_NAMESPACE +#endif //QT_NO_GRAPHICSEFFECT diff --git a/src/gui/effects/qgraphicseffect.h b/src/gui/effects/qgraphicseffect.h index 7335a25..5c73f4b 100644 --- a/src/gui/effects/qgraphicseffect.h +++ b/src/gui/effects/qgraphicseffect.h @@ -48,6 +48,7 @@ #include #include +#ifndef QT_NO_GRAPHICSEFFECT QT_BEGIN_HEADER QT_BEGIN_NAMESPACE @@ -302,6 +303,7 @@ private: QT_END_NAMESPACE QT_END_HEADER +#endif //QT_NO_GRAPHICSEFFECT #endif // QGRAPHICSEFFECT_H diff --git a/src/gui/effects/qgraphicseffect_p.h b/src/gui/effects/qgraphicseffect_p.h index 0ff5794..9a46a24 100644 --- a/src/gui/effects/qgraphicseffect_p.h +++ b/src/gui/effects/qgraphicseffect_p.h @@ -60,6 +60,7 @@ #include #include +#ifndef QT_NO_GRAPHICSEFFECT QT_BEGIN_NAMESPACE class QGraphicsEffectSourcePrivate : public QObjectPrivate @@ -179,5 +180,6 @@ public: QT_END_NAMESPACE +#endif //QT_NO_GRAPHICSEFFECT #endif // QGRAPHICSEFFECT_P_H diff --git a/src/gui/image/qpixmapfilter.cpp b/src/gui/image/qpixmapfilter.cpp index e50cc8b..d83ef2c 100644 --- a/src/gui/image/qpixmapfilter.cpp +++ b/src/gui/image/qpixmapfilter.cpp @@ -53,6 +53,7 @@ #include "private/qpaintengineex_p.h" #include "private/qpaintengine_raster_p.h" +#ifndef QT_NO_GRAPHICSEFFECT QT_BEGIN_NAMESPACE class QPixmapFilterPrivate : public QObjectPrivate @@ -1107,3 +1108,5 @@ void QPixmapDropShadowFilter::draw(QPainter *p, } QT_END_NAMESPACE + +#endif //QT_NO_GRAPHICSEFFECT diff --git a/src/gui/image/qpixmapfilter_p.h b/src/gui/image/qpixmapfilter_p.h index 6a96676..2573fc7 100644 --- a/src/gui/image/qpixmapfilter_p.h +++ b/src/gui/image/qpixmapfilter_p.h @@ -57,6 +57,7 @@ #include #include +#ifndef QT_NO_GRAPHICSEFFECT QT_BEGIN_HEADER QT_BEGIN_NAMESPACE @@ -191,4 +192,5 @@ QT_END_NAMESPACE QT_END_HEADER +#endif //QT_NO_GRAPHICSEFFECT #endif // QPIXMAPFILTER_H diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index 6a72cfa..386bf71 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -230,7 +230,9 @@ QWidgetPrivate::~QWidgetPrivate() if (extra) deleteExtra(); +#ifndef QT_NO_GRAPHICSEFFECT delete graphicsEffect; +#endif //QT_NO_GRAPHICSEFFECT } QWindowSurface *QWidgetPrivate::createDefaultWindowSurface() @@ -1793,6 +1795,7 @@ QRegion QWidgetPrivate::clipRegion() const return r; } +#ifndef QT_NO_GRAPHICSEFFECT void QWidgetPrivate::invalidateGraphicsEffectsRecursively() { Q_Q(QWidget); @@ -1807,6 +1810,7 @@ void QWidgetPrivate::invalidateGraphicsEffectsRecursively() w = w->parentWidget(); } while (w); } +#endif //QT_NO_GRAPHICSEFFECT void QWidgetPrivate::setDirtyOpaqueRegion() { @@ -1814,7 +1818,9 @@ void QWidgetPrivate::setDirtyOpaqueRegion() dirtyOpaqueChildren = true; +#ifndef QT_NO_GRAPHICSEFFECT invalidateGraphicsEffectsRecursively(); +#endif //QT_NO_GRAPHICSEFFECT if (q->isWindow()) return; @@ -1963,10 +1969,12 @@ void QWidgetPrivate::clipToEffectiveMask(QRegion ®ion) const const QWidget *w = q; QPoint offset; +#ifndef QT_NO_GRAPHICSEFFECT if (graphicsEffect) { w = q->parentWidget(); offset -= data.crect.topLeft(); } +#endif //QT_NO_GRAPHICSEFFECT while (w) { const QWidgetPrivate *wd = w->d_func(); @@ -2001,11 +2009,13 @@ void QWidgetPrivate::updateIsOpaque() // hw: todo: only needed if opacity actually changed setDirtyOpaqueRegion(); +#ifndef QT_NO_GRAPHICSEFFECT if (graphicsEffect) { // ### We should probably add QGraphicsEffect::isOpaque at some point. setOpaque(false); return; } +#endif //QT_NO_GRAPHICSEFFECT Q_Q(QWidget); #ifdef Q_WS_X11 @@ -5013,11 +5023,13 @@ void QWidget::render(QPainter *painter, const QPoint &targetOffset, \sa setGraphicsEffect() */ +#ifndef QT_NO_GRAPHICSEFFECT QGraphicsEffect *QWidget::graphicsEffect() const { Q_D(const QWidget); return d->graphicsEffect; } +#endif //QT_NO_GRAPHICSEFFECT /*! @@ -5036,6 +5048,7 @@ QGraphicsEffect *QWidget::graphicsEffect() const \sa graphicsEffect() */ +#ifndef QT_NO_GRAPHICSEFFECT void QWidget::setGraphicsEffect(QGraphicsEffect *effect) { Q_D(QWidget); @@ -5065,6 +5078,7 @@ void QWidget::setGraphicsEffect(QGraphicsEffect *effect) d->updateIsOpaque(); update(); } +#endif //QT_NO_GRAPHICSEFFECT bool QWidgetPrivate::isAboutToShow() const { @@ -5211,6 +5225,7 @@ void QWidgetPrivate::drawWidget(QPaintDevice *pdev, const QRegion &rgn, const QP return; Q_Q(QWidget); +#ifndef QT_NO_GRAPHICSEFFECT if (graphicsEffect && graphicsEffect->isEnabled()) { QGraphicsEffectSource *source = graphicsEffect->d_func()->source; QWidgetEffectSourcePrivate *sourced = static_cast @@ -5241,6 +5256,7 @@ void QWidgetPrivate::drawWidget(QPaintDevice *pdev, const QRegion &rgn, const QP return; } } +#endif //QT_NO_GRAFFICSEFFECT const bool asRoot = flags & DrawAsRoot; const bool alsoOnScreen = flags & DrawPaintOnScreen; @@ -5395,7 +5411,6 @@ void QWidgetPrivate::paintSiblingsRecursive(QPaintDevice *pdev, const QObjectLis QWidgetPrivate *wd = w->d_func(); const QPoint widgetPos(w->data->crect.topLeft()); const bool hasMask = wd->extra && wd->extra->hasMask && !wd->graphicsEffect; - if (index > 0) { QRegion wr(rgn); if (wd->isOpaque) @@ -5421,6 +5436,7 @@ void QWidgetPrivate::paintSiblingsRecursive(QPaintDevice *pdev, const QObjectLis } } +#ifndef QT_NO_GRAPHICSEFFECT QRectF QWidgetEffectSourcePrivate::boundingRect(Qt::CoordinateSystem system) const { if (system != Qt::DeviceCoordinates) @@ -5521,6 +5537,7 @@ QPixmap QWidgetEffectSourcePrivate::pixmap(Qt::CoordinateSystem system, QPoint * m_widget->render(&pixmap, pixmapOffset); return pixmap; } +#endif //QT_NO_GRAPHICSEFFECT #ifndef QT_NO_GRAPHICSVIEW /*! diff --git a/src/gui/kernel/qwidget.h b/src/gui/kernel/qwidget.h index 05f0069..b7c55f9 100644 --- a/src/gui/kernel/qwidget.h +++ b/src/gui/kernel/qwidget.h @@ -351,8 +351,10 @@ public: const QRegion &sourceRegion = QRegion(), RenderFlags renderFlags = RenderFlags(DrawWindowBackground | DrawChildren)); +#ifndef QT_NO_GRAPHICSEFFECT QGraphicsEffect *graphicsEffect() const; void setGraphicsEffect(QGraphicsEffect *effect); +#endif //QT_NO_GRAPHICSEFFECT void grabGesture(Qt::GestureType type, Qt::GestureFlags flags = Qt::GestureFlags()); void ungrabGesture(Qt::GestureType type); diff --git a/src/gui/kernel/qwidget_p.h b/src/gui/kernel/qwidget_p.h index 8b03a85..151b90a 100644 --- a/src/gui/kernel/qwidget_p.h +++ b/src/gui/kernel/qwidget_p.h @@ -384,7 +384,9 @@ public: void setOpaque(bool opaque); void updateIsTranslucent(); bool paintOnScreen() const; +#ifndef QT_NO_GRAPHICSEFFECT void invalidateGraphicsEffectsRecursively(); +#endif //QT_NO_GRAPHICSEFFECT const QRegion &getOpaqueChildren() const; void setDirtyOpaqueRegion(); @@ -530,8 +532,10 @@ public: inline QRect effectiveRectFor(const QRect &rect) const { +#ifndef QT_NO_GRAPHICSEFFECT if (graphicsEffect && graphicsEffect->isEnabled()) return graphicsEffect->boundingRectFor(rect).toAlignedRect(); +#endif //QT_NO_GRAPHICSEFFECT return rect; } @@ -774,6 +778,7 @@ struct QWidgetPaintContext QPainter *painter; }; +#ifndef QT_NO_GRAPHICSEFFECT class QWidgetEffectSourcePrivate : public QGraphicsEffectSourcePrivate { public: @@ -826,6 +831,7 @@ public: QTransform lastEffectTransform; bool updateDueToGraphicsEffect; }; +#endif //QT_NO_GRAPHICSEFFECT inline QWExtra *QWidgetPrivate::extraData() const { diff --git a/src/gui/painting/qbackingstore.cpp b/src/gui/painting/qbackingstore.cpp index f36470a..8226797 100644 --- a/src/gui/painting/qbackingstore.cpp +++ b/src/gui/painting/qbackingstore.cpp @@ -529,7 +529,9 @@ void QWidgetBackingStore::markDirty(const QRegion &rgn, QWidget *widget, bool up Q_ASSERT(widget->window() == tlw); Q_ASSERT(!rgn.isEmpty()); +#ifndef QT_NO_GRAPHICSEFFECT widget->d_func()->invalidateGraphicsEffectsRecursively(); +#endif //QT_NO_GRAPHICSEFFECT if (widget->d_func()->paintOnScreen()) { if (widget->d_func()->dirty.isEmpty()) { @@ -559,9 +561,11 @@ void QWidgetBackingStore::markDirty(const QRegion &rgn, QWidget *widget, bool up if (invalidateBuffer) { const bool eventAlreadyPosted = !dirty.isEmpty(); +#ifndef QT_NO_GRAPHICSEFFECT if (widget->d_func()->graphicsEffect) dirty += widget->d_func()->effectiveRectFor(rgn.boundingRect()).translated(offset); else +#endif //QT_NO_GRAPHICSEFFECT dirty += rgn.translated(offset); if (!eventAlreadyPosted || updateImmediately) sendUpdateRequest(tlw, updateImmediately); @@ -576,9 +580,11 @@ void QWidgetBackingStore::markDirty(const QRegion &rgn, QWidget *widget, bool up if (widget->d_func()->inDirtyList) { if (!qt_region_strictContains(widget->d_func()->dirty, widgetRect)) { +#ifndef QT_NO_GRAPHICSEFFECT if (widget->d_func()->graphicsEffect) widget->d_func()->dirty += widget->d_func()->effectiveRectFor(rgn.boundingRect()); else +#endif //QT_NO_GRAPHICSEFFECT widget->d_func()->dirty += rgn; } } else { @@ -606,7 +612,9 @@ void QWidgetBackingStore::markDirty(const QRect &rect, QWidget *widget, bool upd Q_ASSERT(widget->window() == tlw); Q_ASSERT(!rect.isEmpty()); +#ifndef QT_NO_GRAPHICSEFFECT widget->d_func()->invalidateGraphicsEffectsRecursively(); +#endif //QT_NO_GRAPHICSEFFECT if (widget->d_func()->paintOnScreen()) { if (widget->d_func()->dirty.isEmpty()) { diff --git a/src/gui/painting/qbackingstore_p.h b/src/gui/painting/qbackingstore_p.h index 3288dae..fbef980 100644 --- a/src/gui/painting/qbackingstore_p.h +++ b/src/gui/painting/qbackingstore_p.h @@ -146,9 +146,11 @@ private: { if (widget && !widget->d_func()->inDirtyList && !widget->data->in_destructor) { QWidgetPrivate *widgetPrivate = widget->d_func(); +#ifndef QT_NO_GRAPHICSEFFECT if (widgetPrivate->graphicsEffect) widgetPrivate->dirty = widgetPrivate->effectiveRectFor(rgn.boundingRect()); else +#endif //QT_NO_GRAPHICSEFFECT widgetPrivate->dirty = rgn; dirtyWidgets.append(widget); widgetPrivate->inDirtyList = true; -- cgit v0.12 From 55f0b7e5f3203fa6dfe6a149cf82f42b8b403006 Mon Sep 17 00:00:00 2001 From: Harald Fernengel Date: Wed, 4 Nov 2009 17:47:41 +0100 Subject: added my changes to the ChangeLog --- dist/changes-4.6.0 | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/dist/changes-4.6.0 b/dist/changes-4.6.0 index 61c3aa0..8292957 100644 --- a/dist/changes-4.6.0 +++ b/dist/changes-4.6.0 @@ -24,6 +24,11 @@ information about a particular change. now 0.93. +Third party components +---------------------- + + - Updated FreeType to version 2.3.9 + **************************************************************************** * Library * **************************************************************************** @@ -42,10 +47,20 @@ information about a particular change. - Qt::escape * now escape the double quote (") + - QScopedPointer + * New pointer class for cleaning up objects when leaving the + current scope + + - QFile + * Make QFile::resize() more robust when operating on buffered files + **************************************************************************** * Platform Specific Changes * **************************************************************************** + - Added community supported Qt ports for QNX and VxWorks. See platform + notes in the Qt documentation for details. + - Significant external contribution from Milan Burda for planned removal of (non-unicode) Windows 9x/ME support. @@ -65,6 +80,10 @@ information about a particular change. - On Windows CE the link time code geration has been disabled by default to be consistent with win32-msvc200x. + - Added QMAKE_LIBS_OPENGL_ES1, QMAKE_LIBS_OPENGL_ES1CL and + QMAKE_LIBS_OPENGL_ES2 qmake variables for specifying OpenGL ES + specific libraries. + **************************************************************************** * Tools * **************************************************************************** -- cgit v0.12 From ad3fa7ce6b8a36c2b23f0364f867713f63c6da3b Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Wed, 4 Nov 2009 18:55:46 +0100 Subject: Some of my changes in the changelog --- dist/changes-4.6.0 | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 56 insertions(+), 2 deletions(-) diff --git a/dist/changes-4.6.0 b/dist/changes-4.6.0 index 8292957..6a1f6f9 100644 --- a/dist/changes-4.6.0 +++ b/dist/changes-4.6.0 @@ -39,10 +39,14 @@ Third party components * Since the 4.6 beta Qt::RenderHint has been moved to QGraphicsBlurEffect::BlurHint. +QtCore + - QVariant * Many optimisations * Added QVariant::toFloat() and QVariant::toReal() * Added QVariant(float) constructor + * qvariant_cast and qVariantFromValue are now + identify functions - Qt::escape * now escape the double quote (") @@ -54,6 +58,53 @@ Third party components - QFile * Make QFile::resize() more robust when operating on buffered files + - QObject + * Added the possibility to pass the flag Qt::UniqueConnection to QObject::connect + * Fixed race conditions that occured when moving object to threads while connecting + +- QTextStream + * [221316] Fixed crash on large input. + +QtGui + + - QTreeView + * [234930] Be able to use :has-children and :has-sibillings in a stylesheet + * [252616] Set QStyleOptionViewItemV4::OnlyOne flag when painting spanning collumns + + - QTableView + * [234926] Fixed sorting after changing QTableView header + * [244651] Speed up table view with many spans + + - QTabBar + * [196326] Fixed having a stylesheet on a QTabBar resulted in some tab names + to be slightly clipped. + * [241383] Added ability to style the close tab button with style sheet + + - QComboBox + * [220195] Fixed keyboard search when current index is -1 + + - QSpinBox + * [259226] Fixed setting a stylesheet on a QSpinBox to change the arrow possition + + - QStandardItemModel + * [255652] Fixed crash while using takeRow with a QSortFilterProxyModel + + - QGraphicsItem + * Added a new set of properties to set a transformation on a item + + - QMenu + * [252610] Fixed position of the shortcut text while setting a stylesheet on menu items + + - QSortFilterProxyModel + * [251296] Fixed bugs in which filtered items could not be filtered. + + - QSplitter + * [206494] Added ability to style pressed slided with stylesheet + + - QWidget + * [201649] Added QWidget::previousInFocusChain + + **************************************************************************** * Platform Specific Changes * **************************************************************************** @@ -84,6 +135,9 @@ Third party components QMAKE_LIBS_OPENGL_ES2 qmake variables for specifying OpenGL ES specific libraries. + - KDE Integration: Improved the integration into KDE desktop (loading of KDE + palette, usage of KColorDialog and KFileDialog) using the GuiPlatformPlugin + **************************************************************************** * Tools * **************************************************************************** @@ -251,8 +305,8 @@ Third party components for all floating point numbers, and this can be changed using the new function setFloatingPointPrecision(). Set Qt_4_5 as the version of the QDataStream to get the behavior of previous versions. - + - On Mac OS X, QDesktopServices::storageLocation(DataLocation) now includes QCoreApplication::organizationName() and QCoreApplication::applicationName() if those are set. This matches the behavior on the other platforms. - + -- cgit v0.12 From b30cc1dbf2073a6591289b8600e6efd2bfb465a2 Mon Sep 17 00:00:00 2001 From: Jocelyn Turcotte Date: Wed, 4 Nov 2009 19:06:30 +0100 Subject: Updated WebKit from /home/jturcott/dev/webkit/ to qtwebkit/qtwebkit-4.6 ( 16aab1b39e14195abdc2100265da2e45b96b739f ) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Changes in WebKit/qt since the last update: ++ b/WebKit/qt/ChangeLog 2009-11-04 Yael Aharon Reviewed by Simon Hausmann. [Qt] REGRESSION: Allow applications to use their own QWidget bypassing QWebView. https://bugs.webkit.org/show_bug.cgi?id=30979 Decouple QWebViewPrivate from QWebPageClient, and automatically create QWebPageWidgetClient whenever the view is QWidget based. * Api/qwebpage.cpp: (QWebPageWidgetClient::QWebPageWidgetClient): (QWebPageWidgetClient::scroll): (QWebPageWidgetClient::update): (QWebPageWidgetClient::setInputMethodEnabled): (QWebPageWidgetClient::setInputMethodHint): (QWebPageWidgetClient::cursor): (QWebPageWidgetClient::updateCursor): (QWebPageWidgetClient::palette): (QWebPageWidgetClient::screenNumber): (QWebPageWidgetClient::ownerWidget): (QWebPageWidgetClient::pluginParent): (QWebPage::setView): * Api/qwebview.cpp: (QWebView::~QWebView): (QWebView::setPage): (QWebView::event): 2009-11-03 Andras Becsi Reviewed by Simon Hausmann. [Qt] Fix build of unit-test after r50454. * tests/qwebpage/tst_qwebpage.cpp: 2009-11-03 Simon Hausmann Reviewed by Tor Arne Vestbø. Make QWebPluginDatabase private API for now. https://bugs.webkit.org/show_bug.cgi?id=30775 * Api/headers.pri: * Api/qwebplugindatabase.cpp: * Api/qwebplugindatabase_p.h: Renamed from WebKit/qt/Api/qwebplugindatabase.h. * Api/qwebsettings.cpp: * Api/qwebsettings.h: * QtLauncher/main.cpp: (MainWindow::setupUI): * tests/tests.pro: 2009-11-03 Simon Hausmann Rubber-stamped by Tor Arne Vestbø. Oops, also remove the API docs of the removed networkRequestStarted() signal. * Api/qwebpage.cpp: 2009-11-03 Simon Hausmann Reviewed by Tor Arne Vestbø. Replace the QWebPage::networkRequestStarted() signal with the originatingObject property set to the QWebFrame that belongs to the request. https://bugs.webkit.org/show_bug.cgi?id=29975 * Api/qwebpage.h: * WebCoreSupport/FrameLoaderClientQt.cpp: (WebCore::FrameLoaderClientQt::dispatchDecidePolicyForNewWindowAction): (WebCore::FrameLoaderClientQt::dispatchDecidePolicyForNavigationAction): (WebCore::FrameLoaderClientQt::startDownload): * tests/qwebpage/tst_qwebpage.cpp: (tst_QWebPage::loadFinished): (TestNetworkManager::createRequest): (tst_QWebPage::originatingObjectInNetworkRequests): 2009-11-02 Jedrzej Nowacki Reviewed by Adam Barth. QWebView crash fix. The QWebView should not crash if the stop() method is called from a function triggered by the loadProgress signal. A null pointer protection was added in the ProgressTracker::incrementProgress. New autotest was created. https://bugs.webkit.org/show_bug.cgi?id=29425 * tests/qwebview/tst_qwebview.cpp: (WebViewCrashTest::WebViewCrashTest): (WebViewCrashTest::loading): (tst_QWebView::crashTests): 2009-10-30 Jocelyn Turcotte Reviewed by Tor Arne Vestbø. [Qt] Remove the QWebInspector::windowTitleChanged signal, QEvent::WindowTitleChange can be used to achieve the same. https://bugs.webkit.org/show_bug.cgi?id=30927 * Api/qwebinspector.cpp: * Api/qwebinspector.h: * WebCoreSupport/InspectorClientQt.cpp: (WebCore::InspectorClientQt::updateWindowTitle): 2009-10-29 Laszlo Gombos Reviewed by Tor Arne Vestbø. [Qt] Implement DELETE HTTP method for XmlHttpRequest https://bugs.webkit.org/show_bug.cgi?id=30894 No new tests as this functionality is already tested by the xmlhttprequest LayoutTests. As this patch depends on an unreleased version of the dependent QtNetwork library and the tests will be enabled later once the dependent library is released (and the buildbot is updated). * Api/qwebframe.cpp: (QWebFrame::load): --- .../webkit/JavaScriptCore/jit/JITStubs.cpp | 40 +------ .../webkit/JavaScriptCore/runtime/Collector.cpp | 8 +- src/3rdparty/webkit/VERSION | 4 +- src/3rdparty/webkit/WebCore/ChangeLog | 108 +++++++++++++++++ src/3rdparty/webkit/WebCore/WebCore.pro | 16 +-- .../webkit/WebCore/inspector/front-end/WebKit.qrc | 11 ++ .../webkit/WebCore/loader/ProgressTracker.cpp | 14 ++- src/3rdparty/webkit/WebCore/platform/FileSystem.h | 11 -- src/3rdparty/webkit/WebCore/platform/KURL.cpp | 4 +- .../platform/graphics/qt/ImageDecoderQt.cpp | 10 +- .../platform/network/qt/QNetworkReplyHandler.cpp | 19 +-- .../WebCore/platform/network/qt/ResourceRequest.h | 3 +- .../platform/network/qt/ResourceRequestQt.cpp | 5 +- .../webkit/WebCore/platform/qt/RenderThemeQt.cpp | 10 +- src/3rdparty/webkit/WebKit/qt/Api/headers.pri | 1 - .../webkit/WebKit/qt/Api/qgraphicswebview.cpp | 96 +-------------- src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp | 5 + .../webkit/WebKit/qt/Api/qwebinspector.cpp | 6 - src/3rdparty/webkit/WebKit/qt/Api/qwebinspector.h | 3 - src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp | 129 ++++++++++++++++----- src/3rdparty/webkit/WebKit/qt/Api/qwebpage.h | 2 - .../webkit/WebKit/qt/Api/qwebplugindatabase.cpp | 5 +- .../webkit/WebKit/qt/Api/qwebplugindatabase.h | 98 ---------------- .../webkit/WebKit/qt/Api/qwebplugindatabase_p.h | 98 ++++++++++++++++ src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.cpp | 5 +- src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.h | 2 +- src/3rdparty/webkit/WebKit/qt/Api/qwebview.cpp | 91 +-------------- src/3rdparty/webkit/WebKit/qt/ChangeLog | 129 +++++++++++++++++++++ .../qt/WebCoreSupport/FrameLoaderClientQt.cpp | 10 +- .../WebKit/qt/WebCoreSupport/InspectorClientQt.cpp | 1 - src/3rdparty/webkit/WebKit/qt/docs/qtwebkit.qdoc | 2 +- .../webkit/WebKit/qt/tests/qwebframe/qwebframe.pro | 2 +- .../WebKit/qt/tests/qwebframe/tst_qwebframe.cpp | 27 ++++- .../webkit/WebKit/qt/tests/qwebpage/qwebpage.pro | 2 +- .../WebKit/qt/tests/qwebpage/tst_qwebpage.cpp | 32 ++++- .../WebKit/qt/tests/qwebview/data/frame_a.html | 2 + .../WebKit/qt/tests/qwebview/data/index.html | 4 + .../webkit/WebKit/qt/tests/qwebview/qwebview.pro | 1 + .../WebKit/qt/tests/qwebview/tst_qwebview.cpp | 43 +++++++ .../WebKit/qt/tests/qwebview/tst_qwebview.qrc | 7 ++ src/3rdparty/webkit/WebKit/qt/tests/tests.pro | 2 +- 41 files changed, 628 insertions(+), 440 deletions(-) delete mode 100644 src/3rdparty/webkit/WebKit/qt/Api/qwebplugindatabase.h create mode 100644 src/3rdparty/webkit/WebKit/qt/Api/qwebplugindatabase_p.h create mode 100644 src/3rdparty/webkit/WebKit/qt/tests/qwebview/data/frame_a.html create mode 100644 src/3rdparty/webkit/WebKit/qt/tests/qwebview/data/index.html create mode 100644 src/3rdparty/webkit/WebKit/qt/tests/qwebview/tst_qwebview.qrc diff --git a/src/3rdparty/webkit/JavaScriptCore/jit/JITStubs.cpp b/src/3rdparty/webkit/JavaScriptCore/jit/JITStubs.cpp index 470ed0b..c999618 100644 --- a/src/3rdparty/webkit/JavaScriptCore/jit/JITStubs.cpp +++ b/src/3rdparty/webkit/JavaScriptCore/jit/JITStubs.cpp @@ -75,25 +75,12 @@ namespace JSC { #define THUMB_FUNC_PARAM(name) #endif -#if PLATFORM(LINUX) && (PLATFORM(X86_64) || PLATFORM(X86)) +#if PLATFORM(LINUX) && PLATFORM(X86_64) #define SYMBOL_STRING_RELOCATION(name) #name "@plt" #else #define SYMBOL_STRING_RELOCATION(name) SYMBOL_STRING(name) #endif -#if PLATFORM(DARWIN) - // Mach-O platform -#define HIDE_SYMBOL(name) ".private_extern _" #name -#elif PLATFORM(AIX) - // IBM's own file format -#define HIDE_SYMBOL(name) ".lglobl " #name -#elif PLATFORM(LINUX) || PLATFORM(FREEBSD) || PLATFORM(OPENBSD) || PLATFORM(SOLARIS) || (PLATFORM(HPUX) && PLATFORM(IA64)) || PLATFORM(SYMBIAN) || PLATFORM(NETBSD) - // ELF platform -#define HIDE_SYMBOL(name) ".hidden " #name -#else -#define HIDE_SYMBOL(name) -#endif - #if USE(JSVALUE32_64) #if COMPILER(GCC) && PLATFORM(X86) @@ -106,9 +93,7 @@ COMPILE_ASSERT(offsetof(struct JITStackFrame, callFrame) == 0x58, JITStackFrame_ COMPILE_ASSERT(offsetof(struct JITStackFrame, code) == 0x50, JITStackFrame_code_offset_matches_ctiTrampoline); asm volatile ( -".text\n" ".globl " SYMBOL_STRING(ctiTrampoline) "\n" -HIDE_SYMBOL(ctiTrampoline) "\n" SYMBOL_STRING(ctiTrampoline) ":" "\n" "pushl %ebp" "\n" "movl %esp, %ebp" "\n" @@ -129,7 +114,6 @@ SYMBOL_STRING(ctiTrampoline) ":" "\n" asm volatile ( ".globl " SYMBOL_STRING(ctiVMThrowTrampoline) "\n" -HIDE_SYMBOL(ctiVMThrowTrampoline) "\n" SYMBOL_STRING(ctiVMThrowTrampoline) ":" "\n" #if !USE(JIT_STUB_ARGUMENT_VA_LIST) "movl %esp, %ecx" "\n" @@ -145,7 +129,6 @@ SYMBOL_STRING(ctiVMThrowTrampoline) ":" "\n" asm volatile ( ".globl " SYMBOL_STRING(ctiOpThrowNotCaught) "\n" -HIDE_SYMBOL(ctiOpThrowNotCaught) "\n" SYMBOL_STRING(ctiOpThrowNotCaught) ":" "\n" "addl $0x3c, %esp" "\n" "popl %ebx" "\n" @@ -170,7 +153,6 @@ COMPILE_ASSERT(offsetof(struct JITStackFrame, code) == 0x80, JITStackFrame_code_ asm volatile ( ".globl " SYMBOL_STRING(ctiTrampoline) "\n" -HIDE_SYMBOL(ctiTrampoline) "\n" SYMBOL_STRING(ctiTrampoline) ":" "\n" "pushq %rbp" "\n" "movq %rsp, %rbp" "\n" @@ -197,7 +179,6 @@ SYMBOL_STRING(ctiTrampoline) ":" "\n" asm volatile ( ".globl " SYMBOL_STRING(ctiVMThrowTrampoline) "\n" -HIDE_SYMBOL(ctiVMThrowTrampoline) "\n" SYMBOL_STRING(ctiVMThrowTrampoline) ":" "\n" "movq %rsp, %rdi" "\n" "call " SYMBOL_STRING_RELOCATION(cti_vm_throw) "\n" @@ -213,7 +194,6 @@ SYMBOL_STRING(ctiVMThrowTrampoline) ":" "\n" asm volatile ( ".globl " SYMBOL_STRING(ctiOpThrowNotCaught) "\n" -HIDE_SYMBOL(ctiOpThrowNotCaught) "\n" SYMBOL_STRING(ctiOpThrowNotCaught) ":" "\n" "addq $0x48, %rsp" "\n" "popq %rbx" "\n" @@ -235,7 +215,6 @@ asm volatile ( ".text" "\n" ".align 2" "\n" ".globl " SYMBOL_STRING(ctiTrampoline) "\n" -HIDE_SYMBOL(ctiTrampoline) "\n" ".thumb" "\n" ".thumb_func " THUMB_FUNC_PARAM(ctiTrampoline) "\n" SYMBOL_STRING(ctiTrampoline) ":" "\n" @@ -262,7 +241,6 @@ asm volatile ( ".text" "\n" ".align 2" "\n" ".globl " SYMBOL_STRING(ctiVMThrowTrampoline) "\n" -HIDE_SYMBOL(ctiVMThrowTrampoline) "\n" ".thumb" "\n" ".thumb_func " THUMB_FUNC_PARAM(ctiVMThrowTrampoline) "\n" SYMBOL_STRING(ctiVMThrowTrampoline) ":" "\n" @@ -368,9 +346,7 @@ COMPILE_ASSERT(offsetof(struct JITStackFrame, code) == 0x30, JITStackFrame_code_ COMPILE_ASSERT(offsetof(struct JITStackFrame, savedEBX) == 0x1c, JITStackFrame_stub_argument_space_matches_ctiTrampoline); asm volatile ( -".text\n" ".globl " SYMBOL_STRING(ctiTrampoline) "\n" -HIDE_SYMBOL(ctiTrampoline) "\n" SYMBOL_STRING(ctiTrampoline) ":" "\n" "pushl %ebp" "\n" "movl %esp, %ebp" "\n" @@ -391,7 +367,6 @@ SYMBOL_STRING(ctiTrampoline) ":" "\n" asm volatile ( ".globl " SYMBOL_STRING(ctiVMThrowTrampoline) "\n" -HIDE_SYMBOL(ctiVMThrowTrampoline) "\n" SYMBOL_STRING(ctiVMThrowTrampoline) ":" "\n" #if !USE(JIT_STUB_ARGUMENT_VA_LIST) "movl %esp, %ecx" "\n" @@ -407,7 +382,6 @@ SYMBOL_STRING(ctiVMThrowTrampoline) ":" "\n" asm volatile ( ".globl " SYMBOL_STRING(ctiOpThrowNotCaught) "\n" -HIDE_SYMBOL(ctiOpThrowNotCaught) "\n" SYMBOL_STRING(ctiOpThrowNotCaught) ":" "\n" "addl $0x1c, %esp" "\n" "popl %ebx" "\n" @@ -430,9 +404,7 @@ COMPILE_ASSERT(offsetof(struct JITStackFrame, code) == 0x48, JITStackFrame_code_ COMPILE_ASSERT(offsetof(struct JITStackFrame, savedRBX) == 0x78, JITStackFrame_stub_argument_space_matches_ctiTrampoline); asm volatile ( -".text\n" ".globl " SYMBOL_STRING(ctiTrampoline) "\n" -HIDE_SYMBOL(ctiTrampoline) "\n" SYMBOL_STRING(ctiTrampoline) ":" "\n" "pushq %rbp" "\n" "movq %rsp, %rbp" "\n" @@ -466,7 +438,6 @@ SYMBOL_STRING(ctiTrampoline) ":" "\n" asm volatile ( ".globl " SYMBOL_STRING(ctiVMThrowTrampoline) "\n" -HIDE_SYMBOL(ctiVMThrowTrampoline) "\n" SYMBOL_STRING(ctiVMThrowTrampoline) ":" "\n" "movq %rsp, %rdi" "\n" "call " SYMBOL_STRING_RELOCATION(cti_vm_throw) "\n" @@ -482,7 +453,6 @@ SYMBOL_STRING(ctiVMThrowTrampoline) ":" "\n" asm volatile ( ".globl " SYMBOL_STRING(ctiOpThrowNotCaught) "\n" -HIDE_SYMBOL(ctiOpThrowNotCaught) "\n" SYMBOL_STRING(ctiOpThrowNotCaught) ":" "\n" "addq $0x78, %rsp" "\n" "popq %rbx" "\n" @@ -504,7 +474,6 @@ asm volatile ( ".text" "\n" ".align 2" "\n" ".globl " SYMBOL_STRING(ctiTrampoline) "\n" -HIDE_SYMBOL(ctiTrampoline) "\n" ".thumb" "\n" ".thumb_func " THUMB_FUNC_PARAM(ctiTrampoline) "\n" SYMBOL_STRING(ctiTrampoline) ":" "\n" @@ -531,7 +500,6 @@ asm volatile ( ".text" "\n" ".align 2" "\n" ".globl " SYMBOL_STRING(ctiVMThrowTrampoline) "\n" -HIDE_SYMBOL(ctiVMThrowTrampoline) "\n" ".thumb" "\n" ".thumb_func " THUMB_FUNC_PARAM(ctiVMThrowTrampoline) "\n" SYMBOL_STRING(ctiVMThrowTrampoline) ":" "\n" @@ -549,7 +517,6 @@ asm volatile ( ".text" "\n" ".align 2" "\n" ".globl " SYMBOL_STRING(ctiOpThrowNotCaught) "\n" -HIDE_SYMBOL(ctiOpThrowNotCaught) "\n" ".thumb" "\n" ".thumb_func " THUMB_FUNC_PARAM(ctiOpThrowNotCaught) "\n" SYMBOL_STRING(ctiOpThrowNotCaught) ":" "\n" @@ -564,9 +531,7 @@ SYMBOL_STRING(ctiOpThrowNotCaught) ":" "\n" #elif COMPILER(GCC) && PLATFORM(ARM_TRADITIONAL) asm volatile ( -".text\n" ".globl " SYMBOL_STRING(ctiTrampoline) "\n" -HIDE_SYMBOL(ctiTrampoline) "\n" SYMBOL_STRING(ctiTrampoline) ":" "\n" "stmdb sp!, {r1-r3}" "\n" "stmdb sp!, {r4-r8, lr}" "\n" @@ -583,14 +548,12 @@ SYMBOL_STRING(ctiTrampoline) ":" "\n" asm volatile ( ".globl " SYMBOL_STRING(ctiVMThrowTrampoline) "\n" -HIDE_SYMBOL(ctiVMThrowTrampoline) "\n" SYMBOL_STRING(ctiVMThrowTrampoline) ":" "\n" "mov r0, sp" "\n" "bl " SYMBOL_STRING_RELOCATION(cti_vm_throw) "\n" // Both has the same return sequence ".globl " SYMBOL_STRING(ctiOpThrowNotCaught) "\n" -HIDE_SYMBOL(ctiOpThrowNotCaught) "\n" SYMBOL_STRING(ctiOpThrowNotCaught) ":" "\n" "add sp, sp, #36" "\n" "ldmia sp!, {r4-r8, lr}" "\n" @@ -925,7 +888,6 @@ static NEVER_INLINE void throwStackOverflowError(CallFrame* callFrame, JSGlobalD ".text" "\n" \ ".align 2" "\n" \ ".globl " SYMBOL_STRING(cti_##op) "\n" \ - HIDE_SYMBOL(cti_##op) "\n" \ ".thumb" "\n" \ ".thumb_func " THUMB_FUNC_PARAM(cti_##op) "\n" \ SYMBOL_STRING(cti_##op) ":" "\n" \ diff --git a/src/3rdparty/webkit/JavaScriptCore/runtime/Collector.cpp b/src/3rdparty/webkit/JavaScriptCore/runtime/Collector.cpp index 8b647a0..b885049 100644 --- a/src/3rdparty/webkit/JavaScriptCore/runtime/Collector.cpp +++ b/src/3rdparty/webkit/JavaScriptCore/runtime/Collector.cpp @@ -240,9 +240,7 @@ void Heap::destroy() template NEVER_INLINE CollectorBlock* Heap::allocateBlock() { - // Disable the use of vm_map for the Qt build on Darwin, because when compiled on 10.4 - // it crashes on 10.5 -#if PLATFORM(DARWIN) && !PLATFORM(QT) +#if PLATFORM(DARWIN) vm_address_t address = 0; // FIXME: tag the region as a JavaScriptCore heap when we get a registered VM tag: . vm_map(current_task(), &address, BLOCK_SIZE, BLOCK_OFFSET_MASK, VM_FLAGS_ANYWHERE | VM_TAG_FOR_COLLECTOR_MEMORY, MEMORY_OBJECT_NULL, 0, FALSE, VM_PROT_DEFAULT, VM_PROT_DEFAULT, VM_INHERIT_DEFAULT); @@ -334,9 +332,7 @@ NEVER_INLINE void Heap::freeBlock(size_t block) NEVER_INLINE void Heap::freeBlock(CollectorBlock* block) { - // Disable the use of vm_deallocate for the Qt build on Darwin, because when compiled on 10.4 - // it crashes on 10.5 -#if PLATFORM(DARWIN) && !PLATFORM(QT) +#if PLATFORM(DARWIN) vm_deallocate(current_task(), reinterpret_cast(block), BLOCK_SIZE); #elif PLATFORM(SYMBIAN) userChunk->Free(reinterpret_cast(block)); diff --git a/src/3rdparty/webkit/VERSION b/src/3rdparty/webkit/VERSION index 98f007c..810781f 100644 --- a/src/3rdparty/webkit/VERSION +++ b/src/3rdparty/webkit/VERSION @@ -4,8 +4,8 @@ This is a snapshot of the Qt port of WebKit from The commit imported was from the - qtwebkit-4.6-snapshot-20091003 branch/tag + qtwebkit/qtwebkit-4.6 branch/tag and has the sha1 checksum - 8f810287200d21aded375664cc0a6ac0476dbdea + 16aab1b39e14195abdc2100265da2e45b96b739f diff --git a/src/3rdparty/webkit/WebCore/ChangeLog b/src/3rdparty/webkit/WebCore/ChangeLog index 2b36014..1dfc2f9 100644 --- a/src/3rdparty/webkit/WebCore/ChangeLog +++ b/src/3rdparty/webkit/WebCore/ChangeLog @@ -1,3 +1,111 @@ +2009-11-03 Simon Hausmann + + Unreviewed build fix for WebInspector with Qt build. + + Simply re-generate the Qt resource file by running + WebKitTools/Scripts/generate-qt-inspector-resource + + * inspector/front-end/WebKit.qrc: + +2009-11-03 Simon Hausmann + + Reviewed by Tor Arne Vestbø. + + Make QWebPluginDatabase private API for now. + + https://bugs.webkit.org/show_bug.cgi?id=30775 + + * WebCore.pro: + +2009-11-03 Simon Hausmann + + Reviewed by Tor Arne Vestbø. + + Extended the conversion of the WebCore ResourceRequest to the + QNetworkRequest with a mandatory originating object argument, + which is meant to be the QWebFrame the request belongs to. + + https://bugs.webkit.org/show_bug.cgi?id=29975 + + * platform/network/qt/QNetworkReplyHandler.cpp: + (WebCore::QNetworkReplyHandler::QNetworkReplyHandler): + (WebCore::QNetworkReplyHandler::sendResponseIfNeeded): + (WebCore::QNetworkReplyHandler::start): + * platform/network/qt/ResourceRequest.h: + * platform/network/qt/ResourceRequestQt.cpp: + (WebCore::ResourceRequest::toNetworkRequest): + +2009-11-02 Jedrzej Nowacki + + Reviewed by Adam Barth. + + QWebView crash fix. + + The QWebView should not crash if the stop() method is called from + a function triggered by the loadProgress signal. + + A null pointer protection was added in the ProgressTracker::incrementProgress. + + New autotest was created. + + https://bugs.webkit.org/show_bug.cgi?id=29425 + + * loader/ProgressTracker.cpp: + (WebCore::ProgressTracker::incrementProgress): + +2009-11-02 Kai Koehne + + Reviewed by Holger Freyther. + + Remove implementation of ImageDecocerQt::clearFrameBufferCache. + The implementation was buggy, and will visually break repeating + animations anyway. + + https://bugs.webkit.org/show_bug.cgi?id=31009 + + * platform/graphics/qt/ImageDecoderQt.cpp: + (WebCore::ImageDecoderQt::clearFrameBufferCache): + +2009-11-01 Yael Aharon + + Reviewed by Darin Adler. + + Don't add '/' to the URL path if the it does not include '/' after the protocol component + https://bugs.webkit.org/show_bug.cgi?id=30971 + + Match IE8 behaviour, that does not add '/' if there is none after the protocol component. + + * platform/KURL.cpp: + (WebCore::KURL::parse): + +2009-10-30 Kenneth Rohde Christiansen + + Reviewed by Holger Hans Peter Freyther. + + If the owner widget of the page has a palette set, we + should use that one. This was only working when the + owner was a QWebView. This patch fixes that. + + * platform/qt/RenderThemeQt.cpp: + (WebCore::RenderThemeQt::applyTheme): + +2009-10-29 Laszlo Gombos + + Reviewed by Tor Arne Vestbø. + + [Qt] Implement DELETE HTTP method for XmlHttpRequest + https://bugs.webkit.org/show_bug.cgi?id=30894 + + No new tests as this functionality is already tested by the + xmlhttprequest LayoutTests. As this patch depends on an unreleased + version of the dependent QtNetwork library and the tests will be + enabled later once the dependent library is released (and the + buildbot is updated). + + * platform/network/qt/QNetworkReplyHandler.cpp: + (WebCore::QNetworkReplyHandler::QNetworkReplyHandler): + (WebCore::QNetworkReplyHandler::start): + 2009-11-02 Tor Arne Vestbø Rubber-stamped by Antti Koivisto. diff --git a/src/3rdparty/webkit/WebCore/WebCore.pro b/src/3rdparty/webkit/WebCore/WebCore.pro index 1379fdd..60e414f 100644 --- a/src/3rdparty/webkit/WebCore/WebCore.pro +++ b/src/3rdparty/webkit/WebCore/WebCore.pro @@ -2327,6 +2327,7 @@ HEADERS += \ xml/XSLTExtensions.h \ xml/XSLTProcessor.h \ xml/XSLTUnicodeSort.h \ + $$PWD/../WebKit/qt/Api/qwebplugindatabase_p.h \ $$PWD/../WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h \ $$PWD/platform/network/qt/DnsPrefetchHelper.h @@ -3380,18 +3381,3 @@ CONFIG(QTDIR_build):isEqual(QT_MAJOR_VERSION, 4):greaterThan(QT_MINOR_VERSION, 4 plugins/win/PaintHooks.asm } } - -# Temporary workaround to pick up the DEF file from the same place as all the others -symbian { - shared { - contains(MMP_RULES, defBlock) { - MMP_RULES -= defBlock - - MMP_RULES += "$${LITERAL_HASH}ifdef WINSCW" \ - "DEFFILE ../../../s60installs/bwins/$${TARGET}.def" \ - "$${LITERAL_HASH}elif defined EABI" \ - "DEFFILE ../../../s60installs/eabi/$${TARGET}.def" \ - "$${LITERAL_HASH}endif" - } - } -} diff --git a/src/3rdparty/webkit/WebCore/inspector/front-end/WebKit.qrc b/src/3rdparty/webkit/WebCore/inspector/front-end/WebKit.qrc index a1d671e..0347952 100644 --- a/src/3rdparty/webkit/WebCore/inspector/front-end/WebKit.qrc +++ b/src/3rdparty/webkit/WebCore/inspector/front-end/WebKit.qrc @@ -28,6 +28,7 @@ InjectedScript.js InjectedScriptAccess.js inspector.js + InspectorControllerStub.js KeyboardShortcut.js MetricsSidebarPane.js Object.js @@ -161,6 +162,15 @@ Images/statusbarResizerVertical.png Images/storageIcon.png Images/successGreenDot.png + Images/timelineBarBlue.png + Images/timelineBarGray.png + Images/timelineBarGreen.png + Images/timelineBarOrange.png + Images/timelineBarPurple.png + Images/timelineBarRed.png + Images/timelineBarYellow.png + Images/timelineCheckmarks.png + Images/timelineDots.png Images/timelineHollowPillBlue.png Images/timelineHollowPillGray.png Images/timelineHollowPillGreen.png @@ -168,6 +178,7 @@ Images/timelineHollowPillPurple.png Images/timelineHollowPillRed.png Images/timelineHollowPillYellow.png + Images/timelineIcon.png Images/timelinePillBlue.png Images/timelinePillGray.png Images/timelinePillGreen.png diff --git a/src/3rdparty/webkit/WebCore/loader/ProgressTracker.cpp b/src/3rdparty/webkit/WebCore/loader/ProgressTracker.cpp index e682b9b..6b6ce1b 100644 --- a/src/3rdparty/webkit/WebCore/loader/ProgressTracker.cpp +++ b/src/3rdparty/webkit/WebCore/loader/ProgressTracker.cpp @@ -176,8 +176,10 @@ void ProgressTracker::incrementProgress(unsigned long identifier, const char*, i // FIXME: Can this ever happen? if (!item) return; + + RefPtr frame = m_originatingProgressFrame; - m_originatingProgressFrame->loader()->client()->willChangeEstimatedProgress(); + frame->loader()->client()->willChangeEstimatedProgress(); unsigned bytesReceived = length; double increment, percentOfRemainingBytes; @@ -189,7 +191,7 @@ void ProgressTracker::incrementProgress(unsigned long identifier, const char*, i item->estimatedLength = item->bytesReceived * 2; } - int numPendingOrLoadingRequests = m_originatingProgressFrame->loader()->numPendingOrLoadingRequests(true); + int numPendingOrLoadingRequests = frame->loader()->numPendingOrLoadingRequests(true); estimatedBytesForPendingRequests = progressItemDefaultEstimatedLength * numPendingOrLoadingRequests; remainingBytes = ((m_totalPageAndResourceBytesToLoad + estimatedBytesForPendingRequests) - m_totalBytesReceived); if (remainingBytes > 0) // Prevent divide by 0. @@ -199,8 +201,8 @@ void ProgressTracker::incrementProgress(unsigned long identifier, const char*, i // For documents that use WebCore's layout system, treat first layout as the half-way point. // FIXME: The hasHTMLView function is a sort of roundabout way of asking "do you use WebCore's layout system". - bool useClampedMaxProgress = m_originatingProgressFrame->loader()->client()->hasHTMLView() - && !m_originatingProgressFrame->loader()->firstLayoutDone(); + bool useClampedMaxProgress = frame->loader()->client()->hasHTMLView() + && !frame->loader()->firstLayoutDone(); double maxProgressValue = useClampedMaxProgress ? 0.5 : finalProgressValue; increment = (maxProgressValue - m_progressValue) * percentOfRemainingBytes; m_progressValue += increment; @@ -221,14 +223,14 @@ void ProgressTracker::incrementProgress(unsigned long identifier, const char*, i if (m_progressValue == 1) m_finalProgressChangedSent = true; - m_originatingProgressFrame->loader()->client()->postProgressEstimateChangedNotification(); + frame->loader()->client()->postProgressEstimateChangedNotification(); m_lastNotifiedProgressValue = m_progressValue; m_lastNotifiedProgressTime = now; } } - m_originatingProgressFrame->loader()->client()->didChangeEstimatedProgress(); + frame->loader()->client()->didChangeEstimatedProgress(); } void ProgressTracker::completeProgress(unsigned long identifier) diff --git a/src/3rdparty/webkit/WebCore/platform/FileSystem.h b/src/3rdparty/webkit/WebCore/platform/FileSystem.h index 791198d..9952b39 100644 --- a/src/3rdparty/webkit/WebCore/platform/FileSystem.h +++ b/src/3rdparty/webkit/WebCore/platform/FileSystem.h @@ -98,17 +98,6 @@ struct PlatformModuleVersion { { } - bool operator != (const PlatformModuleVersion& rhs) const - { - return mostSig != rhs.mostSig && leastSig != rhs.leastSig; - } - - - bool operator > (const PlatformModuleVersion& rhs) const - { - return mostSig > rhs.mostSig && leastSig > rhs.leastSig; - } - }; #else typedef unsigned PlatformModuleVersion; diff --git a/src/3rdparty/webkit/WebCore/platform/KURL.cpp b/src/3rdparty/webkit/WebCore/platform/KURL.cpp index ffacc19..c5829d2 100644 --- a/src/3rdparty/webkit/WebCore/platform/KURL.cpp +++ b/src/3rdparty/webkit/WebCore/platform/KURL.cpp @@ -1269,8 +1269,8 @@ void KURL::parse(const char* url, const String* originalString) m_userStart = m_userEnd = m_passwordEnd = m_hostEnd = m_portEnd = p - buffer.data(); // For canonicalization, ensure we have a '/' for no path. - // Only do this for http and https. - if (m_protocolInHTTPFamily && pathEnd - pathStart == 0) + // Do this only for hierarchical URL with protocol http or https. + if (m_protocolInHTTPFamily && hierarchical && pathEnd == pathStart) *p++ = '/'; // add path, escaping bad characters diff --git a/src/3rdparty/webkit/WebCore/platform/graphics/qt/ImageDecoderQt.cpp b/src/3rdparty/webkit/WebCore/platform/graphics/qt/ImageDecoderQt.cpp index f8403b7..b6823dd 100644 --- a/src/3rdparty/webkit/WebCore/platform/graphics/qt/ImageDecoderQt.cpp +++ b/src/3rdparty/webkit/WebCore/platform/graphics/qt/ImageDecoderQt.cpp @@ -145,16 +145,8 @@ RGBA32Buffer* ImageDecoderQt::frameBufferAtIndex(size_t index) return &frame; } -void ImageDecoderQt::clearFrameBufferCache(size_t index) +void ImageDecoderQt::clearFrameBufferCache(size_t /*index*/) { - // Currently QImageReader will be asked to read everything. This - // might change when we read gif images on demand. For now we - // can have a rather simple implementation. - if (index > m_frameBufferCache.size()) - return; - - for (size_t i = 0; i < index; ++index) - m_frameBufferCache[index].clear(); } void ImageDecoderQt::internalDecodeSize() diff --git a/src/3rdparty/webkit/WebCore/platform/network/qt/QNetworkReplyHandler.cpp b/src/3rdparty/webkit/WebCore/platform/network/qt/QNetworkReplyHandler.cpp index ed5e024..bbf5525 100644 --- a/src/3rdparty/webkit/WebCore/platform/network/qt/QNetworkReplyHandler.cpp +++ b/src/3rdparty/webkit/WebCore/platform/network/qt/QNetworkReplyHandler.cpp @@ -140,10 +140,14 @@ QNetworkReplyHandler::QNetworkReplyHandler(ResourceHandle* handle, LoadMode load m_method = QNetworkAccessManager::PostOperation; else if (r.httpMethod() == "PUT") m_method = QNetworkAccessManager::PutOperation; +#if QT_VERSION >= 0x040600 + else if (r.httpMethod() == "DELETE") + m_method = QNetworkAccessManager::DeleteOperation; +#endif else m_method = QNetworkAccessManager::UnknownOperation; - m_request = r.toNetworkRequest(); + m_request = r.toNetworkRequest(m_resourceHandle->getInternal()->m_frame); if (m_loadMode == LoadNormal) start(); @@ -323,10 +327,7 @@ void QNetworkReplyHandler::sendResponseIfNeeded() client->willSendRequest(m_resourceHandle, newRequest, response); m_redirected = true; - m_request = newRequest.toNetworkRequest(); - - ResourceHandleInternal* d = m_resourceHandle->getInternal(); - emit d->m_frame->page()->networkRequestStarted(d->m_frame, &m_request); + m_request = newRequest.toNetworkRequest(m_resourceHandle->getInternal()->m_frame); return; } @@ -368,8 +369,6 @@ void QNetworkReplyHandler::start() QNetworkAccessManager* manager = d->m_frame->page()->networkAccessManager(); - emit d->m_frame->page()->networkRequestStarted(d->m_frame, &m_request); - const QUrl url = m_request.url(); const QString scheme = url.scheme(); // Post requests on files and data don't really make sense, but for @@ -398,6 +397,12 @@ void QNetworkReplyHandler::start() putDevice->setParent(m_reply); break; } +#if QT_VERSION >= 0x040600 + case QNetworkAccessManager::DeleteOperation: { + m_reply = manager->deleteResource(m_request); + break; + } +#endif case QNetworkAccessManager::UnknownOperation: { m_reply = 0; ResourceHandleClient* client = m_resourceHandle->client(); diff --git a/src/3rdparty/webkit/WebCore/platform/network/qt/ResourceRequest.h b/src/3rdparty/webkit/WebCore/platform/network/qt/ResourceRequest.h index 93dacf3..60d32dd 100644 --- a/src/3rdparty/webkit/WebCore/platform/network/qt/ResourceRequest.h +++ b/src/3rdparty/webkit/WebCore/platform/network/qt/ResourceRequest.h @@ -31,6 +31,7 @@ QT_BEGIN_NAMESPACE class QNetworkRequest; +class QObject; QT_END_NAMESPACE namespace WebCore { @@ -59,7 +60,7 @@ namespace WebCore { } #if QT_VERSION >= 0x040400 - QNetworkRequest toNetworkRequest() const; + QNetworkRequest toNetworkRequest(QObject* originatingObject) const; #endif private: diff --git a/src/3rdparty/webkit/WebCore/platform/network/qt/ResourceRequestQt.cpp b/src/3rdparty/webkit/WebCore/platform/network/qt/ResourceRequestQt.cpp index c8f6ad5..c866a54 100644 --- a/src/3rdparty/webkit/WebCore/platform/network/qt/ResourceRequestQt.cpp +++ b/src/3rdparty/webkit/WebCore/platform/network/qt/ResourceRequestQt.cpp @@ -28,10 +28,13 @@ namespace WebCore { -QNetworkRequest ResourceRequest::toNetworkRequest() const +QNetworkRequest ResourceRequest::toNetworkRequest(QObject* originatingFrame) const { QNetworkRequest request; request.setUrl(url()); +#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0) + request.setOriginatingObject(originatingFrame); +#endif const HTTPHeaderMap &headers = httpHeaderFields(); for (HTTPHeaderMap::const_iterator it = headers.begin(), end = headers.end(); diff --git a/src/3rdparty/webkit/WebCore/platform/qt/RenderThemeQt.cpp b/src/3rdparty/webkit/WebCore/platform/qt/RenderThemeQt.cpp index b61d356..501a28b 100644 --- a/src/3rdparty/webkit/WebCore/platform/qt/RenderThemeQt.cpp +++ b/src/3rdparty/webkit/WebCore/platform/qt/RenderThemeQt.cpp @@ -45,6 +45,7 @@ #include "RenderBox.h" #include "RenderTheme.h" #include "UserAgentStyleSheets.h" +#include "QWebPageClient.h" #include "qwebpage.h" #include @@ -757,12 +758,13 @@ ControlPart RenderThemeQt::applyTheme(QStyleOption& option, RenderObject* o) con if (result == RadioPart || result == CheckboxPart) option.state |= (isChecked(o) ? QStyle::State_On : QStyle::State_Off); - // If the webview has a custom palette, use it + // If the owner widget has a custom palette, use it Page* page = o->document()->page(); if (page) { - QWidget* view = static_cast(page->chrome()->client())->m_webPage->view(); - if (view) - option.palette = view->palette(); + ChromeClient* client = page->chrome()->client(); + QWebPageClient* pageClient = client->platformPageClient(); + if (pageClient) + option.palette = pageClient->palette(); } return result; diff --git a/src/3rdparty/webkit/WebKit/qt/Api/headers.pri b/src/3rdparty/webkit/WebKit/qt/Api/headers.pri index 5a95c67..1a42597 100644 --- a/src/3rdparty/webkit/WebKit/qt/Api/headers.pri +++ b/src/3rdparty/webkit/WebKit/qt/Api/headers.pri @@ -8,7 +8,6 @@ WEBKIT_API_HEADERS = $$PWD/qwebframe.h \ $$PWD/qwebdatabase.h \ $$PWD/qwebsecurityorigin.h \ $$PWD/qwebelement.h \ - $$PWD/qwebplugindatabase.h \ $$PWD/qwebpluginfactory.h \ $$PWD/qwebhistory.h \ $$PWD/qwebinspector.h \ diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.cpp index b22109b..50a0986 100644 --- a/src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.cpp +++ b/src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.cpp @@ -164,101 +164,17 @@ void QGraphicsWebViewPrivate::_q_setStatusBarMessage(const QString& s) /*! \class QGraphicsWebView - \brief The QGraphicsWebView class allows Web content to be added to a GraphicsView. + \brief The QGraphicsWebView class allows web content to be added to a GraphicsView. \since 4.6 - An instance of this class renders Web content from a URL or supplied as data, using - features of the QtWebKit module. + A WebGraphicsItem renders web content based on a URL or set data. - If the width and height of the item is not set, they will dynamically adjust to - a size appropriate for the content. This width may be large (e.g., 980 pixels or - more) for typical online Web pages. - - \section1 Browser Features - - Many of the functions, signals and properties provided by QWebView are also available - for this item, making it simple to adapt existing code to use QGraphicsWebView instead - of QWebView. - - The item uses a QWebPage object to perform the rendering of Web content, and this can - be obtained with the page() function, enabling the document itself to be accessed and - modified. - - As with QWebView, the item records the browsing history using a QWebHistory object, - accessible using the history() function. The QWebSettings object that defines the - configuration of the browser can be obtained with the settings() function, enabling - features like plugin support to be customized for each item. - - \sa QWebView, QGraphicsTextItem -*/ - -/*! - \fn void QGraphicsWebView::titleChanged(const QString &title) - - This signal is emitted whenever the \a title of the main frame changes. - - \sa title() -*/ - -/*! - \fn void QGraphicsWebView::urlChanged(const QUrl &url) - - This signal is emitted when the \a url of the view changes. - - \sa url(), load() -*/ - -/*! - \fn void QGraphicsWebView::statusChanged() - - This signal is emitted when the status bar text is changed by the page. -*/ - -/*! - \fn void QGraphicsWebView::iconChanged() - - This signal is emitted whenever the icon of the page is loaded or changes. - - In order for icons to be loaded, you will need to set an icon database path - using QWebSettings::setIconDatabasePath(). - - \sa icon(), QWebSettings::setIconDatabasePath() -*/ - -/*! - \fn void QGraphicsWebView::loadStarted() - - This signal is emitted when a new load of the page is started. - - \sa progressChanged(), loadFinished() -*/ - -/*! - \fn void QGraphicsWebView::loadFinished(bool ok) - - This signal is emitted when a load of the page is finished. - \a ok will indicate whether the load was successful or any error occurred. - - \sa loadStarted() + If the width and height of the item is not set, they will + dynamically adjust to a size appropriate for the content. + This width may be large (eg. 980) for typical online web pages. */ /*! - \fn void QGraphicsWebView::progressChanged(qreal progress) - - This signal is emitted every time an element in the web page - completes loading and the overall loading progress advances. - - This signal tracks the progress of all child frames. - - The current value is provided by \a progress and scales from 0.0 to 1.0, - which is the default range of QProgressBar. - - \sa loadStarted(), loadFinished() -*/ - - - -/*! Constructs an empty QGraphicsWebView with parent \a parent. \sa load() @@ -275,7 +191,7 @@ QGraphicsWebView::QGraphicsWebView(QGraphicsItem* parent) } /*! - Destroys the item. + Destroys the web graphicsitem. */ QGraphicsWebView::~QGraphicsWebView() { diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp index 606dae4..17a0118 100644 --- a/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp +++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp @@ -734,6 +734,11 @@ void QWebFrame::load(const QNetworkRequest &req, case QNetworkAccessManager::PostOperation: request.setHTTPMethod("POST"); break; +#if QT_VERSION >= 0x040600 + case QNetworkAccessManager::DeleteOperation: + request.setHTTPMethod("DELETE"); + break; +#endif case QNetworkAccessManager::UnknownOperation: // eh? break; diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebinspector.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebinspector.cpp index 4578dc9..409e1a0 100644 --- a/src/3rdparty/webkit/WebKit/qt/Api/qwebinspector.cpp +++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebinspector.cpp @@ -188,9 +188,3 @@ void QWebInspectorPrivate::adjustFrontendSize(const QSize& size) frontend->resize(size); } -/*! - \fn void QWebInspector::windowTitleChanged(const QString& newTitle); - - This is emitted to signal that this widget's title changed to \a newTitle. -*/ - diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebinspector.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebinspector.h index bb5bd64..a5c1ed5 100644 --- a/src/3rdparty/webkit/WebKit/qt/Api/qwebinspector.h +++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebinspector.h @@ -39,9 +39,6 @@ public: QSize sizeHint() const; bool event(QEvent*); -Q_SIGNALS: - void windowTitleChanged(const QString& newTitle); - protected: void resizeEvent(QResizeEvent* event); void showEvent(QShowEvent* event); diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp index 6f1347c..5402ab1 100644 --- a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp +++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp @@ -78,6 +78,7 @@ #include "Cache.h" #include "runtime/InitializeThreading.h" #include "PageGroup.h" +#include "QWebPageClient.h" #include #include @@ -107,6 +108,9 @@ #else #include "qwebnetworkinterface.h" #endif +#if defined(Q_WS_X11) +#include +#endif using namespace WebCore; @@ -138,6 +142,95 @@ QString QWEBKIT_EXPORT qt_webpage_groupName(QWebPage* page) return page->handle()->page->groupName(); } +class QWebPageWidgetClient : public QWebPageClient { +public: + QWebPageWidgetClient(QWidget* view) + : view(view) + { + Q_ASSERT(view); + } + + virtual void scroll(int dx, int dy, const QRect&); + virtual void update(const QRect& dirtyRect); + virtual void setInputMethodEnabled(bool enable); +#if QT_VERSION >= 0x040600 + virtual void setInputMethodHint(Qt::InputMethodHint hint, bool enable); +#endif + +#ifndef QT_NO_CURSOR + virtual QCursor cursor() const; + virtual void updateCursor(const QCursor& cursor); +#endif + + virtual QPalette palette() const; + virtual int screenNumber() const; + virtual QWidget* ownerWidget() const; + + virtual QObject* pluginParent() const; + + QWidget* view; +}; + +void QWebPageWidgetClient::scroll(int dx, int dy, const QRect& rectToScroll) +{ + view->scroll(qreal(dx), qreal(dy), rectToScroll); +} + +void QWebPageWidgetClient::update(const QRect & dirtyRect) +{ + view->update(dirtyRect); +} + +void QWebPageWidgetClient::setInputMethodEnabled(bool enable) +{ + view->setAttribute(Qt::WA_InputMethodEnabled, enable); +} +#if QT_VERSION >= 0x040600 +void QWebPageWidgetClient::setInputMethodHint(Qt::InputMethodHint hint, bool enable) +{ + if (enable) + view->setInputMethodHints(view->inputMethodHints() | hint); + else + view->setInputMethodHints(view->inputMethodHints() & ~hint); +} +#endif +#ifndef QT_NO_CURSOR +QCursor QWebPageWidgetClient::cursor() const +{ + return view->cursor(); +} + +void QWebPageWidgetClient::updateCursor(const QCursor& cursor) +{ + view->setCursor(cursor); +} +#endif + +QPalette QWebPageWidgetClient::palette() const +{ + return view->palette(); +} + +int QWebPageWidgetClient::screenNumber() const +{ +#if defined(Q_WS_X11) + if (view) + return view->x11Info().screen(); +#endif + + return 0; +} + +QWidget* QWebPageWidgetClient::ownerWidget() const +{ + return view; +} + +QObject* QWebPageWidgetClient::pluginParent() const +{ + return view; +} + // Lookup table mapping QWebPage::WebActions to the associated Editor commands static const char* editorCommandWebActions[] = { @@ -1672,6 +1765,15 @@ void QWebPage::setView(QWidget *view) { if (this->view() != view) { d->view = view; + if (!view) { + delete d->client; + d->client = 0; + } else { + if (!d->client) + d->client = new QWebPageWidgetClient(view); + else + static_cast(d->client)->view = view; + } setViewportSize(view ? view->size() : QSize(0, 0)); } } @@ -2661,17 +2763,6 @@ void QWebPage::updatePositionDependentActions(const QPoint &pos) as a result of the user clicking on a "file upload" button in a HTML form where multiple file selection is allowed. - \omitvalue ErrorPageExtension (introduced in Qt 4.6) -*/ - -/*! - \enum QWebPage::ErrorDomain - \since 4.6 - \internal - - \value QtNetwork - \value Http - \value WebKit */ /*! @@ -2722,12 +2813,6 @@ void QWebPage::updatePositionDependentActions(const QPoint &pos) */ /*! - \fn QWebPage::ErrorPageExtensionReturn::ErrorPageExtensionReturn() - - Constructs a new error page object. -*/ - -/*! \class QWebPage::ChooseMultipleFilesExtensionOption \since 4.5 \brief The ChooseMultipleFilesExtensionOption class describes the option @@ -3406,16 +3491,6 @@ quint64 QWebPage::bytesReceived() const */ /*! - \since 4.6 - \fn void QWebPage::networkRequestStarted(QWebFrame* frame, QNetworkRequest* request); - \preliminary - - This signal is emitted when a \a frame of the current page requests a web resource. The application - may want to associate the \a request with the \a frame that initiated it by storing the \a frame - as an attribute of the \a request. -*/ - -/*! \fn QWebPagePrivate* QWebPage::handle() const \internal */ diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.h index f2bbde0..f39209c 100644 --- a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.h +++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.h @@ -347,8 +347,6 @@ Q_SIGNALS: void saveFrameStateRequested(QWebFrame* frame, QWebHistoryItem* item); void restoreFrameStateRequested(QWebFrame* frame); - void networkRequestStarted(QWebFrame* frame, QNetworkRequest* request); - protected: virtual QWebPage *createWindow(WebWindowType type); virtual QObject *createPlugin(const QString &classid, const QUrl &url, const QStringList ¶mNames, const QStringList ¶mValues); diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebplugindatabase.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebplugindatabase.cpp index 623895f..758e257 100644 --- a/src/3rdparty/webkit/WebKit/qt/Api/qwebplugindatabase.cpp +++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebplugindatabase.cpp @@ -18,7 +18,7 @@ */ #include "config.h" -#include "qwebplugindatabase.h" +#include "qwebplugindatabase_p.h" #include "PluginDatabase.h" #include "PluginPackage.h" @@ -26,6 +26,7 @@ using namespace WebCore; /*! + \internal \typedef QWebPluginInfo::MimeType \since 4.6 \brief Represents a single MIME type supported by a plugin. @@ -33,6 +34,7 @@ using namespace WebCore; /*! \class QWebPluginInfo + \internal \since 4.6 \brief The QWebPluginInfo class represents a single Netscape plugin. @@ -232,6 +234,7 @@ QWebPluginInfo &QWebPluginInfo::operator=(const QWebPluginInfo& other) /*! \class QWebPluginDatabase + \internal \since 4.6 \brief The QWebPluginDatabase class provides an interface for managing Netscape plugins used by WebKit in QWebPages. diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebplugindatabase.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebplugindatabase.h deleted file mode 100644 index b22c3de..0000000 --- a/src/3rdparty/webkit/WebKit/qt/Api/qwebplugindatabase.h +++ /dev/null @@ -1,98 +0,0 @@ -/* - Copyright (C) 2009 Jakub Wieczorek - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#ifndef QWEBPLUGINDATABASE_H -#define QWEBPLUGINDATABASE_H - -#include "qwebkitglobal.h" -#include "qwebpluginfactory.h" - -#include -#include - -namespace WebCore { - class PluginDatabase; - class PluginPackage; -} - -class QWebPluginInfoPrivate; -class QWEBKIT_EXPORT QWebPluginInfo { -public: - QWebPluginInfo(); - QWebPluginInfo(const QWebPluginInfo& other); - QWebPluginInfo &operator=(const QWebPluginInfo& other); - ~QWebPluginInfo(); - -private: - QWebPluginInfo(WebCore::PluginPackage* package); - -public: - typedef QWebPluginFactory::MimeType MimeType; - - QString name() const; - QString description() const; - QList mimeTypes() const; - bool supportsMimeType(const QString& mimeType) const; - QString path() const; - - bool isNull() const; - - void setEnabled(bool enabled); - bool isEnabled() const; - - bool operator==(const QWebPluginInfo& other) const; - bool operator!=(const QWebPluginInfo& other) const; - - friend class QWebPluginDatabase; - -private: - QWebPluginInfoPrivate* d; - WebCore::PluginPackage* m_package; - mutable QList m_mimeTypes; -}; - -class QWebPluginDatabasePrivate; -class QWEBKIT_EXPORT QWebPluginDatabase : public QObject { - Q_OBJECT - -private: - QWebPluginDatabase(QObject* parent = 0); - ~QWebPluginDatabase(); - -public: - QList plugins() const; - - static QStringList defaultSearchPaths(); - QStringList searchPaths() const; - void setSearchPaths(const QStringList& paths); - void addSearchPath(const QString& path); - - void refresh(); - - QWebPluginInfo pluginForMimeType(const QString& mimeType); - void setPreferredPluginForMimeType(const QString& mimeType, const QWebPluginInfo& plugin); - - friend class QWebSettings; - -private: - QWebPluginDatabasePrivate* d; - WebCore::PluginDatabase* m_database; -}; - -#endif // QWEBPLUGINDATABASE_H diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebplugindatabase_p.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebplugindatabase_p.h new file mode 100644 index 0000000..b22c3de --- /dev/null +++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebplugindatabase_p.h @@ -0,0 +1,98 @@ +/* + Copyright (C) 2009 Jakub Wieczorek + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef QWEBPLUGINDATABASE_H +#define QWEBPLUGINDATABASE_H + +#include "qwebkitglobal.h" +#include "qwebpluginfactory.h" + +#include +#include + +namespace WebCore { + class PluginDatabase; + class PluginPackage; +} + +class QWebPluginInfoPrivate; +class QWEBKIT_EXPORT QWebPluginInfo { +public: + QWebPluginInfo(); + QWebPluginInfo(const QWebPluginInfo& other); + QWebPluginInfo &operator=(const QWebPluginInfo& other); + ~QWebPluginInfo(); + +private: + QWebPluginInfo(WebCore::PluginPackage* package); + +public: + typedef QWebPluginFactory::MimeType MimeType; + + QString name() const; + QString description() const; + QList mimeTypes() const; + bool supportsMimeType(const QString& mimeType) const; + QString path() const; + + bool isNull() const; + + void setEnabled(bool enabled); + bool isEnabled() const; + + bool operator==(const QWebPluginInfo& other) const; + bool operator!=(const QWebPluginInfo& other) const; + + friend class QWebPluginDatabase; + +private: + QWebPluginInfoPrivate* d; + WebCore::PluginPackage* m_package; + mutable QList m_mimeTypes; +}; + +class QWebPluginDatabasePrivate; +class QWEBKIT_EXPORT QWebPluginDatabase : public QObject { + Q_OBJECT + +private: + QWebPluginDatabase(QObject* parent = 0); + ~QWebPluginDatabase(); + +public: + QList plugins() const; + + static QStringList defaultSearchPaths(); + QStringList searchPaths() const; + void setSearchPaths(const QStringList& paths); + void addSearchPath(const QString& path); + + void refresh(); + + QWebPluginInfo pluginForMimeType(const QString& mimeType); + void setPreferredPluginForMimeType(const QString& mimeType, const QWebPluginInfo& plugin); + + friend class QWebSettings; + +private: + QWebPluginDatabasePrivate* d; + WebCore::PluginDatabase* m_database; +}; + +#endif // QWEBPLUGINDATABASE_H diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.cpp index ffa21e4..3052056 100644 --- a/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.cpp +++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.cpp @@ -22,7 +22,7 @@ #include "qwebpage.h" #include "qwebpage_p.h" -#include "qwebplugindatabase.h" +#include "qwebplugindatabase_p.h" #include "Cache.h" #include "CrossOriginPreflightResultCache.h" @@ -627,7 +627,7 @@ QIcon QWebSettings::iconForUrl(const QUrl& url) /*! Returns the plugin database object. -*/ + QWebPluginDatabase *QWebSettings::pluginDatabase() { static QWebPluginDatabase* database = 0; @@ -635,6 +635,7 @@ QWebPluginDatabase *QWebSettings::pluginDatabase() database = new QWebPluginDatabase(); return database; } +*/ /*! Sets \a graphic to be drawn when QtWebKit needs to draw an image of the diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.h index e68ea53..c958ae7 100644 --- a/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.h +++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.h @@ -114,7 +114,7 @@ public: static void clearIconDatabase(); static QIcon iconForUrl(const QUrl &url); - static QWebPluginDatabase *pluginDatabase(); + //static QWebPluginDatabase *pluginDatabase(); static void setWebGraphic(WebGraphic type, const QPixmap &graphic); static QPixmap webGraphic(WebGraphic type); diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebview.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebview.cpp index b9c2f74..12b20ab 100644 --- a/src/3rdparty/webkit/WebKit/qt/Api/qwebview.cpp +++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebview.cpp @@ -32,11 +32,8 @@ #include "qprinter.h" #include "qdir.h" #include "qfile.h" -#if defined(Q_WS_X11) -#include -#endif -class QWebViewPrivate : public QWebPageClient { +class QWebViewPrivate { public: QWebViewPrivate(QWebView *view) : view(view) @@ -46,24 +43,6 @@ public: Q_ASSERT(view); } - virtual void scroll(int dx, int dy, const QRect&); - virtual void update(const QRect& dirtyRect); - virtual void setInputMethodEnabled(bool enable); -#if QT_VERSION >= 0x040600 - virtual void setInputMethodHint(Qt::InputMethodHint hint, bool enable); -#endif - -#ifndef QT_NO_CURSOR - virtual QCursor cursor() const; - virtual void updateCursor(const QCursor& cursor); -#endif - - virtual QPalette palette() const; - virtual int screenNumber() const; - virtual QWidget* ownerWidget() const; - - virtual QObject* pluginParent() const; - void _q_pageDestroyed(); QWebView *view; @@ -72,66 +51,6 @@ public: QPainter::RenderHints renderHints; }; -void QWebViewPrivate::scroll(int dx, int dy, const QRect& rectToScroll) -{ - view->scroll(qreal(dx), qreal(dy), rectToScroll); -} - -void QWebViewPrivate::update(const QRect & dirtyRect) -{ - view->update(dirtyRect); -} - -void QWebViewPrivate::setInputMethodEnabled(bool enable) -{ - view->setAttribute(Qt::WA_InputMethodEnabled, enable); -} -#if QT_VERSION >= 0x040600 -void QWebViewPrivate::setInputMethodHint(Qt::InputMethodHint hint, bool enable) -{ - if (enable) - view->setInputMethodHints(view->inputMethodHints() | hint); - else - view->setInputMethodHints(view->inputMethodHints() & ~hint); -} -#endif -#ifndef QT_NO_CURSOR -QCursor QWebViewPrivate::cursor() const -{ - return view->cursor(); -} - -void QWebViewPrivate::updateCursor(const QCursor& cursor) -{ - view->setCursor(cursor); -} -#endif - -QPalette QWebViewPrivate::palette() const -{ - return view->palette(); -} - -int QWebViewPrivate::screenNumber() const -{ -#if defined(Q_WS_X11) - if (view) - return view->x11Info().screen(); -#endif - - return 0; -} - -QWidget* QWebViewPrivate::ownerWidget() const -{ - return view; -} - -QObject* QWebViewPrivate::pluginParent() const -{ - return view; -} - void QWebViewPrivate::_q_pageDestroyed() { page = 0; @@ -151,7 +70,7 @@ void QWebViewPrivate::_q_pageDestroyed() It can be used in various applications to display web content live from the Internet. - The image below shows QWebView previewed in \QD with a Nokia website. + The image below shows QWebView previewed in \QD with the Trolltech website. \image qwebview-url.png @@ -251,6 +170,7 @@ QWebView::~QWebView() #else d->page->d->view = 0; #endif + delete d->page->d->client; d->page->d->client = 0; } @@ -296,7 +216,6 @@ void QWebView::setPage(QWebPage* page) d->page = page; if (d->page) { d->page->setView(this); - d->page->d->client = d; // set the page client d->page->setPalette(palette()); // #### connect signals QWebFrame *mainFrame = d->page->mainFrame(); @@ -728,7 +647,7 @@ bool QWebView::event(QEvent *e) // WebCore. // FIXME: Add a QEvent::CursorUnset or similar to Qt. if (cursor().shape() == Qt::ArrowCursor) - d->resetCursor(); + d->page->d->client->resetCursor(); #endif #endif } else if (e->type() == QEvent::Leave) @@ -1055,7 +974,7 @@ void QWebView::changeEvent(QEvent *e) /*! \fn void QWebView::statusBarMessage(const QString& text) - This signal is emitted when the status bar \a text is changed by the page. + This signal is emitted when the statusbar \a text is changed by the page. */ /*! diff --git a/src/3rdparty/webkit/WebKit/qt/ChangeLog b/src/3rdparty/webkit/WebKit/qt/ChangeLog index b19a1d0..84c5d43 100644 --- a/src/3rdparty/webkit/WebKit/qt/ChangeLog +++ b/src/3rdparty/webkit/WebKit/qt/ChangeLog @@ -1,3 +1,132 @@ +2009-11-04 Yael Aharon + + Reviewed by Simon Hausmann. + + [Qt] REGRESSION: Allow applications to use their own QWidget bypassing QWebView. + https://bugs.webkit.org/show_bug.cgi?id=30979 + + Decouple QWebViewPrivate from QWebPageClient, and automatically create + QWebPageWidgetClient whenever the view is QWidget based. + + * Api/qwebpage.cpp: + (QWebPageWidgetClient::QWebPageWidgetClient): + (QWebPageWidgetClient::scroll): + (QWebPageWidgetClient::update): + (QWebPageWidgetClient::setInputMethodEnabled): + (QWebPageWidgetClient::setInputMethodHint): + (QWebPageWidgetClient::cursor): + (QWebPageWidgetClient::updateCursor): + (QWebPageWidgetClient::palette): + (QWebPageWidgetClient::screenNumber): + (QWebPageWidgetClient::ownerWidget): + (QWebPageWidgetClient::pluginParent): + (QWebPage::setView): + * Api/qwebview.cpp: + (QWebView::~QWebView): + (QWebView::setPage): + (QWebView::event): + +2009-11-03 Andras Becsi + + Reviewed by Simon Hausmann. + + [Qt] Fix build of unit-test after r50454. + + * tests/qwebpage/tst_qwebpage.cpp: + +2009-11-03 Simon Hausmann + + Reviewed by Tor Arne Vestbø. + + Make QWebPluginDatabase private API for now. + + https://bugs.webkit.org/show_bug.cgi?id=30775 + + * Api/headers.pri: + * Api/qwebplugindatabase.cpp: + * Api/qwebplugindatabase_p.h: Renamed from WebKit/qt/Api/qwebplugindatabase.h. + * Api/qwebsettings.cpp: + * Api/qwebsettings.h: + * QtLauncher/main.cpp: + (MainWindow::setupUI): + * tests/tests.pro: + +2009-11-03 Simon Hausmann + + Rubber-stamped by Tor Arne Vestbø. + + Oops, also remove the API docs of the removed networkRequestStarted() signal. + + * Api/qwebpage.cpp: + +2009-11-03 Simon Hausmann + + Reviewed by Tor Arne Vestbø. + + Replace the QWebPage::networkRequestStarted() signal with the originatingObject + property set to the QWebFrame that belongs to the request. + + https://bugs.webkit.org/show_bug.cgi?id=29975 + + * Api/qwebpage.h: + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::dispatchDecidePolicyForNewWindowAction): + (WebCore::FrameLoaderClientQt::dispatchDecidePolicyForNavigationAction): + (WebCore::FrameLoaderClientQt::startDownload): + * tests/qwebpage/tst_qwebpage.cpp: + (tst_QWebPage::loadFinished): + (TestNetworkManager::createRequest): + (tst_QWebPage::originatingObjectInNetworkRequests): + +2009-11-02 Jedrzej Nowacki + + Reviewed by Adam Barth. + + QWebView crash fix. + + The QWebView should not crash if the stop() method is called from + a function triggered by the loadProgress signal. + + A null pointer protection was added in the ProgressTracker::incrementProgress. + + New autotest was created. + + https://bugs.webkit.org/show_bug.cgi?id=29425 + + * tests/qwebview/tst_qwebview.cpp: + (WebViewCrashTest::WebViewCrashTest): + (WebViewCrashTest::loading): + (tst_QWebView::crashTests): + +2009-10-30 Jocelyn Turcotte + + Reviewed by Tor Arne Vestbø. + + [Qt] Remove the QWebInspector::windowTitleChanged signal, + QEvent::WindowTitleChange can be used to achieve the same. + https://bugs.webkit.org/show_bug.cgi?id=30927 + + * Api/qwebinspector.cpp: + * Api/qwebinspector.h: + * WebCoreSupport/InspectorClientQt.cpp: + (WebCore::InspectorClientQt::updateWindowTitle): + +2009-10-29 Laszlo Gombos + + Reviewed by Tor Arne Vestbø. + + [Qt] Implement DELETE HTTP method for XmlHttpRequest + https://bugs.webkit.org/show_bug.cgi?id=30894 + + No new tests as this functionality is already tested by the + xmlhttprequest LayoutTests. As this patch depends on an unreleased + version of the dependent QtNetwork library and the tests will be + enabled later once the dependent library is released (and the + buildbot is updated). + + * Api/qwebframe.cpp: + (QWebFrame::load): + 2009-10-29 Kenneth Rohde Christiansen Reviewed by Tor Arne Vestbø. diff --git a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp index 1ed9b21..f706d77 100644 --- a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp +++ b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp @@ -708,7 +708,7 @@ void FrameLoaderClientQt::committedLoad(WebCore::DocumentLoader* loader, const c WebCore::ResourceError FrameLoaderClientQt::cancelledError(const WebCore::ResourceRequest& request) { ResourceError error = ResourceError("QtNetwork", QNetworkReply::OperationCanceledError, request.url().prettyURL(), - QCoreApplication::translate("QWebFrame", "Request canceled", 0, QCoreApplication::UnicodeUTF8)); + QCoreApplication::translate("QWebFrame", "Request cancelled", 0, QCoreApplication::UnicodeUTF8)); error.setIsCancellation(true); return error; } @@ -746,7 +746,7 @@ WebCore::ResourceError FrameLoaderClientQt::interruptForPolicyChangeError(const WebCore::ResourceError FrameLoaderClientQt::cannotShowMIMETypeError(const WebCore::ResourceResponse& response) { return ResourceError("WebKit", WebKitErrorCannotShowMIMEType, response.url().string(), - QCoreApplication::translate("QWebFrame", "Cannot show MIME type", 0, QCoreApplication::UnicodeUTF8)); + QCoreApplication::translate("QWebFrame", "Cannot show mimetype", 0, QCoreApplication::UnicodeUTF8)); } WebCore::ResourceError FrameLoaderClientQt::fileDoesNotExistError(const WebCore::ResourceResponse& response) @@ -946,7 +946,7 @@ void FrameLoaderClientQt::dispatchDecidePolicyForNewWindowAction(FramePolicyFunc #if QT_VERSION < 0x040400 QWebNetworkRequest r(request); #else - QNetworkRequest r(request.toNetworkRequest()); + QNetworkRequest r(request.toNetworkRequest(m_webFrame)); #endif QWebPage* page = m_webFrame->page(); @@ -971,7 +971,7 @@ void FrameLoaderClientQt::dispatchDecidePolicyForNavigationAction(FramePolicyFun #if QT_VERSION < 0x040400 QWebNetworkRequest r(request); #else - QNetworkRequest r(request.toNetworkRequest()); + QNetworkRequest r(request.toNetworkRequest(m_webFrame)); #endif QWebPage*page = m_webFrame->page(); @@ -1001,7 +1001,7 @@ void FrameLoaderClientQt::startDownload(const WebCore::ResourceRequest& request) if (!m_webFrame) return; - emit m_webFrame->page()->downloadRequested(request.toNetworkRequest()); + emit m_webFrame->page()->downloadRequested(request.toNetworkRequest(m_webFrame)); #endif } diff --git a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp index 12f405c..7a1bfd5 100644 --- a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp +++ b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp @@ -166,7 +166,6 @@ void InspectorClientQt::updateWindowTitle() if (m_inspectedWebPage->d->inspector) { QString caption = QCoreApplication::translate("QWebPage", "Web Inspector - %2").arg(m_inspectedURL); m_inspectedWebPage->d->inspector->setWindowTitle(caption); - emit m_inspectedWebPage->d->inspector->windowTitleChanged(caption); } } diff --git a/src/3rdparty/webkit/WebKit/qt/docs/qtwebkit.qdoc b/src/3rdparty/webkit/WebKit/qt/docs/qtwebkit.qdoc index 408478c..09dfae5 100644 --- a/src/3rdparty/webkit/WebKit/qt/docs/qtwebkit.qdoc +++ b/src/3rdparty/webkit/WebKit/qt/docs/qtwebkit.qdoc @@ -31,7 +31,7 @@ the module under the appropriate version of the GNU LGPL; version 2.1 for applications and libraries licensed under the GNU GPL version 2, or version 3 for applications and libraries licensed under the GNU - GPL version 3. + GPL version 2. \legalese WebKit is licensed under the GNU Library General Public License. diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/qwebframe.pro b/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/qwebframe.pro index b8734cd..0e540e5 100644 --- a/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/qwebframe.pro +++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/qwebframe.pro @@ -5,7 +5,7 @@ SOURCES += tst_qwebframe.cpp RESOURCES += qwebframe.qrc QT += testlib network QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR -!symbian:DEFINES += SRCDIR=\\\"$$PWD/resources\\\" +DEFINES += SRCDIR=\\\"$$PWD/resources\\\" symbian { TARGET.UID3 = 0xA000E53D diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp b/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp index d304d3e..7cc62b0 100644 --- a/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp +++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp @@ -38,10 +38,6 @@ #endif #include "../util.h" -#if defined(Q_OS_SYMBIAN) -# define SRCDIR "" -#endif - //TESTED_CLASS= //TESTED_FILES= @@ -590,6 +586,7 @@ private slots: void javaScriptWindowObjectClearedOnEvaluate(); void setHtml(); void setHtmlWithResource(); + void setHtmlWithBaseURL(); void ipv6HostEncoding(); void metaData(); void popupFocus(); @@ -2375,6 +2372,28 @@ void tst_QWebFrame::setHtmlWithResource() QCOMPARE(p.styleProperty("color", QWebElement::CascadedStyle), QLatin1String("red")); } +void tst_QWebFrame::setHtmlWithBaseURL() +{ + QString html("

hello world

"); + + QWebPage page; + QWebFrame* frame = page.mainFrame(); + + // in few seconds, the image should be completey loaded + QSignalSpy spy(&page, SIGNAL(loadFinished(bool))); + + frame->setHtml(html, QUrl::fromLocalFile(QDir::currentPath())); + QTest::qWait(200); + QCOMPARE(spy.count(), 1); + + QCOMPARE(frame->evaluateJavaScript("document.images.length").toInt(), 1); + QCOMPARE(frame->evaluateJavaScript("document.images[0].width").toInt(), 128); + QCOMPARE(frame->evaluateJavaScript("document.images[0].height").toInt(), 128); + + // no history item has to be added. + QCOMPARE(m_view->page()->history()->count(), 0); +} + class TestNetworkManager : public QNetworkAccessManager { public: diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/qwebpage.pro b/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/qwebpage.pro index 7853b28..6b28efd 100644 --- a/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/qwebpage.pro +++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/qwebpage.pro @@ -5,7 +5,7 @@ SOURCES += tst_qwebpage.cpp RESOURCES += tst_qwebpage.qrc QT += testlib network QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR -!symbian:DEFINES += SRCDIR=\\\"$$PWD/\\\" +DEFINES += SRCDIR=\\\"$$PWD/\\\" symbian { TARGET.UID3 = 0xA000E53E diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp b/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp index 8373e04..6cbe2b1 100644 --- a/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp +++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp @@ -37,10 +37,6 @@ #include #include -#if defined(Q_OS_SYMBIAN) -# define SRCDIR "" -#endif - // Will try to wait for the condition while allowing event processing #define QTRY_COMPARE(__expr, __expected) \ do { \ @@ -133,6 +129,8 @@ private slots: void screenshot_data(); void screenshot(); + void originatingObjectInNetworkRequests(); + private: QWebView* m_view; QWebPage* m_page; @@ -238,7 +236,6 @@ void tst_QWebPage::loadFinished() { qRegisterMetaType("QWebFrame*"); qRegisterMetaType("QNetworkRequest*"); - QSignalSpy spyNetworkRequestStarted(m_page, SIGNAL(networkRequestStarted(QWebFrame*, QNetworkRequest*))); QSignalSpy spyLoadStarted(m_view, SIGNAL(loadStarted())); QSignalSpy spyLoadFinished(m_view, SIGNAL(loadFinished(bool))); @@ -249,7 +246,6 @@ void tst_QWebPage::loadFinished() QTest::qWait(3000); - QVERIFY(spyNetworkRequestStarted.count() > 1); QVERIFY(spyLoadStarted.count() > 1); QVERIFY(spyLoadFinished.count() > 1); @@ -350,9 +346,11 @@ public: TestNetworkManager(QObject* parent) : QNetworkAccessManager(parent) {} QList requestedUrls; + QList requests; protected: virtual QNetworkReply* createRequest(Operation op, const QNetworkRequest &request, QIODevice* outgoingData) { + requests.append(request); requestedUrls.append(request.url()); return QNetworkAccessManager::createRequest(op, request, outgoingData); } @@ -1613,5 +1611,27 @@ void tst_QWebPage::screenshot() QDir::setCurrent(QApplication::applicationDirPath()); } +void tst_QWebPage::originatingObjectInNetworkRequests() +{ + TestNetworkManager* networkManager = new TestNetworkManager(m_page); + m_page->setNetworkAccessManager(networkManager); + networkManager->requests.clear(); + + m_view->setHtml(QString("data:text/html,foo \">" + ""), QUrl()); + QVERIFY(::waitForSignal(m_view, SIGNAL(loadFinished(bool)))); + + QCOMPARE(networkManager->requests.count(), 2); + + QList childFrames = m_page->mainFrame()->childFrames(); + QCOMPARE(childFrames.count(), 2); + +#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0) + for (int i = 0; i < 2; ++i) + QVERIFY(qobject_cast(networkManager->requests.at(i).originatingObject()) == childFrames.at(i)); +#endif +} + QTEST_MAIN(tst_QWebPage) #include "tst_qwebpage.moc" diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebview/data/frame_a.html b/src/3rdparty/webkit/WebKit/qt/tests/qwebview/data/frame_a.html new file mode 100644 index 0000000..9ff68f1 --- /dev/null +++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebview/data/frame_a.html @@ -0,0 +1,2 @@ +Google +Yahoo diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebview/data/index.html b/src/3rdparty/webkit/WebKit/qt/tests/qwebview/data/index.html new file mode 100644 index 0000000..c53ad09 --- /dev/null +++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebview/data/index.html @@ -0,0 +1,4 @@ + + + + diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebview/qwebview.pro b/src/3rdparty/webkit/WebKit/qt/tests/qwebview/qwebview.pro index e67bb7a..735537b 100644 --- a/src/3rdparty/webkit/WebKit/qt/tests/qwebview/qwebview.pro +++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebview/qwebview.pro @@ -4,6 +4,7 @@ include(../../../../WebKit.pri) SOURCES += tst_qwebview.cpp QT += testlib network QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR +RESOURCES += tst_qwebview.qrc DEFINES += SRCDIR=\\\"$$PWD/\\\" symbian { diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebview/tst_qwebview.cpp b/src/3rdparty/webkit/WebKit/qt/tests/qwebview/tst_qwebview.cpp index fda979e..27daf38 100644 --- a/src/3rdparty/webkit/WebKit/qt/tests/qwebview/tst_qwebview.cpp +++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebview/tst_qwebview.cpp @@ -20,6 +20,7 @@ */ #include +#include "../util.h" #include #include @@ -45,6 +46,8 @@ private slots: void reusePage_data(); void reusePage(); + + void crashTests(); }; // This will be called before the first test function is executed. @@ -148,6 +151,46 @@ void tst_QWebView::reusePage() QDir::setCurrent(QApplication::applicationDirPath()); } +// Class used in crashTests +class WebViewCrashTest : public QObject { + Q_OBJECT + QWebView* m_view; +public: + bool m_executed; + + + WebViewCrashTest(QWebView* view) + : m_view(view) + , m_executed(false) + { + view->connect(view, SIGNAL(loadProgress(int)), this, SLOT(loading(int))); + } + +private slots: + void loading(int progress) + { + if (progress >= 20 && progress < 90) { + QVERIFY(!m_executed); + m_view->stop(); + m_executed = true; + } + } +}; + + +// Should not crash. +void tst_QWebView::crashTests() +{ + // Test if loading can be stopped in loadProgress handler without crash. + // Test page should have frames. + QWebView view; + WebViewCrashTest tester(&view); + QUrl url("qrc:///data/index.html"); + view.load(url); + QTRY_VERIFY(tester.m_executed); // If fail it means that the test wasn't executed. +} + + QTEST_MAIN(tst_QWebView) #include "tst_qwebview.moc" diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebview/tst_qwebview.qrc b/src/3rdparty/webkit/WebKit/qt/tests/qwebview/tst_qwebview.qrc new file mode 100644 index 0000000..ede34a9 --- /dev/null +++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebview/tst_qwebview.qrc @@ -0,0 +1,7 @@ + + + data/index.html + data/frame_a.html + + + diff --git a/src/3rdparty/webkit/WebKit/qt/tests/tests.pro b/src/3rdparty/webkit/WebKit/qt/tests/tests.pro index 81cc8f3..939cd22 100644 --- a/src/3rdparty/webkit/WebKit/qt/tests/tests.pro +++ b/src/3rdparty/webkit/WebKit/qt/tests/tests.pro @@ -1,4 +1,4 @@ TEMPLATE = subdirs -SUBDIRS = qwebframe qwebpage qwebelement qgraphicswebview qwebhistoryinterface qwebplugindatabase qwebview qwebhistory +SUBDIRS = qwebframe qwebpage qwebelement qgraphicswebview qwebhistoryinterface qwebview qwebhistory greaterThan(QT_MINOR_VERSION, 4): SUBDIRS += benchmarks/painting/tst_painting.pro benchmarks/loading/tst_loading.pro -- cgit v0.12 From 29afcb69d6023aba012051bd2a026b57b3689732 Mon Sep 17 00:00:00 2001 From: Liang QI Date: Tue, 3 Nov 2009 12:05:50 +0100 Subject: Re-apply change 1db4a133a9d35e00bad50541fb8d64079a7debea by Liang QI Fix tst_qwebpage and tst_qwebframe compilation on Symbian. RevBy: TrustMe --- src/3rdparty/webkit/WebKit/qt/tests/qwebframe/qwebframe.pro | 2 +- src/3rdparty/webkit/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp | 4 ++++ src/3rdparty/webkit/WebKit/qt/tests/qwebpage/qwebpage.pro | 2 +- src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp | 4 ++++ 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/qwebframe.pro b/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/qwebframe.pro index 0e540e5..b8734cd 100644 --- a/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/qwebframe.pro +++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/qwebframe.pro @@ -5,7 +5,7 @@ SOURCES += tst_qwebframe.cpp RESOURCES += qwebframe.qrc QT += testlib network QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR -DEFINES += SRCDIR=\\\"$$PWD/resources\\\" +!symbian:DEFINES += SRCDIR=\\\"$$PWD/resources\\\" symbian { TARGET.UID3 = 0xA000E53D diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp b/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp index 7cc62b0..6f07e90 100644 --- a/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp +++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp @@ -38,6 +38,10 @@ #endif #include "../util.h" +#if defined(Q_OS_SYMBIAN) +# define SRCDIR "" +#endif + //TESTED_CLASS= //TESTED_FILES= diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/qwebpage.pro b/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/qwebpage.pro index 6b28efd..7853b28 100644 --- a/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/qwebpage.pro +++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/qwebpage.pro @@ -5,7 +5,7 @@ SOURCES += tst_qwebpage.cpp RESOURCES += tst_qwebpage.qrc QT += testlib network QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR -DEFINES += SRCDIR=\\\"$$PWD/\\\" +!symbian:DEFINES += SRCDIR=\\\"$$PWD/\\\" symbian { TARGET.UID3 = 0xA000E53E diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp b/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp index 6cbe2b1..3eead92 100644 --- a/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp +++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp @@ -37,6 +37,10 @@ #include #include +#if defined(Q_OS_SYMBIAN) +# define SRCDIR "" +#endif + // Will try to wait for the condition while allowing event processing #define QTRY_COMPARE(__expr, __expected) \ do { \ -- cgit v0.12 From fdb9419f23d1cd2a9ddfc1f7e2fb58f6e845483b Mon Sep 17 00:00:00 2001 From: Jocelyn Turcotte Date: Tue, 13 Oct 2009 11:34:27 +0200 Subject: Re-apply change 2fbc823bb66db6ef6f6acc74d2baa96ebe1dec81 by Jocelyn Turcotte Re-apply change 6125aabeccb01a07c706fe4227279eb827e8e890 by Jocelyn Turcotte Re-apply change 6b8ac349b9a477863a8c8388dcc0658f3284bc54 by Jocelyn Turcotte Re-applying commit ee0a43fee20cc398b505eb65218ebed56dfc8f39 by Simon Hausmann Fix crash of QtScript on Mac OS X When compiling on 10.4 but running on 10.5 the flags passed to vm_map cause it to crash. For now fall back to the use of mmap() as allocator instead. Reviewed-by: Kent Hansen --- src/3rdparty/webkit/JavaScriptCore/runtime/Collector.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/3rdparty/webkit/JavaScriptCore/runtime/Collector.cpp b/src/3rdparty/webkit/JavaScriptCore/runtime/Collector.cpp index b885049..8b647a0 100644 --- a/src/3rdparty/webkit/JavaScriptCore/runtime/Collector.cpp +++ b/src/3rdparty/webkit/JavaScriptCore/runtime/Collector.cpp @@ -240,7 +240,9 @@ void Heap::destroy() template NEVER_INLINE CollectorBlock* Heap::allocateBlock() { -#if PLATFORM(DARWIN) + // Disable the use of vm_map for the Qt build on Darwin, because when compiled on 10.4 + // it crashes on 10.5 +#if PLATFORM(DARWIN) && !PLATFORM(QT) vm_address_t address = 0; // FIXME: tag the region as a JavaScriptCore heap when we get a registered VM tag: . vm_map(current_task(), &address, BLOCK_SIZE, BLOCK_OFFSET_MASK, VM_FLAGS_ANYWHERE | VM_TAG_FOR_COLLECTOR_MEMORY, MEMORY_OBJECT_NULL, 0, FALSE, VM_PROT_DEFAULT, VM_PROT_DEFAULT, VM_INHERIT_DEFAULT); @@ -332,7 +334,9 @@ NEVER_INLINE void Heap::freeBlock(size_t block) NEVER_INLINE void Heap::freeBlock(CollectorBlock* block) { -#if PLATFORM(DARWIN) + // Disable the use of vm_deallocate for the Qt build on Darwin, because when compiled on 10.4 + // it crashes on 10.5 +#if PLATFORM(DARWIN) && !PLATFORM(QT) vm_deallocate(current_task(), reinterpret_cast(block), BLOCK_SIZE); #elif PLATFORM(SYMBIAN) userChunk->Free(reinterpret_cast(block)); -- cgit v0.12 From b065fda13c29110fc81f77c9bbf1069d562b4d67 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Fri, 16 Oct 2009 14:30:39 +0200 Subject: Re-apply change 422c747c5108f9f0c544b5dd0789df32aa498fb7 by Martin Smith Re-apply change cef1901dbd96be81fc4139b50b094dfae5223e6f by Martin Smith Re-apply change 0f8bff1970d4b0f10e98ce7d6ab341620f4ce76b by Martin Smith doc: Changed Trolltech to Nokia --- src/3rdparty/webkit/WebKit/qt/Api/qwebview.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebview.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebview.cpp index 12b20ab..6623f24 100644 --- a/src/3rdparty/webkit/WebKit/qt/Api/qwebview.cpp +++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebview.cpp @@ -70,7 +70,7 @@ void QWebViewPrivate::_q_pageDestroyed() It can be used in various applications to display web content live from the Internet. - The image below shows QWebView previewed in \QD with the Trolltech website. + The image below shows QWebView previewed in \QD with a Nokia website. \image qwebview-url.png -- cgit v0.12 From 62ed4c43c8c2fe3457de6d7570c2ae4a09a5ecf0 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Fri, 23 Oct 2009 14:51:48 +0200 Subject: Re-apply change 914de965a8380e7620209c7b26e984ed9fbccc57 by David Boddie Re-apply change 37dc859e7e2e0f135e4c40bc7f6f824fcdb21e86 by David Boddie Doc: Fixed and synchronized QWebView related documentation. Reviewed-by: Trust Me --- .../webkit/WebKit/qt/Api/qgraphicswebview.cpp | 96 ++++++++++++++++++++-- src/3rdparty/webkit/WebKit/qt/Api/qwebview.cpp | 2 +- 2 files changed, 91 insertions(+), 7 deletions(-) diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.cpp index 50a0986..b22109b 100644 --- a/src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.cpp +++ b/src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.cpp @@ -164,17 +164,101 @@ void QGraphicsWebViewPrivate::_q_setStatusBarMessage(const QString& s) /*! \class QGraphicsWebView - \brief The QGraphicsWebView class allows web content to be added to a GraphicsView. + \brief The QGraphicsWebView class allows Web content to be added to a GraphicsView. \since 4.6 - A WebGraphicsItem renders web content based on a URL or set data. + An instance of this class renders Web content from a URL or supplied as data, using + features of the QtWebKit module. - If the width and height of the item is not set, they will - dynamically adjust to a size appropriate for the content. - This width may be large (eg. 980) for typical online web pages. + If the width and height of the item is not set, they will dynamically adjust to + a size appropriate for the content. This width may be large (e.g., 980 pixels or + more) for typical online Web pages. + + \section1 Browser Features + + Many of the functions, signals and properties provided by QWebView are also available + for this item, making it simple to adapt existing code to use QGraphicsWebView instead + of QWebView. + + The item uses a QWebPage object to perform the rendering of Web content, and this can + be obtained with the page() function, enabling the document itself to be accessed and + modified. + + As with QWebView, the item records the browsing history using a QWebHistory object, + accessible using the history() function. The QWebSettings object that defines the + configuration of the browser can be obtained with the settings() function, enabling + features like plugin support to be customized for each item. + + \sa QWebView, QGraphicsTextItem +*/ + +/*! + \fn void QGraphicsWebView::titleChanged(const QString &title) + + This signal is emitted whenever the \a title of the main frame changes. + + \sa title() +*/ + +/*! + \fn void QGraphicsWebView::urlChanged(const QUrl &url) + + This signal is emitted when the \a url of the view changes. + + \sa url(), load() +*/ + +/*! + \fn void QGraphicsWebView::statusChanged() + + This signal is emitted when the status bar text is changed by the page. +*/ + +/*! + \fn void QGraphicsWebView::iconChanged() + + This signal is emitted whenever the icon of the page is loaded or changes. + + In order for icons to be loaded, you will need to set an icon database path + using QWebSettings::setIconDatabasePath(). + + \sa icon(), QWebSettings::setIconDatabasePath() +*/ + +/*! + \fn void QGraphicsWebView::loadStarted() + + This signal is emitted when a new load of the page is started. + + \sa progressChanged(), loadFinished() +*/ + +/*! + \fn void QGraphicsWebView::loadFinished(bool ok) + + This signal is emitted when a load of the page is finished. + \a ok will indicate whether the load was successful or any error occurred. + + \sa loadStarted() */ /*! + \fn void QGraphicsWebView::progressChanged(qreal progress) + + This signal is emitted every time an element in the web page + completes loading and the overall loading progress advances. + + This signal tracks the progress of all child frames. + + The current value is provided by \a progress and scales from 0.0 to 1.0, + which is the default range of QProgressBar. + + \sa loadStarted(), loadFinished() +*/ + + + +/*! Constructs an empty QGraphicsWebView with parent \a parent. \sa load() @@ -191,7 +275,7 @@ QGraphicsWebView::QGraphicsWebView(QGraphicsItem* parent) } /*! - Destroys the web graphicsitem. + Destroys the item. */ QGraphicsWebView::~QGraphicsWebView() { diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebview.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebview.cpp index 6623f24..55ce1f7 100644 --- a/src/3rdparty/webkit/WebKit/qt/Api/qwebview.cpp +++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebview.cpp @@ -974,7 +974,7 @@ void QWebView::changeEvent(QEvent *e) /*! \fn void QWebView::statusBarMessage(const QString& text) - This signal is emitted when the statusbar \a text is changed by the page. + This signal is emitted when the status bar \a text is changed by the page. */ /*! -- cgit v0.12 From 16d98a3fa8e5cf5f41e35e257b8791ce030a4ce1 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Mon, 26 Oct 2009 10:56:57 +0100 Subject: Re-apply change cbb2efb13cdf05aabc245e2b0157883146cf069d by Thiago Macieira Re-apply change 3f7a99565de7ed17d7ac4c0a25b02997b094b1a9 by Thiago Macieira Fix linking of WebKit on Linux 32-bit. It was missing the ".text" directive at the top of the file, indicating that code would follow. Without it, the assembler created "NOTYPE" symbols, which would result in linker errors. --- src/3rdparty/webkit/JavaScriptCore/jit/JITStubs.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/3rdparty/webkit/JavaScriptCore/jit/JITStubs.cpp b/src/3rdparty/webkit/JavaScriptCore/jit/JITStubs.cpp index c999618..9fa898a 100644 --- a/src/3rdparty/webkit/JavaScriptCore/jit/JITStubs.cpp +++ b/src/3rdparty/webkit/JavaScriptCore/jit/JITStubs.cpp @@ -75,7 +75,7 @@ namespace JSC { #define THUMB_FUNC_PARAM(name) #endif -#if PLATFORM(LINUX) && PLATFORM(X86_64) +#if PLATFORM(LINUX) && (PLATFORM(X86_64) || PLATFORM(X86)) #define SYMBOL_STRING_RELOCATION(name) #name "@plt" #else #define SYMBOL_STRING_RELOCATION(name) SYMBOL_STRING(name) @@ -93,6 +93,7 @@ COMPILE_ASSERT(offsetof(struct JITStackFrame, callFrame) == 0x58, JITStackFrame_ COMPILE_ASSERT(offsetof(struct JITStackFrame, code) == 0x50, JITStackFrame_code_offset_matches_ctiTrampoline); asm volatile ( +".text\n" ".globl " SYMBOL_STRING(ctiTrampoline) "\n" SYMBOL_STRING(ctiTrampoline) ":" "\n" "pushl %ebp" "\n" -- cgit v0.12 From 0951f86be22633e1ff763de935f9c35a20f8a575 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Mon, 26 Oct 2009 11:04:21 +0100 Subject: Re-apply change 7293097060383bcb75ee9f3e6a270de3b5bee2dc by Thiago Macieira Re-apply change e2ef97128c006ac2a5c99c67bb54eebaa3b45720 by Thiago Macieira Implement symbol hiding for JSC's JIT functions. These functions are implemented directly in assembly, so they need the proper directives to enable/disable visibility. On ELF systems, it's .hidden, whereas on Mach-O systems (Mac) it's .private_extern. On Windows, it's not necessary since you have to explicitly export. I also implemented the AIX idiom, though it's unlikely anyone will implement AIX/POWER JIT. That leaves only HP-UX on PA-RISC unimplemented, from the platforms that Qt supports. It's also unlikely that we'll imlpement JIT for it. Reviewed-by: Kent Hansen (this commit was 26d0990c66068bfc92a2ec77512b26d4a0c11b02, but was lost during a WebKit update) --- .../webkit/JavaScriptCore/jit/JITStubs.cpp | 37 ++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/src/3rdparty/webkit/JavaScriptCore/jit/JITStubs.cpp b/src/3rdparty/webkit/JavaScriptCore/jit/JITStubs.cpp index 9fa898a..470ed0b 100644 --- a/src/3rdparty/webkit/JavaScriptCore/jit/JITStubs.cpp +++ b/src/3rdparty/webkit/JavaScriptCore/jit/JITStubs.cpp @@ -81,6 +81,19 @@ namespace JSC { #define SYMBOL_STRING_RELOCATION(name) SYMBOL_STRING(name) #endif +#if PLATFORM(DARWIN) + // Mach-O platform +#define HIDE_SYMBOL(name) ".private_extern _" #name +#elif PLATFORM(AIX) + // IBM's own file format +#define HIDE_SYMBOL(name) ".lglobl " #name +#elif PLATFORM(LINUX) || PLATFORM(FREEBSD) || PLATFORM(OPENBSD) || PLATFORM(SOLARIS) || (PLATFORM(HPUX) && PLATFORM(IA64)) || PLATFORM(SYMBIAN) || PLATFORM(NETBSD) + // ELF platform +#define HIDE_SYMBOL(name) ".hidden " #name +#else +#define HIDE_SYMBOL(name) +#endif + #if USE(JSVALUE32_64) #if COMPILER(GCC) && PLATFORM(X86) @@ -95,6 +108,7 @@ COMPILE_ASSERT(offsetof(struct JITStackFrame, code) == 0x50, JITStackFrame_code_ asm volatile ( ".text\n" ".globl " SYMBOL_STRING(ctiTrampoline) "\n" +HIDE_SYMBOL(ctiTrampoline) "\n" SYMBOL_STRING(ctiTrampoline) ":" "\n" "pushl %ebp" "\n" "movl %esp, %ebp" "\n" @@ -115,6 +129,7 @@ SYMBOL_STRING(ctiTrampoline) ":" "\n" asm volatile ( ".globl " SYMBOL_STRING(ctiVMThrowTrampoline) "\n" +HIDE_SYMBOL(ctiVMThrowTrampoline) "\n" SYMBOL_STRING(ctiVMThrowTrampoline) ":" "\n" #if !USE(JIT_STUB_ARGUMENT_VA_LIST) "movl %esp, %ecx" "\n" @@ -130,6 +145,7 @@ SYMBOL_STRING(ctiVMThrowTrampoline) ":" "\n" asm volatile ( ".globl " SYMBOL_STRING(ctiOpThrowNotCaught) "\n" +HIDE_SYMBOL(ctiOpThrowNotCaught) "\n" SYMBOL_STRING(ctiOpThrowNotCaught) ":" "\n" "addl $0x3c, %esp" "\n" "popl %ebx" "\n" @@ -154,6 +170,7 @@ COMPILE_ASSERT(offsetof(struct JITStackFrame, code) == 0x80, JITStackFrame_code_ asm volatile ( ".globl " SYMBOL_STRING(ctiTrampoline) "\n" +HIDE_SYMBOL(ctiTrampoline) "\n" SYMBOL_STRING(ctiTrampoline) ":" "\n" "pushq %rbp" "\n" "movq %rsp, %rbp" "\n" @@ -180,6 +197,7 @@ SYMBOL_STRING(ctiTrampoline) ":" "\n" asm volatile ( ".globl " SYMBOL_STRING(ctiVMThrowTrampoline) "\n" +HIDE_SYMBOL(ctiVMThrowTrampoline) "\n" SYMBOL_STRING(ctiVMThrowTrampoline) ":" "\n" "movq %rsp, %rdi" "\n" "call " SYMBOL_STRING_RELOCATION(cti_vm_throw) "\n" @@ -195,6 +213,7 @@ SYMBOL_STRING(ctiVMThrowTrampoline) ":" "\n" asm volatile ( ".globl " SYMBOL_STRING(ctiOpThrowNotCaught) "\n" +HIDE_SYMBOL(ctiOpThrowNotCaught) "\n" SYMBOL_STRING(ctiOpThrowNotCaught) ":" "\n" "addq $0x48, %rsp" "\n" "popq %rbx" "\n" @@ -216,6 +235,7 @@ asm volatile ( ".text" "\n" ".align 2" "\n" ".globl " SYMBOL_STRING(ctiTrampoline) "\n" +HIDE_SYMBOL(ctiTrampoline) "\n" ".thumb" "\n" ".thumb_func " THUMB_FUNC_PARAM(ctiTrampoline) "\n" SYMBOL_STRING(ctiTrampoline) ":" "\n" @@ -242,6 +262,7 @@ asm volatile ( ".text" "\n" ".align 2" "\n" ".globl " SYMBOL_STRING(ctiVMThrowTrampoline) "\n" +HIDE_SYMBOL(ctiVMThrowTrampoline) "\n" ".thumb" "\n" ".thumb_func " THUMB_FUNC_PARAM(ctiVMThrowTrampoline) "\n" SYMBOL_STRING(ctiVMThrowTrampoline) ":" "\n" @@ -347,7 +368,9 @@ COMPILE_ASSERT(offsetof(struct JITStackFrame, code) == 0x30, JITStackFrame_code_ COMPILE_ASSERT(offsetof(struct JITStackFrame, savedEBX) == 0x1c, JITStackFrame_stub_argument_space_matches_ctiTrampoline); asm volatile ( +".text\n" ".globl " SYMBOL_STRING(ctiTrampoline) "\n" +HIDE_SYMBOL(ctiTrampoline) "\n" SYMBOL_STRING(ctiTrampoline) ":" "\n" "pushl %ebp" "\n" "movl %esp, %ebp" "\n" @@ -368,6 +391,7 @@ SYMBOL_STRING(ctiTrampoline) ":" "\n" asm volatile ( ".globl " SYMBOL_STRING(ctiVMThrowTrampoline) "\n" +HIDE_SYMBOL(ctiVMThrowTrampoline) "\n" SYMBOL_STRING(ctiVMThrowTrampoline) ":" "\n" #if !USE(JIT_STUB_ARGUMENT_VA_LIST) "movl %esp, %ecx" "\n" @@ -383,6 +407,7 @@ SYMBOL_STRING(ctiVMThrowTrampoline) ":" "\n" asm volatile ( ".globl " SYMBOL_STRING(ctiOpThrowNotCaught) "\n" +HIDE_SYMBOL(ctiOpThrowNotCaught) "\n" SYMBOL_STRING(ctiOpThrowNotCaught) ":" "\n" "addl $0x1c, %esp" "\n" "popl %ebx" "\n" @@ -405,7 +430,9 @@ COMPILE_ASSERT(offsetof(struct JITStackFrame, code) == 0x48, JITStackFrame_code_ COMPILE_ASSERT(offsetof(struct JITStackFrame, savedRBX) == 0x78, JITStackFrame_stub_argument_space_matches_ctiTrampoline); asm volatile ( +".text\n" ".globl " SYMBOL_STRING(ctiTrampoline) "\n" +HIDE_SYMBOL(ctiTrampoline) "\n" SYMBOL_STRING(ctiTrampoline) ":" "\n" "pushq %rbp" "\n" "movq %rsp, %rbp" "\n" @@ -439,6 +466,7 @@ SYMBOL_STRING(ctiTrampoline) ":" "\n" asm volatile ( ".globl " SYMBOL_STRING(ctiVMThrowTrampoline) "\n" +HIDE_SYMBOL(ctiVMThrowTrampoline) "\n" SYMBOL_STRING(ctiVMThrowTrampoline) ":" "\n" "movq %rsp, %rdi" "\n" "call " SYMBOL_STRING_RELOCATION(cti_vm_throw) "\n" @@ -454,6 +482,7 @@ SYMBOL_STRING(ctiVMThrowTrampoline) ":" "\n" asm volatile ( ".globl " SYMBOL_STRING(ctiOpThrowNotCaught) "\n" +HIDE_SYMBOL(ctiOpThrowNotCaught) "\n" SYMBOL_STRING(ctiOpThrowNotCaught) ":" "\n" "addq $0x78, %rsp" "\n" "popq %rbx" "\n" @@ -475,6 +504,7 @@ asm volatile ( ".text" "\n" ".align 2" "\n" ".globl " SYMBOL_STRING(ctiTrampoline) "\n" +HIDE_SYMBOL(ctiTrampoline) "\n" ".thumb" "\n" ".thumb_func " THUMB_FUNC_PARAM(ctiTrampoline) "\n" SYMBOL_STRING(ctiTrampoline) ":" "\n" @@ -501,6 +531,7 @@ asm volatile ( ".text" "\n" ".align 2" "\n" ".globl " SYMBOL_STRING(ctiVMThrowTrampoline) "\n" +HIDE_SYMBOL(ctiVMThrowTrampoline) "\n" ".thumb" "\n" ".thumb_func " THUMB_FUNC_PARAM(ctiVMThrowTrampoline) "\n" SYMBOL_STRING(ctiVMThrowTrampoline) ":" "\n" @@ -518,6 +549,7 @@ asm volatile ( ".text" "\n" ".align 2" "\n" ".globl " SYMBOL_STRING(ctiOpThrowNotCaught) "\n" +HIDE_SYMBOL(ctiOpThrowNotCaught) "\n" ".thumb" "\n" ".thumb_func " THUMB_FUNC_PARAM(ctiOpThrowNotCaught) "\n" SYMBOL_STRING(ctiOpThrowNotCaught) ":" "\n" @@ -532,7 +564,9 @@ SYMBOL_STRING(ctiOpThrowNotCaught) ":" "\n" #elif COMPILER(GCC) && PLATFORM(ARM_TRADITIONAL) asm volatile ( +".text\n" ".globl " SYMBOL_STRING(ctiTrampoline) "\n" +HIDE_SYMBOL(ctiTrampoline) "\n" SYMBOL_STRING(ctiTrampoline) ":" "\n" "stmdb sp!, {r1-r3}" "\n" "stmdb sp!, {r4-r8, lr}" "\n" @@ -549,12 +583,14 @@ SYMBOL_STRING(ctiTrampoline) ":" "\n" asm volatile ( ".globl " SYMBOL_STRING(ctiVMThrowTrampoline) "\n" +HIDE_SYMBOL(ctiVMThrowTrampoline) "\n" SYMBOL_STRING(ctiVMThrowTrampoline) ":" "\n" "mov r0, sp" "\n" "bl " SYMBOL_STRING_RELOCATION(cti_vm_throw) "\n" // Both has the same return sequence ".globl " SYMBOL_STRING(ctiOpThrowNotCaught) "\n" +HIDE_SYMBOL(ctiOpThrowNotCaught) "\n" SYMBOL_STRING(ctiOpThrowNotCaught) ":" "\n" "add sp, sp, #36" "\n" "ldmia sp!, {r4-r8, lr}" "\n" @@ -889,6 +925,7 @@ static NEVER_INLINE void throwStackOverflowError(CallFrame* callFrame, JSGlobalD ".text" "\n" \ ".align 2" "\n" \ ".globl " SYMBOL_STRING(cti_##op) "\n" \ + HIDE_SYMBOL(cti_##op) "\n" \ ".thumb" "\n" \ ".thumb_func " THUMB_FUNC_PARAM(cti_##op) "\n" \ SYMBOL_STRING(cti_##op) ":" "\n" \ -- cgit v0.12 From 4f62d29e8ae464c223af5bc08ae219d9b198da63 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Mon, 26 Oct 2009 17:35:17 +0100 Subject: Re-apply change b4be512bffba65bf4577a2b8275d7c38ce5501a1 by David Boddie Re-apply change 6f36d0aafaccbb9affe8ac1b82c225d985aa7491 by David Boddie Doc: Added internal or hidden placeholder documentation. Reviewed-by: Trust Me To-be-completed-by: QtWebKit developers --- src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp index 5402ab1..a1e131a 100644 --- a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp +++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp @@ -2763,6 +2763,17 @@ void QWebPage::updatePositionDependentActions(const QPoint &pos) as a result of the user clicking on a "file upload" button in a HTML form where multiple file selection is allowed. + \omitvalue ErrorPageExtension (introduced in Qt 4.6) +*/ + +/*! + \enum QWebPage::ErrorDomain + \since 4.6 + \internal + + \value QtNetwork + \value Http + \value WebKit */ /*! @@ -2813,6 +2824,12 @@ void QWebPage::updatePositionDependentActions(const QPoint &pos) */ /*! + \fn QWebPage::ErrorPageExtensionReturn::ErrorPageExtensionReturn() + + Constructs a new error page object. +*/ + +/*! \class QWebPage::ChooseMultipleFilesExtensionOption \since 4.5 \brief The ChooseMultipleFilesExtensionOption class describes the option -- cgit v0.12 From 914d5847532a85a564a5df4a2bc8bdccb0f91abb Mon Sep 17 00:00:00 2001 From: Shane Kearns Date: Wed, 28 Oct 2009 08:52:30 +0100 Subject: Re-apply change cadd19cd98b9a6ff7ff8755f7774027400aadb0f by Shane Kearns Re-apply change 6bc9ef388590b4bfb281d2e1510dc7c3d1837349 by Shane Kearns Fix to 8e0fbc2caa3edefb78d6667721235b783bc1a850 This version of the fix will set the def file only if defblock is enabled in qbase.pri. That means that def files don't get turned on for webkit but not for the whole project (avoids build failures in the continuous integration system when other teams change the exported symbols) Reviewed-by: Jason Barron --- src/3rdparty/webkit/WebCore/WebCore.pro | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/3rdparty/webkit/WebCore/WebCore.pro b/src/3rdparty/webkit/WebCore/WebCore.pro index 60e414f..4e84a80 100644 --- a/src/3rdparty/webkit/WebCore/WebCore.pro +++ b/src/3rdparty/webkit/WebCore/WebCore.pro @@ -3381,3 +3381,18 @@ CONFIG(QTDIR_build):isEqual(QT_MAJOR_VERSION, 4):greaterThan(QT_MINOR_VERSION, 4 plugins/win/PaintHooks.asm } } + +# Temporary workaround to pick up the DEF file from the same place as all the others +symbian { + shared { + contains(MMP_RULES, defBlock) { + MMP_RULES -= defBlock + + MMP_RULES += "$${LITERAL_HASH}ifdef WINSCW" \ + "DEFFILE ../../../s60installs/bwins/$${TARGET}.def" \ + "$${LITERAL_HASH}elif defined EABI" \ + "DEFFILE ../../../s60installs/eabi/$${TARGET}.def" \ + "$${LITERAL_HASH}endif" + } + } +} -- cgit v0.12 From 2a9596d85a6c44fe1eba98447ab95ca913f10e29 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Tue, 27 Oct 2009 16:19:19 +0100 Subject: Re-apply change 62923e7edacf6a1d28accaff70cbdc0176890d62 by Joerg Bornemann Re-apply change fa1856bcb2eff41dadf0900202dd43f44ddb2343 by Joerg Bornemann WebKit compile fix for Windows CE Not sure if this is right fix. We could also disable PLUGIN_PACKAGE_SIMPLE_HASH. But this is automatically enabled when NETSCAPE_PLUGIN_API is disabled. Reviewed-by: thartman --- src/3rdparty/webkit/WebCore/platform/FileSystem.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/3rdparty/webkit/WebCore/platform/FileSystem.h b/src/3rdparty/webkit/WebCore/platform/FileSystem.h index 9952b39..791198d 100644 --- a/src/3rdparty/webkit/WebCore/platform/FileSystem.h +++ b/src/3rdparty/webkit/WebCore/platform/FileSystem.h @@ -98,6 +98,17 @@ struct PlatformModuleVersion { { } + bool operator != (const PlatformModuleVersion& rhs) const + { + return mostSig != rhs.mostSig && leastSig != rhs.leastSig; + } + + + bool operator > (const PlatformModuleVersion& rhs) const + { + return mostSig > rhs.mostSig && leastSig > rhs.leastSig; + } + }; #else typedef unsigned PlatformModuleVersion; -- cgit v0.12 From c1eae9d5842c73719d7719cccc4beca55711714d Mon Sep 17 00:00:00 2001 From: David Boddie Date: Wed, 4 Nov 2009 19:35:37 +0100 Subject: Doc: Fixed qdoc warnings. Reviewed-by: Trust Me --- doc/src/examples/ftp.qdoc | 12 ++++++------ doc/src/getting-started/examples.qdoc | 2 +- doc/src/network-programming/qtnetwork.qdoc | 4 ++-- src/dbus/qdbusservicewatcher.cpp | 10 +++++----- src/gui/graphicsview/qgraphicslinearlayout.cpp | 3 +++ src/gui/kernel/qevent.cpp | 5 +++-- src/gui/kernel/qgesture.cpp | 20 ++++++++++---------- src/gui/s60framework/qs60mainappui.cpp | 2 ++ src/gui/styles/qstyleoption.cpp | 5 +++-- src/network/socket/qabstractsocket.cpp | 6 +++--- src/network/ssl/qsslsocket.cpp | 10 ++++++++-- 11 files changed, 46 insertions(+), 33 deletions(-) diff --git a/doc/src/examples/ftp.qdoc b/doc/src/examples/ftp.qdoc index 8fded88..68fb0d7 100644 --- a/doc/src/examples/ftp.qdoc +++ b/doc/src/examples/ftp.qdoc @@ -40,7 +40,7 @@ ****************************************************************************/ /*! - \example network/ftp + \example network/qftp \title FTP Example The FTP example demonstrates a simple FTP client that can be used @@ -90,12 +90,12 @@ the FTP server, and registers whether an entry represents a directory or a file. We use the QFile object to download files from the FTP server. - + \section1 FtpWindow Class Implementation We skip the \c FtpWindow constructor as it only contains code for setting up the GUI, which is explained in other examples. - + We move on to the slots, starting with \c connectOrDisconnect(). \snippet examples/network/qftp/ftpwindow.cpp 0 @@ -137,7 +137,7 @@ \snippet examples/network/qftp/ftpwindow.cpp 3 \dots \snippet examples/network/qftp/ftpwindow.cpp 4 - + We first fetch the name of the file, which we find in the selected item of \c fileList. We then start the download by using QFtp::get(). QFtp will send progress signals during the download @@ -153,7 +153,7 @@ finished a QFtp::Command. If an error occurred during the command, QFtp will set \c error to one of the values in the QFtp::Error enum; otherwise, \c error is zero. - + \snippet examples/network/qftp/ftpwindow.cpp 7 After login, the QFtp::list() function will list the top-level @@ -165,7 +165,7 @@ When a \l{QFtp::}{Get} command is finished, a file has finished downloading (or an error occurred during the download). - + \snippet examples/network/qftp/ftpwindow.cpp 9 After a \l{QFtp::}{List} command is performed, we have to check if diff --git a/doc/src/getting-started/examples.qdoc b/doc/src/getting-started/examples.qdoc index 05940e4..79cbe89 100644 --- a/doc/src/getting-started/examples.qdoc +++ b/doc/src/getting-started/examples.qdoc @@ -729,7 +729,7 @@ \o \l{network/network-chat}{Network Chat} \o \l{network/fortuneclient}{Fortune Client}\raisedaster \o \l{network/fortuneserver}{Fortune Server}\raisedaster - \o \l{network/ftp}{FTP}\raisedaster + \o \l{network/qftp}{FTP}\raisedaster \o \l{network/http}{HTTP} \o \l{network/loopback}{Loopback} \o \l{network/threadedfortuneserver}{Threaded Fortune Server}\raisedaster diff --git a/doc/src/network-programming/qtnetwork.qdoc b/doc/src/network-programming/qtnetwork.qdoc index d9377fb..c20adaf 100644 --- a/doc/src/network-programming/qtnetwork.qdoc +++ b/doc/src/network-programming/qtnetwork.qdoc @@ -101,7 +101,7 @@ Each application or library can create one or more instances of QNetworkAccessManager to handle network communication. - + \section1 Writing FTP Clients with QFtp FTP (File Transfer Protocol) is a protocol used almost exclusively @@ -155,7 +155,7 @@ commands based on the result of a previous command. It also enables you to provide detailed feedback to the user. - The \l{network/ftp}{FTP} example + The \l{network/qftp}{FTP} example illustrates how to write an FTP client. Writing your own FTP (or HTTP) server is possible using the lower-level classes QTcpSocket and QTcpServer. diff --git a/src/dbus/qdbusservicewatcher.cpp b/src/dbus/qdbusservicewatcher.cpp index 4872732..115fe3e 100644 --- a/src/dbus/qdbusservicewatcher.cpp +++ b/src/dbus/qdbusservicewatcher.cpp @@ -150,14 +150,14 @@ void QDBusServiceWatcherPrivate::removeService(const QString &service) modes: \list - \o watching for service registration only - \o watching for service unregistration only - \o watching for any kind of service ownership change (the default mode) + \o Watching for service registration only. + \o Watching for service unregistration only. + \o Watching for any kind of service ownership change (the default mode). \endlist Besides being created or deleted, services may change owners without a - unregister/register operation happening. So the \ref serviceRegistered() - and \ref serviceUnregistered() signals may not be emitted if that + unregister/register operation happening. So the serviceRegistered() + and serviceUnregistered() signals may not be emitted if that happens. This class is more efficient than using the diff --git a/src/gui/graphicsview/qgraphicslinearlayout.cpp b/src/gui/graphicsview/qgraphicslinearlayout.cpp index 5684f0e..cb68741 100644 --- a/src/gui/graphicsview/qgraphicslinearlayout.cpp +++ b/src/gui/graphicsview/qgraphicslinearlayout.cpp @@ -542,6 +542,9 @@ void QGraphicsLinearLayout::invalidate() QGraphicsLayout::invalidate(); } +/*! + \internal +*/ void QGraphicsLinearLayout::dump(int indent) const { #ifdef QT_DEBUG diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp index 55a329c..31bd83f 100644 --- a/src/gui/kernel/qevent.cpp +++ b/src/gui/kernel/qevent.cpp @@ -4344,8 +4344,9 @@ bool QGestureEvent::isAccepted(QGesture *gesture) const Sets the accept flag of the given \a gestureType object to the specified \a value. - Setting the accept flag indicates that the event receiver wants the \a gesture. - Unwanted gestures may be propagated to the parent widget. + Setting the accept flag indicates that the event receiver wants to receive + gestures of the specified type. Unwanted gestures may be propagated to the + parent widget. By default, gestures in events of type QEvent::Gesture are accepted, and gestures in QEvent::GestureOverride events are ignored. diff --git a/src/gui/kernel/qgesture.cpp b/src/gui/kernel/qgesture.cpp index 850f22c..c121bad 100644 --- a/src/gui/kernel/qgesture.cpp +++ b/src/gui/kernel/qgesture.cpp @@ -174,6 +174,16 @@ void QGesture::unsetHotSpot() } /*! + \property QGesture::gestureCancelPolicy + \brief the policy for deciding what happens on accepting a gesture + + On accepting one gesture Qt can automatically cancel other gestures + that belong to other targets. The policy is normally set to not cancel + any other gestures and can be set to cancel all active gestures in the + context. For example for all child widgets. +*/ + +/*! \enum QGesture::GestureCancelPolicy This enum describes how accepting a gesture can cancel other gestures @@ -217,16 +227,6 @@ QGesture::GestureCancelPolicy QGesture::gestureCancelPolicy() const */ /*! - \property QGesture::GestureCancelPolicy - \brief the policy for deciding what happens on accepting a gesture - - On accepting one gesture Qt can automatically cancel other gestures - that belong to other targets. The policy is normally set to not cancel - any other gestures and can be set to cancel all active gestures in the - context. For example for all child widgets. -*/ - -/*! \property QPanGesture::lastOffset \brief the last offset recorded for this gesture diff --git a/src/gui/s60framework/qs60mainappui.cpp b/src/gui/s60framework/qs60mainappui.cpp index 4ad78f9..33c39e6 100644 --- a/src/gui/s60framework/qs60mainappui.cpp +++ b/src/gui/s60framework/qs60mainappui.cpp @@ -161,6 +161,8 @@ void QS60MainAppUi::HandleResourceChangeL(TInt type) } /*! + * \fn void QS60MainAppUi::HandleWsEventL(const TWsEvent &event, CCoeControl *destination) + * * \brief Handles raw window server events. * * The event type and information is passed in \a event, while the receiving control is passed in diff --git a/src/gui/styles/qstyleoption.cpp b/src/gui/styles/qstyleoption.cpp index f5a2b94..d73a563 100644 --- a/src/gui/styles/qstyleoption.cpp +++ b/src/gui/styles/qstyleoption.cpp @@ -4736,8 +4736,9 @@ QStyleOptionTabWidgetFrameV2::QStyleOptionTabWidgetFrameV2(const QStyleOptionTab QStyleOptionFrame types. If the \a{other} style option's version is 1, this style option's - \l FrameFeature value is set to \l QStyleOptionFrameV2::None. If - its version is 2, its \l FrameFeature value is simply copied to + QStyleOptionFrameV2::FrameFeature value is set to + QStyleOptionFrameV2::None. If its version is 2, its + \l{QStyleOptionFrameV2::}{FrameFeature} value is simply copied to this style option. */ QStyleOptionTabWidgetFrameV2 &QStyleOptionTabWidgetFrameV2::operator=(const QStyleOptionTabWidgetFrame &other) diff --git a/src/network/socket/qabstractsocket.cpp b/src/network/socket/qabstractsocket.cpp index 89a6e91..8b4f364 100644 --- a/src/network/socket/qabstractsocket.cpp +++ b/src/network/socket/qabstractsocket.cpp @@ -1589,10 +1589,10 @@ bool QAbstractSocket::setSocketDescriptor(int socketDescriptor, SocketState sock } /*! - Sets the option \a option to the value described by \a value. + \since 4.6 + Sets the given \a option to the value described by \a value. \sa socketOption() - \since 4.6 */ void QAbstractSocket::setSocketOption(QAbstractSocket::SocketOption option, const QVariant &value) { @@ -1618,10 +1618,10 @@ void QAbstractSocket::setSocketOption(QAbstractSocket::SocketOption option, cons } /*! + \since 4.6 Returns the value of the \a option option. \sa setSocketOption() - \since 4.6 */ QVariant QAbstractSocket::socketOption(QAbstractSocket::SocketOption option) { diff --git a/src/network/ssl/qsslsocket.cpp b/src/network/ssl/qsslsocket.cpp index cfa99c8..e53d8a4 100644 --- a/src/network/ssl/qsslsocket.cpp +++ b/src/network/ssl/qsslsocket.cpp @@ -468,7 +468,10 @@ bool QSslSocket::setSocketDescriptor(int socketDescriptor, SocketState state, Op } /*! - \reimp + \since 4.6 + Sets the given \a option to the value described by \a value. + + \sa socketOption() */ void QSslSocket::setSocketOption(QAbstractSocket::SocketOption option, const QVariant &value) { @@ -478,7 +481,10 @@ void QSslSocket::setSocketOption(QAbstractSocket::SocketOption option, const QVa } /*! - \reimp + \since 4.6 + Returns the value of the \a option option. + + \sa setSocketOption() */ QVariant QSslSocket::socketOption(QAbstractSocket::SocketOption option) { -- cgit v0.12 From 4dbc0d34657bff0166ff6984e91a38b79e59e107 Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Wed, 4 Nov 2009 19:55:27 +0100 Subject: Added changes to ChangeLog. --- dist/changes-4.6.0 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/dist/changes-4.6.0 b/dist/changes-4.6.0 index 6a1f6f9..627760a 100644 --- a/dist/changes-4.6.0 +++ b/dist/changes-4.6.0 @@ -69,11 +69,14 @@ QtGui - QTreeView * [234930] Be able to use :has-children and :has-sibillings in a stylesheet - * [252616] Set QStyleOptionViewItemV4::OnlyOne flag when painting spanning collumns + * [252616] Set QStyleOptionViewItemV4::OnlyOne flag when painting spanning columns - QTableView + * [191545] Selections work more similarly to well-known spreadsheets * [234926] Fixed sorting after changing QTableView header - * [244651] Speed up table view with many spans + * [244651] [245327] [250193] [QTBUG-5062] Spans get plenty of love with + speed-up, support for rows/columns insertion/removal, and better keyboard + navigation - QTabBar * [196326] Fixed having a stylesheet on a QTabBar resulted in some tab names -- cgit v0.12 From 829f617ab2d4f240950ce88e9ce97421a2939a74 Mon Sep 17 00:00:00 2001 From: Derick Hawcroft Date: Thu, 5 Nov 2009 10:17:16 +1000 Subject: Check success of query. For example a bogus use of setFilter() might cause a query to fail. Check for this. Reviewed-by: Bill King --- src/sql/models/qsqltablemodel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sql/models/qsqltablemodel.cpp b/src/sql/models/qsqltablemodel.cpp index a91dc9f..98f22c8 100644 --- a/src/sql/models/qsqltablemodel.cpp +++ b/src/sql/models/qsqltablemodel.cpp @@ -406,7 +406,7 @@ bool QSqlTableModel::select() QSqlQuery qu(query, d->db); setQuery(qu); - if (!qu.isActive()) { + if (!qu.isActive() || lastError().isValid()) { // something went wrong - revert to non-select state d->initRecordAndPrimaryIndex(); return false; -- cgit v0.12 From 91c09562ed9c6eb1bd3a4dbd84a8cc64647751ee Mon Sep 17 00:00:00 2001 From: Derick Hawcroft Date: Thu, 5 Nov 2009 10:35:48 +1000 Subject: Fix retrieval of SQL type "TIME" information for PostgreSQL PostgreSQL can store/retieve the millisecond part of type "TIME" , so allow it in the API level. Task-number: QTBUG-5251 Reviewed-by: Bill King --- src/sql/drivers/psql/qsql_psql.cpp | 2 +- tests/auto/qsqlquery/tst_qsqlquery.cpp | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/src/sql/drivers/psql/qsql_psql.cpp b/src/sql/drivers/psql/qsql_psql.cpp index 4c78d6a..3e3ea06 100644 --- a/src/sql/drivers/psql/qsql_psql.cpp +++ b/src/sql/drivers/psql/qsql_psql.cpp @@ -1133,7 +1133,7 @@ QString QPSQLDriver::formatValue(const QSqlField &field, bool trimStrings) const case QVariant::Time: #ifndef QT_NO_DATESTRING if (field.value().toTime().isValid()) { - r = QLatin1Char('\'') + field.value().toTime().toString(Qt::ISODate) + QLatin1Char('\''); + r = QLatin1Char('\'') + field.value().toTime().toString(QLatin1String("hh:mm:ss.zzz")) + QLatin1Char('\''); } else #endif { diff --git a/tests/auto/qsqlquery/tst_qsqlquery.cpp b/tests/auto/qsqlquery/tst_qsqlquery.cpp index 3463153..87774a3 100644 --- a/tests/auto/qsqlquery/tst_qsqlquery.cpp +++ b/tests/auto/qsqlquery/tst_qsqlquery.cpp @@ -194,6 +194,8 @@ private slots: void sqlServerReturn0_data() { generic_data(); } void sqlServerReturn0(); + void QTBUG_5251_data() { generic_data("QPSQL"); } + void QTBUG_5251(); private: // returns all database connections @@ -2880,5 +2882,35 @@ void tst_QSqlQuery::sqlServerReturn0() QVERIFY_SQL(q, next()); } +void tst_QSqlQuery::QTBUG_5251() +{ + QFETCH( QString, dbName ); + QSqlDatabase db = QSqlDatabase::database( dbName ); + CHECK_DATABASE( db ); + + if (!db.driverName().startsWith( "QPSQL" )) return; + + QSqlQuery q(db); + q.exec("DROP TABLE " + qTableName("timetest")); + QVERIFY_SQL(q, exec("CREATE TABLE " + qTableName("timetest") + " (t TIME)")); + QVERIFY_SQL(q, exec("INSERT INTO " + qTableName("timetest") + " VALUES ('1:2:3.666')")); + + QSqlTableModel timetestModel(0,db); + timetestModel.setEditStrategy(QSqlTableModel::OnManualSubmit); + timetestModel.setTable(qTableName("timetest")); + QVERIFY_SQL(timetestModel, select()); + + QCOMPARE(timetestModel.record(0).field(0).value().toTime().toString("HH:mm:ss.zzz"), QString("01:02:03.666")); + QVERIFY_SQL(timetestModel,setData(timetestModel.index(0, 0), QTime(0,12,34,500))); + QCOMPARE(timetestModel.record(0).field(0).value().toTime().toString("HH:mm:ss.zzz"), QString("00:12:34.500")); + QVERIFY_SQL(timetestModel, submitAll()); + QCOMPARE(timetestModel.record(0).field(0).value().toTime().toString("HH:mm:ss.zzz"), QString("00:12:34.500")); + + QVERIFY_SQL(q, exec("UPDATE " + qTableName("timetest") + " SET t = '0:11:22.33'")); + QVERIFY_SQL(timetestModel, select()); + QCOMPARE(timetestModel.record(0).field(0).value().toTime().toString("HH:mm:ss.zzz"), QString("00:11:22.330")); + +} + QTEST_MAIN( tst_QSqlQuery ) #include "tst_qsqlquery.moc" -- cgit v0.12 From c416d0d026377a5c8659abbd12cb4a8eab7c7264 Mon Sep 17 00:00:00 2001 From: Bill King Date: Thu, 5 Nov 2009 12:13:59 +1000 Subject: Add new cross schema relation autotest Autotest for http://bugreports.qt.nokia.com/browse/QTBUG-5373 --- .../tst_qsqlrelationaltablemodel.cpp | 36 +++++++++++++++++++--- 1 file changed, 31 insertions(+), 5 deletions(-) diff --git a/tests/auto/qsqlrelationaltablemodel/tst_qsqlrelationaltablemodel.cpp b/tests/auto/qsqlrelationaltablemodel/tst_qsqlrelationaltablemodel.cpp index cb24a9f..e045c10 100644 --- a/tests/auto/qsqlrelationaltablemodel/tst_qsqlrelationaltablemodel.cpp +++ b/tests/auto/qsqlrelationaltablemodel/tst_qsqlrelationaltablemodel.cpp @@ -86,6 +86,7 @@ private slots: void escapedRelations(); void escapedTableName(); void whiteSpaceInIdentifiers(); + void psqlSchemaTest(); private: void dropTestTables( QSqlDatabase db ); @@ -150,10 +151,11 @@ void tst_QSqlRelationalTableModel::initTestCase() if (db.driverName().startsWith("QIBASE")) db.exec("SET DIALECT 3"); else if (tst_Databases::isSqlServer(db)) { - QSqlQuery q(db); - QVERIFY_SQL(q, exec("SET ANSI_DEFAULTS ON")); - QVERIFY_SQL(q, exec("SET IMPLICIT_TRANSACTIONS OFF")); + db.exec("SET ANSI_DEFAULTS ON"); + db.exec("SET IMPLICIT_TRANSACTIONS OFF"); } + else if(tst_Databases::isPostgreSQL(db)) + db.exec("set client_min_messages='warning'"); recreateTestTables(db); } } @@ -181,6 +183,9 @@ void tst_QSqlRelationalTableModel::dropTestTables( QSqlDatabase db ) << qTableName("CASETEST1" ) << qTableName("casetest1" ); tst_Databases::safeDropTables( db, tableNames ); + + db.exec("DROP SCHEMA "+qTableName("QTBUG_5373")); + db.exec("DROP SCHEMA "+qTableName("QTBUG_5373_s2")); } void tst_QSqlRelationalTableModel::init() @@ -1118,8 +1123,8 @@ void tst_QSqlRelationalTableModel::escapedTableName() } } -void tst_QSqlRelationalTableModel::whiteSpaceInIdentifiers() { - +void tst_QSqlRelationalTableModel::whiteSpaceInIdentifiers() +{ QFETCH_GLOBAL(QString, dbName); QSqlDatabase db = QSqlDatabase::database(dbName); CHECK_DATABASE(db); @@ -1193,5 +1198,26 @@ void tst_QSqlRelationalTableModel::whiteSpaceInIdentifiers() { QCOMPARE(model.data(model.index(0, 2)).toInt(), 6); } +void tst_QSqlRelationalTableModel::psqlSchemaTest() +{ + QFETCH_GLOBAL(QString, dbName); + QSqlDatabase db = QSqlDatabase::database(dbName); + CHECK_DATABASE(db); + + if(!tst_Databases::isPostgreSQL(db)) { + QSKIP("Postgresql specific test", SkipSingle); + return; + } + QSqlRelationalTableModel model(0, db); + QSqlQuery q(db); + QVERIFY_SQL(q, exec("create schema "+qTableName("QTBUG_5373"))); + QVERIFY_SQL(q, exec("create schema "+qTableName("QTBUG_5373_s2"))); + QVERIFY_SQL(q, exec("create table "+qTableName("QTBUG_5373")+"."+qTableName("user")+"(userid int primary key, relatingid int)")); + QVERIFY_SQL(q, exec("create table "+qTableName("QTBUG_5373_s2")+"."+qTableName("user2")+"(userid2 int primary key, username2 char(40))")); + model.setTable(qTableName("QTBUG_5373")+"."+qTableName("user")); + model.setRelation(1, QSqlRelation(qTableName("QTBUG_5373_s2")+"."+qTableName("user2"), "userid2", "username2")); + QVERIFY_SQL(model, select()); +} + QTEST_MAIN(tst_QSqlRelationalTableModel) #include "tst_qsqlrelationaltablemodel.moc" -- cgit v0.12 From aa58293b57a05cd52b36ba14a05958dceb65c603 Mon Sep 17 00:00:00 2001 From: Bill King Date: Thu, 5 Nov 2009 14:21:36 +1000 Subject: Cascade delete to cleanup autotest properly. Task-number: QTBUG-5373 --- tests/auto/qsqlrelationaltablemodel/tst_qsqlrelationaltablemodel.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/auto/qsqlrelationaltablemodel/tst_qsqlrelationaltablemodel.cpp b/tests/auto/qsqlrelationaltablemodel/tst_qsqlrelationaltablemodel.cpp index e045c10..8c840cd 100644 --- a/tests/auto/qsqlrelationaltablemodel/tst_qsqlrelationaltablemodel.cpp +++ b/tests/auto/qsqlrelationaltablemodel/tst_qsqlrelationaltablemodel.cpp @@ -184,8 +184,8 @@ void tst_QSqlRelationalTableModel::dropTestTables( QSqlDatabase db ) << qTableName("casetest1" ); tst_Databases::safeDropTables( db, tableNames ); - db.exec("DROP SCHEMA "+qTableName("QTBUG_5373")); - db.exec("DROP SCHEMA "+qTableName("QTBUG_5373_s2")); + db.exec("DROP SCHEMA "+qTableName("QTBUG_5373")+" CASCADE"); + db.exec("DROP SCHEMA "+qTableName("QTBUG_5373_s2")+" CASCADE"); } void tst_QSqlRelationalTableModel::init() -- cgit v0.12 From 40914841ea59d3c7a0c1d0baf5f82af23b79e63f Mon Sep 17 00:00:00 2001 From: Daniel Molkentin Date: Wed, 4 Nov 2009 18:30:43 +0100 Subject: Revert last commit to configure, only configure.exe needed the fix Reviewed-By: con --- configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure b/configure index 611f4bf..9c3e417 100755 --- a/configure +++ b/configure @@ -4185,7 +4185,7 @@ fi if [ -n "$EVALKEY" ]; then cat > "$outpath/src/corelib/global/qconfig_eval.cpp" <