Changeset f001ca


Ignore:
Timestamp:
Oct 23, 2010, 2:36:11 PM (14 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:
9d457d
Parents:
db7cb0
Message:

FIX: result variable Dialog::FileQuery::tmp is now set. Label added in front of QLineEdit.

Location:
src/UIElements/QT4
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/UIElements/QT4/QTDialog.cpp

    rdb7cb0 rf001ca  
    635635  filenameLineEdit->setReadOnly(true);
    636636
     637  filenameLabel = new QLabel(QString("Input file:"));
     638  filenameLabel->setBuddy(filenameLineEdit);
     639
    637640  filedialogButton = new QPushButton("&Choose", _dialog);
    638641
    639   pipe = new FileQTQueryPipe(tmp,_dialog,filenameLineEdit,filedialogButton);
     642  pipe = new FileQTQueryPipe(&tmp,_dialog,filenameLineEdit,filedialogButton);
    640643
    641644  thisLayout = new QHBoxLayout();
    642645  parent->addLayout(thisLayout);
     646  thisLayout->addWidget(filenameLabel);
    643647  thisLayout->addWidget(filenameLineEdit);
    644648  thisLayout->addWidget(filedialogButton);
     
    896900}
    897901
    898 FileQTQueryPipe::FileQTQueryPipe(const boost::filesystem::path &_content, QTDialog *_dialog, QLineEdit *_filenameLineEdit, QPushButton *_filedialogButton) :
     902FileQTQueryPipe::FileQTQueryPipe(boost::filesystem::path *_content, QTDialog *_dialog, QLineEdit *_filenameLineEdit, QPushButton *_filedialogButton) :
    899903  content(_content),
    900904  dialog(_dialog),
    901905  filenameLineEdit(_filenameLineEdit),
    902906  filedialogButton(_filedialogButton)
    903 {}
     907{
     908  theFileDialog = NULL;
     909}
    904910
    905911FileQTQueryPipe::~FileQTQueryPipe()
    906 {}
     912{
     913  if (theFileDialog != NULL)
     914    delete theFileDialog;
     915}
    907916
    908917void FileQTQueryPipe::update() {
    909918  QStringList ListOfFilenames = theFileDialog->selectedFiles();
    910919  std::cout << "Selected File is " << ListOfFilenames.at(0).toStdString() << std::endl;
    911   content = ListOfFilenames.at(0).toStdString();
     920  (*content) = ListOfFilenames.at(0).toStdString();
     921  filenameLineEdit->setText(QString::fromStdString((*content).string()));
    912922  dialog->update();
    913923}
     
    921931    theFileDialog->setViewMode(QFileDialog::List);
    922932  }
    923   theFileDialog->show();
    924 
    925   filenameLineEdit->setText(QString());
     933  theFileDialog->exec();
     934
     935  update();
    926936  filedialogButton->setFlat(false);
    927937}
  • src/UIElements/QT4/QTDialog.hpp

    rdb7cb0 rf001ca  
    286286      QBoxLayout *parent;
    287287      QBoxLayout *thisLayout;
     288      QLabel *filenameLabel;
    288289      QLineEdit *filenameLineEdit;
    289290      QPushButton *filedialogButton;
     
    500501  Q_OBJECT
    501502public:
    502   FileQTQueryPipe(const boost::filesystem::path &_content, QTDialog *_dialog, QLineEdit *_filenameLineEdit, QPushButton *_filedialogButton);
     503  FileQTQueryPipe(boost::filesystem::path *_content, QTDialog *_dialog, QLineEdit *_filenameLineEdit, QPushButton *_filedialogButton);
    503504  virtual ~FileQTQueryPipe();
    504505
     
    508509
    509510private:
    510   boost::filesystem::path content;
     511  boost::filesystem::path *content;
    511512  QTDialog *dialog;
    512513  QLineEdit *filenameLineEdit;
Note: See TracChangeset for help on using the changeset viewer.