GroupsWidget Class Reference

#include <groupsWidget.h>

Inheritance diagram for GroupsWidget:

[legend]
Collaboration diagram for GroupsWidget:
[legend]
List of all members.

Detailed Description

Displays group icon and text, also contains pointer to widget for setting group settings.

Definition at line 25 of file groupsWidget.h.

Public Member Functions

 GroupsWidget (QWidget *parent=0, const char *name=0)
void keyPressEvent (QKeyEvent *e)
QSize sizeHint () const
void setTextWidth (int val)
int getTextWidth ()

Protected Member Functions

void contentsMousePressEvent (QMouseEvent *e)

Private Attributes

int textWidth


Constructor & Destructor Documentation

GroupsWidget::GroupsWidget ( QWidget parent = 0,
const char *  name = 0 
)

Definition at line 18 of file groupsWidget.cpp.

00019                                                : QIconView( parent, name)
00020 {
00021   setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Minimum);
00022 }


Member Function Documentation

void GroupsWidget::keyPressEvent ( QKeyEvent *  e  ) 

Definition at line 32 of file groupsWidget.cpp.

00033 {
00034   //change key left/right presses to up/down events
00035   int key = e->key();
00036   if( key == Key_Left) key = Key_Up;
00037   if( key == Key_Right) key = Key_Down;
00038 
00039   QIconView::keyPressEvent(
00040     new QKeyEvent(QEvent::KeyPress,
00041               key,
00042               e->ascii(),
00043               e->state(),
00044               e->text(),
00045               e->isAutoRepeat(),
00046               e->count() ) );
00047 }

QSize GroupsWidget::sizeHint (  )  const

Definition at line 49 of file groupsWidget.cpp.

00050 {
00051   QSize s = QIconView::sizeHint();
00052 
00053   //find max item width
00054   s.setWidth(0);
00055   QIconViewItem *item;
00056   for( item = firstItem(); item != NULL; item = item->nextItem() )
00057   {
00058     if(item->width() + 2 > s.width() )
00059       s.setWidth( item->width() );
00060   }
00061   s.setWidth( s.width() + 2*spacing() );
00062   return s;
00063 }

void GroupsWidget::setTextWidth ( int  val  ) 

Definition at line 65 of file groupsWidget.cpp.

References textWidth.

Referenced by ConfigurationWidget::ConfigurationWidget().

00066 { textWidth = val; }

int GroupsWidget::getTextWidth (  ) 

Definition at line 68 of file groupsWidget.cpp.

References textWidth.

00069 { return textWidth; }

void GroupsWidget::contentsMousePressEvent ( QMouseEvent *  e  )  [protected]

Definition at line 24 of file groupsWidget.cpp.

00025 {
00026   //ignore all clicks other than left-clicks
00027   if( e->button() != Qt::LeftButton ) return;
00028   
00029   QIconView::contentsMousePressEvent( e );
00030 }


Member Data Documentation

int GroupsWidget::textWidth [private]

Definition at line 43 of file groupsWidget.h.

Referenced by getTextWidth(), and setTextWidth().


The documentation for this class was generated from the following files:
Generated on Wed Jan 24 05:38:10 2007 for AlbumShaper by  doxygen 1.5.1