D17731: Select curve only, when clicked near curve
Martin Marmsoler
noreply at phabricator.kde.org
Tue Dec 25 21:12:14 GMT 2018
Murmele marked an inline comment as done.
Murmele added a comment.
Can the code:
//to select curves having overlapping bounding boxes we need to check whether the cursor
//is inside of item's shapes and not inside of the bounding boxes (Qt's default behaviour).
if(m_cartesianPlotMouseMode == CartesianPlot::MouseMode::SelectionMode){
for (auto* item : items(event->pos())) {
if (!dynamic_cast<XYCurvePrivate*>(item))
continue;
if ( item->shape().contains(item->mapFromScene(mapToScene(event->pos()))) ) {
//deselect currently selected items
for (auto* selectedItem : scene()->selectedItems())
selectedItem->setSelected(false);
//select the item under the cursor and update the current selection
item->setSelected(true);
selectionChanged();
return;
}
}
}
In worksheetView.cpp, line944 to 963 be deleted?
INLINE COMMENTS
> asemke wrote in Column.cpp:436
> why do you update the column properties here? Why not to update only when asked for in Column::columnProperties() similar to how this is done for statistics in Column::statistics()?
Problem is, that in XYCurve the column member is const, so I'm not able to update from XYCurve.
Should I reset AbstractColumn to not const?
> asemke wrote in Column.cpp:436
> why do you update the column properties here? Why not to update only when asked for in Column::columnProperties() similar to how this is done for statistics in Column::statistics()?
made columnPropertiesAvailable and columnProperties mutable
REVISION DETAIL
https://phabricator.kde.org/D17731
To: Murmele, asemke
Cc: yurchor, kde-edu, Murmele, narvaez, apol
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-edu/attachments/20181225/ee3d6304/attachment.html>
More information about the kde-edu
mailing list