void GlossItem::setTextForm(const TextBit & textForm) { WritingSystem ws = textForm.writingSystem(); bool textUpdate = mTextForms.value(ws).id() == textForm.id() && mTextForms.value(ws).text() != textForm.text(); if( mTextForms.value(ws) != textForm ) { mConcordance->removeGlossItemTextFormIdPair( this, mTextForms.value(ws).id() ); mDbAdapter->updateTextForm(textForm); mTextForms.insert( ws , textForm ); setTextFormNumberFromDatabase( ws ); mConcordance->updateGlossItemTextFormConcordance( this, textForm.id() ); if( textUpdate ) mDbAdapter->clearMorphologicalAnalysisIfInconsistent(textForm.id() ); if( mMorphologicalAnalyses.contains( textForm.writingSystem() ) ) { delete mMorphologicalAnalyses.take( textForm.writingSystem() ); } mMorphologicalAnalyses.insert( ws , mDbAdapter->morphologicalAnalysisFromTextFormId( textForm.id(), mConcordance ) ); emit fieldsChanged(); emit textFormChanged(textForm); emit morphologicalAnalysisChanged( this, mMorphologicalAnalyses.value( ws ) ); } }
void GlossItem::setInterpretation(qlonglong id) { if( mId != id ) { setCandidateNumber(GlossItem::MultipleOption); setApprovalStatus(GlossItem::Approved); mId = id; mConcordance->updateGlossItemConcordance( this ); mTextForms.clear(); mGlosses.clear(); // doing it in this roundabout way makes sure that the proper signals are emitted TextBitHashIterator tfIter(mDbAdapter->guessInterpretationTextForms(mId)); while(tfIter.hasNext()) { tfIter.next(); setTextForm( tfIter.value() ); } TextBitHashIterator tfGlosses = mDbAdapter->guessInterpretationGlosses(mId); while(tfGlosses.hasNext()) { tfGlosses.next(); setGloss( tfGlosses.value() ); } emit fieldsChanged(); } }
///******************************************************************************************* void FieldsModel::clear() { //Тут удаляем ранее считанные данные о релизах в коллекции emit beginResetModel(); m_Fields.clear(); emit endResetModel(); emit fieldsChanged(); }
void GlossItem::setGlossText(const TextBit & gloss) { if( mGlosses.value(gloss.writingSystem()).id() == gloss.id() ) { if( mGlosses.value(gloss.writingSystem()).text() != gloss.text() ) { mGlosses[gloss.writingSystem()].setText( gloss.text() ); emit glossChanged(gloss); emit fieldsChanged(); } } }
ProblemWidget::ProblemWidget(QWidget *parent) : QWidget(parent) { createActions(); createControls(); updateControls(); // global signals connect(Util::scene(), SIGNAL(invalidated()), this, SLOT(updateControls())); connect(Util::problem(), SIGNAL(fieldsChanged()), this, SLOT(updateControls())); setMinimumSize(sizeHint()); }
void GlossItem::setTextFormText(const TextBit & textForm) { if( mTextForms.value(textForm.writingSystem()).id() == textForm.id() ) { if( mTextForms.value(textForm.writingSystem()).text() != textForm.text() ) { mTextForms[textForm.writingSystem()].setText(textForm.text()); mDbAdapter->clearMorphologicalAnalysisIfInconsistent( textForm.id() ); emit textFormChanged(textForm); emit fieldsChanged(); } } }
///******************************************************************************************* void FieldsModel::refresh() { // m_isNotEmpty = false; //Если уже список был сформирован, то пока предлагаю его обнулить и считать заново if (m_Fields.count()!=0) { emit beginResetModel(); clear(); emit endResetModel(); } getFields(); emit fieldsChanged(); }
void GlossItem::setGloss(const TextBit & gloss) { if( mGlosses.value(gloss.writingSystem()) != gloss ) { mConcordance->removeGlossItemGlossIdPair(this, mGlosses.value(gloss.writingSystem()).id() ); mDbAdapter->updateGloss(gloss); mGlosses.insert( gloss.writingSystem(), gloss ); setGlossNumberFromDatabase( gloss.writingSystem() ); mConcordance->updateGlossItemGlossConcordance( this, gloss.id() ); emit fieldsChanged(); emit glossChanged(gloss); } }
void GlossItem::resetBaselineText( const TextBit & baselineBit ) { mBaselineWritingSystem = baselineBit.writingSystem(); mTextForms.clear(); mGlosses.clear(); mTextForms.insert(mBaselineWritingSystem, baselineBit ); mId = -1; guessInterpretation(); updateGlossItemConcordance(); setCandidateNumberFromDatabase(); emit fieldsChanged(); emit baselineTextChanged(mTextForms.value(mBaselineWritingSystem)); }
// ------------------------------------------------------------- TRasterMapsMembers::TRasterMapPathDialog::TRasterMapPathDialog( QString Organization_, QString Application_, QStringList* ListNames_, TRasterMapFields* MapFields_, QWidget* Parent_) : QDialog(Parent_), w_MapFields(MapFields_), w_ListNames(ListNames_) { setWindowTitle(QNetMapTranslator::tr("Add raster map" /* Russian: Добавление растровой карты */)); setMinimumWidth(500); QVBoxLayout* MainLayout = new QVBoxLayout; // поля ввода w_PathField = new TPathField( QNetMapTranslator::tr("Raster map file" /* Russian: Файл с растровой картой */), Organization_, Application_, QNetMapConsts::FilePathKey, 10, TPathField::Consts::BrowseFile, QNetMapTranslator::tr("Images" /* Russian: Изображения */) + QString(" (*.png *.tif *.jpg *.bmp *.gif)")); w_NameField = new TTextField( QNetMapTranslator::tr("Display name" /* Russian: Отображаемое имя */), Organization_, Application_, QNetMapConsts::NameKey); // Кнопки подтверждения / отмены m_ButtonBox.setMinimumSize(QSize(0, 30)); m_ButtonBox.setOrientation(Qt::Horizontal); m_ButtonBox.setStandardButtons(QDialogButtonBox::Cancel | QDialogButtonBox::Ok); /// находим кнопку ОК и делаем ее недоступной QList<QAbstractButton*> ListButtons = m_ButtonBox.buttons(); foreach(QAbstractButton* Button, ListButtons) { if(m_ButtonBox.buttonRole(Button) == QDialogButtonBox::AcceptRole) { Button->setEnabled(false); w_ButtonOK = Button; break; } } // все помещаем на основной лайоут MainLayout->addWidget(w_PathField); MainLayout->addWidget(w_NameField); MainLayout->addWidget(&m_ButtonBox); setLayout(MainLayout); // сигналы QNM_DEBUG_CHECK(connect(w_PathField, SIGNAL(editTextChanged(const QString&)), this, SLOT(fieldsChanged()))); QNM_DEBUG_CHECK(connect(w_NameField, SIGNAL(editTextChanged(const QString&)), this, SLOT(fieldsChanged()))); QNM_DEBUG_CHECK(connect(&m_ButtonBox, SIGNAL(accepted()), this, SLOT(accept()))); QNM_DEBUG_CHECK(connect(&m_ButtonBox, SIGNAL(rejected()), this, SLOT(reject()))); // fieldsChanged(); }
Agros2D::Agros2D() { clearAgros2DCache(); m_problem = new Problem(); m_scene = new Scene(); QObject::connect(m_problem, SIGNAL(fieldsChanged()), m_scene, SLOT(doFieldsChanged())); QObject::connect(m_scene, SIGNAL(invalidated()), m_problem, SLOT(clearSolution())); initLists(); m_solutionStore = new SolutionStore(); m_configComputer = new Config(); m_configComputer->load(); // log m_log = new Log(); // memory monitor m_memoryMonitor = new MemoryMonitor(); }