|
AlbumShaper
1.0a3
|
#include <items.h>


Public Member Functions | |
| Items (QWidget *parent=0, const char *name=0) | |
| void | keyPressEvent (QKeyEvent *e) |
| QSize | sizeHint () const |
Private Slots | |
| void | repaintGroup (QIconViewItem *pseudoSelection) |
| void | clearPseudoSelection () |
Private Attributes | |
| Item * | currentPseudoSelection |
| Items::Items | ( | QWidget * | parent = 0, |
| const char * | name = 0 |
||
| ) |
Definition at line 19 of file items.cpp.
References clearPseudoSelection(), currentPseudoSelection, and repaintGroup().
: QIconView( parent, name) { currentPseudoSelection = NULL; // setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Minimum); //connect mouse over events to paint pseudo selection in ligher blue connect( this, SIGNAL(onItem(QIconViewItem*)), this, SLOT(repaintGroup(QIconViewItem*)) ); //clear any pseudo selection when mouse moves off icons connect( this, SIGNAL(onViewport()), this, SLOT(clearPseudoSelection()) ); }
| void Items::clearPseudoSelection | ( | ) | [private, slot] |
Definition at line 78 of file items.cpp.
References currentPseudoSelection, and Item::setMousedOver().
Referenced by Items(), and repaintGroup().
{
//if old pseudo selection unselect it
if(currentPseudoSelection != NULL)
{
currentPseudoSelection->setMousedOver(false);
repaintItem(currentPseudoSelection);
currentPseudoSelection = NULL;
}
}
| void Items::keyPressEvent | ( | QKeyEvent * | e | ) |
Definition at line 34 of file items.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 Items::repaintGroup | ( | QIconViewItem * | pseudoSelection | ) | [private, slot] |
Definition at line 67 of file items.cpp.
References clearPseudoSelection(), currentPseudoSelection, and Item::setMousedOver().
Referenced by Items().
{
//if old pseudo selection unselect it
clearPseudoSelection();
//paint new selection
currentPseudoSelection = (Item*)pseudoSelection;
currentPseudoSelection->setMousedOver(true);
repaintItem(currentPseudoSelection);
}
| QSize Items::sizeHint | ( | ) | const |
Definition at line 51 of file items.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;
}
Item* Items::currentPseudoSelection [private] |
Definition at line 38 of file items.h.
Referenced by clearPseudoSelection(), Items(), and repaintGroup().
1.7.5.1