PDA

View Full Version : Gif as Background for QListWidget or transparent background



gunturrohith
21st March 2016, 07:43
Hi

Iam trying to add Gif Image as an background for the QListWidget

Here is my Part of Code to understand what i have done



resize(800,600);

myMovie = new QMovie(":/images/icon_gif.gif");
movieLabel = new QLabel(this);
movieLabel->setMovie(myMovie);
myMovie->start();

listWidget = new QListWidget(this);
listWidget->setViewMode(QListView::IconMode);
listWidget->resize(800,600);


QListWidgetItem *sample = new QListWidgetItem();
sample->setIcon(QIcon(":/images/shutdown.png"));
sample->setText("Sample");
sample->setTextAlignment(Qt::AlignHCenter);

listWidget->addItem(sample);
listWidget->setItemWidget(sample,movieLabel);


The Gif image was not displaying in background with the animation that it contains

and the output is 11806

OR else how can i make a QListWidget Transparent so that i will be able to see the components that are present behind it.


Please Guide me,

Thanks in advance,
Rohith.G