Results 1 to 3 of 3

Thread: Create slide show

  1. #1
    Join Date
    Nov 2014
    Location
    Chennai
    Posts
    160
    Thanks
    65
    Qt products
    Qt4
    Platforms
    Unix/X11

    Question Create slide show

    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??
    Last edited by iswaryasenthilkumar; 4th December 2014 at 12:58.

  2. #2
    Join Date
    Nov 2014
    Location
    Chennai
    Posts
    160
    Thanks
    65
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Want to display multiple images based on Qtimer

    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

  3. #3
    Join Date
    Nov 2014
    Location
    Chennai
    Posts
    160
    Thanks
    65
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Make QTimer start and then go through its delay.?

    this was my coding:
    Widget.cpp
    Qt Code:
    1. #include "widget.h"
    2. #include "ui_widget.h"
    3. #include<QTimer>
    4. #include<QtGui>
    5. #include<QMouseEvent>
    6.  
    7. Widget::Widget(QWidget *parent) :
    8. QWidget(parent),
    9. ui(new Ui::Widget)
    10. {
    11.  
    12. QImage *img = new QImage("/home/ishwarya/displayimages/local/1.jpeg");
    13. label=new QLabel(this);
    14. QPixmap map = QPixmap::fromImage(img->scaled(900,900,Qt::KeepAspectRatio,Qt::FastTransformation));
    15. label->setPixmap(map);
    16. label->show();
    17. QTimer::singleShot(10000,this,SLOT(slot1()));
    18.  
    19. ui->setupUi(this);
    20. }
    21.  
    22. Widget::~Widget()
    23. {
    24. delete ui;
    25.  
    26. }
    27.  
    28. void Widget::slot1()
    29.  
    30. {
    31.  
    32. QImage *img = new QImage("/home/ishwarya/displayimages/local/2.jpeg");
    33. label=new QLabel(this);
    34. QPixmap map = QPixmap::fromImage(img->scaled(900,900,Qt::KeepAspectRatio,Qt::FastTransformation));
    35. label->setPixmap(map);
    36. label->showFullScreen();
    37. label->show();
    38.  
    39. QTimer::singleShot(10000,this,SLOT(slot2()));
    40.  
    41. }
    42.  
    43. void Widget::slot2()
    44. {
    45. QImage *img = new QImage("/home/ishwarya/displayimages/local/3.jpeg");
    46. label=new QLabel(this);
    47. QPixmap map = QPixmap::fromImage(img->scaled(900,900,Qt::KeepAspectRatio,Qt::FastTransformation));
    48. label->setPixmap(map);
    49. label->showFullScreen();
    50. label->show();
    51.  
    52. QTimer::singleShot(10000,this,SLOT(slot3()));
    53. }
    54. void Widget::slot3()
    55. {
    56. QImage *img = new QImage("/home/ishwarya/displayimages/local/4.jpeg");
    57. label=new QLabel(this);
    58. QPixmap map = QPixmap::fromImage(img->scaled(900,900,Qt::KeepAspectRatio,Qt::FastTransformation));
    59. label->setPixmap(map);
    60. label->showFullScreen();
    61. label->show();
    62.  
    63. QTimer::singleShot(10000,this,SLOT(slot4()));
    64. }
    65. void Widget::slot4()
    66. {
    67. showFullScreen();
    68. activateWindow();
    69. update();
    70. QImage *img = new QImage("/home/ishwarya/displayimages/local/5.jpeg");
    71. label=new QLabel(this);
    72. QPixmap map = QPixmap::fromImage(img->scaled(900,900,Qt::KeepAspectRatio,Qt::FastTransformation));
    73. label->setPixmap(map);
    74. label->showFullScreen();
    75. label->show();
    76.  
    77. QTimer::singleShot(10000,this,SLOT(slot5()));
    78.  
    79. }
    80.  
    81. void Widget::slot5()
    82. {
    83. QImage *img = new QImage("/home/ishwarya/displayimages/local/6.jpeg");
    84. label=new QLabel(this);
    85. QPixmap map = QPixmap::fromImage(img->scaled(900,900,Qt::KeepAspectRatio,Qt::FastTransformation));
    86. label->setPixmap(map);
    87. label->showFullScreen();
    88. label->show();
    89.  
    90. QTimer::singleShot(10000,this,SLOT(slot6()));
    91. }
    92.  
    93. void Widget::slot6()
    94. {
    95. QImage *img = new QImage("/home/ishwarya/displayimages/local/7.jpeg");
    96. label=new QLabel(this);
    97. QPixmap map = QPixmap::fromImage(img->scaled(900,900,Qt::KeepAspectRatio,Qt::FastTransformation));
    98. label->setPixmap(map);
    99. label->showFullScreen();
    100. label->show();
    101.  
    102. QTimer::singleShot(10000,this,SLOT(slot7()));
    103.  
    104. }
    105.  
    106. void Widget::slot7()
    107.  
    108. {
    109. showFullScreen();
    110. activateWindow();
    111. update();
    112. QImage *img = new QImage("/home/ishwarya/displayimages/local/8.jpeg");
    113. label=new QLabel(this);
    114. QPixmap map = QPixmap::fromImage(img->scaled(900,900,Qt::KeepAspectRatio,Qt::FastTransformation));
    115. label->setPixmap(map);
    116. label->showFullScreen();
    117. label->show();
    118.  
    119. QTimer::singleShot(10000,this,SLOT(slot8()));
    120.  
    121. }
    122.  
    123. void Widget::slot8()
    124. {
    125. QImage *img = new QImage("/home/ishwarya/displayimages/local/9.jpeg");
    126. label=new QLabel(this);
    127. QPixmap map = QPixmap::fromImage(img->scaled(900,900,Qt::KeepAspectRatio,Qt::FastTransformation));
    128. label->setPixmap(map);
    129. label->showFullScreen();
    130. label->show();
    131.  
    132. QTimer::singleShot(10000,this,SLOT(slot9()));
    133. }
    134. void Widget::slot9()
    135. {
    136. showFullScreen();
    137. activateWindow();
    138. update();
    139. QImage *img = new QImage("/home/ishwarya/displayimages/local/10.jpeg");
    140. label=new QLabel(this);
    141. QPixmap map = QPixmap::fromImage(img->scaled(900,900,Qt::KeepAspectRatio,Qt::FastTransformation));
    142. label->setPixmap(map);
    143. label->showFullScreen();
    144. label->show();
    145.  
    146. QTimer::singleShot(10000,this,SLOT(slot10()));
    147. }
    148. void Widget::slot10()
    149. {
    150. QImage *img = new QImage("/home/ishwarya/displayimages/local/11.jpeg");
    151. label=new QLabel(this);
    152. QPixmap map = QPixmap::fromImage(img->scaled(900,900,Qt::KeepAspectRatio,Qt::FastTransformation));
    153. label->setPixmap(map);
    154. label->showFullScreen();
    155. label->show();
    156.  
    157. QTimer::singleShot(10000,this,SLOT(slot11()));
    158.  
    159. }
    160.  
    161. void Widget::slot11()
    162. {
    163. QImage *img = new QImage("/home/ishwarya/displayimages/local/12.jpeg");
    164. label=new QLabel(this);
    165. QPixmap map = QPixmap::fromImage(img->scaled(900,900,Qt::KeepAspectRatio,Qt::FastTransformation));
    166. label->setPixmap(map);
    167. label->showFullScreen();
    168. label->show();
    169.  
    170. QTimer::singleShot(10000,this,SLOT(slot12()));
    171. }
    172.  
    173. void Widget::slot12()
    174. {
    175. QImage *img = new QImage("/home/ishwarya/displayimages/local/13.jpeg");
    176. label=new QLabel(this);
    177. QPixmap map = QPixmap::fromImage(img->scaled(900,900,Qt::KeepAspectRatio,Qt::FastTransformation));
    178. label->setPixmap(map);
    179. label->showFullScreen();
    180. label->show();
    181.  
    182. QTimer::singleShot(10000,this,SLOT(slot13()));
    183.  
    184. }
    185. void Widget::slot13()
    186. {
    187. showFullScreen();
    188. activateWindow();
    189. update();
    190. QImage *img = new QImage("/home/ishwarya/displayimages/local/14.jpeg");
    191. label=new QLabel(this);
    192. QPixmap map = QPixmap::fromImage(img->scaled(900,900,Qt::KeepAspectRatio,Qt::FastTransformation));
    193. label->setPixmap(map);
    194. label->showFullScreen();
    195. label->show();
    196.  
    197. QTimer::singleShot(10000,this,SLOT(slot14()));
    198. }
    199. void Widget::slot14()
    200. {
    201. QImage *img = new QImage("/home/ishwarya/displayimages/local/15.jpeg");
    202. label=new QLabel(this);
    203. QPixmap map = QPixmap::fromImage(img->scaled(900,900,Qt::KeepAspectRatio,Qt::FastTransformation));
    204. label->setPixmap(map);
    205. label->showFullScreen();
    206. label->show();
    207.  
    208. QTimer::singleShot(10000,this,SLOT(slot15()));
    209.  
    210. }
    211.  
    212. void Widget::slot15()
    213. {
    214. QImage *img = new QImage("/home/ishwarya/displayimages/local/16.jpeg");
    215. label=new QLabel(this);
    216. QPixmap map = QPixmap::fromImage(img->scaled(900,900,Qt::KeepAspectRatio,Qt::FastTransformation));
    217. label->setPixmap(map);
    218. label->showFullScreen();
    219. label->show();
    220.  
    221. QTimer::singleShot(10000,this,SLOT(slot16()));
    222. }
    223.  
    224. void Widget::slot16()
    225. {
    226.  
    227. QImage *img = new QImage("/home/ishwarya/displayimages/local/17.jpeg");
    228. label=new QLabel(this);
    229. QPixmap map = QPixmap::fromImage(img->scaled(900,900,Qt::KeepAspectRatio,Qt::FastTransformation));
    230. label->setPixmap(map);
    231. label->showFullScreen();
    232. label->show();
    233.  
    234. QTimer::singleShot(10000,this,SLOT(slot17()));
    235.  
    236. }
    237. void Widget::slot17()
    238. {
    239. showFullScreen();
    240. activateWindow();
    241. update();
    242. QImage *img = new QImage("/home/ishwarya/displayimages/local/18.jpeg");
    243. label=new QLabel(this);
    244. QPixmap map = QPixmap::fromImage(img->scaled(900,900,Qt::KeepAspectRatio,Qt::FastTransformation));
    245. label->setPixmap(map);
    246. label->showFullScreen();
    247. label->show();
    248.  
    249. QTimer::singleShot(10000,this,SLOT(slot18()));
    250.  
    251. }
    252. void Widget::slot18()
    253. {
    254.  
    255. QImage *img = new QImage("/home/ishwarya/displayimages/local/19.jpeg");
    256. label=new QLabel(this);
    257. QPixmap map = QPixmap::fromImage(img->scaled(900,900,Qt::KeepAspectRatio,Qt::FastTransformation));
    258. label->setPixmap(map);
    259. label->showFullScreen();
    260. label->show();
    261.  
    262. QTimer::singleShot(10000,this,SLOT(slot19()));
    263.  
    264. }
    265. void Widget::slot19()
    266. {
    267.  
    268. QImage *img = new QImage("/home/ishwarya/displayimages/local/20.jpeg");
    269. label=new QLabel(this);
    270. QPixmap map = QPixmap::fromImage(img->scaled(900,900,Qt::KeepAspectRatio,Qt::FastTransformation));
    271. label->setPixmap(map);
    272. label->showFullScreen();
    273. label->show();
    274.  
    275. QTimer::singleShot(10000,this,SLOT(slot20()));
    276.  
    277. }
    278. void Widget::slot20()
    279. {
    280. showFullScreen();
    281. activateWindow();
    282. update();
    283. QImage *img = new QImage("/home/ishwarya/displayimages/remote/1.jpeg");
    284. label=new QLabel(this);
    285. QPixmap map = QPixmap::fromImage(img->scaled(900,900,Qt::KeepAspectRatio,Qt::FastTransformation));
    286. label->setPixmap(map);
    287. label->showFullScreen();
    288. label->show();
    289.  
    290. QTimer::singleShot(10000,this,SLOT(slot1()));
    291.  
    292. }
    293.  
    294.  
    295. void Widget::mousePressEvent(QMouseEvent *event)
    296. {
    297. if(event->button()==Qt::LeftButton || Qt::RightButton)
    298. {
    299.  
    300. showMaximized();
    301. activateWindow();
    302. update();
    303. QTimer::singleShot(delay1,this,SLOT(repaint()));
    304.  
    305. }
    306.  
    307. }
    To copy to clipboard, switch view to plain text mode 
    Last edited by anda_skoa; 4th December 2014 at 13:55. Reason: missing [code] tags

Similar Threads

  1. a set of images slide show on a single QLabel
    By lyw8120 in forum Qt Programming
    Replies: 9
    Last Post: 17th March 2014, 14:19
  2. Slide show using QProperty animation
    By mvbhavsar in forum Newbie
    Replies: 0
    Last Post: 10th August 2011, 11:24
  3. slide of frames
    By vinayaka in forum Newbie
    Replies: 3
    Last Post: 18th July 2011, 07:50
  4. How to create a slide-out window ?
    By ada10 in forum Newbie
    Replies: 18
    Last Post: 12th August 2010, 08:49
  5. slide show
    By jeetu_happy in forum Qt Programming
    Replies: 3
    Last Post: 18th January 2007, 13:21

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.