UltraScan III
us_widgets.h
Go to the documentation of this file.
1 #ifndef US_WIDGETS_H
3 #define US_WIDGETS_H
4 
5 #include <QtGui>
6 
7 #include "qwt_counter.h"
8 #include "qwt_plot.h"
9 #include "qwt_plot_grid.h"
10 #include "qwt_plot_picker.h"
11 #include "qwt_plot_curve.h"
12 
13 #include "us_global.h"
14 #include "us_extern.h"
15 #include "us_gui_settings.h"
16 
24 class US_GUI_EXTERN US_Widgets : public QFrame
25 {
26  public:
29  US_Widgets( bool = true, QWidget* p = 0, Qt::WindowFlags f = 0 );
30 
33  ~US_Widgets( void );
34 
37 
39  QPalette vlgray;
40 
47  QLabel* us_label ( const QString&, int = 0, int = QFont::Bold );
48 
52  QLabel* us_textlabel ( const QString&, int = -1, int = QFont::Bold );
53 
59  QLabel* us_banner ( const QString&, int = 0, int = QFont::Bold );
60 
68  QPushButton* us_pushbutton( const QString&, bool = true, int = 0 );
69 
75  QTextEdit* us_textedit ( void );
76 
80  QLineEdit* us_lineedit ( const QString& = 0, int = -1, bool = false );
81 
84  void us_setReadOnly( QLineEdit*, bool = true );
85 
88  void us_setReadOnly( QTextEdit*, bool = true );
89 
92  QListWidget* us_listwidget ( int = 0 );
93 
99  QGridLayout* us_checkbox ( const QString&, QCheckBox*&, bool = false );
100 
107  //QRadioButton* us_radiobutton( const QString&, bool = false );
108  QGridLayout* us_radiobutton(
109  const QString& text, QRadioButton*& rb, bool state = false );
115  QProgressBar* us_progressBar( int, int, int = 0 );
116 
118  QComboBox* us_comboBox( void );
119 
124  QLCDNumber* us_lcd( int, int = 0 );
125 
131  QwtCounter* us_counter( int, double, double, double = 0.0 );
132 
138  QwtPlot* us_plot( const QString&, const QString& = QString(),
139  const QString& = QString() );
140 
144  QwtPlotGrid* us_grid( QwtPlot* );
145 
149  QwtPlotCurve* us_curve( QwtPlot*, const QString& );
150 
154  QwtPlotPicker* us_picker( QwtPlot* );
155 
157  static QFont fixedFont(void);
158 
162  QTabWidget* us_tabwidget( int = 0,
163  int = QFont::Bold );
164 
168  void write_plot( const QString&, const QwtPlot* );
169 
173  int clean_etc_dir( bool = false );
174 };
175 
177 
178 class US_GUI_EXTERN US_ListWidget : public QListWidget
179 {
180  Q_OBJECT
181 
182  public:
184  {
185  setAutoFillBackground( true );
186  setPalette( US_GuiSettings::editColor() );
187  setFont ( QFont( US_GuiSettings::fontFamily(),
189 
190  setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Minimum );
191  };
192 
195  QSize sizeHint() const
196  {
197  return QSize( -1, -1 ); // Allow default in the class
198  };
199 
202  void mousePressEvent( QMouseEvent* );
203 
204  signals:
207  void rightClick( void );
208 
209 };
210 
212 
213 class US_GUI_EXTERN US_Disk_DB_Controls : public QHBoxLayout
214 {
215  Q_OBJECT
216 
217  public:
219  enum type { Default, DB, Disk };
220 
224  // Default set gets the setting from US_Settings
225  US_Disk_DB_Controls( int= Default );
226 
229  bool db( void );
230 
232  void set_disk( void );
233 
235  void set_db ( void );
236 
237  signals:
239  void changed( bool );
240 
241  private:
242  QRadioButton* rb_disk;
243  QRadioButton* rb_db;
244 
245  QGridLayout* us_radiobutton(
246  const QString& text, QRadioButton*& rb, bool state = false );
247 
248  private slots:
249  void rb_changed( bool );
250 };
251 
252 #endif