当前位置: 首页>>代码示例>>C++>>正文


C++ Column::setSuppressDataChangedSignal方法代码示例

本文整理汇总了C++中Column::setSuppressDataChangedSignal方法的典型用法代码示例。如果您正苦于以下问题:C++ Column::setSuppressDataChangedSignal方法的具体用法?C++ Column::setSuppressDataChangedSignal怎么用?C++ Column::setSuppressDataChangedSignal使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Column的用法示例。


在下文中一共展示了Column::setSuppressDataChangedSignal方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: readData


//.........这里部分代码省略.........
	int currentRow=0; //indexes the position in the vector(column)
	int columnOffset=0; //indexes the "start column" in the spreadsheet. Starting from this column the data will be imported.
	//pointers to the actual data containers
	QVector<QVector<double>*> dataPointers;

	if(dataSource != NULL)
		columnOffset = dataSource->create(dataPointers, mode, actualRows, actualCols, vectorNameList);

	//header: import the values in the first line, if they were not used as the header (as the names for the columns)
	bool isNumber;
	if (!headerEnabled){
		for ( int n=0; n<actualCols; n++ ){
			if (n<lineStringList.size()) {
				const double value = lineStringList.at(n).toDouble(&isNumber);
				if (dataSource != NULL)
					isNumber ? dataPointers[n]->operator[](0) = value : dataPointers[n]->operator[](0) = NAN;
				else
					isNumber ? dataString<<QString::number(value)<<" " : dataString<<QLatin1String("NAN ");
			} else {
				if (dataSource != NULL)
					dataPointers[n]->operator[](0) = NAN;
				else
					dataString<<QLatin1String("NAN ");
			}
		}
		dataString<<"\n";
		currentRow++;
	}

	//Read the remainder of the file.
	for (int i=currentRow; i<qMin(lines,actualRows); i++){
		line = in.readLine();

		if(simplifyWhitespacesEnabled)
			line = line.simplified();

		//skip empty lines
		if (line.isEmpty())
			continue;

		if( line.startsWith(commentCharacter) == true ){
			currentRow++;
			continue;
		}

		lineStringList = line.split( separator, QString::SplitBehavior(skipEmptyParts) );

		// TODO : read strings (comments) or datetime too
		for ( int n=0; n<actualCols; n++ ){
			if (n<lineStringList.size()) {
				const double value = lineStringList.at(n).toDouble(&isNumber);
				if (dataSource != NULL)
					isNumber ? dataPointers[n]->operator[](currentRow) = value : dataPointers[n]->operator[](currentRow) = NAN;
				else
					isNumber ? dataString<<QString::number(value)<<" " : dataString<<QString("NAN ");
			} else {
				if (dataSource != NULL)
					dataPointers[n]->operator[](currentRow) = NAN;
				else
					dataString<<QLatin1String("NAN ");
			}
		}

		dataString<<"\n";
		currentRow++;
		emit q->completed(100*currentRow/actualRows);
	}

	if (!dataSource)
		return dataString.join("");

	//make everything undo/redo-able again
	//set the comments for each of the columns
	Spreadsheet* spreadsheet = dynamic_cast<Spreadsheet*>(dataSource);
	if (spreadsheet) {
		//TODO: generalize to different data types
		QString comment = i18np("numerical data, %1 element", "numerical data, %1 elements", headerEnabled ? currentRow : currentRow+1);
		for ( int n=startColumn; n<=endColumn; n++ ){
			Column* column = spreadsheet->column(columnOffset+n-startColumn);
			column->setComment(comment);
			column->setUndoAware(true);
			if (mode==AbstractFileFilter::Replace) {
				column->setSuppressDataChangedSignal(false);
				column->setChanged();
			}
		}
		spreadsheet->setUndoAware(true);
		return dataString.join("");
	}


	Matrix* matrix = dynamic_cast<Matrix*>(dataSource);
	if (matrix) {
		matrix->setSuppressDataChangedSignal(false);
		matrix->setChanged();
		matrix->setUndoAware(true);
	}

	return dataString.join("");
}
开发者ID:prakritibhrdwj,项目名称:labplot,代码行数:101,代码来源:AsciiFilter.cpp

示例2: readData


//.........这里部分代码省略.........
			case BinaryFilter::INT64: {
				qint64 value;
				in >> value;
				if (dataSource != NULL)
					dataPointers[n]->operator[](i) = value;
				else
					dataString<<QString::number(value)<<" ";
				break;
			}
			case BinaryFilter::UINT8: {
				quint8 value;
				in >> value;
				if (dataSource != NULL)
					dataPointers[n]->operator[](i) = value;
				else
					dataString<<QString::number(value)<<" ";
				break;
			}
			case BinaryFilter::UINT16: {
				quint16 value;
				in >> value;
				if (dataSource != NULL)
					dataPointers[n]->operator[](i) = value;
				else
					dataString<<QString::number(value)<<" ";
				break;
			}
			case BinaryFilter::UINT32: {
				quint32 value;
				in >> value;
				if (dataSource != NULL)
					dataPointers[n]->operator[](i) = value;
				else
					dataString<<QString::number(value)<<" ";
				break;
			}
			case BinaryFilter::UINT64: {
				quint64 value;
				in >> value;
				if (dataSource != NULL)
					dataPointers[n]->operator[](i) = value;
				else
					dataString<<QString::number(value)<<" ";
				break;
			}
			case BinaryFilter::REAL32: {
				float value;
				in >> value;
				if (dataSource != NULL)
					dataPointers[n]->operator[](i) = value;
				else
					dataString<<QString::number(value)<<" ";
				break;
			}
			case BinaryFilter::REAL64: {
				double value;
				in >> value;
				if (dataSource != NULL)
					dataPointers[n]->operator[](i) = value;
				else
					dataString<<QString::number(value)<<" ";
				break;
			}
			}
		}
		dataString<<"\n";
		emit q->completed(100*i/actualRows);
	}

	if (!dataSource)
		return dataString.join("");

	//make everything undo/redo-able again
	//set the comments for each of the columns
	Spreadsheet* spreadsheet = dynamic_cast<Spreadsheet*>(dataSource);
	if (spreadsheet) {
		Spreadsheet* spreadsheet = dynamic_cast<Spreadsheet*>(dataSource);
		QString comment = i18np("numerical data, %1 element", "numerical data, %1 elements", actualRows);
		for ( int n=0; n<actualCols; n++ ){
			Column* column = spreadsheet->column(columnOffset+n);
			column->setComment(comment);
			column->setUndoAware(true);
			if (mode==AbstractFileFilter::Replace) {
				column->setSuppressDataChangedSignal(false);
				column->setChanged();
			}
		}
		spreadsheet->setUndoAware(true);
		return dataString.join("");
	}

	Matrix* matrix = dynamic_cast<Matrix*>(dataSource);
	if (matrix) {
		matrix->setSuppressDataChangedSignal(false);
		matrix->setChanged();
		matrix->setUndoAware(true);
	}

	return dataString.join("");
}
开发者ID:asemke,项目名称:labplot,代码行数:101,代码来源:BinaryFilter.cpp


注:本文中的Column::setSuppressDataChangedSignal方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。