diff options
author | Jason McDonald <jason.mcdonald@nokia.com> | 2009-12-08 03:29:15 (GMT) |
---|---|---|
committer | Jason McDonald <jason.mcdonald@nokia.com> | 2009-12-08 03:29:15 (GMT) |
commit | 04f4d1444a49db9e27b483bbc91c713e80ab0792 (patch) | |
tree | 5bef9f51e2d525e043dabb6f5ce6a4965f6c5b23 | |
parent | ad41250b0af1f4207b267e1dfa9fb1e03ee01828 (diff) | |
parent | f34cfa14ff6b0928f98143f72e1f512eceabe27c (diff) | |
download | Qt-04f4d1444a49db9e27b483bbc91c713e80ab0792.zip Qt-04f4d1444a49db9e27b483bbc91c713e80ab0792.tar.gz Qt-04f4d1444a49db9e27b483bbc91c713e80ab0792.tar.bz2 |
Merge branch '4.5' of git@scm.dev.nokia.troll.no:qt/qt into 4.5
-rw-r--r-- | src/corelib/tools/qvector.h | 2 | ||||
-rw-r--r-- | src/gui/widgets/qdockarealayout.cpp | 7 | ||||
-rw-r--r-- | src/opengl/qgl.cpp | 2 | ||||
-rw-r--r-- | src/opengl/qpaintengine_opengl.cpp | 6 |
4 files changed, 8 insertions, 9 deletions
diff --git a/src/corelib/tools/qvector.h b/src/corelib/tools/qvector.h index 6c78abb..2e88d6b 100644 --- a/src/corelib/tools/qvector.h +++ b/src/corelib/tools/qvector.h @@ -315,7 +315,7 @@ void QVector<T>::detach_helper() { realloc(d->size, d->alloc); } template <typename T> void QVector<T>::reserve(int asize) -{ if (asize > d->alloc || d->ref != 1) realloc(d->size, asize); d->capacity = 1; } +{ if (asize > d->alloc) realloc(d->size, asize); if (d->ref == 1) d->capacity = 1; } template <typename T> void QVector<T>::resize(int asize) { realloc(asize, (asize > d->alloc || (!d->capacity && asize < d->size && asize < (d->alloc >> 1))) ? diff --git a/src/gui/widgets/qdockarealayout.cpp b/src/gui/widgets/qdockarealayout.cpp index 4970300..9422bdc 100644 --- a/src/gui/widgets/qdockarealayout.cpp +++ b/src/gui/widgets/qdockarealayout.cpp @@ -1167,7 +1167,8 @@ bool QDockAreaLayoutInfo::insertGap(QList<int> path, QLayoutItem *dockWidgetItem QDockAreaLayoutInfo *subinfo = item.subinfo; QLayoutItem *widgetItem = item.widgetItem; - QRect r = subinfo == 0 ? dockedGeometry(widgetItem->widget()) : subinfo->rect; + QPlaceHolderItem *placeHolderItem = item.placeHolderItem; + QRect r = subinfo == 0 ? widgetItem ? dockedGeometry(widgetItem->widget()) : placeHolderItem->topLevelRect : subinfo->rect; Qt::Orientation opposite = o == Qt::Horizontal ? Qt::Vertical : Qt::Horizontal; #ifdef QT_NO_TABBAR @@ -1176,13 +1177,15 @@ bool QDockAreaLayoutInfo::insertGap(QList<int> path, QLayoutItem *dockWidgetItem QDockAreaLayoutInfo *new_info = new QDockAreaLayoutInfo(sep, dockPos, opposite, tabBarShape, mainWindow); + //item become a new top-level item.subinfo = new_info; item.widgetItem = 0; + item.placeHolderItem = 0; QDockAreaLayoutItem new_item = widgetItem == 0 ? QDockAreaLayoutItem(subinfo) - : QDockAreaLayoutItem(widgetItem); + : widgetItem ? QDockAreaLayoutItem(widgetItem) : QDockAreaLayoutItem(placeHolderItem); new_item.size = pick(opposite, r.size()); new_item.pos = pick(opposite, r.topLeft()); new_info->item_list.append(new_item); diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp index 18c70f3..b011637 100644 --- a/src/opengl/qgl.cpp +++ b/src/opengl/qgl.cpp @@ -3530,7 +3530,7 @@ void QGLWidget::qglColor(const QColor& c) const const QGLContext *ctx = QGLContext::currentContext(); if (ctx) { if (ctx->format().rgba()) - glColor4ub(c.red(), c.green(), c.blue(), c.alpha()); + glColor4f(c.redF(), c.greenF(), c.blueF(), c.alphaF()); else if (!d->cmap.isEmpty()) { // QGLColormap in use? int i = d->cmap.find(c.rgb()); if (i < 0) diff --git a/src/opengl/qpaintengine_opengl.cpp b/src/opengl/qpaintengine_opengl.cpp index e7251e8..4823408 100644 --- a/src/opengl/qpaintengine_opengl.cpp +++ b/src/opengl/qpaintengine_opengl.cpp @@ -113,11 +113,7 @@ static bool DEBUG_TEMP_FLAG; static inline void qt_glColor4ubv(unsigned char *col) { -#ifdef QT_OPENGL_ES - glColor4f(col[0]/255.0, col[1]/255.0, col[2]/255.0, col[3]/255.0); -#else - glColor4ubv(col); -#endif + glColor4f(col[0]/255.0f, col[1]/255.0f, col[2]/255.0f, col[3]/255.0f); } struct QT_PointF { |