From 9dc738821e6618b1ba51b46f98205acfe74cbea4 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Fri, 20 Apr 2012 21:12:12 +0200 Subject: [PATCH] Do not use deprecated API Change-Id: I0c61f9cb4abe926d5f1e0a3acda7117d8d54efb6 Reviewed-by: Simjees Abraham Reviewed-by: Kai Koehne Reviewed-by: Matthew Vogt --- src/imports/folderlistmodel/qquickfolderlistmodel.cpp | 8 ++++++-- src/imports/folderlistmodel/qquickfolderlistmodel.h | 1 + src/plugins/qmltooling/qmldbg_qtquick2/inspecttool.cpp | 12 ++++++------ src/qml/qml/qqmlvaluetype.cpp | 2 +- src/quick/items/context2d/qquickcontext2dtexture.cpp | 4 ++-- tools/easingcurveeditor/splineeditor.cpp | 2 +- 6 files changed, 17 insertions(+), 12 deletions(-) diff --git a/src/imports/folderlistmodel/qquickfolderlistmodel.cpp b/src/imports/folderlistmodel/qquickfolderlistmodel.cpp index 0aabb7a..b937fbd 100644 --- a/src/imports/folderlistmodel/qquickfolderlistmodel.cpp +++ b/src/imports/folderlistmodel/qquickfolderlistmodel.cpp @@ -274,8 +274,6 @@ QQuickFolderListModel::QQuickFolderListModel(QObject *parent) d->roleNames[FileLastModifiedRole] = "fileModified"; d->roleNames[FileLastReadRole] = "fileAccessed"; d->roleNames[FileIsDirRole] = "fileIsDir"; - setRoleNames(d->roleNames); - d->init(); } @@ -323,6 +321,12 @@ QVariant QQuickFolderListModel::data(const QModelIndex &index, int role) const return rv; } +QHash QQuickFolderListModel::roleNames() const +{ + Q_D(const QQuickFolderListModel); + return d->roleNames; +} + /*! \qmlproperty int FolderListModel::count diff --git a/src/imports/folderlistmodel/qquickfolderlistmodel.h b/src/imports/folderlistmodel/qquickfolderlistmodel.h index 830a30b..d002836 100644 --- a/src/imports/folderlistmodel/qquickfolderlistmodel.h +++ b/src/imports/folderlistmodel/qquickfolderlistmodel.h @@ -97,6 +97,7 @@ public: virtual int rowCount(const QModelIndex &parent = QModelIndex()) const; virtual QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const; virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; + virtual QHash roleNames() const; //![abslistmodel] //![count] diff --git a/src/plugins/qmltooling/qmldbg_qtquick2/inspecttool.cpp b/src/plugins/qmltooling/qmldbg_qtquick2/inspecttool.cpp index 47b1519..7a17736 100644 --- a/src/plugins/qmltooling/qmldbg_qtquick2/inspecttool.cpp +++ b/src/plugins/qmltooling/qmldbg_qtquick2/inspecttool.cpp @@ -120,16 +120,16 @@ void InspectTool::leaveEvent(QEvent *) void InspectTool::mousePressEvent(QMouseEvent *event) { - m_mousePosition = event->posF(); + m_mousePosition = event->localPos(); if (event->button() == Qt::LeftButton) { m_pressAndHoldTimer.start(); - initializeDrag(event->posF()); + initializeDrag(event->localPos()); } } void InspectTool::mouseReleaseEvent(QMouseEvent *event) { - m_mousePosition = event->posF(); + m_mousePosition = event->localPos(); m_pressAndHoldTimer.stop(); if (event->button() == Qt::LeftButton && !m_dragStarted) { selectItem(); @@ -139,7 +139,7 @@ void InspectTool::mouseReleaseEvent(QMouseEvent *event) void InspectTool::mouseDoubleClickEvent(QMouseEvent *event) { - m_mousePosition = event->posF(); + m_mousePosition = event->localPos(); m_pressAndHoldTimer.stop(); if (event->button() == Qt::LeftButton) { selectNextItem(); @@ -149,13 +149,13 @@ void InspectTool::mouseDoubleClickEvent(QMouseEvent *event) void InspectTool::mouseMoveEvent(QMouseEvent *event) { - m_mousePosition = event->posF(); + m_mousePosition = event->localPos(); moveItem(event->buttons() & Qt::LeftButton); } void InspectTool::hoverMoveEvent(QMouseEvent *event) { - m_mousePosition = event->posF(); + m_mousePosition = event->localPos(); m_pressAndHoldTimer.stop(); QQuickItem *item = inspector()->topVisibleItemAt(event->pos()); if (!item || item == m_lastClickedItem) { diff --git a/src/qml/qml/qqmlvaluetype.cpp b/src/qml/qml/qqmlvaluetype.cpp index fdc44c2..4086cae 100644 --- a/src/qml/qml/qqmlvaluetype.cpp +++ b/src/qml/qml/qqmlvaluetype.cpp @@ -439,7 +439,7 @@ void QQmlEasingValueType::setBezierCurve(const QVariantList &customCurveVariant) QVariantList QQmlEasingValueType::bezierCurve() const { QVariantList rv; - QList points = v.cubicBezierSpline(); + QVector points = v.toCubicSpline(); for (int ii = 0; ii < points.count(); ++ii) rv << QVariant(points.at(ii).x()) << QVariant(points.at(ii).y()); return rv; diff --git a/src/quick/items/context2d/qquickcontext2dtexture.cpp b/src/quick/items/context2d/qquickcontext2dtexture.cpp index bdf1471..1beee8c 100644 --- a/src/quick/items/context2d/qquickcontext2dtexture.cpp +++ b/src/quick/items/context2d/qquickcontext2dtexture.cpp @@ -520,7 +520,7 @@ QImage QQuickContext2DFBOTexture::toImage(const QRectF& region) void QQuickContext2DFBOTexture::compositeTile(QQuickContext2DTile* tile) { QQuickContext2DFBOTile* t = static_cast(tile); - QRect target = t->rect().intersect(m_canvasWindow); + QRect target = t->rect().intersected(m_canvasWindow); if (target.isValid()) { QRect source = target; @@ -730,7 +730,7 @@ void QQuickContext2DImageTexture::compositeTile(QQuickContext2DTile* tile) { Q_ASSERT(!tile->dirty()); QQuickContext2DImageTile* t = static_cast(tile); - QRect target = t->rect().intersect(m_canvasWindow); + QRect target = t->rect().intersected(m_canvasWindow); if (target.isValid()) { QRect source = target; source.moveTo(source.topLeft() - t->rect().topLeft()); diff --git a/tools/easingcurveeditor/splineeditor.cpp b/tools/easingcurveeditor/splineeditor.cpp index dbd32dd..d440852 100644 --- a/tools/easingcurveeditor/splineeditor.cpp +++ b/tools/easingcurveeditor/splineeditor.cpp @@ -659,7 +659,7 @@ void SplineEditor::setEasingCurve(const QEasingCurve &easingCurve) return; m_block = true; m_easingCurve = easingCurve; - m_controlPoints = m_easingCurve.cubicBezierSpline().toVector(); + m_controlPoints = m_easingCurve.toCubicSpline(); m_numberOfSegments = m_controlPoints.count() / 3; update(); emit easingCurveChanged(); -- 2.7.4