本文整理汇总了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;
}
示例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);
}
示例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(' ');
}
示例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 << ']';
}
}