Multiple cell selection + new control element for entries + first version of selection actions
ClosedPublic

Authored by sirgienko on Feb 1 2020, 9:13 PM.

Diff Detail

Repository
R55 Cantor
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
sirgienko created this revision.Feb 1 2020, 9:13 PM
Restricted Application added a project: KDE Edu. · View Herald TranscriptFeb 1 2020, 9:13 PM
Restricted Application added a subscriber: kde-edu. · View Herald Transcript
sirgienko requested review of this revision.Feb 1 2020, 9:13 PM
asemke added inline comments.Feb 2 2020, 12:47 PM
src/CMakeLists.txt
82

to be more consistent with other classes, let's name the new files worksheetcontrolitem.h/cpp and the class WorksheetControlItem.

src/actionbar.cpp
34

spaces around the operators are not consistently used in Cantor's code nor in this patch. Let's consistently use spaces around every operator.

src/worksheet.cpp
1541

unnecessary blank.

1687

space in front of :

2434

space if front of :

2444

space in front of the opening bracket (

src/worksheet.h
277

function names start with a small letter.

src/worksheetcontrolelement.cpp
25 ↗(On Diff #74844)

the debug output below doesn't see to be relevant anymore.

70 ↗(On Diff #74844)

similar to how we visualize the selection of the control item we should also visualize the item when it's being hovered. Let's introduce a new variable m_overed here and handle it appropriately in hoverEnterEvent() and in hoverLeaveEvent().

78 ↗(On Diff #74844)

painter->fillRect(rect(), QApplication::palette().color(QPalette::Highlight) would also do the job I think.

91 ↗(On Diff #74844)

this assignment and the evaluation of buttonDownPos() is only needed if we have Qt::LeftButton. I'd use

if (event->buttons() != Qt::LeftButton)
    return;

const QPointF downPos = event->buttonDownPos(Qt::LeftButton);
if (contains(downPos) && (event->pos() - downPos).manhattanLength() >= QApplication::startDragDistance())
{
...
}
src/worksheetcontrolelement.h
36 ↗(On Diff #74844)

for QPointF it's better/faster to work with object copies and not with references.

40 ↗(On Diff #74844)

inconsistent usage of spaces here.

44 ↗(On Diff #74844)

these is* variables sound like function names. Let's consistently name private variables m_* like in WorksheetTextItem, etc.

sirgienko updated this revision to Diff 74859.Feb 2 2020, 3:36 PM
sirgienko marked 12 inline comments as done.

Requested changes + hover event + fixing painting on pringing pdf

sirgienko added inline comments.Feb 2 2020, 3:36 PM
src/worksheet.cpp
1541

Where exactly?

src/worksheetcontrolelement.h
44 ↗(On Diff #74844)

Well, but this variables is public, so, I think, we could say, that they part of public interface.

sirgienko updated this revision to Diff 74864.Feb 2 2020, 5:19 PM

Minor spaces improvments

asemke accepted this revision.Feb 2 2020, 5:21 PM
This revision is now accepted and ready to land.Feb 2 2020, 5:21 PM
This revision was automatically updated to reflect the committed changes.