D21575: Add Cursor

Stefan Gerlach noreply at phabricator.kde.org
Wed Jul 17 21:57:05 BST 2019


sgerlach added inline comments.

INLINE COMMENTS

> TreeModel.cpp:148
> +    QVector<QVariant> rootData;
> +    foreach (QString header, headers)
> +        rootData << header;

use range-based loop

> TreeModel.cpp:164
> +QVariant TreeModel::treeData(const int row, const int column, const QModelIndex& parent, const int role) {
> +	QModelIndex currentIndex = index(row, column, parent);
> +	return data(currentIndex, role);

indentation?

> Worksheet.cpp:839
> +
> +	CartesianPlot* sender = dynamic_cast<CartesianPlot*>(QObject::sender());
> +

auto* sender = ...

> Worksheet.cpp:861
> +
> +			CartesianPlot* plot = dynamic_cast<CartesianPlot*>(getPlot(i));
> +			if (!plot || !plot->isVisible())

auto* plot = ...

> Worksheet.cpp:985
> +void Worksheet::curveDataChanged(const XYCurve* curve) {
> +	CartesianPlot* plot = dynamic_cast<CartesianPlot*>(QObject::sender());
> +	if (!plot)

auto*

> Worksheet.cpp:1024
> +void Worksheet::curveAdded(const XYCurve* curve) {
> +	CartesianPlot* plot = dynamic_cast<CartesianPlot*>(QObject::sender());
> +	if (!plot)

auto*

> Worksheet.cpp:1068
> +
> +	CartesianPlot* plot = dynamic_cast<CartesianPlot*>(QObject::sender());
> +	if (!plot)

auto*

> CartesianCoordinateSystem.cpp:609
> +		double x = point.x();
> +		double y = point.y();
> +		if (limit) {

define temp vars for pageRect.x() and pageRect.y() too?

> CartesianPlot.cpp:2575
> +		double cursorPenWidth2 = cursorPen.width()/2;
> +		cursorPenWidth2 = cursorPenWidth2 < 10 ? 10 : cursorPenWidth2;
> +		if (cursor0Enable && abs(event->pos().x()-cSystem->mapLogicalToScene(QPointF(cursor0Pos.x(),yMin)).x()) < cursorPenWidth2) {

same as
if (cursorPenWidth2 < 10) cursorPenWidth2 = 10;

> CartesianPlot.cpp:2689
> +		if (!boundingRect().contains(event->pos())) {
> +			q->info("Not inside bounding rect");
> +			return;

translation?

REPOSITORY
  R262 LabPlot

REVISION DETAIL
  https://phabricator.kde.org/D21575

To: Murmele, asemke
Cc: sgerlach, kde-edu, narvaez, apol
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-edu/attachments/20190717/c2fbb517/attachment-0001.html>


More information about the kde-edu mailing list