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


C++ QTextStream::setFieldWidth方法代码示例

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


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

示例1:

/*!
* Rem: "field001size" is field size including Terminator (FT)
* Writes the recId and the FT (Field Terminator)
* Returns pointer to first Byte after leader
***************************************************************************** */
void ISO8211::write0001fieldASC(QTextStream & iso8211strm, unsigned int iso8211rcid, unsigned int field001size) 
{
    iso8211strm.setFieldWidth(field001size -1);
    iso8211strm.setPadChar(QChar('0'));
    iso8211strm << iso8211rcid;
    iso8211strm.setFieldWidth(0);
    iso8211strm.setPadChar(QChar(' '));
    iso8211strm <<  ISO8211::FT;
}
开发者ID:KaiAbuSir,项目名称:EncLib,代码行数:14,代码来源:iso8211_simple.cpp

示例2: printOptions

static void printOptions(QTextStream& s, const QMap<QString, QString>& options) {
    QMap<QString, QString>::const_iterator it = options.constBegin();
    s.setFieldAlignment(QTextStream::AlignLeft);
    for (; it != options.constEnd(); ++it) {
        s << "  --";
        s.setFieldWidth(38);
        s << it.key() << it.value();
        s.setFieldWidth(0);
        s << endl;
    }
}
开发者ID:OdyX,项目名称:Generatorrunner,代码行数:11,代码来源:main.cpp

示例3: startComment

void ConsoleOutput::startComment(QTextStream &out,AnsiColor color){
  out.setFieldWidth(indent);
  out.setFieldAlignment(QTextStream::AlignRight);
  out << " ";
  out.setFieldWidth(0);
#ifndef _WIN32
  out << "\033[0;" << color << "m";
#endif
  out.setFieldAlignment(QTextStream::AlignLeft);
  out.setFieldWidth(20);
  out.setPadChar(' ');
}
开发者ID:wulffern,项目名称:ciccreator,代码行数:12,代码来源:consoleoutput.cpp

示例4: hexDump

void QWSHexDump::hexDump()
{
    *outstrm << '(' << dataSize << " bytes):\n" << prefix;
    sprintf(sideviewLayout, " [%%-%us]", wrap);
    dataWidth = (2 * wrap) + (wrap / clustering);

    dirty = false;
    uint wrapIndex = 0;
    for (uint i = 0; i < dataSize; i++) {
        uint c = static_cast<uchar>(data[i]);
        sideview[wrapIndex = i%wrap] = isprint(c) ? c : '.';

        if (wrapIndex && (wrapIndex % clustering == 0))
            *outstrm << ' ';

        outstrm->setFieldWidth(2);
        outstrm->setPadChar('0');
        outstrm->setNumberFlags( QTextStream::ShowBase );
        *outstrm << hex << c;
        dirty = true;

        if (wrapIndex == wrap-1) {
            sideviewDump(wrapIndex);
            wrapIndex = 0;
            if (i+1 < dataSize)
                *outstrm << endl << prefix;
        }

    }
    sideviewDump(wrapIndex);
}
开发者ID:wpbest,项目名称:copperspice,代码行数:31,代码来源:qwscommand_qws.cpp

示例5: endComment

void ConsoleOutput::endComment(QTextStream &out){
  out.setFieldWidth(1);
#ifndef _WIN32
  out << "\033[0m" ;
#endif
  out << endl;
}
开发者ID:wulffern,项目名称:ciccreator,代码行数:7,代码来源:consoleoutput.cpp

示例6: WriteData

// Write data + helpers
void FormattedTouchstone::WriteData(FormattedNetworkData &network, QTextStream &snpFile) {
    // Choose data format
    GetWriteFormat(network);

    snpFile.setRealNumberPrecision(PRECISION);
    for (uint currentFreq = 0; currentFreq < network.points(); currentFreq++) {
        snpFile.setFieldAlignment(QTextStream::AlignLeft);
        snpFile.setFieldWidth(COLUMNWIDTH);
        snpFile << network.x()[currentFreq];
        FormattedComplexMatrix2D::iterator row_iter = network.y()[currentFreq].begin();
        WriteRow(network, snpFile, *row_iter);
        row_iter++;
        for (; row_iter != network.y()[currentFreq].end(); row_iter++) {
            snpFile.setFieldAlignment(QTextStream::AlignLeft);
            snpFile.setFieldWidth(COLUMNWIDTH);
            snpFile << " "; // tab past frequency column for subsequent rows
            WriteRow(network, snpFile, *row_iter);
        }
    }
}
开发者ID:Terrabits,项目名称:RsaToolbox,代码行数:21,代码来源:FormattedTouchstone.cpp

示例7: WriteRow

void FormattedTouchstone::WriteRow(FormattedNetworkData &network, QTextStream &snpFile, FormattedComplexRowVector &row) {
    uint columnsWritten = 1;
    uint const COLUMNSPERLINE = 4;
    FormattedComplexRowVector::iterator column_iter = row.begin();
    for (; column_iter != row.end(); column_iter++) {
        (*WriteDatum)(snpFile, *column_iter);
        // add delimiter
        if (columnsWritten == network.numberOfPorts()) {
            snpFile.setFieldWidth(0);
            snpFile << endl;
            snpFile.setFieldWidth(COLUMNWIDTH);
        }
        else if (columnsWritten % COLUMNSPERLINE == 0) {
            snpFile.setFieldWidth(0);
            snpFile << endl;
            snpFile.setFieldAlignment(QTextStream::AlignLeft);
            snpFile.setFieldWidth(COLUMNWIDTH);
            snpFile << " ";
        }
        columnsWritten++;
    }
}
开发者ID:Terrabits,项目名称:RsaToolbox,代码行数:22,代码来源:FormattedTouchstone.cpp

示例8: sideviewDump

void QWSHexDump::sideviewDump(int at)
{
    if (dirty) {
        dirty = false;
        ++at;
        sideview[at] = '\0';
        int currentWidth = (2 * at) + (at / clustering) - (at%clustering?0:1);
        int missing = qMax(dataWidth - currentWidth, 0);
        while (missing--)
            *outstrm << ' ';

        *outstrm << " [";
        outstrm->setPadChar(' ');
        outstrm->setFieldWidth(wrap);
        outstrm->setFieldAlignment( QTextStream::AlignLeft );
        *outstrm << sideview;
        *outstrm << ']';
    }
}
开发者ID:wpbest,项目名称:copperspice,代码行数:19,代码来源:qwscommand_qws.cpp

示例9: WriteDB

void FormattedTouchstone::WriteDB(QTextStream &snpFile, FormattedComplex &datum) {
    snpFile.setFieldAlignment(QTextStream::AlignLeft);
    snpFile.setFieldWidth(COLUMNWIDTH);
    snpFile << datum.dB();
    snpFile << datum.angle_deg();
}
开发者ID:Terrabits,项目名称:RsaToolbox,代码行数:6,代码来源:FormattedTouchstone.cpp

示例10: WriteRI

void FormattedTouchstone::WriteRI(QTextStream &snpFile, FormattedComplex &datum) {
    snpFile.setFieldAlignment(QTextStream::AlignLeft);
    snpFile.setFieldWidth(COLUMNWIDTH);
    snpFile << datum.real();
    snpFile << datum.imaginary();
}
开发者ID:Terrabits,项目名称:RsaToolbox,代码行数:6,代码来源:FormattedTouchstone.cpp


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