24 #include <QStackedWidget>
25 #include <QProgressBar>
26 #include <QToolButton>
28 #include <QGridLayout>
30 #include <QMouseEvent>
34 : QFrame( parent ), mCurrentItem( NULL )
36 QPalette pal = palette();
37 pal.setBrush( backgroundRole(), pal.window() );
39 setAutoFillBackground(
true );
40 setFrameShape( QFrame::StyledPanel );
41 setFrameShadow( QFrame::Plain );
43 mLayout =
new QGridLayout(
this );
44 mLayout->setContentsMargins( 9, 1, 9, 1 );
48 mCountStyleSheet = QString(
"QProgressBar { border: 1px solid rgba(0, 0, 0, 75%);"
49 " border-radius: 2px; background: rgba(0, 0, 0, 0);"
50 " image: url(:/images/themes/default/%1) }"
51 "QProgressBar::chunk { background-color: rgba(0, 0, 0, 30%); width: 5px; }" );
56 mCountProgress->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed );
65 mItemCount->setSizePolicy( QSizePolicy::Maximum, QSizePolicy::Preferred );
79 "QToolButton { background-color: rgba(255, 255, 255, 0); } "
80 "QToolButton::menu-indicator { subcontrol-position: right bottom; subcontrol-origin: padding; bottom: 2px; }" );
81 mCloseBtn->setCursor( Qt::PointingHandCursor );
83 mCloseBtn->setIconSize( QSize( 18, 18 ) );
84 mCloseBtn->setSizePolicy( QSizePolicy::Maximum, QSizePolicy::Maximum );
106 if (
mCountProgress == childAt( e->pos() ) && e->button() == Qt::LeftButton )
132 QWidget *widget =
dynamic_cast<QWidget*
>(
mCurrentItem );
133 mLayout->removeWidget( widget );
135 disconnect(
mCurrentItem, SIGNAL( styleChanged( QString ) ),
this, SLOT( setStyleSheet( QString ) ) );
170 if ( existingItem == item )
172 mItems.removeOne( existingItem );
199 while (
mItems.count() > 0 )
213 disconnect(
mCurrentItem, SIGNAL( styleChanged( QString ) ),
this, SLOT( setStyleSheet( QString ) ) );
218 if (
mItems.contains( item ) )
229 mLayout->addWidget( item, 0, 1, 1, 1 );
240 connect(
mCurrentItem, SIGNAL( styleChanged( QString ) ),
this, SLOT( setStyleSheet( QString ) ) );