Ignore:
Timestamp:
Jul 12, 2017, 7:11:51 PM (9 years ago)
Author:
Frederik Heber <frederik.heber@…>
Branches:
Action_Thermostats, Adding_MD_integration_tests, Adding_StructOpt_integration_tests, AutomationFragmentation_failures, Candidate_v1.6.1, Candidate_v1.7.0, Candidate_v1.7.1, ChemicalSpaceEvaluator, Enhanced_StructuralOptimization, Enhanced_StructuralOptimization_continued, Exclude_Hydrogens_annealWithBondGraph, Fix_Verbose_Codepatterns, ForceAnnealing_with_BondGraph, ForceAnnealing_with_BondGraph_continued, ForceAnnealing_with_BondGraph_continued_betteresults, ForceAnnealing_with_BondGraph_contraction-expansion, Gui_displays_atomic_force_velocity, JobMarket_RobustOnKillsSegFaults, JobMarket_StableWorkerPool, PythonUI_with_named_parameters, Recreated_GuiChecks, StoppableMakroAction, TremoloParser_IncreasedPrecision, stable
Children:
4c6f0d
Parents:
b10593
git-author:
Frederik Heber <frederik.heber@…> (07/12/17 12:20:23)
git-committer:
Frederik Heber <frederik.heber@…> (07/12/17 19:11:51)
Message:

FIX: several Qt...Lists required mutex to control refill triggered by observable update.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/UIElements/Views/Qt4/QtHomologyList.cpp

    rb10593 r7516f6  
    108108
    109109  dirty = true;
    110   clearing = false;
    111110 
    112111  QSettings settings;
     
    151150}
    152151
    153 void QtHomologyList::update(Observable *publisher) {
    154 
     152void QtHomologyList::update(Observable *publisher)
     153{
    155154  dirty = true;
    156155
    157156  // force an update from Qt...
    158 //  clearing = true;
    159157//  treewidget->clear();
    160 //  clearing = false;
    161158  emit changed(); //doesn't work!?!
    162159}
     
    164161void QtHomologyList::refill()
    165162{
    166   clearing = true;
     163  boost::recursive_mutex::scoped_lock lock(refill_mutex);
     164
    167165  const HomologyContainer &homologies = World::getInstance().getHomologies();
    168166
     
    290288  }
    291289  dirty = false;
    292   clearing = false;
    293290}
    294291
    295292void QtHomologyList::paintEvent(QPaintEvent * event)
    296293{
     294  boost::recursive_mutex::scoped_lock lock(refill_mutex);
     295
    297296  if (dirty)
    298297    refill();
     
    313312void QtHomologyList::rowSelected()
    314313{
     314  boost::recursive_mutex::scoped_lock lock(refill_mutex);
     315
    315316  //std::cout << "rowSelected\n";
    316317  for (int i=0;i<treewidget->topLevelItemCount();i++){
Note: See TracChangeset for help on using the changeset viewer.