00001 #ifndef WDGDIRTREE_H
00002 #define WDGDIRTREE_H
00003
00004 #include "PSQt/Frame.h"
00005
00006
00007
00008
00009
00010
00011 #include <Qt>
00012 #include <QtGui>
00013 #include <QtCore>
00014
00015
00016 #include "PSQt/WdgFile.h"
00017
00018 namespace PSQt {
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039 class WdgDirTree : public Frame
00040 {
00041 Q_OBJECT
00042
00043 public:
00044 WdgDirTree( QWidget *parent = 0,
00045 const std::string& dir_top = "/reg/g/psdm/detector/alignment/cspad/calib-cxi-ds1-2014-05-15",
00046 const unsigned& pbits=0);
00047
00048 void showTips() ;
00049
00050 void resizeEvent (QResizeEvent *event = 0) ;
00051 void closeEvent (QCloseEvent *event = 0) ;
00052 void moveEvent (QMoveEvent *event = 0) ;
00053 void mousePressEvent (QMouseEvent *event = 0) ;
00054
00055 public slots:
00056
00057 void onButExit() ;
00058
00059 private:
00060
00061 std::string m_dir_top;
00062 QTreeView* m_view;
00063 QStandardItemModel* m_model;
00064 unsigned m_pbits;
00065
00066 inline const char* _name_(){return "WdgDirTree";}
00067 void makeTreeModel();
00068 void updateTreeModel(const std::string& dir_top = "./");
00069 void fillTreeModel(const std::string& dir_top = "./", QStandardItem* item=0, const unsigned& level=0, const unsigned& pbits=0);
00070 void fillTreeModelTest();
00071 };
00072
00073 }
00074
00075 #endif // WDGDIRTREE_H