Skip to content

Commit

Permalink
Remove unnecessary comments from header files.
Browse files Browse the repository at this point in the history
  • Loading branch information
przemek83 committed Jan 14, 2025
1 parent 5c4ff86 commit 2736d16
Showing 14 changed files with 8 additions and 176 deletions.
19 changes: 2 additions & 17 deletions src/Import/ColumnsPreview.h
Original file line number Diff line number Diff line change
@@ -6,11 +6,8 @@

class Dataset;

/**
* @brief Columns preview widget.
* When set DatasetDefinition it displays first 10 (or less if dataset has less
* than 10) rows of data.
*/
/// @brief Columns preview widget.
/// Displays max 10 first rows of data.
class ColumnsPreview : public QTableWidget
{
Q_OBJECT
@@ -22,11 +19,6 @@ class ColumnsPreview : public QTableWidget
void clear();

public Q_SLOTS:
/**
* Triggered when currently selected column in related widget changed.
* Used to sync widgets displaying columns.
* @param column Currently selected column.
*/
void selectCurrentColumn(int column);

private:
@@ -35,15 +27,8 @@ public Q_SLOTS:
void setLabels(const std::unique_ptr<Dataset>& dataset);

private Q_SLOTS:
/**
* Triggered when selection in table changed.
*/
void onItemSelectionChanged();

Q_SIGNALS:
/**
* Emit when selected column was changed to sync widgets displaying columns.
* @param currentColumn Currently selected column.
*/
void currentColumnNeedSync(int currentColumn);
};
3 changes: 0 additions & 3 deletions src/Import/DatasetImportTab.h
Original file line number Diff line number Diff line change
@@ -6,9 +6,6 @@

class Dataset;

/**
*@brief Import tab for inner datasets.
*/
class DatasetImportTab : public ImportTab
{
Q_OBJECT
12 changes: 0 additions & 12 deletions src/Import/DatasetVisualization.h
Original file line number Diff line number Diff line change
@@ -12,9 +12,6 @@
class QTreeWidgetItem;
class QComboBox;

/**
* @brief Widget for visualization of dataset.
*/
class DatasetVisualization : public QWidget
{
Q_OBJECT
@@ -28,11 +25,6 @@ class DatasetVisualization : public QWidget
std::unique_ptr<Dataset> retrieveDataset();

public Q_SLOTS:
/**
* Triggered when currently selected column in linked widget changed.
* Used to sync widgets displaying columns.
* @param column Currently selected column.
*/
void selectCurrentColumn(int column);

private:
@@ -75,9 +67,5 @@ private Q_SLOTS:
void refreshColumnList(int newIndex);

Q_SIGNALS:
/**
* Emit when selected column was changed to sync linked widgets.
* @param currentColumn Currently selected column.
*/
void currentColumnNeedSync(int currentColumn);
};
3 changes: 0 additions & 3 deletions src/Import/DatasetsListBrowser.h
Original file line number Diff line number Diff line change
@@ -8,9 +8,6 @@

class QListWidgetItem;

/**
* @brief Widget for browsing list of actual datasets.
*/
class DatasetsListBrowser : public QWidget
{
Q_OBJECT
4 changes: 0 additions & 4 deletions src/Import/ImportData.h
Original file line number Diff line number Diff line change
@@ -9,10 +9,6 @@ class Dataset;
class QDialogButtonBox;
class QTabWidget;

/**
* @brief Main dialog for loading data into application.
* It consist QTabWidget with pages for each type of data.
*/
class ImportData : public QDialog
{
Q_OBJECT
3 changes: 0 additions & 3 deletions src/Import/ImportTab.h
Original file line number Diff line number Diff line change
@@ -8,9 +8,6 @@ class Dataset;
class ColumnsPreview;
class DatasetVisualization;

/**
* @brief Import tabs base class.
*/
class ImportTab : public QWidget
{
Q_OBJECT
3 changes: 0 additions & 3 deletions src/Import/SpreadsheetsImportTab.h
Original file line number Diff line number Diff line change
@@ -9,9 +9,6 @@
class DatasetSpreadsheet;
class QFileInfo;

/**
* @brief Ui class for importing spreadsheets.
*/
class SpreadsheetsImportTab : public ImportTab
{
Q_OBJECT
15 changes: 0 additions & 15 deletions src/ModelsAndViews/DataView.h
Original file line number Diff line number Diff line change
@@ -7,9 +7,6 @@
class TableModel;
class FilteringProxyModel;

/**
* @brief 2d view for data.
*/
class DataView : public QTableView
{
Q_OBJECT
@@ -20,16 +17,9 @@ class DataView : public QTableView

const PlotDataProvider& getPlotDataProvider() const;

/**
* @brief Recompute data using currently selected rows.
*/
void recomputeAllData();

public Q_SLOTS:
/**
* @brief Force recomputing of data because of grouping column changed.
* @param column New grouping column.
*/
void groupingColumnChanged(int column);

protected:
@@ -38,11 +28,6 @@ public Q_SLOTS:
void keyPressEvent(QKeyEvent* event) override;

private:
/**
* @brief Get data selected on view.
* @param groupByColumn Column used in grouping.
* @return Container of structures containing data, price and grouping data.
*/
QVector<TransactionData> fillDataFromSelection(int groupByColumn) const;

void initHorizontalHeader();
3 changes: 0 additions & 3 deletions src/ModelsAndViews/DateDelegate.h
Original file line number Diff line number Diff line change
@@ -2,9 +2,6 @@

#include <QStyledItemDelegate>

/**
* @brief Delegate for date type.
*/
class DateDelegate : public QStyledItemDelegate
{
Q_OBJECT
33 changes: 0 additions & 33 deletions src/ModelsAndViews/FilteringProxyModel.h
Original file line number Diff line number Diff line change
@@ -4,51 +4,21 @@

class TableModel;

/**
* @brief Filtering model for 2d data.
*/
class FilteringProxyModel : public QSortFilterProxyModel
{
Q_OBJECT
public:
explicit FilteringProxyModel(QObject* parent = nullptr);

/**
* @brief get pointer to parent model.
* @return parent parent model.
*/
const TableModel* getParentModel() const;

/**
* @brief set filter for string column.
* @param column column number to set filter.
* @param bannedStrings list of strings to filter.
*/
void setStringFilter(int column, const QStringList& bannedStrings);

/**
* @brief set filter for date column.
* @param column column number to set filter.
* @param from filter from date.
* @param to filter to date.
*/
void setDateFilter(int column, QDate from, QDate to, bool filterEmptyDates);

/**
* @brief set filter for numeric column.
* @param column column number to set filter.
* @param from filter from value.
* @param to filter to value.
*/
void setNumericFilter(int column, double from, double to);

protected:
/**
* @brief Determine if row should be shown or not.
* @param sourceRow row to check.
* @param sourceParent index to check.
* @return filter row (true), show row (false).
*/
bool filterAcceptsRow(int sourceRow,
const QModelIndex& sourceParent) const override;

@@ -62,12 +32,9 @@ class FilteringProxyModel : public QSortFilterProxyModel
bool acceptRowAccordingToNumericRestrictions(
int sourceRow, const QModelIndex& sourceParent) const;

/// Filter set for strings.
std::map<int, QStringList> stringsRestrictions_;

/// Filter set for dates.
std::map<int, std::tuple<QDate, QDate, bool> > datesRestrictions_;

/// Filter set for numeric.
std::map<int, std::pair<double, double> > numericRestrictions_;
};
3 changes: 0 additions & 3 deletions src/ModelsAndViews/NumericDelegate.h
Original file line number Diff line number Diff line change
@@ -2,9 +2,6 @@

#include <QStyledItemDelegate>

/**
* @brief Delegate for numeric type.
*/
class NumericDelegate : public QStyledItemDelegate
{
Q_OBJECT
22 changes: 2 additions & 20 deletions src/ModelsAndViews/PlotDataProvider.h
Original file line number Diff line number Diff line change
@@ -6,28 +6,15 @@

#include "TransactionData.h"

/**
* @brief class used for computation of values for all plots.
*/
class PlotDataProvider : public QObject
{
Q_OBJECT
public:
explicit PlotDataProvider(QObject* parent = nullptr);

/**
* @brief reCompute all data for plots.
* @param newCalcData new data used for computations.
* @param columnFormat format of grouping column.
*/
void recompute(QVector<TransactionData> newCalcData,
ColumnType columnFormat);

/**
* @brief recompute data for grouping plot.
* @param calcData new data used for calculations.
* @param columnFormat format of grouping column.
*/
void recomputeGroupingData(QVector<TransactionData> calcData,
ColumnType columnFormat);

@@ -42,16 +29,11 @@ class PlotDataProvider : public QObject
void fundamentalDataChanged(QVector<double> data, Quantiles quantiles);

private:
/**
* @brief Groups strings and for each group calculate quantiles and names.
* @param calcData Data used for calculations.
*/
/// Groups strings and for each group calculate quantiles and names.
static std::tuple<QVector<QString>, QVector<Quantiles>>
fillDataForStringGrouping(const QVector<TransactionData>& calcData);

/**
* @brief compute data used for simple plots (histogram and basic plots).
*/
/// Compute data used for simple plots (histogram and basic plots).
std::tuple<QVector<QPointF>, QVector<QPointF>> computePointsAndRegression();

static Quantiles computeQuantiles(
58 changes: 4 additions & 54 deletions src/ModelsAndViews/TableModel.h
Original file line number Diff line number Diff line change
@@ -7,87 +7,37 @@

#include "Dataset.h"

/**
* @brief 2d data model.
*/
class TableModel : public QAbstractTableModel
{
Q_OBJECT
public:
explicit TableModel(std::unique_ptr<Dataset> dataset,
QObject* parent = nullptr);

/**
* @brief Overridden method for row count check.
* @return row count.
*/
int rowCount(const QModelIndex& parent = QModelIndex()) const override;

/**
* @brief Override method for column count check.
* @return column count.
*/
int columnCount(const QModelIndex& parent = QModelIndex()) const override;

/**
* @brief Overridden method returning data from model for given index.
* @param index index used to retrieve data.
* @return data.
*/
QVariant data(const QModelIndex& index,
int role = Qt::DisplayRole) const override;

/**
* @brief Overridden method returning data used for column header.
* @param section column.
* @param orientation orientation (vertical or horizontal).
* @param role role of returned data.
* @return data.
*/
QVariant headerData(int section, Qt::Orientation orientation,
int role = Qt::DisplayRole) const override;

/**
* @brief fill max and min for given numeric column.
* @param column Column number.
* @returns Minimum for column,
* maximum cor column.
*/
std::tuple<double, double> getNumericRange(int column) const;

/**
* @brief Fill max and min for given date column.
* @param column Column number.
* @returns minimum date for column,
* maximum date for column,
* existence of empty dates in column.
*/
/// @brief Fill max and min for given date column.
/// @param column Column number.
/// @returns minimum date for column, maximum date for column, existence of
/// empty dates in column.
std::tuple<QDate, QDate, bool> getDateRange(int column) const;

/**
* @brief set possible string values for column.
* @param column Column number.
* @return List of strings.
*/
QStringList getStringList(int column) const;

/**
* @brief get type of given column.
* @return data format of given column.
*/
ColumnType getColumnFormat(int column) const;

/**
* @brief get tagged column if exist (date, value).
* @param columnTag searched column tag.
* @return true if found (column number in int passed as ref.).
*/
std::tuple<bool, int> getTaggedColumnIfExists(ColumnTag columnTag) const;

/**
* @brief get dataset used in model.
* @return dataset definition pointer.
*/
QByteArray definitionToXml(unsigned int rowCount) const;

bool areTaggedColumnsSet() const;
3 changes: 0 additions & 3 deletions src/ModelsAndViews/TransactionData.h
Original file line number Diff line number Diff line change
@@ -4,9 +4,6 @@
#include <QMetaType>
#include <QVariant>

/**
* @brief Struct used for computation. 3 related values needed.
*/
struct TransactionData
{
public:

0 comments on commit 2736d16

Please sign in to comment.