diff options
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativegridview.cpp | 23 | ||||
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativelistview.cpp | 59 | ||||
-rw-r--r-- | src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp | 8 | ||||
-rw-r--r-- | src/opengl/gl2paintengineex/qtriangulator.cpp | 21 | ||||
-rw-r--r-- | src/opengl/qgl.cpp | 6 | ||||
-rw-r--r-- | src/opengl/qgl_p.h | 4 | ||||
-rw-r--r-- | src/opengl/qglextensions_p.h | 23 | ||||
-rw-r--r-- | src/opengl/qglframebufferobject.cpp | 19 | ||||
-rw-r--r-- | tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp | 9 |
9 files changed, 80 insertions, 92 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativegridview.cpp b/src/declarative/graphicsitems/qdeclarativegridview.cpp index f53625f..bbc03f3 100644 --- a/src/declarative/graphicsitems/qdeclarativegridview.cpp +++ b/src/declarative/graphicsitems/qdeclarativegridview.cpp @@ -112,7 +112,7 @@ public: , bufferMode(BufferBefore | BufferAfter), snapMode(QDeclarativeGridView::NoSnap) , ownModel(false), wrap(false), autoHighlight(true) , fixCurrentVisibility(false), lazyRelease(false), layoutScheduled(false) - , deferredRelease(false), haveHighlightRange(false), currentIndexSet(false) {} + , deferredRelease(false), haveHighlightRange(false), currentIndexCleared(false) {} void init(); void clear(); @@ -392,7 +392,7 @@ public: bool layoutScheduled : 1; bool deferredRelease : 1; bool haveHighlightRange : 1; - bool currentIndexSet : 1; + bool currentIndexCleared : 1; }; void QDeclarativeGridViewPrivate::init() @@ -1242,7 +1242,7 @@ void QDeclarativeGridView::setModel(const QVariant &model) d->bufferMode = QDeclarativeGridViewPrivate::BufferBefore | QDeclarativeGridViewPrivate::BufferAfter; if (isComponentComplete()) { refill(); - if ((d->currentIndex >= d->model->count() || d->currentIndex < 0) && !d->currentIndexSet) { + if ((d->currentIndex >= d->model->count() || d->currentIndex < 0) && !d->currentIndexCleared) { setCurrentIndex(0); } else { d->moveReason = QDeclarativeGridViewPrivate::SetIndex; @@ -1330,7 +1330,8 @@ void QDeclarativeGridView::setDelegate(QDeclarativeComponent *delegate) \qmlproperty Item GridView::currentItem The \c currentIndex property holds the index of the current item, and - \c currentItem holds the current item. + \c currentItem holds the current item. Setting the currentIndex to -1 + will clear the highlight and set currentItem to null. If highlightFollowsCurrentItem is \c true, setting either of these properties will smoothly scroll the GridView so that the current @@ -1350,7 +1351,7 @@ void QDeclarativeGridView::setCurrentIndex(int index) Q_D(QDeclarativeGridView); if (d->requestedIndex >= 0) // currently creating item return; - d->currentIndexSet = true; + d->currentIndexCleared = (index == -1); if (index == d->currentIndex) return; if (isComponentComplete() && d->isValid()) { @@ -1831,6 +1832,8 @@ void QDeclarativeGridView::viewportMoved() { Q_D(QDeclarativeGridView); QDeclarativeFlickable::viewportMoved(); + if (!d->itemCount) + return; d->lazyRelease = true; if (d->flickingHorizontally || d->flickingVertically) { if (yflick()) { @@ -2222,7 +2225,7 @@ void QDeclarativeGridView::componentComplete() if (d->isValid()) { refill(); d->moveReason = QDeclarativeGridViewPrivate::SetIndex; - if (d->currentIndex < 0 && !d->currentIndexSet) + if (d->currentIndex < 0 && !d->currentIndexCleared) d->updateCurrent(0); else d->updateCurrent(d->currentIndex); @@ -2297,13 +2300,13 @@ void QDeclarativeGridView::itemsInserted(int modelIndex, int count) return; if (!d->visibleItems.count() || d->model->count() <= 1) { d->scheduleLayout(); - if (d->currentIndex >= modelIndex) { + if (d->itemCount && d->currentIndex >= modelIndex) { // adjust current item index d->currentIndex += count; if (d->currentItem) d->currentItem->index = d->currentIndex; emit currentIndexChanged(); - } else if (d->currentIndex < 0 && !d->currentIndexSet) { + } else if (!d->currentIndex || (d->currentIndex < 0 && !d->currentIndexCleared)) { d->updateCurrent(0); } d->itemCount += count; @@ -2411,7 +2414,7 @@ void QDeclarativeGridView::itemsInserted(int modelIndex, int count) } } - if (d->currentIndex >= modelIndex) { + if (d->itemCount && d->currentIndex >= modelIndex) { // adjust current item index d->currentIndex += count; if (d->currentItem) { @@ -2498,8 +2501,8 @@ void QDeclarativeGridView::itemsRemoved(int modelIndex, int count) if (removedVisible && d->visibleItems.isEmpty()) { d->timeline.clear(); - d->setPosition(0); if (d->itemCount == 0) { + d->setPosition(0); d->updateHeader(); d->updateFooter(); update(); diff --git a/src/declarative/graphicsitems/qdeclarativelistview.cpp b/src/declarative/graphicsitems/qdeclarativelistview.cpp index 7dd5c75..e29f285 100644 --- a/src/declarative/graphicsitems/qdeclarativelistview.cpp +++ b/src/declarative/graphicsitems/qdeclarativelistview.cpp @@ -182,7 +182,7 @@ public: , bufferMode(BufferBefore | BufferAfter) , ownModel(false), wrap(false), autoHighlight(true), haveHighlightRange(false) , correctFlick(false), inFlickCorrection(false), lazyRelease(false) - , deferredRelease(false), layoutScheduled(false), currentIndexSet(false) + , deferredRelease(false), layoutScheduled(false), currentIndexCleared(false) , minExtentDirty(true), maxExtentDirty(true) {} @@ -394,44 +394,19 @@ public: } // map a model index to visibleItems index. - // These may differ if removed items are still present in the visible list, - // e.g. doing a removal animation int mapFromModel(int modelIndex) const { if (modelIndex < visibleIndex || modelIndex >= visibleIndex + visibleItems.count()) return -1; for (int i = 0; i < visibleItems.count(); ++i) { FxListItem *listItem = visibleItems.at(i); if (listItem->index == modelIndex) - return i + visibleIndex; + return i; if (listItem->index > modelIndex) return -1; } return -1; // Not in visibleList } - bool mapRangeFromModel(int &index, int &count) const { - if (index + count < visibleIndex) - return false; - - int lastIndex = -1; - for (int i = visibleItems.count()-1; i >= 0; --i) { - FxListItem *listItem = visibleItems.at(i); - if (listItem->index != -1) { - lastIndex = listItem->index; - break; - } - } - - if (index > lastIndex) - return false; - - int last = qMin(index + count - 1, lastIndex); - index = qMax(index, visibleIndex); - count = last - index + 1; - - return true; - } - void updateViewport() { Q_Q(QDeclarativeListView); if (orient == QDeclarativeListView::Vertical) { @@ -545,7 +520,7 @@ public: bool lazyRelease : 1; bool deferredRelease : 1; bool layoutScheduled : 1; - bool currentIndexSet : 1; + bool currentIndexCleared : 1; mutable bool minExtentDirty : 1; mutable bool maxExtentDirty : 1; }; @@ -1604,7 +1579,7 @@ void QDeclarativeListView::setModel(const QVariant &model) if (isComponentComplete()) { updateSections(); refill(); - if ((d->currentIndex >= d->model->count() || d->currentIndex < 0) && !d->currentIndexSet) { + if ((d->currentIndex >= d->model->count() || d->currentIndex < 0) && !d->currentIndexCleared) { setCurrentIndex(0); } else { d->moveReason = QDeclarativeListViewPrivate::SetIndex; @@ -1694,7 +1669,8 @@ void QDeclarativeListView::setDelegate(QDeclarativeComponent *delegate) \qmlproperty Item ListView::currentItem The \c currentIndex property holds the index of the current item, and - \c currentItem holds the current item. + \c currentItem holds the current item. Setting the currentIndex to -1 + will clear the highlight and set currentItem to null. If highlightFollowsCurrentItem is \c true, setting either of these properties will smoothly scroll the ListView so that the current @@ -1714,7 +1690,7 @@ void QDeclarativeListView::setCurrentIndex(int index) Q_D(QDeclarativeListView); if (d->requestedIndex >= 0) // currently creating item return; - d->currentIndexSet = true; + d->currentIndexCleared = (index == -1); if (index == d->currentIndex) return; if (isComponentComplete() && d->isValid()) { @@ -2329,6 +2305,8 @@ void QDeclarativeListView::viewportMoved() { Q_D(QDeclarativeListView); QDeclarativeFlickable::viewportMoved(); + if (!d->itemCount) + return; d->lazyRelease = true; refill(); if (d->flickingHorizontally || d->flickingVertically || d->movingHorizontally || d->movingVertically) @@ -2543,7 +2521,7 @@ void QDeclarativeListView::incrementCurrentIndex() if (count && (currentIndex() < count - 1 || d->wrap)) { d->moveReason = QDeclarativeListViewPrivate::SetIndex; int index = currentIndex()+1; - d->updateCurrent((index >= 0 && index < count) ? index : 0); + setCurrentIndex((index >= 0 && index < count) ? index : 0); } } @@ -2563,7 +2541,7 @@ void QDeclarativeListView::decrementCurrentIndex() if (count && (currentIndex() > 0 || d->wrap)) { d->moveReason = QDeclarativeListViewPrivate::SetIndex; int index = currentIndex()-1; - d->updateCurrent((index >= 0 && index < count) ? index : count-1); + setCurrentIndex((index >= 0 && index < count) ? index : count-1); } } @@ -2697,7 +2675,7 @@ void QDeclarativeListView::componentComplete() if (d->isValid()) { refill(); d->moveReason = QDeclarativeListViewPrivate::SetIndex; - if (d->currentIndex < 0 && !d->currentIndexSet) + if (d->currentIndex < 0 && !d->currentIndexCleared) d->updateCurrent(0); else d->updateCurrent(d->currentIndex); @@ -2797,13 +2775,13 @@ void QDeclarativeListView::itemsInserted(int modelIndex, int count) d->moveReason = QDeclarativeListViewPrivate::Other; if (!d->visibleItems.count() || d->model->count() <= 1) { d->scheduleLayout(); - if (d->currentIndex >= modelIndex) { + if (d->itemCount && d->currentIndex >= modelIndex) { // adjust current item index d->currentIndex += count; if (d->currentItem) d->currentItem->index = d->currentIndex; emit currentIndexChanged(); - } else if (d->currentIndex < 0 && !d->currentIndexSet) { + } else if (!d->currentIndex || (d->currentIndex < 0 && !d->currentIndexCleared)) { d->updateCurrent(0); } d->itemCount += count; @@ -2811,15 +2789,15 @@ void QDeclarativeListView::itemsInserted(int modelIndex, int count) return; } - int overlapCount = count; - if (!d->mapRangeFromModel(modelIndex, overlapCount)) { + int index = d->mapFromModel(modelIndex); + if (index < 0) { int i = d->visibleItems.count() - 1; while (i > 0 && d->visibleItems.at(i)->index == -1) --i; if (d->visibleItems.at(i)->index + 1 == modelIndex && d->visibleItems.at(i)->endPosition() < d->buffer+d->position()+d->size()-1) { // Special case of appending an item to the model. - modelIndex = d->visibleIndex + d->visibleItems.count(); + index = d->visibleItems.count(); } else { if (modelIndex < d->visibleIndex) { // Insert before visible items @@ -2846,7 +2824,6 @@ void QDeclarativeListView::itemsInserted(int modelIndex, int count) // At least some of the added items will be visible - int index = modelIndex - d->visibleIndex; // index can be the next item past the end of the visible items list (i.e. appended) int pos = index < d->visibleItems.count() ? d->visibleItems.at(index)->position() : d->visibleItems.at(index-1)->endPosition()+d->spacing+1; @@ -2910,7 +2887,7 @@ void QDeclarativeListView::itemsInserted(int modelIndex, int count) } diff = pos - initialPos; } - if (d->currentIndex >= modelIndex) { + if (d->itemCount && d->currentIndex >= modelIndex) { // adjust current item index d->currentIndex += count; if (d->currentItem) { diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp index a98d7cc..5c7ebfa 100644 --- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp +++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp @@ -825,7 +825,7 @@ void QGL2PaintEngineExPrivate::fill(const QVectorPath& path) glBindBuffer(GL_ARRAY_BUFFER, cache->vbo); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, cache->ibo); - if (glSupportsElementIndexUint) + if (QGLExtensions::glExtensions() & QGLExtensions::ElementIndexUint) glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(quint32) * polys.indices.size(), polys.indices.data(), GL_STATIC_DRAW); else glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(quint16) * polys.indices.size(), polys.indices.data(), GL_STATIC_DRAW); @@ -836,7 +836,7 @@ void QGL2PaintEngineExPrivate::fill(const QVectorPath& path) glBufferData(GL_ARRAY_BUFFER, sizeof(float) * vertices.size(), vertices.data(), GL_STATIC_DRAW); #else cache->vertices = (float *) qMalloc(sizeof(float) * polys.vertices.size()); - if (glSupportsElementIndexUint) { + if (QGLExtensions::glExtensions() & QGLExtensions::ElementIndexUint) { cache->indices = (quint32 *) qMalloc(sizeof(quint32) * polys.indices.size()); memcpy(cache->indices, polys.indices.data(), sizeof(quint32) * polys.indices.size()); } else { @@ -853,7 +853,7 @@ void QGL2PaintEngineExPrivate::fill(const QVectorPath& path) glBindBuffer(GL_ARRAY_BUFFER, cache->vbo); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, cache->ibo); setVertexAttributePointer(QT_VERTEX_COORDS_ATTR, 0); - if (glSupportsElementIndexUint) + if (QGLExtensions::glExtensions() & QGLExtensions::ElementIndexUint) glDrawElements(cache->primitiveType, cache->indexCount, GL_UNSIGNED_INT, 0); else glDrawElements(cache->primitiveType, cache->indexCount, GL_UNSIGNED_SHORT, 0); @@ -861,7 +861,7 @@ void QGL2PaintEngineExPrivate::fill(const QVectorPath& path) glBindBuffer(GL_ARRAY_BUFFER, 0); #else setVertexAttributePointer(QT_VERTEX_COORDS_ATTR, cache->vertices); - if (glSupportsElementIndexUint) + if (QGLExtensions::glExtensions() & QGLExtensions::ElementIndexUint) glDrawElements(cache->primitiveType, cache->indexCount, GL_UNSIGNED_INT, (qint32 *)cache->indices); else glDrawElements(cache->primitiveType, cache->indexCount, GL_UNSIGNED_SHORT, (qint16 *)cache->indices); diff --git a/src/opengl/gl2paintengineex/qtriangulator.cpp b/src/opengl/gl2paintengineex/qtriangulator.cpp index b839b00..85f604a 100644 --- a/src/opengl/gl2paintengineex/qtriangulator.cpp +++ b/src/opengl/gl2paintengineex/qtriangulator.cpp @@ -58,7 +58,6 @@ #include <math.h> #include <private/qgl_p.h> -#include <private/qglextensions_p.h> QT_BEGIN_NAMESPACE @@ -3014,10 +3013,8 @@ void QTriangulator<T>::MonotoneToTriangles::decompose() QTriangleSet qTriangulate(const qreal *polygon, int count, uint hint, const QTransform &matrix) { - QGLContext *ctx = 0; // Not really used but needs to be introduced for glSupportsElementIndexUint - QTriangleSet triangleSet; - if (glSupportsElementIndexUint) { + if (QGLExtensions::glExtensions() & QGLExtensions::ElementIndexUint) { QTriangulator<quint32> triangulator; triangulator.initialize(polygon, count, hint, matrix); QVertexSet<quint32> vertexSet = triangulator.triangulate(); @@ -3037,10 +3034,8 @@ QTriangleSet qTriangulate(const qreal *polygon, QTriangleSet qTriangulate(const QVectorPath &path, const QTransform &matrix, qreal lod) { - QGLContext *ctx = 0; // Not really used but needs to be introduced for glSupportsElementIndexUint - QTriangleSet triangleSet; - if (glSupportsElementIndexUint) { + if (QGLExtensions::glExtensions() & QGLExtensions::ElementIndexUint) { QTriangulator<quint32> triangulator; triangulator.initialize(path, matrix, lod); QVertexSet<quint32> vertexSet = triangulator.triangulate(); @@ -3059,10 +3054,8 @@ QTriangleSet qTriangulate(const QVectorPath &path, QTriangleSet qTriangulate(const QPainterPath &path, const QTransform &matrix, qreal lod) { - QGLContext *ctx = 0; // Not really used but needs to be introduced for glSupportsElementIndexUint - QTriangleSet triangleSet; - if (glSupportsElementIndexUint) { + if (QGLExtensions::glExtensions() & QGLExtensions::ElementIndexUint) { QTriangulator<quint32> triangulator; triangulator.initialize(path, matrix, lod); QVertexSet<quint32> vertexSet = triangulator.triangulate(); @@ -3081,10 +3074,8 @@ QTriangleSet qTriangulate(const QPainterPath &path, QPolylineSet qPolyline(const QVectorPath &path, const QTransform &matrix, qreal lod) { - QGLContext *ctx = 0; // Not really used but needs to be introduced for glSupportsElementIndexUint - QPolylineSet polyLineSet; - if (glSupportsElementIndexUint) { + if (QGLExtensions::glExtensions() & QGLExtensions::ElementIndexUint) { QTriangulator<quint32> triangulator; triangulator.initialize(path, matrix, lod); QVertexSet<quint32> vertexSet = triangulator.polyline(); @@ -3103,10 +3094,8 @@ QPolylineSet qPolyline(const QVectorPath &path, QPolylineSet qPolyline(const QPainterPath &path, const QTransform &matrix, qreal lod) { - QGLContext *ctx = 0; // Not really used but needs to be introduced for glSupportsElementIndexUint - QPolylineSet polyLineSet; - if (glSupportsElementIndexUint) { + if (QGLExtensions::glExtensions() & QGLExtensions::ElementIndexUint) { QTriangulator<quint32> triangulator; triangulator.initialize(path, matrix, lod); QVertexSet<quint32> vertexSet = triangulator.polyline(); diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp index 7f25887..62eff6e 100644 --- a/src/opengl/qgl.cpp +++ b/src/opengl/qgl.cpp @@ -5292,6 +5292,12 @@ QGLExtensions::Extensions QGLExtensions::currentContextExtensions() #if defined(QT_OPENGL_ES) if (extensions.match("GL_OES_packed_depth_stencil")) glExtensions |= PackedDepthStencil; + if (extensions.match("GL_OES_element_index_uint")) + glExtensions |= ElementIndexUint; + if (extensions.match("GL_OES_depth24")) + glExtensions |= Depth24; +#else + glExtensions |= ElementIndexUint; #endif if (extensions.match("GL_ARB_framebuffer_object")) { // ARB_framebuffer_object also includes EXT_framebuffer_blit. diff --git a/src/opengl/qgl_p.h b/src/opengl/qgl_p.h index 387c8f7..6c494ee 100644 --- a/src/opengl/qgl_p.h +++ b/src/opengl/qgl_p.h @@ -284,7 +284,9 @@ public: DDSTextureCompression = 0x00008000, ETC1TextureCompression = 0x00010000, PVRTCTextureCompression = 0x00020000, - FragmentShader = 0x00040000 + FragmentShader = 0x00040000, + ElementIndexUint = 0x00080000, + Depth24 = 0x00100000 }; Q_DECLARE_FLAGS(Extensions, Extension) diff --git a/src/opengl/qglextensions_p.h b/src/opengl/qglextensions_p.h index e81e849..a35ad87 100644 --- a/src/opengl/qglextensions_p.h +++ b/src/opengl/qglextensions_p.h @@ -346,17 +346,6 @@ struct QGLExtensionFuncs qt_glEGLImageTargetTexture2DOES = 0; qt_glEGLImageTargetRenderbufferStorageOES = 0; #endif - - // OES_element_index_uint -#if !defined(QT_OPENGL_ES) - qt_glSupportsElementIndexUint = true; -#else - QString extensions = reinterpret_cast<const char *>(glGetString(GL_EXTENSIONS)); - if (extensions.contains("GL_OES_element_index_uint")) - qt_glSupportsElementIndexUint = true; - else - qt_glSupportsElementIndexUint = false; -#endif } @@ -483,8 +472,6 @@ struct QGLExtensionFuncs _glEGLImageTargetTexture2DOES qt_glEGLImageTargetTexture2DOES; _glEGLImageTargetRenderbufferStorageOES qt_glEGLImageTargetRenderbufferStorageOES; #endif - - bool qt_glSupportsElementIndexUint; }; @@ -576,6 +563,14 @@ struct QGLExtensionFuncs #define GL_TEXTURE1 0x84C1 #endif +#ifndef GL_DEPTH_COMPONENT16 +#define GL_DEPTH_COMPONENT16 0x81A5 +#endif + +#ifndef GL_DEPTH_COMPONENT24_OES +#define GL_DEPTH_COMPONENT24_OES 0x81A6 +#endif + #ifndef GL_EXT_framebuffer_object #define GL_INVALID_FRAMEBUFFER_OPERATION_EXT 0x0506 #define GL_MAX_RENDERBUFFER_SIZE_EXT 0x84E8 @@ -883,8 +878,6 @@ struct QGLExtensionFuncs #define glEGLImageTargetRenderbufferStorageOES QGLContextPrivate::extensionFuncs(ctx).qt_glEGLImageTargetRenderbufferStorageOES #endif -#define glSupportsElementIndexUint QGLContextPrivate::extensionFuncs(ctx).qt_glSupportsElementIndexUint - extern bool qt_resolve_framebufferobject_extensions(QGLContext *ctx); bool qt_resolve_buffer_extensions(QGLContext *ctx); diff --git a/src/opengl/qglframebufferobject.cpp b/src/opengl/qglframebufferobject.cpp index 6c9b288..a1472f7 100644 --- a/src/opengl/qglframebufferobject.cpp +++ b/src/opengl/qglframebufferobject.cpp @@ -508,17 +508,26 @@ void QGLFramebufferObjectPrivate::init(QGLFramebufferObject *q, const QSize &sz, Q_ASSERT(glIsRenderbuffer(depth_buffer)); if (samples != 0 && glRenderbufferStorageMultisampleEXT) { #ifdef QT_OPENGL_ES -#define GL_DEPTH_COMPONENT16 0x81A5 - glRenderbufferStorageMultisampleEXT(GL_RENDERBUFFER_EXT, samples, - GL_DEPTH_COMPONENT16, size.width(), size.height()); + if (QGLExtensions::glExtensions() & QGLExtensions::Depth24) { + glRenderbufferStorageMultisampleEXT(GL_RENDERBUFFER_EXT, samples, + GL_DEPTH_COMPONENT24_OES, size.width(), size.height()); + } else { + glRenderbufferStorageMultisampleEXT(GL_RENDERBUFFER_EXT, samples, + GL_DEPTH_COMPONENT16, size.width(), size.height()); + } #else glRenderbufferStorageMultisampleEXT(GL_RENDERBUFFER_EXT, samples, GL_DEPTH_COMPONENT, size.width(), size.height()); #endif } else { #ifdef QT_OPENGL_ES -#define GL_DEPTH_COMPONENT16 0x81A5 - glRenderbufferStorage(GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT16, size.width(), size.height()); + if (QGLExtensions::glExtensions() & QGLExtensions::Depth24) { + glRenderbufferStorage(GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT24_OES, + size.width(), size.height()); + } else { + glRenderbufferStorage(GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT16, + size.width(), size.height()); + } #else glRenderbufferStorage(GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT, size.width(), size.height()); #endif diff --git a/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp b/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp index 080631c..79fef7a 100644 --- a/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp +++ b/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp @@ -673,6 +673,15 @@ void tst_QDeclarativeListView::removed(bool animated) QTRY_COMPARE(item->y(),80+i*20.0); } + model.removeItems(1, 17); +// QTest::qWait(300); + + model.removeItems(2, 1); + model.addItem("New", "1"); + + QTRY_VERIFY(name = findItem<QDeclarativeText>(contentItem, "textName", model.count()-1)); + QCOMPARE(name->text(), QString("New")); + delete canvas; } |