困扰我很久的QT问题三
之前搞了很久没搞出来,原来是路径错了,233…,欢迎交流指正。
一、效果
二、主要实现
//主要就是用了个定时器
connect(start_button, SIGNAL(clicked()), this, SLOT(startViewImg()));
connect(timer_time, SIGNAL(timeout()), this, SLOT(getImgIndex()));
connect(timer_time, SIGNAL(timeout()), this, SLOT(showMoveImg()));
......//省略了一些没写的代码
void ShowImg::startViewImg()
{
timer_time->start();
return;
}
void ShowImg::showMoveImg()
{
showFilePath_lineedit->setText(showfilePath);
img_pix.load(showfilePath);
img_pix = img_pix.scaled(INTERFACE_WIDTH /2,INTERFACE_HEIGHT/2,Qt::KeepAspectRatio,Qt::SmoothTransformation);
showImg_label->setAlignment(Qt::AlignCenter);
showImg_label->setPixmap(img_pix);
timer_time->start(1000);//showImg_label上的