本文整理汇总了C++中QTextStream::string方法的典型用法代码示例。如果您正苦于以下问题:C++ QTextStream::string方法的具体用法?C++ QTextStream::string怎么用?C++ QTextStream::string使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QTextStream
的用法示例。
在下文中一共展示了QTextStream::string方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: log
void Logger::log(LogLevelEnum l, QTextStream& os) const
{
QTextStream qout(stdout);
qout << "[" << logLevelEnumToString(l) << "]" << " " << *os.string();
*str_ = "";
qout.flush();
}
示例2: outputXThetaYRadiusValues
void ExportFileFunctions::outputXThetaYRadiusValues (const DocumentModelExportFormat &modelExportOverride,
const DocumentModelCoords &modelCoords,
const MainWindowModel &modelMainWindow,
const QStringList &curvesIncluded,
const ExportValuesXOrY &xThetaValuesMerged,
const Transformation &transformation,
QVector<QVector<QString*> > &yRadiusValues,
const QString &delimiter,
QTextStream &str) const
{
LOG4CPP_INFO_S ((*mainCat)) << "ExportFileFunctions::outputXThetaYRadiusValues";
// Header
if (modelExportOverride.header() != EXPORT_HEADER_NONE) {
if (modelExportOverride.header() == EXPORT_HEADER_GNUPLOT) {
str << curveSeparator (str.string());
str << gnuplotComment();
}
str << modelExportOverride.xLabel();
QStringList::const_iterator itrHeader;
for (itrHeader = curvesIncluded.begin(); itrHeader != curvesIncluded.end(); itrHeader++) {
QString curveName = *itrHeader;
str << delimiter << curveName;
}
str << "\n";
}
FormatCoordsUnits format;
const double DUMMY_Y_RADIUS = 1.0;
for (int row = 0; row < xThetaValuesMerged.count(); row++) {
if (rowHasAtLeastOneYRadiusEntry (yRadiusValues,
row)) {
double xTheta = xThetaValuesMerged.at (row);
// Output x/theta value for this row
QString xThetaString, yRadiusString;
format.unformattedToFormatted (xTheta,
DUMMY_Y_RADIUS,
modelCoords,
modelMainWindow,
xThetaString,
yRadiusString,
transformation);
str << xThetaString;
for (int col = 0; col < yRadiusValues.count(); col++) {
str << delimiter << *(yRadiusValues [col] [row]);
}
str << "\n";
}
}
}
示例3:
SdfRenderer::SdfRenderer(const QDomNode &bla)
{
toGen.setString(&toGenerator, QIODevice::ReadWrite);
QTextStream str;
QString tr;
str.setString(&tr,QIODevice::ReadWrite);
str << bla;
doc.setContent(*(str.string()));
QDomElement docElem = doc.documentElement();
first_size_x = docElem.attribute("sizex").toInt();
first_size_y = docElem.attribute("sizey").toInt();
}
示例4: outputXThetaYRadiusValues
void ExportFileRelations::outputXThetaYRadiusValues (const DocumentModelExportFormat &modelExportOverride,
const QStringList &curvesIncluded,
QVector<QVector<QString*> > &xThetaYRadiusValues,
const QString &delimiter,
QTextStream &str) const
{
LOG4CPP_INFO_S ((*mainCat)) << "ExportFileRelations::outputXThetaYRadiusValues";
// Header
if (modelExportOverride.header() != EXPORT_HEADER_NONE) {
if (modelExportOverride.header() == EXPORT_HEADER_GNUPLOT) {
str << curveSeparator(str.string());
str << gnuplotComment();
}
QString delimiterForRow;
QStringList::const_iterator itr;
for (itr = curvesIncluded.begin(); itr != curvesIncluded.end(); itr++) {
QString curveName = *itr;
str << delimiterForRow << modelExportOverride.xLabel();
delimiterForRow = delimiter;
str << delimiterForRow << curveName;
}
str << "\n";
}
for (int row = 0; row < xThetaYRadiusValues [0].count(); row++) {
QString delimiterForRow;
for (int col = 0; col < xThetaYRadiusValues.count(); col++) {
str << delimiterForRow << *(xThetaYRadiusValues [col] [row]);
delimiterForRow = delimiter;
}
str << "\n";
}
}