Matrix
A description for Matrix.
-
class Matrix : public AbstractDataSource
Public Functions
-
virtual QIcon icon() const override
Returns an icon to be used for decorating my views.
-
virtual QMenu *createContextMenu() override
Returns a new context menu. The caller takes ownership of the menu.
-
virtual QWidget *view() const override
Construct a primary view on me.
The caller receives ownership of the view.
This method may be called multiple times during the life time of a Part, or it might not get called at all. Parts must not depend on the existence of a view for their operation.
-
void setRowHeight(int row, int height)
This method should only be called by the view.
This method does not change the view, it only changes the values that are saved when the matrix is saved. The view has to take care of reading and applying these values
-
void setColumnWidth(int col, int width)
This method should only be called by the view.
This method does not change the view, it only changes the values that are saved when the matrix is saved. The view has to take care of reading and applying these values
-
template<typename T>
T cell(int row, int col) const Return the value in the given cell (needs explicit instantiation)
-
template<typename T>
QString text(int row, int col) Return the text displayed in the given cell (needs explicit instantiation)
-
template<typename T>
void setCell(int row, int col, T value) Set the value of the cell (needs explicit instantiation)
-
template<typename T>
QVector<T> columnCells(int col, int first_row, int last_row) Return the values in the given cells as vector.
-
template<typename T>
void setColumnCells(int col, int first_row, int last_row, const QVector<T> &values) Set the values in the given cells from a type T vector.
-
template<typename T>
QVector<T> rowCells(int row, int first_column, int last_column) Return the values in the given cells as vector (needs explicit instantiation)
-
template<typename T>
void setRowCells(int row, int first_column, int last_column, const QVector<T> &values) Set the values in the given cells from a type T vector.
-
virtual void save(QXmlStreamWriter*) const override
Save as XML.
-
virtual bool load(XmlStreamReader*, bool preview) override
Load from XML.
XmlStreamReader supports errors as well as warnings. If only warnings (non-critical errors) occur, this function must return the reader at the end element corresponding to the current element at the time the function was called.
This function is normally intended to be called directly after the ctor. If you want to call load on an aspect that has been altered, you must make sure beforehand that it is in the same state as after creation, e.g., remove all its child aspects.
- Returns:
false on error
Public Slots
-
void clear()
Clear the whole matrix (i.e. reset all cells)
-
virtual QIcon icon() const override