50 Q_PROPERTY(QSharedPointer<ito::DataObject> data READ getData WRITE setData DESIGNABLE
false);
51 Q_PROPERTY(
bool readOnly READ getReadOnly WRITE setReadOnly DESIGNABLE
true);
52 Q_PROPERTY(
double min READ getMin WRITE setMin DESIGNABLE
true);
53 Q_PROPERTY(
double max READ getMax WRITE setMax DESIGNABLE
true);
54 Q_PROPERTY(
int decimals READ getDecimals WRITE setDecimals DESIGNABLE
true);
55 Q_PROPERTY(
int editorDecimals READ getEditorDecimals WRITE setEditorDecimals DESIGNABLE
true);
56 Q_PROPERTY(
int defaultCols READ getDefaultCols WRITE setDefaultCols DESIGNABLE
true);
57 Q_PROPERTY(
int defaultRows READ getDefaultRows WRITE setDefaultRows DESIGNABLE
true);
58 Q_PROPERTY(QStringList horizontalLabels READ getHorizontalLabels WRITE setHorizontalLabels DESIGNABLE
true);
59 Q_PROPERTY(QStringList verticalLabels READ getVerticalLabels WRITE setVerticalLabels DESIGNABLE
true);
60 Q_PROPERTY(QStringList suffixes READ getSuffixes WRITE setSuffixes DESIGNABLE
true);
61 Q_PROPERTY(QHeaderView::ResizeMode horizontalResizeMode READ getHorizontalResizeMode WRITE setHorizontalResizeMode DESIGNABLE
true);
62 Q_PROPERTY(QHeaderView::ResizeMode verticalResizeMode READ getVerticalResizeMode WRITE setVerticalResizeMode DESIGNABLE
true);
63 Q_PROPERTY(Qt::Alignment alignment READ getAlignment WRITE setAlignment DESIGNABLE
true);
64 Q_PROPERTY(NumberFormat numberFormat READ getNumberFormat WRITE setNumberFormat DESIGNABLE
true);
67 Q_CLASSINFO(
"prop://data",
"dataObject that is displaye in the table view");
68 Q_CLASSINFO(
"prop://readOnly",
"enable write protection");
69 Q_CLASSINFO(
"prop://min",
"minimum acceptable value (if editing is allowed)");
70 Q_CLASSINFO(
"prop://max",
"maximum acceptable value (if editing is allowed)");
71 Q_CLASSINFO(
"prop://decimals",
"number of visible decimals for floating point numbers");
72 Q_CLASSINFO(
"prop://editorDecimals",
"number of possible decimals during the edit of floating point numbers");
73 Q_CLASSINFO(
"prop://defaultCols",
"number of column to be shown");
74 Q_CLASSINFO(
"prop://defaultRows",
"number of rows to be shown");
75 Q_CLASSINFO(
"prop://horizontalLabels",
"list with labels for each shown column (if more columns are shown than labels, a default numbering is used for additional columns)");
76 Q_CLASSINFO(
"prop://verticalLabels",
"list with labels for each shown row (if more rows are shown than labels, a default numbering is used for additional rows)");
77 Q_CLASSINFO(
"prop://suffixes",
"list with suffixes for each column. If less suffixes than columns are indicated, the last suffix is repeated.");
78 Q_CLASSINFO(
"prop://horizontalResizeMode",
"defines the mode how the rows can be resized or are stretched over the available space (ResizeToContents, Interactive, Stretch, Fixed, Custom -> see QHeaderView::ResizeMode).");
79 Q_CLASSINFO(
"prop://verticalResizeMode",
"defines the mode how the columns can be resized or are stretched over the available space (ResizeToContents, Interactive, Stretch, Fixed, Custom -> see QHeaderView::ResizeMode).");
80 Q_CLASSINFO(
"prop://alignment",
"alignment of the text cells.");
81 Q_CLASSINFO(
"prop://numberFormat",
"number format notation for floating point numbers, e.g. 0.002 or 2e-3. The meaning of ``decimals`` depends on this property.")
83 Q_CLASSINFO(
"signal://activated",
"signal emitted if a cell is activated. Arguments are (row,column) of the cell.")
84 Q_CLASSINFO(
"signal://clicked",
"signal emitted if a cell is clicked by the mouse. Arguments are (row,column) of the cell.")
85 Q_CLASSINFO(
"signal://doubleClicked",
"signal emitted if a cell is double clicked by the mouse. Arguments are (row,column) of the cell.")
86 Q_CLASSINFO(
"signal://entered",
"signal emitted if a cell is entered by the mouse cursor. Arguments are (row,column) of the cell. Property 'mouseTracking' needs to be enabled for this feature to work.")
87 Q_CLASSINFO(
"signal://pressed",
"signal emitted if a cell if the mouse is pressed on a cell. Arguments are (row,column) of the cell.")
90 enum NumberFormat { Standard = 0, Scientific = 1, Auto = 2 };
93 enum HeatmapType { Off = 0, RealColor = 1, RedYellowGreen = 2, GreenYellowRed = 3, RedWhiteGreen = 4, GreenWhiteRed = 5 };
99 void setData(QSharedPointer<ito::DataObject> dataObj);
100 QSharedPointer<ito::DataObject> getData()
const;
102 bool getReadOnly()
const;
103 void setReadOnly(
bool value);
105 double getMin()
const;
106 void setMin(
double value);
108 double getMax()
const;
109 void setMax(
double value);
111 int getDecimals()
const;
112 void setDecimals(
int value);
114 void setNumberFormat(
const NumberFormat& format);
115 NumberFormat getNumberFormat()
const;
117 Qt::Alignment getAlignment()
const;
118 void setAlignment(Qt::Alignment alignment);
120 int getEditorDecimals()
const;
121 void setEditorDecimals(
int value);
123 QHeaderView::ResizeMode getHorizontalResizeMode()
const;
124 void setHorizontalResizeMode(QHeaderView::ResizeMode mode);
126 QHeaderView::ResizeMode getVerticalResizeMode()
const;
127 void setVerticalResizeMode(QHeaderView::ResizeMode mode);
129 int getDefaultCols()
const;
130 void setDefaultCols(
int value);
132 int getDefaultRows()
const;
133 void setDefaultRows(
int value);
135 QStringList getVerticalLabels()
const;
136 void setVerticalLabels(QStringList value);
138 QStringList getHorizontalLabels()
const;
139 void setHorizontalLabels(QStringList value);
141 QStringList getSuffixes()
const;
142 void setSuffixes(QStringList value);
144 virtual QSize sizeHint()
const;
151 void createActions();
152 void restoreSelection(
const QModelIndexList &indices);
154 void keyPressEvent(QKeyEvent *e);
155 void contextMenuEvent(QContextMenuEvent *event);
157 virtual void selectionChanged(
const QItemSelection& selected,
const QItemSelection& deselected);
163 static QHash<DataObjectTable*, DataObjectTablePrivate*>
PrivateHash;
166 inline void _activated (
const QModelIndex &index) { emit activated(index.row(), index.column()); }
167 inline void _clicked (
const QModelIndex &index) { emit clicked(index.row(), index.column()); }
168 inline void _doubleClicked (
const QModelIndex &index) { emit doubleClicked(index.row(), index.column()); }
169 inline void _entered (
const QModelIndex &index) { emit entered(index.row(), index.column()); }
170 inline void _pressed (
const QModelIndex &index) { emit pressed(index.row(), index.column()); }
171 void copySelectionToClipboard();
172 void saveSelectionToCSV();
173 void setDecimalsGUI();
174 void configureHeatmap();
175 void numberFormatTriggered(QAction *a);
176 void heatmapTriggered(QAction *a);
179 void activated (
int row,
int column);
180 void clicked (
int row,
int column);
181 void doubleClicked (
int row,
int column);
182 void entered (
int row,
int column);
183 void pressed (
int row,
int column);
184 void selectionInformationChanged(
const QString &selectionInformation);