thank you sir
bt in my concept i have two file one file was jpeg images another file was sorted images with name sir i have to combine this both

Originally Posted by
jakr13
Hi iswarya,
check the updated piece of code attached to help you how the QTimer can be used in a constructor!!!
jakr13
Added after 4 minutes:
my task concept was:
i have a folder it contains lot of jpeg images..i have to sort this images and putd in textfile by linux.i have one more file it contains timer
it says local image=10 seconds,by reading this timer file i have to display the images for evry 10 seconds.so my codinf should link sorted text file ,timer text file,images file(jpeg).
i want to show slideshow.. (every 10 seconds images should automaticaly change)
this was my concept sir
sir pls kindly help me in my coding itself sir
using for loop i can able to display every images after 10 seconds,,i dnt knw how to put
so pls help me sir
my coding
#include "widget.h"
#include "ui_widget.h"
#include <QtGui>
ui(new Ui::Widget)
{
QString filePath1
("/home/ishwarya/displayimages/configfile");
// path for temp.txt file QString filePath2
("/home/ishwarya/displayimages/local");
// path for images QString sortedimagesfilenameslist
="temp.txt";
// it contains list of sorted images dir.cd(filePath1);
file.setFileName(dir.absoluteFilePath(sortedimages filenameslist));
imagefilename= stream.readLine();
qDebug()<<imagefilename;
dir.cd(filePath2);
qDebug()<<dir;
file1.setFileName(dir.absoluteFilePath(imagefilena me));
qDebug()<<file1.exists();
QImage *img
= new QImage(dir.
absoluteFilePath(imagefilename
));
QPixmap map
= QPixmap::fromImage(img
->scaled
(900,
900,Qt
::KeepAspectRatio,Qt
::FastTransf ormation
));
imageLabel->setPixmap(map);
imageLabel->showFullScreen();
imageLabel->show();
ui->setupUi(this);
}
#include "widget.h"
#include "ui_widget.h"
#include <QtGui>
Widget::Widget(QWidget *parent) :
QWidget(parent),
ui(new Ui::Widget)
{
QString filePath1("/home/ishwarya/displayimages/configfile");// path for temp.txt file
QString filePath2("/home/ishwarya/displayimages/local");// path for images
QString sortedimagesfilenameslist="temp.txt";// it contains list of sorted images
QDir dir;
dir.cd(filePath1);
QFile file;
file.setFileName(dir.absoluteFilePath(sortedimages filenameslist));
file.open(QIODevice::ReadOnly);
QTextStream stream( &file );
QString imagefilename;
imagefilename= stream.readLine();
qDebug()<<imagefilename;
dir.cd(filePath2);
qDebug()<<dir;
QFile file1;
file1.setFileName(dir.absoluteFilePath(imagefilena me));
qDebug()<<file1.exists();
QImage *img = new QImage(dir.absoluteFilePath(imagefilename));
imageLabel=new QLabel(this);
QPixmap map = QPixmap::fromImage(img->scaled(900,900,Qt::KeepAspectRatio,Qt::FastTransf ormation));
imageLabel->setPixmap(map);
imageLabel->showFullScreen();
imageLabel->show();
ui->setupUi(this);
}
To copy to clipboard, switch view to plain text mode
Bookmarks