-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcxlogolistwidget.cpp
45 lines (36 loc) · 968 Bytes
/
cxlogolistwidget.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#include "cxlogolistwidget.h"
#define LOGOH 45
#define LOGOW 60
//////////////////////////////////////////////////////////////////////////
LogoItem::LogoItem(CxImageItem* image)
{
m_image = image ;
setSizeHint(QSize(LOGOW,LOGOH)) ;
setIcon(QIcon(image->myPixmap())) ;
m_pos = image->pos() ;
m_size = image->rect().size() ;
m_path = image->imageSource() ;
}
//////////////////////////////////////////////////////////////////////////
CxLogoListWidget::CxLogoListWidget(QWidget *parent)
: QListWidget(parent)
{
setViewMode(QListView::IconMode) ;
setLayoutDirection(Qt::LeftToRight) ;
setIconSize(QSize(LOGOW,LOGOH)) ;
setFlow(QListView::LeftToRight) ;
setDragDropMode(QAbstractItemView::NoDragDrop) ;
setWrapping(false);
}
CxLogoListWidget::~CxLogoListWidget()
{
}
void CxLogoListWidget::addMyItem( CxImageItem* image )
{
LogoItem* item = new LogoItem(image) ;
addItem(item) ;
}
void CxLogoListWidget::onRemoveLogo()
{
takeItem(currentRow()) ;
}