AMExternalScanDataSourceAB::AMExternalScanDataSourceAB(AMDatabase* sourceDatabase, int sourceScanId, const QString& sourceDataSourceName, const QString& outputDataSourceName, RefreshDataWhenSpec whenToLoadData, QObject *parent) : AMStandardAnalysisBlock(outputDataSourceName, parent) { insideConstructor_ = true; sourceDb_ = sourceDatabase; sourceScanId_ = sourceScanId; sourceDataSourceName_ = sourceDataSourceName; // not valid until refreshData() is completed. setState(AMDataSource::InvalidFlag); scan_ = 0; // however, we should still get our rank, which means trying to load the scan AMDbObject* dbObject = 0; try { dbObject = AMDbObjectSupport::s()->createAndLoadObjectAt(sourceDb_, AMDbObjectSupport::s()->tableNameForClass<AMScan>(), sourceScanId_); /// \todo Once we have just one scan class, then we don't need to use the dynamic loader. Then we can do this without having to load the scan's raw data just to get our rank. scan_ = qobject_cast<AMScan*>(dbObject); if(!scan_) throw -1; int dataSourceIndex = scan_->indexOfDataSource(sourceDataSourceName_); if(dataSourceIndex < 0) throw -2; // good... now we'll have our rank. Requirement to not change rank once constructed is satisfied. axes_ = scan_->dataSourceAt(dataSourceIndex)->axes(); } catch(int errCode) { if(dbObject) { delete dbObject; } scan_ = 0; } scan_->retain(this); insideConstructor_ = false; switch(whenToLoadData) { case InConstructor: refreshData(); break; case DeferAfterConstructor: QTimer::singleShot(0, this, SLOT(refreshData())); break; default: case Manually: break; } }
//----------------------------------------------------------------------------- void MemPanel::refresh() { long n = parser.GetNumVar(), m=0; for(long i=0;i<n;i++) if(parser.GetVar(i)) m++; tab->setRowCount(m); QString s; QTableWidgetItem *it; Qt::ItemFlags flags=Qt::ItemIsSelectable|Qt::ItemIsEnabled; for(long i=m=0;i<n;i++) { mglDataA *v = parser.GetVar(i); if(!v) continue; s = QString::fromStdWString(v->s); it = new QTableWidgetItem(s); tab->setItem(m,0,it); it->setFlags(flags); s.sprintf("%ld * %ld * %ld", v->GetNx(), v->GetNy(), v->GetNz()); it = new QTableWidgetItem(s); tab->setItem(m,1,it); it->setFlags(flags); it->setTextAlignment(Qt::AlignHCenter|Qt::AlignVCenter); s.sprintf("%12ld", v->GetNN()*sizeof(mreal)); it = new QTableWidgetItem(s); tab->setItem(m,2,it); it->setFlags(flags); it->setTextAlignment(Qt::AlignRight|Qt::AlignVCenter); if(v->o) refreshData((QWidget *)v->o); m++; } tab->sortItems(colSort); }
void SensorDashboard::refreshClicked() { mAutoRefresh->setChecked(false); emit subscribeSensorData(false); refreshData(); }
void Kandas::Daemon::Engine::registerClient() { ++m_clientCount; //make sure the client has up-to-date data refreshData(); //systemInfo(), slotInfo(), and clientInfo() signals are now sent out m_autoRefreshTimer.start(Kandas::Daemon::RefreshInterval); emit initComplete(); }
TaskManager::TaskManager(QWidget *parent) : QWidget(parent), ui(new Ui::TaskManager) { ui->setupUi(this); setConnToDB(new ConnectToDataBase()); ui->dteSearch->setDate(QDate::currentDate()); ui->dteSearch->setCalendarPopup(true); refreshData(); this->createActions(); }
void DecorateScene::ontypeItemClicked(cocos2d::Ref *pRef, Widget::TouchEventType toucht){ if (toucht == Widget::TouchEventType::ENDED) { if (typeScrollView->getNumberOfRunningActions() != 0) { return; } Button* pNode = dynamic_cast<Button*>(pRef); typeScrollView->runAction(EaseElasticInOut::create(MoveTo::create(0.5, scrollPosition2), 0.4)); currentSelType = pNode->getName(); if (itemScrollView == nullptr) { frameBanner = Sprite::create("ui/decorate/sub_box.png"); itemScrollView = ScrollPage::create(); itemScrollView->setContentSize(Size(STVisibleRect::getGlvisibleSize().width, 159)); itemScrollView->setDirection(ScrollPage::Direction::HORIZONTAL); itemScrollView->setPosition(Vec2::ZERO); frameBanner->addChild(itemScrollView); frameBanner->setAnchorPoint(Vec2(0, 0)); frameBanner->setPosition(scrollPosition1 + Vec2(STVisibleRect::getGlvisibleSize().width, 0)); addChild(frameBanner, 7); Button* downButton = Button::create("ui/decorate/sub_pulldown.png"); downButton->setAnchorPoint(Vec2(0.5, 0)); downButton->setPosition(Vec2(frameBanner->getContentSize().width/2.0, frameBanner->getContentSize().height-15)); downButton->addTouchEventListener(CC_CALLBACK_2(DecorateScene::onDownButtonClicked, this)); frameBanner->addChild(downButton, 1); // downButton->setScale9Enabled(true); refreshData(); frameBanner->runAction(Sequence::create(EaseSineInOut::create(MoveTo::create(0.8, scrollPosition1)), DelayTime::create(0.0f),CallFunc::create([=]{ itemScrollView->scrollToPercentHorizontal(60, 0.7, true); }), DelayTime::create(0.8), CallFunc::create([=]{ itemScrollView->scrollToPercentHorizontal(0, 0.8, true); }),NULL)); }else { refreshData(); frameBanner->runAction(EaseElasticInOut::create(MoveTo::create(0.5, scrollPosition1), 0.4)); } } }
Kandas::Daemon::Engine::Engine() : QObject() , m_clean(true) , m_clientCount(0) , m_system(Kandas::SystemUnchecked) { //auto refresh connect(&m_autoRefreshTimer, SIGNAL(timeout()), this, SLOT(refreshData())); //D-Bus new KandasAdaptor(this); QDBusConnection bus = QDBusConnection::systemBus(); if (!bus.registerService("org.kandas")) { kError() << "Could not register service. D-Bus returned:" << bus.lastError().message(); m_clean = false; } else bus.registerObject("/", this); //schedule initial data updates QTimer::singleShot(0, this, SLOT(refreshData())); }
void SensorDashboard::autoRefreshToggled(bool checked) { uint time = QDateTime::currentDateTime().toTime_t(); uint timeDiff = periodTo()->dateTime().toTime_t() - periodFrom()->dateTime().toTime_t(); timeDiff = qAbs(timeDiff); mPeriodFrom->setDateTime(QDateTime::fromTime_t(time - timeDiff)); mPeriodTo->setDateTime(QDateTime::fromTime_t(time)); refreshData(); emit subscribeSensorData(checked); }
//connect signals and slots void ServerDashboard::createActions() { //quit app connect(ui->quitAction,SIGNAL(triggered()), this,SLOT(quitApp())); //stundetclass maintain add item to the list connect(ui->studentClassInfoMaintain,SIGNAL(clicked()), this,SLOT(studentClassInfoMaintainAddItemSlot())); //refresh student and class list info connect(studentClassMaintainWin,SIGNAL(refreshData()), this,SLOT(refreshMaintainData())); //change the student list in studentmaintain list connect(studentClassMaintainWin,SIGNAL(clickRootItem(QString)), this,SLOT(setCurrentClass(QString))); }
void AssetBrowserViewModel::updateFolderContentsFilter(const Variant& filter) { std::string newFilter = ""; if (filter.typeIs<std::string>()) { bool isOk = filter.tryCast(newFilter); if (isOk) { // Set the new filter for folder contents impl_->data_->setFolderContentsFilter(newFilter); // Refresh is required to apply the new filter refreshData(); } } }
QGCFlight::QGCFlight(QWidget *parent) : QWidget(parent), uas(NULL), yawLP(0.0f), pitchLP(0.0f), refreshTimer(new QTimer()), ui(new Ui::QGCFlight) { ui->setupUi(this); connect(UASManager::instance(), SIGNAL(activeUASSet(UASInterface*)), this, SLOT(setActiveUAS(UASInterface*))); refreshTimer->setInterval(100); connect(refreshTimer, SIGNAL(timeout()), this, SLOT(refreshData())); refreshTimer->start(); }
void LLPanelGroup::onOpen(const LLSD& key) { if(!key.has("group_id")) return; // open the desired panel if (key.has("open_tab_name")) { // onOpen from selected panel will be called from onTabSelected callback LLTabContainer* tab_ctrl = getChild<LLTabContainer>("groups_accordion"); tab_ctrl->selectTabByName(key["open_tab_name"]); } LLUUID group_id = key["group_id"]; if(!key.has("action")) { setGroupID(group_id); getChild<LLAccordionCtrl>("groups_accordion")->expandDefaultTab(); return; } std::string str_action = key["action"]; if(str_action == "refresh") { if(mID == group_id || group_id == LLUUID::null) refreshData(); } else if(str_action == "close") { onBackBtnClick(); } else if(str_action == "create") { setGroupID(LLUUID::null); } else if(str_action == "refresh_notices") { LLPanelGroupNotices* panel_notices = findChild<LLPanelGroupNotices>("group_notices_tab_panel"); if(panel_notices) panel_notices->refreshNotices(); } }
void FacebookInviteView::onSearchClick(CCObject *pSender, CCControlEvent event){ m_selectAll = true; std::string sName = m_inputName->getText(); int num = m_srcData->count(); m_data->removeAllObjects(); std::transform(sName.begin(),sName.end(),sName.begin(),::toupper); for (int i=0; i<num; i++) { auto dic = _dict(m_srcData->objectAtIndex(i)); if (dic!=NULL) { string name = dic->valueForKey("name")->getCString(); std::transform(name.begin(),name.end(),name.begin(),::toupper); if (name.find(sName) < name.length() && m_data->count()<50) { dic->setObject(CCString::create("1"), "flag"); m_data->addObject(dic); } } } refreshData(0.0); }
void WeatherRequest::replyFinished(QNetworkReply *reply) { m_items.clear(); QByteArray ba = reply->readAll(); reply->deleteLater(); if(ba.isEmpty()) return; QJsonObject jobj = QJsonDocument::fromJson(ba).object(); if(jobj.contains("list")) { QJsonValue value = jobj.take("list"); if(value.isArray()) { QJsonArray array = value.toArray(); QJsonArray::iterator it = array.begin(); for(;it != array.end(); it++) { if((*it).isObject()) { QJsonObject obj = (*it).toObject(); QStringList keys = m_maps.keys(); QStringList::iterator keyIt = keys.begin(); WeatherItem item; for(; keyIt != keys.end(); keyIt++) { m_maps[*keyIt]->readData(item,obj.take(*keyIt)); } m_items.append(item); } } } } if(m_items.count() == 7) { emit refreshData(m_items); } if(!m_timer->isActive()) { m_timer->start(); } }
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); /* menu */ // Creating a menu "File" QMenu* menuFile = new QMenu("Fichier"); // And adding the menu "File" in the menu bar ui->menuBar->addMenu(menuFile); // Now we add our items // Add an item "Open" menuFile->addAction(QString("Nouvelle sequence"), this, SLOT(open_newsequence())); // Add a separator menuFile->addSeparator(); menuFile->addAction(QString("Organiser les séquences"), this, SLOT(open_organizesequence())); menuFile->addSeparator(); menuFile->addAction(QString("exporter"), this, SLOT(open_export())); menuFile->addSeparator(); menuFile->addAction(QString("importer"), this, SLOT(open_import())); menuFile->addSeparator(); // Add an item "Bye" connected to the slot "close" of the mainWindow menuFile->addAction("Quitter", this, SLOT(close()) ); /* ---- */ refreshData(); }
bool AMExternalScanDataSourceAB::loadFromDb(AMDatabase *db, int id) { // if we're not inside the constructor, verify that we have the same rank as the stored version if(!insideConstructor_) { QVariant storedRank = db->retrieve(id, dbTableName(), "rank"); if(!storedRank.isValid() || rank() != storedRank.toInt() ) { AMErrorMon::report(AMErrorReport(this, AMErrorReport::Serious, -1, "Not allowed to change the rank of an External Scan Data analysis block by re-loading it from the database.")); return false; } } // load parameters from the db in the normal way. if(!AMStandardAnalysisBlock::loadFromDb(db, id)) return false; AMDataSource::name_ = dbLoadOutputDataSourceName_; AMDatabase* sourceDb = AMDatabase::database(dbLoadConnectionName_); if(!sourceDb) { AMErrorMon::report(AMErrorReport(this, AMErrorReport::Serious, -2, "Couldn't locate the database containing the external scan data to load.")); return false; } if(scan_) { // don't want refreshData() to use an old scan object. This will ensure it loads a new one. scan_->release(this); scan_ = 0; } // from this point on, we've actually made permanent modifications to our parameters. Which means that we need to change the state to invalid if anything goes wrong from here. This will be taken care of by refreshData(). sourceDb_ = sourceDb; sourceScanId_ = dbLoadScanId_; sourceDataSourceName_ = dbLoadSourceDataSourceName_; if(!refreshData()) { return false; } return true; }
void LLPanelGroup::onOpen(const LLSD& key) { if(!key.has("group_id")) return; LLUUID group_id = key["group_id"]; if(!key.has("action")) { setGroupID(group_id); getChild<LLAccordionCtrl>("groups_accordion")->expandDefaultTab(); return; } std::string str_action = key["action"]; if(str_action == "refresh") { if(mID == group_id || group_id == LLUUID::null) refreshData(); } else if(str_action == "close") { onBackBtnClick(); } else if(str_action == "create") { setGroupID(LLUUID::null); } else if(str_action == "refresh_notices") { LLPanelGroupNotices* panel_notices = findChild<LLPanelGroupNotices>("group_notices_tab_panel"); if(panel_notices) panel_notices->refreshNotices(); } }
void MainWindow::changeAdapter() { ui->plot->detachItems(QwtPlotItem::Rtti_PlotCurve); QList<QLabel *> labels = ui->currentReadings->findChildren<QLabel*>("reading"); while( labels.count() > 0) delete labels.takeFirst(); disconnect(this,SLOT(refreshData())); disconnect(this,SLOT(sampleSeriesAdded(int))); disconnect(this,SLOT(sampleSeriesReset())); if (adapter) { disconnect(adapter,SLOT(startSampling())); disconnect(adapter,SLOT(stopSampling())); delete adapter; adapter = NULL; } if (ui->deviceSelector->currentIndex() > -1) { try { adapter = MultimeterAdapter::createAdapter(ui->deviceSelector->itemData(ui->deviceSelector->currentIndex()).toString()); } catch (...) { ; } } if (not adapter) return; /* for(int i = 0; i < adapter->getChannelCount(); i++) { QLabel *label = new QLabel(); label->setObjectName("reading"); ui->currentReadings->layout()->addWidget(label); QPalette palette; palette.setColor(QPalette::WindowText, getChannelColor(i)); label->setPalette(palette); QwtPlotCurve *curve = new QwtPlotCurve(); curve->setData(new QwtPointSeriesData(adapter->getSamplesList(i))); if (i == 0) curve->setYAxis(QwtPlot::yLeft); else curve->setYAxis(QwtPlot::yRight); curve->setPen(QPen(getChannelColor(i))); ui->plot->enableAxis(curve->yAxis()); curve->attach(ui->plot); } */ refreshData(); connect(adapter,SIGNAL(sampleSeriesAdded(int)), this, SLOT(sampleSeriesAdded(int))); connect(adapter,SIGNAL(sampleSeriesReset()), this, SLOT(sampleSeriesReset())); connect(adapter,SIGNAL(dataChanged()), this, SLOT(refreshData())); connect(ui->startButton, SIGNAL(clicked()), adapter,SLOT(startSampling())); connect(ui->stopButton, SIGNAL(clicked()), adapter, SLOT(stopSampling())); }
/** * Sets the frequency to new frequency. */ void VoiceGenerator::setFrequency(qreal frequency) { Q_ASSERT(1 / frequency < BufferSizeMilliseconds); this->m_frequency = frequency; refreshData(); }
void TaskManager::on_dteSearch_dateChanged(const QDate &date) { refreshData(); }
void TaskManager::slotCreationCompleted() { refreshData(); }
bool SingleScoreRankView::init(int type) { if (!PopupBaseView::init()) { return false; } setIsHDPanel(true); auto tmpCCB = CCBLoadFile("SinglelListView", this, this); setContentSize(tmpCCB->getContentSize()); SType = type; m_data = CCArray::create(); changeBGHeight(m_bg); float extH = getExtendHeight(); m_bottomNode->setPositionY(m_bottomNode->getPositionY() - extH); m_infoList->setContentSize( m_infoList->getContentSize() + Size(0, extH) ); int curRank = 0; if (SType == 1) { curRank = ActivityController::getInstance()->AllianceScoreRank; m_info1Label->setString(_lang("150366")); m_info2Label->setString(_lang_1("150368", "")); m_historyBtn->setPositionX(150); CCCommonUtils::setButtonTitle(m_historyBtn, _lang("150367").c_str()); CCCommonUtils::setButtonTitle(m_conRankBtn, _lang("150370").c_str()); }else if (SType == 0) { curRank = ActivityController::getInstance()->SingleScoreRank; m_info1Label->setString(_lang("150309")); m_info2Label->setString(_lang_1("150310", "")); CCCommonUtils::setButtonTitle(m_historyBtn, _lang("150314").c_str()); m_conRankBtn->setVisible(false); m_conRankBtn->setEnabled(false); } else if (SType == 2) { curRank = ActivityController::getInstance()->KingPlScoreRank; m_info1Label->setString(_lang("150309")); m_info2Label->setString(_lang_1("150310", "")); CCCommonUtils::setButtonTitle(m_historyBtn, _lang("150314").c_str()); m_conRankBtn->setVisible(false); m_conRankBtn->setEnabled(false); } else if (SType == 3) { curRank = ActivityController::getInstance()->KingAlScoreRank; m_info1Label->setString(_lang("150309")); m_info2Label->setString(_lang_1("150368", "")); m_historyBtn->setPositionX(150); CCCommonUtils::setButtonTitle(m_historyBtn, _lang("150314").c_str()); CCCommonUtils::setButtonTitle(m_conRankBtn, _lang("150370").c_str()); } if (curRank == 0) { m_info3Label->setString("5000+"); }else { m_info3Label->setString(CC_ITOA( curRank )); } // m_info3Label->setPositionX( m_info2Label->getPositionX() + m_info2Label->getContentSize().width*m_info2Label->getOriginScaleX() + 10 ); m_tableView = CCTableView::create(this, m_infoList->getContentSize()); m_tableView->setDirection(kCCScrollViewDirectionVertical); m_tableView->setVerticalFillOrder(kCCTableViewFillTopDown); m_infoList->addChild(m_tableView); refreshData(); return true; }
void ReservationView::initializeData() { emit refreshData(); }
ListModel::ListModel(const std::vector<ModelEntity> &initialData, QObject *parent) : QAbstractListModel(parent) { refreshData(initialData); }
void idle(void) { refreshData(&cuda_vbo_resource); glutPostRedisplay(); }
void ItemView::initializeData() { emit refreshData(); }
//----------------------------------------------------------------------------- // // Class MainWindow // //----------------------------------------------------------------------------- MainWindow::MainWindow(QWidget *wp) : QMainWindow(wp) { QAction *a; setWindowTitle(_("untitled - UDAV")); setAttribute(Qt::WA_DeleteOnClose); split = new QSplitter(this); ltab = new QTabWidget(split); ltab->setMovable(true); ltab->setTabPosition(QTabWidget::South); // ltab->setTabsClosable(true); rtab = new QTabWidget(split); rtab->setMovable(true); rtab->setTabPosition(QTabWidget::South); messWnd = new QDockWidget(_("Messages and warnings"),this); mess = new QTextEdit(this); messWnd->setWidget(mess); messWnd->setAllowedAreas(Qt::TopDockWidgetArea | Qt::BottomDockWidgetArea); addDockWidget(Qt::BottomDockWidgetArea, messWnd); messWnd->resize(size().width(), 0); new MessSyntax(mess); // connect(mess,SIGNAL(cursorPositionChanged()),this,SLOT(messClicked())); connect(mess,SIGNAL(selectionChanged()),this,SLOT(messClicked())); hideWnd = new QDockWidget(_("Hidden plots"),this); hidden = new TextEdit(this); hideWnd->setWidget(hidden); hideWnd->setAllowedAreas(Qt::TopDockWidgetArea | Qt::BottomDockWidgetArea); addDockWidget(Qt::BottomDockWidgetArea, hideWnd); hideWnd->resize(size().width(), 0); hidden->setReadOnly(true); connect(hidden,SIGNAL(selectionChanged()),this,SLOT(hiddenClicked())); // TODO // connect(hidden,SIGNAL(cursorPositionChanged()),this,SLOT(hiddenClicked())); calcWnd = new QDockWidget(_("Calculator"),this); aload = a = new QAction(QPixmap(":/png/document-open.png"), _("Open file"), this); connect(a, SIGNAL(triggered()), this, SLOT(choose())); a->setToolTip(_("Open and execute/show script or data from file (Ctrl+O).\nYou may switch off automatic exection in UDAV properties.")); a->setShortcut(Qt::CTRL+Qt::Key_O); asave = a = new QAction(QPixmap(":/png/document-save.png"), _("Save script"), this); connect(a, SIGNAL(triggered()), this, SLOT(save())); a->setToolTip(_("Save script to a file (Ctrl+S)")); a->setShortcut(Qt::CTRL+Qt::Key_S); acalc = a = new QAction(QPixmap(":/png/accessories-calculator.png"), _("Calculator"), this); a->setShortcut(Qt::Key_F4); a->setCheckable(true); connect(a, SIGNAL(toggled(bool)), calcWnd, SLOT(setVisible(bool))); connect(calcWnd, SIGNAL(visibilityChanged(bool)), a, SLOT(setChecked(bool))); a->setToolTip(_("Show calculator which evaluate and help to type textual formulas.\nTextual formulas may contain data variables too.")); a->setChecked(false); calcWnd->setVisible(false); ainfo = a = new QAction(_("Show info"), this); a->setShortcut(Qt::Key_F2); a->setCheckable(true); connect(a, SIGNAL(toggled(bool)), messWnd, SLOT(setVisible(bool))); connect(messWnd, SIGNAL(visibilityChanged(bool)), a, SLOT(setChecked(bool))); a->setChecked(false); messWnd->setVisible(false); ahide = a = new QAction(QPixmap(":/png/layer-visible-on.png"), _("Show hidden plots"), this); a->setShortcut(Qt::Key_F8); a->setCheckable(true); connect(a, SIGNAL(toggled(bool)), hideWnd, SLOT(setVisible(bool))); connect(hideWnd, SIGNAL(visibilityChanged(bool)), a, SLOT(setChecked(bool))); a->setChecked(false); hideWnd->setVisible(false); graph = new PlotPanel(this); rtab->addTab(graph,QPixmap(":/png/office-chart-line.png"),_("Canvas")); // connect(info,SIGNAL(addPanel(QWidget*)),this,SLOT(addPanel(QWidget*))); info = createMemPanel(this); rtab->addTab(info,QPixmap(":/png/system-file-manager.png"),_("Info")); hlp = createHlpPanel(this); rtab->addTab(hlp,QPixmap(":/png/help-contents.png"),_("Help")); edit = new TextPanel(this); edit->graph = graph; graph->textMGL = edit->edit; connect(graph->mgl,SIGNAL(showWarn(QString)),mess,SLOT(setText(QString))); connect(graph->mgl,SIGNAL(showWarn(QString)),edit->edit,SLOT(setErrMessage(QString))); connect(graph,SIGNAL(clearWarn()),mess,SLOT(clear())); ltab->addTab(edit,QPixmap(":/png/text-plain.png"),_("Script")); calcWnd->setWidget(createCalcDlg(this, edit->edit)); calcWnd->setAllowedAreas(Qt::TopDockWidgetArea | Qt::BottomDockWidgetArea); addDockWidget(Qt::BottomDockWidgetArea, calcWnd); calcWnd->resize(size().width(), 200); makeMenu(); setCentralWidget(split); setWindowIcon(QIcon(":/udav.png")); readSettings(); if(!propDlg) propDlg = new PropDialog; connect(graph, SIGNAL(save()), this, SLOT(save())); connect(graph, SIGNAL(setStatus(const QString &)), this, SLOT(setStatus(const QString &))); connect(graph, SIGNAL(animPutText(const QString &)), edit, SLOT(animPutText(const QString &))); connect(graph,SIGNAL(giveFocus()),edit->edit,SLOT(setFocus())); connect(graph->mgl, SIGNAL(objChanged(int)), edit, SLOT(setCursorPosition(int))); // connect(graph->mgl, SIGNAL(posChanged(QString)), statusBar(), SLOT(showMessage(QString))); connect(graph->mgl, SIGNAL(refreshData()), this, SLOT(refresh())); connect(graph->mgl, SIGNAL(refreshData()), edit, SLOT(refreshData())); connect(graph->mgl,SIGNAL(doubleClick(int)),edit,SLOT(newCmd(int))); connect(edit->edit,SIGNAL(textChanged()),this,SLOT(updateHidden())); connect(mess, SIGNAL(textChanged()), this, SLOT(warnChanged())); connect(propDlg, SIGNAL(sizeChanged(int,int)), graph->mgl, SLOT(imgSize(int,int))); connect(edit->edit,SIGNAL(textChanged()), this, SLOT(setAsterix())); connect(edit->edit, SIGNAL(cursorPositionChanged()), this, SLOT(editPosChanged())); connect(edit,SIGNAL(setCurrentFile(QString)),this,SLOT(setCurrentFile(QString))); connect(edit,SIGNAL(setStatus(QString)),this,SLOT(setStatus(QString))); setStatus(_("Ready")); num_wnd++; edit->setAcceptDrops(false); // for disabling default action by 'edit' setAcceptDrops(true); }
/** * Sets the amplitude for the voice. */ void VoiceGenerator::setAmplitude(qreal amplitude) { Q_ASSERT(amplitude >= 0); m_amplitude = amplitude; refreshData(); }
void TabbedOptionsDialog::initTabs() { OptionsDialogTabLayout *tab1Layout = new OptionsDialogTabLayout(this); OptionsDialogTabLayout *tab2Layout = new OptionsDialogTabLayout(this); OptionsDialogTabLayout *tab3Layout = new OptionsDialogTabLayout(this); optionsFormLayout = new OptionsFormLayout; // organize tabs' contents here Plant *p = Plant::activePlant; int row = 0; QStringList list; list << "Age" << "Probability" << "Branching"; tab1Layout->initValue(row++, new QStringList(list), p->maxAge, true, true, &(p->branching)); list .clear(); list << "Age" << "% Deviation" << "Angle"; tab1Layout->initValue(row++, new QStringList(list), p->maxAge, true, true, &(p->branchingAngle)); list .clear(); list << "Age" << "% Deviation" << "Rotation"; tab1Layout->initValue(row++, new QStringList(list), p->maxAge, true, true, &(p->branchingRotation)); // list .clear(); // list << "Age" << "% Continuity"; // tab1Layout->initValue(row++, new QStringList(list), p->maxAge, true, false, &(p->mainBranch)); list .clear(); list << "Age" << "Probability" << "Interruption"; tab1Layout->initValue(row++, new QStringList(list), p->maxAge, true, true,&(p->growthInterruption)); tabWidget->addTab(new Tab(this, tab1Layout), "Branching Behaviour"); row = 0; list .clear(); list << "Age" << "% Deviation" << "Length"; tab2Layout->initValue(row++, new QStringList(list), p->maxAge,true,true,&(p->branchLength)); list .clear(); list << "Age" << "% Deviation" << "Thickness"; tab2Layout->initValue(row++, new QStringList(list), p->maxAge,true,true,&(p->branchThickness)); list .clear(); list << "Age" << "Probability" << "Wobbliness"; tab2Layout->initValue(row++, new QStringList(list), p->maxAge,true,true,&(p->branchWobbliness)); list .clear(); list << "Age" << "% Continuity"; tab2Layout->initValue(row++, new QStringList(list), p->maxAge, true, false, &(p->mainBranch)); // list .clear(); // list << "Age" << "Gravitation"; // tab2Layout->initValue(row++, new QStringList(list), p->maxAge,false,true,&(p->gravitationalInfluence)); tabWidget->addTab(new Tab(this,tab2Layout), "Branch Geometry"); row = 0; list .clear(); list << "Age" << "Count/level"; tab3Layout->initValue(row++, new QStringList(list), p->maxAge,false,true,&(p->leafCountPerLevel)); list .clear(); list << "Age" << "Levels"; tab3Layout->initValue(row++, new QStringList(list), p->maxAge,false,true,&(p->leafLevels)); list .clear(); list << "Age" << "Angle"; tab3Layout->initValue(row++, new QStringList(list), p->maxAge,false,true,&(p->leafAngle)); list .clear(); list << "Age" << "Length"; tab3Layout->initValue(row++, new QStringList(list),p->maxAge,false,true,&(p->leafLength)); list .clear(); list << "Age" << "Width"; tab3Layout->initValue(row++, new QStringList(list), p->maxAge,false,true,&(p->leafWidth)); tabWidget->addTab(new Tab(this, tab3Layout), "Leaf Geometry"); // other options tabWidget->addTab(new Tab(this, optionsFormLayout), "Other"); connect(optionsFormLayout,SIGNAL(treeRescaled()),this,SLOT(refreshData())); }
QTreeWidgetItem *currentStudent = new QTreeWidgetItem(root,STUDENT_ITEM); //set text currentStudent->setText(0,trStudentName); //add student to studentitemlist studentItemList.insert(trStudentName,trStudent); } //conn the signal and slot void StudentClassInfoMaintain::createActions() { //change the maintain theme connect(ui->chooseMaintain,SIGNAL(currentChanged(int)), this,SLOT(setCurrentIndex(int))); // reget the data from database connect(ui->refreshBtn,SIGNAL(clicked()), this,SIGNAL(refreshData())); //set current class in class maintain connect(ui->classList,SIGNAL(itemClicked(QTreeWidgetItem*,int)), this,SLOT(setCurrentClassInClassMaintain(QTreeWidgetItem*,int))); //set current class in student maintain connect(ui->studentsList,SIGNAL(itemClicked(QTreeWidgetItem*,int)), this,SLOT(setCurrentClassInStudentMaintain(QTreeWidgetItem*,int))); //edit class connect(ui->editBtn,SIGNAL(clicked()), this,SLOT(editClassInfoSlot())); //add new class connect(ui->newBtn,SIGNAL(clicked()), this,SLOT(addClassInfoSlot())); } //clear the list