// sas_torture.cpp // // A Qt-based application for playing Microsoft WAV files. // // (C) Copyright 2002 Fred Gleason // // $Id: sas_torture.cpp,v 1.10 2011/06/21 22:20:44 cvs Exp $ // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License version 2 as // published by the Free Software Foundation. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public // License along with this program; if not, write to the Free Software // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. // #include #include #include #include #include #include #include #include #include MainWidget::MainWidget(QWidget *parent,const char *name) :QWidget(parent,name) { unsigned schema=0; // // Fix the Window Size // setMinimumWidth(sizeHint().width()); setMaximumWidth(sizeHint().width()); setMinimumHeight(sizeHint().height()); setMaximumHeight(sizeHint().height()); // // Generate Fonts // QFont font("Helvetica",12,QFont::Normal); font.setPixelSize(12); // // Open Database // rd_config=new RDConfig(RD_CONF_FILE); rd_config->load(); QString err; test_db=RDInitDb(&schema,&err); if(!test_db) { QMessageBox::warning(this,"Can't Connect", err,0,1,1); exit(0); } // // Generate Button // QPushButton *button=new QPushButton(this,"generate_button"); button->setGeometry(10,10,sizeHint().width()-20,50); button->setText("Generate Test"); button->setFont(font); connect(button,SIGNAL(clicked()),this,SLOT(generateData())); // // Remove Button // button=new QPushButton(this,"remove_button"); button->setGeometry(10,70,sizeHint().width()-20,50); button->setText("Remove Test"); button->setFont(font); connect(button,SIGNAL(clicked()),this,SLOT(removeData())); // // Exit Button // button=new QPushButton(this,"cancel_button"); button->setGeometry(10,130,sizeHint().width()-20,50); button->setText("Exit"); button->setFont(font); connect(button,SIGNAL(clicked()),this,SLOT(cancelData())); } QSize MainWidget::sizeHint() const { return QSize(200,190); } QSizePolicy MainWidget::sizePolicy() const { return QSizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed); } void MainWidget::generateData() { QString sql; RDSqlQuery *q; QString rml; QString desc; // // Create Carts // for(int i=0;iquit(); } void MainWidget::closeEvent(QCloseEvent *e) { cancelData(); } int main(int argc,char *argv[]) { QApplication a(argc,argv); MainWidget *w=new MainWidget(NULL,"main"); a.setMainWidget(w); w->setGeometry(QRect(QPoint(0,0),w->sizeHint())); w->show(); return a.exec(); }