put in your mainwindow.h:
#include <QPushButton> //delete this line
#include <QPushButton> //delete this line
class QPushButton;
class QLabel;
To copy to clipboard, switch view to plain text mode
then declare private section:
private:
private:
QLabel *FirstLabel;
QLabel *SecondLabel;
QLabel *ThirdLabel;
To copy to clipboard, switch view to plain text mode
in mainwidow.cpp
FirstLabel
= new QLabel(this);
FirstLabel->move(0,240);
FirstLabel->resize(this->x()+400,this->y()+240);
FirstLabel->show();
train_button->setText(tr("something"));
train_button->move(200,200);
train_button->show();
connect(train_button, SIGNAL(clicked()),
this, SLOT (PlayImage()));
void MainWindow::PlayImage()
{
//char* picture[5] = {"D://1.png","D://2.jpg","D://3.jpg","D://4.jpg","D://5.jpg"};
QStringList picture
= {"D://1.png",
"D://2.jpg",
"D://3.jpg",
"D://4.jpg",
"D://5.jpg"};
for(int i = 0;i<=picture.count() ; i++){
FirstLabel->setPixmap(pixmapObject);
update(); //What is it?
}
}
FirstLabel = new QLabel(this);
FirstLabel->move(0,240);
FirstLabel->resize(this->x()+400,this->y()+240);
FirstLabel->show();
train_button = new QPushButton(this);
train_button->setText(tr("something"));
train_button->move(200,200);
train_button->show();
connect(train_button, SIGNAL(clicked()),
this, SLOT (PlayImage()));
void MainWindow::PlayImage()
{
//char* picture[5] = {"D://1.png","D://2.jpg","D://3.jpg","D://4.jpg","D://5.jpg"};
QStringList picture = {"D://1.png","D://2.jpg","D://3.jpg","D://4.jpg","D://5.jpg"};
for(int i = 0;i<=picture.count() ; i++){
QPixmap pixmapObject(picture[i]);
FirstLabel->setPixmap(pixmapObject);
update(); //What is it?
}
}
To copy to clipboard, switch view to plain text mode
Bookmarks