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

authoroverview.cpp

Go to the documentation of this file.
00001 /***************************************************************************
00002  *                                                                         *
00003  *   authoroverview.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 "authoroverview.h"
00018 #include "readonlyformbase.h"
00019 #include "linklistbox.h"
00020 #include "linklistboxitem.h"
00021 #include <qglobal.h>
00022 #include <qlabel.h>
00023 #include <qsqlquery.h>
00024 #include <qlayout.h>
00025 
00026 AuthorOverview::AuthorOverview(LitUrl u, QObject *receiver, QString slot, QWidget *parent, const char *name): 
00027         ReadOnlyFormBase(u, receiver, slot, parent, name) {
00028     overviewform=new OverviewForm(this, "authoroverviewform");
00029     QHBoxLayout *l=new QHBoxLayout(this);
00030     l->addWidget(overviewform);
00031     Q_ASSERT(overviewform);  
00032     setData();
00033 }
00034 
00035 bool AuthorOverview::setData() {
00036     overviewform->title->setText("Authors");
00037     overviewform->linklistbox->clear();
00038     overviewform->linklistbox->setColumnText(0, "Names");
00039     QSqlQuery query("select firstname, lastname, no from author order by lastname");
00040     
00041     while(query.next()) {
00042         new LinkListBoxItem(overviewform->linklistbox, query.value(1).toString()+", "+query.value(0).toString(), LitUrl("lit://author/author?no="+query.value(2).toString()));
00043       setValid(true);
00044     }
00045     return true;
00046 }
00047 
00048 AuthorOverview::~AuthorOverview() {
00049 }

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