From f1d3ed3a4adc2f1859102afb03b5c794d569940c Mon Sep 17 00:00:00 2001 From: Harald Fernengel Date: Fri, 26 Jun 2009 11:35:16 +0200 Subject: Manually fix bad merges and make sure everything compiles with 4.6. --- src/corelib/statemachine/qstatemachine.cpp | 2 +- src/corelib/thread/qthread_p.h | 15 +++++++++++++++ src/corelib/tools/qvector.h | 20 ++++++++++---------- src/gui/dialogs/qfiledialog_p.h | 2 +- src/gui/graphicsview/qgraphicsitem.cpp | 5 ++--- src/gui/kernel/qapplication.cpp | 3 +-- src/gui/kernel/qwidget_p.h | 7 +++---- src/gui/kernel/qwidget_s60.cpp | 2 +- src/gui/painting/qpaintengineex.cpp | 6 ++---- 9 files changed, 36 insertions(+), 26 deletions(-) diff --git a/src/corelib/statemachine/qstatemachine.cpp b/src/corelib/statemachine/qstatemachine.cpp index 64b33ac..31aeaea 100644 --- a/src/corelib/statemachine/qstatemachine.cpp +++ b/src/corelib/statemachine/qstatemachine.cpp @@ -2074,7 +2074,7 @@ int QSignalEventGenerator::qt_metacall(QMetaObject::Call _c, int _id, void **_a) switch (_id) { case 0: { // ### in Qt 4.6 we can use QObject::senderSignalIndex() - QObjectPrivate *d = static_cast(d_ptr); + QObjectPrivate *d = static_cast(d_ptr.data()); int signalIndex = -1; QObject *sender = this->sender(); if (sender && d->currentSender) diff --git a/src/corelib/thread/qthread_p.h b/src/corelib/thread/qthread_p.h index c575005..0735746 100644 --- a/src/corelib/thread/qthread_p.h +++ b/src/corelib/thread/qthread_p.h @@ -211,6 +211,21 @@ public: # endif }; +// thread wrapper for the main() thread +class QAdoptedThread : public QThread +{ + Q_DECLARE_PRIVATE(QThread) + +public: + QAdoptedThread(QThreadData *data = 0); + ~QAdoptedThread(); + void init(); + + static QThread *createThreadForAdoption(); +private: + void run(); +}; + QT_END_NAMESPACE #endif // QTHREAD_P_H diff --git a/src/corelib/tools/qvector.h b/src/corelib/tools/qvector.h index d9fad3a..c83e833 100644 --- a/src/corelib/tools/qvector.h +++ b/src/corelib/tools/qvector.h @@ -436,8 +436,8 @@ void QVector::realloc(int asize, int aalloc) if (QTypeInfo::isComplex && asize < d->size && d->ref == 1 ) { // call the destructor on all objects that need to be // destroyed when shrinking - pOld = d->array + d->size; - pNew = d->array + asize; + pOld = p->array + d->size; + pNew = p->array + asize; while (asize < d->size) { (--pOld)->~T(); d->size--; @@ -447,23 +447,23 @@ void QVector::realloc(int asize, int aalloc) if (aalloc != d->alloc || d->ref != 1) { // (re)allocate memory if (QTypeInfo::isStatic) { - x.p = malloc(aalloc); + x.d = malloc(aalloc); Q_CHECK_PTR(x.p); x.d->size = 0; } else if (d->ref != 1) { - x.p = malloc(aalloc); + x.d = malloc(aalloc); Q_CHECK_PTR(x.p); if (QTypeInfo::isComplex) { x.d->size = 0; } else { - ::memcpy(x.p, p, sizeOfTypedData() + (qMin(aalloc, p->alloc) - 1) * sizeof(T)); + ::memcpy(x.p, p, sizeOfTypedData() + (qMin(aalloc, d->alloc) - 1) * sizeof(T)); x.d->size = d->size; } } else { QT_TRY { QVectorData *mem = static_cast(qRealloc(p, sizeOfTypedData() + (aalloc - 1) * sizeof(T))); Q_CHECK_PTR(mem); - x.p = p = mem; + x.d = d = mem; x.d->size = d->size; } QT_CATCH (const std::bad_alloc &) { if (aalloc > d->alloc) // ignore the error in case we are just shrinking. @@ -478,8 +478,8 @@ void QVector::realloc(int asize, int aalloc) if (QTypeInfo::isComplex) { QT_TRY { - pOld = d->array + x.d->size; - pNew = x.d->array + x.d->size; + pOld = p->array + x.d->size; + pNew = x.p->array + x.d->size; // copy objects from the old array into the new array while (x.d->size < qMin(asize, d->size)) { new (pNew++) T(*pOld++); @@ -491,13 +491,13 @@ void QVector::realloc(int asize, int aalloc) x.d->size++; } } QT_CATCH (...) { - free(x.d); + free(x.p); QT_RETHROW; } } else if (asize > x.d->size) { // initialize newly allocated memory to 0 - qMemSet(x.d->array + x.d->size, 0, (asize - x.d->size) * sizeof(T)); + qMemSet(x.p->array + x.d->size, 0, (asize - x.d->size) * sizeof(T)); } x.d->size = asize; diff --git a/src/gui/dialogs/qfiledialog_p.h b/src/gui/dialogs/qfiledialog_p.h index 2925c8c..47e84ab 100644 --- a/src/gui/dialogs/qfiledialog_p.h +++ b/src/gui/dialogs/qfiledialog_p.h @@ -235,7 +235,7 @@ public: QFileSystemModel *model; #ifndef QT_NO_COMPLETER - QFSCompletor *completer; + QFSCompleter *completer; #endif //QT_NO_COMPLETER QFileDialog::FileMode fileMode; diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp index d9cba2a..aad652f 100644 --- a/src/gui/graphicsview/qgraphicsitem.cpp +++ b/src/gui/graphicsview/qgraphicsitem.cpp @@ -986,7 +986,7 @@ void QGraphicsItemPrivate::childrenBoundingRectHelper(QTransform *x, QRectF *rec for (int i = 0; i < children.size(); ++i) { QGraphicsItem *child = children.at(i); - QGraphicsItemPrivate *childd = child->d_ptr; + QGraphicsItemPrivate *childd = child->d_ptr.data(); bool hasPos = !childd->pos.isNull(); if (hasPos || childd->transformData) { // COMBINE @@ -1142,7 +1142,6 @@ QGraphicsItem::~QGraphicsItem() d_ptr->setParentItemHelper(0); delete d_ptr->transformData; - delete d_ptr; qt_dataStore()->data.remove(this); } @@ -3325,7 +3324,7 @@ QTransform QGraphicsItem::itemTransform(const QGraphicsItem *other, bool *ok) co QTransform x; const QGraphicsItem *p = child; do { - p->d_ptr->.data()->combineTransformToParent(&x); + p->d_ptr.data()->combineTransformToParent(&x); } while ((p = p->d_ptr->parent) && p != root); if (parentOfOther) return x.inverted(ok); diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp index 64009d4..a8ac9a1 100644 --- a/src/gui/kernel/qapplication.cpp +++ b/src/gui/kernel/qapplication.cpp @@ -450,7 +450,6 @@ bool QApplicationPrivate::fade_tooltip = false; bool QApplicationPrivate::animate_toolbox = false; bool QApplicationPrivate::widgetCount = false; bool QApplicationPrivate::auto_sip_on_mouse_focus = false; -QString* QApplicationPrivate::styleOverride = 0; #if defined(Q_WS_WIN) && !defined(Q_WS_WINCE) bool QApplicationPrivate::inSizeMove = false; #endif @@ -1948,7 +1947,7 @@ QString desktopstyle; #elif defined(Q_WS_X11) && defined(Q_OS_SOLARIS) desktopstyle = QLatin1String("CDE"); // default style for X11 on Solaris #elif defined(Q_WS_S60) - style = QLatin1String("S60"); + desktopstyle = QLatin1String("S60"); #elif defined(Q_WS_X11) && defined(Q_OS_IRIX) desktopstyle = QLatin1String("SGI"); // default style for X11 on IRIX #elif defined(Q_WS_QWS) diff --git a/src/gui/kernel/qwidget_p.h b/src/gui/kernel/qwidget_p.h index 527e331..e17c236 100644 --- a/src/gui/kernel/qwidget_p.h +++ b/src/gui/kernel/qwidget_p.h @@ -282,9 +282,6 @@ public: QPalette naturalWidgetPalette(uint inheritedMask) const; void setMask_sys(const QRegion &); -#ifdef Q_WS_S60 - void s60UpdateIsOpaque(); -#endif void raise_sys(); void lower_sys(); @@ -658,8 +655,10 @@ public: #elif defined(Q_WS_S60) // <--------------------------------------------------------- SYMBIAN static QWidget *mouseGrabber; static QWidget *keyboardGrabber; + void s60UpdateIsOpaque(); + void reparentChildren(); #endif - + }; inline QWExtra *QWidgetPrivate::extraData() const diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp index 6109f17..3149a7e 100644 --- a/src/gui/kernel/qwidget_s60.cpp +++ b/src/gui/kernel/qwidget_s60.cpp @@ -144,7 +144,7 @@ void QWidgetPrivate::setSoftKeys_sys(const QList &softkeys) nativeContainer->DrawDeferred(); // 3.1 needs an extra invitation } -void QWidgetPrivate::setWSGeometry(bool dontShow) +void QWidgetPrivate::setWSGeometry(bool, const QRect &) { } diff --git a/src/gui/painting/qpaintengineex.cpp b/src/gui/painting/qpaintengineex.cpp index 222e29f..eedd5c0 100644 --- a/src/gui/painting/qpaintengineex.cpp +++ b/src/gui/painting/qpaintengineex.cpp @@ -144,8 +144,7 @@ void QPaintEngineExPrivate::replayClipOperations() if (!p || !p->d_ptr) return; - QPainterPrivate *pp = p->d_ptr; - QList clipInfo = pp->state->clipInfo; + QList clipInfo = p->d_ptr->state->clipInfo; QTransform transform = q->state()->matrix; @@ -196,8 +195,7 @@ bool QPaintEngineExPrivate::hasClipOperations() const if (!p || !p->d_ptr) return false; - QPainterPrivate *pp = p->d_ptr; - QList clipInfo = pp->state->clipInfo; + QList clipInfo = p->d_ptr->state->clipInfo; return !clipInfo.isEmpty(); } -- cgit v0.12