|
AlbumShaper
1.0a3
|
Displays group icon and text, also contains pointer to widget for setting group settings. More...
#include <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 |
Displays group icon and text, also contains pointer to widget for setting group settings.
Definition at line 25 of file groupsWidget.h.
| 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); }
| 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 | ( | ) |
| 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;
}
int GroupsWidget::textWidth [private] |
Definition at line 43 of file groupsWidget.h.
Referenced by getTextWidth(), and setTextWidth().
1.7.5.1