statistics: remove old unused statistics code

This never came to be - no point in carrying it around.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2022-11-18 21:43:53 +01:00 committed by Dirk Hohndel
parent 5525344594
commit cf70a25be4
4 changed files with 0 additions and 75 deletions

View file

@ -493,7 +493,6 @@ elseif (SUBSURFACE_TARGET_EXECUTABLE MATCHES "DesktopExecutable")
subsurface_generated_ui
subsurface_interface
subsurface_profile
subsurface_statistics
${SUBSURFACE_MAPWIDGET}
subsurface_backend_shared
subsurface_models_desktop
@ -503,7 +502,6 @@ elseif (SUBSURFACE_TARGET_EXECUTABLE MATCHES "DesktopExecutable")
${SUBSURFACE_LINK_LIBRARIES}
)
add_dependencies(subsurface_desktop_preferences subsurface_generated_ui)
add_dependencies(subsurface_statistics subsurface_generated_ui)
add_dependencies(subsurface_interface subsurface_generated_ui)
add_dependencies(subsurface_profile subsurface_generated_ui)
add_dependencies(subsurface_models_desktop subsurface_generated_ui)

View file

@ -181,21 +181,12 @@ endif()
source_group("Subsurface Interface" FILES ${SUBSURFACE_INTERFACE})
# the yearly statistics widget.
set(SUBSURFACE_STATISTICS_LIB_SRCS
statistics/statisticswidget.cpp
statistics/statisticswidget.h
)
source_group("Subsurface Statistics" FILES ${SUBSURFACE_STATISTICS_LIB_SRCS})
if(NOT USINGQT6)
qt5_wrap_ui(SUBSURFACE_UI_SRCS ${SUBSURFACE_UI})
else()
qt_wrap_ui(SUBSURFACE_UI_SRCS ${SUBSURFACE_UI})
endif()
add_library(subsurface_statistics STATIC ${SUBSURFACE_STATISTICS_LIB_SRCS})
target_link_libraries(subsurface_statistics ${QT_LIBRARIES})
add_library(subsurface_generated_ui STATIC ${SUBSURFACE_UI_HDRS})
target_link_libraries(subsurface_generated_ui ${QT_LIBRARIES})
add_library(subsurface_interface STATIC ${SUBSURFACE_INTERFACE} ${SUBSURFACE_UI_SRCS})

View file

@ -1,40 +0,0 @@
// SPDX-License-Identifier: GPL-2.0
#include "desktop-widgets/statistics/statisticswidget.h"
#include "qt-models/yearlystatisticsmodel.h"
#include <QModelIndex>
YearlyStatisticsWidget::YearlyStatisticsWidget(QWidget *parent):
QGraphicsView(parent),
m_model(NULL)
{
}
void YearlyStatisticsWidget::setModel(YearlyStatisticsModel *m)
{
m_model = m;
connect(m, SIGNAL(dataChanged(QModelIndex,QModelIndex)),
this, SLOT(modelDataChanged(QModelIndex,QModelIndex)));
connect(m, SIGNAL(rowsAboutToBeRemoved(QModelIndex,int,int)),
scene(), SLOT(clear()));
connect(m, SIGNAL(rowsInserted(QModelIndex,int,int)),
this, SLOT(modelRowsInserted(QModelIndex,int,int)));
modelRowsInserted(QModelIndex(),0,m_model->rowCount()-1);
}
void YearlyStatisticsWidget::modelRowsInserted(const QModelIndex&, int, int)
{
// stub
}
void YearlyStatisticsWidget::modelDataChanged(const QModelIndex&, const QModelIndex&)
{
scene()->clear();
modelRowsInserted(QModelIndex(),0,m_model->rowCount()-1);
}
void YearlyStatisticsWidget::resizeEvent(QResizeEvent *event)
{
QGraphicsView::resizeEvent(event);
fitInView(sceneRect(), Qt::IgnoreAspectRatio);
}

View file

@ -1,24 +0,0 @@
// SPDX-License-Identifier: GPL-2.0
#ifndef YEARLYSTATISTICSWIDGET_H
#define YEARLYSTATISTICSWIDGET_H
#include <QGraphicsView>
class YearlyStatisticsModel;
class QModelIndex;
class YearlyStatisticsWidget : public QGraphicsView {
Q_OBJECT
public:
YearlyStatisticsWidget(QWidget *parent = 0);
void setModel(YearlyStatisticsModel *m);
protected:
void resizeEvent(QResizeEvent *event) override;
public slots:
void modelRowsInserted(const QModelIndex& index, int first, int last);
void modelDataChanged(const QModelIndex& topLeft, const QModelIndex& bottomRight);
private:
YearlyStatisticsModel *m_model;
};
#endif