mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
profile: move dragging code from stats to general qt-code
So far, the only dragable item was the legend in the statistics code. On the profile, we will have multiple dragable items. Therefore, move the code up and make it more general. This took some reorganization. Now, the size of the ChartItem is saved in the base class. Also, setPos() became a virtual function. The dragable items are kept as an unsorted list. If there will be many of them, this should be changed to some sort of sorted list (maybe quadtree?). Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
13c9218ecf
commit
a527415ac9
7 changed files with 114 additions and 65 deletions
|
|
@ -17,7 +17,8 @@ static const double legendInternalBorderSize = 2.0;
|
|||
Legend::Legend(ChartView &view, const StatsTheme &theme, const std::vector<QString> &names) :
|
||||
ChartRectItem(view, ChartZValue::Legend,
|
||||
QPen(theme.legendBorderColor, legendBorderSize),
|
||||
QBrush(theme.legendColor), legendBoxBorderRadius),
|
||||
QBrush(theme.legendColor), legendBoxBorderRadius,
|
||||
true),
|
||||
displayedItems(0), width(0.0), height(0.0),
|
||||
theme(theme),
|
||||
posInitialized(false)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue