Logo Search packages:      
Sourcecode: qtiplot version File versions  Download package

Matrix Class Reference

#include <Matrix.h>

Inheritance diagram for Matrix:

MyWidget scripted

List of all members.

Detailed Description

Matrix worksheet class.

Definition at line 56 of file Matrix.h.

Public Types

enum  CaptionPolicy { Name = 0, Label = 1, Both = 2 }
 Possible window captions. More...
enum  ColorMapType { GrayScale, Rainbow, Custom }
enum  HeaderViewType { ColumnRow, XY }
enum  Status { Hidden = -1, Normal = 0, Minimized = 1, Maximized = 2 }
enum  ViewType { TableView, ImageView }

Public Slots

static double ** allocateMatrixData (int rows, int columns)
 Allocate memory for a matrix buffer.
QwtDoubleRect boundingRect ()
 Returns the bounding rect of the matrix coordinates.
bool calculate (int startRow=0, int endRow=-1, int startCol=0, int endCol=-1)
 Calculate matrix values using the formula_str.
double cell (int row, int col)
 Return the value of the cell as a double.
void clearSelection ()
 Clear cells.
int columnsWidth ()
 Return the width of all columns.
void copy (Matrix *m)
void copySelection ()
 Standard copy operation.
void cutSelection ()
 Standard cut operation.
void deleteSelectedColumns ()
 Delte the selected columns.
void deleteSelectedRows ()
 Delete the selected rows.
double determinant ()
 Calculate the determinant of the matrix.
double dx ()
 Returns the step of the X axis.
double dy ()
 Returns the step of the Y axis.
void exportPDF (const QString &fileName)
QString formula ()
 Return the matrix formula.
static void freeMatrixData (double **data, int rows)
 Free memory used for a matrix buffer.
void goToRow (int row)
 Scroll to row (row starts with 1).
void insertColumn ()
 Insert a column before the current cell.
void insertRow ()
 Insert a row before the current cell.
void invert ()
 Invert the matrix.
int numSelectedColumns ()
 Return the number of selected columns.
int numSelectedRows ()
 Return the number of selected rows.
void pasteSelection ()
 Standard paste operation.
int precision ()
 Return the number precision digits.
void print (const QString &fileName)
 Print the Matrix to fileName.
void print ()
 Print the Matrix.
void range (double *min, double *max)
 Min and max values of the matrix.
void restore (const QStringList &l)
 Load the matrix from a string list (i.e. lines from a project file).
QString saveAsTemplate (const QString &info)
 Format the matrix format in a string to save it in a template file.
QString saveToString (const QString &info, bool saveAsTemplate=false)
 Return a string to save the matrix in a project file (<matrix> section).
void setCell (int row, int col, double value)
 Set the value of the cell.
void setColumnsWidth (int width)
 Set the width of all columns.
void setCoordinates (double xs, double xe, double ys, double ye)
 Set the X and Y coordinate intervals.
void setDimensions (int rows, int cols)
 Set the Matrix size.
void setFormula (const QString &s)
 Set the matrix forumla.
void setNumericFormat (const QChar &f, int prec)
void setNumericPrecision (int prec)
 Set the number of significant digits.
void setText (int row, int col, const QString &new_text)
 Set the content of the cell as a string.
void setTextFormat (const QChar &format, int precision)
 Set the number format for the cells.
QString text (int row, int col)
 Return the content of the cell as a string.
QChar textFormat ()
 Return the text format code ('e', 'f', ...).
void transpose ()
 Transpose the matrix.
int verticalHeaderWidth ()
double xEnd ()
 Returns the X value corresponding to the last column.
double xStart ()
 Returns the X value corresponding to column 1.
double yEnd ()
 Returns the Y value corresponding to the last row.
double yStart ()
 Returns the Y value corresponding to row 1.


void closedWindow (MyWidget *)
 Emitted when the window was closed.
void hiddenWindow (MyWidget *)
 Emitted when the window was hidden.
void modifiedWindow (QWidget *)
void moved ()
void resizedWindow (QWidget *)
void showContextMenu ()
 Show the context menu.
void showTitleBarMenu ()
 Emitted when the title bar recieves a QContextMenuEvent.
void statusChanged (MyWidget *)
 Emitted when the window status changed.

Public Member Functions

void askOnCloseEvent (bool ask)
 Toggle the "ask on close" flag.
QString aspect ()
 Return the window status as a string.
QString birthDate ()
 Return the creation date.
CaptionPolicy captionPolicy ()
 Return the caption policy.
void closeEvent (QCloseEvent *)
 Close event handler.
QwtLinearColorMap colorMap ()
ColorMapType colorMapType ()
void contextMenuEvent (QContextMenuEvent *e)
 Context menu event handler.
void customEvent (QEvent *e)
 Custom event handler.
bool eventFilter (QObject *object, QEvent *e)
 Event filter.
void exportRasterImage (const QString &fileName, int quality=100)
void exportSVG (const QString &fileName)
void exportToFile (const QString &fileName)
void exportVector (const QString &fileName, int res=0, bool color=true, bool keepAspect=true, QPrinter::PageSize pageSize=QPrinter::Custom)
void flipHorizontally ()
void flipVertically ()
Folderfolder ()
 Returns the pointer to the parent folder of the window.
HeaderViewType headerViewType ()
QImage image ()
void importImage (const QString &fn)
QLocale locale ()
 Matrix (ScriptingEnv *env, const QImage &image, const QString &label, QWidget *parent=0, const QString &name=QString(), Qt::WFlags f=0)
 Matrix (ScriptingEnv *env, int r, int c, const QString &label, QWidget *parent=0, const QString &name=QString(), Qt::WFlags f=0)
MatrixModel * matrixModel ()
void moveCell (const QModelIndex &index)
QString name ()
 Return the window name.
void notifyChanges ()
 Notifies the main application that the window has been modified.
int numCols ()
 Return the number of columns.
int numRows ()
 Return the number of rows.
void resetView ()
void resizeEvent (QResizeEvent *)
void rotate90 (bool clockwise=true)
void scriptingChangeEvent (ScriptingChangeEvent *)
QItemSelectionModel * selectionModel ()
void setBirthDate (const QString &s)
 Set the creation date.
void setCaptionPolicy (CaptionPolicy policy)
 Set the caption policy.
void setColorMap (const QStringList &lst)
 Used when restoring from project files.
void setColorMap (const QwtLinearColorMap &map)
void setColorMapType (ColorMapType mapType)
void setFolder (Folder *f)
 Initializes the pointer to the parent folder of the window.
void setGrayScale ()
void setHeaderViewType (HeaderViewType type)
virtual void setHidden ()
 Notifies that a window was hidden by a direct user action.
void setImage (const QImage &image)
void setLocale (const QLocale &l)
void setMaximized ()
void setMinimized ()
void setName (const QString &s)
 Set the window name.
void setNormal ()
void setNumCols (int cols)
void setNumRows (int rows)
void setRainbowColorMap ()
void setStatus (Status s)
 Set the window status flag (hidden, normal, minimized or maximized).
void setViewType (ViewType)
void setWindowLabel (const QString &s)
 Set the window label.
virtual QString sizeToString ()
 Size of the widget as a string.
Status status ()
 Return the window status flag (hidden, normal, minimized or maximized).
ViewType viewType ()
QString windowLabel ()
 Return the window label.

Protected Member Functions

virtual void changeEvent (QEvent *event)
 Catches parent changes (in order to gain access to the title bar).

Protected Attributes

QWidget * titleBar
 Title bar of this MDI window if it currently belongs to a QWorkspace, NULL else.

Private Member Functions

void initGlobals ()
void initImage (const QImage &image)
void initImageView ()
void initTable (int rows, int cols)
 Initialize the matrix.
void initTableView ()

Private Attributes

QwtLinearColorMap d_color_map
ColorMapType d_color_map_type
int d_column_width
 Column width in pixels;.
HeaderViewType d_header_view_type
 Keeps track of the header view type;.
MatrixModel * d_matrix_model
QShortcut * d_select_all_shortcut
QStackedWidget * d_stack
QTableView * d_table_view
 Pointer to the table view.
ViewType d_view_type
 Keeps track of the view type;.
QString formula_str
 Last formula used to calculate cell values.
QLabel * imageLabel
 Used to display the image view.
int num_precision
 Number of significant digits.
QChar txt_format
 Format code for displaying numbers.
double x_end
 X value corresponding to the last column.
double x_start
 X value corresponding to column 1.
double y_end
 Y value corresponding to the last row.
double y_start
 Y value corresponding to row 1.

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index