diff options
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/dialogs/qwizard.cpp | 25 | ||||
-rw-r--r-- | src/gui/dialogs/qwizard.h | 1 | ||||
-rw-r--r-- | src/gui/graphicsview/qgraphicsproxywidget.cpp | 2 | ||||
-rw-r--r-- | src/gui/itemviews/qlistview.cpp | 2 | ||||
-rw-r--r-- | src/gui/painting/qbackingstore.cpp | 5 | ||||
-rw-r--r-- | src/gui/painting/qpaintengine_raster.cpp | 2 | ||||
-rw-r--r-- | src/gui/painting/qpainter.cpp | 23 | ||||
-rw-r--r-- | src/gui/text/qfontengine_mac.mm | 5 |
8 files changed, 46 insertions, 19 deletions
diff --git a/src/gui/dialogs/qwizard.cpp b/src/gui/dialogs/qwizard.cpp index 2c1c2e3..a2dfa52 100644 --- a/src/gui/dialogs/qwizard.cpp +++ b/src/gui/dialogs/qwizard.cpp @@ -560,6 +560,7 @@ public: void enableUpdates(); void _q_emitCustomButtonClicked(); void _q_updateButtonStates(); + void _q_handleFieldObjectDestroyed(QObject *); void setStyle(QStyle *style); #ifdef Q_WS_MAC static QPixmap findDefaultBackgroundPixmap(); @@ -731,6 +732,8 @@ void QWizardPrivate::cleanupPagesNotInHistory() void QWizardPrivate::addField(const QWizardField &field) { + Q_Q(QWizard); + QWizardField myField = field; myField.resolve(defaultPropertyTable); @@ -744,15 +747,23 @@ void QWizardPrivate::addField(const QWizardField &field) if (myField.mandatory && !myField.changedSignal.isEmpty()) QObject::connect(myField.object, myField.changedSignal, myField.page, SLOT(_q_maybeEmitCompleteChanged())); + QObject::connect( + myField.object, SIGNAL(destroyed(QObject *)), q, + SLOT(_q_handleFieldObjectDestroyed(QObject *))); } void QWizardPrivate::removeFieldAt(int index) { + Q_Q(QWizard); + const QWizardField &field = fields.at(index); fieldIndexMap.remove(field.name); if (field.mandatory && !field.changedSignal.isEmpty()) QObject::disconnect(field.object, field.changedSignal, field.page, SLOT(_q_maybeEmitCompleteChanged())); + QObject::disconnect( + field.object, SIGNAL(destroyed(QObject *)), q, + SLOT(_q_handleFieldObjectDestroyed(QObject *))); fields.remove(index); } @@ -1595,6 +1606,20 @@ void QWizardPrivate::_q_updateButtonStates() enableUpdates(); } +void QWizardPrivate::_q_handleFieldObjectDestroyed(QObject *object) +{ + QVector<QWizardField>::iterator it = fields.begin(); + while (it != fields.end()) { + const QWizardField &field = *it; + if (field.object == object) { + fieldIndexMap.remove(field.name); + it = fields.erase(it); + } else { + ++it; + } + } +} + void QWizardPrivate::setStyle(QStyle *style) { for (int i = 0; i < QWizard::NButtons; i++) diff --git a/src/gui/dialogs/qwizard.h b/src/gui/dialogs/qwizard.h index 1d1a9b5..d1f9cf7 100644 --- a/src/gui/dialogs/qwizard.h +++ b/src/gui/dialogs/qwizard.h @@ -197,6 +197,7 @@ private: Q_DECLARE_PRIVATE(QWizard) Q_PRIVATE_SLOT(d_func(), void _q_emitCustomButtonClicked()) Q_PRIVATE_SLOT(d_func(), void _q_updateButtonStates()) + Q_PRIVATE_SLOT(d_func(), void _q_handleFieldObjectDestroyed(QObject *)) friend class QWizardPage; }; diff --git a/src/gui/graphicsview/qgraphicsproxywidget.cpp b/src/gui/graphicsview/qgraphicsproxywidget.cpp index 57269ce..07ebb8c 100644 --- a/src/gui/graphicsview/qgraphicsproxywidget.cpp +++ b/src/gui/graphicsview/qgraphicsproxywidget.cpp @@ -839,7 +839,7 @@ bool QGraphicsProxyWidget::event(QEvent *event) // ### Qt 4.5: this code must also go into a reimplementation // of inputMethodEvent(). QWidget *focusWidget = d->widget->focusWidget(); - if (focusWidget->testAttribute(Qt::WA_InputMethodEnabled)) + if (focusWidget && focusWidget->testAttribute(Qt::WA_InputMethodEnabled)) QApplication::sendEvent(focusWidget, event); break; } diff --git a/src/gui/itemviews/qlistview.cpp b/src/gui/itemviews/qlistview.cpp index f1b0d19..4652b91 100644 --- a/src/gui/itemviews/qlistview.cpp +++ b/src/gui/itemviews/qlistview.cpp @@ -2238,7 +2238,7 @@ QListViewItem QStaticListViewBase::indexToListViewItem(const QModelIndex &index) { if (flowPositions.isEmpty() || segmentPositions.isEmpty() - || index.row() > flowPositions.count()) + || index.row() >= flowPositions.count()) return QListViewItem(); const int segment = qBinarySearch<int>(segmentStartRows, index.row(), diff --git a/src/gui/painting/qbackingstore.cpp b/src/gui/painting/qbackingstore.cpp index d3b4157..34bc578 100644 --- a/src/gui/painting/qbackingstore.cpp +++ b/src/gui/painting/qbackingstore.cpp @@ -258,7 +258,10 @@ void QWidgetBackingStore::unflushPaint(QWidget *widget, const QRegion &rgn) bool QWidgetBackingStore::bltRect(const QRect &rect, int dx, int dy, QWidget *widget) { const QPoint pos(tlwOffset + widget->mapTo(tlw, rect.topLeft())); - return windowSurface->scroll(QRect(pos, rect.size()), dx, dy); + const QRect tlwRect(QRect(pos, rect.size())); + if (dirty.intersects(tlwRect)) + return false; // We don't want to scroll junk. + return windowSurface->scroll(tlwRect, dx, dy); } void QWidgetBackingStore::releaseBuffer() diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp index 37f7b6d..37a88a3 100644 --- a/src/gui/painting/qpaintengine_raster.cpp +++ b/src/gui/painting/qpaintengine_raster.cpp @@ -1322,6 +1322,7 @@ void QRasterPaintEngine::clip(const QRect &rect, Qt::ClipOperation op) delete s->clip; s->clip = clip; + s->clip->enabled = true; s->flags.has_clip_ownership = true; } else { // intersect clip with current clip @@ -1338,6 +1339,7 @@ void QRasterPaintEngine::clip(const QRect &rect, Qt::ClipOperation op) s->clip->setClipRect(base->clipRect & clipRect); else s->clip->setClipRegion(base->clipRegion & clipRect); + s->clip->enabled = true; } else { QPaintEngineEx::clip(rect, op); return; diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp index 6953e04..34305c2 100644 --- a/src/gui/painting/qpainter.cpp +++ b/src/gui/painting/qpainter.cpp @@ -2545,6 +2545,9 @@ void QPainter::setClipRect(const QRectF &rect, Qt::ClipOperation op) Q_D(QPainter); if (d->extended) { + if (!hasClipping() && (op == Qt::IntersectClip || op == Qt::UniteClip)) + op = Qt::ReplaceClip; + if (!d->engine) { qWarning("QPainter::setClipRect: Painter not active"); return; @@ -2598,6 +2601,9 @@ void QPainter::setClipRect(const QRect &rect, Qt::ClipOperation op) return; } + if (!hasClipping() && (op == Qt::IntersectClip || op == Qt::UniteClip)) + op = Qt::ReplaceClip; + if (d->extended) { d->state->clipEnabled = true; d->extended->clip(rect, op); @@ -2606,9 +2612,6 @@ void QPainter::setClipRect(const QRect &rect, Qt::ClipOperation op) return; } - if (!hasClipping() && (op == Qt::IntersectClip || op == Qt::UniteClip)) - op = Qt::ReplaceClip; - d->state->clipRegion = rect; d->state->clipOperation = op; if (op == Qt::NoClip || op == Qt::ReplaceClip) @@ -2651,6 +2654,9 @@ void QPainter::setClipRegion(const QRegion &r, Qt::ClipOperation op) return; } + if (!hasClipping() && (op == Qt::IntersectClip || op == Qt::UniteClip)) + op = Qt::ReplaceClip; + if (d->extended) { d->state->clipEnabled = true; d->extended->clip(r, op); @@ -2659,9 +2665,6 @@ void QPainter::setClipRegion(const QRegion &r, Qt::ClipOperation op) return; } - if (!hasClipping() && (op == Qt::IntersectClip || op == Qt::UniteClip)) - op = Qt::ReplaceClip; - d->state->clipRegion = r; d->state->clipOperation = op; if (op == Qt::NoClip || op == Qt::ReplaceClip) @@ -3048,6 +3051,9 @@ void QPainter::setClipPath(const QPainterPath &path, Qt::ClipOperation op) return; } + if (!hasClipping() && (op == Qt::IntersectClip || op == Qt::UniteClip)) + op = Qt::ReplaceClip; + if (d->extended) { d->state->clipEnabled = true; d->extended->clip(path, op); @@ -3056,11 +3062,6 @@ void QPainter::setClipPath(const QPainterPath &path, Qt::ClipOperation op) return; } - - - if (!hasClipping() && (op == Qt::IntersectClip || op == Qt::UniteClip)) - op = Qt::ReplaceClip; - d->state->clipPath = path; d->state->clipOperation = op; if (op == Qt::NoClip || op == Qt::ReplaceClip) diff --git a/src/gui/text/qfontengine_mac.mm b/src/gui/text/qfontengine_mac.mm index b80e52d..a545148 100644 --- a/src/gui/text/qfontengine_mac.mm +++ b/src/gui/text/qfontengine_mac.mm @@ -1019,11 +1019,6 @@ bool QFontEngineMacMulti::stringToCMapInternal(const QChar *str, int len, QGlyph | kATSLineDisableAllJustification ; - if (!(flags & QTextEngine::DesignMetrics)) { - layopts |= kATSLineFractDisable | kATSLineUseDeviceMetrics - | kATSLineDisableAutoAdjustDisplayPos; - } - if (fontDef.styleStrategy & QFont::NoAntialias) layopts |= kATSLineNoAntiAliasing; |