Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix use of deprecated APIs in Qt 5.15 #235

Merged
merged 1 commit into from
Nov 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/app/app.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ QStringList App::nodePaths() const
}
}

return existing_paths.toList();
return existing_paths.values();
}

////////////////////////////////////////////////////////////////////////////////
Expand Down
6 changes: 3 additions & 3 deletions app/canvas/canvas_view.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,10 @@ void CanvasView::mouseMoveEvent(QMouseEvent* event)

void CanvasView::wheelEvent(QWheelEvent* event)
{
QPointF a = mapToScene(event->pos());
auto s = pow(1.001, -event->delta());
QPointF a = mapToScene(event->position().toPoint());
auto s = pow(1.001, -event->angleDelta().y());
scale(s, s);
auto d = a - mapToScene(event->pos());
auto d = a - mapToScene(event->position().toPoint());
setSceneRect(sceneRect().translated(d.x(), d.y()));
}

Expand Down
4 changes: 2 additions & 2 deletions app/canvas/info.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

void CanvasInfo::unite(const CanvasInfo& other)
{
inspector.unite(other.inspector);
subdatum.unite(other.subdatum);
inspector.insert(other.inspector);
subdatum.insert(other.subdatum);
}
4 changes: 2 additions & 2 deletions app/canvas/inspector/frame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ QList<DatumRow*> InspectorFrame::visibleRows() const
}

// Sort datums by row order
qSort(rows.begin(), rows.end(),
std::sort(rows.begin(), rows.end(),
[](const DatumRow* a, const DatumRow* b)
{ return a->getIndex() < b->getIndex(); });

Expand Down Expand Up @@ -159,7 +159,7 @@ void InspectorFrame::redoLayout()
}

// Sort datums by row order
qSort(rows.begin(), rows.end(),
std::sort(rows.begin(), rows.end(),
[](const DatumRow* a, const DatumRow* b)
{ return a->getIndex() < b->getIndex(); });

Expand Down
2 changes: 1 addition & 1 deletion app/script/editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ ScriptEditor::ScriptEditor(Script* script, QWidget* parent)
QFont font;
font.setFamily("Courier");
QFontMetrics fm(font);
setTabStopWidth(fm.width(" "));
setTabStopDistance(fm.horizontalAdvance(" "));
document()->setDefaultFont(font);
}

Expand Down
2 changes: 1 addition & 1 deletion app/viewport/render/task.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ RenderTask* RenderTask::getNext(RenderInstance* parent) const

void RenderTask::async()
{
QTime timer;
QElapsedTimer timer;
timer.start();

boost::python::extract<const Shape&> get_shape(shape);
Expand Down
6 changes: 3 additions & 3 deletions app/viewport/view.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -319,9 +319,9 @@ void ViewportView::mouseReleaseEvent(QMouseEvent* event)

void ViewportView::wheelEvent(QWheelEvent* event)
{
QVector3D a = sceneToWorld(mapToScene(event->pos()));
scale *= pow(1.001, -event->delta());
QVector3D b = sceneToWorld(mapToScene(event->pos()));
QVector3D a = sceneToWorld(mapToScene(event->position().toPoint()));
scale *= pow(1.001, -event->angleDelta().y());
QVector3D b = sceneToWorld(mapToScene(event->position().toPoint()));
center += a - b;
update();
}
Expand Down