本文整理汇总了C++中QCStringList类的典型用法代码示例。如果您正苦于以下问题:C++ QCStringList类的具体用法?C++ QCStringList怎么用?C++ QCStringList使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了QCStringList类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SLOT
void DictApplet::sendCommand(const QCString &fun, const QString &data)
{
if (waiting > 0) {
waiting = 1;
delayedFunc = fun.copy();
delayedData = data;
return;
}
DCOPClient *client = kapp->dcopClient();
if (!client->isApplicationRegistered("kdict")) {
KApplication::startServiceByDesktopName("kdict");
waiting = 1;
delayedFunc = fun.copy();
delayedData = data;
QTimer::singleShot(100, this, SLOT(sendDelayedCommand()));
return;
} else {
QCStringList list = client->remoteObjects("kdict");
if (list.findIndex("KDictIface")==-1) {
waiting = 1;
delayedFunc = fun.copy();
delayedData = data;
QTimer::singleShot(100, this, SLOT(sendDelayedCommand()));
return;
}
}
client->send("kdict","default",fun,data);
}
示例2: request
Arts::Buffer *MCOPDCOPObject::callFunction(MCOPEntryInfo *entry, TQCString ifaceName, const TQByteArray &data)
{
Arts::Object workingObject = Arts::SubClass(string(ifaceName));
Arts::DynamicRequest request(workingObject);
request.method(string(entry->functionName()));
if(entry->signatureList().size() > 0)
{
QCStringList list = entry->signatureList();
QCStringList::iterator it;
for(it = list.begin(); it != list.end(); ++it)
{
TQCString param = *it;
kdDebug() << "PARAM: " << param << endl;
TQDataStream argStream(data, IO_ReadOnly);
if(param == "long")
request.param(MCOPDCOPTools::getLong(argStream));
else if(param == "string")
request.param(MCOPDCOPTools::getString(argStream));
}
}
Arts::AnyRef result;
if(!request.invoke(result))
return 0;
Arts::Buffer *newBuffer = new Arts::Buffer();
result.write(newBuffer);
return newBuffer;
}
示例3: functionsDynamic
QCStringList MCOPDCOPObject::functionsDynamic()
{
QCStringList returnList;
TQMap<TQCString, MCOPEntryInfo *>::iterator it;
for(it = d->dynamicFunctions.begin(); it != d->dynamicFunctions.end(); ++it)
returnList.append(it.key());
return returnList;
}
示例4: updateDCOPObjects
void EditAction::updateDCOPObjects()
{
theDCOPObjects->clear();
DCOPClient *theClient = TDEApplication::kApplication()->dcopClient();
if(theDCOPApplications->currentText().isNull() || theDCOPApplications->currentText().isEmpty()) return;
QCStringList theObjects = theClient->remoteObjects(nameProgramMap[theDCOPApplications->currentText()].utf8());
if(!theObjects.size() && theDCOPApplications->currentText() == (*theAction).program()) theDCOPObjects->insertItem((*theAction).object());
for(QCStringList::iterator j = theObjects.begin(); j != theObjects.end(); ++j)
if(*j != "tdesycoca" && *j != "qt" && AddAction::getFunctions(nameProgramMap[theDCOPApplications->currentText()], *j).count())
theDCOPObjects->insertItem(TQString::fromUtf8(*j));
updateDCOPFunctions();
}
示例5: getFunctions
const QStringList AddAction::getFunctions(const QString app, const QString obj)
{
QStringList ret;
DCOPClient *theClient = KApplication::kApplication()->dcopClient();
QCStringList theApps = theClient->remoteFunctions(app.utf8(), obj.utf8());
for(QCStringList::iterator i = theApps.begin(); i != theApps.end(); ++i)
if( *i != "QCStringList interfaces()" &&
*i != "QCStringList functions()" &&
*i != "QCStringList objects()" &&
*i != "QCStringList find(QCString)" )
ret += QString::fromUtf8(*i);
return ret;
}
示例6: TQCString
TQCString StubProcess::commaSeparatedList(QCStringList lst)
{
if (lst.count() == 0)
return TQCString("");
QCStringList::Iterator it = lst.begin();
TQCString str = *it;
for (it++; it!=lst.end(); it++)
{
str += ',';
str += *it;
}
return str;
}
示例7: registeredToDCOP
bool KIMProxy::initialize()
{
if ( !m_initialized )
{
m_initialized = true; // we should only do this once, as registeredToDCOP() will catch any new starts
// So there is no error from a failed query when using tdelibs 3.2, which don't have this servicetype
if ( KServiceType::serviceType( IM_SERVICE_TYPE ) )
{
//kdDebug( 790 ) << k_funcinfo << endl;
TQCString dcopObjectId = "KIMIface";
// see what apps implementing our service type are out there
KService::List offers = KServiceType::offers( IM_SERVICE_TYPE );
KService::List::iterator offer;
typedef TQValueList<TQCString> QCStringList;
QCStringList registeredApps = d->dc->registeredApplications();
QCStringList::iterator app;
const QCStringList::iterator end = registeredApps.end();
// for each registered app
for ( app = registeredApps.begin(); app != end; ++app )
{
//kdDebug( 790 ) << " considering: " << *app << endl;
//for each offer
for ( offer = offers.begin(); offer != offers.end(); ++offer )
{
TQCString dcopService = (*offer)->property("X-DCOP-ServiceName").toString().latin1();
if ( !dcopService.isEmpty() )
{
//kdDebug( 790 ) << " is it: " << dcopService << "?" << endl;
// get the application name ( minus any process ID )
TQCString instanceName = (*app).left( dcopService.length() );
// if the application implements the dcop service, add it
if ( instanceName == dcopService )
{
m_apps_available = true;
//kdDebug( 790 ) << " app name: " << (*offer)->name() << ", has instance " << *app << ", dcopService: " << dcopService << endl;
if ( !m_im_client_stubs.find( dcopService ) )
{
kdDebug( 790 ) << "App " << *app << ", dcopObjectId " << dcopObjectId << " found, using it for presence info." << endl;
m_im_client_stubs.insert( *app, new KIMIface_stub( d->dc, *app, dcopObjectId ) );
pollApp( *app );
}
}
}
}
}
}
}
return !m_im_client_stubs.isEmpty();
}
示例8: fromResponse
Capabilities Capabilities::fromResponse( const Response & ehlo ) {
Capabilities c;
// first, check whether the response was valid and indicates success:
if ( !ehlo.isOk()
|| ehlo.code() / 10 != 25 // ### restrict to 250 only?
|| ehlo.lines().empty() )
return c;
QCStringList l = ehlo.lines();
for ( QCStringList::const_iterator it = ++l.constBegin() ; it != l.constEnd() ; ++it )
c.add( QString::fromLatin1(*it) );
return c;
}
示例9: main
int main(int argc, char *argv[])
{
xsltStylesheetPtr cur = NULL;
xmlDocPtr doc, res;
const char *params[16 + 1];
int nbparams = 0;
params[nbparams] = NULL;
KAboutData aboutData( "umbodoc", 0, ki18n("Umbrello UML Modeller autonomous code generator"),
umbrelloVersion(), ki18n(description), KAboutData::License_GPL,
ki18n("(c) 2006 Gael de Chalendar (aka Kleag), (c) 2002-2006 Umbrello UML Modeller Authors"), KLocalizedString(),
"http://uml.sf.net/");
aboutData.addAuthor(ki18n("Gael de Chalendar (aka Kleag)"),KLocalizedString(), "[email protected]");
aboutData.addAuthor(ki18n("Umbrello UML Modeller Authors"), KLocalizedString(), "[email protected]");
KCmdLineArgs::init( argc, argv, &aboutData );
KCmdLineOptions options;
options.add("+[File]", ki18n("File to transform"));
options.add("xslt <url>", ki18n("The XSLT file to use"));
KCmdLineArgs::addCmdLineOptions( options ); // Add our own options.
KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
QCStringList xsltOpt = args->getOptionList("xslt");
if (xsltOpt.size() > 0)
{
QString xsltFile(xsltOpt.last());
xmlSubstituteEntitiesDefault(1);
xmlLoadExtDtdDefaultValue = 1;
cur = xsltParseStylesheetFile((const xmlChar *)xsltFile.latin1());
doc = xmlParseFile(args->url( 0 ).url().latin1());
res = xsltApplyStylesheet(cur, doc, params);
xsltSaveResultToFile(stdout, res, cur);
xsltFreeStylesheet(cur);
xmlFreeDoc(res);
xmlFreeDoc(doc);
xsltCleanupGlobals();
xmlCleanupParser();
}
return(0);
}
示例10: rx
bool NoatunSensor::isRunning()
{
TQRegExp rx("(noatun)|(noatun-\\d+)");
QCStringList list = client->registeredApplications();
TQValueList<TQCString>::iterator it;
it = list.begin();
bool foundNoatun = false;
noatunID = "noatun";
while( foundNoatun == false && it != list.end() )
{
if( rx.search( *it ) != -1 )
{
foundNoatun = true;
noatunID = *it;
}
++it;
}
return ( client->isApplicationRegistered ( noatunID ) );
}
示例11: r
void AddAction::updateObjects()
{
QStringList names;
theObjects->clear();
uniqueProgramMap.clear();
nameProgramMap.clear();
DCOPClient *theClient = KApplication::kApplication()->dcopClient();
QCStringList theApps = theClient->registeredApplications();
for(QCStringList::iterator i = theApps.begin(); i != theApps.end(); ++i)
{
if(!QString(*i).find("anonymous")) continue;
if(!QString(*i).find(i18n( "anonymous" ))) continue;
QRegExp r("(.*)-[0-9]+");
QString name = r.exactMatch(QString(*i)) ? r.cap(1) : *i;
if(names.contains(name)) continue;
names += name;
KListViewItem *a = new KListViewItem(theObjects, name);
uniqueProgramMap[a] = name == QString(*i);
nameProgramMap[a] = *i;
QCStringList theObjects = theClient->remoteObjects(*i);
for(QCStringList::iterator j = theObjects.begin(); j != theObjects.end(); ++j)
if(*j != "ksycoca" && *j != "qt")// && getFunctions(*i, *j).count())
new KListViewItem(a, *j);
}
updateFunctions();
}
示例12: updateDCOPApplications
void EditAction::updateDCOPApplications()
{
TQStringList names;
theDCOPApplications->clear();
DCOPClient *theClient = TDEApplication::kApplication()->dcopClient();
QCStringList theApps = theClient->registeredApplications();
for(QCStringList::iterator i = theApps.begin(); i != theApps.end(); ++i)
{
if(!TQString(*i).find("anonymous")) continue;
TQRegExp r("(.*)-[0-9]+");
TQString name = r.exactMatch(TQString(*i)) ? r.cap(1) : *i;
if(names.contains(name)) continue;
names += name;
theDCOPApplications->insertItem(name);
uniqueProgramMap[name] = name == TQString(*i);
nameProgramMap[name] = *i;
}
updateDCOPObjects();
}
示例13: Config_getString
void Qhp::initialize()
{
/*
<QtHelpProject version="1.0">
<namespace>mycompany.com.myapplication.1_0</namespace>
<virtualFolder>doc</virtualFolder>
<customFilter name="My Application 1.0">
<filterAttribute>myapp</filterAttribute>
<filterAttribute>1.0</filterAttribute>
</customFilter>
<filterSection>
<filterAttribute>myapp</filterAttribute>
<filterAttribute>1.0</filterAttribute>
..
*/
QCString nameSpace = Config_getString(QHP_NAMESPACE);
QCString virtualFolder = Config_getString(QHP_VIRTUAL_FOLDER);
m_doc.declaration("1.0", "UTF-8");
const char * rootAttributes[] =
{ "version", "1.0", 0 };
m_doc.open("QtHelpProject", rootAttributes);
m_doc.openCloseContent("namespace", nameSpace);
m_doc.openCloseContent("virtualFolder", virtualFolder);
// Add custom filter
QCString filterName = Config_getString(QHP_CUST_FILTER_NAME);
if (!filterName.isEmpty())
{
const char * tagAttributes[] =
{ "name", filterName, 0 };
m_doc.open("customFilter", tagAttributes);
QCStringList customFilterAttributes = QCStringList::split(' ', Config_getString(QHP_CUST_FILTER_ATTRS));
for (int i = 0; i < (int)customFilterAttributes.count(); i++)
{
m_doc.openCloseContent("filterAttribute", customFilterAttributes[i]);
}
m_doc.close("customFilter");
}
m_doc.open("filterSection");
// Add section attributes
QCStringList sectionFilterAttributes = QCStringList::split(' ',
Config_getString(QHP_SECT_FILTER_ATTRS));
if (!sectionFilterAttributes.contains("doxygen"))
{
sectionFilterAttributes << "doxygen";
}
for (int i = 0; i < (int)sectionFilterAttributes.count(); i++)
{
m_doc.openCloseContent("filterAttribute", sectionFilterAttributes[i]);
}
m_toc.open("toc");
// Add extra root node
QCString fullProjectname = getFullProjectName();
QCString indexFile = "index"+Doxygen::htmlFileExtension;
const char * const attributes[] =
{ "title", fullProjectname,
"ref", indexFile,
NULL
};
m_toc.open("section", attributes);
m_prevSectionTitle = getFullProjectName();
m_prevSectionLevel = 1;
m_sectionLevel = 1;
m_index.open("keywords");
m_files.open("files");
}
示例14: while
int StubProcess::ConverseStub(int check)
{
TQCString line, tmp;
while (1)
{
line = readLine();
if (line.isNull())
return -1;
if (line == "tdesu_stub")
{
// This makes parsing a lot easier.
enableLocalEcho(false);
if (check) writeLine("stop");
else writeLine("ok");
} else if (line == "display") {
writeLine(display());
} else if (line == "display_auth") {
#ifdef Q_WS_X11
writeLine(displayAuth());
#else
writeLine("");
#endif
} else if (line == "dcopserver") {
if (m_bDCOPForwarding)
writeLine(dcopServer());
else
writeLine("no");
} else if (line == "dcop_auth") {
if (m_bDCOPForwarding)
writeLine(dcopAuth());
else
writeLine("no");
} else if (line == "ice_auth") {
if (m_bDCOPForwarding)
writeLine(iceAuth());
else
writeLine("no");
} else if (line == "command") {
writeLine(m_Command);
} else if (line == "path") {
TQCString path = getenv("PATH");
if (!path.isEmpty() && path[0] == ':')
path = path.mid(1);
if (m_User == "root")
if (!path.isEmpty())
path = "/usr/local/sbin:/usr/sbin:/sbin:" + path;
else
if (strcmp(__TDE_BINDIR, "/usr/bin") == 0) {
path = "/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin";
}
else {
path = "/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:" __TDE_BINDIR ":/usr/bin:/bin";
}
writeLine(path);
} else if (line == "user") {
writeLine(m_User);
} else if (line == "priority") {
tmp.setNum(m_Priority);
writeLine(tmp);
} else if (line == "scheduler") {
if (m_Scheduler == SchedRealtime) writeLine("realtime");
else writeLine("normal");
} else if (line == "xwindows_only") {
if (m_bXOnly) writeLine("no");
else writeLine("yes");
} else if (line == "app_startup_id") {
QCStringList env = environment();
TQCString tmp;
for( QCStringList::ConstIterator it = env.begin();
it != env.end();
++it )
{
if( (*it).find( "DESKTOP_STARTUP_ID=" ) == 0 )
tmp = (*it).mid( strlen( "DESKTOP_STARTUP_ID=" ));
}
if( tmp.isEmpty())
tmp = "0";
writeLine(tmp);
} else if (line == "app_start_pid") { // obsolete
tmp.setNum(getpid());
writeLine(tmp);
} else if (line == "environment") { // additional env vars
QCStringList env = environment();
for( QCStringList::ConstIterator it = env.begin();
it != env.end();
++it )
writeLine( *it );
writeLine( "" );
} else if (line == "end") {
return 0;
} else
{
kdWarning(900) << k_lineinfo << "Unknown request: -->" << line
<< "<--\n";
return 1;
}
}
return 0;
//.........这里部分代码省略.........
示例15: main
int main(int argc, char *argv[]) {
int i_file, i_v, i_curve;
int i_plot;
QString fullPath;
KAboutData aboutData("kst", I18N_NOOP("Kst"),
KSTVERSION, description, KAboutData::License_GPL,
I18N_NOOP("(c) 2000-2007 Barth Netterfield"),
0,
"http://kst.kde.org/");
aboutData.addAuthor("Barth Netterfield",
I18N_NOOP("Original author and maintainer."),
"[email protected]",
"http://omega.astro.utoronto.ca/");
aboutData.addAuthor("Staikos Computing Services Inc.",
I18N_NOOP("Developed for the University of Toronto."),
"[email protected]",
"http://www.staikos.net/");
aboutData.addAuthor("Sumus Technology Limited",
I18N_NOOP("Developed for the University of British Columbia"),
"[email protected]",
"http://www.sumusltd.com/");
aboutData.addAuthor("Rick Chern",
I18N_NOOP("University of British Columbia"),
"",
"");
aboutData.addAuthor("Duncan Hanson",
I18N_NOOP("University of British Columbia"),
"",
"");
aboutData.addAuthor("Nicolas Brisset",
"",
"",
"");
aboutData.addAuthor("Matthew Truch",
"",
"http://matt.truch.net/",
"[email protected]");
aboutData.addAuthor("Theodore Kisner",
"",
"[email protected]",
"");
aboutData.setTranslator(I18N_NOOP("_: NAME OF TRANSLATORS\nYour names"),
I18N_NOOP("_: EMAIL OF TRANSLATORS\nYour emails"));
KCmdLineArgs::init( argc, argv, &aboutData );
KCmdLineArgs::addCmdLineOptions( options ); // Add our own options.
KApplication app;
KImageIO::registerFormats();
KstDialogs::replaceSelf(new KstGuiDialogs);
KstData::replaceSelf(new KstGuiData);
KstApp::initialize();
atexit(exitHelper);
if (app.isRestored()) {
RESTORE(KstApp)
} else {
KstApp *kst = new KstApp;
InType in;
QColor color;
QCStringList ycolList;
QCStringList matrixList;
QCStringList yEqList;
QCStringList psdList;
QCStringList hsList;
QCStringList errorList;
unsigned int i_ycol;
QCStringList::Iterator hs_string;
QCStringList::Iterator eq_i;
QCStringList::Iterator mat_i;
bool showQuickStart = false;
bool showDataWizard = false;
bool nOK;
int n_y = 0;
KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
CheckForCMDErrors(args);
QString wizardfile = args->getOption("w");
QString printfile = args->getOption("print");
QString pngfile = args->getOption("png");
bool print_and_exit = false;
if (printfile != "<none>") {
print_and_exit = true;
}
if (pngfile != "<none>") {
print_and_exit = true;
}
if (!print_and_exit) {
app.setMainWidget(kst);
QRect rect = KGlobalSettings::desktopGeometry(kst);
kst->resize(5 * rect.width() / 6, 5 * rect.height() / 6);
kst->show();
}
//.........这里部分代码省略.........