// --------------------------------------------------------------------- Form::Form(string s, string p, string loc, QWidget *parent) : QWidget (parent) { Q_UNUSED(parent); id=s; child=0; evtchild=0; locale=loc; menubar=0; seq=FormSeq++; tab=0; closed=false; shown=false; lastfocus=""; setAttribute(Qt::WA_DeleteOnClose); QStringList m=s2q(p).split(' ',QString::SkipEmptyParts); if (invalidopt(s,m,"escclose closeok dialog popup minbutton maxbutton closebutton ptop owner nosize")) return; escclose=m.contains("escclose"); closeok=m.contains("closeok"); setpn(s); Qt::WindowFlags flags=0; if (m.contains("dialog")) flags=Qt::Dialog|Qt::WindowTitleHint|Qt::WindowStaysOnTopHint|Qt::CustomizeWindowHint; if (m.contains("popup")) flags=Qt::Popup; if (m.contains("minbutton")) flags|=Qt::WindowMinimizeButtonHint; if (m.contains("maxbutton")) flags|=Qt::WindowMaximizeButtonHint; if (m.contains("closebutton")) flags|=Qt::WindowCloseButtonHint; if (m.contains("ptop")) flags|=Qt::WindowStaysOnTopHint; if (m.contains("owner")) { flags|=Qt::Window; setWindowModality(Qt::WindowModal); } if (fontdef) setFont(fontdef->font); setWindowFlags(flags); layout=new QVBoxLayout(this); setpadding(0,0,0,0); layout->setSpacing(0); if (m.contains("nosize")) layout->setSizeConstraint( QLayout::SetFixedSize ); addpane(0); signalMapper=new QSignalMapper(this); connect(signalMapper,SIGNAL(mapped(QWidget *)), this,SLOT(buttonClicked(QWidget *))); timer=new QTimer(this); connect(timer, SIGNAL(timeout()),this,SLOT(systimer())); }
int main() { systimer (systimer::ms, 1); mcp3551 sensor; while (1) { sensor.getCode (); indicator.get_buffer (sensor.byteCode); delay_ms (500); /*if (button.short_press)*/ { // foo(); //button.short_press = 0; } } }