void Run::handleAlgorhitmDone(int lineNo, quint32 colStart, quint32 colEnd) { algDoneMutex_->lock(); algDoneFlag_ = true; algDoneMutex_->unlock(); if (mustStop()) emit lineChanged(lineNo, colStart, colEnd); else emit lineChanged(-1, 0u, 0u); }
bool Run::noticeOnLineChanged(int lineNo, quint32 colStart, quint32 colEnd) { if (ignoreLineChangeFlag_) { ignoreLineChangeFlag_ = false; return true; } stepDoneMutex_->lock(); stepDoneFlag_ = true; stepDoneMutex_->unlock(); if (mustStop()) emit lineChanged(lineNo, colStart, colEnd); else emit lineChanged(-1, 0u, 0u); return true; }
// ------------------------------------------------------------------------ void MainWindow::setUpSignals() { // image control slots connect(this->imageList->getImageList(), SIGNAL(itemSelectionChanged()), this, SLOT(imageSelectionChanged())); connect(this->zSlider, SIGNAL(valueChanged(int)), this, SLOT(sliderSelectionChanged())); connect(this->tSlider, SIGNAL(valueChanged(int)), this, SLOT(sliderSelectionChanged())); // button slots connect(this->addLineButton, SIGNAL(pressed()), this, SLOT(addLinePressed())); connect(this->removeLineButton, SIGNAL(pressed()), this, SLOT(removeLinePressed())); connect(this->propagateLineButton, SIGNAL(pressed()), this, SLOT(propagateLinePressed())); connect(this->lockLineButton, SIGNAL(pressed()), this, SLOT(lockLine())); connect(this->lineList->getWidget(), SIGNAL(itemSelectionChanged()), this, SLOT(lineChanged())); connect(this->controls, SIGNAL(rightPressed()), this, SLOT(tSliderRight())); connect(this->controls, SIGNAL(leftPressed()), this, SLOT(tSliderLeft())); connect(this->controls, SIGNAL(lockPressed()), this, SLOT(lockLine())); connect(this->controls, SIGNAL(propagatePressed()), this, SLOT(propagateLinePressed())); connect(this->imageTypeButton, SIGNAL(pressed()), this, SLOT(imageTypePressed())); // connect the load and save connect(this->saveAction, SIGNAL(triggered()), this, SLOT(saveActionPressed())); connect(this->newAction, SIGNAL(triggered()), this, SLOT(newActionPressed())); connect(this->loadAction, SIGNAL(triggered()), this, SLOT(loadActionPressed())); connect(this->saveAsAction, SIGNAL(triggered()), this, SLOT(saveAsActionPressed())); connect(this->processDicomAction, SIGNAL(triggered()), this, SLOT(processDicomPressed())); connect(this->exportVideos, SIGNAL(triggered()), this, SLOT(exportVideosPressed())); }
void SkinDocument::cursorChanged() { if(editor->isError(editor->textCursor().blockNumber() + 1)) { QTextCursor line = editor->textCursor(); line.movePosition(QTextCursor::StartOfLine); line.movePosition(QTextCursor::EndOfLine, QTextCursor::KeepAnchor); skin_parse(line.selectedText().toAscii()); if(skin_error_line() > 0) parseStatus = tr("Error on line ") + QString::number(line.blockNumber() + 1) + tr(": ") + skin_error_message(); statusLabel->setText(parseStatus); } else if(editor->hasErrors()) { parseStatus = tr("Errors in document"); statusLabel->setText(parseStatus); } else { emit lineChanged(editor->textCursor().blockNumber() + 1); } }
bool Run::noticeOnFunctionReturn() { algDoneMutex_->lock(); algDoneFlag_ = true; algDoneMutex_->unlock(); emit lineChanged(vm->effectiveLineNo(), vm->effectiveColumn().first, vm->effectiveColumn().second); return true; }
void Run::runToEnd() { stepDoneFlag_ = false; algDoneFlag_ = false; breakHitFlag_ = false; ignoreLineChangeFlag_ = false; emit lineChanged(-1, 0u, 0u); _runMode = Shared::RunInterface::RM_StepOut; vm->setNextCallToEndOfContext(); start(); }
void kMyMoneyLineEdit::focusOutEvent(QFocusEvent *ev) { // if the current text is not in the list of // possible completions, we have a new payee // and signal that to the outside world. if (text() != d->m_text) { emit lineChanged(text()); } KLineEdit::focusOutEvent(ev); // force update of hint if (text().isEmpty()) repaint(); }
void WordChecker::checkWord(const QString currentLine) { QString compareLine = mSpeedText.section('\n', mLine, mLine); QString compareString = compareLine.left(currentLine.length()); if (currentLine.compare(compareString) == 0) { // Update the number of correct characters entered. mNbrOfCharacters = mEnteredLines.length() + currentLine.length(); emit nbrOfCharactersChanged(mNbrOfCharacters); // Update the number of characters that is left to enter. mRemainingTextLength = mSpeedTextLength - mNbrOfCharacters; // Updates the Qstring holding the text that is not yet typed. mRemainingText = mSpeedText.right(mRemainingTextLength); emit remainingTextChanged(mRemainingText); if (compareLine.length() == currentLine.length()) { // If at the end of a line, update the line and enteredLines // property with the number of lines and the text entered so far mLine++; // Update the entered lines. mEnteredLines = mSpeedText.section('\n', 0, mLine - 1) + "\n"; emit enteredLinesChanged(mEnteredLines); // lineChanged signal needs to be emitted after enteredLinesChanged. If not, the // speedtext will be updated with the just entered line instead of a new one. emit lineChanged(mLine); // Start a new line by setting the current correct line to an empty string. mCurrentCorrectLine = ""; emit currentCorrectLineChanged(mCurrentCorrectLine); if (mNbrOfCharacters >= mSpeedTextLength) { // When the entire text has been correctly entered return end. emit ended(); } } else { mCurrentCorrectLine = currentLine; emit currentCorrectLineChanged(mCurrentCorrectLine); } setValid(true); } else { setValid(false); } }
void BtMixedEdit::setIsWeight(bool state) { // But you have to admit, this is clever if (state) { _type = Unit::Mass; _units = Units::kilograms; } else { _type = Unit::Volume; _units = Units::liters; } // maybe? My head hurts now lineChanged(); }
BtLineEdit::BtLineEdit(QWidget *parent, Unit::UnitType type) : QLineEdit(parent), btParent(parent), _type(type), _forceUnit(Unit::noUnit), _forceScale(Unit::noScale) { _section = property("configSection").toString(); /* btParent = parent; _type = type; _forceUnit = Unit::noUnit; _forceScale = Unit::noScale; */ connect(this,SIGNAL(editingFinished()),this,SLOT(lineChanged())); }
WordResult WordChecker::checkWord(const QString currentLine) { QString compareLine = mSpeedText.section('\n', mLine, mLine); QString compareString = compareLine.left(currentLine.length()); if (currentLine.compare(compareString) == 0) { // Update the number of correct characters entered. mNbrOfCharacters = mEnteredLines.length() + currentLine.length(); emit nbrOfCharactersChanged(mNbrOfCharacters); if (mNbrOfCharacters >= mSpeedTextLength) { emit ended(); // When the entire text has been correctly entered return end. return WordResult_End; } if (compareLine.length() == currentLine.length()) { // If at the end of a line, update the line and enteredLines // property with the number of lines and the text entered so far mLine++; emit lineChanged(mLine); // Update the entered lines. mEnteredLines = mSpeedText.section('\n', 0, mLine - 1) + "\n"; emit enteredLinesChanged(mEnteredLines); // Start a new line by setting the current correct line to an empty string. mCurrentCorrectLine = ""; emit currentCorrectLineChanged(mCurrentCorrectLine); return WordResult_NewLine; } else { mCurrentCorrectLine = currentLine; emit currentCorrectLineChanged(mCurrentCorrectLine); } return WordResult_Correct; } return WordResult_Wrong; }
BtLineEdit::BtLineEdit(QWidget *parent, FieldType type) : QLineEdit(parent) { btParent = parent; _type = type; switch( _type ) { case MASS: // I don't ... oh bugger _units = Units::kilograms; break; case VOLUME: _units = Units::liters; break; case TEMPERATURE: _units = Units::celsius; break; case TIME: _units = Units::minutes; break; case COLOR: _units = Units::srm; break; case DENSITY: _units = Units::sp_grav; break; case MIXED: _units = Units::kilograms; break; case GENERIC: case STRING: _units = 0; break; } connect(this,SIGNAL(editingFinished()),this,SLOT(lineChanged())); }
void Run::run() { while (vm->hasMoreInstructions()) { if (mustStop()) { break; } vm->evaluateNextInstruction(); if (vm->error().length()>0 && !stoppingFlag_) { int lineNo = vm->effectiveLineNo(); std::pair<quint32,quint32> colNo = vm->effectiveColumn(); emit lineChanged(lineNo, colNo.first, colNo.second); emit error(QString::fromStdWString(vm->error())); break; } } if (vm->error().length() == 0 && !stoppingFlag_ && vm->entryPoint() == KumirVM::EP_Testing) { qApp->setProperty("returnCode", vm->returnCode()); } // bool wasError = vm->error().length()>0; // Unclosed files is an error only if program reached end bool unclosedFilesIsNotError = stoppingFlag_ || vm->hasMoreInstructions(); // Must close all files if program reached end or user terminated bool programFinished = stoppingFlag_ || !vm->hasMoreInstructions() || vm->error().length(); // __check_for_unclosed_files__st_funct(unclosedFilesIsNotError, closeUnclosedFiles); // vm->updateStFunctError(); // if (!wasError && vm->error().length()>0) { // emit lineChanged(vm->effectiveLineNo()); // emit error(QString::fromStdWString(vm->error())); // } if (programFinished) Kumir::finalizeStandardLibrary(); emit aboutToStop(); }
void Text::dispatchEvents() { int old_line = m_old_line + (m_old_start_index / m_width); int new_line = m_line + (m_start_index / m_width); if (old_line != new_line) { m_old_line = m_line; emit lineChanged(); } if (m_latin != m_latin_old) { m_latin_old = m_latin; emit latinChanged(); } if (m_old_start_index != m_start_index || m_text_dirty) { m_text_dirty = false; QString old_text = m_text; m_text = m_text_line->mid(m_start_index, m_end_index - m_start_index + 1); if (m_old_start_index != m_start_index) { m_old_start_index = m_start_index; emit indexChanged(); } emit textChanged(); } if (m_style_dirty) { m_style_dirty = false; bool emit_foreground = m_new_style.foreground != m_style.foreground; bool emit_background = m_new_style.background != m_style.background; TextStyle::Styles new_style = m_new_style.style; TextStyle::Styles old_style = m_style.style; bool emit_bold = false; bool emit_blink = false; bool emit_underline = false; bool emit_inverse = false; if (new_style != old_style) { emit_bold = differentStyle(new_style, old_style, TextStyle::Bold); emit_blink = differentStyle(new_style, old_style, TextStyle::Blinking); emit_underline = differentStyle(new_style, old_style, TextStyle::Underlined); emit_inverse = differentStyle(new_style, old_style, TextStyle::Inverse); } m_style = m_new_style; if (emit_inverse) { setForegroundColor(); setBackgroundColor(); } else { if (emit_foreground || emit_bold) { setForegroundColor(); } if (emit_background) { setBackgroundColor(); } } if (emit_bold) { emit boldChanged(); } if (emit_blink) { emit blinkingChanged(); } if (emit_underline) { emit underlineChanged(); } } if (m_visible_old != m_visible) { m_visible_old = m_visible; emit visibleChanged(); } }
TContainerLine::TContainerLine(QWidget *parent, QPoint p, QWidget *cWidget) : RptContainer(parent,p,cWidget) { QString stl = "TContainerLine#lbl {;" "border-width:1px;" "border-style:solid;" "border-color:rgba(0,0,0,255);" "border-top-color:rgba(0,0,0,255);" "border-left-color:rgba(0,0,0,255);" "border-right-color:rgba(0,0,0,255);" "border-bottom-color:rgba(0,0,0,255);" "color:rgba(0,0,0,255);" "background-color:rgba(255,255,255,0);" "}"; cs = 0; ce = 0; m_arrowStart = false; m_arrowEnd = true; this->setStyleSheet(stl); this->resize(10,10); this->setBaseSize(width(),height()); this->allowResize(false); this->allowDrawSelection(false); this->setAutoFillBackground(true); this->move(-50,-50); line.setP1( QPoint() ); line.setP2( QPoint() ); QPalette Pal(palette()); Pal.setColor(QPalette::Background, Qt::blue); cs = new XYZContainer(parent,QPoint(line.p1().x(), line.p2().y())); cs->setObjectName("CS"); cs->resize(6,6); cs->allowResize(false); cs->allowDrawSelection(false); cs->setVisible(false); cs->setAutoFillBackground(true); cs->setPalette(Pal); ce = new XYZContainer(parent,QPoint(line.p2().x(), line.p2().y())); ce->setObjectName("CE"); ce->resize(6,6); ce->allowResize(false); ce->allowDrawSelection(false); ce->setVisible(false); ce->setAutoFillBackground(true); ce->setPalette(Pal); QObject::connect(cs, SIGNAL(newGeometry(QRect, QRect)), this, SIGNAL(newGeometry(QRect, QRect))); QObject::connect(ce, SIGNAL(newGeometry(QRect, QRect)), this, SIGNAL(newGeometry(QRect, QRect))); QObject::connect(ce, SIGNAL(newGeometry(QRect, QRect)), this, SLOT(lineChanged(QRect, QRect))); QObject::connect(cs, SIGNAL(newGeometry(QRect, QRect)), this, SLOT(lineChanged(QRect, QRect))); //QObject::connect(cs, SIGNAL(geomChanged(QRect, QRect)), this, SIGNAL(geomChanged(QRect, QRect))); //QObject::connect(ce, SIGNAL(geomChanged(QRect, QRect)), this, SIGNAL(geomChanged(QRect, QRect))); QObject::connect(cs, SIGNAL(geomChanged(QRect, QRect)), this, SLOT(geomContChanged(QRect, QRect))); QObject::connect(ce, SIGNAL(geomChanged(QRect, QRect)), this, SLOT(geomContChanged(QRect, QRect))); QObject::connect(cs, SIGNAL(destroyed()), this, SLOT(delItemInTree())); QObject::connect(ce, SIGNAL(destroyed()), this, SLOT(delItemInTree())); QObject::connect(this, SIGNAL(delCont(QTreeWidgetItem *)), this, SLOT(delItemInTree())); QObject::connect(cs, SIGNAL(inFocus(bool)), this, SLOT(m_inFocus(bool))); QObject::connect(ce, SIGNAL(inFocus(bool)), this, SLOT(m_inFocus(bool))); //QObject::connect(this, SIGNAL(inFocus(bool)), cs, SIGNAL(inFocus(bool))); //QObject::connect(this, SIGNAL(inFocus(bool)), ce, SIGNAL(inFocus(bool))); this->show(); }
EquipmentEditor::EquipmentEditor(QWidget* parent, bool singleEquipEditor) : QDialog(parent) { doLayout(); if( singleEquipEditor ) { //horizontalLayout_equipments->setVisible(false); for(int i = 0; i < horizontalLayout_equipments->count(); ++i) { QWidget* w = horizontalLayout_equipments->itemAt(i)->widget(); if(w) w->setVisible(false); } pushButton_new->setVisible(false); } // Set grain absorption label based on units. Unit* weightUnit = 0; Unit* volumeUnit = 0; Brewtarget::getThicknessUnits( &volumeUnit, &weightUnit ); label_absorption->setText(tr("Grain absorption (%1/%2)").arg(volumeUnit->getUnitName()).arg(weightUnit->getUnitName())); equipmentListModel = new EquipmentListModel(equipmentComboBox); equipmentSortProxyModel = new BeerXMLSortProxyModel(equipmentListModel); equipmentComboBox->setModel(equipmentSortProxyModel); obsEquip = 0; // Connect all the edit boxen connect(lineEdit_boilTime,SIGNAL(textModified()),this,SLOT(updateCheckboxRecord())); connect(lineEdit_evaporationRate,SIGNAL(textModified()),this,SLOT(updateCheckboxRecord())); connect(lineEdit_topUpWater,SIGNAL(textModified()),this,SLOT(updateCheckboxRecord())); connect(lineEdit_trubChillerLoss,SIGNAL(textModified()),this,SLOT(updateCheckboxRecord())); // Set up the buttons connect( pushButton_save, SIGNAL( clicked() ), this, SLOT( save() ) ); connect( pushButton_new, SIGNAL( clicked() ), this, SLOT( newEquipment() ) ); connect( pushButton_cancel, SIGNAL( clicked() ), this, SLOT( cancel() ) ); connect( pushButton_remove, SIGNAL( clicked() ), this, SLOT( removeEquipment() ) ); connect( pushButton_absorption, SIGNAL( clicked() ), this, SLOT( resetAbsorption() ) ); connect( equipmentComboBox, SIGNAL(activated(const QString&)), this, SLOT( equipmentSelected() ) ); // Check boxen connect(checkBox_calcBoilVolume, SIGNAL(stateChanged(int)), this, SLOT(updateCheckboxRecord())); connect(checkBox_defaultEquipment, SIGNAL(stateChanged(int)), this, SLOT(updateDefaultEquipment(int))); // Labels connect(label_boilSize, SIGNAL(labelChanged(unitDisplay,unitScale)), lineEdit_boilSize, SLOT(lineChanged(unitDisplay,unitScale))); connect(label_batchSize, SIGNAL(labelChanged(unitDisplay,unitScale)), lineEdit_batchSize, SLOT(lineChanged(unitDisplay,unitScale))); connect(label_evaporationRate, SIGNAL(labelChanged(unitDisplay,unitScale)), lineEdit_evaporationRate, SLOT(lineChanged(unitDisplay,unitScale))); connect(label_topUpWater, SIGNAL(labelChanged(unitDisplay,unitScale)), lineEdit_topUpWater, SLOT(lineChanged(unitDisplay,unitScale))); connect(label_boilingPoint, SIGNAL(labelChanged(unitDisplay,unitScale)), lineEdit_boilingPoint, SLOT(lineChanged(unitDisplay,unitScale))); connect(label_tunVolume, SIGNAL(labelChanged(unitDisplay,unitScale)), lineEdit_tunVolume, SLOT(lineChanged(unitDisplay,unitScale))); connect(label_tunWeight, SIGNAL(labelChanged(unitDisplay,unitScale)), lineEdit_tunWeight, SLOT(lineChanged(unitDisplay,unitScale))); connect(label_lauterDeadspace, SIGNAL(labelChanged(unitDisplay,unitScale)), lineEdit_lauterDeadspace, SLOT(lineChanged(unitDisplay,unitScale))); connect(label_trubChillerLoss, SIGNAL(labelChanged(unitDisplay,unitScale)), lineEdit_trubChillerLoss, SLOT(lineChanged(unitDisplay,unitScale))); connect(label_topUpKettle, SIGNAL(labelChanged(unitDisplay,unitScale)), lineEdit_topUpKettle, SLOT(lineChanged(unitDisplay,unitScale))); connect(label_boilTime, SIGNAL(labelChanged(unitDisplay,unitScale)), lineEdit_boilTime, SLOT(lineChanged(unitDisplay,unitScale))); QMetaObject::connectSlotsByName(this); // make sure the dialog gets populated the first time it's opened from the menu equipmentSelected(); }
void KInvestmentDetailsWizardPage::setupInvestmentSymbol() { m_investmentSymbol->setFocus(); connect(m_investmentSymbol, SIGNAL(lineChanged(QString)), this, SIGNAL(checkForExistingSymbol(QString))); }
void BtLineEdit::lineChanged() { lineChanged(Unit::noUnit,Unit::noScale); }
HydrometerTool::HydrometerTool(QWidget* parent) : QDialog(parent) { doLayout(); connect( pushButton_convert, SIGNAL(clicked()), this, SLOT(convert()) ); connect(label_inputTemp, SIGNAL(labelChanged(Unit::unitDisplay,Unit::unitScale)), lineEdit_inputTemp, SLOT(lineChanged(Unit::unitDisplay,Unit::unitScale))); connect(label_inputSg, SIGNAL(labelChanged(Unit::unitDisplay,Unit::unitScale)), lineEdit_inputSg, SLOT(lineChanged(Unit::unitDisplay,Unit::unitScale))); connect(label_outputSg, SIGNAL(labelChanged(Unit::unitDisplay,Unit::unitScale)), lineEdit_outputSg, SLOT(lineChanged(Unit::unitDisplay,Unit::unitScale))); QMetaObject::connectSlotsByName(this); }
void Clef::setLine(int line) { if (d->line == line) return; d->line = line; emit lineChanged(line); }