void AdjQueryDlg::keyPressEvent( QKeyEvent *e ) { switch( e->key() ) { case Key_Escape: dontKnowClicked(); break; case Key_Return: case Key_Enter: if (mw->dont_know->isDefault() ) dontKnowClicked(); else if (mw->know_it->isDefault() ) knowItClicked(); else if (mw->show_all->isDefault() ) showAllClicked(); else if (mw->verify->isDefault() ) verifyClicked(); break; default: e->ignore(); break; } }
void AdjQueryDlg::timeoutReached() { if (timercount > 0) { timercount--; mw->timebar->setProgress(timercount); qtimer->start(1000, TRUE); } if (timercount <= 0) { mw->timebar->setProgress(0); if (Prefs::queryTimeout() == Prefs::EnumQueryTimeout::Show) { showAllClicked(); mw->dont_know->setDefault(true); } else if (Prefs::queryTimeout() == Prefs::EnumQueryTimeout::Continue) emit sigQueryChoice(Timeout); } }
AdjQueryDlg::AdjQueryDlg ( QString type, int entry, int col, int query_cycle, int query_num, int query_startnum, kvoctrainExpr *exp, kvoctrainDoc *doc, const Comparison &_comp) : QueryDlgBase(i18n("Comparison Training")) { mw = new AdjQueryDlgForm(this); setMainWidget(mw); connect(mw->dont_know, SIGNAL(clicked()), SLOT(dontKnowClicked()) ); connect(mw->know_it, SIGNAL(clicked()), SLOT(knowItClicked()) ); connect(mw->verify, SIGNAL(clicked()), SLOT(verifyClicked()) ); connect(mw->show_all, SIGNAL(clicked()), SLOT(showAllClicked()) ); connect(mw->lev1Field, SIGNAL(returnPressed()), SLOT(returnPressed()) ); connect(mw->lev2Field, SIGNAL(returnPressed()), SLOT(returnPressed()) ); connect(mw->lev3Field, SIGNAL(returnPressed()), SLOT(returnPressed()) ); connect(mw->lev1Field, SIGNAL(textChanged(const QString&)), SLOT(lev1Changed(const QString&)) ); connect(mw->lev2Field, SIGNAL(textChanged(const QString&)), SLOT(lev2Changed(const QString&)) ); connect(mw->lev3Field, SIGNAL(textChanged(const QString&)), SLOT(lev3Changed(const QString&)) ); qtimer = 0; mw->lev1Label->setBuddy(mw->lev1Field); mw->lev2Label->setBuddy(mw->lev2Field); mw->lev3Label->setBuddy(mw->lev3Field); setQuery (type, entry, col, query_cycle, query_num, query_startnum, exp, doc, _comp); mw->countbar->setFormat("%v/%m"); mw->timebar->setFormat("%v"); resize(configDialogSize("AdjQueryDialog")); }
void AP2DataPlot2D::tableCellClicked(int row,int column) { if (ui.tableWidget->item(row,0)) { if (m_tableHeaderNameMap.contains(ui.tableWidget->item(row,0)->text())) { QString formatstr = m_tableHeaderNameMap.value(ui.tableWidget->item(row,0)->text()); QStringList split = formatstr.split(","); for (int i=0;i<split.size();i++) { QTableWidgetItem *item = new QTableWidgetItem(split[i]); item->setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable); ui.tableWidget->setHorizontalHeaderItem(i+1,item); } for (int i=split.size();i<ui.tableWidget->columnCount()-1;i++) { QTableWidgetItem *item = new QTableWidgetItem(); item->setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable); ui.tableWidget->setHorizontalHeaderItem(i+1,item); } if (ui.tableWidget->horizontalHeaderItem(column) && column != 0) { QString label = ui.tableWidget->item(row,0)->text() + "." + ui.tableWidget->horizontalHeaderItem(column)->text(); if (m_graphClassMap.contains(label)) { //It's an enabled m_addGraphAction->setText("Remove From Graph"); disconnect(m_addGraphAction,SIGNAL(triggered()),this,SLOT(addGraphLeft())); //Disconnect from everything disconnect(m_addGraphAction,SIGNAL(triggered()),this,SLOT(removeGraphLeft())); //Disconnect from everything disconnect(m_addGraphAction,SIGNAL(triggered()),this,SLOT(showOnlyClicked())); disconnect(m_addGraphAction,SIGNAL(triggered()),this,SLOT(showAllClicked())); connect(m_addGraphAction,SIGNAL(triggered()),this,SLOT(removeGraphLeft())); } else { m_addGraphAction->setText("Add To Graph"); disconnect(m_addGraphAction,SIGNAL(triggered()),this,SLOT(addGraphLeft())); //Disconnect from everything disconnect(m_addGraphAction,SIGNAL(triggered()),this,SLOT(removeGraphLeft())); //Disconnect from everything disconnect(m_addGraphAction,SIGNAL(triggered()),this,SLOT(showOnlyClicked())); disconnect(m_addGraphAction,SIGNAL(triggered()),this,SLOT(showAllClicked())); connect(m_addGraphAction,SIGNAL(triggered()),this,SLOT(addGraphLeft())); //Add addgraphleft } } else { //This is column 0 if (m_showOnlyActive) { m_addGraphAction->setText("Show All"); disconnect(m_addGraphAction,SIGNAL(triggered()),this,SLOT(addGraphLeft())); //Disconnect from everything disconnect(m_addGraphAction,SIGNAL(triggered()),this,SLOT(removeGraphLeft())); //Disconnect from everything disconnect(m_addGraphAction,SIGNAL(triggered()),this,SLOT(showOnlyClicked())); disconnect(m_addGraphAction,SIGNAL(triggered()),this,SLOT(showAllClicked())); connect(m_addGraphAction,SIGNAL(triggered()),this,SLOT(showAllClicked())); } else { m_addGraphAction->setText("Show only these rows"); disconnect(m_addGraphAction,SIGNAL(triggered()),this,SLOT(addGraphLeft())); //Disconnect from everything disconnect(m_addGraphAction,SIGNAL(triggered()),this,SLOT(showAllClicked())); disconnect(m_addGraphAction,SIGNAL(triggered()),this,SLOT(showOnlyClicked())); disconnect(m_addGraphAction,SIGNAL(triggered()),this,SLOT(removeGraphLeft())); //Disconnect from everything connect(m_addGraphAction,SIGNAL(triggered()),this,SLOT(showOnlyClicked())); } } } } }