AlbumShaper 1.0a3
recentAlbumMenuItem.h
Go to the documentation of this file.
1//==============================================
2// copyright : (C) 2003-2005 by Will Stokes
3//==============================================
4// This program is free software; you can redistribute it
5// and/or modify it under the terms of the GNU General
6// Public License as published by the Free Software
7// Foundation; either version 2 of the License, or
8// (at your option) any later version.
9//==============================================
10
11#ifndef GUI_RECENTALBUMMENUITEM_H
12#define GUI_RECENTALBUMMENUITEM_H
13
14#include <qmenudata.h>
15#include <qimage.h>
16
17//forward declarations
18
19//=====================================
22//=====================================
24{
25//----------------------
26public:
28
30 void changeItem( QString albumName, QString albumLocation, QString numPhotos );
31
32
34 void paint( QPainter * p, const QColorGroup & cg, bool act, bool enabled,
35 int x, int y, int w, int h );
36
38 QSize sizeHint ();
39
42 void setMaxWidth( int val );
43
45 bool fullSpan() const;
46 //----------------------
47private:
49
51 QImage albumImage;
52
54 QString albumName;
55
57 QString numPhotos;
58
60 QSize size;
61
64
67 //----------------------
68};
69//======================
70#endif //GUI_RECENTALBUMMENUITEM_H
A custom menu entry, displays album image, name, and number of photos.
int maxWidth
max element width
int idealImageWidth
used for painting purposes
QSize sizeHint()
returns menu entry size
bool fullSpan() const
no icon necessary since album image painted here
QString numPhotos
number of photos
void changeItem(QString albumName, QString albumLocation, QString numPhotos)
updates entry as per arguments passed (used by constructor during intiailization as well)
void setMaxWidth(int val)
after all menu items have been refreshed hint at maximum width so we can adequately position the acce...
QImage albumImage
album image
RecentAlbumMenuItem(Qt::Key acceleratorKey)
QString albumName
album name
void paint(QPainter *p, const QColorGroup &cg, bool act, bool enabled, int x, int y, int w, int h)
paints entry
QSize size
computed size