Changeset 47812b for src


Ignore:
Timestamp:
Oct 6, 2011, 12:08:30 PM (13 years ago)
Author:
Frederik Heber <heber@…>
Branches:
Action_Thermostats, Add_AtomRandomPerturbation, Add_FitFragmentPartialChargesAction, Add_RotateAroundBondAction, Add_SelectAtomByNameAction, Added_ParseSaveFragmentResults, AddingActions_SaveParseParticleParameters, Adding_Graph_to_ChangeBondActions, Adding_MD_integration_tests, Adding_ParticleName_to_Atom, Adding_StructOpt_integration_tests, AtomFragments, Automaking_mpqc_open, AutomationFragmentation_failures, Candidate_v1.5.4, Candidate_v1.6.0, Candidate_v1.6.1, ChangeBugEmailaddress, ChangingTestPorts, ChemicalSpaceEvaluator, CombiningParticlePotentialParsing, Combining_Subpackages, Debian_Package_split, Debian_package_split_molecuildergui_only, Disabling_MemDebug, Docu_Python_wait, EmpiricalPotential_contain_HomologyGraph, EmpiricalPotential_contain_HomologyGraph_documentation, Enable_parallel_make_install, Enhance_userguide, Enhanced_StructuralOptimization, Enhanced_StructuralOptimization_continued, Example_ManyWaysToTranslateAtom, Exclude_Hydrogens_annealWithBondGraph, FitPartialCharges_GlobalError, Fix_BoundInBox_CenterInBox_MoleculeActions, Fix_ChargeSampling_PBC, Fix_ChronosMutex, Fix_FitPartialCharges, Fix_FitPotential_needs_atomicnumbers, Fix_ForceAnnealing, Fix_IndependentFragmentGrids, Fix_ParseParticles, Fix_ParseParticles_split_forward_backward_Actions, Fix_PopActions, Fix_QtFragmentList_sorted_selection, Fix_Restrictedkeyset_FragmentMolecule, Fix_StatusMsg, Fix_StepWorldTime_single_argument, Fix_Verbose_Codepatterns, Fix_fitting_potentials, Fixes, ForceAnnealing_goodresults, ForceAnnealing_oldresults, ForceAnnealing_tocheck, ForceAnnealing_with_BondGraph, ForceAnnealing_with_BondGraph_continued, ForceAnnealing_with_BondGraph_continued_betteresults, ForceAnnealing_with_BondGraph_contraction-expansion, FragmentAction_writes_AtomFragments, FragmentMolecule_checks_bonddegrees, GeometryObjects, Gui_Fixes, Gui_displays_atomic_force_velocity, ImplicitCharges, IndependentFragmentGrids, IndependentFragmentGrids_IndividualZeroInstances, IndependentFragmentGrids_IntegrationTest, IndependentFragmentGrids_Sole_NN_Calculation, JobMarket_RobustOnKillsSegFaults, JobMarket_StableWorkerPool, JobMarket_unresolvable_hostname_fix, MoreRobust_FragmentAutomation, ODR_violation_mpqc_open, PartialCharges_OrthogonalSummation, PdbParser_setsAtomName, PythonUI_with_named_parameters, QtGui_reactivate_TimeChanged_changes, Recreated_GuiChecks, Rewrite_FitPartialCharges, RotateToPrincipalAxisSystem_UndoRedo, SaturateAtoms_findBestMatching, SaturateAtoms_singleDegree, StoppableMakroAction, Subpackage_CodePatterns, Subpackage_JobMarket, Subpackage_LinearAlgebra, Subpackage_levmar, Subpackage_mpqc_open, Subpackage_vmg, Switchable_LogView, ThirdParty_MPQC_rebuilt_buildsystem, TrajectoryDependenant_MaxOrder, TremoloParser_IncreasedPrecision, TremoloParser_MultipleTimesteps, TremoloParser_setsAtomName, Ubuntu_1604_changes, stable
Children:
573d72
Parents:
b40b9d
git-author:
Frederik Heber <heber@…> (08/12/11 16:09:00)
git-committer:
Frederik Heber <heber@…> (10/06/11 12:08:30)
Message:

FIX: MolecuilderGUI crashes on selecting molecule.

  • QtWorldView::update() set ATOMS column twice, hence FORMULA was NULL item.
  • rename in enum COLUMNTYPES: ATOMS->ATOMCOUNT.
Location:
src/UIElements/Views/Qt4
Files:
2 edited

Legend:

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

    rb40b9d r47812b  
    4646  for(int i=0; i<COLUMNCOUNT;++i) {
    4747    QTableWidgetItem *heading = new QTableWidgetItem();
     48    std::cout << "Creating heading item " << heading << "." << std::endl;
    4849    heading->setText(QString(COLUMNNAMES[i]));
    4950    setHorizontalHeaderItem(i,heading);
     
    7677    const int index = (*iter)->IndexNr;
    7778    QTableWidgetItem *indexWidget = new QTableWidgetItem();
     79    //std::cout << "Creating index item " << indexWidget << "." << std::endl;
    7880    indexWidget->setText(QString::number(index));
    7981    indexWidget->setData(Qt::UserRole,QVariant(index));
     
    8284    const string name = (*iter)->getName();
    8385    QTableWidgetItem *nameWidget = new QTableWidgetItem();
     86    //std::cout << "Creating name item " << nameWidget << " at " << i << "," << NAME << "." << std::endl;
    8487    nameWidget->setText(QString(name.c_str()));
    8588    setItem(i,NAME,nameWidget);
     
    8790    const int atomCount = (*iter)->getAtomCount();
    8891    QTableWidgetItem *countWidget= new QTableWidgetItem();
     92    //std::cout << "Creating count item " << countWidget << " at " << i << "," << ATOMCOUNT << "." << std::endl;
    8993    countWidget->setText(QString::number(atomCount));
    9094    countWidget->setFlags(Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled);
    91     setItem(i,ATOMS,countWidget);
     95    setItem(i,ATOMCOUNT,countWidget);
    9296
    9397    const Formula formula = (*iter)->getFormula();
    9498    QTableWidgetItem *formulaWidget= new QTableWidgetItem();
     99    //std::cout << "Creating formula item " << formulaWidget << " at " << i << "," << FORMULA << "." << std::endl;
    95100    formulaWidget->setText(QString(formula.toString().c_str()));
    96101    formulaWidget->setFlags(Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled);
    97     setItem(i,ATOMS,formulaWidget);
     102    setItem(i,FORMULA,formulaWidget);
    98103
    99104    molSelection[i]=nameWidget->isSelected();
     
    118123
    119124void QtWorldView::cellSelected(int row, int column){
     125  //std::cout << "Selection in (" << row << "," << column << "): " << item(row,column) << std::endl;
    120126  bool state = item(row,column)->isSelected();
    121127  for(int i = 0; i<COLUMNCOUNT; i++){
     128    //std::cout << "Setting " << i << "-th item " << item(row,i) << " in row " << row << " to state selected." << std::endl;
    122129    item(row,i)->setSelected(state);
    123130  }
  • src/UIElements/Views/Qt4/QtWorldView.hpp

    rb40b9d r47812b  
    3434
    3535  static const int COLUMNCOUNT;
    36   enum {NAME,ATOMS,FORMULA,COLUMNTYPES_MAX} COLUMNTYPES;
     36  enum {NAME,ATOMCOUNT,FORMULA,COLUMNTYPES_MAX} COLUMNTYPES;
    3737  static const char *COLUMNNAMES[];
    3838
Note: See TracChangeset for help on using the changeset viewer.