Set up widgets the UltraScan way. More...
#include "us_widgets.h"
Public Member Functions | |
US_Widgets (bool=true, QWidget *p=0, Qt::WindowFlags f=0) | |
~US_Widgets (void) | |
QLabel * | us_label (const QString &, int=0, int=QFont::Bold) |
QLabel * | us_textlabel (const QString &, int=-1, int=QFont::Bold) |
QLabel * | us_banner (const QString &, int=0, int=QFont::Bold) |
QPushButton * | us_pushbutton (const QString &, bool=true, int=0) |
QTextEdit * | us_textedit (void) |
QLineEdit * | us_lineedit (const QString &=0, int=-1, bool=false) |
void | us_setReadOnly (QLineEdit *, bool=true) |
void | us_setReadOnly (QTextEdit *, bool=true) |
QListWidget * | us_listwidget (int=0) |
QGridLayout * | us_checkbox (const QString &, QCheckBox *&, bool=false) |
QGridLayout * | us_radiobutton (const QString &text, QRadioButton *&rb, bool state=false) |
QProgressBar * | us_progressBar (int, int, int=0) |
QComboBox * | us_comboBox (void) |
QLCDNumber * | us_lcd (int, int=0) |
QwtCounter * | us_counter (int, double, double, double=0.0) |
QwtPlot * | us_plot (const QString &, const QString &=QString(), const QString &=QString()) |
QwtPlotGrid * | us_grid (QwtPlot *) |
QwtPlotCurve * | us_curve (QwtPlot *, const QString &) |
QwtPlotPicker * | us_picker (QwtPlot *) |
QTabWidget * | us_tabwidget (int=0, int=QFont::Bold) |
void | write_plot (const QString &, const QwtPlot *) |
Write a plot file (PNG or SVG+PNG) from a plot. More... | |
int | clean_etc_dir (bool=false) |
Clean install and work ./etc directories. More... | |
Static Public Member Functions | |
static QFont | fixedFont (void) |
Public Attributes | |
US_Global | g |
Connect to global memory and make the values accessible. More... | |
QPalette | vlgray |
Very light gray palette for read-only line edits. More... | |
Set up widgets the UltraScan way.
This class is designed to be the parent class to almost all UltraScan windows. It allows easy creation of widgets and applies the appropriate palette and font acording to the user's settings (or the UltraScan default). Depending on the widget, other parameters may be set.
Definition at line 24 of file us_widgets.h.
US_Widgets::US_Widgets | ( | bool | set_position = true , |
QWidget * | p = 0 , |
||
Qt::WindowFlags | f = 0 |
||
) |
The constructor connects to global memory and moves the screen to the point saved there. It adjusts the location point by QPoint( 30, 30).
Definition at line 11 of file us_widgets.cpp.
US_Widgets::~US_Widgets | ( | void | ) |
The destructor readjusts the location point in global memory to a value of QPoint( -30, -30 )
Definition at line 35 of file us_widgets.cpp.
int US_Widgets::clean_etc_dir | ( | bool | report = false | ) |
Clean install and work ./etc directories.
report | Optional flag to report any file mods |
Definition at line 487 of file us_widgets.cpp.
|
static |
Definition at line 412 of file us_widgets.cpp.
QLabel * US_Widgets::us_banner | ( | const QString & | labelString, |
int | fontAdjust = 0 , |
||
int | weight = QFont::Bold |
||
) |
Same as us_label except:
Definition at line 74 of file us_widgets.cpp.
QGridLayout * US_Widgets::us_checkbox | ( | const QString & | text, |
QCheckBox *& | cb, | ||
bool | state = false |
||
) |
text | - Text to set with checkbox |
state | - Initial check state |
cb | - reference to a pointer of the checkbox
|
Definition at line 187 of file us_widgets.cpp.
QComboBox * US_Widgets::us_comboBox | ( | void | ) |
Definition at line 270 of file us_widgets.cpp.
QwtCounter * US_Widgets::us_counter | ( | int | buttons, |
double | low, | ||
double | high, | ||
double | value = 0.0 |
||
) |
buttons | - Number of buttons to use ( 1 to 3 ) |
low | - Lower bound of progress |
high | - Upper bound of progress |
value | - Initial value to set
|
Definition at line 298 of file us_widgets.cpp.
QwtPlotCurve * US_Widgets::us_curve | ( | QwtPlot * | plot, |
const QString & | title | ||
) |
plot* | - Pointer to plot |
title | - Title of the curve
|
Definition at line 371 of file us_widgets.cpp.
QwtPlotGrid * US_Widgets::us_grid | ( | QwtPlot * | plot | ) |
plot* | - Pointer to plot
|
Definition at line 360 of file us_widgets.cpp.
QLabel * US_Widgets::us_label | ( | const QString & | labelString, |
int | fontAdjust = 0 , |
||
int | weight = QFont::Bold |
||
) |
labelString | - contents of label |
fontAdjust | - adjustment to default point size |
weight | - QFont::{Light,Normal,DemiBold,Bold,Black}
|
Definition at line 42 of file us_widgets.cpp.
QLCDNumber * US_Widgets::us_lcd | ( | int | digits, |
int | value = 0 |
||
) |
Create an LCD style disply
digits | - Number of digits to display |
value | - Initial value to set
|
Definition at line 283 of file us_widgets.cpp.
QLineEdit * US_Widgets::us_lineedit | ( | const QString & | text = 0 , |
int | fontAdjust = -1 , |
||
bool | readonly = false |
||
) |
text | - starting text in line edit box |
fontAdjust | - adjustment to default point size |
readonly | - flag if read-only, default uses editColor() |
Definition at line 124 of file us_widgets.cpp.
QListWidget * US_Widgets::us_listwidget | ( | int | fontAdjust = 0 | ) |
fontAdjust | - adjustment to default font size
|
Definition at line 174 of file us_widgets.cpp.
QwtPlotPicker * US_Widgets::us_picker | ( | QwtPlot * | plot | ) |
plot* | - Pointer to plot
|
Definition at line 382 of file us_widgets.cpp.
QwtPlot * US_Widgets::us_plot | ( | const QString & | title, |
const QString & | x_axis = QString() , |
||
const QString & | y_axis = QString() |
||
) |
title | - Plot Title |
x_axis | - Bottom Axis Title |
y_axis | - Left Axis Title
|
Definition at line 342 of file us_widgets.cpp.
QProgressBar * US_Widgets::us_progressBar | ( | int | low, |
int | high, | ||
int | value = 0 |
||
) |
low | - Lower bound of progress |
high | - Upper bound of progress |
value | - Initial value between low and high
|
Definition at line 251 of file us_widgets.cpp.
QPushButton * US_Widgets::us_pushbutton | ( | const QString & | labelString, |
bool | enabled = true , |
||
int | fontAdjust = 0 |
||
) |
labelString | - text in pushbutton |
enabled | |
fontAdjust | - adjustment to default font size
|
Definition at line 90 of file us_widgets.cpp.
QGridLayout * US_Widgets::us_radiobutton | ( | const QString & | text, |
QRadioButton *& | rb, | ||
bool | state = false |
||
) |
Create a radiobutton with a specifice palette (normal) and indentation of the button
text | - Text to set with radiobutton |
rb | - pointer to the radio button |
state | - Checked ( true or false )
|
Definition at line 219 of file us_widgets.cpp.
void US_Widgets::us_setReadOnly | ( | QLineEdit * | le, |
bool | readonly = true |
||
) |
le | - line edit for which to set ReadOnly and color |
readonly | - flag if read-only, default uses editColor() |
Definition at line 142 of file us_widgets.cpp.
void US_Widgets::us_setReadOnly | ( | QTextEdit * | te, |
bool | readonly = true |
||
) |
te | - text edit for which to set ReadOnly and color |
readonly | - flag if read-only, default uses editColor() |
Definition at line 158 of file us_widgets.cpp.
QTabWidget * US_Widgets::us_tabwidget | ( | int | fontAdjust = 0 , |
int | weight = QFont::Bold |
||
) |
fontAdjust | - adjustment to default font size |
weight | - QFont::{Light,Normal,DemiBold,Bold,Black}
|
Definition at line 464 of file us_widgets.cpp.
QTextEdit * US_Widgets::us_textedit | ( | void | ) |
Definition at line 107 of file us_widgets.cpp.
QLabel * US_Widgets::us_textlabel | ( | const QString & | labelString, |
int | fontAdjust = -1 , |
||
int | weight = QFont::Bold |
||
) |
Same as us_label except:
Definition at line 63 of file us_widgets.cpp.
void US_Widgets::write_plot | ( | const QString & | fname, |
const QwtPlot * | plot | ||
) |
Write a plot file (PNG or SVG+PNG) from a plot.
fname | Full path name of the plot file to create |
plot | Pointer to plot |
Definition at line 481 of file us_widgets.cpp.
US_Global US_Widgets::g |
Connect to global memory and make the values accessible.
Definition at line 36 of file us_widgets.h.
QPalette US_Widgets::vlgray |
Very light gray palette for read-only line edits.
Definition at line 39 of file us_widgets.h.