Changeset f001ca
- Timestamp:
- Oct 23, 2010, 2:36:11 PM (14 years ago)
- 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
- Location:
- src/UIElements/QT4
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/UIElements/QT4/QTDialog.cpp
rdb7cb0 rf001ca 635 635 filenameLineEdit->setReadOnly(true); 636 636 637 filenameLabel = new QLabel(QString("Input file:")); 638 filenameLabel->setBuddy(filenameLineEdit); 639 637 640 filedialogButton = new QPushButton("&Choose", _dialog); 638 641 639 pipe = new FileQTQueryPipe( tmp,_dialog,filenameLineEdit,filedialogButton);642 pipe = new FileQTQueryPipe(&tmp,_dialog,filenameLineEdit,filedialogButton); 640 643 641 644 thisLayout = new QHBoxLayout(); 642 645 parent->addLayout(thisLayout); 646 thisLayout->addWidget(filenameLabel); 643 647 thisLayout->addWidget(filenameLineEdit); 644 648 thisLayout->addWidget(filedialogButton); … … 896 900 } 897 901 898 FileQTQueryPipe::FileQTQueryPipe( const boost::filesystem::path &_content, QTDialog *_dialog, QLineEdit *_filenameLineEdit, QPushButton *_filedialogButton) :902 FileQTQueryPipe::FileQTQueryPipe(boost::filesystem::path *_content, QTDialog *_dialog, QLineEdit *_filenameLineEdit, QPushButton *_filedialogButton) : 899 903 content(_content), 900 904 dialog(_dialog), 901 905 filenameLineEdit(_filenameLineEdit), 902 906 filedialogButton(_filedialogButton) 903 {} 907 { 908 theFileDialog = NULL; 909 } 904 910 905 911 FileQTQueryPipe::~FileQTQueryPipe() 906 {} 912 { 913 if (theFileDialog != NULL) 914 delete theFileDialog; 915 } 907 916 908 917 void FileQTQueryPipe::update() { 909 918 QStringList ListOfFilenames = theFileDialog->selectedFiles(); 910 919 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())); 912 922 dialog->update(); 913 923 } … … 921 931 theFileDialog->setViewMode(QFileDialog::List); 922 932 } 923 theFileDialog-> show();924 925 filenameLineEdit->setText(QString());933 theFileDialog->exec(); 934 935 update(); 926 936 filedialogButton->setFlat(false); 927 937 } -
src/UIElements/QT4/QTDialog.hpp
rdb7cb0 rf001ca 286 286 QBoxLayout *parent; 287 287 QBoxLayout *thisLayout; 288 QLabel *filenameLabel; 288 289 QLineEdit *filenameLineEdit; 289 290 QPushButton *filedialogButton; … … 500 501 Q_OBJECT 501 502 public: 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); 503 504 virtual ~FileQTQueryPipe(); 504 505 … … 508 509 509 510 private: 510 boost::filesystem::path content;511 boost::filesystem::path *content; 511 512 QTDialog *dialog; 512 513 QLineEdit *filenameLineEdit;
Note:
See TracChangeset
for help on using the changeset viewer.