本文整理汇总了C++中QDebug::setAutoInsertSpaces方法的典型用法代码示例。如果您正苦于以下问题:C++ QDebug::setAutoInsertSpaces方法的具体用法?C++ QDebug::setAutoInsertSpaces怎么用?C++ QDebug::setAutoInsertSpaces使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QDebug
的用法示例。
在下文中一共展示了QDebug::setAutoInsertSpaces方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: debugSpaceHandling
void tst_QDebug::debugSpaceHandling() const
{
MessageHandlerSetter mhs(myMessageHandler);
{
QDebug d = qDebug();
QVERIFY(d.autoInsertSpaces());
d.setAutoInsertSpaces(false);
QVERIFY(!d.autoInsertSpaces());
d << " ";
d.setAutoInsertSpaces(true);
QVERIFY(d.autoInsertSpaces());
d << "foo";
d.nospace();
d << "key=" << "value";
d.space();
d << 1 << 2;
MyLine line(MyPoint(10, 11), MyPoint (12, 13));
d << line;
// With the old implementation of MyPoint doing dbg.nospace() << ...; dbg.space() we ended up with
// MyLine(MyPoint(10, 11) , MyPoint(12, 13) )
}
QCOMPARE(s_msg, QString::fromLatin1(" foo key=value 1 2 MyLine(MyPoint(10, 11), MyPoint(12, 13))"));
}
示例2: switch
QDebug operator<<(QDebug debug, FinalBytesSingleIntermediate character)
{
bool insert_space = debug.autoInsertSpaces();
debug.setAutoInsertSpaces(false);
debug << "FinalBytesSingleIntermediate::";
switch(character) {
case SL:
debug << "SL";
break;
case SR:
debug << "SR";
break;
case GSM:
debug << "GSM";
break;
case GSS:
debug << "GSS";
break;
case FNT:
debug << "FNT";
break;
case TSS:
debug << "TSS";
break;
case JFY:
debug << "JFY";
break;
case SPI:
debug << "SPI";
break;
case QUAD:
debug << "QUAD";
break;
case SSU:
debug << "SSU";
break;
case PFS:
debug << "PFS";
break;
case SHS:
debug << "SHS";
break;
case SVS:
debug << "SVS";
break;
case IGS:
debug << "IGS";
break;
case NOT_DEFINED:
debug << "NOT_DEFINED";
break;
case IDCS:
debug << "IDCS";
break;
case PPA:
debug << "PPA";
break;
case PPR:
debug << "PPR";
break;
case PPB:
debug << "PPB";
break;
case SPD:
debug << "SPD";
break;
case DTA:
debug << "DTA";
break;
case SHL:
debug << "SHL";
break;
case SLL:
debug << "SLL";
break;
case FNK:
debug << "FNK";
break;
case SPQR:
debug << "SPQR";
break;
case SEF:
debug << "SEF";
break;
case PEC:
debug << "PEC";
break;
case SSW:
debug << "SSW";
break;
case SACS:
debug << "SACS";
break;
case SAPV:
debug << "SAPV";
break;
case STAB:
debug << "STAB";
break;
case GCC:
//.........这里部分代码省略.........