KDevelop API Documentation

buildtools/autotools/autolistviewitems.cpp

Go to the documentation of this file.
00001 /*************************************************************************** 00002 * Copyright (C) 2001-2002 by Bernd Gehrmann * 00003 * bernd@kdevelop.org * 00004 * * 00005 * Copyright (C) 2002 by Victor Rder * 00006 * victor_roeder@gmx.de * 00007 * * 00008 * This program is free software; you can redistribute it and/or modify * 00009 * it under the terms of the GNU General Public License as published by * 00010 * the Free Software Foundation; either version 2 of the License, or * 00011 * (at your option) any later version. * 00012 * * 00013 ***************************************************************************/ 00014 00015 #include <qpainter.h> 00016 00017 #include <kiconloader.h> 00018 00019 #include "autolistviewitems.h" 00020 00025 ProjectItem::ProjectItem( Type type, QListView *parent, const QString &text ) 00026 : QListViewItem( parent, text ), typ( type ) 00027 { 00028 bld = false; 00029 } 00030 00031 00032 ProjectItem::ProjectItem( Type type, ProjectItem *parent, const QString &text ) 00033 : QListViewItem( parent, text ), typ( type ) 00034 { 00035 bld = false; 00036 } 00037 00038 00039 void ProjectItem::paintCell( QPainter *p, const QColorGroup &cg, 00040 int column, int width, int alignment ) 00041 { 00042 if ( isBold() ) 00043 { 00044 QFont font( p->font() ); 00045 font.setBold( true ); 00046 p->setFont( font ); 00047 } 00048 QListViewItem::paintCell( p, cg, column, width, alignment ); 00049 } 00050 00051 00056 SubprojectItem::SubprojectItem( QListView *parent, const QString &text ) 00057 : ProjectItem( Subproject, parent, text ) 00058 { 00059 init(); 00060 } 00061 00062 00063 SubprojectItem::SubprojectItem( SubprojectItem *parent, const QString &text ) 00064 : ProjectItem( Subproject, parent, text ) 00065 { 00066 init(); 00067 } 00068 00069 00070 void SubprojectItem::init() 00071 { 00072 targets.setAutoDelete( true ); 00073 setPixmap( 0, SmallIcon( "folder" ) ); 00074 } 00075 00076 00077 QString SubprojectItem::relativePath() 00078 { 00079 QString relpath = subdir; 00080 00081 SubprojectItem *it = this; 00082 while ( (it= dynamic_cast<SubprojectItem*>(it->parent())) ) 00083 { 00084 relpath.prepend(it->subdir + "/"); 00085 } 00086 relpath.remove(0, 2); 00087 00088 return relpath; 00089 } 00090 00091 00096 TargetItem::TargetItem( QListView *lv, bool group, const QString &text ) 00097 : ProjectItem( Target, lv, text ) 00098 { 00099 sources.setAutoDelete( true ); 00100 setPixmap( 0, group ? SmallIcon( "tar" ) : SmallIcon( "binary" ) ); 00101 } 00102 00103 00108 FileItem::FileItem( QListView *lv, const QString &text ) 00109 : ProjectItem( File, lv, text ) 00110 { 00111 setPixmap( 0, SmallIcon( "document" ) ); 00112 } 00113 00114
KDE Logo
This file is part of the documentation for KDevelop Version 3.0.4.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Tue Oct 19 08:01:36 2004 by doxygen 1.3.7 written by Dimitri van Heesch, © 1997-2003