Changeset 7516f6
- Timestamp:
- Jul 12, 2017, 7:11:51 PM (7 years ago)
- Branches:
- Action_Thermostats, Adding_MD_integration_tests, Adding_StructOpt_integration_tests, AutomationFragmentation_failures, Candidate_v1.6.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
- 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)
- Location:
- src/UIElements/Views/Qt4
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
src/UIElements/Views/Qt4/QtGeometryList.cpp
rb10593 r7516f6 109 109 void QtGeometryList::refill(::GeometryObject *ignore) 110 110 { 111 boost::recursive_mutex::scoped_lock lock(refill_mutex); 112 111 113 clear(); 112 114 … … 125 127 } 126 128 127 #if 0128 129 void QtGeometryList::paintEvent(QPaintEvent * event) 129 130 { 131 boost::recursive_mutex::scoped_lock lock(refill_mutex); 130 132 /*if (dirty) 131 133 refill(NULL);*/ 132 Q tGeometryList::paintEvent(event);134 QTreeWidget::paintEvent(event); 133 135 } 134 #endif135 136 136 137 void QtGeometryList::subjectKilled(Observable *publisher) { … … 151 152 void QtGeometryList::mouseMoveFunction(QMouseEvent * event) 152 153 { 154 boost::recursive_mutex::scoped_lock lock(refill_mutex); 155 153 156 if (event->type() == QEvent::MouseMove) { 154 157 QTreeWidgetItem* current = itemAt(event->pos()); -
src/UIElements/Views/Qt4/QtGeometryList.hpp
rb10593 r7516f6 17 17 #include <QtGui/QTreeWidget> 18 18 #include <QMouseEvent> 19 20 #include <boost/thread/recursive_mutex.hpp> 19 21 20 22 #include "CodePatterns/Observer/Observer.hpp" … … 38 40 virtual void subjectKilled(Observable *publisher); 39 41 virtual void recieveNotification(Observable *publisher, Notification_ptr notification); 40 //virtual void paintEvent(QPaintEvent * event);42 virtual void paintEvent(QPaintEvent * event); 41 43 void refill(::GeometryObject *ignore); 42 44 … … 45 47 static const char *COLUMNNAMES[]; 46 48 49 private: 50 51 mutable boost::recursive_mutex refill_mutex; 47 52 }; 48 53 -
src/UIElements/Views/Qt4/QtHomologyList.cpp
rb10593 r7516f6 108 108 109 109 dirty = true; 110 clearing = false;111 110 112 111 QSettings settings; … … 151 150 } 152 151 153 void QtHomologyList::update(Observable *publisher) {154 152 void QtHomologyList::update(Observable *publisher) 153 { 155 154 dirty = true; 156 155 157 156 // force an update from Qt... 158 // clearing = true;159 157 // treewidget->clear(); 160 // clearing = false;161 158 emit changed(); //doesn't work!?! 162 159 } … … 164 161 void QtHomologyList::refill() 165 162 { 166 clearing = true; 163 boost::recursive_mutex::scoped_lock lock(refill_mutex); 164 167 165 const HomologyContainer &homologies = World::getInstance().getHomologies(); 168 166 … … 290 288 } 291 289 dirty = false; 292 clearing = false;293 290 } 294 291 295 292 void QtHomologyList::paintEvent(QPaintEvent * event) 296 293 { 294 boost::recursive_mutex::scoped_lock lock(refill_mutex); 295 297 296 if (dirty) 298 297 refill(); … … 313 312 void QtHomologyList::rowSelected() 314 313 { 314 boost::recursive_mutex::scoped_lock lock(refill_mutex); 315 315 316 //std::cout << "rowSelected\n"; 316 317 for (int i=0;i<treewidget->topLevelItemCount();i++){ -
src/UIElements/Views/Qt4/QtHomologyList.hpp
rb10593 r7516f6 17 17 #include <QtGui/QWidget> 18 18 #include "CodePatterns/Observer/Observer.hpp" 19 20 #include <boost/thread/recursive_mutex.hpp> 19 21 20 22 class HomologyGraph; … … 53 55 //!> flag to indicate that we got an update 54 56 bool dirty; 55 //!> flag to indicate that we currently clear the view, avoids thread collisions56 bool clearing;57 57 //!> flag to indicate whether we are subscribed to PotentialRegistry 58 58 bool potentialregistry_enabled; 59 60 mutable boost::recursive_mutex refill_mutex; 59 61 60 62 private: -
src/UIElements/Views/Qt4/QtShapeList.cpp
rb10593 r7516f6 65 65 setHeaderLabels(header); 66 66 67 clearing = false;68 67 selecting = false; 69 68 … … 114 113 } 115 114 116 void QtShapeList::refill(::Shape *ignore) { 115 void QtShapeList::refill(::Shape *ignore) 116 { 117 boost::recursive_mutex::scoped_lock lock(refill_mutex); 117 118 118 clearing = true;119 119 clear(); 120 120 shapeSelection.clear(); … … 138 138 shapeSelection.push_back(reg.isSelected(s)); 139 139 } 140 clearing = false;141 140 } 142 141 143 #if 0144 142 void QtShapeList::paintEvent(QPaintEvent * event) 145 143 { 144 boost::recursive_mutex::scoped_lock lock(refill_mutex); 146 145 /*if (dirty) 147 146 refill();*/ 148 Q tShapeList::paintEvent(event);147 QTreeWidget::paintEvent(event); 149 148 } 150 #endif151 149 152 150 void QtShapeList::subjectKilled(Observable *publisher) { … … 156 154 void QtShapeList::rowSelected() 157 155 { 158 if (clearing)159 return; 156 boost::recursive_mutex::scoped_lock lock(refill_mutex); 157 160 158 if (selecting) 161 159 return; -
src/UIElements/Views/Qt4/QtShapeList.hpp
rb10593 r7516f6 16 16 17 17 #include <QtGui/QTreeWidget> 18 19 #include <boost/thread/recursive_mutex.hpp> 20 18 21 #include "CodePatterns/Observer/Observer.hpp" 19 22 … … 32 35 virtual void subjectKilled(Observable *publisher); 33 36 virtual void recieveNotification(Observable *publisher, Notification_ptr notification); 34 //virtual void paintEvent(QPaintEvent * event);37 virtual void paintEvent(QPaintEvent * event); 35 38 void refill(::Shape *ignore); 36 39 … … 48 51 49 52 private: 50 bool clearing;51 53 bool selecting; 52 54 std::vector<bool> shapeSelection; //!< needed to determine when a selection changes 55 56 mutable boost::recursive_mutex refill_mutex; 53 57 }; 54 58 -
src/UIElements/Views/Qt4/QtStatusBar.cpp
rb10593 r7516f6 99 99 } 100 100 101 void QtStatusBar::update(Observable *subject){ 101 void QtStatusBar::paintEvent(QPaintEvent * event) 102 { 103 boost::recursive_mutex::scoped_lock lock(refill_mutex); 104 105 QStatusBar::paintEvent(event); 106 } 107 108 void QtStatusBar::update(Observable *subject) 109 { 102 110 if (subject == World::getPointer()){ 103 111 atomCount = World::getInstance().numAtoms(); … … 133 141 void QtStatusBar::updateStatusMessage() 134 142 { 143 boost::recursive_mutex::scoped_lock lock(refill_mutex); 144 135 145 if (StatusList.size() != 0) { 136 146 // get oldest message from the StatusList … … 177 187 } 178 188 179 void QtStatusBar::redrawStatus(){ 189 void QtStatusBar::redrawStatus() 190 { 191 boost::recursive_mutex::scoped_lock lock(refill_mutex); 192 180 193 stringstream sstr; 181 194 sstr << "You have " << atomCount << " atom" << PLURAL_S(atomCount) … … 190 203 const bool StopStatus) 191 204 { 205 boost::recursive_mutex::scoped_lock lock(refill_mutex); 206 192 207 progressIndicator *ind=0; 193 208 progressBars_t::iterator iter = progressBars.find(name); … … 216 231 217 232 218 QtStatusBar::progressIndicator::progressIndicator(const std::string &name){ 233 QtStatusBar::progressIndicator::progressIndicator(const std::string &name) 234 { 219 235 stringstream sstr; 220 236 sstr << "Busy (" << name << ")"; -
src/UIElements/Views/Qt4/QtStatusBar.hpp
rb10593 r7516f6 19 19 #include <string> 20 20 #include <QtGui/QStatusBar> 21 22 #include <boost/thread/recursive_mutex.hpp> 21 23 22 24 #include "CodePatterns/Observer/Observer.hpp" … … 51 53 void subjectKilled(Observable *subject); 52 54 void recieveNotification(Observable *_publisher, Notification *_notification); 55 virtual void paintEvent(QPaintEvent * event); 53 56 54 57 private slots: … … 89 92 //!> time interval in milliseconds 90 93 const int timer_interval; 94 95 mutable boost::recursive_mutex refill_mutex; 91 96 }; 92 97 -
src/UIElements/Views/Qt4/QtTimeLine.cpp
rb10593 r7516f6 82 82 } 83 83 84 void QtTimeLine::paintEvent(QPaintEvent * event) 85 { 86 boost::recursive_mutex::scoped_lock lock(refill_mutex); 87 88 QSlider::paintEvent(event); 89 } 90 84 91 void QtTimeLine::subjectKilled(Observable *publisher) 85 92 { … … 101 108 void QtTimeLine::recieveNotification(Observable *publisher, Notification_ptr notification) 102 109 { 110 boost::recursive_mutex::scoped_lock lock(refill_mutex); 111 103 112 if (static_cast<WorldTime *>(publisher) == WorldTime::getPointer()) { 104 113 const int timestep = WorldTime::getTime(); … … 122 131 void QtTimeLine::StepUpdate(int position) 123 132 { 133 boost::recursive_mutex::scoped_lock lock(refill_mutex); 134 124 135 if (WorldTime_change) 125 136 WorldTime_change = false; -
src/UIElements/Views/Qt4/QtTimeLine.hpp
rb10593 r7516f6 15 15 16 16 #include <QtGui/QSlider> 17 18 #include <boost/thread/recursive_mutex.hpp> 19 17 20 #include "CodePatterns/Observer/Observer.hpp" 18 21 … … 29 32 virtual void recieveNotification(Observable *publisher, Notification_ptr notification); 30 33 virtual void subjectKilled(Observable *publisher); 34 virtual void paintEvent(QPaintEvent * event); 31 35 32 36 private slots: … … 40 44 //!> states whether value was set by observing WorldTime (and not by slider) 41 45 bool WorldTime_change; 46 47 mutable boost::recursive_mutex refill_mutex; 42 48 }; 43 49
Note:
See TracChangeset
for help on using the changeset viewer.