Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

statwindow.cpp

Go to the documentation of this file.
00001 /**********************************************************************
00002 ** Copyright (C) 2002-2004 Michael 'Mickey' Lauer.  All rights reserved.
00003 **
00004 ** This file is part of Wellenreiter II.
00005 **
00006 ** This file may be distributed and/or modified under the terms of the
00007 ** GNU General Public License version 2 as published by the Free Software
00008 ** Foundation and appearing in the file LICENSE.GPL included in the
00009 ** packaging of this file.
00010 **
00011 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
00012 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00013 **
00014 **********************************************************************/
00015 
00016 #include "statwindow.h"
00017 #include <opie2/olistview.h>
00018 
00019 using namespace Opie::Ui;
00020 using namespace Opie::Ui;
00021 using namespace Opie::Ui;
00022 MStatWindow::MStatWindow( QWidget * parent, const char * name, WFlags f )
00023            :QVBox( parent, name, f )
00024 {
00025     table = new OListView( this );
00026     table->addColumn( tr( "Protocol" ) );
00027     table->addColumn( tr( "Count" ) );
00028     table->setItemMargin( 2 );
00029 };
00030 
00031 
00032 void MStatWindow::updateCounter( const QString& protocol, int counter )
00033 {
00034     QListViewItemIterator it( table );
00035     for ( ; it.current(); ++it )
00036     {
00037         if ( it.current()->text( 0 ) == protocol )
00038         {
00039             it.current()->setText( 1, QString::number( counter ) );
00040             return;
00041         }
00042     }
00043 
00044     new OListViewItem( table, protocol, QString::number( counter ) );
00045 }
00046 

Generated on Sat Nov 5 16:17:45 2005 for OPIE by  doxygen 1.4.2