Ejemplo n.º 1
0
void Matrix::restore(const QStringList &lst)
{
QStringList l;
QStringList::const_iterator i=lst.begin();

l= QStringList::split ("\t", *i++, true);
setColumnsWidth(l[1].toInt());

l= QStringList::split ("\t", *i++, true);
if (l[0] == "Formula")
  formula_str = l[1];
else if (l[0] == "<formula>")
{
  for (formula_str=""; i != lst.end() && *i != "</formula>"; i++)
    formula_str += *i + "\n";
  formula_str.truncate(formula_str.length()-1);
  i++;
}

l= QStringList::split ("\t", *i++, true);
if (l[1] == "f")
	setTextFormat('f', l[2].toInt());
else
	setTextFormat('e', l[2].toInt());

l= QStringList::split ("\t", *i++, true);
x_start = l[1].toDouble();
x_end = l[2].toDouble();
y_start = l[3].toDouble();
y_end = l[4].toDouble();
}
Ejemplo n.º 2
0
void Matrix::restore(const QStringList &lst)
{
	QStringList l;
	QStringList::const_iterator i = lst.begin();

	l = (*i++).split("\t");
	setColumnsWidth(l[1].toInt());

	l = (*i++).split("\t");
	if (l[0] == "Formula")
		formula_str = l[1];
	else if (l[0] == "<formula>"){
		for(formula_str=""; i != lst.end() && *i != "</formula>"; i++)
			formula_str += *i + "\n";
		formula_str.truncate(formula_str.length()-1);
		i++;
	}

	l = (*i++).split("\t");
	if (l[1] == "f")
		setTextFormat('f', l[2].toInt());
	else
		setTextFormat('e', l[2].toInt());

	l = (*i++).split("\t");
	x_start = l[1].toDouble();
	x_end = l[2].toDouble();
	y_start = l[3].toDouble();
	y_end = l[4].toDouble();

	l = (*i++).split("\t");
	d_view_type = (Matrix::ViewType)l[1].toInt();
	l = (*i++).split("\t");
	d_header_view_type = (Matrix::HeaderViewType)l[1].toInt();
	l = (*i++).split("\t");
	d_color_map_type = (Matrix::ColorMapType)l[1].toInt();

    if (lst.contains ("<ColorMap>")){
        QStringList aux;
        while (*i != "</ColorMap>"){
            aux << *i;
            i++;
        }
        setColorMap(aux);
    }

    if (d_view_type == ImageView){
	    if (d_table_view)
            delete d_table_view;
        if (d_select_all_shortcut)
            delete d_select_all_shortcut;
	    initImageView();
		d_stack->setCurrentWidget(imageLabel);
		if (d_color_map_type == Rainbow)
            setRainbowColorMap();
	}
    resetView();
}
Ejemplo n.º 3
0
void Matrix::copy(Matrix *m)
{
	if (!m)
        return;

    MatrixModel *mModel = m->matrixModel();
	if (!mModel)
		return;

	x_start = m->xStart();
	x_end = m->xEnd();
	y_start = m->yStart();
	y_end = m->yEnd();

	int rows = numRows();
	int cols = numCols();

    txt_format = m->textFormat();
	num_precision = m->precision();

    double *data = d_matrix_model->dataVector();
    double *m_data = mModel->dataVector();
    int size = rows*cols;
    for (int i=0; i<size; i++)
        data[i] = m_data[i];

	d_header_view_type = m->headerViewType();
    d_view_type = m->viewType();
	setColumnsWidth(m->columnsWidth());
	formula_str = m->formula();
    d_color_map_type = m->colorMapType();
    d_color_map = m->colorMap();

    if (d_view_type == ImageView){
	    if (d_table_view)
            delete d_table_view;
        if (d_select_all_shortcut)
            delete d_select_all_shortcut;
	    initImageView();
		d_stack->setCurrentWidget(imageLabel);
	}
	resetView();
}
Ejemplo n.º 4
0
void View::Invoicing::OperationTable::setModel(View::Invoicing::OperationModel *model)
{
    QTableView::setModel(model);
    setColumnsWidth();
}