PSQt/include/WdgFile.h

Go to the documentation of this file.
00001 #ifndef WDGFILE_H
00002 #define WDGFILE_H
00003 
00004 //#include <QVBox>
00005 //#include <QWidget>
00006 //#include <QLabel>
00007 //#include <QSlider>
00008 //#include <QPushButton>
00009 #include <QString>
00010 
00011 #include <Qt>
00012 #include <QtGui>
00013 #include <QtCore>
00014 
00015 #include "PSQt/Frame.h"
00016 
00017 namespace PSQt {
00018 
00019 /**
00020  *  @ingroup PSQt
00021  * 
00022  *  @brief Widget for file name input.
00023  * 
00024  *  @code
00025  *  @endcode
00026  *
00027  *  This software was developed for the LCLS project.  If you use all or 
00028  *  part of it, please give an appropriate acknowledgment.
00029  *
00030  *  @see GUIMain, GUIImageViewer
00031  *
00032  *  @version $Id: WdgFile.h 9841 2015-03-26 18:35:44Z dubrovin@SLAC.STANFORD.EDU $
00033  *
00034  *  @author Mikhail Dubrovin
00035  */
00036 
00037 class WdgFile : public QWidget
00038 {
00039  Q_OBJECT // macro is needed for connection of signals and slots
00040 
00041  public:
00042     WdgFile( QWidget *parent = 0, 
00043              const std::string& but_title=std::string("File:"), 
00044              const std::string& path=std::string(),
00045              const std::string& search_fmt=std::string("*.data *.png *.gif *.jpg *.jpeg\n *"),
00046              const bool& show_frame=true,
00047              const unsigned& but_width=100);
00048     //    ~WdgFile(){}
00049 
00050     void resizeEvent(QResizeEvent *event = 0) ;
00051     void closeEvent (QCloseEvent  *event = 0) ;
00052     std::string& fileName() { return m_path; };
00053 
00054  public slots:
00055     void onButFile() ;
00056     void onEdiFile() ;
00057     void testSignalString(const std::string& fname) ;
00058 
00059  signals :
00060     void fileNameIsChanged(const std::string& fname) ;
00061     void valueChanged(int value) ;
00062 
00063  private :
00064     std::string  m_path;
00065     std::string  m_search_fmt;
00066     bool         m_show_frame;
00067     //QLabel*      m_lab_fname;
00068     QFrame*      m_frame;
00069     QLineEdit*   m_edi_file;
00070     QPushButton* m_but_file;
00071 
00072     inline const char* _name_(){return "WdgFile";}
00073     void showTips() ;
00074     void setFrame() ;
00075     bool fileExists(const std::string& fname) ;
00076     bool setNewFileName(const std::string& fname) ;
00077 };
00078 
00079 } // namespace PSQt
00080 
00081 #endif // WDGFILE_H

Generated on 19 Dec 2016 for PSANAmodules by  doxygen 1.4.7