1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108
|
/**
*
* This file is part of Tulip (https://tulip.labri.fr)
*
* Authors: David Auber and the Tulip development Team
* from LaBRI, University of Bordeaux
*
* Tulip is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation, either version 3
* of the License, or (at your option) any later version.
*
* Tulip is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
*/
#ifndef TABLEVIEW_H
#define TABLEVIEW_H
#include <tulip/ViewWidget.h>
#include <tulip/BooleanProperty.h>
#include <QModelIndex>
namespace Ui {
class TableViewWidget;
}
namespace tlp {
class GraphModel;
}
class TableViewConfiguration;
class PropertiesEditor;
class TableView : public tlp::ViewWidget {
Q_OBJECT
Ui::TableViewWidget *_ui;
PropertiesEditor *propertiesEditor;
tlp::GraphModel *_model;
bool isNewGraph;
bool filteringColumns;
tlp::Graph *previousGraph;
int minFontSize;
QString settingsButtonIconName;
public:
PLUGININFORMATION("Spreadsheet view", "Tulip Team", "04/17/2012", "Spreadsheet view for raw data",
"4.0", "")
TableView(tlp::PluginContext *);
~TableView() override;
std::string icon() const override {
return ":/spreadsheet_view.png";
}
tlp::DataSet state() const override;
void setState(const tlp::DataSet &) override;
void setupWidget() override;
std::list<QWidget *> configurationWidgets() const override;
bool getNodeOrEdgeAtViewportPos(int x, int y, tlp::node &n, tlp::edge &e) const override;
// Qt bug workaround
// see void WorkspacePanel::showEvent(QShowEvent *event);
#if defined(__APPLE__)
bool rebuildSceneOnShowEvent() override {
return true;
}
#endif
public slots:
void readSettings();
void setPropertyVisible(tlp::PropertyInterface *, bool);
void filterChanged();
tlp::BooleanProperty *getFilteringProperty() const;
bool hasEffectiveFiltering();
protected:
void graphChanged(tlp::Graph *) override;
void graphDeleted(tlp::Graph *) override;
bool eventFilter(QObject *obj, QEvent *event) override;
protected slots:
void delHighlightedRows();
void toggleHighlightedRows();
void selectHighlightedRows();
bool setAllHighlightedRows(tlp::PropertyInterface *);
bool setCurrentValue(tlp::PropertyInterface *, unsigned int);
void setLabelsOfHighlightedRows(tlp::PropertyInterface *);
void clearValueMatchFilter();
void clearColumnMatchFilter();
void setMatchProperty();
void setColumnsFilter();
void setColumnsFilterCase();
void setPropertiesFilter(const QString &);
void mapToGraphSelection();
void columnsInserted(const QModelIndex &, int, int);
void showCustomContextMenu(const QPoint &pos);
void showHorizontalHeaderCustomContextMenu(const QPoint &pos);
void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight);
void setZoomLevel(int);
void showHideTableSettings();
};
#endif // TABLEVIEW_H
|