AlbumShaper
1.0a3
src
gui
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
//=====================================
23
class
RecentAlbumMenuItem
:
public
QMenuItem
24
{
25
//----------------------
26
public
:
27
RecentAlbumMenuItem
( Qt::Key
acceleratorKey
);
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
//----------------------
47
private
:
48
Qt::Key
acceleratorKey
;
49
51
QImage
albumImage
;
52
54
QString
albumName
;
55
57
QString
numPhotos
;
58
60
QSize
size
;
61
63
int
maxWidth
;
64
66
int
idealImageWidth
;
67
//----------------------
68
};
69
//======================
70
#endif //GUI_RECENTALBUMMENUITEM_H
RecentAlbumMenuItem::fullSpan
bool fullSpan() const
no icon necessary since album image painted here
Definition:
recentAlbumMenuItem.cpp:108
RecentAlbumMenuItem::maxWidth
int maxWidth
max element width
Definition:
recentAlbumMenuItem.h:63
RecentAlbumMenuItem::changeItem
void changeItem(QString albumName, QString albumLocation, QString numPhotos)
updates entry as per arguments passed (used by constructor during intiailization as well) ...
Definition:
recentAlbumMenuItem.cpp:28
RecentAlbumMenuItem::setMaxWidth
void setMaxWidth(int val)
after all menu items have been refreshed hint at maximum width so we can adequately position the acce...
Definition:
recentAlbumMenuItem.cpp:111
RecentAlbumMenuItem::acceleratorKey
Qt::Key acceleratorKey
Definition:
recentAlbumMenuItem.h:48
RecentAlbumMenuItem::RecentAlbumMenuItem
RecentAlbumMenuItem(Qt::Key acceleratorKey)
Definition:
recentAlbumMenuItem.cpp:22
RecentAlbumMenuItem::paint
void paint(QPainter *p, const QColorGroup &cg, bool act, bool enabled, int x, int y, int w, int h)
paints entry
Definition:
recentAlbumMenuItem.cpp:60
RecentAlbumMenuItem
A custom menu entry, displays album image, name, and number of photos.
Definition:
recentAlbumMenuItem.h:23
RecentAlbumMenuItem::idealImageWidth
int idealImageWidth
used for painting purposes
Definition:
recentAlbumMenuItem.h:66
RecentAlbumMenuItem::numPhotos
QString numPhotos
number of photos
Definition:
recentAlbumMenuItem.h:57
RecentAlbumMenuItem::sizeHint
QSize sizeHint()
returns menu entry size
Definition:
recentAlbumMenuItem.cpp:105
QMenuItem
RecentAlbumMenuItem::albumName
QString albumName
album name
Definition:
recentAlbumMenuItem.h:54
RecentAlbumMenuItem::size
QSize size
computed size
Definition:
recentAlbumMenuItem.h:60
RecentAlbumMenuItem::albumImage
QImage albumImage
album image
Definition:
recentAlbumMenuItem.h:51
Generated by
1.8.12