Ignore:
Timestamp:
Sep 26, 2012, 5:24:05 PM (12 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:
52575c
Parents:
6cab535
git-author:
Michael Ankele <ankele@…> (08/31/12 16:02:31)
git-committer:
Frederik Heber <heber@…> (09/26/12 17:24:05)
Message:

nicer QtInfoBox (bigger lists)

File:
1 edited

Legend:

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

    r6cab535 r0b2be1  
    3939  timer = new QTimer(this);
    4040  timer->setSingleShot(true);
     41
     42  setMinimumWidth(200);
    4143
    4244  connect(timer, SIGNAL(timeout()), this, SLOT(timerTimeout()));
     
    8385  // Show new tabs.
    8486  if (curAtom){
    85     page_atom = new QtAtomInfoPage(curAtom);
     87    page_atom = new QtAtomInfoPage(curAtom, this);
    8688    addTab(page_atom, "Atom");
    8789    connect(page_atom, SIGNAL(atomKilled()), this, SLOT(clearTabs()));
    8890
    8991    if (curAtom->getMolecule()){
    90       page_mol = new QtMoleculeInfoPage(curAtom->getMolecule());
     92      page_mol = new QtMoleculeInfoPage(curAtom->getMolecule(), this);
    9193      addTab(page_mol, "Molecule");
    9294      connect(page_mol, SIGNAL(moleculeKilled()), this, SLOT(clearTabs()));
     
    104106}
    105107
    106 QtAtomInfoPage::QtAtomInfoPage(const atom *_atom) :
     108QtAtomInfoPage::QtAtomInfoPage(const atom *_atom, QWidget *parent) :
     109  QTreeWidget(parent),
    107110  Observer("QTAtomPage"),
    108111  atomRef(_atom)
     
    110113  atomRef->signOn(this);
    111114
    112   info = new QTreeWidget(this);
    113   info->setColumnCount(2);
     115  setColumnCount(2);
    114116  QStringList header;
    115117  header << "data";
    116118  header << "value";
    117   info->setHeaderLabels(header);
     119  setHeaderLabels(header);
    118120
    119   addInfo(info, "Element", QString(atomRef->getElement().getName().c_str()));
    120   addInfo(info, "Mass", QString("%1").arg(atomRef->getMass()));
    121   addInfo(info, "Charge", QString("%1").arg(atomRef->getCharge()));
    122   addInfo(info, "Position", QString(toString(atomRef->getPosition()).c_str()));
    123   addInfo(info, "Bonds", QString("%1").arg(atomRef->getListOfBonds().size()));
     121  addInfo(this, "Element", QString(atomRef->getElement().getName().c_str()));
     122  addInfo(this, "Mass", QString("%1").arg(atomRef->getMass()));
     123  addInfo(this, "Charge", QString("%1").arg(atomRef->getCharge()));
     124  addInfo(this, "Position", QString(toString(atomRef->getPosition()).c_str()));
     125  addInfo(this, "Bonds", QString("%1").arg(atomRef->getListOfBonds().size()));
    124126}
    125127
     
    144146/************************ Tab for single Molecules *****************/
    145147
    146 QtMoleculeInfoPage::QtMoleculeInfoPage(const molecule *_mol) :
     148QtMoleculeInfoPage::QtMoleculeInfoPage(const molecule *_mol, QWidget *parent) :
     149    QTreeWidget(parent),
    147150    Observer("QTMoleculePage"),
    148151    mol(_mol)
     
    150153  mol->signOn(this);
    151154
    152   info = new QTreeWidget(this);
    153   info->setColumnCount(2);
     155  setColumnCount(2);
    154156  QStringList header;
    155157  header << "data";
    156158  header << "value";
    157   info->setHeaderLabels(header);
     159  setHeaderLabels(header);
    158160
    159   addInfo(info, "Name", QString(mol->getName().c_str()));
    160   addInfo(info, "Formula", QString(mol->getFormula().toString().c_str()));
    161   addInfo(info, "Atoms", QString("%1").arg(mol->getAtomCount()));
    162   addInfo(info, "Bonds", QString("%1").arg(mol->getBondCount()));
     161  addInfo(this, "Name", QString(mol->getName().c_str()));
     162  addInfo(this, "Formula", QString(mol->getFormula().toString().c_str()));
     163  addInfo(this, "Atoms", QString("%1").arg(mol->getAtomCount()));
     164  addInfo(this, "Bonds", QString("%1").arg(mol->getBondCount()));
    163165}
    164166
Note: See TracChangeset for help on using the changeset viewer.