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
Branch
cell-selection
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 21954
Build 21972: arc lint + arc unit
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

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

70

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

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

91

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

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

40

inconsistent usage of spaces here.

44

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

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.