14 qDebug(
"us_win: invalid global memory" );
18 vlgray.setColor( QPalette::Base, QColor( 0xe0, 0xe0, 0xe0 ) );
21 setWindowIcon( us3_icon );
27 QLabel* newLabel =
new QLabel( labelString,
this );
30 newLabel->setAlignment ( Qt::AlignVCenter | Qt::AlignLeft );
31 newLabel->setMargin ( 2 );
32 newLabel->setAutoFillBackground(
true );
48 QLabel* newLabel =
us_label( labelString, fontAdjust, weight );
59 QLabel* newLabel =
us_label( labelString, fontAdjust, weight );
61 newLabel->setAlignment ( Qt::AlignCenter );
62 newLabel->setFrameStyle( QFrame::WinPanel | QFrame::Raised );
63 newLabel->setMidLineWidth( 2 );
75 QPushButton* button =
new QPushButton( tr( labelString.toAscii() ),
this );
82 button->setAutoDefault(
false );
83 button->setEnabled( enabled );
91 QTextEdit* te =
new QTextEdit(
this );
97 te->setFrameStyle ( QFrame::WinPanel | QFrame::Sunken );
98 te->setAcceptRichText(
true );
99 te->setReadOnly (
true );
109 QLineEdit* le =
new QLineEdit(
this );
116 le->setAutoFillBackground(
true );
128 le->setPalette (
vlgray );
129 le->setReadOnly(
true );
134 le->setReadOnly(
false );
143 te->setPalette (
vlgray );
144 te->setReadOnly(
true );
149 te->setReadOnly(
false );
156 QListWidget* lw =
new QListWidget;
158 lw->setAutoFillBackground(
true );
168 const QString& text, QCheckBox*& cb,
bool state )
175 QFontMetrics fm( font );
177 QLabel* lb_spacer =
new QLabel;
178 lb_spacer->setFixedWidth ( fm.width(
"w" ) );
179 lb_spacer->setAutoFillBackground(
true );
180 lb_spacer->setPalette ( p );
182 cb =
new QCheckBox( text.toAscii(), this );
183 cb->setFont ( font );
184 cb->setPalette ( p );
185 cb->setAutoFillBackground(
true );
186 cb->setChecked ( state );
188 QGridLayout* layout =
new QGridLayout;
189 layout->setContentsMargins( 0, 0, 0, 0 );
190 layout->setSpacing ( 0 );
192 layout->addWidget( lb_spacer, 0, 0 );
193 layout->addWidget( cb , 0, 1 );
200 const QString& text, QRadioButton*& rb,
bool state )
207 QFontMetrics fm( font );
209 QLabel* lb_spacer =
new QLabel;
210 lb_spacer->setFixedWidth ( fm.width(
"w" ) );
211 lb_spacer->setAutoFillBackground(
true );
212 lb_spacer->setPalette ( p );
214 rb =
new QRadioButton( text.toAscii(), this );
215 rb->setAutoFillBackground(
true );
216 rb->setFont ( font );
217 rb->setPalette ( p );
218 rb->setChecked ( state );
220 QGridLayout* layout =
new QGridLayout;
221 layout->setSpacing ( 0 );
222 layout->setContentsMargins( 0, 0, 0, 0 );
224 layout->addWidget( lb_spacer, 0, 0 );
225 layout->addWidget( rb , 0, 1 );
233 QProgressBar* pb =
new QProgressBar;
235 pb->setRange( low, high );
236 pb->setValue( value );
238 pb->setAlignment( Qt::AlignLeft | Qt::AlignVCenter );
240 pb->setAutoFillBackground(
true );
252 QComboBox* cb =
new QComboBox(
this );
255 cb->setAutoFillBackground(
true );
265 QLCDNumber* lcd =
new QLCDNumber( digits );
267 lcd->setSegmentStyle( QLCDNumber::Filled );
268 lcd->setMode ( QLCDNumber::Dec );
269 lcd->display ( value );
270 lcd->setAutoFillBackground(
true );
281 QwtCounter* counter =
new QwtCounter;
283 QList< QObject* > children = counter->children();
284 QStyle *btnstyle =
new QPlastiqueStyle();
286 for (
int jj = 0; jj < children.size(); jj++ )
288 QWidget* cwidg = (QWidget*)children.at( jj );
289 QString clname = cwidg->metaObject()->className();
291 if ( !clname.isEmpty() && clname.contains(
"Button" ) )
293 cwidg->setStyle( btnstyle );
298 QFontMetrics fm( vfont );
299 counter->setNumButtons( buttons );
300 counter->setRange ( low, high );
301 counter->setValue ( value );
303 counter->setFont ( vfont );
304 counter->setAutoFillBackground(
true );
307 int ncv = int( log10( value ) ) + 1;
308 int nch = int( log10( high ) ) + 1;
309 ncv = ( ncv > 0 ) ? ncv : ( 4 - ncv );
310 nch = ( nch > 0 ) ? nch : ( 4 - nch );
311 nch = qMax( nch, ncv );
312 int widv = fm.width( QString(
"12345678901234" ).left( ncv ) );
313 int widh = fm.width( QString(
"12345678901234" ).left( nch ) );
314 counter->adjustSize();
315 int mwidth = counter->width() + widh - widv;
316 counter->resize ( mwidth, counter->height() );
317 counter->setMinimumWidth( mwidth - fm.width(
"A" ) );
323 const QString& y_axis )
325 QwtPlot* plot =
new QwtPlot;
326 plot->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding );
327 plot->setAutoReplot(
false );
328 plot->setTitle ( title );
330 plot->setAxisTitle( QwtPlot::xBottom, x_axis );
331 plot->setAxisTitle( QwtPlot::yLeft , y_axis );
333 plot->setAutoFillBackground(
true );
342 QwtPlotGrid* grid =
new QwtPlotGrid;
343 grid->enableXMin (
true );
346 grid->attach ( plot );
353 QwtPlotCurve* curve =
new QwtPlotCurve( title );
356 curve->setYAxis ( QwtPlot::yLeft );
357 curve->attach ( plot );
364 QwtPlotPicker* pick =
new QwtPlotPicker( QwtPlot::xBottom, QwtPlot::yLeft,
367 pick->setSelectionFlags( QwtPicker::PointSelection );
368 pick->setTrackerMode ( QwtPicker::AlwaysOn );
369 pick->setRubberBand ( QwtPicker::CrossRubberBand );
372 pick->setRubberBandPen ( c );
373 pick->setTrackerPen ( c );
382 QTabWidget* newtw =
new QTabWidget(
this );
384 newtw->setAutoFillBackground(
true );