PSQt/include/WdgPointPos.h

Go to the documentation of this file.
00001 #ifndef WDGPOINTPOSITION_H
00002 #define WDGPOINTPOSITION_H
00003 
00004 #include <Qt>
00005 #include <QtGui>
00006 #include <QtCore>
00007 
00008 #include "PSQt/Frame.h"
00009 
00010 namespace PSQt {
00011 
00012 /**
00013  *  @ingroup PSQt
00014  * 
00015  *  @brief Widget to display two values for 2-d point position. 
00016  * 
00017  *  This software was developed for the LCLS project.  If you use all or 
00018  *  part of it, please give an appropriate acknowledgment.
00019  *
00020  *  @see GUIImageViewer
00021  *
00022  *  @version $Id: WdgPointPos.h 9841 2015-03-26 18:35:44Z dubrovin@SLAC.STANFORD.EDU $
00023  *
00024  *  @author Mikhail Dubrovin
00025  */
00026 
00027 class WdgPointPos : public Frame // QWidget
00028 {
00029  Q_OBJECT // macro is needed for connection of signals and slots
00030 
00031 public:
00032     WdgPointPos( QWidget *parent = 0
00033             , const std::string& label1=std::string("X:")
00034             , const std::string& label2=std::string("Y:") 
00035             , const float& val1=0
00036             , const float& val2=0
00037             , const bool& show_boarder=true
00038             , const unsigned& fld_width=100
00039             , const unsigned& precision=2);
00040 
00041     ~WdgPointPos(){}
00042 
00043     void resizeEvent(QResizeEvent *event = 0) ;
00044     void closeEvent (QCloseEvent  *event = 0) ;
00045 
00046  public slots:
00047     void onEdi() ;
00048     void testPosIsChanged(const QPointF& pos);
00049     void setPointPos(const QPointF& pos);
00050 
00051  signals :
00052     void posIsChanged(const QPointF&);
00053 
00054  private :
00055     bool         m_show_boarder;
00056     unsigned     m_fld_width;
00057     unsigned     m_precision;
00058 
00059     QLabel*      m_lab1;
00060     QLabel*      m_lab2;
00061     QLineEdit*   m_edi1;
00062     QLineEdit*   m_edi2;
00063 
00064     inline const char* _name_(){return "WdgPointPos";}
00065     void showTips() ;
00066 };
00067 
00068 } // namespace PSQt
00069 
00070 #endif // WDGPOINTPOSITION_H

Generated on 19 Dec 2016 for PSANAmodules by  doxygen 1.4.7