• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ qstringlist::Iterator类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中qstringlist::Iterator的典型用法代码示例。如果您正苦于以下问题:C++ Iterator类的具体用法?C++ Iterator怎么用?C++ Iterator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了Iterator类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: preprocessMessage

void KviWindow::preprocessMessage(QString & szMessage)
{
    // FIXME: slow

    if(!m_pConsole)
        return;
    if(!m_pConsole->connection())
        return;

    static QString szNonStandardLinkPrefix = QString::fromAscii("\r![");

    if(szMessage.contains(szNonStandardLinkPrefix))
        return; // contains a non standard link that may contain spaces, do not break it.

    // FIXME: This STILL breaks $fmtlink() in certain configurations

    QStringList strings = szMessage.split(" ");
    for(QStringList::Iterator it = strings.begin(); it != strings.end(); ++it )
    {
        if(it->contains('\r'))
            continue;
        QString szTmp(*it);
        szTmp = KviControlCodes::stripControlBytes(szTmp).trimmed();
        if(szTmp.length() < 1)
            continue;
        if(m_pConsole->connection()->serverInfo()->supportedChannelTypes().contains(szTmp[0]))
        {
            if((*it) == szTmp)
                *it = QString("\r!c\r%1\r").arg(*it);
            else
                *it = QString("\r!c%1\r%2\r").arg(szTmp,*it);
        }
    }
    szMessage = strings.join(" ");
}
开发者ID:wodim,项目名称:kronos,代码行数:35,代码来源:KviWindow.cpp


示例2: loadProfiles

void QIMPenInput::loadProfiles()
{
    profileList.clear();
    profile = 0;
    delete shortcutCharSet;
    shortcutCharSet = new QIMPenCharSet();
    shortcutCharSet->setTitle( tr("Shortcut") );
    QString path = QPEApplication::qpeDir() + "etc/qimpen";
    QDir dir( path, "*.conf" );
    QStringList list = dir.entryList();
    QStringList::Iterator it;
    for ( it = list.begin(); it != list.end(); ++it ) {
	QIMPenProfile *p = new QIMPenProfile( path + "/" + *it );
	profileList.append( p );
	if ( p->shortcut() ) {
	    QIMPenCharIterator it( p->shortcut()->characters() );
	    for ( ; it.current(); ++it ) {
		shortcutCharSet->addChar( new QIMPenChar(*it.current()) );
	    }
	}
    }

    Config config( "handwriting" );
    config.setGroup( "Settings" );
    QString prof = config.readEntry( "Profile", "Default" );
    selectProfile( prof );
}
开发者ID:opieproject,项目名称:opie,代码行数:27,代码来源:qimpeninput.cpp


示例3: restart

void Process::restart()
{
    bool changed = false;
    if (mPath.compare(getTaskDefinition().getFirst()) != 0)
        changed = true;

    if (getTaskDefinition().getSecondList().size() != mArguments.size())
        changed = true;

    if (!changed)
    {
        int index = 0;
        for (QStringList::Iterator it = mArguments.begin(); it != mArguments.end(); it++)
        {
            if (it->compare(getTaskDefinition().getSecondList().at(index)) != 0)
            {
                changed = true;
                break;
            }
            index++;
        }
    }

    if (changed)
    {
        LOG_WARNING() << "Task definition for the process " << getTaskDefinition().getName() << " changed since the last execution. Restarting with the previous "
                      << "path and arguments. To use the new Values, stop and run the Simulation.";
    }

    restartProcess();
}
开发者ID:,项目名称:,代码行数:31,代码来源:


示例4: collectStyles

SvgStyles SvgStyleParser::collectStyles(const KoXmlElement &e)
{
    SvgStyles styleMap;

    // collect individual presentation style attributes which have the priority 0
    foreach(const QString &command, d->styleAttributes) {
        const QString attribute = e.attribute(command);
        if (!attribute.isEmpty())
            styleMap[command] = attribute;
    }
    foreach(const QString & command, d->fontAttributes) {
        const QString attribute = e.attribute(command);
        if (!attribute.isEmpty())
            styleMap[command] = attribute;
    }

    // match css style rules to element
    QStringList cssStyles = d->context.matchingStyles(e);

    // collect all css style attributes
    foreach(const QString &style, cssStyles) {
        QStringList substyles = style.split(';', QString::SkipEmptyParts);
        if (!substyles.count())
            continue;
        for (QStringList::Iterator it = substyles.begin(); it != substyles.end(); ++it) {
            QStringList substyle = it->split(':');
            if (substyle.count() != 2)
                continue;
            QString command = substyle[0].trimmed();
            QString params  = substyle[1].trimmed();
            // only use style and font attributes
            if (d->styleAttributes.contains(command) || d->fontAttributes.contains(command))
                styleMap[command] = params;
        }
    }
开发者ID:crayonink,项目名称:calligra-2,代码行数:35,代码来源:SvgStyleParser.cpp


示例5: tr

void Qt5Files::buttonClicked() {
	QString filter;
	if (!m_extensions.size()) {
		filter = tr("All Files (*.*)");
	} else {
		filter = tr("Valid Files (");
		for (unsigned int i=0; i<m_extensions.size(); ++i) {
			if (i) filter += " ";
			filter += "*."+QString::fromStdString(m_extensions[i]);
		}
		filter += tr(")");
	}
	QStringList files = QFileDialog::getOpenFileNames(nullptr, "Open Files...", filter, tr("All Files (*.*)"), nullptr, 0);
	QStringList::Iterator it = files.begin();
	m_value.clear();
	QString text;
	while (it != files.end()) {
		m_value.push_back(fs::path(it->toStdString()));
		if (it != files.begin()) text += ", ";
		text += *it;
		++it;
	}
	m_lineEdit->setText(text);
	notify(m_value);
}
开发者ID:ochilan,项目名称:graphene,代码行数:25,代码来源:Qt5Files.cpp


示例6: parse

void CPU::parse(QByteArray input)
{
    qDebug() << "opCodes:" << opCodes;
    QString in = input;
    QStringList string;
    if(input.isEmpty()) return;
        //throw Exception("Файл пуст!");
    string = in.split('\n'); // делим построчно файл
    for(QStringList::Iterator i = string.begin(); i < string.end(); i++)
        this->parseCommand(i->split(" ", QString::SkipEmptyParts)); // парсим каждую строку поотдельности
    qDebug() << data;
}
开发者ID:kiselvserg,项目名称:arch,代码行数:12,代码来源:cpu.cpp


示例7: parseColorStops

void SvgStyleParser::parseColorStops(QGradient *gradient, const KoXmlElement &e)
{
    QGradientStops stops;
    QColor c;

    for (KoXmlNode n = e.firstChild(); !n.isNull(); n = n.nextSibling()) {
        KoXmlElement stop = n.toElement();
        if (stop.tagName() == "stop") {
            float offset;
            QString temp = stop.attribute("offset");
            if (temp.contains('%')) {
                temp = temp.left(temp.length() - 1);
                offset = temp.toFloat() / 100.0;
            } else
                offset = temp.toFloat();

            QString stopColorStr = stop.attribute("stop-color");
            if (!stopColorStr.isEmpty()) {
                if (stopColorStr == "inherit") {
                    stopColorStr = inheritedAttribute("stop-color", stop);
                }
                parseColor(c, stopColorStr);
            }
            else {
                // try style attr
                QString style = stop.attribute("style").simplified();
                QStringList substyles = style.split(';', QString::SkipEmptyParts);
                for (QStringList::Iterator it = substyles.begin(); it != substyles.end(); ++it) {
                    QStringList substyle = it->split(':');
                    QString command = substyle[0].trimmed();
                    QString params  = substyle[1].trimmed();
                    if (command == "stop-color")
                        parseColor(c, params);
                    if (command == "stop-opacity")
                        c.setAlphaF(params.toDouble());
                }

            }
            QString opacityStr = stop.attribute("stop-opacity");
            if (!opacityStr.isEmpty()) {
                if (opacityStr == "inherit") {
                    opacityStr = inheritedAttribute("stop-opacity", stop);
                }
                c.setAlphaF(opacityStr.toDouble());
            }
            stops.append(QPair<qreal, QColor>(offset, c));
        }
    }
    if (stops.count())
        gradient->setStops(stops);
}
开发者ID:crayonink,项目名称:calligra-2,代码行数:51,代码来源:SvgStyleParser.cpp


示例8: LoadImages

void MainWindow::LoadImages() {
    images_.clear();

    QStringList files = QFileDialog::getOpenFileNames(
                            this, tr("Load Images"), "~/Pictures",
                            tr("Images (*.png, *.jpeg, *.jpg, *.tiff, *.bmp, *"));

    QStringList files_copy = files;
    for (QStringList::Iterator i = files_copy.begin(); i != files_copy.end(); ++i) {
        // Load files and add to ThumbnailView.
        QImage* img = new QImage(*i);
        std::cout << i->toStdString() << " " << img->width() << " " << img->height() << "\n";
        images_.push_back(shared_ptr<QImage>(img));
        thumb_->addImage(img, *i);
    }
}
开发者ID:herzhang,项目名称:Android-App-Profiling,代码行数:16,代码来源:main_window.cpp


示例9: setCurrentList

void KFFWin_Flightplan::setCurrentList( QStringList & list )
{
	QTreeWidgetItem* item = 0;
	QStringList::Iterator it;
	int i = 0, j;

	ui_widget.treewidget_navaids->clear();

	for ( it = list.begin() ; it != list.end() ; ( it++, i++ ) )
	{
		item = new QTreeWidgetItem( ui_widget.treewidget_navaids );

		for ( j = 0 ; j < ui_widget.treewidget_navaids->columnCount() ; j++ )
		{
			item->setText( j, it->section( "|", j, j ) );
		}

		ui_widget.treewidget_navaids->insertTopLevelItem( i, item );
	}
}
开发者ID:ac001,项目名称:ffs-central,代码行数:20,代码来源:win_flightplan.cpp


示例10: ParseMasks

// -----------------------------------------------------------------------
bool ParseMasks(const char *Masks_, QSet<QString> &Patterns_, TExcludePatterns &ExcludePatterns_)
{
QStringList MasksList = QString::fromLocal8Bit(Masks_).split(';', QString::SkipEmptyParts);
for(QStringList::Iterator it = MasksList.begin(); it != MasksList.end(); ++it) {
	*it = it->trimmed();
	if(it->isEmpty()) return false;
	}
//
for(QStringList::Iterator it = MasksList.begin(); it != MasksList.end(); ++it) {
	if(Patterns_.contains(*it)) continue;
	//
	ExcludePatterns_.push_back(QRegExp(*it, 
		#ifdef Q_OS_WIN
			Qt::CaseInsensitive, QRegExp::Wildcard));
		#else
			Qt::CaseSensitive, QRegExp::WildcardUnix));
		#endif
	Patterns_.insert(*it);
	}
return true;
}
开发者ID:vasyutin,项目名称:hpro,代码行数:22,代码来源:main.cpp


示例11: getImage

/**
 * Funtion returns image pointer to Image located 
 * in cache folder where shoul be downloaded cover 
 * with name from parameter.
 * @param name
 * @return 
 */
QImage* CoverDownloader::getImage(QString name) {
    QDir d = QDir::current();

    std::cout << "Current dir cover.. " << d.absolutePath().toStdString() << std::endl;
    if (d.cd("cache")) {
        QImage * img = new QImage();
        QStringList filters;
        filters << name + ".*";
        QStringList files = d.entryList(filters, QDir::Readable | QDir::Files | QDir::NoSymLinks);
        for (QStringList::Iterator it = files.begin(); it != files.end(); ++it) {
            std::cout << it->toStdString() << std::endl;
            if (img->load("cache/" + *it)) {
                break;
            }
        }
        if (!img->isNull()) {
            return img;
        }
        SAFE_DELETE(img);
    }
    return NULL;
}
开发者ID:helcl42,项目名称:Streaming,代码行数:29,代码来源:CoverDownloader.cpp


示例12: regExpSpTab

QVector< QVector<int> > NormFilterDialog::getMatrixFromLineEdit(QTextEdit *edit) const
{	// 文字列から行列を得る
	QVector< QVector<int> > result;
	QTextCursor cr = edit->textCursor();
	cr.movePosition(QTextCursor::Start, QTextCursor::MoveAnchor);
	for (QTextBlock block = cr.block(); block.isValid(); block = block.next()) {	// 行の走査
		const QString line = block.text();
		const QRegExp regExpSpTab(tr("[ \\t]+"));
		QStringList tokens = line.split(regExpSpTab);	// スペースでトークン分割
		if (!tokens.isEmpty() && tokens.first().isEmpty()) { tokens.removeFirst(); }
		if (!tokens.isEmpty() && tokens.last().isEmpty()) { tokens.removeLast(); }
		if (tokens.isEmpty()) { continue; }

		const QRegExp regExpInt(tr("^-?\\d+$"));
		QVector<int> row;
		for (QStringList::Iterator it = tokens.begin(); it != tokens.end(); ++it) {
			if (!regExpInt.exactMatch(*it)) { result.clear(); return result; }
			row.append(it->toInt());
		}
		result.append(row);
	}
	return result;
}
开发者ID:,项目名称:,代码行数:23,代码来源:


示例13: open

void ReduxWidget::open() {

    QStringList files = QFileDialog::getOpenFileNames( this, tr( "Open File" ), "", tr( "Log Files (*_lg*)" ) );

    int sz = PATH_MAX + 1; // N.B. It is possible to construct a path longer than PATH_MAX on most systems,
    // so this is really not fool-proof...
    char* buf = new char[sz];

    QStringList::Iterator it = files.begin();
    while( it != files.end() ) {
        memset( buf, 0, sz * sizeof( char ) );
        if( ( ! it->isEmpty() ) && realpath( it->toStdString().c_str(), buf ) ) {
            dumpMsg( QString( "Opening LogFile : " ) + *it );
            /*LogFile* tmpLog = new LogFile ( buf );
            bool skip = false;
            for ( unsigned int i=0; i<myLogs.size(); ++i)
            if ( !(*(myLogs[i]) != *tmpLog) )
               skip = true;
             cout << *tmpLog << endl;
                 if ( ! skip ) myLogs.push_back( tmpLog );
                 else delete tmpLog;
                 //myLog.load();
                 */
        }
        ++it;
    }
    delete[] buf;

    //emit setsChanged();
    //logTree->reset();

    //emit jobsChanged();
    //jobTree->reset();
    //for (int i=0; i<myJobs.size(); ++i) cout << *myJobs[i];
    //cout << myNet;
    //cout << dumpXML(true) << endl;
}
开发者ID:ISP-SST,项目名称:redux,代码行数:37,代码来源:reduxwidget.cpp


示例14: parse

bool QOptions::parse(int argc, const char *const*argv)
{
    if (mOptionGroupMap.isEmpty())
		return false;

    if (argc==1)
		return true;

	bool result = true;
    QStringList args;
    for (int i=1;i<argc;++i) {
        args.append(QString::fromLocal8Bit(argv[i]));
	}

	QStringList::Iterator it = args.begin();
    QList<QOption>::Iterator it_list;
    mOptions = mOptionGroupMap.keys();

    while (it != args.end()) {
        if (it->startsWith("--")) {
            int e = it->indexOf('=');
            for (it_list = mOptions.begin(); it_list != mOptions.end(); ++it_list) {
                if (it_list->longName() == it->mid(2,e-2)) {
                    if (it_list->type()==QOption::NoToken) {
                        it_list->setValue(true);
                        //qDebug("%d %s", __LINE__, qPrintable(it_list->value().toString()));
						it = args.erase(it);
						break;
					}
					if (e>0) { //
                        it_list->setValue(it->mid(e+1));
                        //qDebug("%d %s", __LINE__, qPrintable(it_list->value().toString()));
					} else {
						it = args.erase(it);
                        if (it == args.end())
                            break;
                        it_list->setValue(*it);
                        //qDebug("%d %s", __LINE__, qPrintable(it_list->value().toString()));
					}
					it = args.erase(it);
					break;
				}
			}
            if (it_list == mOptions.end()) {
                qWarning() << "unknow option: " << *it;
                result = false;
				++it;
            }
			//handle unknow option
        } else if (it->startsWith('-')) {
            for (it_list = mOptions.begin(); it_list != mOptions.end(); ++it_list) {
                QString sname = it_list->shortName();
				int sname_len = sname.length(); //usally is 1
                //TODO: startsWith(-height,-h) Not endsWith, -oabco
                if (it->midRef(1).compare(sname) == 0) {
                    if (it_list->type() == QOption::NoToken) {
                        it_list->setValue(true);
						it = args.erase(it);
						break;
					}
                    if (it->length() == sname_len+1) {//-o abco
						it = args.erase(it);
                        if (it == args.end())
                            break;
                        it_list->setValue(*it);
                        //qDebug("%d %s", __LINE__, qPrintable(it_list->value().toString()));
                    } else {
                        it_list->setValue(it->mid(sname_len+1));
                        //qDebug("%d %s", __LINE__, qPrintable(it_list->value().toString()));
                    }
					it = args.erase(it);
					break;
				}
			}
            if (it_list==mOptions.end()) {
                qWarning() << "unknow option: " << *it;
                result = false;
				++it;
            }
			//handle unknow option
        } else {
            qWarning() << "unknow option: " << *it;
            ++it;
        }
	}
    if (!result) {
        print();
    }
	return result;
}
开发者ID:wang-bin,项目名称:qoptions,代码行数:90,代码来源:qoptions.cpp


示例15: searchData

void KFFOpt_scenery::searchData( QFile* file )
{
	QDomDocument doc;
	QDomElement root;
	QDomNode parent;
	QDomNode child;
	QDomElement e_parent;
	QDomElement e_child;
	KFFScenarioData scenario;
	QString name;
	QStringList list;
	QStringList::Iterator it;

	if ( doc.setContent( file ) )
	{
		root = doc.documentElement();
		parent = root.firstChild();
		e_parent = parent.toElement();
		if ( !e_parent.isNull() )
		{
			if ( e_parent.tagName() == "description" )
			{
				list = e_parent.text().split("\n");
				for (it = list.begin() ; it != list.end() ; it++ )
				{
					*it = it->simplified();
				}
				scenario.description = list.join("\n");
				parent = parent.nextSibling();
				
			}
		}
		
		parent = parent.firstChild();
		
		name = file->fileName().section( '/', -1, -1 ).remove( ".xml" );

		while ( !parent.isNull() )
		{
			e_parent = parent.toElement();

			if ( !e_parent.isNull() )
			{
				if ( e_parent.tagName() == "entry" )
				{
					child = parent.firstChild();

					while ( !child.isNull() )
					{
						e_child = child.toElement();

						if ( !e_child.isNull() )
						{
							if ( e_child.tagName() == "type" )
							{
								scenario.type = e_child.text();
							}
						}

						child = child.nextSibling();
					}
				}

				if ( e_parent.tagName() == "description" )
				{
					list = e_parent.text().split("\n");
					for (it = list.begin() ; it != list.end() ; it++ )
					{
						*it = it->simplified();
					}
					scenario.description = list.join("\n");
				}
			}

			parent = parent.nextSibling();

		}

		if ( !m_scenarii.contains( name ) )
		{
			m_scenarii[name] = scenario;
		}

	}
	else
	{
		qDebug() << file->fileName() << "is not a valide xml file" ;
	}
}
开发者ID:ac001,项目名称:ffs-central,代码行数:89,代码来源:opt_scenery.cpp


示例16: readEntryRaw

ConversionStatus GettextImportPlugin::readEntryRaw(QTextStream& stream)
{
   //kDebug() << " START";
   enum {Begin,Comment,Msgctxt,Msgid,Msgstr} part=Begin;

   _trailingNewLines=0;
   bool error=false;
   bool recoverableError=false;
   bool seenMsgctxt=false;
   _msgstr.clear();
   _msgstr.append(QString());
   _msgid.clear();
   _msgid.append(QString());
   _msgctxt.clear();
   _comment.clear();
   _gettextPluralForm=false;
   _obsolete=false;

   QStringList::Iterator msgstrIt=_msgstr.begin();
   QString line;

   while( !stream.atEnd() )
   {
       _errorLine++;
       //line=stream.readLine();
       if (!_bufferedLine.isEmpty())
       {
            line=_bufferedLine;
            _bufferedLine.clear();
       }
       else
           line=stream.readLine();

       kDebug() << "Parsing line: " << line;

       static const QString lesslessless="<<<<<<<";
       static const QString isisis="=======";
       static const QString moremoremore=">>>>>>>";
       if (KDE_ISUNLIKELY( line.startsWith( lesslessless ) || line.startsWith( isisis ) || line.startsWith( moremoremore ) ))
       {
          // We have found a CVS/SVN conflict marker. Abort.
          // (It cannot be any useful data of the PO file, as otherwise the line would start with at least a quote)
          kError() << "CVS/SVN conflict marker found! Aborting!" << endl << line << endl;
          return PARSE_ERROR;
       }

       // remove whitespaces from beginning and end of line
       line = line.trimmed();

       // remember wrapping state to save file nicely
       int len=line.length();
       if (len)
       {
          _trailingNewLines=0;
         if (_maxLineLength<len && line.at(0)!='#')
           _maxLineLength=len;
       }
       else
          ++_trailingNewLines;


       if(part==Begin)
       {
           // ignore trailing newlines
           if(!len)
              continue;

           if(line.startsWith(_obsoleteStart))
           {
               _obsolete=true;
               part=Comment;
               _comment=line;
           }
           else if(line.startsWith('#'))
           {
               part=Comment;
               _comment=line;
           }
           else if( line.startsWith(_msgctxtStart) && line.contains( _rxMsgCtxt ) )
           {
               part=Msgctxt;

               // remove quotes at beginning and the end of the lines
               line.remove(QRegExp("^msgctxt\\s*\""));
               line.remove(_rxMsgLineRemEndQuote);
               _msgctxt=line;
               seenMsgctxt=true;
           }
           else if( line.contains( _rxMsgId ) )
           {
               part=Msgid;

               // remove quotes at beginning and the end of the lines
               line.remove(_rxMsgIdRemQuotes);
               line.remove(_rxMsgLineRemEndQuote);

               (*(_msgid).begin())=line;

           }
           // one of the quotation marks is missing
//.........这里部分代码省略.........
开发者ID:ShermanHuang,项目名称:kdesdk,代码行数:101,代码来源:gettextimport.cpp


示例17: run


//.........这里部分代码省略.........
      }
    }

    // In direct mode user is warned by select file dialog
    if ( !mDirect )
    {
      // Check if output exists
      QStringList outputExists = mOptions->checkOutput();
      if ( outputExists.size() > 0 )
      {
        QMessageBox::StandardButton ret = QMessageBox::question( 0, QStringLiteral( "Warning" ),
                                          tr( "Output %1 exists! Overwrite?" ).arg( outputExists.join( QStringLiteral( "," ) ) ),
                                          QMessageBox::Ok | QMessageBox::Cancel );

        if ( ret == QMessageBox::Cancel )
          return;

        arguments.append( QStringLiteral( "--o" ) );
      }
    }

    // Remember output maps
    mOutputVector = mOptions->output( QgsGrassModuleOption::Vector );
    QgsDebugMsg( QString( "mOutputVector.size() = %1" ).arg( mOutputVector.size() ) );
    mOutputRaster = mOptions->output( QgsGrassModuleOption::Raster );
    QgsDebugMsg( QString( "mOutputRaster.size() = %1" ).arg( mOutputRaster.size() ) );
    mSuccess = false;
    mViewButton->setEnabled( false );

    QStringList list = mOptions->arguments();
    list << arguments;

    QStringList argumentsHtml;
    for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it )
    {
      QgsDebugMsg( "option: " + ( *it ) );
      //command.append ( " " + *it );
      arguments.append( *it );
      //mProcess.addArgument( *it );

      // Quote options with special characters so that user
      // can copy-paste-run the command
      if ( it->contains( QRegExp( "[ <>\\$|;&]" ) ) )
      {
        argumentsHtml.append( "\"" + *it + "\"" );
      }
      else
      {
        argumentsHtml.append( *it );
      }
    }

    /* WARNING - TODO: there was a bug in GRASS 6.0.0 / 6.1.CVS (< 2005-04-29):
     * db_start_driver set GISRC_MODE_MEMORY eviroment variable to 1 if
     * G_get_gisrc_mode() == G_GISRC_MODE_MEMORY but the variable wasn't unset
     * if  G_get_gisrc_mode() == G_GISRC_MODE_FILE. Because QGIS GRASS provider starts drivers in
     * G_GISRC_MODE_MEMORY mode, the variable remains set in variable when a module is run
     * -> unset GISRC_MODE_MEMORY. Remove later once 6.1.x / 6.0.1 is widespread.
    *   */
    putenv( ( char * ) "GISRC_MODE_MEMORY" ); // unset

    mOutputTextBrowser->clear();

    QProcessEnvironment environment = processEnvironment( mDirect );
    environment.insert( QStringLiteral( "GRASS_HTML_BROWSER" ), QgsGrassUtils::htmlBrowserPath() );
开发者ID:exlimit,项目名称:QGIS,代码行数:66,代码来源:qgsgrassmodule.cpp


示例18: process

void MigrateDialog::process()
{
    unsigned size = 0;
    for (list<QCheckBox*>::iterator it = m_boxes.begin(); it != m_boxes.end(); ++it){
        if (!(*it)->isChecked())
            continue;
        QString path = user_file((*it)->text());
        path += '/';
        icqConf.close();
        clientsConf.close();
        contactsConf.close();
        icqConf.setFileName(path + "icq.conf");
        clientsConf.setFileName(path + "clients.conf");
        contactsConf.setFileName(path + "contacts.conf");
        lblStatus->setText(path + "icq.conf");
        if (!icqConf.open(QIODevice::ReadOnly)){
            error(i18n("Can't open %1") .arg(path + "icq.conf"));
            return;
        }
        if (!clientsConf.open(QIODevice::WriteOnly | QIODevice::Truncate)){
            error(i18n("Can't open %1") .arg(path + "clients.conf"));
            return;
        }
        if (!contactsConf.open(QIODevice::WriteOnly | QIODevice::Truncate)){
            error(i18n("Can't open %1") .arg(path + "contacts.conf"));
            return;
        }
        m_uin    = 0;
        m_passwd = "";
        m_state  = 0;
        m_grpId		= 0;
        m_contactId = 0;
        Buffer cfg;
        cfg.init(icqConf.size());
        icqConf.read(cfg.data(), icqConf.size());
        for (;;){
            QByteArray section = cfg.getSection();
            if (section.isEmpty())
                break;
            m_state = 3;
            if (section == "Group")
                m_state = 1;
            if (section == "User")
                m_state = 2;
            if (!m_bProcess)
                return;
            for (;;){
                QByteArray l = cfg.getLine();
                if (l.isEmpty())
                    break;
                QByteArray line = l;
                QByteArray name = getToken(line, '=');
                if (name == "UIN")
                    m_uin = line.toUInt();
                if (name == "EncryptPassword")
                    m_passwd = line;
                if (name == "Name")
                    m_name = line;
                if (name == "Alias")
                    m_name = line;
            }
            flush();
            barCnv->setValue(cfg.readPos());
            qApp->processEvents();
        }
        icqConf.close();
        clientsConf.close();
        contactsConf.close();
        m_state = 3;
        size += icqConf.size();
        if (!m_bProcess)
            return;
        barCnv->setValue(size);
        qApp->processEvents();
        QString h_path = path;
#ifdef WIN32
        h_path += "history\\";
#else
        h_path += "history/";
#endif
        QDir history(h_path);
        QStringList l = history.entryList(QStringList("*.history"), QDir::Files);
        for (QStringList::Iterator it = l.begin(); it != l.end(); ++it){
            hFrom.close();
            hTo.close();
            hFrom.setFileName(h_path + (*it));
            lblStatus->setText(h_path + (*it));
            hTo.setFileName(h_path + QString(m_owner) + '.' + it->left(it->indexOf('.')));
            if (!hFrom.open(QIODevice::ReadOnly)){
                error(i18n("Can't open %1") .arg(hFrom.fileName()));
                return;
            }
            if (!hTo.open(QIODevice::WriteOnly | QIODevice::Truncate)){
                error(i18n("Can't open %1") .arg(hTo.fileName()));
                return;
            }
            cfg.init(hFrom.size());
            hFrom.read(cfg.data(), hFrom.size());
            for (;;){
                QByteArray section = cfg.getSection();
//.........这里部分代码省略.........
开发者ID:,项目名称:,代码行数:101,代码来源:


示例19:

void pdp::Toolbar::OpenFile()
{
	//std::cout << "hi from " << __FUNCSIG__ << std::endl;

	mitk::DataNodeFactory::Pointer nodeReader = mitk::DataNodeFactory::New();
	QStringList fileNames;
	
	if(AT_HOME == 1)
	{
		fileNames = QFileDialog::getOpenFileNames(NULL, "Open", "C:\\DA\\Data\\", "*" );
	}
	else
	{
		fileNames = QFileDialog::getOpenFileNames(NULL, "Open", "E:\\Media Informatics\\thesis\\Hendrik_PhanAnh_pdp\\PA_Hendrik\\PA_Hendrik\\pdp\\Hendrik_pdp\\data", "*" );
		
	}

	if(!(fileNames.isEmpty()))
	{
		for(QStringList::Iterator fileName = fileNames.begin(); fileName != fileNames.end(); fileName++)
		{
			if(QFile::exists(fileName->toLocal8Bit().data()))
			{
				nodeReader->SetFileName(fileName->toLocal8Bit().data());
				try
				{
					nodeReader->Update();
				}
				catch (itk::ExceptionObject &ex)
				{
					std::cout << ex << std::endl;
				}
				catch (std::exception &ex1)
				{
					ex1.what();
				}

				// Adding file/image to the DataNode
				mitk::DataNode::Pointer node;
				node = nodeReader->GetOutput(0);
				
				// Add unique id
				int newId = m_ThreeDEditing->GetUniqueId();
				node->SetIntProperty("UniqueID", newId);
				node->SetBoolProperty("ModifiedThusConvert", mitk::BoolProperty::New(false));

				// Surface visualisation
				//node->SetFloatProperty("material.wireframeLineWidth", 8.0);
				node->ReplaceProperty("line width", mitk::IntProperty::New(3));

				m_ThreeDEditing->GetLungDataset()->getDataStore()->Add(node);
				m_ThreeDEditing->SetUpMitkView();
			}
			else
			{
				std::cout << "Selected file does not exist!\n";
			}
		}
	}
	else
	{
		std::cout << "No file given to the program!\n";
	}

	// Segmentations should be in the front, the reference image in the back
	SetImagesToBottom();

	//std::cout << "ciao from " << __FUNCSIG__ << std::endl;
}
开发者ID:hksonngan,项目名称:phan-anh-pdp,代码行数:69,代码来源:toolbar.cpp


示例20: handleIPCMessage

void QmitkCommonExtPlugin::handleIPCMessage(const QByteArray& msg)
{
  QDataStream ds(msg);
  QString msgType;
  ds >> msgType;

  // we only handle messages containing command line arguments
  if (msgType != "$cmdLineArgs") return;

  // activate the current workbench window
  berry::IWorkbenchWindow::Pointer window =
      berry::PlatformUI::GetWorkbench()->GetActiveWorkbenchWindow();

  QMainWindow* mainWindow =
   static_cast<QMainWindow*> (window->GetShell()->GetControl());

  mainWindow->setWindowState(mainWindow->windowState() & ~Qt::WindowMinimized);
  mainWindow->raise();
  mainWindow->activateWindow();

  // Get the preferences for the instantiation behavior
  berry::IPreferencesService* prefService = berry::Platform::GetPreferencesService();
  berry::IPreferences::Pointer prefs = prefService->GetSystemPreferences()->Node("/General");
  bool newInstanceAlways = prefs->GetBool("newInstance.always", false);
  bool newInstanceScene = prefs->GetBool("newInstance.scene", true);

  QStringList args;
  ds >> args;

  QStringList fileArgs;
  QStringList sceneArgs;

  Poco::Util::OptionSet os;
  berry::Platform::GetOptionSet(os);
  Poco::Util::OptionProcessor processor(os);
#if !defined(POCO_OS_FAMILY_UNIX)
  processor.setUnixStyle(false);
#endif
  args.pop_front();
  QStringList::Iterator it = args.begin();
  while (it != args.end())
  {
    std::string name;
    std::string value;
    if (processor.process(it->toStdString(), name, value))
    {
      ++it;
    }
    else
    {
      if (it->endsWith(".mitk"))
      {
        sceneArgs << *it;
      }
      else
      {
        fileArgs << *it;
      }
      it = args.erase(it);
    }
  }

  if (newInstanceAlways)
  {
    if (newInstanceScene)
    {
      startNewInstance(args, fileArgs);

      foreach(QString sceneFile, sceneArgs)
      {
        startNewInstance(args, QStringList(sceneFile));
      }
    }
    else
    {
开发者ID:jingheiieh,项目名称:MITK,代码行数:75,代码来源:QmitkCommonExtPlugin.cpp



注:本文中的qstringlist::Iterator类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ qstringlist::const_iterator类代码示例发布时间:2022-05-31
下一篇:
C++ qstring::const_iterator类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap