本文整理汇总了C++中Q3CString::right方法的典型用法代码示例。如果您正苦于以下问题:C++ Q3CString::right方法的具体用法?C++ Q3CString::right怎么用?C++ Q3CString::right使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Q3CString
的用法示例。
在下文中一共展示了Q3CString::right方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: QCOMPARE
void tst_Q3CString::right()
{
Q3CString a;
a="ABCDEFGHIEfGEFG"; // 15 chars
QCOMPARE(a.right(3),(Q3CString)"EFG");
QCOMPARE(a.right(0),(Q3CString)"");
Q3CString n;
QVERIFY(n.right(3).isNull());
QVERIFY(n.right(0).isNull());
}
示例2: gen_app
void UmlArtifact::gen_app(const Q3CString & path) {
Q3CString target;
Q3CString pro;
propertyValue("genpro target", target);
propertyValue("genpro pro", pro);
if (target.isEmpty()) {
if ((target = name()) == "executable")
target = UmlPackage::getProject()->name();
#ifdef WIN32
target += ".exe";
#endif
}
if (pro.isEmpty()) {
pro = target;
#ifdef WIN32
if (pro.right(4) == ".exe")
pro.resize(pro.length() - 4);
#endif
QDir d(path);
pro = d.absFilePath(pro + ".pro");
}
Q3CString tmplt;
Q3CString config;
Q3CString defines;
Q3CString includepath;
Q3CString dependpath;
Q3CString objectsdir;
Q3CString footer;
if (!propertyValue("genpro tmplt", tmplt))
tmplt = "app";
if (!propertyValue("genpro config", config))
config = "debug warn_on qt";
if (!propertyValue("genpro defines", defines))
defines = "WITHCPP WITHJAVA WITHPHP WITHPYTHON WITHIDL";
else if (defines.find("WITHPHP") == -1) {
int n = 0;
if (defines.find("WITHCPP") != -1)
n += 1;
if (defines.find("WITHJAVA") != -1)
n += 1;
if (defines.find("WITHIDL") != -1)
n += 1;
if (n > 1)
defines += " WITHPHP WITHPYTHON";
}
else if (defines.find("WITHPYTHON") == -1) {
int n = 0;
if (defines.find("WITHCPP") != -1)
n += 1;
if (defines.find("WITHJAVA") != -1)
n += 1;
if (defines.find("WITHIDL") != -1)
n += 1;
if (defines.find("WITHPHP") != -1)
n += 1;
if (n > 1)
defines += " WITHPYTHON";
}
propertyValue("genpro includepath", includepath);
propertyValue("genpro dependpath", dependpath);
propertyValue("genpro objectsdir", objectsdir);
propertyValue("genpro footer", footer);
for (;;) {
Dialog dialog(this, path, pro, target, tmplt, config, defines,
includepath, dependpath, objectsdir, footer);
if (dialog.exec() != QDialog::Accepted)
return;
set_PropertyValue("genpro pro", pro);
set_PropertyValue("genpro path", path);
set_PropertyValue("genpro target", target);
set_PropertyValue("genpro tmplt", tmplt);
set_PropertyValue("genpro config", config);
set_PropertyValue("genpro defines", defines);
set_PropertyValue("genpro includepath", includepath);
set_PropertyValue("genpro dependpath", dependpath);
set_PropertyValue("genpro objectsdir", objectsdir);
set_PropertyValue("genpro footer", footer);
QFile f(pro);
if (! f.open(QIODevice::WriteOnly))
//.........这里部分代码省略.........