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

C++ setCurrent函数代码示例

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

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



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

示例1: while

Node* TreeWalker::nextNode(ScriptState* state)
{
    RefPtr<Node> node = m_current;
Children:
    while (Node* firstChild = node->firstChild()) {
        node = firstChild;
        short acceptNodeResult = acceptNode(state, node.get());
        if (state && state->hadException())
            return 0;
        if (acceptNodeResult == NodeFilter::FILTER_ACCEPT)
            return setCurrent(node.release());
        if (acceptNodeResult == NodeFilter::FILTER_REJECT)
            break;
    }
    while (Node* nextSibling = node->traverseNextSibling(root())) {
        node = nextSibling;
        short acceptNodeResult = acceptNode(state, node.get());
        if (state && state->hadException())
            return 0;
        if (acceptNodeResult == NodeFilter::FILTER_ACCEPT)
            return setCurrent(node.release());
        if (acceptNodeResult == NodeFilter::FILTER_SKIP)
            goto Children;
    }
    return 0;
}
开发者ID:1833183060,项目名称:wke,代码行数:26,代码来源:TreeWalker.cpp


示例2: switch

/*\reimp
*/
void WellArray::keyPressEvent(QKeyEvent* e)
{
    switch(e->key()) {                        // Look at the key code
    case Qt::Key_Left:                                // If 'left arrow'-key,
        if (curCol > 0)                        // and cr't not in leftmost col
            setCurrent(curRow, curCol - 1);        // set cr't to next left column
        break;
    case Qt::Key_Right:                                // Correspondingly...
        if (curCol < numCols()-1)
            setCurrent(curRow, curCol + 1);
        break;
    case Qt::Key_Up:
        if (curRow > 0)
            setCurrent(curRow - 1, curCol);
        break;
    case Qt::Key_Down:
        if (curRow < numRows()-1)
            setCurrent(curRow + 1, curCol);
        break;
    case Qt::Key_Space:
        setSelected(curRow, curCol);
        break;
    default:                                // If not an interesting key,
        e->ignore();                        // we don't accept the event
        return;
    }

}
开发者ID:danielkitta,项目名称:pulseview,代码行数:30,代码来源:wellarray.cpp


示例3: getCommands

ushort TGroup::execView( TView* p)
{
    if( p == 0 )
        return cmCancel;

    ushort saveOptions = p->options;
    TGroup *saveOwner = p->owner;
    TView *saveTopView = TheTopView;
    TView *saveCurrent= current;
    TCommandSet saveCommands;
    getCommands( saveCommands );
    TheTopView = p;
    p->options = p->options & ~ofSelectable;
    p->setState(sfModal, True);
    setCurrent(p, enterSelect);
    if( saveOwner == 0 )
        insert(p);
    ushort retval = p->execute();
    if( saveOwner == 0 )
        remove(p);
    setCurrent(saveCurrent, leaveSelect);    
    p->setState(sfModal, False);
    p->options = saveOptions;
    TheTopView = saveTopView;
    setCommands(saveCommands);
    return retval;
}
开发者ID:NoSuchProcess,项目名称:OrangeC,代码行数:27,代码来源:tgroup.cpp


示例4: addTeam

void TeamHolder::load()
{
    QSettings s;

    m_teams.clear();
    if (!s.contains("Teams/Locations")) {
        addTeam();
        setCurrent(0);
    } else {
        QStringList l = s.value("Teams/Locations").toStringList();

        for (int i = 0; i < l.length(); i++) {
            addTeam();
            team(i).loadFromFile(l[i]);
        }

        if (count() == 0) {
            addTeam();
            setCurrent(0);
        } else {
            if (currentTeam() >= count()) {
                setCurrent(count()-1);
            }
        }
    }

    if (!team().path().isEmpty()) {
        s.setValue("Teams/Folder", team().folder());
    }

    profile().loadFromFile(s.value("Profile/Current").toString());
}
开发者ID:Alicirno,项目名称:pokemon-online,代码行数:32,代码来源:teamholder.cpp


示例5: while

Node* TreeWalker::nextNode(JSValue*& exception)
{
    exception = 0;
    RefPtr<Node> node = m_current;
Children:
    while (Node* firstChild = node->firstChild()) {
        node = firstChild;
        short acceptNodeResult = acceptNode(node.get(), exception);
        if (exception)
            return 0;
        if (acceptNodeResult == NodeFilter::FILTER_ACCEPT)
            return setCurrent(node.release());
        if (acceptNodeResult == NodeFilter::FILTER_REJECT)
            break;
    }
    while (Node* nextSibling = node->traverseNextSibling(root())) {
        node = nextSibling;
        short acceptNodeResult = acceptNode(node.get(), exception);
        if (exception)
            return 0;
        if (acceptNodeResult == NodeFilter::FILTER_ACCEPT)
            return setCurrent(node.release());
        if (acceptNodeResult == NodeFilter::FILTER_SKIP)
            goto Children;
    }
    return 0;
}
开发者ID:Gin-Rye,项目名称:duibrowser,代码行数:27,代码来源:TreeWalker.cpp


示例6: debug

/**
 * \brief disable automatic white balance
 */
void	UVCCamera::disableAutoWhiteBalance() {
	// turn of the white balance temperature control
	white_balance_temperature_auto_control_t	wbtempauto;
	wbtempauto.bWhiteBalanceTemperatureAuto = 0;
	if (controlSupported(wbtempauto)) {
		debug(LOG_DEBUG, DEBUG_LOG, 0,
			"turn off auto white balance temperature");
		setCurrent(wbtempauto);
	} else {
		debug(LOG_DEBUG, DEBUG_LOG, 0,
			"white balance temperature auto control not supported");
	}

	// turn of automatic white balance component adjustmen
	white_balance_component_auto_control_t	wbcompauto;
	wbcompauto.bWhiteBalanceComponentAuto = 0;
	if (controlSupported(wbcompauto)) {
		debug(LOG_DEBUG, DEBUG_LOG, 0,
			"turn off auto white balance components");
		setCurrent(wbcompauto);
	} else {
		debug(LOG_DEBUG, DEBUG_LOG, 0,
			"white balance component auto control not supported");
	}

	// set the white balance temperature
	white_balance_temperature_control_t	wbtemp;
	if (controlSupported(wbtemp)) {
		wbtemp = get(GET_DEF, wbtemp);
		setCurrent(wbtemp);
		debug(LOG_DEBUG, DEBUG_LOG, 0,
			"white balance temperature set to %hu", 
			wbtemp.wWhiteBalanceTemperature);
		return;
	} else {
		debug(LOG_DEBUG, DEBUG_LOG, 0,
			"white balance temperature control not supported");
	}

	// if white balance temperature setting is not supported, try
	// setting components
	white_balance_component_control_t	wbcomp;
	if (controlSupported(wbcomp)) {
		wbcomp = get(GET_CUR, wbcomp);
		debug(LOG_DEBUG, DEBUG_LOG, 0,
			"current White Balance components B = %hu, R = %hu", 
			wbcomp.wWhiteBalanceBlue,
			wbcomp.wWhiteBalanceRed);
		wbcomp = get(GET_DEF, wbcomp);
		wbcomp.wWhiteBalanceBlue += 10;
		setCurrent(wbcomp);
		debug(LOG_DEBUG, DEBUG_LOG, 0,
			"white balance components set to B = %hu, R = %hu", 
			wbcomp.wWhiteBalanceBlue,
			wbcomp.wWhiteBalanceRed);
	} else {
		debug(LOG_DEBUG, DEBUG_LOG, 0,
			"white balance component control not supported");
	}
}
开发者ID:AndreasFMueller,项目名称:AstroPhotography,代码行数:63,代码来源:UVCCamera.cpp


示例7: setState

/*******************

Verander de status van de lader. Deze functie moet gebruikt worden aangezien bepaalde combinaties van relaystanden niet goed zijn voor de batterij
mogelijke status:   USE
					CHARGING
					DISCHARGING

*******************/
int setState(enum status new_state){
    if (new_state == status) return 1;
    // Huidige status bepaalt overgangsmethode
    switch (status) {
        case CHARGING:
            // Stel stroom in op 0A
            setCurrent(0);
            if (new_state == DISCHARGING) {
                // Ontkoppel de lader
                turnOff();
                // Schakel naar ontladen
                discharge();
                // Koppel lader
                turnOn();
                // Stel stroom in op gewenste waarde
                // TODO: gewenste stroom instellen
            }else if (new_state == USE){
                // Veilig ontkoppelen na opladen
                // Schakel naar ontladen
                discharge();
                // Ontkoppel de lader
                turnOff();
            }
            break;
        case DISCHARGING:
            // Stel stroom in op 0A
            setCurrent(0);
            // Ontkoppel de lader
            turnOff();
            if (new_state == CHARGING){
                // Schakel naar opladen
                charge();
                // Koppel de lader
                turnOn();
            }
            break;
        case USE:
            if (new_state == DISCHARGING) {
                // Schakel naar ontladen
                discharge();
                //instellen van de stroom
				setCurrentCharger(0);
				// Koppel de lader
                turnOn();
                // Stel stroom in
                // TODO: gewenste stroom instellen
            }else if (new_state == CHARGING){
                // Schakel naar opladen
                charge();
                // Koppel de lader
                turnOn();
                // Stel stroom in
                // TODO: gewenste stroom instellen
            }
            break;
        default:
            break;
    }
    return 0;
}
开发者ID:ThVanC,项目名称:Electrical_car_Olimex,代码行数:68,代码来源:lader.c


示例8: evaluate

        void evaluate()
        {
            if(m_binding) {
                if(m_binding_init) {
                    m_value = m_binding();

                    if(m_notifier) {
                        m_notifier(m_value);
                    }
                }
                else {
                    // capture inputs for this property
                    m_capture_failed = false;
                    setCurrent(this);
                    m_value = m_binding();
                    setCurrent(nullptr);

                    if(!m_capture_failed) {
                        m_binding_init = true;

                        if(m_notifier) {
                            m_notifier(m_value);
                        }
                    }
                    else {
                        resetBinding();
                    }
                }
            }
        }
开发者ID:preet,项目名称:ks_shared,代码行数:30,代码来源:KsDynamicProperty.hpp


示例9: while

//----------------------------------------------------------------------------
ctkCmdLineModuleObjectTreeWalker::TokenType ctkCmdLineModuleObjectTreeWalker::readNext()
{
  if (AtEnd) return NoToken;

  QObject* curr = 0;
  if (CurrentObject == 0)
  {
    curr = RootObject;
    if (setCurrent(curr)) return CurrentToken;
  }
  else
  {
    curr = CurrentObject;
  }

  while (true)
  {
    if (curr)
    {
      QObjectList children = curr->children();
      QListIterator<QObject*> i(children);
      i.toBack();
      while (i.hasPrevious())
      {
        ObjectStack.push(i.previous());
      }
      if (children.isEmpty())
      {
        curr = 0;
      }
      else
      {
        curr = ObjectStack.pop();
        if (setCurrent(curr)) return CurrentToken;
      }
      continue;
    }

    if (ObjectStack.isEmpty()) break;
    curr = ObjectStack.pop();
    if (setCurrent(curr)) return CurrentToken;
  }

  AtEnd = true;
  CurrentObject = 0;
  CurrentToken = NoToken;

  return NoToken;
}
开发者ID:151706061,项目名称:CTK,代码行数:50,代码来源:ctkCmdLineModuleObjectTreeWalker.cpp


示例10: Q_ASSERT

void    Properties::setTimeValue( double tv )
{
    Q_ASSERT( tv <= 1.00001 && tv >= 0. );
    _timeValue = tv;
    emit timeValueChanged( );

    if ( qFuzzyCompare( 1. + tv, 1. + 1. ) )  // Force 1. value to _last to avoid rounding problems
        setCurrent( _last );
    else
    {
        qint64 startToLastDelay = _first.msecsTo( _last );
        Q_ASSERT( startToLastDelay > 0 );
        setCurrent( _first.addMSecs( startToLastDelay * tv ) );
    }
}
开发者ID:vishnucool220,项目名称:QuickQanava,代码行数:15,代码来源:qanProperties.cpp


示例11: getView

void ViewController::addView(ControllableView *view,bool destroyOld) {
    ControllableView *tmpView = getView(view->type());
    if(tmpView == view) return;
    ControllableView * cView = currentView();
    if(tmpView) removeView(tmpView,destroyOld);
    m_views.append(view);

    m_currentViewIndex = -1; // reset index because it can be not valid
    if(cView) setCurrent(cView);
    // Check if the old current view was replaced by a new one and set new to current
    if(cView && !currentView()) setCurrent(view);

    if(view->jsObject())
        view->jsObject()->setParent(this);  // for javascript access.
}
开发者ID:cdaffara,项目名称:symbiandump-ossapps,代码行数:15,代码来源:viewcontroller.cpp


示例12: setCurrent

void KbAnimWidget::refreshList(){
    noReorder = true;
    setCurrent(0);
    ui->animList->clear();
    animations.clear();
    // Add the animations from the new lighting mode
    if(!light){
        ui->animList->setVisible(false);
        ui->noAnimLabel->setVisible(true);
        return;
    }
    QList<KbAnim*> newAnimations = light->animList();
    if(newAnimations.count() == 0){
        ui->animList->setVisible(false);
        ui->noAnimLabel->setVisible(true);
        return;
    }
    ui->animList->setVisible(true);
    foreach(KbAnim* anim, newAnimations){
        QListWidgetItem* item = new QListWidgetItem(anim->name(), ui->animList);
        item->setData(Qt::UserRole, anim->guid());
        item->setFlags(item->flags() | Qt::ItemIsEditable);
        animations[anim->guid()] = anim;
        ui->animList->addItem(item);
    }
开发者ID:0----0,项目名称:ckb,代码行数:25,代码来源:kbanimwidget.cpp


示例13: init

void eListBoxBase::lostFocus()
{
#ifndef DISABLE_LCD
	if ( descr )
	{
		delete LCDTmp;
		LCDTmp=0;
		delete tmpDescr;
		tmpDescr=0;
	}
#endif
	--have_focus;
	if (entries)
		if ( newFocus() ) //recalced ?
		{
			ePtrList<eListBoxEntry>::iterator it = current;
			init();
			setCurrent(it);
		}
		else if ( isVisible() )
		{
			int i = 0;
			for (ePtrList<eListBoxEntry>::iterator entry(top); entry != bottom; ++i, ++entry)
				if (entry == current)
					invalidateEntry(i);
		}
#ifndef DISABLE_LCD
	if (parent && parent->LCDElement)
		parent->LCDElement->setText("");
#endif
}
开发者ID:nx111,项目名称:OpenPLi-1,代码行数:31,代码来源:listbox.cpp


示例14: setCurrent

int eListBoxBaseExt::keyDown(int key)
{
	if (key >= KEY_ASCII)
	{
		browseTimer.start(2*1000,true);
		// TODO convert browseText to utf8 !!
		browseText+=(char)key;
		const char *browseBuf = browseText.c_str();
		int len = browseText.length();
		for (ePtrList<eListBoxEntry>::iterator it(childs.begin());
			it != childs.end(); ++it )
		{
			if ( !strncasecmp(it->getText().c_str(), browseBuf, len) )
			{
				if ( it != current )
				{
					browseHistory.push_front(current);
					setCurrent(*it,false);
				}
				return 1;
			}
		}
		browseText.erase(len-1,1);
	}
	return 0;
}
开发者ID:nx111,项目名称:OpenPLi-1,代码行数:26,代码来源:listbox.cpp


示例15: initCredits

void initCredits(SDL_Surface* screen)
{
  msgList=listInit(_freeCreditListItem);
  listAppendData(msgList, (void*)initMsg("Website","wizznic.org", screen));
  listAppendData(msgList, (void*)initMsg("Code/Gfx/Sfx","Jimmy Christensen", screen));
  listAppendData(msgList, (void*)initMsg("Gfx","ViperMD", screen));
  listAppendData(msgList, (void*)initMsg("Music","Sean Hawk", screen));

  listAppendData(msgList, (void*)initMsg("Thx","Qubodup", screen));
  listAppendData(msgList, (void*)initMsg("Thx","Farox", screen));
  listAppendData(msgList, (void*)initMsg("Thx","bMan", screen));
  listAppendData(msgList, (void*)initMsg("Thx","KML", screen));
  listAppendData(msgList, (void*)initMsg("Thx","Neil L", screen));
  listAppendData(msgList, (void*)initMsg("Thx","Zear", screen));
  listAppendData(msgList, (void*)initMsg("Thx","ReactorScram", screen));
  listAppendData(msgList, (void*)initMsg("Thx","torpor", screen));
  listAppendData(msgList, (void*)initMsg("Thx","klopsi", screen));

  listAppendData(msgList, (void*)initMsg("Greetings","GP32X.com", screen));
  listAppendData(msgList, (void*)initMsg("Greetings","freegamedev.net", screen));
  listAppendData(msgList, (void*)initMsg("Greetings","gcw-zero.com", screen));

  //Set current
  currentMsgIndex=0;
  setCurrent();
}
开发者ID:DusteDdk,项目名称:Wizznic,代码行数:26,代码来源:credits.c


示例16: setCurrent

void VirtualDesktopManager::handleDesktopsRemoved(uint previousCount)
{
    if (current() > count()) {
        setCurrent(count());
    }
    emit desktopsRemoved(previousCount);
}
开发者ID:8l,项目名称:kwin,代码行数:7,代码来源:virtualdesktops.cpp


示例17: getSessionName

void SessionManager::newSession()
{
	// Fetch session name
	QString name = getSessionName(tr("New Session"));
	if (name.isEmpty()) {
		return;
	}
	QString theme = m_session->theme();

	// Close open documents
	bool visible = isVisible();
	hide();
	if (!closeCurrent()) {
		if (visible) {
			show();
		}
		return;
	}
	accept();

	// Create session and make it active
	{
		QSettings session(Session::pathFromName(name), QSettings::IniFormat);
		session.setValue("ThemeManager/Theme", theme);
		session.setValue("ThemeManager/Size", QSettings().value("ThemeManager/Size"));
	}
	setCurrent(name);
}
开发者ID:neoriddle,项目名称:focuswriter,代码行数:28,代码来源:session_manager.cpp


示例18: setCurrent

void ColorBox::mousePressEvent(QMouseEvent *e)
{
    // The current cell marker is set to the cell the mouse is pressed in
    QPoint pos = e->pos();
    m_mousePressed = true;
    setCurrent(pos.x() - 5, pos.y() - 5);
}
开发者ID:KDE,项目名称:android-qt-creator,代码行数:7,代码来源:colorbox.cpp


示例19: getExtent

void *TGroup::read( ipstream& is )
{
    ushort index;

    TView::read( is );
    clip = getExtent();
    TGroup *ownerSave = owner;
    owner = this;
    last = 0;
    phase = TView::phFocused;
    current = 0;
    buffer = 0;
    lockFlag = 0;
    endState = 0;
    int count;
    is >> count;
    TView *tv;
    for( int i = 0; i < count; i++ )
        {
        is >> tv;
        if( tv != 0 )
            insertView( tv, 0 );
        }
    owner = ownerSave;
    TView *current;
    is >> index;
    current = at(index);
    setCurrent( current, TView::normalSelect );
    if (ownerGroup == NULL)
        awaken();
    return this;
}
开发者ID:NoSuchProcess,项目名称:OrangeC,代码行数:32,代码来源:tgroup.cpp


示例20: QWidget

QFEvaluationPropertyEditor::QFEvaluationPropertyEditor(QFPluginServices* services, ProgramOptions* set, QFEvaluationItem* current, int id, QWidget* parent, Qt::WindowFlags f):
    QWidget(parent, f)
{
    p=new QFEvaluationPropertyEditorPrivate(this);
    setAttribute(Qt::WA_DeleteOnClose, true);
    //std::cout<<"creating QFEvaluationPropertyEditor ... \n";
    p->id=id;
    this->current=NULL;
    p->services=services;
    p->layWidgets=NULL;
    resultsModel=new QFEvaluationResultsModel(this);
    resultsModel->init(NULL, "*");

    rdrModel=new QFProjectRawDataModel(this, NULL);
    rdrProxy=new QFEvaluationRawDataModelProxy(rdrModel);
    rdrProxy->setSourceModel(rdrModel);
    p->lstRawData=NULL;
    p->splitMain=NULL;
    p->filesListFiltered=true;

    resize(400,300);
    move(5,5);

    setSettings(set);
    //std::cout<<"creating QFEvaluationPropertyEditor ... creating widgets ...\n";
    p->createWidgets();

    resize(400,300);
    move(5,5);
    //std::cout<<"creating QFEvaluationPropertyEditor ... setting current ...\n";
    setCurrent(current);
    //std::cout<<"creating QFEvaluationPropertyEditor ... DONE!\n";
    readSettings();

}
开发者ID:jkriege2,项目名称:QuickFit3,代码行数:35,代码来源:qfevaluationpropertyeditor.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ setCurrentAction函数代码示例发布时间:2022-05-30
下一篇:
C++ setContextMenuPolicy函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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