AlbumShaper  1.0a3
Public Member Functions | Protected Member Functions | Private Attributes
GroupsWidget Class Reference

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

#include <groupsWidget.h>

Inheritance diagram for GroupsWidget:
Inheritance graph
[legend]
Collaboration diagram for GroupsWidget:
Collaboration graph
[legend]

List of all members.

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

Detailed Description

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

Definition at line 25 of file groupsWidget.h.


Constructor & Destructor Documentation

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

Definition at line 18 of file groupsWidget.cpp.

                                               : QIconView( parent, name)
{
  setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Minimum);
}

Member Function Documentation

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

Definition at line 24 of file groupsWidget.cpp.

{
  //ignore all clicks other than left-clicks
  if( e->button() != Qt::LeftButton ) return;
  
  QIconView::contentsMousePressEvent( e );
}
int GroupsWidget::getTextWidth ( )

Definition at line 68 of file groupsWidget.cpp.

References textWidth.

{ return textWidth; }
void GroupsWidget::keyPressEvent ( QKeyEvent *  e)

Definition at line 32 of file groupsWidget.cpp.

{
  //change key left/right presses to up/down events
  int key = e->key();
  if( key == Key_Left) key = Key_Up;
  if( key == Key_Right) key = Key_Down;

  QIconView::keyPressEvent(
    new QKeyEvent(QEvent::KeyPress,
              key,
              e->ascii(),
              e->state(),
              e->text(),
              e->isAutoRepeat(),
              e->count() ) );
}
void GroupsWidget::setTextWidth ( int  val)

Definition at line 65 of file groupsWidget.cpp.

References textWidth.

Referenced by ConfigurationWidget::ConfigurationWidget().

{ textWidth = val; }
QSize GroupsWidget::sizeHint ( ) const

Definition at line 49 of file groupsWidget.cpp.

{
  QSize s = QIconView::sizeHint();

  //find max item width
  s.setWidth(0);
  QIconViewItem *item;
  for( item = firstItem(); item != NULL; item = item->nextItem() )
  {
    if(item->width() + 2 > s.width() )
      s.setWidth( item->width() );
  }
  s.setWidth( s.width() + 2*spacing() );
  return s;
}

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: