int DSI::Dispatcher::poll(int timeout_ms) { int ret = ::poll(fds_table_, max_, timeout_ms); if (ret > 0) { for(unsigned int i=0; i<max_ && !finished_; ++i) { if (fds_table_[i].fd >= 0 && (fds_table_[i].revents != 0)) { if (!events_table_[i]->eval(fds_table_[i].fd, fds_table_[i].revents)) { // make sure to not delete a slot entry which was modified by the user, // e.g. by calling the sequence close() and then registering a new IO operation // which then could reuse this slot but with new revents mask set to zero. if (fds_table_[i].revents != 0) clearSlot(i); } } } } else if (ret < 0) { if (io::getLastError() == EINTR) { ret = 0; } } return ret; }
void LineEdit::backspace() { QLineEdit::backspace(); if(text().isEmpty()) clearSlot(); insertNumber(Number::toNumber(text())); }
void LineEdit::clearAll() { m_numbers.clear(); m_numbers.push(0); postfix.clear(); clearSlot(); m_operator = ""; }
void asyncclass::loopSlots() { for(int i=0; i<ASYNC_SLOTS; ++i) { if(fn[i]==asyncclass::nullfn) continue; if(timediff(fnStamp[i]) >= fnPeriod[i]) { fnStamp[i] = time; fn[i](fnContext[i]); if(!fnRepeat[i]) clearSlot(i); } } }
void DSI::Dispatcher::doRemoveAll(int fd) { for (unsigned int i=0; i<max_; ++i) { if (fds_table_[i].fd == fd) { clearSlot(i); break; } } }
static UA_StatusCode UA_NodeMap_removeNode(void *context, const UA_NodeId *nodeid) { UA_NodeMap *ns = (UA_NodeMap*)context; BEGIN_CRITSECT(ns); UA_NodeMapEntry **slot = findOccupiedSlot(ns, nodeid); UA_StatusCode retval = UA_STATUSCODE_GOOD; if(slot) retval = clearSlot(ns, slot); else retval = UA_STATUSCODE_BADNODEIDUNKNOWN; END_CRITSECT(ns); return retval; }
void FFCP::createActions() { newAct = new QAction( tr("新建"), this); //QIcon("./images/open.png"), 暂时不设置图片 newAct->setShortcut(tr("N")); connect(newAct, SIGNAL(triggered()), this, SLOT(newSlot())); openAct = new QAction(tr("打开"), this); openAct->setShortcut(tr("O")); connect(openAct, SIGNAL(triggered()), this, SLOT(openSlot())); saveAct = new QAction(tr("保存"), this); saveAct->setShortcut(tr("S")); connect(saveAct, SIGNAL(triggered()), this, SLOT(saveSlot())); quitAct = new QAction(tr("退出"), this); quitAct->setShortcut(tr("Q")); connect(quitAct, SIGNAL(triggered()), this, SLOT(close())); aboutAct = new QAction(tr("关于"), this); aboutAct->setShortcut(tr("A")); connect(aboutAct, SIGNAL(triggered()), this, SLOT(aboutSlot())); compileAct = new QAction(tr("编译"), this); compileAct->setShortcut(tr("F7")); connect(compileAct, SIGNAL(triggered()), this, SLOT(compileSlot())); simulationAct = new QAction(tr("仿真"), this); simulationAct->setShortcut(tr("F6")); connect(simulationAct, SIGNAL(triggered()), this, SLOT(simulationSlot())); downloadAct = new QAction(tr("下载"), this); downloadAct->setShortcut(tr("F5")); connect(downloadAct, SIGNAL(triggered()), this, SLOT(downloadSlot())); clearAct = new QAction(tr("清除"), this); clearAct->setShortcut(tr("F8")); connect(clearAct, SIGNAL(triggered()), this, SLOT(clearSlot())); //在工具中添加变量定义 defineAct = new QAction(tr("变量定义"),this); defineAct->setShortcut(tr("F1")); connect(defineAct, SIGNAL(triggered()), this, SLOT(defineSlot())); hardwareAct = new QAction(tr("硬件结构图"), this); defineAct->setShortcut(tr("F3")); connect(hardwareAct, SIGNAL(triggered()), this, SLOT(hardwareSlot())); softwareAct = new QAction(tr("软件流程图"), this); defineAct->setShortcut(tr("F2")); connect(softwareAct, SIGNAL(triggered()), this, SLOT(softwareSlot())); }