PDA

View Full Version : Create slide show



iswaryasenthilkumar
4th December 2014, 09:18
hai .
i have a task in qtWidget.
the task was
user have two folder one was remote and another one was local.remote folder should contain 24 images where there is no restrictions for local folder.user have to make slideshow based on this two folder.every 10 seconds local images should display when timer reaches 5 minutes remote images should display for 10 seconds then after 10 seconds every local images should dispaly 10 seconds again after 5 minutes remote imagemshould display there is no ending for this program unless user clicks the mouse to close window.
this was my task.
i completed it works,,bt my problem was i have to use only one method not more than 1 slots.
can any one plss help me to recover this problem??:confused::crying:

iswaryasenthilkumar
4th December 2014, 09:29
hai..
i have a task in qt.
my task was am having 2 folder one was remote another one was local.in remote folder should contain 24 images,in local there is no restrictions.
i have to make slideshow every 10 seconds local images should display when timerreaches 5 minutes remote images should display 10seconds after local start...
i created bt timer was not working..
can any one help me??plsss

hai..
i have a task in qt.
my task was am having 2 folder one was remote another one was local.in remote folder should contain 24 images,in local there is no restrictions.
i have to make slideshow every 10 seconds local images should display when timerreaches 5 minutes remote images should display 10seconds after local start...
i created bt timer was not working..
can any one help me??plsss:confused::crying:

iswaryasenthilkumar
4th December 2014, 11:55
this was my coding:
Widget.cpp


#include "widget.h"
#include "ui_widget.h"
#include<QTimer>
#include<QtGui>
#include<QMouseEvent>

Widget::Widget(QWidget *parent) :
QWidget(parent),
ui(new Ui::Widget)
{

QImage *img = new QImage("/home/ishwarya/displayimages/local/1.jpeg");
label=new QLabel(this);
QPixmap map = QPixmap::fromImage(img->scaled(900,900,Qt::KeepAspectRatio,Qt::FastTransfo rmation));
label->setPixmap(map);
label->show();
QTimer::singleShot(10000,this,SLOT(slot1()));

ui->setupUi(this);
}

Widget::~Widget()
{
delete ui;

}

void Widget::slot1()

{

QImage *img = new QImage("/home/ishwarya/displayimages/local/2.jpeg");
label=new QLabel(this);
QPixmap map = QPixmap::fromImage(img->scaled(900,900,Qt::KeepAspectRatio,Qt::FastTransfo rmation));
label->setPixmap(map);
label->showFullScreen();
label->show();

QTimer::singleShot(10000,this,SLOT(slot2()));

}

void Widget::slot2()
{
QImage *img = new QImage("/home/ishwarya/displayimages/local/3.jpeg");
label=new QLabel(this);
QPixmap map = QPixmap::fromImage(img->scaled(900,900,Qt::KeepAspectRatio,Qt::FastTransfo rmation));
label->setPixmap(map);
label->showFullScreen();
label->show();

QTimer::singleShot(10000,this,SLOT(slot3()));
}
void Widget::slot3()
{
QImage *img = new QImage("/home/ishwarya/displayimages/local/4.jpeg");
label=new QLabel(this);
QPixmap map = QPixmap::fromImage(img->scaled(900,900,Qt::KeepAspectRatio,Qt::FastTransfo rmation));
label->setPixmap(map);
label->showFullScreen();
label->show();

QTimer::singleShot(10000,this,SLOT(slot4()));
}
void Widget::slot4()
{
showFullScreen();
activateWindow();
update();
QImage *img = new QImage("/home/ishwarya/displayimages/local/5.jpeg");
label=new QLabel(this);
QPixmap map = QPixmap::fromImage(img->scaled(900,900,Qt::KeepAspectRatio,Qt::FastTransfo rmation));
label->setPixmap(map);
label->showFullScreen();
label->show();

QTimer::singleShot(10000,this,SLOT(slot5()));

}

void Widget::slot5()
{
QImage *img = new QImage("/home/ishwarya/displayimages/local/6.jpeg");
label=new QLabel(this);
QPixmap map = QPixmap::fromImage(img->scaled(900,900,Qt::KeepAspectRatio,Qt::FastTransfo rmation));
label->setPixmap(map);
label->showFullScreen();
label->show();

QTimer::singleShot(10000,this,SLOT(slot6()));
}

void Widget::slot6()
{
QImage *img = new QImage("/home/ishwarya/displayimages/local/7.jpeg");
label=new QLabel(this);
QPixmap map = QPixmap::fromImage(img->scaled(900,900,Qt::KeepAspectRatio,Qt::FastTransfo rmation));
label->setPixmap(map);
label->showFullScreen();
label->show();

QTimer::singleShot(10000,this,SLOT(slot7()));

}

void Widget::slot7()

{
showFullScreen();
activateWindow();
update();
QImage *img = new QImage("/home/ishwarya/displayimages/local/8.jpeg");
label=new QLabel(this);
QPixmap map = QPixmap::fromImage(img->scaled(900,900,Qt::KeepAspectRatio,Qt::FastTransfo rmation));
label->setPixmap(map);
label->showFullScreen();
label->show();

QTimer::singleShot(10000,this,SLOT(slot8()));

}

void Widget::slot8()
{
QImage *img = new QImage("/home/ishwarya/displayimages/local/9.jpeg");
label=new QLabel(this);
QPixmap map = QPixmap::fromImage(img->scaled(900,900,Qt::KeepAspectRatio,Qt::FastTransfo rmation));
label->setPixmap(map);
label->showFullScreen();
label->show();

QTimer::singleShot(10000,this,SLOT(slot9()));
}
void Widget::slot9()
{
showFullScreen();
activateWindow();
update();
QImage *img = new QImage("/home/ishwarya/displayimages/local/10.jpeg");
label=new QLabel(this);
QPixmap map = QPixmap::fromImage(img->scaled(900,900,Qt::KeepAspectRatio,Qt::FastTransfo rmation));
label->setPixmap(map);
label->showFullScreen();
label->show();

QTimer::singleShot(10000,this,SLOT(slot10()));
}
void Widget::slot10()
{
QImage *img = new QImage("/home/ishwarya/displayimages/local/11.jpeg");
label=new QLabel(this);
QPixmap map = QPixmap::fromImage(img->scaled(900,900,Qt::KeepAspectRatio,Qt::FastTransfo rmation));
label->setPixmap(map);
label->showFullScreen();
label->show();

QTimer::singleShot(10000,this,SLOT(slot11()));

}

void Widget::slot11()
{
QImage *img = new QImage("/home/ishwarya/displayimages/local/12.jpeg");
label=new QLabel(this);
QPixmap map = QPixmap::fromImage(img->scaled(900,900,Qt::KeepAspectRatio,Qt::FastTransfo rmation));
label->setPixmap(map);
label->showFullScreen();
label->show();

QTimer::singleShot(10000,this,SLOT(slot12()));
}

void Widget::slot12()
{
QImage *img = new QImage("/home/ishwarya/displayimages/local/13.jpeg");
label=new QLabel(this);
QPixmap map = QPixmap::fromImage(img->scaled(900,900,Qt::KeepAspectRatio,Qt::FastTransfo rmation));
label->setPixmap(map);
label->showFullScreen();
label->show();

QTimer::singleShot(10000,this,SLOT(slot13()));

}
void Widget::slot13()
{
showFullScreen();
activateWindow();
update();
QImage *img = new QImage("/home/ishwarya/displayimages/local/14.jpeg");
label=new QLabel(this);
QPixmap map = QPixmap::fromImage(img->scaled(900,900,Qt::KeepAspectRatio,Qt::FastTransfo rmation));
label->setPixmap(map);
label->showFullScreen();
label->show();

QTimer::singleShot(10000,this,SLOT(slot14()));
}
void Widget::slot14()
{
QImage *img = new QImage("/home/ishwarya/displayimages/local/15.jpeg");
label=new QLabel(this);
QPixmap map = QPixmap::fromImage(img->scaled(900,900,Qt::KeepAspectRatio,Qt::FastTransfo rmation));
label->setPixmap(map);
label->showFullScreen();
label->show();

QTimer::singleShot(10000,this,SLOT(slot15()));

}

void Widget::slot15()
{
QImage *img = new QImage("/home/ishwarya/displayimages/local/16.jpeg");
label=new QLabel(this);
QPixmap map = QPixmap::fromImage(img->scaled(900,900,Qt::KeepAspectRatio,Qt::FastTransfo rmation));
label->setPixmap(map);
label->showFullScreen();
label->show();

QTimer::singleShot(10000,this,SLOT(slot16()));
}

void Widget::slot16()
{

QImage *img = new QImage("/home/ishwarya/displayimages/local/17.jpeg");
label=new QLabel(this);
QPixmap map = QPixmap::fromImage(img->scaled(900,900,Qt::KeepAspectRatio,Qt::FastTransfo rmation));
label->setPixmap(map);
label->showFullScreen();
label->show();

QTimer::singleShot(10000,this,SLOT(slot17()));

}
void Widget::slot17()
{
showFullScreen();
activateWindow();
update();
QImage *img = new QImage("/home/ishwarya/displayimages/local/18.jpeg");
label=new QLabel(this);
QPixmap map = QPixmap::fromImage(img->scaled(900,900,Qt::KeepAspectRatio,Qt::FastTransfo rmation));
label->setPixmap(map);
label->showFullScreen();
label->show();

QTimer::singleShot(10000,this,SLOT(slot18()));

}
void Widget::slot18()
{

QImage *img = new QImage("/home/ishwarya/displayimages/local/19.jpeg");
label=new QLabel(this);
QPixmap map = QPixmap::fromImage(img->scaled(900,900,Qt::KeepAspectRatio,Qt::FastTransfo rmation));
label->setPixmap(map);
label->showFullScreen();
label->show();

QTimer::singleShot(10000,this,SLOT(slot19()));

}
void Widget::slot19()
{

QImage *img = new QImage("/home/ishwarya/displayimages/local/20.jpeg");
label=new QLabel(this);
QPixmap map = QPixmap::fromImage(img->scaled(900,900,Qt::KeepAspectRatio,Qt::FastTransfo rmation));
label->setPixmap(map);
label->showFullScreen();
label->show();

QTimer::singleShot(10000,this,SLOT(slot20()));

}
void Widget::slot20()
{
showFullScreen();
activateWindow();
update();
QImage *img = new QImage("/home/ishwarya/displayimages/remote/1.jpeg");
label=new QLabel(this);
QPixmap map = QPixmap::fromImage(img->scaled(900,900,Qt::KeepAspectRatio,Qt::FastTransfo rmation));
label->setPixmap(map);
label->showFullScreen();
label->show();

QTimer::singleShot(10000,this,SLOT(slot1()));

}


void Widget::mousePressEvent(QMouseEvent *event)
{
if(event->button()==Qt::LeftButton || Qt::RightButton)
{

showMaximized();
activateWindow();
update();
QTimer::singleShot(delay1,this,SLOT(repaint()));

}

}