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


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

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


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

示例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: 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


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