本文整理汇总了C++中Q3CString::open方法的典型用法代码示例。如果您正苦于以下问题:C++ Q3CString::open方法的具体用法?C++ Q3CString::open怎么用?C++ Q3CString::open使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Q3CString
的用法示例。
在下文中一共展示了Q3CString::open方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: c
//.........这里部分代码省略.........
f[7]='F';
QCOMPARE(e,(Q3CString)"String E");
char text[]="String f";
f = text;
text[7]='!';
QCOMPARE(f,(Q3CString)"String f");
f[7]='F';
QCOMPARE(text[7],'!');
#if 0
a="";
a[0]='A';
Q3CString res = "A";
QCOMPARE(a,res);
QCOMPARE(a.length(),(uint)1);
compare(a.length(),(uint)1);
a[1]='B';
QCOMPARE(a,(Q3CString)"AB");
QCOMPARE(a.length(),(uint)2);
a[2]='C';
QCOMPARE(a,(Q3CString)"ABC");
QCOMPARE(a.length(),(uint)3);
a = Q3CString();
QVERIFY(a.isNull());
a[0]='A';
QCOMPARE(a,(Q3CString)"A");
QCOMPARE(a.length(),(uint)1);
a[1]='B';
QCOMPARE(a,(Q3CString)"AB");
QCOMPARE(a.length(),(uint)2);
a[2]='C';
QCOMPARE(a,(Q3CString)"ABC");
QCOMPARE(a.length(),(uint)3);
#endif
a="123";
b="456";
a[0]=a[1];
QCOMPARE(a,(Q3CString)"223");
a[1]=b[1];
QCOMPARE(b,(Q3CString)"456");
QCOMPARE(a,(Q3CString)"253");
char t[]="TEXT";
a="A";
a=t;
QCOMPARE(a,(Q3CString)"TEXT");
QCOMPARE(a,(Q3CString)t);
a[0]='X';
QCOMPARE(a,(Q3CString)"XEXT");
QCOMPARE(t[0],'T');
t[0]='Z';
QCOMPARE(a,(Q3CString)"XEXT");
a="ABC";
QCOMPARE(((const char*)a)[1],'B');
QCOMPARE(strcmp(a,(Q3CString)"ABC"),0);
a += "DEF";
QCOMPARE(a, (Q3CString)"ABCDEF");
a += 'G';
QCOMPARE(a, (Q3CString)"ABCDEFG");
a += ((const char*)(0));
QCOMPARE(a, (Q3CString)"ABCDEFG");
// non-member operators
a="ABC";
b="ABC";
c="ACB";
d="ABCD";
QVERIFY(a==b);
QVERIFY(!(a==d));
QVERIFY(!(a!=b));
QVERIFY(a!=d);
QVERIFY(!(a<b));
QVERIFY(a<c);
QVERIFY(a<d);
QVERIFY(!(d<a));
QVERIFY(!(c<a));
QVERIFY(a<=b);
QVERIFY(a<=d);
QVERIFY(a<=c);
QVERIFY(!(c<=a));
QVERIFY(!(d<=a));
QCOMPARE(a+b,(Q3CString)"ABCABC");
QCOMPARE(a +"XXXX",(Q3CString)"ABCXXXX");
QCOMPARE(a+'X',(Q3CString)"ABCX");
QCOMPARE("XXXX"+a,(Q3CString)"XXXXABC");
QCOMPARE('X'+a,(Q3CString)"XABC");
a = (const char*)0;
QVERIFY(a.isNull());
QVERIFY(*((const char *)a) == 0);
{
QFile f("COMPARE.txt");
f.open( QIODevice::WriteOnly );
QTextStream ts( &f );
ts.setEncoding(QTextStream::Unicode);
ts << "Abc";
}
}