Skip to content

Commit 04f4d14

Browse files
author
Jason McDonald
committed
Merge branch '4.5' of [email protected]:qt/qt into 4.5
2 parents ad41250 + f34cfa1 commit 04f4d14

File tree

4 files changed

+8
-9
lines changed

4 files changed

+8
-9
lines changed

src/corelib/tools/qvector.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ void QVector<T>::detach_helper()
315315
{ realloc(d->size, d->alloc); }
316316
template <typename T>
317317
void QVector<T>::reserve(int asize)
318-
{ if (asize > d->alloc || d->ref != 1) realloc(d->size, asize); d->capacity = 1; }
318+
{ if (asize > d->alloc) realloc(d->size, asize); if (d->ref == 1) d->capacity = 1; }
319319
template <typename T>
320320
void QVector<T>::resize(int asize)
321321
{ realloc(asize, (asize > d->alloc || (!d->capacity && asize < d->size && asize < (d->alloc >> 1))) ?

src/gui/widgets/qdockarealayout.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1167,7 +1167,8 @@ bool QDockAreaLayoutInfo::insertGap(QList<int> path, QLayoutItem *dockWidgetItem
11671167

11681168
QDockAreaLayoutInfo *subinfo = item.subinfo;
11691169
QLayoutItem *widgetItem = item.widgetItem;
1170-
QRect r = subinfo == 0 ? dockedGeometry(widgetItem->widget()) : subinfo->rect;
1170+
QPlaceHolderItem *placeHolderItem = item.placeHolderItem;
1171+
QRect r = subinfo == 0 ? widgetItem ? dockedGeometry(widgetItem->widget()) : placeHolderItem->topLevelRect : subinfo->rect;
11711172

11721173
Qt::Orientation opposite = o == Qt::Horizontal ? Qt::Vertical : Qt::Horizontal;
11731174
#ifdef QT_NO_TABBAR
@@ -1176,13 +1177,15 @@ bool QDockAreaLayoutInfo::insertGap(QList<int> path, QLayoutItem *dockWidgetItem
11761177
QDockAreaLayoutInfo *new_info
11771178
= new QDockAreaLayoutInfo(sep, dockPos, opposite, tabBarShape, mainWindow);
11781179

1180+
//item become a new top-level
11791181
item.subinfo = new_info;
11801182
item.widgetItem = 0;
1183+
item.placeHolderItem = 0;
11811184

11821185
QDockAreaLayoutItem new_item
11831186
= widgetItem == 0
11841187
? QDockAreaLayoutItem(subinfo)
1185-
: QDockAreaLayoutItem(widgetItem);
1188+
: widgetItem ? QDockAreaLayoutItem(widgetItem) : QDockAreaLayoutItem(placeHolderItem);
11861189
new_item.size = pick(opposite, r.size());
11871190
new_item.pos = pick(opposite, r.topLeft());
11881191
new_info->item_list.append(new_item);

src/opengl/qgl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3530,7 +3530,7 @@ void QGLWidget::qglColor(const QColor& c) const
35303530
const QGLContext *ctx = QGLContext::currentContext();
35313531
if (ctx) {
35323532
if (ctx->format().rgba())
3533-
glColor4ub(c.red(), c.green(), c.blue(), c.alpha());
3533+
glColor4f(c.redF(), c.greenF(), c.blueF(), c.alphaF());
35343534
else if (!d->cmap.isEmpty()) { // QGLColormap in use?
35353535
int i = d->cmap.find(c.rgb());
35363536
if (i < 0)

src/opengl/qpaintengine_opengl.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,7 @@ static bool DEBUG_TEMP_FLAG;
113113

114114
static inline void qt_glColor4ubv(unsigned char *col)
115115
{
116-
#ifdef QT_OPENGL_ES
117-
glColor4f(col[0]/255.0, col[1]/255.0, col[2]/255.0, col[3]/255.0);
118-
#else
119-
glColor4ubv(col);
120-
#endif
116+
glColor4f(col[0]/255.0f, col[1]/255.0f, col[2]/255.0f, col[3]/255.0f);
121117
}
122118

123119
struct QT_PointF {

0 commit comments

Comments
 (0)