当前位置: 首页>>代码示例>>C++>>正文


C++ QPtrList::take方法代码示例

本文整理汇总了C++中QPtrList::take方法的典型用法代码示例。如果您正苦于以下问题:C++ QPtrList::take方法的具体用法?C++ QPtrList::take怎么用?C++ QPtrList::take使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QPtrList的用法示例。


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

示例1: load

/**
 * Load settings from file
 */
void Settings::load()
{
	// Search for a file from user's home directory
	QString path = QString(getenv("HOME")) +
		QString("/") + QString(KQLCUserDir);

	QString fileName = path + QString("/") + QString(KConfigFile);
	QPtrList <QString> list;

	if (FileHandler::readFileToList(fileName, list) == true)
	{
		for (QString* s = list.first(); s != NULL; s = list.next())
		{
			if (*s == QString("Entry"))
			{
				if (*(list.next()) == QString("General"))
				{
					createContents(list);
				}
			}
		}
	}

	while (!list.isEmpty())
	{
		delete list.take(0);
	}
}
开发者ID:speakman,项目名称:qlc,代码行数:31,代码来源:settings.cpp

示例2: int

QLayoutItem *BorderLayoutIterator::takeCurrent()
{
    BorderLayout::BorderLayoutStruct *b
	= idx < int( list->count() ) ? list->take(  idx  ) : 0;
    QLayoutItem *item =  b ? b->item : 0;
    delete b;
    return item;
}
开发者ID:aroraujjwal,项目名称:qt3,代码行数:8,代码来源:border.cpp

示例3: initDeviceClasses

////////////////////////
// Device Class stuff //
////////////////////////
//
// Read all device classes from files
//
void App::initDeviceClasses()
{
  DeviceClass* dc = NULL;
  QString path = QString::null;

  QString dir;
  settings()->get(KEY_SYSTEM_DIR, dir);
  dir += QString("/") + DEVICECLASSPATH + QString("/");

  QDir d(dir);
  d.setFilter(QDir::Files);
  d.setNameFilter("*.deviceclass");
  if (d.exists() == false || d.isReadable() == false)
    {
      QString msg("Unable to read from device directory!");
      QMessageBox::warning(this, KApplicationNameShort, msg);

      return;
    }

  QStringList dirlist(d.entryList());
  QStringList::Iterator it;

  QPtrList <QString> list; // Our stringlist that contains the files' contents

  // Put a slash to the end of the directory name if it isn't there
  if (dir.right(1) != QString("/"))
    {
      dir = dir + QString("/");
    }

  // Go thru all files
  for (it = dirlist.begin(); it != dirlist.end(); ++it)
    {
      path = dir + *it;
      FileHandler::readFileToList(path, list);
      dc = DeviceClass::createDeviceClass(list);
      if (dc != NULL)
	{
	  addDeviceClass(dc);
	}

      // The list needs to be cleared between files
      while (list.isEmpty() == false)
	{
	  list.first();
	  delete list.take();
	}
    }
}
开发者ID:speakman,项目名称:qlc,代码行数:56,代码来源:app.cpp

示例4: listRandom

void WQQuiz::listRandom()
{
  QPtrList<void> list;

  for(int i = 0; i < m_quizList.count(); i++)
    list.append((void*) i);

  KRandomSequence seq;
  seq.randomize(&list);

  QuizList items;
  for(int i = 0; i < m_quizList.count(); i++)
    items.append(m_quizList[(long) list.take()]);

  m_quizList.clear();

  for(int i = 0; i < items.count(); i++)
    m_quizList.append(items[i]);
}
开发者ID:,项目名称:,代码行数:19,代码来源:

示例5: invokeDMXValueMenu

/**
 * Display a DMX value menu, divided into submenus of 16 values
 */
int VCXYPadProperties::invokeDMXValueMenu(const QPoint &point)
{
    int result;

    QPopupMenu* menu = new QPopupMenu;
    QPtrList <QPopupMenu> deleteList;

    menu->insertItem("Value", KNoID);
    menu->insertSeparator();

    menu->insertItem(QString::number(KChannelValueMin), KChannelValueMin);
    menu->insertItem(QString::number(KChannelValueMax), KChannelValueMax);
    for (t_value i = 0; i != KChannelValueMax; i += 15)
    {
        QPopupMenu* sub = new QPopupMenu();
        deleteList.append(sub);

        QString top;
        top.sprintf("%d - %d", i+1, i + 15);

        for (t_value j = 1; j < 16; j++)
        {
            QString num;
            num.setNum(i + j);
            sub->insertItem(num, i + j);
        }

        menu->insertItem(top, sub);
    }

    result = menu->exec(point);

    while (deleteList.isEmpty() == false)
    {
        delete deleteList.take(0);
    }

    delete menu;

    return result;
}
开发者ID:speakman,项目名称:qlc,代码行数:44,代码来源:vcxypadproperties.cpp

示例6: setTabEnabled

void KTabBar::setTabEnabled( int id, bool enabled )
{
    QTab * t = tab( id );
    if ( t ) {
        if ( t->isEnabled() != enabled ) {
            t->setEnabled( enabled );
            QRect r( t->rect() );
            if ( !enabled && id == currentTab() && count()>1 ) {
                int index = indexOf( id );
                index += ( index+1 == count() ) ? -1 : 1;
                t = tabAt( index );

                if ( t->isEnabled() ) {
                    r = r.unite( t->rect() );
                    QPtrList<QTab> *tablist = tabList();
                    tablist->append( tablist->take( tablist->findRef( t ) ) );
                    emit selected( t->identifier() );
                }
            }
            repaint( r );
        }
    }
}
开发者ID:Kst-plot,项目名称:kst-subversion-archive,代码行数:23,代码来源:ktabbar.cpp

示例7: int

QLayoutItem *FlowLayoutIterator::takeCurrent()
{
    return _idx < int(count()) ? _list->take( _idx ) : 0;
}
开发者ID:BackupTheBerlios,项目名称:lapsus-svn,代码行数:4,代码来源:flowlayout.cpp

示例8: int

QLayoutItem *SimpleFlowIterator::takeCurrent()
{
    return idx < int(count()) ? list->take( idx ) : 0;
}
开发者ID:OS2World,项目名称:LIB-QT3_Toolkit_Vbox,代码行数:4,代码来源:flow.cpp

示例9: tableEIT


//.........这里部分代码省略.........
						break;
					}
				}
			}
			++it;
		}

		if ( nodesc )
			desc = new EventDesc();
		if ( parse ) {
			if ( !safeLen( buf+10 ) )
				goto stop;
			desc->duration = getTime( buf+7 );
			if ( !safeLen( buf+11 ) )
				goto stop;
			desc->running = getBits(buf,80,3);
			desc->sid = sid;
			desc->tid = tid;
			desc->tsid = tsid;
			desc->nid = nid;
			desc->lsn = lsn;
			desc->sn = sn;
			desc->eid = eid;
			desc->loop = cdt;
		}

		if ( desc->sn != sn ) {
			slist->unlock();
			return false;
		}
		if ( !safeLen( buf+12 ) )
			goto stop;
		loop = getBits(buf,84,12);
		buf +=12;
		length -=(12+loop);
		while ( loop>0 ) {
			if ( parse ) {
				if ( !safeLen( buf+1 ) )
					goto stop;
				switch ( getBits(buf,0,8) ) {
					case 0x4D :
						if ( !shortEventDesc( buf, desc ) )
							goto stop;
						break;
					case 0x4E :
						if ( !extEventDesc( buf, desc ) )
							goto stop;
						break;
					default :
						break;
				}
			}
			if ( !safeLen( buf+2 ) )
				goto stop;
			loop -=( getBits(buf,8,8)+2 );
			buf +=( getBits(buf,8,8)+2 );
		}
//out:
		if ( parse ) {
			if ( !nodesc ) {
				if ( start==desc->startDateTime )
					goto ifend;
				currentEvents->take( currentEvents->find( desc ) );
			}
			desc->startDateTime = start;
			for ( i=0; i<(int)currentEvents->count(); i++ ) {
				itdesc = currentEvents->at(i);
				if ( desc->startDateTime<itdesc->startDateTime ) {
					currentEvents->insert( i, desc );
					break;
				}
				itdesc = 0;
			}
			if ( !itdesc )
				currentEvents->append( desc );
		}
ifend:
		if ( parse )
			++(desc->sn);
		if ( nodesc ) {
			cur = QDateTime::currentDateTime();
			dt = desc->startDateTime;
			sec = desc->duration.hour()*3600+desc->duration.minute()*60+desc->duration.second();
			if ( dt.addSecs( sec )<cur || desc->title.length()<3 ) {
				currentEvents->remove( desc );
			}
			else
				desc->source = currentSrc->getSource();
		}

	}
	slist->unlock();
	return true;
stop:
	slist->unlock();
	fprintf( stderr, "Stop parsing EIT (%d:%d)\n", adapter, tuner );
	if ( nodesc )
		delete desc;
	return false;
}
开发者ID:iegor,项目名称:kdesktop,代码行数:101,代码来源:dvbevents.cpp


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