Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

state.cpp

Go to the documentation of this file.
00001 /***************************************************************************
00002  *                                                                         *
00003  *   state.cpp                                                             *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License as published by  *
00007  *   the Free Software Foundation; either version 2 of the License, or     *
00008  *   (at your option) any later version.                                   *
00009  *                                                                         *
00010  *   Read the file COPYING for details.                                    *
00011  *                                                                         *
00012  *   copyright: (C) 2003 by Jan Mueller                                    *
00013  *   email: janmueller7@hotmail.com                                        *
00014  *                                                                         *
00015  ***************************************************************************/
00016 
00017 #include "state.h"
00018 #include "readonlyformbase.h"
00019 #include <qglobal.h>
00020 #include <qlabel.h>
00021 #include <qsqlquery.h>
00022 #include <qlayout.h>
00023 
00024 State::State(LitUrl u, QObject *receiver, QString slot, QWidget *parent, const char *name): 
00025     ReadOnlyFormBase(u, receiver, slot, parent, name) {
00026     stateform=new StateForm(this, "stateform");
00027     QHBoxLayout *l=new QHBoxLayout(this);
00028     l->addWidget(stateform);
00029     Q_ASSERT(stateform);  
00030     setData();
00031 }
00032 
00033 bool State::setData() {
00034     QSqlQuery query("select count(*) from publication");
00035     query.first();
00036     stateform->publications->setText(query.value(0).toString()+" publications");
00037     
00038     query.exec("select count(*) from part");
00039     query.first();
00040     stateform->parts->setText(query.value(0).toString()+" parts");
00041     
00042     query.exec("select count(*) from author");
00043     query.first();
00044     stateform->authors->setText(query.value(0).toString()+" authors");
00045     
00046     query.exec("select count(*) from partdata");
00047     query.first();
00048     stateform->files->setText(query.value(0).toString()+" files");
00049     
00050     query.exec("select count(*) from note");
00051     query.first();
00052     stateform->notes->setText(query.value(0).toString()+" notes");
00053     
00054     query.exec("select count(*) from link");
00055     query.first();
00056     stateform->links->setText(query.value(0).toString()+" links");
00057     
00058     query.exec("select count(*) from publisher");
00059     query.first();
00060     stateform->publishers->setText(query.value(0).toString()+" publishers");
00061 
00062     query.exec("select count(*) from journal");
00063     query.first();
00064     stateform->journals->setText(query.value(0).toString()+" journals");
00065     
00066     setValid(true);
00067     return true;
00068 }
00069 
00070 State::~State() {
00071 }

Generated on Sat Mar 27 19:20:44 2004 for Literature by doxygen 1.3.6-20040222